UNPKG

npaw-plugin

Version:
2 lines 613 kB
/*! For license information please see NpawPlugin.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NpawPlugin=t():e.NpawPlugin=t()}(self,()=>(()=>{var e={61:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>s});class s{}s.Products={VIDEO_ANALYTICS:"videoAnalytics",BALANCER:"balancer",DEVICE_ANALYTICS:"deviceAnalytics"},s.AnalyticsVariables={VIEW_CODE:"viewCode",METHOD_OPTION:"methodOption"},s.BalancerVariables={AS_ENABLED:"activeSwitchingEnabled",PROFILE_NAME:"profileName",BUCKET:"bucket",DECISION_FINISHED:"decisionFinished",LAST_USED_CDN:"lastUsedCdn",BALANCER_TRAFFIC:"balancerTraffic",BALANCER_BITRATE:"balancerBitrate"},s.Consumer={NQS:"NQS",PERSISTENT:"PERSISTENT",BLACK_HOLE:"BLACK_HOLE"},s.DeviceVariables={APP_ANALYTICS_DEVICE_STRING:"deviceString"}},108:(e,t,i)=>{"use strict";var s;i.d(t,{A:()=>r});class n{}s=n,n.VideoService={INIT:"/init",START:"/start",JOIN:"/joinTime",PAUSE:"/pause",RESUME:"/resume",SEEK:"/seek",BUFFER:"/bufferUnderrun",ERROR:"/error",STOP:"/stop",PING:"/ping",DATA_OBJECT:"/data"},n.Service=Object.assign(Object.assign({DATA:"/data",ADAPTERS:"/adapters",CONFIGURATION:"/configuration",APP_ANALYTICS_PLUGIN_LOGS:"/infinity/session/pluginLogs",VIDEO_PLUGIN_LOGS:"/infinity/video/pluginLogs"},s.VideoService),{CDN:"/cdn",VIDEO_EVENT:"/infinity/video/event",AD_INIT:"/adInit",AD_START:"/adStart",AD_JOIN:"/adJoin",AD_PAUSE:"/adPause",AD_RESUME:"/adResume",AD_BUFFER:"/adBufferUnderrun",AD_STOP:"/adStop",AD_CLICK:"/adClick",AD_ERROR:"/adError",AD_MANIFEST:"/adManifest",AD_POD_START:"/adBreakStart",AD_POD_STOP:"/adBreakStop",AD_QUARTILE:"/adQuartile",EVENT:"/infinity/session/event",SESSION_START:"/infinity/session/start",SESSION_STOP:"/infinity/session/stop",NAV:"/infinity/session/nav",BEAT:"/infinity/session/beat",OFFLINE_EVENTS:"/offlineEvents"});const r=n},245:(e,t,i)=>{var s=i(3948).extend({constructor:function(e){this.plugin=e},getAllData:function(){var e=this.getNonRandomData();return e.timestamp=this.getTimestamp(),e},getNonRandomData:function(){var e={};return e.userAgent=this.getUserAgent(),e.threads=this.getVirtualCores(),e.language=this.getLanguage(),e.langList=this.getAvailableLanguages(),e.resolution=this.getResolution(),e.colorDepth=this.getColorDepth(),e.deviceMemory=this.getMemory(),e.touchscreen=this.getTouchscreen(),e.localStorage=this.getLocalStorage(),e.sessionStorage=this.getSessionStorage(),e.cookiesAvailable=this.getCookiesAvailable(),e.flashAvailable=this.getHasFlash(),e.timeZone=this.getTimeZone(),e.plugins=this.getPluginList(),e},getUserAgent:function(){return this._getNavigatorValue("userAgent")},getVirtualCores:function(){return this._getNavigatorValue("hardwareConcurrency")},getLanguage:function(){return this._getNavigatorValue("language")},getAvailableLanguages:function(){return this._getNavigatorValue("languages")},getResolution:function(){var e=null;try{this._getNavigatorValue("screen")&&(e=navigator.screen.width.toString()+navigator.screen.height.toString())}catch(e){}return e},getColorDepth:function(){var e=null;try{this._getNavigatorValue("screen")&&(e=navigator.screen.colorDepth)}catch(e){}return e},getMemory:function(){return this._getNavigatorValue("deviceMemory")},getTouchscreen:function(){return this._getNavigatorValue("maxTouchPoints")||!1},getLocalStorage:function(){var e=!1;try{e="undefined"!=typeof localStorage}catch(e){}return e},getSessionStorage:function(){var e=!1;try{e="undefined"!=typeof sessionStorage}catch(e){}return e},getCookiesAvailable:function(){return this._getNavigatorValue("cookieEnabled")||!1},getHasFlash:function(){var e=!1;try{var t=this._getNavigatorValue("plugins");e=t&&"object"==typeof t["Shockwave Flash"]||"undefined"!=typeof window&&window.ActiveXObject&&!1!==new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}return e},getPluginList:function(){var e=null;try{var t=this._getNavigatorValue("plugins");if(t&&0!==t.length){for(var i="",s=0;s<navigator.plugins.length;s++)i+=navigator.plugins[s].description+" "+navigator.plugins[s].filename+" "+navigator.plugins[s].name+" ";e=i}}catch(e){}return e},getTimeZone:function(){var e=null;try{e=(new Date).getTimezoneOffset().toString()}catch(e){}return e},getTimestamp:function(){return(new Date).getTime()},_navigatorCheck:function(){return"undefined"!=typeof navigator},_getNavigatorValue:function(e){var t=null;try{this._navigatorCheck()&&(t=navigator[e])}catch(e){}return t}});e.exports=s},470:(e,t,i)=>{var s=i(3948);const{default:n}=i(7276),{AnalyticsTag:r}=i(2784);var a=s.extend({constructor:function(e,t,i,s){this.prefix=e||"npaw",this.disableCookies=t,this.forceCookies=i,this.disabled=s},updateStorageOptions:function(e,t,i){this.disableCookies=e,this.forceCookies=t,this.disabled=i},isEnabled:function(){if(this.disabled)return!1;var e=!0;if(!this.forceCookies)try{localStorage.setItem(this.prefix+".test","true"),localStorage.removeItem(this.prefix+".test")}catch(t){e=!1}return e},setLocal:function(e,t){if(this.disabled)return null;var i=null;try{!this.forceCookies&&("undefined"!=typeof localStorage&&localStorage||this.disableCookies)?"undefined"!=typeof localStorage&&localStorage&&(i=localStorage.setItem(this.prefix+"."+e,t)):i=this._setCookie(this.prefix+".local."+e,t)}catch(e){n.error(r,"Npaw App Analytics needs localStorage or cookies, not supported by your browser.")}return i},getLocal:function(e){return this.disabled?null:this._localGetRemove("getItem","_getCookie",e)},removeLocal:function(e){return this.disabled?null:this._localGetRemove("removeItem","_removeCookie",e)},_localGetRemove:function(e,t,i){var s=null;try{!this.forceCookies&&("undefined"!=typeof localStorage&&localStorage||this.disableCookies)?"undefined"!=typeof localStorage&&localStorage&&(s=localStorage[e](this.prefix+"."+i)):s=this[t](this.prefix+".local."+i)}catch(e){n.error(r,"Npaw App Analytics needs localStorage or cookies, not supported by your browser.")}return s},setSession:function(e,t){if(this.disabled)return null;var i=null;try{i=!this.forceCookies&&("undefined"!=typeof sessionStorage&&sessionStorage||this.disableCookies)?sessionStorage.setItem(this.prefix+"."+e,t):this._setCookie(this.prefix+".session."+e,t)}catch(e){n.error(r,"Npaw App Analytics needs sessionStorage or cookies, not supported by your browser.")}return i},getSession:function(e){return this.disabled?null:this._sessionGetRemove("getItem","_getCookie",e)},removeSession:function(e){return this.disabled?null:this._sessionGetRemove("removeItem","_removeCookie",e)},_sessionGetRemove:function(e,t,i){var s=null;try{s=!this.forceCookies&&("undefined"!=typeof sessionStorage&&sessionStorage||this.disableCookies)?sessionStorage[e](this.prefix+"."+i):this[t](this.prefix+".session."+i)}catch(e){n.error(r,"Npaw App Analytics needs sessionStorage or cookies, not supported by your browser.")}return s},getStorages:function(e){return this.disabled?null:this.getSession(e)||this.getLocal(e)},setStorages:function(e,t){if(this.disabled)return null;this.setSession(e,t),this.setLocal(e,t)},removeStorages:function(e){if(this.disabled)return null;this.removeSession(e),this.removeLocal(e)},_setCookie:function(e,t){if("undefined"!=typeof document){var i=";";"undefined"!=typeof location&&(i+="domain="+location.host.split(".").reverse().splice(0,2).reverse().join(".")+";path=/;"),document.cookie=e+"="+t+i}},_getCookie:function(e){if("undefined"!=typeof document)for(var t=e+"=",i=decodeURIComponent(document.cookie).split(";"),s=0;s<i.length;s++){for(var n=i[s];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return null},_removeCookie:function(e){this._setCookie(e,"")}});e.exports=a},525:(e,t)=>{"use strict";function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var s=i({HTML:"text/html",isHTML:function(e){return e===s.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),n=i({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===n.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var s=0;s<e.length;s++)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];if(t.call(void 0,n,s,e))return n}},t.freeze=i,t.MIME_TYPE=s,t.NAMESPACE=n},563:e=>{e.exports={cdnName:"FASTLY",parsers:[{element:"host",headerName:"X-Served-By",regex:/([^,\s]+)$/},{element:"type",headerName:"X-Cache",regex:/([^,\s]+)$/}],parseType:function(e){switch(e){case"HIT":return 1;case"MISS":return 2;default:return 0}}}},594:(e,t,i)=>{var s=i(7086);const{default:n}=i(7276),{AnalyticsTag:r}=i(2784);var a={getPlayrate:function(){return this.flags.isPaused?0:1},getFramesPerSecond:function(){},getDroppedFrames:function(){},getThroughput:function(){},getRendition:function(){},getTitle2:function(){},getIsLive:function(){},getCdnTraffic:function(){},getP2PTraffic:function(){},getUploadTraffic:function(){},getIsP2PEnabled:function(){},getSegmentDuration:function(){},getHouseholdId:function(){},getLatency:function(){},getPacketLoss:function(){},getPacketSent:function(){},getMetrics:function(){},getAudioCodec:function(){},getVideoCodec:function(){},setUrlToParse:function(e){this._urlToParse=e},getURLToParse:function(){return this._urlToParse||void 0},fireSeekBegin:function(e,t,i){if(this._discardFalseBuffers(),!(this.getVideo()&&this.getVideo().getIsLive()&&this.plugin.options["content.isLive.noSeek"])&&this.flags.isJoined&&!this.flags.isSeeking){if(this.flags.isBuffering){if(!1===t)return;n.notice(r,"Converting current buffer to seek"),this.chronos.seek=this.chronos.buffer.clone(),this.chronos.buffer.reset(),this.flags.isBuffering=!1}else this.chronos.seek.start();try{this.fireEventsStruct.seek=[],i?this.fireEventsStruct.seek.push(i):this.fireEventsStruct.seek.push("undefinedEvent")}catch(e){}this.flags.isSeeking=!0,this.emit(s.Event.SEEK_BEGIN,{params:e})}},fireSeekEnd:function(e,t){if(!(this.getVideo()&&this.getVideo().getIsLive()&&this.plugin.options["content.isLive.noSeek"])&&this.flags.isJoined&&this.flags.isSeeking){try{t?this.fireEventsStruct.seek.push(t):this.fireEventsStruct.seek.push("undefinedEvent")}catch(e){}(e=e||{}).triggeredEvents=this.fireEventsStruct.seek,this.cancelSeek(),this.emit(s.Event.SEEK_END,{params:e});try{this.chronos.pause.getDeltaTime(!1)>0&&this.chronos.pause.resume()}catch(e){}}},cancelSeek:function(e){this.flags.isJoined&&this.flags.isSeeking&&(this.flags.isSeeking=!1,this.chronos.seek.stop(),this.monitor&&this.monitor.skipNextTick())},fireEvent:function(e,t,i,n,r){if("data"===e)this.emit(s.Event.DATA_OBJECT,{params:n});else{var a=n||{};a.name=e||"",a.dimensions=t||{},a.values=i||{},r&&(a.hasEndDatetime=r||!1),this.emit(s.Event.VIDEO_EVENT,{params:a})}},fireEventEnd:function(e){var t={};t.name=e||"",this.emit(s.Event.VIDEO_EVENT_END,{params:t})},storeNewRendition:function(e){this.getVideo().triggerUpdateRendition(e)}};e.exports=a},703:e=>{e.exports={Preroll:"pre",Midroll:"mid",Postroll:"post"}},825:e=>{e.exports={WILL_SEND_LOG_PLUGIN_INIT:"will-send-log-plugin-init",WILL_SEND_LOG_PLUGIN_SET_OPTIONS:"will-send-log-plugin-set-options",WILL_SEND_LOG_PLUGIN_RECEIVE_DATA:"will-send-log-plugin-receive-data",WILL_SEND_LOG_INFINITY_BEGIN:"will-send-log-infinity-begin",WILL_SEND_LOG_INFINITY_START:"will-send-log-infinity-start",WILL_SEND_LOG_INFINITY_EVENT:"will-send-log-infinity-event",WILL_SEND_LOG_INFINITY_EVENT_END:"will-send-log-infinity-event-end",WILL_SEND_LOG_INFINITY_NAV:"will-send-log-infinity-nav",WILL_SEND_LOG_INFINITY_NEW_SESSION:"will-send-log-infinity-new-session"}},1048:(e,t,i)=>{"use strict";const s=i(7991),n=i(9318),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return d(e,t,i)}function d(e,t,i){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const i=0|g(e,t);let s=o(i);const n=s.write(e,t);return n!==i&&(s=s.slice(0,n)),s}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(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(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer))return p(e,t,i);if("undefined"!=typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return p(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const s=e.valueOf&&e.valueOf();if(null!=s&&s!==e)return c.from(s,t,i);const n=function(e){if(c.isBuffer(e)){const t=0|f(e.length),i=o(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?o(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(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 u(e){return l(e),o(e<0?0:0|f(e))}function h(e){const t=e.length<0?0:0|f(e.length),i=o(t);for(let s=0;s<t;s+=1)i[s]=255&e[s];return i}function p(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let s;return s=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),Object.setPrototypeOf(s,c.prototype),s}function f(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(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 i=e.length,s=arguments.length>2&&!0===arguments[2];if(!s&&0===i)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Y(e).length;default:if(n)return s?-1:W(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,i){let s=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,i);case"utf8":case"utf-8":return I(this,t,i);case"ascii":return N(this,t,i);case"latin1":case"binary":return D(this,t,i);case"base64":return _(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,i);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function v(e,t,i){const s=e[t];e[t]=e[i],e[i]=s}function y(e,t,i,s,n){if(0===e.length)return-1;if("string"==typeof i?(s=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),J(i=+i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=c.from(t,s)),c.isBuffer(t))return 0===t.length?-1:T(e,t,i,s,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):T(e,[t],i,s,n);throw new TypeError("val must be string, number or Buffer")}function T(e,t,i,s,n){let r,a=1,o=e.length,c=t.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,i/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){let s=-1;for(r=i;r<o;r++)if(d(e,r)===d(t,-1===s?0:r-s)){if(-1===s&&(s=r),r-s+1===c)return s*a}else-1!==s&&(r-=r-s),s=-1}else for(i+c>o&&(i=o-c),r=i;r>=0;r--){let i=!0;for(let s=0;s<c;s++)if(d(e,r+s)!==d(t,s)){i=!1;break}if(i)return r}return-1}function S(e,t,i,s){i=Number(i)||0;const n=e.length-i;s?(s=Number(s))>n&&(s=n):s=n;const r=t.length;let a;for(s>r/2&&(s=r/2),a=0;a<s;++a){const s=parseInt(t.substr(2*a,2),16);if(J(s))return a;e[i+a]=s}return a}function E(e,t,i,s){return K(W(t,e.length-i),e,i,s)}function b(e,t,i,s){return K(function(e){const t=[];for(let i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,s)}function A(e,t,i,s){return K(Y(t),e,i,s)}function w(e,t,i,s){return K(function(e,t){let i,s,n;const r=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),s=i>>8,n=i%256,r.push(n),r.push(s);return r}(t,e.length-i),e,i,s)}function _(e,t,i){return 0===t&&i===e.length?s.fromByteArray(e):s.fromByteArray(e.slice(t,i))}function I(e,t,i){i=Math.min(e.length,i);const s=[];let n=t;for(;n<i;){const t=e[n];let r=null,a=t>239?4:t>223?3:t>191?2:1;if(n+a<=i){let i,s,o,c;switch(a){case 1:t<128&&(r=t);break;case 2:i=e[n+1],128==(192&i)&&(c=(31&t)<<6|63&i,c>127&&(r=c));break;case 3:i=e[n+1],s=e[n+2],128==(192&i)&&128==(192&s)&&(c=(15&t)<<12|(63&i)<<6|63&s,c>2047&&(c<55296||c>57343)&&(r=c));break;case 4:i=e[n+1],s=e[n+2],o=e[n+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(c=(15&t)<<18|(63&i)<<12|(63&s)<<6|63&o,c>65535&&c<1114112&&(r=c))}}null===r?(r=65533,a=1):r>65535&&(r-=65536,s.push(r>>>10&1023|55296),r=56320|1023&r),s.push(r),n+=a}return function(e){const t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let i="",s=0;for(;s<t;)i+=String.fromCharCode.apply(String,e.slice(s,s+=P));return i}(s)}c.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}}(),c.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,i){return d(e,t,i)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,i){return function(e,t,i){return l(e),e<=0?o(e):void 0!==t?"string"==typeof i?o(e).fill(t,i):o(e).fill(t):o(e)}(e,t,i)},c.allocUnsafe=function(e){return u(e)},c.allocUnsafeSlow=function(e){return u(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,s=t.length;for(let n=0,r=Math.min(i,s);n<r;++n)if(e[n]!==t[n]){i=e[n],s=t[n];break}return i<s?-1:s<i?1:0},c.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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const s=c.allocUnsafe(t);let n=0;for(i=0;i<e.length;++i){let t=e[i];if(z(t,Uint8Array))n+t.length>s.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(s,n)):Uint8Array.prototype.set.call(s,t,n);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(s,n)}n+=t.length}return s},c.byteLength=g,c.prototype._isBuffer=!0,c.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)v(this,t,t+1);return this},c.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)v(this,t,t+3),v(this,t+1,t+2);return this},c.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)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const i=t.IS;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(e,t,i,s,n){if(z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.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===i&&(i=e?e.length:0),void 0===s&&(s=0),void 0===n&&(n=this.length),t<0||i>e.length||s<0||n>this.length)throw new RangeError("out of range index");if(s>=n&&t>=i)return 0;if(s>=n)return-1;if(t>=i)return 1;if(this===e)return 0;let r=(n>>>=0)-(s>>>=0),a=(i>>>=0)-(t>>>=0);const o=Math.min(r,a),d=this.slice(s,n),l=e.slice(t,i);for(let e=0;e<o;++e)if(d[e]!==l[e]){r=d[e],a=l[e];break}return r<a?-1:a<r?1:0},c.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},c.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},c.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},c.prototype.write=function(e,t,i,s){if(void 0===t)s="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)s=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===s&&(s="utf8")):(s=i,i=void 0)}const n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let r=!1;for(;;)switch(s){case"hex":return S(this,e,t,i);case"utf8":case"utf-8":return E(this,e,t,i);case"ascii":case"latin1":case"binary":return b(this,e,t,i);case"base64":return A(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,i);default:if(r)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),r=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function N(e,t,i){let s="";i=Math.min(e.length,i);for(let n=t;n<i;++n)s+=String.fromCharCode(127&e[n]);return s}function D(e,t,i){let s="";i=Math.min(e.length,i);for(let n=t;n<i;++n)s+=String.fromCharCode(e[n]);return s}function R(e,t,i){const s=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>s)&&(i=s);let n="";for(let s=t;s<i;++s)n+=Q[e[s]];return n}function L(e,t,i){const s=e.slice(t,i);let n="";for(let e=0;e<s.length-1;e+=2)n+=String.fromCharCode(s[e]+256*s[e+1]);return n}function C(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,i,s,n,r){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<r)throw new RangeError('"value" argument is out of bounds');if(i+s>e.length)throw new RangeError("Index out of range")}function B(e,t,i,s,n){X(t,s,n,e,i,7);let r=Number(t&BigInt(4294967295));e[i++]=r,r>>=8,e[i++]=r,r>>=8,e[i++]=r,r>>=8,e[i++]=r;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a,a>>=8,e[i++]=a,i}function k(e,t,i,s,n){X(t,s,n,e,i,7);let r=Number(t&BigInt(4294967295));e[i+7]=r,r>>=8,e[i+6]=r,r>>=8,e[i+5]=r,r>>=8,e[i+4]=r;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a>>=8,e[i+2]=a,a>>=8,e[i+1]=a,a>>=8,e[i]=a,i+8}function x(e,t,i,s,n,r){if(i+s>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function M(e,t,i,s,r){return t=+t,i>>>=0,r||x(e,0,i,4),n.write(e,t,i,s,23,4),i+4}function V(e,t,i,s,r){return t=+t,i>>>=0,r||x(e,0,i,8),n.write(e,t,i,s,52,8),i+8}c.prototype.slice=function(e,t){const i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);const s=this.subarray(e,t);return Object.setPrototypeOf(s,c.prototype),s},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);let s=this[e],n=1,r=0;for(;++r<t&&(n*=256);)s+=this[e+r]*n;return s},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);let s=this[e+--t],n=1;for(;t>0&&(n*=256);)s+=this[e+--t]*n;return s},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=$(function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||G(e,this.length-8);const s=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+i*2**24;return BigInt(s)+(BigInt(n)<<BigInt(32))}),c.prototype.readBigUInt64BE=$(function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||G(e,this.length-8);const s=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+i;return(BigInt(s)<<BigInt(32))+BigInt(n)}),c.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);let s=this[e],n=1,r=0;for(;++r<t&&(n*=256);)s+=this[e+r]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},c.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||C(e,t,this.length);let s=t,n=1,r=this[e+--s];for(;s>0&&(n*=256);)r+=this[e+--s]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*t)),r},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=$(function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||G(e,this.length-8);const s=this[e+4]+256*this[e+5]+65536*this[e+6]+(i<<24);return(BigInt(s)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=$(function(e){H(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||G(e,this.length-8);const s=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(s)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+i)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,i,s){e=+e,t>>>=0,i>>>=0,s||O(this,e,t,i,Math.pow(2,8*i)-1,0);let n=1,r=0;for(this[t]=255&e;++r<i&&(n*=256);)this[t+r]=e/n&255;return t+i},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,i,s){e=+e,t>>>=0,i>>>=0,s||O(this,e,t,i,Math.pow(2,8*i)-1,0);let n=i-1,r=1;for(this[t+n]=255&e;--n>=0&&(r*=256);)this[t+n]=e/r&255;return t+i},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||O(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||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},c.prototype.writeBigUInt64LE=$(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(function(e,t=0){return k(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,i,s){if(e=+e,t>>>=0,!s){const s=Math.pow(2,8*i-1);O(this,e,t,i,s-1,-s)}let n=0,r=1,a=0;for(this[t]=255&e;++n<i&&(r*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/r|0)-a&255;return t+i},c.prototype.writeIntBE=function(e,t,i,s){if(e=+e,t>>>=0,!s){const s=Math.pow(2,8*i-1);O(this,e,t,i,s-1,-s)}let n=i-1,r=1,a=0;for(this[t+n]=255&e;--n>=0&&(r*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/r|0)-a&255;return t+i},c.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||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},c.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||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},c.prototype.writeBigInt64LE=$(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(e,t=0){return k(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,i){return M(this,e,t,!0,i)},c.prototype.writeFloatBE=function(e,t,i){return M(this,e,t,!1,i)},c.prototype.writeDoubleLE=function(e,t,i){return V(this,e,t,!0,i)},c.prototype.writeDoubleBE=function(e,t,i){return V(this,e,t,!1,i)},c.prototype.copy=function(e,t,i,s){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),s||0===s||(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<i&&(s=i),s===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-i&&(s=e.length-t+i);const n=s-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,s):Uint8Array.prototype.set.call(e,this.subarray(i,s),t),n},c.prototype.fill=function(e,t,i,s){if("string"==typeof e){if("string"==typeof t?(s=t,t=0,i=this.length):"string"==typeof i&&(s=i,i=this.length),void 0!==s&&"string"!=typeof s)throw new TypeError("encoding must be a string");if("string"==typeof s&&!c.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(1===e.length){const t=e.charCodeAt(0);("utf8"===s&&t<128||"latin1"===s)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;let n;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(n=t;n<i;++n)this[n]=e;else{const r=c.isBuffer(e)?e:c.from(e,s),a=r.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<i-t;++n)this[n+t]=r[n%a]}return this};const U={};function q(e,t,i){U[e]=class extends i{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 F(e){let t="",i=e.length;const s="-"===e[0]?1:0;for(;i>=s+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}function X(e,t,i,s,n,r){if(e>i||e<t){const s="bigint"==typeof t?"n":"";let n;throw n=r>3?0===t||t===BigInt(0)?`>= 0${s} and < 2${s} ** ${8*(r+1)}${s}`:`>= -(2${s} ** ${8*(r+1)-1}${s}) and < 2 ** ${8*(r+1)-1}${s}`:`>= ${t}${s} and <= ${i}${s}`,new U.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,i){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+i]||G(t,e.length-(i+1))}(s,n,r)}function H(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,i){if(Math.floor(e)!==e)throw H(e,i),new U.ERR_OUT_OF_RANGE(i||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),q("ERR_OUT_OF_RANGE",function(e,t,i){let s=`The value of "${e}" is out of range.`,n=i;return Number.isInteger(i)&&Math.abs(i)>2**32?n=F(String(i)):"bigint"==typeof i&&(n=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(n=F(n)),n+="n"),s+=` It must be ${t}. Received ${n}`,s},RangeError);const j=/[^+/0-9A-Za-z-_]/g;function W(e,t){let i;t=t||1/0;const s=e.length;let n=null;const r=[];for(let a=0;a<s;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(a+1===s){(t-=3)>-1&&r.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&r.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&r.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function Y(e){return s.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,i,s){let n;for(n=0;n<s&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Q=function(){const e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){const s=16*i;for(let n=0;n<16;++n)t[s+n]=e[i]+e[n]}return t}();function $(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},1083:e=>{e.exports={ClientSide:"csai",ServerSide:"ssai"}},1129:(e,t,i)=>{var s=i(525),n=s.find,r=s.NAMESPACE;function a(e){return""!==e}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function c(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}(e);return Object.keys(t.reduce(o,{}))}function d(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function l(e,t){var i=e.prototype;if(!(i instanceof t)){function s(){}s.prototype=t.prototype,d(i,s=new s),e.prototype=i=s}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var u={},h=u.ELEMENT_NODE=1,p=u.ATTRIBUTE_NODE=2,f=u.TEXT_NODE=3,g=u.CDATA_SECTION_NODE=4,m=u.ENTITY_REFERENCE_NODE=5,v=u.ENTITY_NODE=6,y=u.PROCESSING_INSTRUCTION_NODE=7,T=u.COMMENT_NODE=8,S=u.DOCUMENT_NODE=9,E=u.DOCUMENT_TYPE_NODE=10,b=u.DOCUMENT_FRAGMENT_NODE=11,A=u.NOTATION_NODE=12,w={},_={},I=(w.INDEX_SIZE_ERR=(_[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(_[2]="DOMString size error",2),w.HIERARCHY_REQUEST_ERR=(_[3]="Hierarchy request error",3)),P=(w.WRONG_DOCUMENT_ERR=(_[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(_[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(_[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(_[7]="No modification allowed",7),w.NOT_FOUND_ERR=(_[8]="Not found",8)),N=(w.NOT_SUPPORTED_ERR=(_[9]="Not supported",9),w.INUSE_ATTRIBUTE_ERR=(_[10]="Attribute in use",10));function D(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,_[e]),this.message=_[e],Error.captureStackTrace&&Error.captureStackTrace(this,D);return i.code=e,t&&(this.message=this.message+": "+t),i}function R(){}function L(e,t){this._node=e,this._refresh=t,C(this)}function C(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(Te(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var s=i.length;s in e;s++)Object.prototype.hasOwnProperty.call(e,s)&&delete e[s];d(i,e),e._inc=t}}function O(){}function B(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function k(e,t,i,s){if(s?t[B(t,s)]=i:t[t.length++]=i,e){i.ownerElement=e;var n=e.ownerDocument;n&&(s&&X(n,e,s),function(e,t,i){e&&e._inc++,i.namespaceURI===r.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(n,e,i))}}function x(e,t,i){var s=B(t,i);if(!(s>=0))throw new D(P,new Error(e.tagName+"@"+i));for(var n=t.length-1;s<n;)t[s]=t[++s];if(t.length=n,e){var r=e.ownerDocument;r&&(X(r,e,i),i.ownerElement=null)}}function M(){}function V(){}function U(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function q(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(q(e,t))return!0}while(e=e.nextSibling)}function F(){this.ownerDocument=this}function X(e,t,i,s){e&&e._inc++,i.namespaceURI===r.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function H(e,t,i){if(e&&e._inc){e._inc++;var s=t.childNodes;if(i)s[s.length++]=i;else{for(var n=t.firstChild,r=0;n;)s[r++]=n,n=n.nextSibling;s.length=r,delete s[s.length]}}}function G(e,t){var i=t.previousSibling,s=t.nextSibling;return i?i.nextSibling=s:e.firstChild=s,s?s.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,H(e.ownerDocument,e),t}function j(e){return e&&e.nodeType===V.DOCUMENT_TYPE_NODE}function W(e){return e&&e.nodeType===V.ELEMENT_NODE}function Y(e){return e&&e.nodeType===V.TEXT_NODE}function K(e,t){var i=e.childNodes||[];if(n(i,W)||j(t))return!1;var s=n(i,j);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function z(e,t){var i=e.childNodes||[];if(n(i,function(e){return W(e)&&e!==t}))return!1;var s=n(i,j);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function J(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===V.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||n(r,Y))throw new D(I,"More than one element or text in fragment");if(1===a.length&&!K(e,i))throw new D(I,"Element in fragment can not be inserted before doctype")}if(W(t)&&!K(e,i))throw new D(I,"Only one element can be added and only after doctype");if(j(t)){if(n(s,j))throw new D(I,"Only one doctype is allowed");var o=n(s,W);if(i&&s.indexOf(o)<s.indexOf(i))throw new D(I,"Doctype can only be inserted before an element");if(!i&&o)throw new D(I,"Doctype can not be appended since element is present")}}function Q(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===V.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||n(r,Y))throw new D(I,"More than one element or text in fragment");if(1===a.length&&!z(e,i))throw new D(I,"Element in fragment can not be inserted before doctype")}if(W(t)&&!z(e,i))throw new D(I,"Only one element can be added and only after doctype");if(j(t)){if(n(s,function(e){return j(e)&&e!==i}))throw new D(I,"Only one doctype is allowed");var o=n(s,W);if(i&&s.indexOf(o)<s.indexOf(i))throw new D(I,"Doctype can only be inserted before an element")}}function $(e,t,i,s){(function(e,t,i){if(!function(e){return e&&(e.nodeType===V.DOCUMENT_NODE||e.nodeType===V.DOCUMENT_FRAGMENT_NODE||e.nodeType===V.ELEMENT_NODE)}(e))throw new D(I,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new D(P,"child not in parent");if(!function(e){return e&&(W(e)||Y(e)||j(e)||e.nodeType===V.DOCUMENT_FRAGMENT_NODE||e.nodeType===V.COMMENT_NODE||e.nodeType===V.PROCESSING_INSTRUCTION_NODE)}(t)||j(t)&&e.nodeType!==V.DOCUMENT_NODE)throw new D(I,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,i),e.nodeType===V.DOCUMENT_NODE&&(s||J)(e,t,i);var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===b){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var o=i?i.previousSibling:e.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e,Z(r,e.ownerDocument||e)}while(r!==a&&(r=r.nextSibling));return H(e.ownerDocument||e,e),t.nodeType==b&&(t.firstChild=t.lastChild=null),t}function Z(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===h&&e.attributes)for(var i=0;i<e.attributes.length;i++){var s=e.attributes.item(i);s&&(s.ownerDocument=t)}for(var n=e.firstChild;n;)Z(n,t),n=n.nextSibling}}function ee(){this._nsMap={}}function te(){}function ie(){}function se(){}function ne(){}function re(){}function ae(){}function oe(){}function ce(){}function de(){}function le(){}function ue(){}function he(){}function pe(e,t){var i=[],s=9==this.nodeType&&this.documentElement||this,n=s.prefix,r=s.namespaceURI;if(r&&null==n&&null==(n=s.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return me(this,i,e,t,a),i.join("")}function fe(e,t,i){var s=e.prefix||"",n=e.namespaceURI;if(!n)return!1;if("xml"===s&&n===r.XML||n===r.XMLNS)return!1;for(var a=i.length;a--;){var o=i[a];if(o.prefix===s)return o.namespace!==n}return!0}function ge(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,U),'"')}function me(e,t,i,s,n){if(n||(n=[]),s){if(!(e=s(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case h:var a=e.attributes,o=a.length,c=e.firstChild,d=e.tagName,l=d;if(!(i=r.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var u,v=0;v<a.length;v++)if("xmlns"===a.item(v).name){u=a.item(v).value;break}if(!u)for(var A=n.length-1;A>=0;A--)if(""===(w=n[A]).prefix&&w.namespace===e.namespaceURI){u=w.namespace;break}if(u!==e.namespaceURI)for(A=n.length-1;A>=0;A--){var w;if((w=n[A]).namespace===e.namespaceURI){w.prefix&&(l=w.prefix+":"+d);break}}}t.push("<",l);for(var _=0;_<o;_++)"xmlns"==(I=a.item(_)).prefix?n.push({prefix:I.localName,namespace:I.value}):"xmlns"==I.nodeName&&n.push({prefix:"",namespace:I.value});for(_=0;_<o;_++){var I,P,N;fe(I=a.item(_),0,n)&&(ge(t,(P=I.prefix||"")?"xmlns:"+P:"xmlns",N=I.namespaceURI),n.push({prefix:P,namespace:N})),me(I,t,i,s,n)}if(d===l&&fe(e,0,n)&&(ge(t,(P=e.prefix||"")?"xmlns:"+P:"xmlns",N=e.namespaceURI),n.push({prefix:P,namespace:N})),c||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(">"),i&&/^script$/i.test(d))for(;c;)c.data?t.push(c.data):me(c,t,i,s,n.slice()),c=c.nextSibling;else for(;c;)me(c,t,i,s,n.slice()),c=c.nextSibling;t.push("</",l,">")}else t.push("/>");return;case S:case b:for(c=e.firstChild;c;)me(c,t,i,s,n.slice()),c=c.nextSibling;return;case p:return ge(t,e.name,e.value);case f:return t.push(e.data.replace(/[<&>]/g,U));case g:return t.push("<![CDATA[",e.data,"]]>");case T:return t.push("\x3c!--",e.data,"--\x3e");case E:var D=e.publicId,R=e.systemId;if(t.push("<!DOCTYPE ",e.name),D)t.push(" PUBLIC ",D),R&&"."!=R&&t.push(" ",R),t.push(">");else if(R&&"."!=R)t.push(" SYSTEM ",R,">");else{var L=e.internalSubset;L&&t.push(" [",L,"]"),t.push(">")}return;case y:return t.push("<?",e.target," ",e.data,"?>");case m:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ve(e,t,i){var s;switch(t.nodeType){case h:(s=t.cloneNode(!1)).ownerDocument=e;case b:break;case p:i=!0}if(s||(s=t.cloneNode(!1)),s.ownerDocument=e,s.parentNode=null,i)for(var n=t.firstChild;n;)s.appendChild(ve(e,n,i)),n=n.nextSibling;return s}function ye(e,t,i){var s=new t.constructor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];"object"!=typeof r&&r!=s[n]&&(s[n]=r)}switch(t.childNodes&&(s.childNodes=new R),s.ownerDocument=e,s.nodeType){case h:var a=t.attributes,o=s.attributes=new O,c=a.length;o._ownerElement=s;for(var d=0;d<c;d++)s.setAttributeNode(ye(e,a.item(d),!0));break;case p:i=!0}if(i)for(var l=t.firstChild;l;)s.appendChild(ye(e,l,i)),l=l.nextSibling;return s}function Te(e,t,i){e[t]=i}w.INVALID_STATE_ERR=(_[11]="Invalid state",11),w.SYNTAX_ERR=(_[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(_[13]="Invalid modification",13),w.NAMESPACE_ERR=(_[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(_[15]="Invalid access",15),D.prototype=Error.prototype,d(w,D),R.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],s=0;s<this.length;s++)me(this[s],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},L.prototype.item=function(e){return C(this),this[e]||null},l(L,R),O.prototype={length:0,item:R.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new D(N);var i=this.getNamedItem(e.nodeName);return k(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new D(N);return t=this.getNamedItemNS(e.namespaceURI,e.localName),k(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return x(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return x(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var s=this[i];if(s.localName==t&&s.namespaceURI==e)return s}return null}},M.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var s=new F;if(s.implementation=this,s.childNodes=new R,s.doctype=i||null,i&&s.appendChild(i),t){var n=s.createElementNS(e,t);s.appendChild(n)}return s},createDocumentType:function(e,t,i){var s=new ae;return s.name=e,s.nodeName=e,s.publicId=t||"",s.systemId=i||"",s}},V.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return $(this,e,t)},replaceChild:function(e,t){$(this,e,t,Q),t&&this.removeChild(t)},removeChild:function(e){return G(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ye(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==f&&e.nodeType==f?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===e)return s;t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},d(u,V),d(u,V.prototype),F.prototype={nodeName:"#document",nodeType:S,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==b){for(var i=e.firstChild;i;){var s=i.nextSibling;this.insertBefore(i,t),i=s}return e}return $(this,e,t),Z(e,this),null===this.documentElement&&e.nodeType===h&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),G(this,e)},replaceChild:function(e,t){$(this,e,t,Q),Z(e,this),t&