try{ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("ZaloSocialSDK",[],e):"object"==typeof exports?exports.ZaloSocialSDK=e():t.ZaloSocialSDK=e()}(window,function(){return i={},r.m=n=[function(t,e,n){var i=n(31)("wks"),r=n(32),o=n(2).Symbol,a="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=a&&o[t]||(a?o:r)("Symbol."+t))}).store=i},function(t,e,n){t.exports={default:n(80),__esModule:!0}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(5),r=n(21);t.exports=n(7)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(6),r=n(49),o=n(50),a=Object.defineProperty;e.f=n(7)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(12);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var m=n(2),g=n(3),y=n(9),v=n(4),w="prototype",b=function(t,e,n){var i,r,o,a=t&b.F,s=t&b.G,l=t&b.S,h=t&b.P,u=t&b.B,c=t&b.W,f=s?g:g[e]||(g[e]={}),d=f[w],p=s?m:l?m[e]:(m[e]||{})[w];for(i in s&&(n=e),n)(r=!a&&p&&void 0!==p[i])&&i in f||(o=r?p[i]:n[i],f[i]=s&&"function"!=typeof p[i]?n[i]:u&&r?y(o,m):c&&p[i]==o?function(i){function t(t,e,n){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,e)}return new i(t,e,n)}return i.apply(this,arguments)}return t[w]=i[w],t}(o):h&&"function"==typeof o?y(Function.call,o):o,h&&((f.virtual||(f.virtual={}))[i]=o,t&b.R&&d&&!d[i]&&v(d,i,o)))};b.F=1,b.G=2,b.S=4,b.P=8,b.B=16,b.W=32,b.U=64,b.R=128,t.exports=b},function(t,e,n){var o=n(18);t.exports=function(i,r,t){if(o(i),void 0===r)return i;switch(t){case 1:return function(t){return i.call(r,t)};case 2:return function(t,e){return i.call(r,t,e)};case 3:return function(t,e,n){return i.call(r,t,e,n)}}return function(){return i.apply(r,arguments)}}},function(t,e){t.exports={}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a(n(1)),i=a(n(84));function o(t,e){for(var n=0;n=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";function w(){return this}var b=n(29),x=n(8),_=n(51),B=n(4),T=n(13),k=n(10),E=n(52),R=n(25),A=n(59),S=n(0)("iterator"),C=!([].keys&&"next"in[].keys()),I="values";t.exports=function(t,e,n,i,r,o,a){E(n,e,i);function s(t){if(!C&&t in p)return p[t];switch(t){case"keys":case I:return function(){return new n(this,t)}}return function(){return new n(this,t)}}var l,h,u,c=e+" Iterator",f=r==I,d=!1,p=t.prototype,m=p[S]||p["@@iterator"]||r&&p[r],g=m||s(r),y=r?f?s("entries"):g:void 0,v="Array"==e&&p.entries||m;if(v&&(u=A(v.call(new t)))!==Object.prototype&&(R(u,c,!0),b||T(u,S)||B(u,S,w)),f&&m&&m.name!==I&&(d=!0,g=function(){return m.call(this)}),b&&!a||!C&&!d&&p[S]||B(p,S,g),k[e]=g,k[c]=w,r)if(l={values:f?g:s(I),keys:o?g:s("keys"),entries:y},a)for(h in l)h in p||_(p,h,l[h]);else x(x.P+x.F*(C||d),e,l);return l}},function(t,e){t.exports=!0},function(t,e,n){var i=n(55),r=n(33);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e,n){var i=n(2),r="__core-js_shared__",o=i[r]||(i[r]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){t.exports=n(2).document&&document.documentElement},function(t,e,n){var r=n(14),o=n(0)("toStringTag"),a="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:a?r(e):"Object"==(i=r(e))&&"function"==typeof e.callee?"Arguments":i}},function(t,e,n){var o=n(6);t.exports=function(e,t,n,i){try{return i?t(o(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&o(r.call(e)),t}}},function(t,e,n){var i=n(10),r=n(0)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[r]===t)}},function(t,e,n){var i=n(35),r=n(0)("iterator"),o=n(10);t.exports=n(3).getIteratorMethod=function(t){if(null!=t)return t[r]||t["@@iterator"]||o[i(t)]}},function(t,e,n){function i(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}}function r(t){i.call(t.data)}var o,a,s,l=n(9),h=n(68),u=n(34),c=n(20),f=n(2),d=f.process,p=f.setImmediate,m=f.clearImmediate,g=f.MessageChannel,y=0,v={},w="onreadystatechange";p&&m||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++y]=function(){h("function"==typeof t?t:Function(t),e)},o(y),y},m=function(t){delete v[t]},"process"==n(14)(d)?o=function(t){d.nextTick(l(i,t,1))}:g?(s=(a=new g).port2,a.port1.onmessage=r,o=l(s.postMessage,s,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(o=function(t){f.postMessage(t+"","*")},f.addEventListener("message",r,!1)):o=w in c("script")?function(t){u.appendChild(c("script"))[w]=function(){u.removeChild(this),i.call(t)}}:function(t){setTimeout(l(i,t,1),0)}),t.exports={set:p,clear:m}},function(t,e,n){var o=n(0)("iterator"),a=!1;try{var i=[7][o]();i.return=function(){a=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!a)return!1;var n=!1;try{var i=[7],r=i[o]();r.next=function(){return{done:n=!0}},i[o]=function(){return r},t(i)}catch(t){}return n}},function(t,e,n){t.exports={default:n(82),__esModule:!0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){t.exports=n(44)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=a(n(45)),i=a(n(72));e.init=function(){s.init()},e.reload=function(){u&&clearInterval(u);s.reload()},e.openChatWidget=function(){s.openChatWidget()},e.closeChatWidget=function(){s.closeChatWidget()};var r=a(n(75)),o=a(n(100));function a(t){return t&&t.__esModule?t:{default:t}}var s=new r.default;s.init();var h,u=void 0;h=i.default.mark(function t(){return i.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:u=setInterval(function(){s.retry()},1e3),setTimeout(function(){u&&clearInterval(u)},5e3);case 2:case"end":return t.stop()}},t,this)}),function(){var s=h.apply(this,arguments);new l.default(function(o,a){return function e(t,n){try{var i=s[t](n),r=i.value}catch(t){return void a(t)}if(!i.done)return l.default.resolve(r).then(function(t){e("next",t)},function(t){e("throw",t)});o(r)}("next")})}(),"news.zing.vn"!=window.location.hostname&&function(){try{if(window.self==window.top){var t=document.createElement("div");if(t.id="app",t.className="zs",document.body.appendChild(t),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));else{var e=window.location.hostname;"news.zing.vn"!==e&&"mp3.zing.vn"!==e||setTimeout(function(){o.default.loadFile("https://stc.sp.zdn.vn/chatbutton/main-1.2.2.js","js"),o.default.loadFile("https://stc.sp.zdn.vn/chatbutton/main.142b31d74cee2e25afe3651f0591f9f4.css","css")},100)}}}catch(t){console.log("")}}()},function(t,e,n){t.exports={default:n(46),__esModule:!0}},function(t,e,n){n(47),n(27),n(60),n(64),t.exports=n(3).Promise},function(t,e){},function(t,e,n){var l=n(16),h=n(17);t.exports=function(s){return function(t,e){var n,i,r=String(h(t)),o=l(e),a=r.length;return o<0||a<=o?s?"":void 0:(n=r.charCodeAt(o))<55296||56319document.F=Object<\/script>"),t.close(),u=t.F;n--;)delete u[h][s[n]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(r[h]=o(t),n=new r,r[h]=null,n[l]=t):n=u(),void 0===e?n:a(n,e)}},function(t,e,n){var a=n(5),s=n(6),l=n(30);t.exports=n(7)?Object.defineProperties:function(t,e){s(t);for(var n,i=l(e),r=i.length,o=0;or;)a(i,n=e[r++])&&(~l(o,n)||o.push(n));return o}},function(t,e,n){var i=n(14);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){var l=n(22),h=n(23),u=n(58);t.exports=function(s){return function(t,e,n){var i,r=l(t),o=h(r.length),a=u(n,o);if(s&&e!=e){for(;a=t.length?(this._t=void 0,r(1)):r(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";function i(){}function r(t,e){return t===e||t===A&&e===f}function u(t){var e;return!(!v(t)||"function"!=typeof(e=t.then))&&e}function o(t){return r(A,t)?new I(t):new c(t)}function h(t){try{t()}catch(t){return{error:t}}}function a(h,n){if(!h._n){h._n=!0;var i=h._c;T(function(){for(var s=h._v,l=1==h._s,t=0,e=function(t){var e,n,i=l?t.ok:t.fail,r=t.resolve,o=t.reject,a=t.domain;try{i?(l||(2==h._h&&z(h),h._h=1),!0===i?e=s:(a&&a.enter(),e=i(s),a&&a.exit()),e===t.promise?o(E("Promise-chain cycle")):(n=u(e))?n.call(e,r,o):r(e)):o(s)}catch(t){o(t)}};i.length>t;)e(i[t++]);h._c=[],h._n=!1,n&&!h._h&&P(h)})}}function s(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),a(e,!0))}var l,c,f,d=n(29),p=n(2),m=n(9),g=n(35),y=n(8),v=n(12),w=n(18),b=n(65),x=n(66),_=n(67),B=n(39).set,T=n(69)(),k="Promise",E=p.TypeError,R=p.process,A=p[k],S="process"==g(R=p.process),C=!!function(){try{var t=A.resolve(1),e=(t.constructor={})[n(0)("species")]=function(t){t(i,i)};return(S||"function"==typeof PromiseRejectionEvent)&&t.then(i)instanceof e}catch(t){}}(),I=c=function(t){var n,i;this.promise=new t(function(t,e){if(void 0!==n||void 0!==i)throw E("Bad Promise constructor");n=t,i=e}),this.resolve=w(n),this.reject=w(i)},P=function(r){B.call(p,function(){var t,e,n,i=r._v;if(L(r)&&(t=h(function(){S?R.emit("unhandledRejection",i,r):(e=p.onunhandledrejection)?e({promise:r,reason:i}):(n=p.console)&&n.error&&n.error("Unhandled promise rejection",i)}),r._h=S||L(r)?2:1),r._a=void 0,t)throw t.error})},L=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,i=0;n.length>i;)if((e=n[i++]).fail||!L(e.promise))return!1;return!0},z=function(e){B.call(p,function(){var t;S?R.emit("rejectionHandled",e):(t=p.onrejectionhandled)&&t({promise:e,reason:e._v})})},O=function(t){var n,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw E("Promise can't be resolved itself");(n=u(t))?T(function(){var e={_w:i,_d:!1};try{n.call(t,m(O,e,1),m(s,e,1))}catch(t){s.call(e,t)}}):(i._v=t,i._s=1,a(i,!1))}catch(t){s.call({_w:i,_d:!1},t)}}};C||(A=function(t){b(this,A,k,"_h"),w(t),l.call(this);try{t(m(O,this,1),m(s,this,1))}catch(t){s.call(this,t)}},(l=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(70)(A.prototype,{then:function(t,e){var n=o(_(this,A));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=S?R.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&a(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),I=function(){var t=new l;this.promise=t,this.resolve=m(O,t,1),this.reject=m(s,t,1)}),y(y.G+y.W+y.F*!C,{Promise:A}),n(25)(A,k),n(71)(k),f=n(3)[k],y(y.S+y.F*!C,k,{reject:function(t){var e=o(this);return(0,e.reject)(t),e.promise}}),y(y.S+y.F*(d||!C),k,{resolve:function(t){if(t instanceof A&&r(t.constructor,this))return t;var e=o(this);return(0,e.resolve)(t),e.promise}}),y(y.S+y.F*!(C&&n(40)(function(t){A.all(t).catch(i)})),k,{all:function(t){var a=this,e=o(a),s=e.resolve,l=e.reject,n=h(function(){var i=[],r=0,o=1;x(t,!1,function(t){var e=r++,n=!1;i.push(void 0),o++,a.resolve(t).then(function(t){n||(n=!0,i[e]=t,--o||s(i))},l)}),--o||s(i)});return n&&l(n.error),e.promise},race:function(t){var e=this,n=o(e),i=n.reject,r=h(function(){x(t,!1,function(t){e.resolve(t).then(n.resolve,i)})});return r&&i(r.error),n.promise}})},function(t,e){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var f=n(9),d=n(36),p=n(37),m=n(6),g=n(23),y=n(38),v={},w={};(e=t.exports=function(t,e,n,i,r){var o,a,s,l,h=r?function(){return t}:y(t),u=f(n,i,e?2:1),c=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(p(h)){for(o=g(t.length);cwindow.innerHeight||n.element.offsetTop+n.element.offsetHeight>=window.innerHeight)&&(n.element.style.top="auto"),n.initWindowWidth>window.innerWidth){var e=n.initWindowWidth-window.innerWidth;t=n.element.style.left.replace("px","")-e<=0}return n.element.style.left?n.element.style.left.replace("px","")>=window.innerWidth?(n.initWindowWidth=window.innerWidth,n.element.style.left=""):t?(n.initWindowWidth=window.innerWidth,n.element.style.left="0px"):(window.innerWidth<=n.element.offsetWidth?(n.element.style.left="",n.checkResizeWindow=!0):n.checkResizeWindow?n.element.style.left="":n.element.style.left=n.element.offsetLeft<0?"0px":n.element.offsetLeft+window.innerWidth-n.initWindowWidth+"px",n.initWindowWidth=window.innerWidth,void(n.chatBoxLeft=n.element.offsetLeft)):(n.initWindowWidth=window.innerWidth,n.element.style.left="")},this.handleTopResize=function(){var t=n.selected.offsetTop+n.selected.offsetHeight,e=n.selected.offsetTop+n.selected.offsetHeight-(n.y_pos-n.y_elem);0>>6)+d(128|63&e):d(224|e>>>12&15)+d(128|e>>>6&63)+d(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return d(240|e>>>18&7)+d(128|e>>>12&63)+d(128|e>>>6&63)+d(128|63&e)}function o(t){return t.replace(p,r)}function a(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(1>>18),c.charAt(n>>>12&63),2<=e?"=":c.charAt(n>>>6&63),1<=e?"=":c.charAt(63&n)].join("")}function s(t,e){return e?g(String(t)).replace(/[+\/]/g,function(t){return"+"==t?"-":"_"}).replace(/=/g,""):g(String(t))}function l(t){switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return d(55296+(e>>>10))+d(56320+(1023&e));case 3:return d((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return d((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}}function h(t){return t.replace(y,l)}function u(t){var e=t.length,n=e%4,i=(0>>16),d(i>>>8&255),d(255&i)];return r.length-=[0,0,2,1][n],r.join("")}function t(t){return w(String(t).replace(/[-_]/g,function(t){return"-"==t?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=function(t){for(var e={},n=0,i=t.length;n * @license MIT */ var i=U(93),o=U(94),a=U(95);function n(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(n()=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return O(t).length;default:if(i)return z(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function m(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):2147483647=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=c.from(e,i)),c.isBuffer(e))return 0===e.length?-1:g(t,e,n,i,r);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,i,r){var o,a=1,s=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s/=a=2,l/=2,n/=2}function h(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){var u=-1;for(o=n;o>>10&1023|55296),u=56320|1023&u),i.push(u),r+=c}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);var n="",i=0;for(;ithis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return b(this,e,n);case"ascii":return _(this,e,n);case"latin1":case"binary":return B(this,e,n);case"base64":return w(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",e=W.INSPECT_MAX_BYTES;return 0e&&(t+=" ... ")),""},c.prototype.compare=function(t,e,n,i,r){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(r<=i&&n<=e)return 0;if(r<=i)return-1;if(n<=e)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),l=this.slice(i,r),h=t.slice(e,n),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,l,h,u,c,f,d,p=!1;;)switch(i){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return f=e,d=n,M(z(t,(c=this).length-f),c,f,d);case"ascii":return v(this,t,e,n);case"latin1":case"binary":return v(this,t,e,n);case"base64":return l=this,h=e,u=n,M(O(t),l,h,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=e,s=n,M(function(t,e){for(var n,i,r,o=[],a=0;a>8,r=n%256,o.push(r),o.push(i);return o}(t,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function _(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;rt.length)throw new RangeError("Index out of range")}function A(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function S(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function C(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(t,e,n,i,r){return r||C(t,0,n,4),o.write(t,e,n,i,23,4),n+4}function P(t,e,n,i,r){return r||C(t,0,n,8),o.write(t,e,n,i,52,8),n+8}c.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):i>>8):A(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):S(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):S(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);R(this,t,e,n,r-1,-r)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+n},c.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);R(this,t,e,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;0<=--o&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):S(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):S(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return I(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return I(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return P(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return P(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o>6|192,63&n|128)}else if(n<65536){if((e-=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((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function O(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(e,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}}).call(this,U(42))},function(t,e,n){"use strict";e.byteLength=function(t){return 3*t.length/4-c(t)},e.toByteArray=function(t){var e,n,i,r,o,a,s=t.length;o=c(t),a=new u(3*s/4-o),i=0>16&255,a[l++]=r>>8&255,a[l++]=255&r;2===o?(r=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,a[l++]=255&r):1===o&&(r=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,a[l++]=r>>8&255,a[l++]=255&r);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,r="",o=[],a=0,s=n-i;a>2],r+=l[e<<4&63],r+="=="):2==i&&(e=(t[n-2]<<8)+t[n-1],r+=l[e>>10],r+=l[e>>4&63],r+=l[e<<2&63],r+="=");return o.push(r),o.join("")};for(var l=[],h=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,o=i.length;r>18&63]+l[r>>12&63]+l[r>>6&63]+l[63&r]);return o.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,i,r){var o,a,s=8*r-i-1,l=(1<>1,u=-7,c=n?r-1:0,f=n?-1:1,d=t[e+c];for(c+=f,o=d&(1<<-u)-1,d>>=-u,u+=s;0>=-u,u+=i;0>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),2<=(e+=1<=a+c?f/l:f*Math.pow(2,1-c))*l&&(a++,l/=2),u<=a+c?(s=0,a=u):1<=a+c?(s=(e*l-1)*Math.pow(2,r),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,r),a=0));8<=r;t[n+d]=255&s,d+=p,s/=256,r-=8);for(a=a<>>=1,n+=n)1&i&&(t=n+t);return t},u.prototype.fromParts=function(t,e,n,i,r,o){return this.version=n>>12&15,this.hex=u.paddedString(t.toString(16),8)+"-"+u.paddedString(e.toString(16),4)+"-"+u.paddedString(n.toString(16),4)+"-"+u.paddedString(i.toString(16),2)+u.paddedString(r.toString(16),2)+"-"+u.paddedString(o.toString(16),12),this},u.prototype.toString=function(){return this.hex},u.prototype.toURN=function(){return"urn:uuid:"+this.hex},u.prototype.toBytes=function(){for(var t=this.hex.split("-"),e=[],n=0,i=0;i>>16,timestamp:e}},u._create4=function(){return(new u).fromParts(u.randomUI32(),u.randomUI16(),16384|u.randomUI12(),128|u.randomUI06(),u.randomUI08(),u.randomUI48())},u._create1=function(){var t=(new Date).getTime(),e=u.randomUI14(),n=1099511627776*(1|u.randomUI08())+u.randomUI40(),i=u.randomUI04(),r=0;t!=r?(t>>8|128,h=255&e;return(new u).fromParts(a,o.mid,s,l,h,n)},u.create=function(t){return this["_create"+(t=t||4)]()},u.fromTime=function(t,e){e=e||!1;var n=u.getTimeFieldValues(t),i=n.low,r=4095&n.hi|4096;return!1===e?(new u).fromParts(i,n.mid,r,0,0,0):(new u).fromParts(i,n.mid,r,128|u.limitUI06,u.limitUI08-1,u.limitUI48-1)},u.firstFromTime=function(t){return u.fromTime(t,!1)},u.lastFromTime=function(t){return u.fromTime(t,!0)},u.fromURN=function(t){var e;return(e=/^(?:urn:uuid:|\{)?([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})(?:\})?$/i.exec(t))?(new u).fromParts(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16),parseInt(e[5],16),parseInt(e[6],16)):null},u.fromBytes=function(t){if(t.length<5)return null;for(var e="",n=0,i=[4,2,2,2,6],r=0;r