UNPKG

reference-app-react

Version:

Reference player for using react component

13 lines 731 kB
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=45)}([function(e,t,n){e.exports=n(150)()},function(e,t,n){"use strict";e.exports=n(46)},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(52)),r(n(55)),r(n(6)),r(n(56)),r(n(14)),r(n(15)),r(n(57)),r(n(66)),r(n(67)),r(n(17)),r(n(68)),r(n(69)),r(n(70)),r(n(71)),r(n(72)),r(n(73)),r(n(74)),r(n(75)),r(n(76)),r(n(77)),r(n(18))},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(58)),r(n(59)),r(n(60)),r(n(61)),r(n(62)),r(n(63)),r(n(64)),r(n(16)),r(n(65))},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i,o,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;(u=new Error(t.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.registeredObservers=new Array}return e.prototype.registerObserver=function(e,t){e&&this.registeredObservers.push({observer:e,owner:t})},e.prototype.unregisterObserver=function(e){var t=this;this.registeredObservers.forEach(function(n,r){n.observer===e&&t.registeredObservers.splice(r,1)})},e.prototype.unregisterObservers=function(e){this.registeredObservers=this.registeredObservers.filter(function(t){return t.owner!==e})},e.prototype.reset=function(){this.currentState=null},e.prototype.notifyObservers=function(e){var t=void 0===e;(void 0===this.currentState&&t||this.currentState!==e)&&this.registeredObservers.forEach(function(t){return t.observer(e)}),this.currentState=e},e}();t.Observable=r},function(e,t,n){var r=n(152);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t))},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=d;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",c=t&&t.delimiter||"/";null!=(n=i.exec(e));){var f=n[0],d=n[1],p=n.index;if(s+=e.slice(a,p),a=p+f.length,d)s+=d[1];else{var h=e[a],v=n[2],y=n[3],m=n[4],b=n[5],g=n[6],_=n[7];s&&(r.push(s),s="");var E=null!=v&&null!=h&&h!==v,w="+"===g||"*"===g,S="?"===g||"*"===g,T=n[2]||c,O=m||b;r.push({name:y||o++,prefix:v||"",delimiter:T,optional:S,repeat:w,partial:E,asterisk:!!_,pattern:O?l(O):_?".*":"[^"+u(T)+"]+?"})}}return a<e.length&&(s+=e.substr(a)),s&&r.push(s),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function s(e){for(var t=new Array(e.length),n=0;n<e.length;n++)"object"==typeof e[n]&&(t[n]=new RegExp("^(?:"+e[n].pattern+")$"));return function(n,i){for(var o="",s=n||{},u=(i||{}).pretty?a:encodeURIComponent,l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var f,d=s[c.name];if(null==d){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(r(d)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(d)+"`");if(0===d.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<d.length;p++){if(f=u(d[p]),!t[l].test(f))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(f)+"`");o+=(0===p?c.prefix:c.delimiter)+f}}else{if(f=c.asterisk?encodeURI(d).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}):u(d),!t[l].test(f))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+f+'"');o+=c.prefix+f}}else o+=c}return o}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function l(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function c(e,t){return e.keys=t,e}function f(e){return e.sensitive?"":"i"}function d(e,t,n){r(t)||(n=t||n,t=[]);for(var i=(n=n||{}).strict,o=!1!==n.end,a="",s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)a+=u(l);else{var d=u(l.prefix),p="(?:"+l.pattern+")";t.push(l),l.repeat&&(p+="(?:"+d+p+")*"),a+=p=l.optional?l.partial?d+"("+p+")?":"(?:"+d+"("+p+"))?":d+"("+p+")"}}var h=u(n.delimiter||"/"),v=a.slice(-h.length)===h;return i||(a=(v?a.slice(0,-h.length):a)+"(?:"+h+"(?=$))?"),a+=o?"$":i&&v?"":"(?="+h+"|$)",c(new RegExp("^"+a,f(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return c(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(p(e[i],t,n).source);return c(new RegExp("(?:"+r.join("|")+")",f(n)),t)}(e,t,n):function(e,t,n){return d(o(e,n),t,n)}(e,t,n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13);t.Core=r.Core;var i=n(51);t.PlayerFramework=i.PlayerFramework;var o=n(78);t.DeviceRecognition=o.DeviceRecognition},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){var t=this;this.window=e,this.commandListeners=new Map,this.onMessageReceived=function(e,n){var r=t.commandListeners.get(e);r&&r(n)},this.window.androidCallback=this.onMessageReceived,this.android=e.Android,this.android.setCallback("window.androidCallback")}return e.getInstance=function(t){return this.instance||(this.instance=new e(t)),this.instance},e.prototype.registerMessageListener=function(e,t){this.commandListeners.set(e,t)},e.prototype.unregisterMessageListener=function(e){this.commandListeners.delete(e)},e}();t.AndroidMessageListener=r},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});var i=n(88);t.HTTPLicenseAcquisitionStrategy=i.default;var o=n(20);t.KeySystemOptionsManager=o.default;var a=n(89);t.KeySystemOptionsGenerator=a.default;var s=n(21);t.generatePlayreadyLicenseRequest=s.default;var u=n(90);t.arcusPlayreadyRequestDecorator=u.default;var l=n(22);t.extractEncodedResponseData=l.default;var c=n(23);t.BrowserInfo=c.BrowserInfo;var f=n(24);t.BrowserInput=f.BrowserInput;var d=n(25);t.createPlayreadyKeySystemOptionsGenerator=d.createPlayreadyKeySystemOptionsGenerator;var p=n(31);t.createWidevineKeySystemOptionsGenerator=p.createWidevineKeySystemOptionsGenerator,r(n(104)),r(n(33)),r(n(32))},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))i.call(n,l)&&(s[l]=n[l]);if(r){a=r(n);for(var c=0;c<a.length;c++)o.call(n,a[c])&&(s[a[c]]=n[a[c]])}}return s}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.registerDeviceFactory=function(e){this.deviceFactory=e},e.initialise=function(e){var t=this;if(void 0===e&&(e=[]),this.isInitialised||this.isInitialising)throw new Error("ctvFramework already initialised or initialising");if(!this.deviceFactory)throw new Error("No factory provided before attempt to initialise()");return this.isInitialising=!0,this.deviceFactory.initialise().then(function(){t.isInitialised=!0,t.isInitialising=!1,t.getDevice().player.setAddons(e)})},e.getDeviceFactory=function(){if(!this.isInitialised)throw new Error("ctvFramework not initialised, call initialise() first");return this.deviceFactory},e.getDevice=function(){if(!this.isInitialised)throw new Error("ctvFramework not initialised, call initialise() first");return this.deviceFactory.getInstance()},e.isInitialised=!1,e.isInitialising=!1,e}();t.Core=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.New="New",e.NextAsset="NextAsset",e.Restart="Restart"}(t.PlayoutRequestReason||(t.PlayoutRequestReason={}));var r=function(){function e(){}return e.prototype.getPlayoutRequestData=function(e,t){return Promise.resolve(this.currentPlayoutRequestData)},e.prototype.getNextAssetSignature=function(e){return Promise.resolve(null)},e.prototype.setCurrentPlayoutRequestData=function(e){this.currentPlayoutRequestData=e},e}();t.DefaultPlayerProvider=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Live=0]="Live",e[e.Vod=1]="Vod",e[e.Local=2]="Local",e[e.Live_Stb=3]="Live_Stb",e[e.Vod_Stb=4]="Vod_Stb",e[e.Sideloaded=5]="Sideloaded",e[e.Advert=6]="Advert"}(t.PlaybackType||(t.PlaybackType={})),function(e){e[e.PlayReady=0]="PlayReady",e[e.Widewine=1]="Widewine",e[e.VGC=2]="VGC"}(t.DrmType||(t.DrmType={})),function(e){e[e.Hss=0]="Hss",e[e.Hls=1]="Hls",e[e.Dash=2]="Dash",e[e.Mp4=3]="Mp4"}(t.StreamFormatType||(t.StreamFormatType={}))},function(e,t,n){"use strict";function r(e){var t=e.indexOf("<?xml ");return e.substring(t).trim()}Object.defineProperty(t,"__esModule",{value:!0}),t.cleanUp=r,t.parse=function(e,t){return void 0===t&&(t=new window.DOMParser),e=r(e),t.parseFromString(e,"text/xml")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.notifyNativeLoad=function(e){this.lastNativeLoadData=e},e}();t.LastNativeLoadManifestLoader=r},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Silent=0]="Silent",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose"}(r=t.LogLevel||(t.LogLevel={}));var i=function(){function e(e,t){void 0===e&&(e="PF"),void 0===t&&(t=new Array),this.rawContext=e,this.logHandlers=t}return e.prototype.withContext=function(t){return new e(this.rawContext+":"+t,this.logHandlers)},e.prototype.addLogger=function(e){this.logHandlers.push(e)},e.prototype.verbose=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logHandlers.forEach(function(n){return n.logLevel>=r.Verbose&&n.verbose.apply(n,[e.context].concat(t))})},e.prototype.info=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logHandlers.forEach(function(n){return n.logLevel>=r.Info&&n.info.apply(n,[e.context].concat(t))})},e.prototype.warn=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logHandlers.forEach(function(n){return n.logLevel>=r.Warn&&n.warn.apply(n,[e.context].concat(t))})},e.prototype.error=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.logHandlers.forEach(function(n){return n.logLevel>=r.Error&&n.error.apply(n,[e.context].concat(t))})},Object.defineProperty(e.prototype,"context",{get:function(){return"["+this.rawContext+"]"},enumerable:!0,configurable:!0}),e}();t.Logger=i,t.createConsoleLogHandler=function(e){return{logLevel:e,verbose:console.debug,info:console.log,warn:console.warn,error:console.error}},t.defaultLogger=new i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.hasLifecycleSuspension=function(){return!0},e.prototype.hasNativeParentalPin=function(){return!1},e.prototype.hasExternalAppsDisplay=function(){return!1},e.prototype.hasVolumeControl=function(){return!1},e.prototype.hasExternalAppsLaunch=function(){return!1},e}();t.AndroidCapabilities=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.keySystemOptionsGenerators=e}return e.prototype.getAllKeySystemOptions=function(e){return e?this.keySystemOptionsGenerators.map(function(t){return t.getKeySystemOptions(e)}).filter(function(e){return Boolean(e)}):[]},e}();t.default=r},function(e,t,n){"use strict";function r(e,t){var n=e.getElementsByTagName(t);return 0===n.length?null:n[0].textContent}function i(e){for(var t={},n=e.getElementsByTagName("HttpHeader"),i=0;i<n.length;i++){var o=n[i],a=r(o,"name"),s=r(o,"value");a&&s&&(t[a]=s)}return t}function o(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,a,s,u){void 0===a&&(a=o),void 0===s&&(s=DOMParser),void 0===u&&(u=atob);var l=a(t),c=(new s).parseFromString(l,"text/xml"),f=u(r(c,"Challenge"));return{url:e.licenceAcquisitionUrl,method:"POST",body:f,headers:i(c)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);t.default=function(e){return r.stringToUint(e.responseText)}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,n){var r=e.call(this,t)||this;return r.window=n,r.deviceType="DESKTOP",r.deviceVersion=r.window.navigator.userAgent,r.deviceBrand=r.window.navigator.vendor,r.browserName=r.window.navigator.userAgent,r.browserVersion=r.window.navigator.userAgent,r.deviceModel=r.window.navigator.platform,r.deviceManufacturer=r.window.navigator.vendor,r.operatingSystemName=r.window.navigator.platform,r.operatingSystemVersion=r.window.navigator.appVersion,r.userFriendlyName=r.window.navigator.appName,r}return i(t,e),t}(n(2).DeviceInfo);t.BrowserInfo=o},function(e,t,n){"use strict";var r,i,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),s=n(4),u=((i={})[s.CTV_KEY.UP]=[38],i[s.CTV_KEY.DOWN]=[40],i[s.CTV_KEY.LEFT]=[37],i[s.CTV_KEY.RIGHT]=[39],i[s.CTV_KEY.ENTER]=[13],i[s.CTV_KEY.BACK]=[27],i[s.CTV_KEY.DELETE]=[8],i[s.CTV_KEY.FF]=[33],i[s.CTV_KEY.RW]=[34],i[s.CTV_KEY.PLAY]=[32],i[s.CTV_KEY.PAUSE]=[80],i[s.CTV_KEY.STOP]=[83],i[s.CTV_KEY.RED]=[82],i[s.CTV_KEY.GREEN]=[71],i[s.CTV_KEY.YELLOW]=[66],i[s.CTV_KEY.BLUE]=[89],i[s.CTV_KEY.INFO]=[73],i[s.CTV_KEY.AD]=[112],i[s.CTV_KEY.SEARCH]=[113],i[s.CTV_KEY.SUBTITLES]=[114],i[s.CTV_KEY.HELP]=[115],i[s.CTV_KEY.SKIP_PREV]=[118],i[s.CTV_KEY.SKIP_NEXT]=[120],i[s.CTV_KEY[1]]=[49],i[s.CTV_KEY[2]]=[50],i[s.CTV_KEY[3]]=[51],i[s.CTV_KEY[4]]=[52],i[s.CTV_KEY[5]]=[53],i[s.CTV_KEY[6]]=[54],i[s.CTV_KEY[7]]=[55],i[s.CTV_KEY[8]]=[56],i[s.CTV_KEY[9]]=[57],i[s.CTV_KEY[0]]=[48],i[s.CTV_KEY.SHORTCUT_9]=[32],i),l=new Set([27,37,38,39,40,13]),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.keyCodeMap=u,t.preventDefault=l,t}return o(t,e),t}(a.Input);t.BrowserInput=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(2),o=n(21),a=n(22),s=n(26);t.createPlayreadyKeySystemOptionsGenerator=function(){return new r.KeySystemOptionsGenerator(i.DrmType.PlayReady,"com.microsoft.playready",new r.HTTPLicenseAcquisitionStrategy(r.arcusPlayreadyRequestDecorator(o.default),a.default,s.request))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"request",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"uwpRequest",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"mutualSslHttpClientFactory",{enumerable:!0,get:function(){return o.default}});var r=a(n(91)),i=a(n(101)),o=a(n(102));function a(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ var r=n(93),i=n(94),o=n(95);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|p(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|p(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(l(e,o+d)!==l(t,d)){f=!1;break}if(f)return o}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function g(e,t,n,r){return q(F(t,e.length-n),e,n,r)}function _(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return _(e,t,n,r)}function w(e,t,n,r){return q(V(t),e,n,r)}function S(e,t,n,r){return q(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,u,l=e[i],c=null,f=l>239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.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}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)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},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;f<s;++f)if(l[f]!==c[f]){o=l[f],a=c[f];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return g(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function x(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=B(e[o]);return i}function k(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function I(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,o){return o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,o){return o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=u.isBuffer(e)?e:F(new u(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(12))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r={error:{statusCode:e,message:t}};n&&(r.responseText=n);return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){try{return JSON.parse(e)}catch(e){return null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e>=i.default.OK&&e<i.default.MULTIPLE_CHOICES||e===i.default.MOVED_TEMPORARILY||e===i.default.NOT_MODIFIED||e===i.default.NO_CONTENT_IE};var r,i=(r=n(96))&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(2),o=n(103);t.createWidevineKeySystemOptionsGenerator=function(){return new r.KeySystemOptionsGenerator(i.DrmType.Widewine,"com.widevine.alpha",new r.HTTPLicenseAcquisitionStrategy(o.generateWidevineLicenseRequest,o.widevineResponseHandler,o.widevineRequestFunction))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.hasLifecycleSuspension=function(){return!1},e.prototype.hasNativeParentalPin=function(){return!1},e.prototype.hasExternalAppsDisplay=function(){return!1},e.prototype.hasVolumeControl=function(){return!1},e.prototype.hasExternalAppsLaunch=function(){return!1},e}();t.BrowserCapabilities=r},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(105),a=n(2),s=n(4),u=function(e){function t(t,n,r){var i;void 0===n&&(n=o.default),void 0===r&&(r=s);var u=e.call(this)||this;return u.keySystemOptionsManager=t,u.rxPlayerConstructor=n,u.frameworkUtils=r,u.getRootElement=function(){return u.rootElement},u.playerStateChangeHandler=function(e){u.playerStateHandlers[e]()},u.errorHandler=function(e){u.notifyError({code:"0000",message:e.message,isFatal:!0})},u.positionUpdateHandler=function(e){u.notifyCurrentPositionChanged(e.position)},u.audioTrackChangeHandler=function(e){u.notifyCurrentAudioTrackChanged(u.transformAudioTrack(e).trackId)},u.playerStateHandlers=((i={})[o.PLAYER_STATES.STOPPED]=function(){u.notifyStateChange(a.PlayerState.Stopped)},i[o.PLAYER_STATES.BUFFERING]=function(){u.notifyStateChange(a.PlayerState.Rebuffering)},i[o.PLAYER_STATES.PLAYING]=function(){u.notifyStateChange(a.PlayerState.Playing)},i[o.PLAYER_STATES.SEEKING]=function(){u.notifyStateChange(a.PlayerState.Paused)},i[o.PLAYER_STATES.PAUSED]=function(){u.notifyStateChange(a.PlayerState.Paused)},i[o.PLAYER_STATES.LOADING]=function(){u.notifyStateChange(a.PlayerState.Loading)},i[o.PLAYER_STATES.ENDED]=function(){u.notifyStateChange(a.PlayerState.Finished)},i[o.PLAYER_STATES.LOADED]=function(){var e=u.getAudioTracks();u.notifyAvailableAudioTracksChanged(e),u.setDefaultAudioTrack(e),u.videoElement.playbackRate=1,u.notifyDurationChanged(u.player.getVideoDuration())},i),u}return i(t,e),t.prototype.initialise=function(){return Promise.resolve()},t.prototype.nativeLoad=function(e){this.defaultAudioLanguage=e.defaultAudioLanguage;var t=e.videoHTMLContainerInfo;this.createVideoElement(e.autoplay,t),t?(this.videoElement.style.width="100%",this.videoElement.style.height="100%"):this.setPlayoutRect(e.custom&&e.custom.playoutRect),this.player.loadVideo({url:e.cdn.url,transport:"smooth",autoPlay:e.autoplay,keySystems:this.keySystemOptionsManager.getAllKeySystemOptions(e.drmConfiguration)})},t.prototype.initiateSeek=function(e){this.player.seekTo(e)},t.prototype.nativeStop=function(){this.player.stop(),this.removeVideoListeners(),this.destroyVideoElement()},t.prototype.nativePause=function(){this.player.pause()},t.prototype.nativePlay=function(){this.player.play()},t.prototype.getFullScreenPlayoutRect=function(){return{x:0,y:0,width:document.body.clientWidth,height:document.body.clientHeight}},t.prototype.setPlayoutRect=function(e){var t=this.getFullScreenPlayoutRect(),n=e||t;this.videoElement.style.zIndex=""+("zIndex"in n?n.zIndex:-1e3),this.videoElement.style.position="absolute",this.videoElement.style.left=(n.x||t.x)+"px",this.videoElement.style.top=(n.y||t.y)+"px",this.videoElement.style.width=(n.width||t.width)+"px",this.videoElement.style.height=(n.height||t.height)+"px",this.videoElement.style.backgroundColor=n.backgroundColor},t.prototype.nativeSetAudioTrack=function(e){this.getAudioTracks().find(function(t){return t.trackId===e})&&this.player.setAudioTrack(e)},t.prototype.dispose=function(){return Promise.resolve()},t.prototype.nativeSetVolume=function(e){this.player.setVolume(e)},t.prototype.setDefaultAudioTrack=function(e){var t;if(this.defaultAudioLanguage)if(t=Array.isArray(this.defaultAudioLanguage)?this.getFirstAvailableLanguage(this.defaultAudioLanguage,e):this.defaultAudioLanguage){var n=e.find(function(e){return e.language===t});this.defaultAudioLanguage=null,n&&this.setAudioTrack(n.trackId)}else e[0]&&this.setAudioTrack(e[0].trackId)},t.prototype.getFirstAvailableLanguage=function(e,t){return e.find(function(e){return void 0!==t.find(function(t){return t.language===e})})},t.prototype.createVideoElement=function(e,t){if(void 0===e&&(e=!1),!this.videoElement){var n={id:"ctvframework-video-browser"};this.videoElement=this.frameworkUtils.createElement("video",n),this.videoElement.autoplay=e,t?(t.videoElementClassName&&this.videoElement.classList.add(t.videoElementClassName),t.videoHTMLContainer.appendChild(this.videoElement),this.rootElement=t.videoHTMLContainer):(this.frameworkUtils.appendToBody(this.videoElement),this.rootElement=document.body),this.player=new this.rxPlayerConstructor({videoElement:this.videoElement}),this.addVideoListeners()}},t.prototype.destroyVideoElement=function(){this.videoElement.parentNode.removeChild(this.videoElement),this.videoElement=null},t.prototype.addVideoListeners=function(){this.player.addEventListener("playerStateChange",this.playerStateChangeHandler),this.player.addEventListener("error",this.errorHandler),this.player.addEventListener("positionUpdate",this.positionUpdateHandler),this.player.addEventListener("audioTrackChange",this.audioTrackChangeHandler)},t.prototype.removeVideoListeners=function(){this.player.removeEventListener("playerStateChange",this.playerStateChangeHandler),this.player.removeEventListener("error",this.errorHandler),this.player.removeEventListener("positionUpdate",this.positionUpdateHandler),this.player.removeEventListener("audioTrackChange",this.audioTrackChangeHandler)},t.prototype.getAudioTracks=function(){return(this.player.getAvailableAudioTracks()||[]).map(this.transformAudioTrack)},t.prototype.transformAudioTrack=function(e){return{language:e.language,trackId:String(e.id)}},t}(a.Player);t.BrowserPlayer=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.hasLifecycleSuspension=function(){return!0},e.prototype.hasNativeParentalPin=function(){return!1},e.prototype.hasExternalAppsDisplay=function(){return!1},e.prototype.hasVolumeControl=function(){return!1},e.prototype.hasExternalAppsLaunch=function(){return!1},e}();t.TizenCapabilities=r},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.PLAY=32]="PLAY",e[e.NEXT=120]="NEXT",e[e.PREV=118]="PREV",e[e.PAUSE=80]="PAUSE",e[e.STOP=83]="STOP",e[e.FF=127]="FF",e[e.RW=128]="RW"}(r=t.MEDIA_REMOTE_KEY_CODE||(t.MEDIA_REMOTE_KEY_CODE={}));var i=function(){function e(e){this.winRtBridge=e,this.onKeyDownCallbacks=[],this.onKeyUpCallbacks=[],this.systemMediaControls=this.winRtBridge.getMediaRemoteControls(),this.enableSystemMediaTransportControls()}return e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.onKeyDown=function(e){this.onKeyDownCallbacks.push(e)},e.prototype.onKeyUp=function(e){this.onKeyUpCallbacks.push(e)},e.prototype.setStatusPlaying=function(){this.systemMediaControls.playbackStatus=this.winRtBridge.getMediaPlaybackStatus().playing},e.prototype.setStatusPaused=function(){this.systemMediaControls.playbackStatus=this.winRtBridge.getMediaPlaybackStatus().paused},e.prototype.setStatusStopped=function(){this.systemMediaControls.playbackStatus=this.winRtBridge.getMediaPlaybackStatus().stopped},e.prototype.enableSystemMediaTransportControls=function(){this.systemMediaControls.isEnabled=!0,this.systemMediaControls.onbuttonpressed=this.systemMediaControlsButtonPressed.bind(this),this.systemMediaControls.isPlayEnabled=!0,this.systemMediaControls.isPauseEnabled=!0,this.systemMediaControls.isStopEnabled=!0,this.systemMediaControls.isNextEnabled=!0,this.systemMediaControls.isFastForwardEnabled=!0,this.systemMediaControls.isPreviousEnabled=!0,this.systemMediaControls.isRewindEnabled=!0,this.systemMediaControls.playbackStatus=this.winRtBridge.getMediaPlaybackStatus().stopped},e.prototype.systemMediaControlsButtonPressed=function(e){var t=this.winRtBridge.getMediaRemoteButtons();switch(e.button){case t.play:this.sendKey(r.PLAY);break;case t.pause:this.sendKey(r.PAUSE);break;case t.stop:this.sendKey(r.STOP);break;case t.next:this.sendKey(r.NEXT);break;case t.fastForward:this.sendKey(r.FF);break;case t.previous:this.sendKey(r.PREV);break;case t.rewind:this.sendKey(r.RW)}},e.prototype.sendKey=function(e){this.onKeyDownCallbacks.forEach(function(t){return t(e)}),this.onKeyUpCallbacks.forEach(function(t){return t(e)})},e}();t.UWPMediaRemoteService=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.hasLifecycleSuspension=function(){return!0},e.prototype.hasNativeParentalPin=function(){return!1},e.prototype.hasExternalAppsDisplay=function(){return!1},e.prototype.hasVolumeControl=function(){return!0},e.prototype.hasExternalAppsLaunch=function(){return!1},e}();t.UWPCapabilities=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.hasLifecycleSuspension=function(){return!0},e.prototype.hasNativeParentalPin=function(){return!1},e.prototype.hasExternalAppsDisplay=function(){return!1},e.prototype.hasVolumeControl=function(){return!1},e.prototype.hasExternalAppsLaunch=function(){return!1},e}();t.WebMafCapabilities=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.hasLifecycleSuspension=function(){return!0},e.prototype.hasNativeParentalPin=function(){return!1},e.prototype.hasExternalAppsDisplay=function(){return!1},e.prototype.hasVolumeControl=function(){return!1},e.prototype.hasExternalAppsLaunch=function(){return!1},e}();t.WebOSCapabilities=r},function(e,t,n){"use strict";function r(e,t){var n=t+"=([^&]*)",r=e.match(n);return r?decodeURIComponent(r[1]):""}Object.defineProperty(t,"__esModule",{value:!0}),t.getAssetConfigurationFromQueryString=function(e){var t=r(e,"manifestUri"),n=r(e,"licensingUri"),i=r(e,"deviceId"),o=r(e,"drmType"),a=r(e,"streamType");return{deviceId:i,drmType:o,manifestUri:t,licensingUri:n,streamType:a}}},function(e,t,n){(function(t){e.exports=function(e){var n=[];return n.toString=function(){return this.map(function(n){var r=function(e,n){var r=e[1]||"",i=e[3];if(!i)return r;if(n){var o=(s=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+new t(JSON.stringify(s)).toString("base64")+" */"),a=i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"});return[r].concat(a).concat([o]).join("\n")}var s;return[r].join("\n")}(n,e);return n[2]?"@media "+n[2]+"{"+r+"}":r}).join("")},n.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(t&&!a[2]?a[2]=t:t&&(a[2]="("+a[2]+") and ("+t+")"),n.push(a))}},n}}).call(this,n(27).Buffer)},function(e,t,n){var r,i,o={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),s=function(e){var t={};return function(e){return void 0===t[e]&&(t[e]=function(e){return document.querySelector(e)}.call(this,e)),t[e]}}(),u=null,l=0,c=[],f=n(157);function d(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id];if(i){i.refs++;for