playbasis
Version:
Playbasis Javascript SDK
39 lines • 282 kB
JavaScript
"use strict";var _typeof2="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e};!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Playbasis=e()}}(function(){var e,t,n;return function(){function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){return o(t[a][1][e]||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}return e}()({1:[function(e,t,n){function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function o(e){var t=r(e),n=t[0],o=t[1];return 3*(n+o)/4-o}function i(e,t,n){return 3*(t+n)/4-n}function a(e){for(var t,n=r(e),o=n[0],a=n[1],s=new h(i(e,o,a)),u=0,l=a>0?o-4:o,c=0;c<l;c+=4)t=f[e.charCodeAt(c)]<<18|f[e.charCodeAt(c+1)]<<12|f[e.charCodeAt(c+2)]<<6|f[e.charCodeAt(c+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=f[e.charCodeAt(c)]<<2|f[e.charCodeAt(c+1)]>>4,s[u++]=255&t),1===a&&(t=f[e.charCodeAt(c)]<<10|f[e.charCodeAt(c+1)]<<4|f[e.charCodeAt(c+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s}function s(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function u(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(s(r));return o.join("")}function l(e){for(var t,n=e.length,r=n%3,o=[],i=0,a=n-r;i<a;i+=16383)o.push(u(e,i,i+16383>a?a:i+16383));return 1===r?(t=e[n-1],o.push(c[t>>2]+c[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(c[t>>10]+c[t>>4&63]+c[t<<2&63]+"=")),o.join("")}n.byteLength=o,n.toByteArray=a,n.fromByteArray=l;for(var c=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,y=p.length;d<y;++d)c[d]=p[d],f[p.charCodeAt(d)]=d;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},{}],2:[function(t,n,r){(function(t,o,i){/* @preserve
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Petka Antonov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
!function(t){if("object"==(void 0===r?"undefined":_typeof2(r))&&void 0!==n)n.exports=t();else if("function"==typeof e&&e.amd)e([],t);else{var i;"undefined"!=typeof window?i=window:void 0!==o?i=o:"undefined"!=typeof self&&(i=self),i.Promise=t()}}(function(){var e,n,r;return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return o(n||e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof _dereq_&&_dereq_,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){t.exports=function(e){function t(e){var t=new n(e),r=t.promise();return t.setHowMany(1),t.setUnwrap(),t.init(),r}var n=e._SomePromiseArray;e.any=function(e){return t(e)},e.prototype.any=function(){return t(this)}}},{}],2:[function(e,n,r){function o(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new h(16),this._normalQueue=new h(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=f}function i(e,t,n){this._lateQueue.push(e,t,n),this._queueTick()}function a(e,t,n){this._normalQueue.push(e,t,n),this._queueTick()}function s(e){this._normalQueue._pushOne(e),this._queueTick()}function u(e){for(;e.length()>0;)l(e)}function l(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var n=e.shift(),r=e.shift();t.call(n,r)}}var c;try{throw new Error}catch(e){c=e}var f=e("./schedule"),h=e("./queue"),p=e("./util");o.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},o.prototype.hasCustomScheduler=function(){return this._customScheduler},o.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},o.prototype.disableTrampolineIfNecessary=function(){p.hasDevTools&&(this._trampolineEnabled=!1)},o.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},o.prototype.fatalError=function(e,n){n?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},o.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},p.hasDevTools?(o.prototype.invokeLater=function(e,t,n){this._trampolineEnabled?i.call(this,e,t,n):this._schedule(function(){setTimeout(function(){e.call(t,n)},100)})},o.prototype.invoke=function(e,t,n){this._trampolineEnabled?a.call(this,e,t,n):this._schedule(function(){e.call(t,n)})},o.prototype.settlePromises=function(e){this._trampolineEnabled?s.call(this,e):this._schedule(function(){e._settlePromises()})}):(o.prototype.invokeLater=i,o.prototype.invoke=a,o.prototype.settlePromises=s),o.prototype._drainQueues=function(){u(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,u(this._lateQueue)},o.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},o.prototype._reset=function(){this._isTickUsed=!1},n.exports=o,n.exports.firstLineError=c},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,n){t.exports=function(e,t,n,r){var o=!1,i=function(e,t){this._reject(t)},a=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(i,i,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},u=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(i){o||(o=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var l=n(i),c=new e(t);c._propagateFrom(this,1);var f=this._target();if(c._setBoundTo(l),l instanceof e){var h={promiseRejectionQueued:!1,promise:c,target:f,bindingPromise:l};f._then(t,a,void 0,c,h),l._then(s,u,void 0,c,h),c._setOnCancel(l)}else c._resolveCallback(f);return c},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,n){return e.resolve(n).bind(t)}}},{}],4:[function(e,t,n){function r(){try{Promise===i&&(Promise=o)}catch(e){}return i}var o;"undefined"!=typeof Promise&&(o=Promise);var i=e("./promise")();i.noConflict=r,t.exports=i},{"./promise":22}],5:[function(e,t,n){var r=Object.create;if(r){var o=r(null),i=r(null);o[" size"]=i[" size"]=0}t.exports=function(t){function n(e,n){var r;if(null!=e&&(r=e[n]),"function"!=typeof r){var o="Object "+s.classString(e)+" has no method '"+s.toString(n)+"'";throw new t.TypeError(o)}return r}function r(e){return n(e,this.pop()).apply(e,this)}function o(e){return e[this]}function i(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}var a,s=e("./util"),u=s.canEvaluate;s.isIdentifier;t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(r,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t,n="number"==typeof e;if(n)t=i;else if(u){var r=a(e);t=null!==r?r:o}else t=o;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,n){t.exports=function(t,n,r,o){var i=e("./util"),a=i.tryCatch,s=i.errorObj,u=t._async;t.prototype.break=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(i.isArray(e))for(var n=0;n<e.length;++n)this._doInvokeOnCancel(e[n],t);else if(void 0!==e)if("function"==typeof e){if(!t){var r=a(e).call(this._boundValue());r===s&&(this._attachExtraTrace(r.e),u.throwLater(r.e))}}else e._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,e)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(e,t,n){t.exports=function(t){function n(e,n,s){return function(u){var l=s._boundValue();e:for(var c=0;c<e.length;++c){var f=e[c];if(f===Error||null!=f&&f.prototype instanceof Error){if(u instanceof f)return i(n).call(l,u)}else if("function"==typeof f){var h=i(f).call(l,u);if(h===a)return h;if(h)return i(n).call(l,u)}else if(r.isObject(u)){for(var p=o(f),d=0;d<p.length;++d){var y=p[d];if(f[y]!=u[y])continue e}return i(n).call(l,u)}}return t}}var r=e("./util"),o=e("./es5").keys,i=r.tryCatch,a=r.errorObj;return n}},{"./es5":13,"./util":36}],8:[function(e,t,n){t.exports=function(e){function t(){this._trace=new t.CapturedTrace(r())}function n(){if(o)return new t}function r(){var e=i.length-1;if(e>=0)return i[e]}var o=!1,i=[];return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},t.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace))},t.prototype._popContext=function(){if(void 0!==this._trace){var e=i.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},t.CapturedTrace=null,t.create=n,t.deactivateLongStackTraces=function(){},t.activateLongStackTraces=function(){var n=e.prototype._pushContext,i=e.prototype._popContext,a=e._peekContext,s=e.prototype._peekContext,u=e.prototype._promiseCreated;t.deactivateLongStackTraces=function(){e.prototype._pushContext=n,e.prototype._popContext=i,e._peekContext=a,e.prototype._peekContext=s,e.prototype._promiseCreated=u,o=!1},o=!0,e.prototype._pushContext=t.prototype._pushContext,e.prototype._popContext=t.prototype._popContext,e._peekContext=e.prototype._peekContext=r,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},t}},{}],9:[function(e,n,r){n.exports=function(n,r){function o(e,t){return{promise:t}}function i(){return!1}function a(e,t,n){var r=this;try{e(t,n,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+D.toString(e));r._attachCancellationCallback(e)})}catch(e){return e}}function s(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?D.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function u(){return this._onCancelField}function l(e){this._onCancelField=e}function c(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(e,t){if(0!=(1&t)){this._cancellationParent=e;var n=e._branchesRemainingToCancel;void 0===n&&(n=0),e._branchesRemainingToCancel=n+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function h(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function p(){var e=this._boundTo;return void 0!==e&&e instanceof n?e.isFulfilled()?e.value():void 0:e}function d(){this._trace=new U(this._peekContext())}function y(e,t){if(H(e)){var n=this._trace;if(void 0!==n&&t&&(n=n._parent),void 0!==n)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var r=C(e);D.notEnumerableProp(e,"stack",r.message+"\n"+r.stack.join("\n")),D.notEnumerableProp(e,"__stackCleaned__",!0)}}}function v(){this._trace=void 0}function _(e,t,n,r,o){if(void 0===e&&null!==t&&K){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&r._bitField))return;n&&(n+=" ");var i="",a="";if(t._trace){for(var s=t._trace.stack.split("\n"),u=E(s),l=u.length-1;l>=0;--l){var c=u[l];if(!G.test(c)){var f=c.match(z);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0)for(var h=u[0],l=0;l<s.length;++l)if(s[l]===h){l>0&&(a="\n"+s[l-1]);break}}var p="a promise was created in a "+n+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(p,!0,t)}}function g(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),m(n)}function m(e,t,r){if(ue.warnings){var o,i=new B(e);if(t)r._attachExtraTrace(i);else if(ue.longStackTraces&&(o=n._peekContext()))o.attachExtraTrace(i);else{var a=C(i);i.stack=a.message+"\n"+a.stack.join("\n")}re("warning",i)||k(i,"",!0)}}function b(e,t){for(var n=0;n<t.length-1;++n)t[n].push("From previous event:"),t[n]=t[n].join("\n");return n<t.length&&(t[n]=t[n].join("\n")),e+"\n"+t.join("\n")}function w(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}function A(e){for(var t=e[0],n=1;n<e.length;++n){for(var r=e[n],o=t.length-1,i=t[o],a=-1,s=r.length-1;s>=0;--s)if(r[s]===i){a=s;break}for(var s=a;s>=0;--s){var u=r[s];if(t[o]!==u)break;t.pop(),o--}t=r}}function E(e){for(var t=[],n=0;n<e.length;++n){var r=e[n],o=" (No stack trace)"===r||V.test(r),i=o&&ie(r);o&&!i&&(Q&&" "!==r.charAt(0)&&(r=" "+r),t.push(r))}return t}function O(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),n=0;n<t.length;++n){var r=t[n];if(" (No stack trace)"===r||V.test(r))break}return n>0&&"SyntaxError"!=e.name&&(t=t.slice(n)),t}function C(e){var t=e.stack,n=e.toString();return t="string"==typeof t&&t.length>0?O(e):[" (No stack trace)"],{message:n,stack:"SyntaxError"==e.name?t:E(t)}}function k(e,t,n){if("undefined"!=typeof console){var r;if(D.isObject(e)){var o=e.stack;r=t+X(o,e)}else r=t+String(e);"function"==typeof N?N(r,n):"function"!=typeof console.log&&"object"!==_typeof2(console.log)||console.log(r)}}function P(e,t,n,r){var o=!1;try{"function"==typeof t&&(o=!0,"rejectionHandled"===e?t(r):t(n,r))}catch(e){F.throwLater(e)}"unhandledRejection"===e?re(e,n,r)||o||k(n,"Unhandled rejection "):re(e,r)}function S(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():D.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+T(t)+">, no stack trace)"}function T(e){return e.length<41?e:e.substr(0,38)+"..."}function j(){return"function"==typeof se}function x(e){var t=e.match(ae);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function R(e,t){if(j()){for(var n,r,o=e.stack.split("\n"),i=t.stack.split("\n"),a=-1,s=-1,u=0;u<o.length;++u){var l=x(o[u]);if(l){n=l.fileName,a=l.line;break}}for(var u=0;u<i.length;++u){var l=x(i[u]);if(l){r=l.fileName,s=l.line;break}}a<0||s<0||!n||!r||n!==r||a>=s||(ie=function(e){if(q.test(e))return!0;var t=x(e);return!!(t&&t.fileName===n&&a<=t.line&&t.line<=s)})}}function U(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);se(this,U),t>32&&this.uncycle()}var M,I,N,L=n._getDomain,F=n._async,B=e("./errors").Warning,D=e("./util"),J=e("./es5"),H=D.canAttachTrace,q=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,G=/\((?:timers\.js):\d+:\d+\)/,z=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,V=null,X=null,Q=!1,$=!(0==D.env("BLUEBIRD_DEBUG")),Y=!(0==D.env("BLUEBIRD_WARNINGS")||!$&&!D.env("BLUEBIRD_WARNINGS")),W=!(0==D.env("BLUEBIRD_LONG_STACK_TRACES")||!$&&!D.env("BLUEBIRD_LONG_STACK_TRACES")),K=0!=D.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(Y||!!D.env("BLUEBIRD_W_FORGOTTEN_RETURN"));n.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},n.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var e=this;setTimeout(function(){e._notifyUnhandledRejection()},1)}},n.prototype._notifyUnhandledRejectionIsHandled=function(){P("rejectionHandled",M,void 0,this)},n.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},n.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},n.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),P("unhandledRejection",I,e,this)}},n.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},n.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},n.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},n.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},n.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},n.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},n.prototype._warn=function(e,t,n){return m(e,t,n||this)},n.onPossiblyUnhandledRejection=function(e){var t=L();I="function"==typeof e?null===t?e:D.domainBind(t,e):void 0},n.onUnhandledRejectionHandled=function(e){var t=L();M="function"==typeof e?null===t?e:D.domainBind(t,e):void 0};var Z=function(){};n.longStackTraces=function(){if(F.haveItemsQueued()&&!ue.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ue.longStackTraces&&j()){var e=n.prototype._captureStackTrace,t=n.prototype._attachExtraTrace,o=n.prototype._dereferenceTrace;ue.longStackTraces=!0,Z=function(){if(F.haveItemsQueued()&&!ue.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");n.prototype._captureStackTrace=e,n.prototype._attachExtraTrace=t,n.prototype._dereferenceTrace=o,r.deactivateLongStackTraces(),F.enableTrampoline(),ue.longStackTraces=!1},n.prototype._captureStackTrace=d,n.prototype._attachExtraTrace=y,n.prototype._dereferenceTrace=v,r.activateLongStackTraces(),F.disableTrampolineIfNecessary()}},n.hasLongStackTraces=function(){return ue.longStackTraces&&j()};var ee=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return D.global.dispatchEvent(e),function(e,t){var n={detail:t,cancelable:!0};J.defineProperty(n,"promise",{value:t.promise}),J.defineProperty(n,"reason",{value:t.reason});var r=new CustomEvent(e.toLowerCase(),n);return!D.global.dispatchEvent(r)}}if("function"==typeof Event){var e=new Event("CustomEvent");return D.global.dispatchEvent(e),function(e,t){var n=new Event(e.toLowerCase(),{cancelable:!0});return n.detail=t,J.defineProperty(n,"promise",{value:t.promise}),J.defineProperty(n,"reason",{value:t.reason}),!D.global.dispatchEvent(n)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),D.global.dispatchEvent(e),function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e.toLowerCase(),!1,!0,t),!D.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),te=function(){return D.isNode?function(){return t.emit.apply(t,arguments)}:D.global?function(e){var t="on"+e.toLowerCase(),n=D.global[t];return!!n&&(n.apply(D.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),ne={promiseCreated:o,promiseFulfilled:o,promiseRejected:o,promiseResolved:o,promiseCancelled:o,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:o},re=function(e){var t=!1;try{t=te.apply(null,arguments)}catch(e){F.throwLater(e),t=!0}var n=!1;try{n=ee(e,ne[e].apply(null,arguments))}catch(e){F.throwLater(e),n=!0}return n||t};n.config=function(e){if(e=Object(e),"longStackTraces"in e&&(e.longStackTraces?n.longStackTraces():!e.longStackTraces&&n.hasLongStackTraces()&&Z()),"warnings"in e){var t=e.warnings;ue.warnings=!!t,K=ue.warnings,D.isObject(t)&&"wForgottenReturn"in t&&(K=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!ue.cancellation){if(F.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");n.prototype._clearCancellationData=c,n.prototype._propagateFrom=f,n.prototype._onCancel=u,n.prototype._setOnCancel=l,n.prototype._attachCancellationCallback=s,n.prototype._execute=a,oe=f,ue.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!ue.monitoring?(ue.monitoring=!0,n.prototype._fireEvent=re):!e.monitoring&&ue.monitoring&&(ue.monitoring=!1,n.prototype._fireEvent=i)),n},n.prototype._fireEvent=i,n.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}},n.prototype._onCancel=function(){},n.prototype._setOnCancel=function(e){},n.prototype._attachCancellationCallback=function(e){},n.prototype._captureStackTrace=function(){},n.prototype._attachExtraTrace=function(){},n.prototype._dereferenceTrace=function(){},n.prototype._clearCancellationData=function(){},n.prototype._propagateFrom=function(e,t){};var oe=h,ie=function(){return!1},ae=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;D.inherits(U,Error),r.CapturedTrace=U,U.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},r=0,o=this;void 0!==o;++r)t.push(o),o=o._parent;e=this._length=r;for(var r=e-1;r>=0;--r){var i=t[r].stack;void 0===n[i]&&(n[i]=r)}for(var r=0;r<e;++r){var a=t[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(t[s-1]._parent=void 0,t[s-1]._length=1),t[r]._parent=void 0,t[r]._length=1;var u=r>0?t[r-1]:this;s<e-1?(u._parent=t[s+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var l=u._length+1,c=r-2;c>=0;--c)t[c]._length=l,l++;return}}}},U.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=C(e),n=t.message,r=[t.stack],o=this;void 0!==o;)r.push(E(o.stack.split("\n"))),o=o._parent;A(r),w(r),D.notEnumerableProp(e,"stack",b(n,r)),D.notEnumerableProp(e,"__stackCleaned__",!0)}};var se=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():S(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,V=e,X=t;var n=Error.captureStackTrace;return ie=function(e){return q.test(e)},function(e,t){Error.stackTraceLimit+=6,n(e,t),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return V=/@/,X=t,Q=!0,function(e){e.stack=(new Error).stack};var o;try{throw new Error}catch(e){o="stack"in e}return"stack"in r||!o||"number"!=typeof Error.stackTraceLimit?(X=function(e,t){return"string"==typeof e?e:"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t||void 0===t.name||void 0===t.message?S(t):t.toString()},null):(V=e,X=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(N=function(e){console.warn(e)},D.isNode&&t.stderr.isTTY?N=function(e,t){var n=t?"[33m":"[31m";console.warn(n+e+"[0m\n")}:D.isNode||"string"!=typeof(new Error).stack||(N=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var ue={warnings:Y,longStackTraces:!1,cancellation:!1,monitoring:!1};return W&&n.longStackTraces(),{longStackTraces:function(){return ue.longStackTraces},warnings:function(){return ue.warnings},cancellation:function(){return ue.cancellation},monitoring:function(){return ue.monitoring},propagateFromFunction:function(){return oe},boundValueFunction:function(){return p},checkForgottenReturns:_,setBounds:R,warn:m,deprecated:g,CapturedTrace:U,fireDomEvent:ee,fireGlobalEvent:te}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(e,t,n){t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1],r=function(){throw t};return this.caught(e,r)},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();var o=function(){return r};return this.caught(n,o)}}},{}],11:[function(e,t,n){t.exports=function(e,t){function n(){return i(this)}function r(e,n){return o(e,n,t,t)}var o=e.reduce,i=e.all;e.prototype.each=function(e){return o(this,e,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return o(this,e,t,t)},e.each=function(e,r){return o(e,r,t,0)._then(n,void 0,void 0,e,void 0)},e.mapSeries=r}},{}],12:[function(e,t,n){function r(e,t){function n(r){if(!(this instanceof n))return new n(r);f(this,"message","string"==typeof r?r:t),f(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(n,Error),n}function o(e){if(!(this instanceof o))return new o(e);f(this,"name","OperationalError"),f(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(f(this,"message",e.message),f(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}var i,a,s=e("./es5"),u=s.freeze,l=e("./util"),c=l.inherits,f=l.notEnumerableProp,h=r("Warning","warning"),p=r("CancellationError","cancellation error"),d=r("TimeoutError","timeout error"),y=r("AggregateError","aggregate error");try{i=TypeError,a=RangeError}catch(e){i=r("TypeError","type error"),a=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),_=0;_<v.length;++_)"function"==typeof Array.prototype[v[_]]&&(y.prototype[v[_]]=Array.prototype[v[_]]);s.defineProperty(y.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),y.prototype.isOperational=!0;var g=0;y.prototype.toString=function(){var e=Array(4*g+1).join(" "),t="\n"+e+"AggregateError of:\n";g++,e=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",o=r.split("\n"),i=0;i<o.length;++i)o[i]=e+o[i];r=o.join("\n"),t+=r+"\n"}return g--,t},c(o,Error);var m=Error.__BluebirdErrorTypes__;m||(m=u({CancellationError:p,TimeoutError:d,OperationalError:o,RejectionError:o,AggregateError:y}),s.defineProperty(Error,"__BluebirdErrorTypes__",{value:m,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:i,RangeError:a,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:h}},{"./es5":13,"./util":36}],13:[function(e,t,n){var r=function(){return void 0===this}();if(r)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!(n&&!n.writable&&!n.set)}};else{var o={}.hasOwnProperty,i={}.toString,a={}.constructor.prototype,s=function(e){var t=[];for(var n in e)o.call(e,n)&&t.push(n);return t},u=function(e,t){return{value:e[t]}},l=function(e,t,n){return e[t]=n.value,e},c=function(e){return e},f=function(e){try{return Object(e).constructor.prototype}catch(e){return a}},h=function(e){try{return"[object Array]"===i.call(e)}catch(e){return!1}};t.exports={isArray:h,keys:s,names:s,defineProperty:l,getDescriptor:u,freeze:c,getPrototypeOf:f,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(e,t,n){t.exports=function(e,t){var n=e.map;e.prototype.filter=function(e,r){return n(this,e,r,t)},e.filter=function(e,r,o){return n(e,r,o,t)}}},{}],15:[function(e,t,n){t.exports=function(t,n,r){function o(e,t,n){this.promise=e,this.type=t,this.handler=n,this.called=!1,this.cancelPromise=null}function i(e){this.finallyHandler=e}function a(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function s(){return l.call(this,this.promise._target()._settledValue())}function u(e){if(!a(this,e))return h.e=e,h}function l(e){var o=this.promise,l=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?l.call(o._boundValue()):l.call(o._boundValue(),e);if(c===r)return c;if(void 0!==c){o._setReturnedNonUndefined();var p=n(c,o);if(p instanceof t){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new f("late cancellation observer");return o._attachExtraTrace(d),h.e=d,h}p.isPending()&&p._attachCancellationCallback(new i(this))}return p._then(s,u,void 0,this,void 0)}}}return o.isRejected()?(a(this),h.e=e,h):(a(this),e)}var c=e("./util"),f=t.CancellationError,h=c.errorObj,p=e("./catch_filter")(r);return o.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){a(this.finallyHandler)},t.prototype._passThrough=function(e,t,n,r){return"function"!=typeof e?this.then():this._then(n,r,void 0,new o(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,l,l)},t.prototype.tap=function(e){return this._passThrough(e,1,l)},t.prototype.tapCatch=function(e){var n=arguments.length;if(1===n)return this._passThrough(e,1,void 0,l);var r,o=new Array(n-1),i=0;for(r=0;r<n-1;++r){var a=arguments[r];if(!c.isObject(a))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+c.classString(a)));o[i++]=a}o.length=i;var s=arguments[r];return this._passThrough(p(o,s,this),1,void 0,l)},o}},{"./catch_filter":7,"./util":36}],16:[function(e,t,n){t.exports=function(t,n,r,o,i,a){function s(e,n,r){for(var i=0;i<n.length;++i){r._pushContext();var a=p(n[i])(e);if(r._popContext(),a===h){r._pushContext();var s=t.reject(h.e);return r._popContext(),s}var u=o(a,r);if(u instanceof t)return u}return null}function u(e,n,o,i){if(a.cancellation()){var s=new t(r),u=this._finallyPromise=new t(r);this._promise=s.lastly(function(){return u}),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new t(r))._captureStackTrace()}this._stack=i,this._generatorFunction=e,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(d):d,this._yieldedPromise=null,this._cancellationPhase=!1}var l=e("./errors"),c=l.TypeError,f=e("./util"),h=f.errorObj,p=f.tryCatch,d=[];f.inherits(u,i),u.prototype._isResolved=function(){return null===this._promise},u.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},u.prototype._promiseCancelled=function(){if(!this._isResolved()){var e,n=void 0!==this._generator.return;if(n)this._promise._pushContext(),e=p(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=p(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},u.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=p(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},u.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=p(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},u.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},u.prototype.promise=function(){return this._promise},u.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},u.prototype._continue=function(e){var n=this._promise;if(e===h)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(e.e,!1);var r=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var i=o(r,this._promise);if(!(i instanceof t)&&null===(i=s(i,this._yieldHandlers,this._promise)))return void this._promiseRejected(new c("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(r))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));i=i._target();var a=i._bitField;0==(50397184&a)?(this._yieldedPromise=i,
i._proxy(this,null)):0!=(33554432&a)?t._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&a)?t._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled()},t.coroutine=function(e,t){if("function"!=typeof e)throw new c("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=Object(t).yieldHandler,r=u,o=(new Error).stack;return function(){var t=e.apply(this,arguments),i=new r(void 0,void 0,n,o),a=i.promise();return i._generator=t,i._promiseFulfilled(void 0),a}},t.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new c("expecting a function but got "+f.classString(e));d.push(e)},t.spawn=function(e){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof e)return n("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=new u(e,this),o=r.promise();return r._run(t.spawn),o}}},{"./errors":12,"./util":36}],17:[function(e,t,n){t.exports=function(t,n,r,o,i,a){var s=e("./util");s.canEvaluate,s.tryCatch,s.errorObj;t.join=function(){var e,t=arguments.length-1;if(t>0&&"function"==typeof arguments[t]){e=arguments[t];var r}var o=[].slice.call(arguments);e&&o.pop();var r=new n(o).promise();return void 0!==e?r.spread(e):r}}},{"./util":36}],18:[function(e,t,n){t.exports=function(t,n,r,o,i,a){function s(e,t,n,r){this.constructor$(e),this._promise._captureStackTrace();var o=l();this._callback=null===o?t:c.domainBind(o,t),this._preservedValues=r===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],p.invoke(this._asyncInit,this,void 0)}function u(e,n,o,i){if("function"!=typeof n)return r("expecting a function but got "+c.classString(n));var a=0;if(void 0!==o){if("object"!==(void 0===o?"undefined":_typeof2(o))||null===o)return t.reject(new TypeError("options argument must be an object but it is "+c.classString(o)));if("number"!=typeof o.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+c.classString(o.concurrency)));a=o.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new s(e,n,a,i).promise()}var l=t._getDomain,c=e("./util"),f=c.tryCatch,h=c.errorObj,p=t._async;c.inherits(s,n),s.prototype._asyncInit=function(){this._init$(void 0,-2)},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(e,n){var r=this._values,i=this.length(),s=this._preservedValues,u=this._limit;if(n<0){if(n=-1*n-1,r[n]=e,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return r[n]=e,this._queue.push(n),!1;null!==s&&(s[n]=e);var l=this._promise,c=this._callback,p=l._boundValue();l._pushContext();var d=f(c).call(p,e,n,i),y=l._popContext();if(a.checkForgottenReturns(d,y,null!==s?"Promise.filter":"Promise.map",l),d===h)return this._reject(d.e),!0;var v=o(d,this._promise);if(v instanceof t){v=v._target();var _=v._bitField;if(0==(50397184&_))return u>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0==(33554432&_))return 0!=(16777216&_)?(this._reject(v._reason()),!0):(this._cancel(),!0);d=v._value()}r[n]=d}return++this._totalResolved>=i&&(null!==s?this._filter(r,s):this._resolve(r),!0)},s.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var r=e.pop();this._promiseFulfilled(n[r],r)}},s.prototype._filter=function(e,t){for(var n=t.length,r=new Array(n),o=0,i=0;i<n;++i)e[i]&&(r[o++]=t[i]);r.length=o,this._resolve(r)},s.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(e,t){return u(this,e,t,null)},t.map=function(e,t,n,r){return u(e,t,n,r)}}},{"./util":36}],19:[function(e,t,n){t.exports=function(t,n,r,o,i){var a=e("./util"),s=a.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+a.classString(e));return function(){var r=new t(n);r._captureStackTrace(),r._pushContext();var o=s(e).apply(this,arguments),a=r._popContext();return i.checkForgottenReturns(o,a,"Promise.method",r),r._resolveFromSyncValue(o),r}},t.attempt=t.try=function(e){if("function"!=typeof e)return o("expecting a function but got "+a.classString(e));var r=new t(n);r._captureStackTrace(),r._pushContext();var u;if(arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];u=a.isArray(l)?s(e).apply(c,l):s(e).call(c,l)}else u=s(e)();var f=r._popContext();return i.checkForgottenReturns(u,f,"Promise.try",r),r._resolveFromSyncValue(u),r},t.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,n){function r(e){return e instanceof Error&&c.getPrototypeOf(e)===Error.prototype}function o(e){var t;if(r(e)){t=new l(e),t.name=e.name,t.message=e.message,t.stack=e.stack;for(var n=c.keys(e),o=0;o<n.length;++o){var i=n[o];f.test(i)||(t[i]=e[i])}return t}return a.markAsOriginatingFromRejection(e),e}function i(e,t){return function(n,r){if(null!==e){if(n){var i=o(s(n));e._attachExtraTrace(i),e._reject(i)}else if(t){var a=[].slice.call(arguments,1);e._fulfill(a)}else e._fulfill(r);e=null}}}var a=e("./util"),s=a.maybeWrapAsError,u=e("./errors"),l=u.OperationalError,c=e("./es5"),f=/^(?:name|message|stack|cause)$/;t.exports=i},{"./errors":12,"./es5":13,"./util":36}],21:[function(e,t,n){t.exports=function(t){function n(e,t){var n=this;if(!i.isArray(e))return r.call(n,e,t);var o=s(t).apply(n._boundValue(),[null].concat(e));o===u&&a.throwLater(o.e)}function r(e,t){var n=this,r=n._boundValue(),o=void 0===e?s(t).call(r,null):s(t).call(r,null,e);o===u&&a.throwLater(o.e)}function o(e,t){var n=this;if(!e){var r=new Error(e+"");r.cause=e,e=r}var o=s(t).call(n._boundValue(),e);o===u&&a.throwLater(o.e)}var i=e("./util"),a=t._async,s=i.tryCatch,u=i.errorObj;t.prototype.asCallback=t.prototype.nodeify=function(e,t){if("function"==typeof e){var i=r;void 0!==t&&Object(t).spread&&(i=n),this._then(i,o,void 0,this,e)}return this}}},{"./util":36}],22:[function(e,n,r){n.exports=function(){function r(){}function o(e,t){if(null==e||e.constructor!==i)throw new m("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new m("expecting a function but got "+d.classString(t))}function i(e){e!==w&&o(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function a(e){this.promise._resolveCallback(e)}function s(e){this.promise._rejectCallback(e,!1)}function u(e){var t=new i(w);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}var l,c=function(){return new m("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},f=function(){return new i.PromiseInspection(this._target())},h=function(e){return i.reject(new m(e))},p={},d=e("./util");l=d.isNode?function(){var e=t.domain;return void 0===e&&(e=null),e}:function(){return null},d.notEnumerableProp(i,"_getDomain",l);var y=e("./es5"),v=e("./async"),_=new v;y.defineProperty(i,"_async",{value:_});var g=e("./errors"),m=i.TypeError=g.TypeError;i.RangeError=g.RangeError;var b=i.CancellationError=g.CancellationError;i.TimeoutError=g.TimeoutError,i.OperationalError=g.OperationalError,i.RejectionError=g.OperationalError,i.AggregateError=g.AggregateError;var w=function(){},A={},E={},O=e("./thenables")(i,w),C=e("./promise_array")(i,w,O,h,r),k=e("./context")(i),P=k.create,S=e("./debuggability")(i,k),T=(S.CapturedTrace,e("./finally")(i,O,E)),j=e("./catch_filter")(E),x=e("./nodeback"),R=d.errorObj,U=d.tryCatch;return i.prototype.toString=function(){return"[object Promise]"},i.prototype.caught=i.prototype.catch=function(e){var t=arguments.length;if(t>1){var n,r=new Array(t-1),o=0;for(n=0;n<t-1;++n){var i=arguments[n];if(!d.isObject(i))return h("Catch statement predicate: expecting an object but got "+d.classString(i));r[o++]=i}return r.length=o,e=arguments[n],this.then(void 0,j(r,e,this))}return this.then(void 0,e)},i.prototype.reflect=function(){return this._then(f,f,void 0,this,void 0)},i.prototype.then=function(e,t){if(S.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var n=".then() only accepts functions but was passed: "+d.classString(e);arguments.length>1&&(n+=", "+d.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},i.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},i.prototype.spread=function(e){return"function"!=typeof e?h("expecting a function but got "+d.classString(e)):this.all()._then(e,void 0,void 0,A,void 0)},i.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new C(this).promise()},i.prototype.error=function(e){return this.caught(d.originatesFromRejection,e)},i.getNewLibraryCopy=n.exports,i.is=function(e){return e instanceof i},i.fromNode=i.fromCallback=function(e){var t=new i(w);t._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=U(e)(x(t,n));return r===R&&t._rejectCallback(r.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},i.all=function(e){return new C(e).promise()},i.cast=function(e){var t=O(e);return t instanceof i||(t=new i(w),t._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(e){var t=new i(w);return t._captureStackTrace(),t._rejectCallback(e,!0),t},i.setScheduler=function(e){if("function"!=typeof e)throw new m("expecting a function but got "+d.classString(e));return _.setScheduler(e)},i.prototype._then=function(e,t,n,r,o){var a=void 0!==o,s=a?o:new i(w),u=this._target(),c=u._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&c)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var f=l();if(0!=(50397184&c)){var h,p,y=u._settlePromiseCtx;0!=(33554432&c)?(p=u._rejectionHandler0,h=e):0!=(16777216&c)?(p=u._fulfillmentHandler0,h=t,u._unsetRejectionIsUnhandled()):(y=u._settlePromiseLateCancellationObserver,p=new b("late cancellation observer"),u._attachExtraTrace(p),h=t),_.invoke(y,u,{handler:null===f?h:"function"==typeof h&&d.domainBind(f,h),promise:s,receiver:r,value:p})}else u._addCallbacks(e,t,s,r,f);return s},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},i.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){_.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==p)return void 0===t&&this._isBound()?this._boundValue():t},i.prototype._promiseAt=function(e){return this[4*e-4+2]},i.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},i.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(e){var t=(e._bitField,e._fulfillmentHandler0),n=e._rejectionHandler0,r=e._promise0,o=e._receiverAt(0);void 0===o&&(o=p),this._addCallbacks(t,n,r,o,null)},i.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),r=e._rejectionHandlerAt(t),o=e._promiseAt(t),i=e._receiverAt(t);void 0===i&&(i=p),this._addCallbacks(n,r,o,i,null)},i.prototype._addCallbacks=function(e,t,n,r,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=n,this._receiver0=r,"function"==typeof e&&(this._fulfillmentHandler0=null===o?e:d.domainBind(o,e)),"function"==typeof t&&(this._rejectionHandler0=null===o?t:d.domainBind(o,t));else{var a=4*i-4;this[a+2]=n,this[a+3]=r,"function"==typeof e&&(this[a+0]=null===o?e:d.domainBind(o,e)),"function"==typeof t&&(this[a+1]=null===o?t:d.domainBind(o,t))}return this._setLength(i+1),i},i.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},i.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(c(),!1);var n=O(e,this);if(!(n instanceof i))return this._fulfill(e);t&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(c());var o=r._bitField;if(0==(50397184&o)){var a=this._length();a>0&&r._migrateCallback0(this);for(var s=1;s<a;++s)r._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!=(33554432&o))this._fulfill(r._value());else if(0!=(16777216&o))this._reject(r._reason());else{var u=new b("late cancellation observer");r._attachExtraTrace(u),this._reject(u)}}},i.prototype._rejectCallback=function(e,t,n){var r=d.ensureErrorObject(e),o=r===e;if(!o&&!n&&S.warnings()){var i="a promise was rejected with a non-error: "+d.classString(e);this._warn(i,!0)}this._attachExtraTrace(r,!!t&&o),this._reject(e)},i.prototype._resolveFromExecutor=function(e){if(e!==w){var t=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,n)});n=!1,this._popContext(),void 0!==r&&t._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(e,t,n,r){var o=r._bitField;if(0==(65536&o)){r._pushContext();var i;t===A?n&&"number"==typeof n.length?i=U(e).apply(this._boundValue(),n):(i=R,i.e=new m("cannot .spread() a non-array: "+d.classString(n))):i=U(e).call(t,n);var a=r._popContext();o=r._bitField,0==(65536&o)&&(i===E?r._reject(n):i===R?r._rejectCallback(i.e,!1):(S.checkForgottenReturns(i,a,"",r,this),r._resolveCallback(i)))}},i.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(e){this._rejectionHandler0=e},i.prototype._settlePromise=function(e,t,n,o){var a=e instanceof i,s=this._bitField,u=0!=(134217728&s);0!=(65536&s)?(a&&e._invokeInternalOnCancel(),n instanceof T&&n.isFinallyHandler()?(n.cancelPromise=e,U(t).call(n,o)===R&&e._reject(R.e)):t===f?e._fulfill(f.call(n)):n instanceof r?n._promiseCancelled(e):a||e instanceof C?e._cancel():n.cancel()):"function"==typeof t?a?(u&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,n,o,e)):t.call(n,o,e):n instanceof r?n._isResolved()||(0!=(33554432&s)?n._promiseFulfilled(o,e):n._promiseRejected(o,e)):a&&(u&&e._setAsyncGuaranteed(),0!=(33554432&s)?e._fulfill(o):e._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,n=e.promise,r=e.receiver,o=e.value;"function"==typeof t?n instanceof i?this._settlePromiseFromHandler(t,r,o,n):t.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},i.prototype._settlePromise0=function(e,t,n){var r=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,e,o,t)},i.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},i.prototype._fulfill=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(e===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():_.settlePromises(this),this._dereferenceTrace())}},i.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return _.fatalError(e,d.isNode);(65535&t)>0?_.settlePromises(this):this._ensurePossibleRejectionHandled()}},i.prototype._fulfillPromises=function(e,t){for(var n=1;n<e;n++){var r=this._fulfillmentHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,t)}},i.prototype._rejectPromises=function(e,t){for(var n=1;n<e;n++){var r=this._rejectionHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,t)}},i.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e),this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){return S.deprecated("Promise.defer","new Promise"),{promise:new i(w),resolve:a,reject:s}},d.notEnumerableProp(i,"_makeSelfResolutionError",c),e("./method")(i,w,O,h,S),e("./bind")(i,w,O,S),e("./cancel")(i,C,h,S),e("./direct_resolve")(i),e("./synchronous_inspection")(i),e("./join")(i,C,O,w,_,l),i.Promise=i,i.version="3.5.4",e("./map.js")(i,C,h,O,w,S),e("./call_get.js")(i),e("./using.js")(i,h,O,P,w,S),e("./timers.js")(i,w,S),e("./generators.js")(i,h,w,O,r,S),e("./nodeify.js")(i),e("./promisify.js")(i,w),e("./props.js")(i,C,O,h),e("./race.js")(i,w,O,h),e("./reduce.js")(i,C,h,O,w,S),e("./settle.js")(i,C,S),e("./some.js")(i,C,h),e("./filter.js")(i,w),e("./each.js")(i,w),e("./any.js")(i),d.toFastProperties(i),d.toFastProperties(i.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new i(w)),S.setBounds(v.firstLineError,d.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,n){t.exports=function(t,n,r,o,i){function a(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}function s(e){var r=this._promise=new t(n);e instanceof t&&r._propagateFrom(e,3),r._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=e("./util");u.isArray;return u.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(n,i){var s=r(this._values,this._promise);if(s instanceof t){s=s._target();var l=s._bitField;if(this._values=s,0==(50397184&l))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,i);if(0==(33554432&l))return 0!=(16777216&l)?this._reject(s._reason()):this._cancel();s=s._value()}if(null===(s=u.asArray(s))){var c=o("expecting an array or an iterable object but got "+u.classString(s)).reason();return void this._promise._rejectCallback(c,!1)}if(0===s.length)return void(-5===i?this._resolveEmptyArray():this._resolve(a(i)));this._iterate(s)},s.prototype._iterate=function(e){var n=this.getActualLength(e.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<n;++s){var u=r(e[s],o);u instanceof t?(u=u._target(),a=u._bitField):a=null,i?null!==a&&u.suppressUnhandledRejections():null!==a?0==(50397184&a)?(u._proxy(this,s),this._values[s]=u):i=0!=(33554432&a)?this._promiseFulfilled(u._value(),s):0!=(16777216&a)?this._promiseRejected(u._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(u,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},s.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n<e.length;++n)e[n]instanceof t&&e[n].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(e){return e},s}},{"./util":36}],24:[function(e,t,n){t.exports=function(t,n){function r(e){return!w.test(e)}function o(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function i(e,t,n){var r=p.getDataPropertyOrDefault(e,t+n,m);return!!r&&o(r)}function a(e,t,n){for(var r=0;r<e.length;r+=2){var o=e[r];if(n.test(o))for(var i=o.replace(n,""),a=0;a<e.length;a+=2)if(e[a]===i)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",t))}}function s(e,t,n,r){for(var s=p.inheritedDataKeys(e),u=[],l=0;l<s.length;++l){var c=s[l],f=e[c],h=r===A||A(c,f,e);"function"!=typeof f||o(f)||i(e,c,t)||!r(c,f,e,h)||u.push(c,f)}return a(u,t,n),u}function u(e,r,o,i,a,s){function u(){var o=r;r===h&&(o=this);var i=new t(n);i._captureStackTrace();var a="string"==typeof c&&this!==l?this[c]:e,u=d(i,s);try{a.apply(o,y(arguments,u))}catch(e){i._rejectCallback(v(e),!0,!0)}return i._isFateSealed()||i._setAsyncGuaranteed(),i}var l=function(){return this}(),c=e;return"string"==typeof c&&(e=i),p.notEnumerableProp(u,"__isPromisified__",!0),u}function l(e,t,n,r,o){for(var i=new RegExp(E(t)+"$"),a=s(e,t,i,n),u=0,l=a.length;u<l;u+=2){var c=a[u],f=a[u+1],d=c+t;if(r===O)e[d]=O(c,h,c,f,t,o);else{var y=r(f,function(){return O(c,h,c,f,t,o)});p.notEnumerableProp(y,"__isPromisified__",!0),e[d]=y}}return p.toFastProperties(e),e}function c(e,t,n){return O(e,t,void 0,e,null,n)}var f,h={},p=e("./util"),d=e("./nodeback"),y=p.withAppended,v=p.maybeWrapAsError,_=p.canEvaluate,g=e("./errors").TypeError,m={__isPromisified__:!0},b=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],w=new RegExp("^(?:"+b.join("|")+")$"),A=function(e){return p.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e},E=function(e){return e.replace(/([$])/,"\\$")},O=_?f:u;t.promisify=function(e,t){if("function"!=typeof e)throw new g("expecting a function but got "+p.classString(e));if(o(e))return e;t=Object(t);var n=void 0===t.context?h:t.context,i=!!t.multiArgs,a=c(e,n,i);return p.copyDescriptors(e,a,r),a},t.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!==(void 0===e?"undefined":_typeof2(e)))throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");t=Object(t);var n=!!t.multiArgs,r=t.suffix;"string"!=typeof r&&(r="Async");var o=t.filter;"function"!=typeof o&&(o=A);var i=t.promisifier;if("function"!=typeof i&&(i=O),!p.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var a=p.inheritedDataKeys(e),s=0;s<a.length;++s){var u=e[a[s]];"constructor"!==a[s]&&p.isClass(u)&&(l(u.prototype,r,o,i,n),l(u,r,o,i,n))}return l(e,r,o,i,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(e,t,n){t.exports=function(t,n,r,o){function i(e){var t,n=!1;if(void 0!==s&&e instanceof s)t=f(e),n=!0;else{var r=c.keys(e),o=r.length;t=new Array(2*o);for(var i=0;i<o;++i){var a=r[i];t[i]=e[a],t[i+o]=a}}this.constructor$(t),this._isMap=n,this._init$(void 0,n?-6:-3)}function a(e){var n,a=r(e);return l(a)?(n=a instanceof t?a._then(t.props,void 0,void 0,void 0,void 0):new i(a).promise(),a instanceof t&&n._propagateFrom(a,2),n):o("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var s,u=e("./util"),l=u.isObject,c=e("./es5");"function"==typeof Map&&(s=Map);var f=function(){function e(e,r){this[t]=e,this[t+n]=r,t++}var t=0,n=0;return function(r){n=r.size,t=0;var o=new Array(2*r.size);return r.forEach(e,o),o}}(),h=function(e){for(var t=new s,n=e.length/2|0,r=0;r<n;++r){var o=e[n+r],i=e[r];t.set(o,i)}return t};u.inherits(i,n),i.prototype._init=function(){},i.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var n;if(this._isMap)n=h(this._values);else{n={};for(var r=this.length(),o=0,i=this.length();o<i;++o)n[this._values[o+r]]=this._values[o]}return this._resolve(n),!0}return!1},i.prototype.shouldCopyValues=function(){return!1},i.prototype.getActualLength=function(e){return e>>1},t.prototype.props=function(){return a(this)},t.props=function(e){return a(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,n){function r(e,t,n,r,o){for(var i=0;i<o;++i)n[i+r]=e[i+t],e[i+t]=void 0}function o(e){this._capacity=e,this._length=0,this._front=0}o.prototype._willBeOverCapacity=function(e){return this._capacity<e},o.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},o.prototype.push=function(e,t,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(e),this._pushOne(t),void this._pushOne(n);var o=this._front+r-3;this._checkCapacity(r);var i=this._capacity-1;this[o+0&i]=e,this[o+1&i]=t,this[o+2&i]=n,this._length=r},o.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},o.prototype.length=function(){return this._length},o.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},o.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,r(this,0,this,t,this._front+this._length&t-1)},t.exports=o},{}],27:[function(e,t,n){t.exports=function(t,n,r,o){function i(e,i){var u=r(e);if(u instanceof t)return s(u);if(null===(e=a.asArray(e)))return o("expecting an array or an iterable object but got "+a.classString(e));var l=new t(n);void 0!==i&&l._propagateFrom(i,3);for(var c=l._fulfill,f=l._reject,h=0,p=e.length;h<p;++h){var d=e[h];(void 0!==d||h in e)&&t.cast(d)._then(c,f,void 0,l,null)}return l}var a=e("./util"),s=function(e){return e.then(function(t){return i(t,e)})};t.race=function(e){return i(e,void 0)},t.prototype.race=function(){return i(this,void 0)}}},{"./util":36}],28:[function(e,t,n){t.exports=function(t,n,r,o,i,a){function s(e,n,r,o){this.constructor$(e);var a=h();this._fn=null===a?n:p.domainBind(a,n),void 0!==r&&(r=t.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function u(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function l(e,t,n,o){return"function"!=typeof t?r("expecting a function but got "+p.classString(t)):new s(e,t,n,o).promise()}function c(e){this.accum=e,this.array._gotAccum(e);var n=o(this.value,this.array._promise);return n instanceof t?(this.array._currentCancellable=n,n._then(f,void 0,void 0,this,void 0)):f.call(this,n)}function f(e){var n=this.array,r=n._promise,o=d(n._fn);r._pushContext();var i;(i=void 0!==n._eachValues?o.call(r._boundValue(),e,this.index,this.length):o.call(r._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(n._currentCancellable=i);var s=r._popContext();return a.checkForgottenReturns(i,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),i}var h=t._getDomain,p=e("./util"),d=p.tryCatch;p.inherits(s,n),s.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==i&&this._eachValues.push(e)},s.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},s.prototype.shouldCopyValues=function(){return!1},s.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},s.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},s.prototype._iterate=function(e){this._values=e;var n,r,o=e.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=t.resolve(e[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;r<o;++r){var i={accum:null,value:e[r],index:r,length:o,array:this};n=n._then(c,void 0,void 0,i,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(u,u,void 0,n,this)},t.prototype.reduce=function(e,t){return l(this,e,t,null)},t.reduce=function(e,t,n,r){return l(e,t,n,r)}}},{"./util":36}],29:[function(e,n,r){var a,s=e("./util"),u=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},l=s.getNativePromise();if(s.isNode&&"undefined"==typeof MutationObserver){var c=o.setImmediate,f=t.nextTick;a=s.isRecentNode?function(e){c.call(o,e)}:function(e){f.call(t,e)}}else if("function"==typeof l&&"function"==typeof l.resolve){var h=l.resolve();a=function(e){h.then(e)}}else a="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?void 0!==i?function(e){i(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:u:function(){var e=document.createElement("div"),t={attributes:!0},n=!1,r=document.createElement("div");new MutationObserver(function(){e.classList.toggle("foo"),n=!1}).observe(r,t);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(e,t),o()}}();n.exports=a},{"./util":36}],30:[function(e,t,n){t.exports=function(t,n,r){function o(e){this.constructor$(e)}var i=t.PromiseInspection;e("./util").inherits(o,n),o.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(e,t){var n=new i;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},o.prototype._promiseRejected=function(e,t){var n=new i;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new o(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,n){t.exports=function(t,n,r){function o(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function i(e,t){if((0|t)!==t||t<0)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n")
;var n=new o(e),i=n.promise();return n.setHowMany(t),n.init(),i}var a=e("./util"),s=e("./errors").RangeError,u=e("./errors").AggregateError,l=a.isArray,c={};a.inherits(o,n),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var e=l(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},o.prototype.init=function(){this._initialized=!0,this._init()},o.prototype.setUnwrap=function(){this._unwrap=!0},o.prototype.howMany=function(){return this._howMany},o.prototype.setHowMany=function(e){this._howMany=e},o.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},o.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},o.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new u,t=this.length();t<this._values.length;++t)this._values[t]!==c&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},o.prototype._fulfilled=function(){return this._totalResolved},o.prototype._rejected=function(){return this._values.length-this.length()},o.prototype._addRejected=function(e){this._values.push(e)},o.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},o.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},o.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new s(t)},o.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return i(e,t)},t.prototype.some=function(e){return i(this,e)},t._SomePromiseArray=o}},{"./errors":12,"./util":36}],32:[function(e,t,n){t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var n=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},i=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return a.call(this._target())},e.prototype.isRejected=function(){return i.call(this._target())},e.prototype.isFulfilled=function(){return o.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),r.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,n){t.exports=function(t,n){function r(e,r){if(c(e)){if(e instanceof t)return e;var o=i(e);if(o===l){r&&r._pushContext();var u=t.reject(o.e);return r&&r._popContext(),u}if("function"==typeof o){if(a(e)){var u=new t(n);return e._then(u._fulfill,u._reject,void 0,u,null),u}return s(e,o,r)}}return e}function o(e){return e.then}function i(e){try{return o(e)}catch(e){return l.e=e,l}}function a(e){try{return f.call(e,"_promise0")}catch(e){return!1}}function s(e,r,o){function i(e){s&&(s._resolveCallback(e),s=null)}function a(e){s&&(s._rejectCallback(e,f,!0),s=null)}var s=new t(n),c=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var f=!0,h=u.tryCatch(r).call(e,i,a);return f=!1,s&&h===l&&(s._rejectCallback(h.e,!0,!0),s=null),c}var u=e("./util"),l=u.errorObj,c=u.isObject,f={}.hasOwnProperty;return r}},{"./util":36}],34:[function(e,t,n){t.exports=function(t,n,r){function o(e){this.handle=e}function i(e){return clearTimeout(this.handle),e}function a(e){throw clearTimeout(this.handle),e}var s=e("./util"),u=t.TimeoutError;o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(e){return c(+this).thenReturn(e)},c=t.delay=function(e,i){var a,s;return void 0!==i?(a=t.resolve(i)._then(l,null,null,e,void 0),r.cancellation()&&i instanceof t&&a._setOnCancel(i)):(a=new t(n),s=setTimeout(function(){a._fulfill()},+e),r.cancellation()&&a._setOnCancel(new o(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};t.prototype.delay=function(e){return c(e,this)};var f=function(e,t,n){var r;r="string"!=typeof t?t instanceof Error?t:new u("operation timed out"):new u(t),s.markAsOriginatingFromRejection(r),e._attachExtraTrace(r),e._reject(r),null!=n&&n.cancel()};t.prototype.timeout=function(e,t){e=+e;var n,s,u=new o(setTimeout(function(){n.isPending()&&f(n,t,s)},e));return r.cancellation()?(s=this.then(),n=s._then(i,a,void 0,u,void 0),n._setOnCancel(u)):n=this._then(i,a,void 0,u,void 0),n}}},{"./util":36}],35:[function(e,t,n){t.exports=function(t,n,r,o,i,a){function s(e){setTimeout(function(){throw e},0)}function u(e){var t=r(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}function l(e,n){function o(){if(a>=l)return c._fulfill();var i=u(e[a++]);if(i instanceof t&&i._isDisposable()){try{i=r(i._getDisposer().tryDispose(n),e.promise)}catch(e){return s(e)}if(i instanceof t)return i._then(o,s,null,null,null)}o()}var a=0,l=e.length,c=new t(i);return o(),c}function c(e,t,n){this._data=e,this._promise=t,this._context=n}function f(e,t,n){this.constructor$(e,t,n)}function h(e){return c.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function p(e){this.length=e,this.promise=null,this[e-1]=null}var d=e("./util"),y=e("./errors").TypeError,v=e("./util").inherits,_=d.errorObj,g=d.tryCatch,m={};c.prototype.data=function(){return this._data},c.prototype.promise=function(){return this._promise},c.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():m},c.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t!==m?this.doDispose(t,e):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},c.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},v(f,c),f.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},p.prototype._resultCancelled=function(){for(var e=this.length,n=0;n<e;++n){var r=this[n];r instanceof t&&r.cancel()}},t.using=function(){var e=arguments.length;if(e<2)return n("you must pass at least 2 arguments to Promise.using");var o=arguments[e-1];if("function"!=typeof o)return n("expecting a function but got "+d.classString(o));var i,s=!0;2===e&&Array.isArray(arguments[0])?(i=arguments[0],e=i.length,s=!1):(i=arguments,e--);for(var u=new p(e),f=0;f<e;++f){var y=i[f];if(c.isDisposer(y)){var v=y;y=y.promise(),y._setDisposable(v)}else{var m=r(y);m instanceof t&&(y=m._then(h,null,null,{resources:u,index:f},void 0))}u[f]=y}for(var b=new Array(u.length),f=0;f<b.length;++f)b[f]=t.resolve(u[f]).reflect();var w=t.all(b).then(function(e){for(var t=0;t<e.length;++t){var n=e[t];if(n.isRejected())return _.e=n.error(),_;if(!n.isFulfilled())return void w.cancel();e[t]=n.value()}A._pushContext(),o=g(o);var r=s?o.apply(void 0,e):o(e),i=A._popContext();return a.checkForgottenReturns(r,i,"Promise.using",A),r}),A=w.lastly(function(){var e=new t.PromiseInspection(w);return l(u,e)});return u.promise=A,A._setOnCancel(u),A},t.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new f(e,this,o());throw new y}}},{"./errors":12,"./util":36}],36:[function(e,n,r){function i(){try{var e=x;return x=null,e.apply(this,arguments)}catch(e){return j.e=e,j}}function a(e){return x=e,i}function s(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function u(e){return"function"==typeof e||"object"===(void 0===e?"undefined":_typeof2(e))&&null!==e}function l(e){return s(e)?new Error(g(e)):e}function c(e,t){var n,r=e.length,o=new Array(r+1);for(n=0;n<r;++n)o[n]=e[n];return o[n]=t,o}function f(e,t,n){if(!S.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var r=Object.getOwnPropertyDescriptor(e,t);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function h(e,t,n){if(s(e))return e;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return S.defineProperty(e,t,r),e}function p(e){throw e}function d(e){try{if("function"==typeof e){var t=S.names(e.prototype),n=S.isES5&&t.length>1,r=t.length>0&&!(1===t.length&&"constructor"===t[0]),o=I.test(e+"")&&S.names(e).length>0;if(n||r||o)return!0}return!1}catch(e){return!1}}function y(e){function t(){}function n(){return _typeof2(r.foo)}t.prototype=e;var r=new t;return n(),n(),e}function v(e){return N.test(e)}function _(e,t,n){for(var r=new Array(e),o=0;o<e;++o)r[o]=t+o+n;return r}function g(e){try{return e+""}catch(e){return"[no string representation]"}}function m(e){return e instanceof Error||null!==e&&"object"===(void 0===e?"undefined":_typeof2(e))&&"string"==typeof e.message&&"string"==typeof e.name}function b(e){try{h(e,"isOperational",!0)}catch(e){}}function w(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)}function A(e){return m(e)&&S.propertyIsWritable(e,"stack")}function E(e){return{}.toString.call(e)}function O(e,t,n){for(var r=S.names(e),o=0;o<r.length;++o){var i=r[o];if(n(i))try{S.defineProperty(t,i,S.getDescriptor(e,i))}catch(e){}}}function C(e){return J?t.env[e]:void 0}function k(){if("function"==typeof Promise)try{var e=new Promise(function(){});if("[object Promise]"==={}.toString.call(e))return Promise}catch(e){}}function P(e,t){return e.bind(t)}var S=e("./es5"),T="undefined"==typeof navigator,j={e:{}},x,R="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==o?o:void 0!==this?this:null,U=function(e,t){function n(){this.constructor=e,this.constructor$=t;for(var n in t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}var r={}.hasOwnProperty;return n.prototype=t.prototype,e.prototype=new n,e.prototype},M=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1};if(S.isES5){var n=Object.getOwnPropertyNames;return function(e){for(var r=[],o=Object.create(null);null!=e&&!t(e);){var i;try{i=n(e)}catch(e){return r}for(var a=0;a<i.length;++a){var s=i[a];if(!o[s]){o[s]=!0;var u=Object.getOwnPropertyDescriptor(e,s);null!=u&&null==u.get&&null==u.set&&r.push(s)}}e=S.getPrototypeOf(e)}return r}}var r={}.hasOwnProperty;return function(n){if(t(n))return[];var o=[];e:for(var i in n)if(r.call(n,i))o.push(i);else{for(var a=0;a<e.length;++a)if(r.call(e[a],i))continue e;o.push(i)}return o}}(),I=/this\s*\.\s*\S+\s*=/,N=/^[a-z$_][a-z$_0-9]*$/i,L=function(){return"stack"in new Error?function(e){return A(e)?e:new Error(g(e))}:function(e){if(A(e))return e;try{throw new Error(g(e))}catch(e){return e}}}(),F=function(e){return S.isArray(e)?e:null};if("undefined"!=typeof Symbol&&("function"==typeof Symbol?Symbol.iterator:"@@iterator")){var B="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,n=[],r=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(t=r.next()).done;)n.push(t.value);return n};F=function(e){return S.isArray(e)?e:null!=e&&"function"==typeof e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]?B(e):null}}var D=void 0!==t&&"[object process]"===E(t).toLowerCase(),J=void 0!==t&&void 0!==t.env,H={isClass:d,isIdentifier:v,inheritedDataKeys:M,getDataPropertyOrDefault:f,thrower:p,isArray:S.isArray,asArray:F,notEnumerableProp:h,isPrimitive:s,isObject:u,isError:m,canEvaluate:T,errorObj:j,tryCatch:a,inherits:U,withAppended:c,maybeWrapAsError:l,toFastProperties:y,filledRange:_,toString:g,canAttachTrace:A,ensureErrorObject:L,originatesFromRejection:w,markAsOriginatingFromRejection:b,classString:E,copyDescriptors:O,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:D,hasEnvVariables:J,env:C,global:R,getNativePromise:k,domainBind:P};H.isRecentNode=H.isNode&&function(){var e;return t.versions&&t.versions.node?e=t.versions.node.split(".").map(Number):t.version&&(e=t.version.split(".").map(Number)),0===e[0]&&e[1]>10||e[0]>0}(),H.isNode&&H.toFastProperties(t);try{throw new Error}catch(e){H.lastLineError=e}n.exports=H},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t(4),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t(85).setImmediate)},{4:4,85:85}],3:[function(e,t,n){},{}],4:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(f===setTimeout)return setTimeout(e,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function a(e){if(h===clearTimeout)return clearTimeout(e);if((h===o||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function s(){v&&d&&(v=!1,d.length?y=d.concat(y):_=-1,y.length&&u())}function u(){if(!v){var e=i(s);v=!0;for(var t=y.length;t;){for(d=y,y=[];++_<t;)d&&d[_].run();_=-1,t=y.length}d=null,v=!1,a(e)}}function l(e,t){this.fun=e,this.array=t}function c(){}var f,h,p=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(e){f=r}try{h="function"==typeof clearTimeout?clearTimeout:o}catch(e){h=o}}();var d,y=[],v=!1,_=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];y.push(new l(e,t)),1!==y.length||v||i(u)},l.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=c,p.addListener=c,p.once=c,p.off=c,p.removeListener=c,p.removeAllListeners=c,p.emit=c,p.prependListener=c,p.prependOnceListener=c,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],5:[function(e,t,n){(function(t,r){function o(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return r.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=r.prototype):(null===e&&(e=new r(t)),e.length=t),e}function r(e,t,n){if(!(r.TYPED_ARRAY_SUPPORT||this instanceof r))return new r(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 l(this,e)}return a(this,e,t,n)}function a(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?h(e,t,n,r):"string"==typeof t?c(e,t,n):p(e,t)}function s(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 u(e,t,n,r){return s(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}function l(e,t){if(s(t),e=i(e,t<0?0:0|d(t)),!r.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var o=0|v(t,n);e=i(e,o);var a=e.write(t,n);return a!==o&&(e=e.slice(0,a)),e}function f(e,t){var n=t.length<0?0:0|d(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e,t,n,o){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(o||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===o?new Uint8Array(t):void 0===o?new Uint8Array(t,n):new Uint8Array(t,n,o),r.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=r.prototype):e=f(e,t),e}function p(e,t){if(r.isBuffer(t)){var n=0|d(t.length);return e=i(e,n),0===e.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||$(t.length)?i(e,0):f(e,t);if("Buffer"===t.type&&K(t.data))return f(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function y(e){return+e!=e&&(e=0),r.alloc(+e)}function v(e,t){if(r.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 o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return X(e).length;default:if(o)return G(e).length;t=(""+t).toLowerCase(),o=!0}}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,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return P(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,o,i){if(0===e.length)return-1;if("string"==typeof n?(o=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=r.from(t,o)),r.isBuffer(t))return 0===t.length?-1:b(e,t,n,o,i);if("number"==typeof t)return t&=255,r.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,o,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,o){function i(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var 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}var l;if(o){var c=-1;for(l=n;l<s;l++)if(i(e,l)===i(t,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*a}else-1!==c&&(l-=l-c),c=-1}else for(n+u>s&&(n=s-u),l=n;l>=0;l--){for(var f=!0,h=0;h<u;h++)if(i(e,l+h)!==i(t,h)){f=!1;break}if(f)return l}return-1}function w(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/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 A(e,t,n,r){return Q(G(t,e.length-n),e,n,r)}function E(e,t,n,r){return Q(z(t),e,n,r)}function O(e,t,n,r){return E(e,t,n,r)}function C(e,t,n,r){return Q(X(t),e,n,r)}function k(e,t,n,r){return Q(V(t,e.length-n),e,n,r)}function P(e,t,n){return 0===t&&n===e.length?Y.fromByteArray(e):Y.fromByteArray(e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i=e[o],a=null,s=i>239?4:i>223?3:i>191?2:1;if(o+s<=n){var u,l,c,f;switch(s){case 1:i<128&&(a=i);break;case 2:u=e[o+1],128==(192&u)&&(f=(31&i)<<6|63&u)>127&&(a=f);break;case 3:u=e[o+1],l=e[o+2],128==(192&u)&&128==(192&l)&&(f=(15&i)<<12|(63&u)<<6|63&l)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:u=e[o+1],l=e[o+2],c=e[o+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(f=(15&i)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=s}return T(r)}function T(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Z));return n}function j(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function x(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=q(e[i]);return o}function U(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function M(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 I(e,t,n,o,i,a){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+o>e.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,r,o){return o||F(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,o){return o||F(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(e,t,n,r,52,8),n+8}function J(e){if(e=H(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function H(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){t=t||1/0;for(var n,r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.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;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function V(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}function X(e){return Y.toByteArray(J(e))}function Q(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function $(e){return e!==e}var Y=e(1),W=e(10),K=e(13);n.Buffer=r,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50,r.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.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}}(),n.kMaxLength=o(),r.poolSize=8192,r._augment=function(e){return e.__proto__=r.prototype,e},r.from=function(e,t,n){return a(null,e,t,n)},r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,"undefined"!=typeof Symbol&&("function"==typeof Symbol?Symbol.species:"@@species")&&r["function"==typeof Symbol?Symbol.species:"@@species"]===r&&Object.defineProperty(r,"function"==typeof Symbol?Symbol.species:"@@species",{value:null,configurable:!0})),r.alloc=function(e,t,n){return u(null,e,t,n)},r.allocUnsafe=function(e){return l(null,e)},r.allocUnsafeSlow=function(e){return l(null,e)},r.isBuffer=function(e){return!(null==e||!e._isBuffer)},r.compare=function(e,t){if(!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,o=t.length,i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==t[i]){n=e[i],o=t[i];break}return n<o?-1:o<n?1:0},r.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}},r.concat=function(e,t){if(!K(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return r.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var o=r.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!r.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o},r.byteLength=v,r.prototype._isBuffer=!0,r.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)g(this,t,t+1);return this},r.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)g(this,t,t+3),g(this,t+1,t+2);return this},r.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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},r.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?S(this,0,e):_.apply(this,arguments)},r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===r.compare(this,e)},r.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},r.prototype.compare=function(e,t,n,o,i){if(!r.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===o&&(o=0),void 0===i&&(i=this.length),t<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&t>=n)return 0;if(o>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,s=n-t,u=Math.min(a,s),l=this.slice(o,i),c=e.slice(t,n),f=0;f<u;++f)if(l[f]!==c[f]){a=l[f],s=c[f];break}return a<s?-1:s<a?1:0},r.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},r.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},r.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},r.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 o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return A(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return O(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;r.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var o;if(r.TYPED_ARRAY_SUPPORT)o=this.subarray(e,t),o.__proto__=r.prototype;else{var i=t-e;o=new r(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+e]}return o},r.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},r.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},r.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},r.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},r.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),W.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),W.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),W.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),W.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){I(this,e,t,n,Math.pow(2,8*n)-1,0)}var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},r.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){I(this,e,t,n,Math.pow(2,8*n)-1,0)}var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},
r.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},r.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);I(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},r.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);I(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},r.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,o){if(n||(n=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),o>0&&o<n&&(o=n),o===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(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t<o-n&&(o=e.length-t+n);var i,a=o-n;if(this===e&&n<t&&t<o)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!r.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},r.prototype.fill=function(e,t,n,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!r.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}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;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=r.isBuffer(e)?e:G(new r(e,o).toString()),u=s.length;for(a=0;a<n-t;++a)this[a+t]=s[a%u]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e(5).Buffer)},{1:1,10:10,13:13,5:5}],6:[function(e,t,n){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],7:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function o(e){return null===e}function i(e){return null==e}function a(e){return"number"==typeof e}function s(e){return"string"==typeof e}function u(e){return"symbol"===(void 0===e?"undefined":_typeof2(e))}function l(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function f(e){return"object"===(void 0===e?"undefined":_typeof2(e))&&null!==e}function h(e){return"[object Date]"===v(e)}function p(e){return"[object Error]"===v(e)||e instanceof Error}function d(e){return"function"==typeof e}function y(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===(void 0===e?"undefined":_typeof2(e))||void 0===e}function v(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=o,n.isNullOrUndefined=i,n.isNumber=a,n.isString=s,n.isSymbol=u,n.isUndefined=l,n.isRegExp=c,n.isObject=f,n.isDate=h,n.isError=p,n.isFunction=d,n.isPrimitive=y,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e(12)})},{12:12}],8:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"===(void 0===e?"undefined":_typeof2(e))&&null!==e}function s(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,i,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],s(n))return!1;if(o(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),n.apply(this,i)}else if(a(n))for(i=Array.prototype.slice.call(arguments,1),l=n.slice(),r=l.length,u=0;u<r;u++)l[u].apply(this,i);return!0},r.prototype.addListener=function(e,t){var n;if(!o(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,i,s;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,r=-1,n===t||o(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(s=i;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],o(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(o(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],9:[function(e,t,n){var r=e(80),o=t.exports;for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);o.request=function(e,t){return e||(e={}),e.scheme="https",e.protocol="https:",r.request.call(this,e,t)}},{80:80}],10:[function(e,t,n){n.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,l=u>>1,c=-7,f=n?o-1:0,h=n?-1:1,p=e[t+f];for(f+=h,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=h,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=l}return(p?-1:1)*a*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var a,s,u,l=8*i-o-1,c=(1<<l)-1,f=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+f>=1?h/u:h*Math.pow(2,1-f),t*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+p]=255&s,p+=d,s/=256,o-=8);for(a=a<<o|s,l+=o;l>0;e[n+p]=255&a,p+=d,a/=256,l-=8);e[n+p-d]|=128*y}},{}],11:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],12:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function o(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
t.exports=function(e){return null!=e&&(r(e)||o(e)||!!e._isBuffer)}},{}],13:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],14:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){e=""+e;var r=new t(e,n);if(!r.valid())throw new w.InvalidInputException(r.constructor.name,e);var o=r.encode();o=(0,h.default)(o);for(var i=0;i<o.length;i++)o[i].options=(0,c.default)(n,o[i].options);return o}function i(){return u.default.CODE128?"CODE128":Object.keys(u.default)[0]}function a(e,t,n){t=(0,h.default)(t);for(var r=0;r<t.length;r++)t[r].options=(0,c.default)(n,t[r].options),(0,d.default)(t[r].options);(0,d.default)(n),new(0,e.renderer)(e.element,t,n).render(),e.afterRender&&e.afterRender()}var s=e(48),u=r(s),l=e(56),c=r(l),f=e(55),h=r(f),p=e(52),d=r(p),y=e(54),v=r(y),_=e(57),g=r(_),m=e(50),b=r(m),w=e(51),A=e(58),E=r(A),O=function(){},C=function(e,t,n){var r=new O;if(void 0===e)throw Error("No element to render on was provided.");return r._renderProperties=(0,v.default)(e),r._encodings=[],r._options=E.default,r._errorHandler=new b.default(r),void 0!==t&&(n=n||{},n.format||(n.format=i()),r.options(n)[n.format](t,n).render()),r};C.getModule=function(e){return u.default[e]};for(var k in u.default)u.default.hasOwnProperty(k)&&function(e,t){O.prototype[t]=O.prototype[t.toUpperCase()]=O.prototype[t.toLowerCase()]=function(n,r){var i=this;return i._errorHandler.wrapBarcodeCall(function(){r.text=void 0===r.text?void 0:""+r.text;var a=(0,c.default)(i._options,r);a=(0,g.default)(a);var s=e[t],u=o(n,s,a);return i._encodings.push(u),i})}}(u.default,k);O.prototype.options=function(e){return this._options=(0,c.default)(this._options,e),this},O.prototype.blank=function(e){var t=new Array(e+1).join("0");return this._encodings.push({data:t}),this},O.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var e;for(var t in this._renderProperties){e=this._renderProperties[t];var n=(0,c.default)(this._options,e.options);"auto"==n.format&&(n.format=i()),this._errorHandler.wrapBarcodeCall(function(){var t=n.value,r=u.default[n.format.toUpperCase()],i=o(t,r,n);a(e,i,n)})}}},O.prototype.render=function(){if(!this._renderProperties)throw new w.NoElementException;if(Array.isArray(this._renderProperties))for(var e=0;e<this._renderProperties.length;e++)a(this._renderProperties[e],this._encodings,this._options);else a(this._renderProperties,this._encodings,this._options);return this},O.prototype._defaults=E.default,"undefined"!=typeof window&&(window.JsBarcode=C),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(e,t){var n=[];return jQuery(this).each(function(){n.push(this)}),C(n,e,t)}),t.exports=C},{48:48,50:50,51:51,52:52,54:54,55:55,56:56,57:57,58:58}],15:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function e(t,n){r(this,e),this.data=t,this.text=n.text||t,this.options=n};n.default=o},{}],16:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(15),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=e(22),c=function(e){function t(e,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.substring(1),n));return i.bytes=e.split("").map(function(e){return e.charCodeAt(0)}),i}return i(t,e),a(t,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var e=this.bytes,n=e.shift()-105,r=l.SET_BY_CODE[n];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");!0===this.shouldEncodeAsEan128()&&e.unshift(l.FNC1);var o=t.next(e,1,r);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:t.getBar(n)+o.result+t.getBar((o.checksum+n)%l.MODULO)+t.getBar(l.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var e=this.options.ean128||!1;return"string"==typeof e&&(e="true"===e.toLowerCase()),e}}],[{key:"getBar",value:function(e){return l.BARS[e]?l.BARS[e].toString():""}},{key:"correctIndex",value:function(e,t){if(t===l.SET_A){var n=e.shift();return n<32?n+64:n-32}return t===l.SET_B?e.shift()-32:10*(e.shift()-48)+e.shift()-48}},{key:"next",value:function(e,n,r){if(!e.length)return{result:"",checksum:0};var o=void 0,i=void 0;if(e[0]>=200){i=e.shift()-105;var a=l.SWAP[i];void 0!==a?o=t.next(e,n+1,a):(r!==l.SET_A&&r!==l.SET_B||i!==l.SHIFT||(e[0]=r===l.SET_A?e[0]>95?e[0]-96:e[0]:e[0]<32?e[0]+96:e[0]),o=t.next(e,n+1,r))}else i=t.correctIndex(e,r),o=t.next(e,n+1,r);var s=t.getBar(i),u=i*n;return{result:s+o.result,checksum:u+o.checksum}}}]),t}(u.default);n.default=c},{15:15,22:22}],17:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(16),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=e(22),c=function(e){function t(e,n){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.A_START_CHAR+e,n))}return i(t,e),a(t,[{key:"valid",value:function(){return new RegExp("^"+l.A_CHARS+"+$").test(this.data)}}]),t}(u.default);n.default=c},{16:16,22:22}],18:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(16),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=e(22),c=function(e){function t(e,n){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.B_START_CHAR+e,n))}return i(t,e),a(t,[{key:"valid",value:function(){return new RegExp("^"+l.B_CHARS+"+$").test(this.data)}}]),t}(u.default);n.default=c},{16:16,22:22}],19:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(16),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=e(22),c=function(e){function t(e,n){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l.C_START_CHAR+e,n))}return i(t,e),a(t,[{key:"valid",value:function(){return new RegExp("^"+l.C_CHARS+"+$").test(this.data)}}]),t}(u.default);n.default=c},{16:16,22:22}],20:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=e(16),u=r(s),l=e(21),c=r(l),f=function(e){function t(e,n){if(o(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(e))var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,c.default)(e),n));else var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return i(r)}return a(t,e),t}(u.default);n.default=f},{16:16,21:21}],21:[function(e,t,n){function r(e,t){var n=t?i.A_CHARS:i.B_CHARS,a=e.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(a)return a[1]+String.fromCharCode(204)+o(e.substring(a[1].length));var s=e.match(new RegExp("^"+n+"+"))[0];return s.length===e.length?e:s+String.fromCharCode(t?205:206)+r(e.substring(s.length),!t)}function o(e){var t=u(e),n=t.length;if(n===e.length)return e;e=e.substring(n);var o=a(e)>=s(e);return t+String.fromCharCode(o?206:205)+r(e,o)}Object.defineProperty(n,"__esModule",{value:!0});var i=e(22),a=function(e){return e.match(new RegExp("^"+i.A_CHARS+"*"))[0].length},s=function(e){return e.match(new RegExp("^"+i.B_CHARS+"*"))[0].length},u=function(e){return e.match(new RegExp("^"+i.C_CHARS+"*"))[0]};n.default=function(e){var t=void 0;if(u(e).length>=2)t=i.C_START_CHAR+o(e);else{var n=a(e)>s(e);t=(n?i.A_START_CHAR:i.B_START_CHAR)+r(e,n)}return t.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(e,t){return String.fromCharCode(203)+t})}},{22:22}],22:[function(e,t,n){function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(n,"__esModule",{value:!0});var o,i=n.SET_A=0,a=n.SET_B=1,s=n.SET_C=2,u=(n.SHIFT=98,n.START_A=103),l=n.START_B=104,c=n.START_C=105;n.MODULO=103,n.STOP=106,n.FNC1=207,n.SET_BY_CODE=(o={},r(o,u,i),r(o,l,a),r(o,c,s),o),n.SWAP={101:i,100:a,99:s},n.A_START_CHAR=String.fromCharCode(208),n.B_START_CHAR=String.fromCharCode(209),n.C_START_CHAR=String.fromCharCode(210),n.A_CHARS="[\0-_È-Ï]",n.B_CHARS="[ -È-Ï]",n.C_CHARS="(Ï*[0-9]{2}Ï*)",n.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]},{}],23:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.CODE128C=n.CODE128B=n.CODE128A=n.CODE128=void 0;var o=e(20),i=r(o),a=e(17),s=r(a),u=e(18),l=r(u),c=e(19),f=r(c);n.CODE128=i.default,n.CODE128A=s.default,n.CODE128B=l.default,n.CODE128C=f.default},{17:17,18:18,19:19,20:20}],24:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return s(l(e))}function s(e){return v[e].toString(2)}function u(e){return y[e]}function l(e){return y.indexOf(e)}function c(e){for(var t=0,n=0;n<e.length;n++)t+=l(e[n]);return t%=43}Object.defineProperty(n,"__esModule",{value:!0}),n.CODE39=void 0;var f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),h=e(15),p=function(e){return e&&e.__esModule?e:{default:e}}(h),d=function(e){function t(e,n){return r(this,t),e=e.toUpperCase(),n.mod43&&(e+=u(c(e))),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return i(t,e),f(t,[{key:"encode",value:function(){for(var e=a("*"),t=0;t<this.data.length;t++)e+=a(this.data[t])+"0";return e+=a("*"),{data:e,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),t}(p.default),y=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],v=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];n.CODE39=d},{15:15}],25:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(32),l=e(33),c=r(l),f=e(15),h=r(f),p=function(e){function t(e,n){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.fontSize=!n.flat&&n.fontSize>10*n.width?10*n.width:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return a(t,e),s(t,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(e,t){return this.text.substr(e,t)}},{key:"leftEncode",value:function(e,t){return(0,c.default)(e,t)}},{key:"rightText",value:function(e,t){return this.text.substr(e,t)}},{key:"rightEncode",value:function(e,t){return(0,c.default)(e,t)}},{key:"encodeGuarded",value:function(){var e={fontSize:this.fontSize},t={height:this.guardHeight};return[{data:u.SIDE_BIN,options:t},{data:this.leftEncode(),text:this.leftText(),options:e},{data:u.MIDDLE_BIN,options:t},{data:this.rightEncode(),text:this.rightText(),options:e},{data:u.SIDE_BIN,options:t}]}},{key:"encodeFlat",value:function(){return{data:[u.SIDE_BIN,this.leftEncode(),u.MIDDLE_BIN,this.rightEncode(),u.SIDE_BIN].join(""),text:this.text}}}]),t}(h.default);n.default=p},{15:15,32:32,33:33}],26:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},u=e(32),l=e(25),c=function(e){return e&&e.__esModule?e:{default:e}}(l),f=function(e){return(10-e.substr(0,12).split("").map(function(e){return+e}).reduce(function(e,t,n){return n%2?e+3*t:e+t},0)%10)%10},h=function(e){function t(e,n){r(this,t),-1!==e.search(/^[0-9]{12}$/)&&(e+=f(e));var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return i.lastChar=n.lastChar,i}return i(t,e),a(t,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===f(this.data)}},{key:"leftText",value:function(){return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var e=this.data.substr(1,6),n=u.EAN13_STRUCTURE[this.data[0]];return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftEncode",this).call(this,e,n)}},{key:"rightText",value:function(){return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var e=this.data.substr(7,6);return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightEncode",this).call(this,e,"RRRRRR")}},{key:"encodeGuarded",value:function(){var e=s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(e.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(e.push({data:"00"}),e.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),e}}]),t}(c.default);n.default=h},{25:25,32:32}],27:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(32),l=e(33),c=r(l),f=e(15),h=r(f),p=function(e){function t(e,n){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return a(t,e),s(t,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var e=u.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,c.default)(this.data,e,"01"),text:this.text}}}]),t}(h.default);n.default=p},{15:15,32:32,33:33}],28:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(32),l=e(33),c=r(l),f=e(15),h=r(f),p=function(e){return e.split("").map(function(e){return+e}).reduce(function(e,t,n){return n%2?e+9*t:e+3*t},0)%10},d=function(e){function t(e,n){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return a(t,e),s(t,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var e=u.EAN5_STRUCTURE[p(this.data)];return{data:"1011"+(0,c.default)(this.data,e,"01"),text:this.text}}}]),t}(h.default);n.default=d},{15:15,32:32,33:33}],29:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},u=e(25),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){return(10-e.substr(0,7).split("").map(function(e){return+e}).reduce(function(e,t,n){return n%2?e+t:e+3*t},0)%10)%10},f=function(e){function t(e,n){return r(this,t),-1!==e.search(/^[0-9]{7}$/)&&(e+=c(e)),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return i(t,e),a(t,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===c(this.data)}},{key:"leftText",value:function(){return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var e=this.data.substr(0,4);return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftEncode",this).call(this,e,"LLLL")}},{key:"rightText",value:function(){return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var e=this.data.substr(4,4);return s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightEncode",this).call(this,e,"RRRR")}}]),t}(l.default);n.default=f},{25:25}],30:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t,n=0;for(t=1;t<11;t+=2)n+=parseInt(e[t]);for(t=0;t<11;t+=2)n+=3*parseInt(e[t]);return(10-n%10)%10}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n.checksum=s;var l=e(33),c=r(l),f=e(15),h=r(f),p=function(e){function t(e,n){o(this,t),-1!==e.search(/^[0-9]{11}$/)&&(e+=s(e));var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return a(t,e),u(t,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==s(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var e="";return e+="101",e+=(0,c.default)(this.data.substr(0,6),"LLLLLL"),e+="01010",e+=(0,c.default)(this.data.substr(6,6),"RRRRRR"),e+="101",{data:e,text:this.text}}},{key:"guardedEncoding",value:function(){var e=[];return this.displayValue&&e.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101"+(0,c.default)(this.data[0],"L"),options:{height:this.guardHeight}}),e.push({data:(0,c.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),e.push({data:"01010",options:{height:this.guardHeight}}),e.push({data:(0,c.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),e.push({data:(0,c.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),e}}]),t}(h.default);n.default=p},{15:15,33:33}],31:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){for(var n=parseInt(e[e.length-1]),r=d[n],o="",i=0,a=0;a<r.length;a++){var s=r[a];o+="X"===s?e[i++]:s}return""+(o=""+t+o)+(0,p.checksum)(o)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=e(33),c=r(l),f=e(15),h=r(f),p=e(30),d=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],y=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],v=function(e){function t(e,n){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(r.isValid=!1,-1!==e.search(/^[0-9]{6}$/))r.middleDigits=e,r.upcA=s(e,"0"),r.text=n.text||""+r.upcA[0]+e+r.upcA[r.upcA.length-1],r.isValid=!0;else{if(-1===e.search(/^[01][0-9]{7}$/))return i(r);if(r.middleDigits=e.substring(1,e.length-1),r.upcA=s(r.middleDigits,e[0]),r.upcA[r.upcA.length-1]!==e[e.length-1])return i(r);r.isValid=!0}return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return a(t,e),u(t,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var e="";return e+="101",e+=this.encodeMiddleDigits(),e+="010101",{data:e,text:this.text}}},{key:"guardedEncoding",value:function(){var e=[];return this.displayValue&&e.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),e.push({data:"101",options:{height:this.guardHeight}}),e.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),e.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&e.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),e}},{key:"encodeMiddleDigits",value:function(){var e=this.upcA[0],t=this.upcA[this.upcA.length-1],n=y[parseInt(t)][parseInt(e)];return(0,c.default)(this.middleDigits,n)}}]),t}(h.default)
;n.default=v},{15:15,30:30,33:33}],32:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});n.SIDE_BIN="101",n.MIDDLE_BIN="01010",n.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},n.EAN2_STRUCTURE=["LL","LG","GL","GG"],n.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],n.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},{}],33:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=e(32),o=function(e,t,n){var o=e.split("").map(function(e,n){return r.BINARIES[t[n]]}).map(function(t,n){return t?t[e[n]]:""});if(n){var i=e.length-1;o=o.map(function(e,t){return t<i?e+n:e})}return o.join("")};n.default=o},{32:32}],34:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.UPCE=n.UPC=n.EAN2=n.EAN5=n.EAN8=n.EAN13=void 0;var o=e(26),i=r(o),a=e(29),s=r(a),u=e(28),l=r(u),c=e(27),f=r(c),h=e(30),p=r(h),d=e(31),y=r(d);n.EAN13=i.default,n.EAN8=s.default,n.EAN5=l.default,n.EAN2=f.default,n.UPC=p.default,n.UPCE=y.default},{26:26,27:27,28:28,29:29,30:30,31:31}],35:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.GenericBarcode=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(15),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(e,n){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return i(t,e),a(t,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),t}(u.default);n.GenericBarcode=l},{15:15}],36:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(38),u=e(15),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),a(t,[{key:"valid",value:function(){return-1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var e=this,t=this.data.match(/.{2}/g).map(function(t){return e.encodePair(t)}).join("");return{data:s.START_BIN+t+s.END_BIN,text:this.text}}},{key:"encodePair",value:function(e){var t=s.BINARIES[e[1]];return s.BINARIES[e[0]].split("").map(function(e,n){return("1"===e?"111":"1")+("1"===t[n]?"000":"0")}).join("")}}]),t}(l.default);n.default=c},{15:15,38:38}],37:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(36),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){var t=e.substr(0,13).split("").map(function(e){return parseInt(e,10)}).reduce(function(e,t,n){return e+t*(3-n%2*2)},0);return 10*Math.ceil(t/10)-t},c=function(e){function t(e,n){return r(this,t),-1!==e.search(/^[0-9]{13}$/)&&(e+=l(e)),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return i(t,e),a(t,[{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===l(this.data)}}]),t}(u.default);n.default=c},{36:36}],38:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});n.START_BIN="1010",n.END_BIN="11101",n.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]},{}],39:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.ITF14=n.ITF=void 0;var o=e(36),i=r(o),a=e(37),s=r(a);n.ITF=i.default,n.ITF14=s.default},{36:36,37:37}],40:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){for(var n=0;n<t;n++)e="0"+e;return e}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e(15),l=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,n){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return i(t,e),s(t,[{key:"encode",value:function(){for(var e="110",t=0;t<this.data.length;t++){var n=parseInt(this.data[t]),r=n.toString(2);r=a(r,4-r.length);for(var o=0;o<r.length;o++)e+="0"==r[o]?"100":"110"}return e+="1001",{data:e,text:this.text}}},{key:"valid",value:function(){return-1!==this.data.search(/^[0-9]+$/)}}]),t}(l.default);n.default=c},{15:15}],41:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=e(40),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=e(45),l=function(e){function t(e,n){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e+(0,u.mod10)(e),n))}return i(t,e),t}(s.default);n.default=l},{40:40,45:45}],42:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=e(40),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=e(45),l=function(e){function t(e,n){return r(this,t),e+=(0,u.mod10)(e),e+=(0,u.mod10)(e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return i(t,e),t}(s.default);n.default=l},{40:40,45:45}],43:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=e(40),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=e(45),l=function(e){function t(e,n){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e+(0,u.mod11)(e),n))}return i(t,e),t}(s.default);n.default=l},{40:40,45:45}],44:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=e(40),s=function(e){return e&&e.__esModule?e:{default:e}}(a),u=e(45),l=function(e){function t(e,n){return r(this,t),e+=(0,u.mod11)(e),e+=(0,u.mod10)(e),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return i(t,e),t}(s.default);n.default=l},{40:40,45:45}],45:[function(e,t,n){function r(e){for(var t=0,n=0;n<e.length;n++){var r=parseInt(e[n]);(n+e.length)%2==0?t+=r:t+=2*r%10+Math.floor(2*r/10)}return(10-t%10)%10}function o(e){for(var t=0,n=[2,3,4,5,6,7],r=0;r<e.length;r++){t+=n[r%n.length]*parseInt(e[e.length-1-r])}return(11-t%11)%11}Object.defineProperty(n,"__esModule",{value:!0}),n.mod10=r,n.mod11=o},{}],46:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.MSI1110=n.MSI1010=n.MSI11=n.MSI10=n.MSI=void 0;var o=e(40),i=r(o),a=e(41),s=r(a),u=e(43),l=r(u),c=e(42),f=r(c),h=e(44),p=r(h);n.MSI=i.default,n.MSI10=s.default,n.MSI11=l.default,n.MSI1010=f.default,n.MSI1110=p.default},{40:40,41:41,42:42,43:43,44:44}],47:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.codabar=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(15),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(e,n){r(this,t),0===e.search(/^[0-9\-\$\:\.\+\/]+$/)&&(e="A"+e+"A");var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.toUpperCase(),n));return i.text=i.options.text||i.text.replace(/[A-D]/g,""),i}return i(t,e),a(t,[{key:"valid",value:function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var e=[],t=this.getEncodings(),n=0;n<this.data.length;n++)e.push(t[this.data.charAt(n)]),n!==this.data.length-1&&e.push("0");return{text:this.text,data:e.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),t}(u.default);n.codabar=l},{15:15}],48:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=e(24),o=e(23),i=e(34),a=e(39),s=e(46),u=e(49),l=e(47),c=e(35);n.default={CODE39:r.CODE39,CODE128:o.CODE128,CODE128A:o.CODE128A,CODE128B:o.CODE128B,CODE128C:o.CODE128C,EAN13:i.EAN13,EAN8:i.EAN8,EAN5:i.EAN5,EAN2:i.EAN2,UPC:i.UPC,UPCE:i.UPCE,ITF14:a.ITF14,ITF:a.ITF,MSI:s.MSI,MSI10:s.MSI10,MSI11:s.MSI11,MSI1010:s.MSI1010,MSI1110:s.MSI1110,pharmacode:u.pharmacode,codabar:l.codabar,GenericBarcode:c.GenericBarcode}},{23:23,24:24,34:34,35:35,39:39,46:46,47:47,49:49}],49:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0}),n.pharmacode=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e(15),u=function(e){return e&&e.__esModule?e:{default:e}}(s),l=function(e){function t(e,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return i.number=parseInt(e,10),i}return i(t,e),a(t,[{key:"encode",value:function(){for(var e=this.number,t="";!isNaN(e)&&0!=e;)e%2==0?(t="11100"+t,e=(e-2)/2):(t="100"+t,e=(e-1)/2);return t=t.slice(0,-2),{data:t,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),t}(u.default);n.pharmacode=l},{15:15}],50:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){r(this,e),this.api=t}return o(e,[{key:"handleCatch",value:function(e){if("InvalidInputException"!==e.name)throw e;if(this.api._options.valid===this.api._defaults.valid)throw e.message;this.api._options.valid(!1),this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(e){try{var t=e.apply(void 0,arguments);return this.api._options.valid(!0),t}catch(e){return this.handleCatch(e),this.api}}}]),e}();n.default=i},{}],51:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":_typeof2(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":_typeof2(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(e){function t(e,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.name="InvalidInputException",i.symbology=e,i.input=n,i.message='"'+i.input+'" is not a valid input for '+i.symbology,i}return i(t,e),t}(Error),s=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="InvalidElementException",e.message="Not supported type to render on",e}return i(t,e),t}(Error),u=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="NoElementException",e.message="No element to render on.",e}return i(t,e),t}(Error);n.InvalidInputException=a,n.InvalidElementException=s,n.NoElementException=u},{}],52:[function(e,t,n){function r(e){return e.marginTop=e.marginTop||e.margin,e.marginBottom=e.marginBottom||e.margin,e.marginRight=e.marginRight||e.margin,e.marginLeft=e.marginLeft||e.margin,e}Object.defineProperty(n,"__esModule",{value:!0}),n.default=r},{}],53:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={};for(var n in u.default)u.default.hasOwnProperty(n)&&(e.hasAttribute("jsbarcode-"+n.toLowerCase())&&(t[n]=e.getAttribute("jsbarcode-"+n.toLowerCase())),e.hasAttribute("data-"+n.toLowerCase())&&(t[n]=e.getAttribute("data-"+n.toLowerCase())));return t.value=e.getAttribute("jsbarcode-value")||e.getAttribute("data-value"),t=(0,a.default)(t)}Object.defineProperty(n,"__esModule",{value:!0});var i=e(57),a=r(i),s=e(58),u=r(s);n.default=o},{57:57,58:58}],54:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if("string"==typeof e)return i(e);if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(o(e[n]));return t}if("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLImageElement)return a(e);if(e&&"svg"===e.nodeName||"undefined"!=typeof SVGElement&&e instanceof SVGElement)return{element:e,options:(0,l.default)(e),renderer:f.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement)return{element:e,options:(0,l.default)(e),renderer:f.default.CanvasRenderer};if(e&&e.getContext)return{element:e,renderer:f.default.CanvasRenderer};if(e&&"object"===(void 0===e?"undefined":s(e))&&!e.nodeName)return{element:e,renderer:f.default.ObjectRenderer};throw new h.InvalidElementException}function i(e){var t=document.querySelectorAll(e);if(0!==t.length){for(var n=[],r=0;r<t.length;r++)n.push(o(t[r]));return n}}function a(e){var t=document.createElement("canvas");return{element:t,options:(0,l.default)(e),renderer:f.default.CanvasRenderer,afterRender:function(){e.setAttribute("src",t.toDataURL())}}}Object.defineProperty(n,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"===_typeof2("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":void 0===e?"undefined":_typeof2(e)},u=e(53),l=r(u),c=e(60),f=r(c),h=e(51);n.default=o},{51:51,53:53,60:60}],55:[function(e,t,n){function r(e){function t(e){if(Array.isArray(e))for(var r=0;r<e.length;r++)t(e[r]);else e.text=e.text||"",e.data=e.data||"",n.push(e)}var n=[];return t(e),n}Object.defineProperty(n,"__esModule",{value:!0}),n.default=r},{}],56:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};n.default=function(e,t){return r({},e,t)}},{}],57:[function(e,t,n){function r(e){var t=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in t)t.hasOwnProperty(n)&&(n=t[n],"string"==typeof e[n]&&(e[n]=parseInt(e[n],10)));return"string"==typeof e.displayValue&&(e.displayValue="false"!=e.displayValue),e}Object.defineProperty(n,"__esModule",{value:!0}),n.default=r},{}],58:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};n.default=r},{}],59:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e(56),a=function(e){return e&&e.__esModule?e:{default:e}}(i),s=e(62),u=function(){function e(t,n,o){r(this,e),this.canvas=t,this.encodings=n,this.options=o}return o(e,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var t=(0,a.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(t,this.encodings[e]),this.drawCanvasText(t,this.encodings[e]),this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var e=this.canvas.getContext("2d");e.save(),(0,s.calculateEncodingAttributes)(this.encodings,this.options,e);var t=(0,s.getTotalWidthOfEncodings)(this.encodings),n=(0,s.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=t+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,e.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(e.fillStyle=this.options.background,e.fillRect(0,0,this.canvas.width,this.canvas.height)),e.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(e,t){var n,r=this.canvas.getContext("2d"),o=t.data;n="top"==e.textPosition?e.marginTop+e.fontSize+e.textMargin:e.marginTop,r.fillStyle=e.lineColor;for(var i=0;i<o.length;i++){var a=i*e.width+t.barcodePadding;"1"===o[i]?r.fillRect(a,n,e.width,e.height):o[i]&&r.fillRect(a,n,e.width,e.height*o[i])}}},{key:"drawCanvasText",value:function(e,t){var n=this.canvas.getContext("2d"),r=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var o,i;i="top"==e.textPosition?e.marginTop+e.fontSize-e.textMargin:e.height+e.textMargin+e.marginTop+e.fontSize,n.font=r,"left"==e.textAlign||t.barcodePadding>0?(o=0,n.textAlign="left"):"right"==e.textAlign?(o=t.width-1,n.textAlign="right"):(o=t.width/2,n.textAlign="center"),n.fillText(t.text,o,i)}}},{key:"moveCanvasDrawing",value:function(e){this.canvas.getContext("2d").translate(e.width,0)}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore()}}]),e}();n.default=u},{56:56,62:62}],60:[function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var o=e(59),i=r(o),a=e(63),s=r(a),u=e(61),l=r(u);n.default={CanvasRenderer:i.default,SVGRenderer:s.default,ObjectRenderer:l.default}},{59:59,61:61,63:63}],61:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n,o){r(this,e),this.object=t,this.encodings=n,this.options=o}return o(e,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),e}();n.default=i},{}],62:[function(e,t,n){function r(e,t){return t.height+(t.displayValue&&e.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function o(e,t,n){if(n.displayValue&&t<e){if("center"==n.textAlign)return Math.floor((e-t)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(e-t)}return 0}function i(e,t,n){for(var i=0;i<e.length;i++){var a,s=e[i],l=(0,c.default)(t,s.options);a=l.displayValue?u(s.text,l,n):0;var f=s.data.length*l.width;s.width=Math.ceil(Math.max(a,f)),s.height=r(s,l),s.barcodePadding=o(a,f,l)}}function a(e){for(var t=0,n=0;n<e.length;n++)t+=e[n].width;return t}function s(e){for(var t=0,n=0;n<e.length;n++)e[n].height>t&&(t=e[n].height);return t}function u(e,t,n){var r;if(n)r=n;else{if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d")}return r.font=t.fontOptions+" "+t.fontSize+"px "+t.font,r.measureText(e).width}Object.defineProperty(n,"__esModule",{value:!0}),n.getTotalWidthOfEncodings=n.calculateEncodingAttributes=n.getBarcodePadding=n.getEncodingHeight=n.getMaximumHeightOfEncodings=void 0;var l=e(56),c=function(e){return e&&e.__esModule?e:{default:e}}(l);n.getMaximumHeightOfEncodings=s,n.getEncodingHeight=r,n.getBarcodePadding=o,n.calculateEncodingAttributes=i,n.getTotalWidthOfEncodings=a},{56:56}],63:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e(56),a=function(e){return e&&e.__esModule?e:{default:e}}(i),s=e(62),u="http://www.w3.org/2000/svg",l=function(){function e(t,n,o){r(this,e),this.svg=t,this.encodings=n,this.options=o,this.document=o.xmlDocument||document}return o(e,[{key:"render",value:function(){var e=this.options.marginLeft;this.prepareSVG();for(var t=0;t<this.encodings.length;t++){var n=this.encodings[t],r=(0,a.default)(this.options,n.options),o=this.createGroup(e,r.marginTop,this.svg);this.setGroupOptions(o,r),this.drawSvgBarcode(o,r,n),this.drawSVGText(o,r,n),e+=n.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,s.calculateEncodingAttributes)(this.encodings,this.options);var e=(0,s.getTotalWidthOfEncodings)(this.encodings),t=(0,s.getMaximumHeightOfEncodings)(this.encodings),n=e+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,t),this.options.background&&this.drawRect(0,0,n,t,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(e,t,n){var r,o=n.data;r="top"==t.textPosition?t.fontSize+t.textMargin:0;for(var i=0,a=0,s=0;s<o.length;s++)a=s*t.width+n.barcodePadding,"1"===o[s]?i++:i>0&&(this.drawRect(a-t.width*i,r,t.width*i,t.height,e),i=0);i>0&&this.drawRect(a-t.width*(i-1),r,t.width*i,t.height,e)}},{key:"drawSVGText",value:function(e,t,n){var r=this.document.createElementNS(u,"text");if(t.displayValue){var o,i;r.setAttribute("style","font:"+t.fontOptions+" "+t.fontSize+"px "+t.font),i="top"==t.textPosition?t.fontSize-t.textMargin:t.height+t.textMargin+t.fontSize,"left"==t.textAlign||n.barcodePadding>0?(o=0,r.setAttribute("text-anchor","start")):"right"==t.textAlign?(o=n.width-1,r.setAttribute("text-anchor","end")):(o=n.width/2,r.setAttribute("text-anchor","middle")),r.setAttribute("x",o),r.setAttribute("y",i),r.appendChild(this.document.createTextNode(n.text)),e.appendChild(r)}}},{key:"setSvgAttributes",value:function(e,t){var n=this.svg;n.setAttribute("width",e+"px"),n.setAttribute("height",t+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+e+" "+t),n.setAttribute("xmlns",u),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(e,t,n){var r=this.document.createElementNS(u,"g");return r.setAttribute("transform","translate("+e+", "+t+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(e,t){e.setAttribute("style","fill:"+t.lineColor+";")}},{key:"drawRect",value:function(e,t,n,r,o){var i=this.document.createElementNS(u,"rect");return i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i),i}}]),e}();n.default=l},{56:56,62:62}],64:[function(e,t,n){(function(e){function n(t,n,r,o){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,o)});default:for(i=new Array(s-1),a=0;a<i.length;)i[a++]=arguments[a];return e.nextTick(function(){t.apply(null,i)})}}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:n}:t.exports=e}).call(this,e(4))},{4:4}],65:[function(t,n,r){(function(t){!function(o){function i(e){throw new RangeError(M[e])}function a(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function s(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(U,"."),r+a(e.split("."),t).join(".")}function u(e){for(var t,n,r=[],o=0,i=e.length;o<i;)t=e.charCodeAt(o++),t>=55296&&t<=56319&&o<i?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);return r}function l(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=L(e>>>10&1023|55296),e=56320|1023&e),t+=L(e)}).join("")}function c(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:E}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function h(e,t,n){var r=0;for(e=n?N(e/P):e>>1,e+=N(e/t);e>I*C>>1;r+=E)e=N(e/I)
;return N(r+(I+1)*e/(e+k))}function p(e){var t,n,r,o,a,s,u,f,p,d,y=[],v=e.length,_=0,g=T,m=S;for(n=e.lastIndexOf(j),n<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&i("not-basic"),y.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<v;){for(a=_,s=1,u=E;o>=v&&i("invalid-input"),f=c(e.charCodeAt(o++)),(f>=E||f>N((A-_)/s))&&i("overflow"),_+=f*s,p=u<=m?O:u>=m+C?C:u-m,!(f<p);u+=E)d=E-p,s>N(A/d)&&i("overflow"),s*=d;t=y.length+1,m=h(_-a,t,0==a),N(_/t)>A-g&&i("overflow"),g+=N(_/t),_%=t,y.splice(_++,0,g)}return l(y)}function d(e){var t,n,r,o,a,s,l,c,p,d,y,v,_,g,m,b=[];for(e=u(e),v=e.length,t=T,n=0,a=S,s=0;s<v;++s)(y=e[s])<128&&b.push(L(y));for(r=o=b.length,o&&b.push(j);r<v;){for(l=A,s=0;s<v;++s)(y=e[s])>=t&&y<l&&(l=y);for(_=r+1,l-t>N((A-n)/_)&&i("overflow"),n+=(l-t)*_,t=l,s=0;s<v;++s)if(y=e[s],y<t&&++n>A&&i("overflow"),y==t){for(c=n,p=E;d=p<=a?O:p>=a+C?C:p-a,!(c<d);p+=E)m=c-d,g=E-d,b.push(L(f(d+m%g,0))),c=N(m/g);b.push(L(f(c,0))),a=h(n,_,r==o),n=0,++r}++n,++t}return b.join("")}function y(e){return s(e,function(e){return x.test(e)?p(e.slice(4).toLowerCase()):e})}function v(e){return s(e,function(e){return R.test(e)?"xn--"+d(e):e})}var _="object"==(void 0===r?"undefined":_typeof2(r))&&r&&!r.nodeType&&r,g="object"==(void 0===n?"undefined":_typeof2(n))&&n&&!n.nodeType&&n,m="object"==(void 0===t?"undefined":_typeof2(t))&&t;m.global!==m&&m.window!==m&&m.self!==m||(o=m);var b,w,A=2147483647,E=36,O=1,C=26,k=38,P=700,S=72,T=128,j="-",x=/^xn--/,R=/[^\x20-\x7E]/,U=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=E-O,N=Math.floor,L=String.fromCharCode;if(b={version:"1.4.1",ucs2:{decode:u,encode:l},decode:p,encode:d,toASCII:v,toUnicode:y},"function"==typeof e&&"object"==_typeof2(e.amd)&&e.amd)e("punycode",function(){return b});else if(_&&g)if(n.exports==_)g.exports=b;else for(w in b)b.hasOwnProperty(w)&&(_[w]=b[w]);else o.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],66:[function(t,n,r){var o=function(){function e(t,n){if(void 0===t.length)throw t.length+"/"+n;var r=function(){for(var e=0;e<t.length&&0==t[e];)e+=1;for(var r=new Array(t.length-e+n),o=0;o<t.length-e;o+=1)r[o]=t[o+e];return r}(),o={};return o.getAt=function(e){return r[e]},o.getLength=function(){return r.length},o.multiply=function(t){for(var n=new Array(o.getLength()+t.getLength()-1),r=0;r<o.getLength();r+=1)for(var i=0;i<t.getLength();i+=1)n[r+i]^=a.gexp(a.glog(o.getAt(r))+a.glog(t.getAt(i)));return e(n,0)},o.mod=function(t){if(o.getLength()-t.getLength()<0)return o;for(var n=a.glog(o.getAt(0))-a.glog(t.getAt(0)),r=new Array(o.getLength()),i=0;i<o.getLength();i+=1)r[i]=o.getAt(i);for(var i=0;i<t.getLength();i+=1)r[i]^=a.gexp(a.glog(t.getAt(i))+n);return e(r,0).mod(t)},o}var t=function(t,n){var o=t,a=r[n],p=null,d=0,y=null,v=[],g={},m=function(e,t){d=4*o+17,p=function(e){for(var t=new Array(e),n=0;n<e;n+=1){t[n]=new Array(e);for(var r=0;r<e;r+=1)t[n][r]=null}return t}(d),b(0,0),b(d-7,0),b(0,d-7),E(),A(),C(e,t),o>=7&&O(e),null==y&&(y=S(o,a,v)),k(y,t)},b=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||d<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||d<=t+r||(p[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},w=function(){for(var e=0,t=0,n=0;n<8;n+=1){m(!0,n);var r=i.getLostPoint(g);(0==n||e>r)&&(e=r,t=n)}return t},A=function(){for(var e=8;e<d-8;e+=1)null==p[e][6]&&(p[e][6]=e%2==0);for(var t=8;t<d-8;t+=1)null==p[6][t]&&(p[6][t]=t%2==0)},E=function(){for(var e=i.getPatternPosition(o),t=0;t<e.length;t+=1)for(var n=0;n<e.length;n+=1){var r=e[t],a=e[n];if(null==p[r][a])for(var s=-2;s<=2;s+=1)for(var u=-2;u<=2;u+=1)p[r+s][a+u]=-2==s||2==s||-2==u||2==u||0==s&&0==u}},O=function(e){for(var t=i.getBCHTypeNumber(o),n=0;n<18;n+=1){var r=!e&&1==(t>>n&1);p[Math.floor(n/3)][n%3+d-8-3]=r}for(var n=0;n<18;n+=1){var r=!e&&1==(t>>n&1);p[n%3+d-8-3][Math.floor(n/3)]=r}},C=function(e,t){for(var n=a<<3|t,r=i.getBCHTypeInfo(n),o=0;o<15;o+=1){var s=!e&&1==(r>>o&1);o<6?p[o][8]=s:o<8?p[o+1][8]=s:p[d-15+o][8]=s}for(var o=0;o<15;o+=1){var s=!e&&1==(r>>o&1);o<8?p[8][d-o-1]=s:o<9?p[8][15-o-1+1]=s:p[8][15-o-1]=s}p[d-8][8]=!e},k=function(e,t){for(var n=-1,r=d-1,o=7,a=0,s=i.getMaskFunction(t),u=d-1;u>0;u-=2)for(6==u&&(u-=1);;){for(var l=0;l<2;l+=1)if(null==p[r][u-l]){var c=!1;a<e.length&&(c=1==(e[a]>>>o&1));var f=s(r,u-l);f&&(c=!c),p[r][u-l]=c,o-=1,-1==o&&(a+=1,o=7)}if((r+=n)<0||d<=r){r-=n,n=-n;break}}},P=function(t,n){for(var r=0,o=0,a=0,s=new Array(n.length),u=new Array(n.length),l=0;l<n.length;l+=1){var c=n[l].dataCount,f=n[l].totalCount-c;o=Math.max(o,c),a=Math.max(a,f),s[l]=new Array(c);for(var h=0;h<s[l].length;h+=1)s[l][h]=255&t.getBuffer()[h+r];r+=c;var p=i.getErrorCorrectPolynomial(f),d=e(s[l],p.getLength()-1),y=d.mod(p);u[l]=new Array(p.getLength()-1);for(var h=0;h<u[l].length;h+=1){var v=h+y.getLength()-u[l].length;u[l][h]=v>=0?y.getAt(v):0}}for(var _=0,h=0;h<n.length;h+=1)_+=n[h].totalCount;for(var g=new Array(_),m=0,h=0;h<o;h+=1)for(var l=0;l<n.length;l+=1)h<s[l].length&&(g[m]=s[l][h],m+=1);for(var h=0;h<a;h+=1)for(var l=0;l<n.length;l+=1)h<u[l].length&&(g[m]=u[l][h],m+=1);return g},S=function(e,t,n){for(var r=s.getRSBlocks(e,t),o=u(),a=0;a<n.length;a+=1){var l=n[a];o.put(l.getMode(),4),o.put(l.getLength(),i.getLengthInBits(l.getMode(),e)),l.write(o)}for(var c=0,a=0;a<r.length;a+=1)c+=r[a].dataCount;if(o.getLengthInBits()>8*c)throw"code length overflow. ("+o.getLengthInBits()+">"+8*c+")";for(o.getLengthInBits()+4<=8*c&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;;){if(o.getLengthInBits()>=8*c)break;if(o.put(236,8),o.getLengthInBits()>=8*c)break;o.put(17,8)}return P(o,r)};g.addData=function(e,t){t=t||"Byte";var n=null;switch(t){case"Numeric":n=l(e);break;case"Alphanumeric":n=c(e);break;case"Byte":n=f(e);break;case"Kanji":n=h(e);break;default:throw"mode:"+t}v.push(n),y=null},g.isDark=function(e,t){if(e<0||d<=e||t<0||d<=t)throw e+","+t;return p[e][t]},g.getModuleCount=function(){return d},g.make=function(){if(o<1){for(var e=1;e<40;e++){for(var t=s.getRSBlocks(e,a),n=u(),r=0;r<v.length;r++){var l=v[r];n.put(l.getMode(),4),n.put(l.getLength(),i.getLengthInBits(l.getMode(),e)),l.write(n)}for(var c=0,r=0;r<t.length;r++)c+=t[r].dataCount;if(n.getLengthInBits()<=8*c)break}o=e}m(!1,w())},g.createTableTag=function(e,t){e=e||2,t=void 0===t?4*e:t;var n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+t+"px;",n+='">',n+="<tbody>";for(var r=0;r<g.getModuleCount();r+=1){n+="<tr>";for(var o=0;o<g.getModuleCount();o+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+e+"px;",n+=" height: "+e+"px;",n+=" background-color: ",n+=g.isDark(r,o)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return n+="</tbody>",n+="</table>"},g.createSvgTag=function(e,t){var n={};"object"==_typeof2(arguments[0])&&(n=arguments[0],e=n.cellSize,t=n.margin),e=e||2,t=void 0===t?4*e:t;var r,o,i,a,s,u=g.getModuleCount()*e+2*t,l="";for(s="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",l+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',l+=n.scalable?"":' width="'+u+'px" height="'+u+'px"',l+=' viewBox="0 0 '+u+" "+u+'" ',l+=' preserveAspectRatio="xMinYMin meet">',l+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',l+='<path d="',i=0;i<g.getModuleCount();i+=1)for(a=i*e+t,r=0;r<g.getModuleCount();r+=1)g.isDark(i,r)&&(o=r*e+t,l+="M"+o+","+a+s);return l+='" stroke="transparent" fill="black"/>',l+="</svg>"},g.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=g.getModuleCount()*e+2*t,r=t,o=n-t;return _(n,n,function(t,n){if(r<=t&&t<o&&r<=n&&n<o){var i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return g.isDark(a,i)?0:1}return 1})},g.createImgTag=function(e,t,n){e=e||2,t=void 0===t?4*e:t;var r=g.getModuleCount()*e+2*t,o="";return o+="<img",o+=' src="',o+=g.createDataURL(e,t),o+='"',o+=' width="',o+=r,o+='"',o+=' height="',o+=r,o+='"',n&&(o+=' alt="',o+=n,o+='"'),o+="/>"};var T=function(e){e=void 0===e?2:e;var t,n,r,o,i,a=1*g.getModuleCount()+2*e,s=e,u=a-e,l={"██":"█","█ ":"▀"," █":"▄"," ":" "},c={"██":"▀","█ ":"▀"," █":" "," ":" "},f="";for(t=0;t<a;t+=2){for(r=Math.floor((t-s)/1),o=Math.floor((t+1-s)/1),n=0;n<a;n+=1)i="█",s<=n&&n<u&&s<=t&&t<u&&g.isDark(r,Math.floor((n-s)/1))&&(i=" "),s<=n&&n<u&&s<=t+1&&t+1<u&&g.isDark(o,Math.floor((n-s)/1))?i+=" ":i+="█",f+=e<1&&t+1>=u?c[i]:l[i];f+="\n"}return a%2&&e>0?f.substring(0,f.length-a-1)+Array(a+1).join("▀"):f.substring(0,f.length-1)};return g.createASCII=function(e,t){if((e=e||1)<2)return T(t);e-=1,t=void 0===t?2*e:t;var n,r,o,i,a=g.getModuleCount()*e+2*t,s=t,u=a-t,l=Array(e+1).join("██"),c=Array(e+1).join(" "),f="",h="";for(n=0;n<a;n+=1){for(o=Math.floor((n-s)/e),h="",r=0;r<a;r+=1)i=1,s<=r&&r<u&&s<=n&&n<u&&g.isDark(o,Math.floor((r-s)/e))&&(i=0),h+=i?l:c;for(o=0;o<e;o+=1)f+=h+"\n"}return f.substring(0,f.length-1)},g.renderTo2dContext=function(e,t){t=t||2;for(var n=g.getModuleCount(),r=0;r<n;r++)for(var o=0;o<n;o++)e.fillStyle=g.isDark(r,o)?"black":"white",e.fillRect(r*t,o*t,t,t)},g};t.stringToBytesFuncs={default:function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t.push(255&r)}return t}},t.stringToBytes=t.stringToBytesFuncs.default,t.createStringToBytes=function(e,t){var n=function(){for(var n=y(e),r=function(){var e=n.read();if(-1==e)throw"eof";return e},o=0,i={};;){var a=n.read();if(-1==a)break;var s=r(),u=r(),l=r(),c=String.fromCharCode(a<<8|s),f=u<<8|l;i[c]=f,o+=1}if(o!=t)throw o+" != "+t;return i}(),r="?".charCodeAt(0);return function(e){for(var t=[],o=0;o<e.length;o+=1){var i=e.charCodeAt(o);if(i<128)t.push(i);else{var a=n[e.charAt(o)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>8),t.push(255&a)):t.push(r)}}return t}};var n={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},r={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r={},i=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){for(var t=e<<10;i(t)-i(1335)>=0;)t^=1335<<i(t)-i(1335);return 21522^(e<<10|t)},r.getBCHTypeNumber=function(e){for(var t=e<<12;i(t)-i(7973)>=0;)t^=7973<<i(t)-i(7973);return e<<12|t},r.getPatternPosition=function(e){return t[e-1]},r.getMaskFunction=function(e){switch(e){case o.PATTERN000:return function(e,t){return(e+t)%2==0};case o.PATTERN001:return function(e,t){return e%2==0};case o.PATTERN010:return function(e,t){return t%3==0};case o.PATTERN011:return function(e,t){return(e+t)%3==0};case o.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case o.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case o.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case o.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},r.getErrorCorrectPolynomial=function(t){for(var n=e([1],0),r=0;r<t;r+=1)n=n.multiply(e([1,a.gexp(r)],0));return n},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case n.MODE_NUMBER:return 10;case n.MODE_ALPHA_NUM:return 9;case n.MODE_8BIT_BYTE:case n.MODE_KANJI:return 8;default:throw"mode:"+e}else if(t<27)switch(e){case n.MODE_NUMBER:return 12;case n.MODE_ALPHA_NUM:return 11;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 10;default:throw"mode:"+e}else{if(!(t<41))throw"type:"+t;switch(e){case n.MODE_NUMBER:return 14;case n.MODE_ALPHA_NUM:return 13;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 12;default:throw"mode:"+e}}},r.getLostPoint=function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r+=1)for(var o=0;o<t;o+=1){for(var i=0,a=e.isDark(r,o),s=-1;s<=1;s+=1)if(!(r+s<0||t<=r+s))for(var u=-1;u<=1;u+=1)o+u<0||t<=o+u||0==s&&0==u||a==e.isDark(r+s,o+u)&&(i+=1);i>5&&(n+=3+i-5)}for(var r=0;r<t-1;r+=1)for(var o=0;o<t-1;o+=1){var l=0;e.isDark(r,o)&&(l+=1),e.isDark(r+1,o)&&(l+=1),e.isDark(r,o+1)&&(l+=1),e.isDark(r+1,o+1)&&(l+=1),0!=l&&4!=l||(n+=3)}for(var r=0;r<t;r+=1)for(var o=0;o<t-6;o+=1)e.isDark(r,o)&&!e.isDark(r,o+1)&&e.isDark(r,o+2)&&e.isDark(r,o+3)&&e.isDark(r,o+4)&&!e.isDark(r,o+5)&&e.isDark(r,o+6)&&(n+=40);for(var o=0;o<t;o+=1)for(var r=0;r<t-6;r+=1)e.isDark(r,o)&&!e.isDark(r+1,o)&&e.isDark(r+2,o)&&e.isDark(r+3,o)&&e.isDark(r+4,o)&&!e.isDark(r+5,o)&&e.isDark(r+6,o)&&(n+=40);for(var c=0,o=0;o<t;o+=1)for(var r=0;r<t;r+=1)e.isDark(r,o)&&(c+=1);return n+=Math.abs(100*c/t/t-50)/5*10},r}(),a=function(){for(var e=new Array(256),t=new Array(256),n=0;n<8;n+=1)e[n]=1<<n;for(var n=8;n<256;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(var n=0;n<255;n+=1)t[e[n]]=n;var r={};return r.glog=function(e){if(e<1)throw"glog("+e+")";return t[e]},r.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},r}(),s=function(){var e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){var n={};return n.totalCount=e,n.dataCount=t,n},n={},o=function(t,n){switch(n){case r.L:return e[4*(t-1)+0];case r.M:return e[4*(t-1)+1];case r.Q:return e[4*(t-1)+2];case r.H:return e[4*(t-1)+3];default:return}};return n.getRSBlocks=function(e,n){var r=o(e,n);if(void 0===r)throw"bad rs block @ typeNumber:"+e+"/errorCorrectionLevel:"+n;for(var i=r.length/3,a=[],s=0;s<i;s+=1)for(var u=r[3*s+0],l=r[3*s+1],c=r[3*s+2],f=0;f<u;f+=1)a.push(t(l,c));return a},n}(),u=function(){var e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){var n=Math.floor(t/8);return 1==(e[n]>>>7-t%8&1)},n.put=function(e,t){for(var r=0;r<t;r+=1)n.putBit(1==(e>>>t-r-1&1))},n.getLengthInBits=function(){return t},n.putBit=function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},l=function(e){var t=n.MODE_NUMBER,r=e,o={};o.getMode=function(){return t},o.getLength=function(e){return r.length},o.write=function(e){for(var t=r,n=0;n+2<t.length;)e.put(i(t.substring(n,n+3)),10),n+=3;n<t.length&&(t.length-n==1?e.put(i(t.substring(n,n+1)),4):t.length-n==2&&e.put(i(t.substring(n,n+2)),7))};var i=function(e){for(var t=0,n=0;n<e.length;n+=1)t=10*t+a(e.charAt(n));return t},a=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+e};return o},c=function(e){var t=n.MODE_ALPHA_NUM,r=e,o={};o.getMode=function(){return t},o.getLength=function(e){return r.length},o.write=function(e){for(var t=r,n=0;n+1<t.length;)e.put(45*i(t.charAt(n))+i(t.charAt(n+1)),11),n+=2;n<t.length&&e.put(i(t.charAt(n)),6)};var i=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-"0".charCodeAt(0);if("A"<=e&&e<="Z")return e.charCodeAt(0)-"A".charCodeAt(0)+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return o},f=function(e){var r=n.MODE_8BIT_BYTE,o=t.stringToBytes(e),i={};return i.getMode=function(){return r},i.getLength=function(e){return o.length},i.write=function(e){for(var t=0;t<o.length;t+=1)e.put(o[t],8)},i},h=function(e){var r=n.MODE_KANJI,o=t.stringToBytesFuncs.SJIS;if(!o)throw"sjis not supported.";!function(e,t){var n=o("友");if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported."}();var i=o(e),a={};return a.getMode=function(){return r},a.getLength=function(e){return~~(i.length/2)},a.write=function(e){for(var t=i,n=0;n+1<t.length;){var r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw"illegal char at "+(n+1)+"/"+r;r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13),n+=2}if(n<t.length)throw"illegal char at "+(n+1)},a},p=function(){var e=[],t={};return t.writeByte=function(t){e.push(255&t)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n=n||0,r=r||e.length;for(var o=0;o<r;o+=1)t.writeByte(e[o+n])},t.writeString=function(e){for(var n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){var t="";t+="[";for(var n=0;n<e.length;n+=1)n>0&&(t+=","),t+=e[n];return t+="]"},t},d=function(){var e=0,t=0,n=0,r="",o={},i=function(e){r+=String.fromCharCode(a(63&e))},a=function(e){if(e<0);else{if(e<26)return 65+e;if(e<52)return e-26+97;if(e<62)return e-52+48;if(62==e)return 43;if(63==e)return 47}throw"n:"+e};return o.writeByte=function(r){for(e=e<<8|255&r,t+=8,n+=1;t>=6;)i(e>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(e<<6-t),e=0,t=0),n%3!=0)for(var o=3-n%3,a=0;a<o;a+=1)r+="="},o.toString=function(){return r},o},y=function(e){var t=e,n=0,r=0,o=0,i={};i.read=function(){for(;o<8;){if(n>=t.length){if(0==o)return-1;throw"unexpected end of file./"+o}var e=t.charAt(n);if(n+=1,"="==e)return o=0,-1;e.match(/^\s$/)||(r=r<<6|a(e.charCodeAt(0)),o+=6)}var i=r>>>o-8&255;return o-=8,i};var a=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return i},v=function(e,t){var n=e,r=t,o=new Array(e*t),i={};i.setPixel=function(e,t,r){o[t*n+e]=r},i.write=function(e){e.writeString("GIF87a"),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(","),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);var t=s(2);e.writeByte(2);for(var o=0;t.length-o>255;)e.writeByte(255),e.writeBytes(t,o,255),o+=255;e.writeByte(t.length-o),e.writeBytes(t,o,t.length-o),e.writeByte(0),e.writeString(";")};var a=function(e){var t=e,n=0,r=0,o={};return o.write=function(e,o){if(e>>>o!=0)throw"length over";for(;n+o>=8;)t.writeByte(255&(e<<n|r)),o-=8-n,e>>>=8-n,r=0,n=0;r|=e<<n,n+=o},o.flush=function(){n>0&&t.writeByte(r)},o},s=function(e){for(var t=1<<e,n=1+(1<<e),r=e+1,i=u(),s=0;s<t;s+=1)i.add(String.fromCharCode(s));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(n));var l=p(),c=a(l);c.write(t,r);var f=0,h=String.fromCharCode(o[f]);for(f+=1;f<o.length;){var d=String.fromCharCode(o[f]);f+=1,i.contains(h+d)?h+=d:(c.write(i.indexOf(h),r),i.size()<4095&&(i.size()==1<<r&&(r+=1),i.add(h+d)),h=d)}return c.write(i.indexOf(h),r),c.write(n,r),c.flush(),l.toByteArray()},u=function(){var e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw"dup key:"+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return void 0!==e[t]},n};return i},_=function(e,t,n){for(var r=v(e,t),o=0;o<t;o+=1)for(var i=0;i<e;i+=1)r.setPixel(i,o,n(i,o));var a=p();r.write(a);for(var s=d(),u=a.toByteArray(),l=0;l<u.length;l+=1)s.writeByte(u[l]);return s.flush(),"data:image/gif;base64,"+s};return t}();!function(){o.stringToBytesFuncs["UTF-8"]=function(e){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)}}(),function(t){"function"==typeof e&&e.amd?e([],t):"object"===(void 0===r?"undefined":_typeof2(r))&&(n.exports=t())}(function(){return o})},{}],67:[function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,i){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var f,h,p,d,y=e[c].replace(s,"%20"),v=y.indexOf(n);v>=0?(f=y.substr(0,v),h=y.substr(v+1)):(f=y,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),r(a,p)?o(a[p])?a[p].push(d):a[p]=[a[p],d]:a[p]=d}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],68:[function(e,t,n){function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var o=function(e){switch(void 0===e?"undefined":_typeof2(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===(void 0===e?"undefined":_typeof2(e))?r(a(e),function(a){var s=encodeURIComponent(o(a))+n;return i(e[a])?r(e[a],function(e){return s+encodeURIComponent(o(e))}).join(t):s+encodeURIComponent(o(e[a]))}).join(t):s?encodeURIComponent(o(s))+n+encodeURIComponent(o(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},{}],69:[function(e,t,n){n.decode=n.parse=e(67),n.encode=n.stringify=e(68)},{67:67,68:68}],70:[function(e,t,n){function r(e){if(!(this instanceof r))return new r(e);l.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",o)}function o(){this.allowHalfOpen||this._writableState.ended||a.nextTick(i,this)}function i(e){e.end()}var a=e(64),s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var u=e(7);u.inherits=e(11);var l=e(72),c=e(74);u.inherits(r,l);for(var f=s(c.prototype),h=0;h<f.length;h++){var p=f[h];r.prototype[p]||(r.prototype[p]=c.prototype[p])}Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),r.prototype._destroy=function(e,t){this.push(null),this.end(),a.nextTick(t,e)}},{11:11,64:64,7:7,72:72,74:74}],71:[function(e,t,n){function r(e){if(!(this instanceof r))return new r(e);o.call(this,e)}t.exports=r;var o=e(73),i=e(7);i.inherits=e(11),i.inherits(r,o),r.prototype._transform=function(e,t,n){n(null,e)}},{11:11,7:7,73:73}],72:[function(e,t,n){(function(n,r){function o(e){return L.from(e)}function i(e){return L.isBuffer(e)||e instanceof F}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?M(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function s(t,n){U=U||e(70),t=t||{};var r=n instanceof U;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var o=t.highWaterMark,i=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(i||0===i)?i:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new q,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(H||(H=e(84).StringDecoder),this.decoder=new H(t.encoding),this.encoding=t.encoding)}function u(t){if(U=U||e(70),!(this instanceof u))return new u(t);this._readableState=new s(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),N.call(this)}function l(e,t,n,r,i){var a=e._readableState;if(null===t)a.reading=!1,y(e,a);else{var s;i||(s=f(a,t)),s?e.emit("error",s):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===L.prototype||(t=o(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?c(e,a,t,!1):g(e,a)):c(e,a,t,!1))):r||(a.reading=!1)}return h(a)}function c(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&v(e)),g(e,t)}function f(e,t){var n;return i(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function h(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function p(e){return e>=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function d(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=p(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function y(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(J("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?R.nextTick(_,e):_(e))}function _(e){J("emit readable"),e.emit("readable"),O(e)}function g(e,t){t.readingMore||(t.readingMore=!0,R.nextTick(m,e,t))}function m(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(J("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function b(e){return function(){var t=e._readableState;J("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&I(e,"data")&&(t.flowing=!0,O(e))}}function w(e){J("readable nexttick read 0"),e.read(0)}function A(e,t){t.resumeScheduled||(t.resumeScheduled=!0,R.nextTick(E,e,t))}function E(e,t){t.reading||(J("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(J("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){if(0===t.length)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=k(e,t.buffer,t.decoder),n}function k(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?P(e,t):S(e,t),r}function P(e,t){var n=t.head,r=1,o=n.data;for(e-=o.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}function S(e,t){var n=L.allocUnsafe(e),r=t.head,o=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}function T(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,R.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function x(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}var R=e(64);t.exports=u;var U,M=e(13);u.ReadableState=s;var I=(e(8).EventEmitter,function(e,t){return e.listeners(t).length}),N=e(77),L=e(79).Buffer,F=r.Uint8Array||function(){},B=e(7);B.inherits=e(11);var D=e(3),J=void 0;J=D&&D.debuglog?D.debuglog("stream"):function(){};var H,q=e(75),G=e(76);B.inherits(u,N);var z=["error","close","destroy","pause","resume"];Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),u.prototype.destroy=G.destroy,u.prototype._undestroy=G.undestroy,u.prototype._destroy=function(e,t){this.push(null),t(e)},u.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=L.from(e,t),t=""),n=!0),l(this,e,t,!1,n)},u.prototype.unshift=function(e){return l(this,e,null,!0,!1)},u.prototype.isPaused=function(){return!1===this._readableState.flowing},u.prototype.setEncoding=function(t){return H||(H=e(84).StringDecoder),this._readableState.decoder=new H(t),this._readableState.encoding=t,this};var V=8388608;u.prototype.read=function(e){J("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),
0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return J("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):v(this),null;if(0===(e=d(e,t))&&t.ended)return 0===t.length&&T(this),null;var r=t.needReadable;J("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,J("length less than watermark",r)),t.ended||t.reading?(r=!1,J("reading or ended",r)):r&&(J("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=d(n,t)));var o;return o=e>0?C(e,t):null,null===o?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&T(this)),null!==o&&this.emit("data",o),o},u.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(e,t){function r(e,t){J("onunpipe"),e===h&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,i())}function o(){J("onend"),e.end()}function i(){J("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",u),e.removeListener("unpipe",r),h.removeListener("end",o),h.removeListener("end",f),h.removeListener("data",s),_=!0,!p.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){J("ondata"),g=!1,!1!==e.write(t)||g||((1===p.pipesCount&&p.pipes===e||p.pipesCount>1&&-1!==x(p.pipes,e))&&!_&&(J("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,g=!0),h.pause())}function u(t){J("onerror",t),f(),e.removeListener("error",u),0===I(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",c),f()}function c(){J("onfinish"),e.removeListener("close",l),f()}function f(){J("unpipe"),h.unpipe(e)}var h=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=e;break;case 1:p.pipes=[p.pipes,e];break;default:p.pipes.push(e)}p.pipesCount+=1,J("pipe count=%d opts=%j",p.pipesCount,t);var d=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,y=d?o:f;p.endEmitted?R.nextTick(y):h.once("end",y),e.on("unpipe",r);var v=b(h);e.on("drain",v);var _=!1,g=!1;return h.on("data",s),a(e,"error",u),e.once("close",l),e.once("finish",c),e.emit("pipe",h),p.flowing||(J("pipe resume"),h.resume()),e},u.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var a=x(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},u.prototype.on=function(e,t){var n=N.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&v(this):R.nextTick(w,this))}return n},u.prototype.addListener=u.prototype.on,u.prototype.resume=function(){var e=this._readableState;return e.flowing||(J("resume"),e.flowing=!0,A(this,e)),this},u.prototype.pause=function(){return J("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(J("pause"),this._readableState.flowing=!1,this.emit("pause")),this},u.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;e.on("end",function(){if(J("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){if(J("wrapped data"),n.decoder&&(o=n.decoder.write(o)),(!n.objectMode||null!==o&&void 0!==o)&&(n.objectMode||o&&o.length)){t.push(o)||(r=!0,e.pause())}});for(var o in e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<z.length;i++)e.on(z[i],this.emit.bind(this,z[i]));return this._read=function(t){J("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(u.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),u._fromList=C}).call(this,e(4),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{11:11,13:13,3:3,4:4,64:64,7:7,70:70,75:75,76:76,77:77,79:79,8:8,84:84}],73:[function(e,t,n){function r(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);s.call(this,e),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",i)}function i(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){a(e,t,n)}):a(this,null,null)}function a(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}t.exports=o;var s=e(70),u=e(7);u.inherits=e(11),u.inherits(o,s),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var n=this;s.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},{11:11,7:7,70:70}],74:[function(e,t,n){(function(n,r,o){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){P(t,e)}}function a(e){return M.from(e)}function s(e){return M.isBuffer(e)||e instanceof I}function u(){}function l(t,n){T=T||e(70),t=t||{};var r=n instanceof T;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var o=t.highWaterMark,a=t.writableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===t.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){g(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function c(t){if(T=T||e(70),!(L.call(c,this)||this instanceof T))return new c(t);this._writableState=new l(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),U.call(this)}function f(e,t){var n=new Error("write after end");e.emit("error",n),S.nextTick(t,n)}function h(e,t,n,r){var o=!0,i=!1;return null===n?i=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i&&(e.emit("error",i),S.nextTick(r,i),o=!1),o}function p(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=M.from(t,n)),t}function d(e,t,n,r,o,i){if(!n){var a=p(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else y(e,t,!1,s,r,o,i);return u}function y(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function v(e,t,n,r,o){--t.pendingcb,n?(S.nextTick(o,r),S.nextTick(C,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),C(e,t))}function _(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function g(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(_(n),t)v(e,n,r,t,o);else{var i=A(n);i||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?j(m,e,n,i,o):m(e,n,i,o)}}function m(e,t,n,r){n||b(e,t),t.pendingcb--,r(),C(e,t)}function b(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,y(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,f=n.callback;if(y(e,t,!1,t.objectMode?1:l.length,l,c,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function O(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,S.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function C(e,t){var n=A(t);return n&&(O(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}function k(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?S.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function P(e,t,n){var r=e.entry;for(e.entry=null;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}var S=e(64);t.exports=c;var T,j=!n.browser&&["v0.10","v0.9."].indexOf(n.version.slice(0,5))>-1?o:S.nextTick;c.WritableState=l;var x=e(7);x.inherits=e(11);var R={deprecate:e(90)},U=e(77),M=e(79).Buffer,I=r.Uint8Array||function(){},N=e(76);x.inherits(c,U),l.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(l.prototype,"buffer",{get:R.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var L;"function"==typeof Symbol&&("function"==typeof Symbol?Symbol.hasInstance:"@@hasInstance")&&"function"==typeof Function.prototype["function"==typeof Symbol?Symbol.hasInstance:"@@hasInstance"]?(L=Function.prototype["function"==typeof Symbol?Symbol.hasInstance:"@@hasInstance"],Object.defineProperty(c,"function"==typeof Symbol?Symbol.hasInstance:"@@hasInstance",{value:function(e){return!!L.call(this,e)||this===c&&(e&&e._writableState instanceof l)}})):L=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,n){var r=this._writableState,o=!1,i=!r.objectMode&&s(e);return i&&!M.isBuffer(e)&&(e=a(e)),"function"==typeof t&&(n=t,t=null),i?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=u),r.ended?f(this,n):(i||h(this,r,e,n))&&(r.pendingcb++,o=d(this,r,i,e,t,n)),o},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),c.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||k(this,r,n)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=N.destroy,c.prototype._undestroy=N.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e(4),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e(85).setImmediate)},{11:11,4:4,64:64,7:7,70:70,76:76,77:77,79:79,85:85,90:90}],75:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){e.copy(t,n)}var i=e(79).Buffer,a=e(3);t.exports=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t=i.allocUnsafe(e>>>0),n=this.head,r=0;n;)o(n.data,t,r),r+=n.data.length,n=n.next;return t},e}(),a&&a.inspect&&a.inspect.custom&&(t.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},{3:3,79:79}],76:[function(e,t,n){function r(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return r||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||a.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(a.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(e,t){e.emit("error",t)}var a=e(64);t.exports={destroy:r,undestroy:o}},{64:64}],77:[function(e,t,n){t.exports=e(8).EventEmitter},{8:8}],78:[function(e,t,n){n=t.exports=e(72),n.Stream=n,n.Readable=n,n.Writable=e(74),n.Duplex=e(70),n.Transform=e(73),n.PassThrough=e(71)},{70:70,71:71,72:72,73:73,74:74}],79:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return a(e,t,n)}var i=e(5),a=i.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=i:(r(i,n),n.Buffer=o),r(a,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{5:5}],80:[function(e,t,n){(function(t){var r=e(82),o=e(83),i=e(91),a=e(6),s=e(88),u=n;u.request=function(e,n){e="string"==typeof e?s.parse(e):i(e);var o=-1===t.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||o,u=e.hostname||e.host,l=e.port,c=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?a+"//"+u:"")+(l?":"+l:"")+c,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new r(e);return n&&f.on("response",n),f},u.get=function(e,t){var n=u.request(e,t);return n.end(),n},u.ClientRequest=r,u.IncomingMessage=o.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{6:6,82:82,83:83,88:88,91:91}],81:[function(e,t,n){(function(e){function t(){if(void 0!==i)return i;if(e.XMLHttpRequest){i=new e.XMLHttpRequest;try{i.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){i=null}}else i=null;return i}function r(e){var n=t();if(!n)return!1;try{return n.responseType=e,n.responseType===e}catch(e){}return!1}function o(e){return"function"==typeof e}n.fetch=o(e.fetch)&&o(e.ReadableStream),n.writableStream=o(e.WritableStream),n.abortController=o(e.AbortController),n.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),n.blobConstructor=!0}catch(e){}var i,a=void 0!==e.ArrayBuffer,s=a&&o(e.ArrayBuffer.prototype.slice);n.arraybuffer=n.fetch||a&&r("arraybuffer"),n.msstream=!n.fetch&&s&&r("ms-stream"),n.mozchunkedarraybuffer=!n.fetch&&a&&r("moz-chunked-arraybuffer"),n.overrideMimeType=n.fetch||!!t()&&o(t().overrideMimeType),n.vbArray=o(e.VBArray),i=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],82:[function(e,t,n){(function(n,r,o){function i(e,t){return s.fetch&&t?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&e?"arraybuffer":s.vbArray&&e?"text:vbarray":"text"}function a(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}var s=e(81),u=e(11),l=e(83),c=e(78),f=e(87),h=l.IncomingMessage,p=l.readyStates,d=t.exports=function(e){var t=this;c.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new o(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(n){t.setHeader(n,e.headers[n])});var n,r=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!s.abortController)r=!1,n=!0;else if("prefer-streaming"===e.mode)n=!1;else if("allow-wrong-content-type"===e.mode)n=!s.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");n=!0}t._mode=i(n,r),t._fetchTimer=null,t.on("finish",function(){t._onFinish()})};u(d,c.Writable),d.prototype.setHeader=function(e,t){var n=this,r=e.toLowerCase();-1===y.indexOf(r)&&(n._headers[r]={name:e,value:t})},d.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},d.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},d.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,i=e._headers,a=null;"GET"!==t.method&&"HEAD"!==t.method&&(a=s.arraybuffer?f(o.concat(e._body)):s.blobConstructor?new r.Blob(e._body.map(function(e){return f(e)}),{type:(i["content-type"]||{}).value||""}):o.concat(e._body).toString());var u=[];if(Object.keys(i).forEach(function(e){var t=i[e].name,n=i[e].value;Array.isArray(n)?n.forEach(function(e){u.push([t,e])}):u.push([t,n])}),"fetch"===e._mode){var l=null;if(s.abortController){var c=new AbortController;l=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=r.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}r.fetch(e._opts.url,{method:e._opts.method,headers:u,body:a||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:l}).then(function(t){e._fetchResponse=t,e._connect()},function(t){r.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var h=e._xhr=new r.XMLHttpRequest;try{h.open(e._opts.method,e._opts.url,!0)}catch(t){return void n.nextTick(function(){e.emit("error",t)})}"responseType"in h&&(h.responseType=e._mode.split(":")[0]),"withCredentials"in h&&(h.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in h&&h.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(h.timeout=t.requestTimeout,h.ontimeout=function(){e.emit("requestTimeout")}),u.forEach(function(e){h.setRequestHeader(e[0],e[1])}),e._response=null,h.onreadystatechange=function(){switch(h.readyState){case p.LOADING:case p.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(h.onprogress=function(){e._onXHRProgress()}),h.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{h.send(a)}catch(t){return void n.nextTick(function(){e.emit("error",t)})}}}},d.prototype._onXHRProgress=function(){var e=this;a(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},d.prototype._connect=function(){var e=this;e._destroyed||(e._response=new h(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},d.prototype._write=function(e,t,n){this._body.push(e),n()},d.prototype.abort=d.prototype.destroy=function(){var e=this;e._destroyed=!0,r.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},d.prototype.end=function(e,t,n){var r=this;"function"==typeof e&&(n=e,e=void 0),c.Writable.prototype.end.call(r,e,t,n)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,e(4),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e(5).Buffer)},{11:11,4:4,5:5,78:78,81:81,83:83,87:87}],83:[function(e,t,n){(function(t,r,o){var i=e(81),a=e(11),s=e(78),u=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=n.IncomingMessage=function(e,n,a,u){var l=this;if(s.Readable.call(l),l._mode=a,l.headers={},l.rawHeaders=[],l.trailers={},l.rawTrailers=[],l.on("end",function(){t.nextTick(function(){l.emit("close")})}),"fetch"===a){if(l._fetchResponse=n,l.url=n.url,l.statusCode=n.status,l.statusMessage=n.statusText,n.headers.forEach(function(e,t){l.headers[t.toLowerCase()]=e,l.rawHeaders.push(t,e)}),i.writableStream){var c=new WritableStream({write:function(e){return new Promise(function(t,n){l._destroyed?n():l.push(new o(e))?t():l._resumeFetch=t})},close:function(){r.clearTimeout(u),l._destroyed||l.push(null)},abort:function(e){l._destroyed||l.emit("error",e)}});try{return void n.body.pipeTo(c).catch(function(e){r.clearTimeout(u),l._destroyed||l.emit("error",e)})}catch(e){}}var f=n.body.getReader();!function e(){f.read().then(function(t){if(!l._destroyed){if(t.done)return r.clearTimeout(u),void l.push(null);l.push(new o(t.value)),e()}}).catch(function(e){r.clearTimeout(u),l._destroyed||l.emit("error",e)})}()}else{l._xhr=e,l._pos=0,l.url=e.responseURL,l.statusCode=e.status,l.statusMessage=e.statusText;if(e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===l.headers[n]&&(l.headers[n]=[]),l.headers[n].push(t[2])):void 0!==l.headers[n]?l.headers[n]+=", "+t[2]:l.headers[n]=t[2],l.rawHeaders.push(t[1],t[2])}}),l._charset="x-user-defined",!i.overrideMimeType){var h=l.rawHeaders["mime-type"];if(h){var p=h.match(/;\s*charset=([^;])(;|$)/);p&&(l._charset=p[1].toLowerCase())}l._charset||(l._charset="utf-8")}}};a(l,s.Readable),l.prototype._read=function(){var e=this,t=e._resumeFetch;t&&(e._resumeFetch=null,t())},l.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==u.DONE)break;try{n=new r.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new o(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var i=n.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new o(i.length),s=0;s<i.length;s++)a[s]=255&i.charCodeAt(s);e.push(a)}else e.push(i,e._charset);e._pos=n.length}break;case"arraybuffer":if(t.readyState!==u.DONE||!t.response)break;n=t.response,e.push(new o(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=t.response,t.readyState!==u.LOADING||!n)break;e.push(new o(new Uint8Array(n)));break;case"ms-stream":if(n=t.response,t.readyState!==u.LOADING)break;var l=new r.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(new o(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){e.push(null)},l.readAsArrayBuffer(n)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e(4),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e(5).Buffer)},{11:11,4:4,5:5,78:78,81:81}],84:[function(e,t,n){function r(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function o(e){var t=r(e);if("string"!=typeof t&&(g.isEncoding===m||!m(e)))throw new Error("Unknown encoding: "+e);return t||e}function i(e){this.encoding=o(e);var t;switch(this.encoding){case"utf16le":this.text=h,this.end=p,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=d,this.end=y,t=3;break;default:return this.write=v,void(this.end=_)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--r<n||-2===o?0:(o=a(t[r]))>=0?(o>0&&(e.lastNeed=o-2),o):--r<n||-2===o?0:(o=a(t[r]),o>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0)}function u(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}function l(e){var t=this.lastTotal-this.lastNeed,n=u(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function h(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function d(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function y(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):""}var g=e(79).Buffer,m=g.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=f,i.prototype.text=c,i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{79:79}],85:[function(e,t,n){(function(t,r){function o(e,t){this._id=e,this._clearFn=t}var i=e(86).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,u={},l=0;n.setTimeout=function(){return new o(a.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new o(a.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=l++,r=!(arguments.length<2)&&s.call(arguments,1);return u[t]=!0,i(function(){u[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(this,e(85).setImmediate,e(85).clearImmediate)},{85:85,86:86}],86:[function(e,t,n){arguments[4][4][0].apply(n,arguments)},{4:4}],87:[function(e,t,n){var r=e(5).Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(r.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,o=0;o<n;o++)t[o]=e[o];return t.buffer}throw new Error("Argument must be a Buffer")}},{5:5}],88:[function(e,t,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,
this.pathname=null,this.path=null,this.href=null}function o(e,t,n){if(e&&l.isObject(e)&&e instanceof r)return e;var o=new r;return o.parse(e,t,n),o}function i(e){return l.isString(e)&&(e=o(e)),e instanceof r?e.format():r.prototype.format.call(e)}function a(e,t){return o(e,!1,!0).resolve(t)}function s(e,t){return e?o(e,!1,!0).resolveObject(t):t}var u=e(65),l=e(89);n.parse=o,n.resolve=a,n.resolveObject=s,n.format=i,n.Url=r;var c=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,p=["<",">",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(p),y=["'"].concat(d),v=["%","/","?",";","#"].concat(y),_=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},A={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=e(69);r.prototype.parse=function(e,t,n){if(!l.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":_typeof2(e)));var r=e.indexOf("?"),o=-1!==r&&r<e.indexOf("#")?"?":"#",i=e.split(o),a=/\\/g;i[0]=i[0].replace(a,"/"),e=i.join(o);var s=e;if(s=s.trim(),!n&&1===e.split("#").length){var f=h.exec(s);if(f)return this.path=s,this.href=s,this.pathname=f[1],f[2]?(this.search=f[2],this.query=t?E.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var p=c.exec(s);if(p){p=p[0];var d=p.toLowerCase();this.protocol=d,s=s.substr(p.length)}if(n||p||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var O="//"===s.substr(0,2);!O||p&&w[p]||(s=s.substr(2),this.slashes=!0)}if(!w[p]&&(O||p&&!A[p])){for(var C=-1,k=0;k<_.length;k++){var P=s.indexOf(_[k]);-1!==P&&(-1===C||P<C)&&(C=P)}var S,T;T=-1===C?s.lastIndexOf("@"):s.lastIndexOf("@",C),-1!==T&&(S=s.slice(0,T),s=s.slice(T+1),this.auth=decodeURIComponent(S)),C=-1;for(var k=0;k<v.length;k++){var P=s.indexOf(v[k]);-1!==P&&(-1===C||P<C)&&(C=P)}-1===C&&(C=s.length),this.host=s.slice(0,C),s=s.slice(C),this.parseHost(),this.hostname=this.hostname||"";var j="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!j)for(var x=this.hostname.split(/\./),k=0,R=x.length;k<R;k++){var U=x[k];if(U&&!U.match(g)){for(var M="",I=0,N=U.length;I<N;I++)U.charCodeAt(I)>127?M+="x":M+=U[I];if(!M.match(g)){var L=x.slice(0,k),F=x.slice(k+1),B=U.match(m);B&&(L.push(B[1]),F.unshift(B[2])),F.length&&(s="/"+F.join(".")+s),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=u.toASCII(this.hostname));var D=this.port?":"+this.port:"",J=this.hostname||"";this.host=J+D,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!b[d])for(var k=0,R=y.length;k<R;k++){var H=y[k];if(-1!==s.indexOf(H)){var q=encodeURIComponent(H);q===H&&(q=escape(H)),s=s.split(H).join(q)}}var G=s.indexOf("#");-1!==G&&(this.hash=s.substr(G),s=s.slice(0,G));var z=s.indexOf("?");if(-1!==z?(this.search=s.substr(z),this.query=s.substr(z+1),t&&(this.query=E.parse(this.query)),s=s.slice(0,z)):t&&(this.search="",this.query={}),s&&(this.pathname=s),A[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var D=this.pathname||"",V=this.search||"";this.path=D+V}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&l.isObject(this.query)&&Object.keys(this.query).length&&(i=E.stringify(this.query));var a=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||A[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),a=a.replace("#","%23"),t+o+n+a+r},r.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(l.isString(e)){var t=new r;t.parse(e,!1,!0),e=t}for(var n=new r,o=Object.keys(this),i=0;i<o.length;i++){var a=o[i];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(n[c]=e[c])}return A[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!A[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var p=f[h];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||w[e.protocol])n.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),n.pathname=d.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var y=n.pathname||"",v=n.search||"";n.path=y+v}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var _=n.pathname&&"/"===n.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),m=g||_||n.host&&e.pathname,b=m,E=n.pathname&&n.pathname.split("/")||[],d=e.pathname&&e.pathname.split("/")||[],O=n.protocol&&!A[n.protocol];if(O&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),m=m&&(""===d[0]||""===E[0])),g)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,E=d;else if(d.length)E||(E=[]),E.pop(),E=E.concat(d),n.search=e.search,n.query=e.query;else if(!l.isNullOrUndefined(e.search)){if(O){n.hostname=n.host=E.shift();var C=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");C&&(n.auth=C.shift(),n.host=n.hostname=C.shift())}return n.search=e.search,n.query=e.query,l.isNull(n.pathname)&&l.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var k=E.slice(-1)[0],P=(n.host||e.host||E.length>1)&&("."===k||".."===k)||""===k,S=0,T=E.length;T>=0;T--)k=E[T],"."===k?E.splice(T,1):".."===k?(E.splice(T,1),S++):S&&(E.splice(T,1),S--);if(!m&&!b)for(;S--;S)E.unshift("..");!m||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),P&&"/"!==E.join("/").substr(-1)&&E.push("");var j=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(O){n.hostname=n.host=j?"":E.length?E.shift():"";var C=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");C&&(n.auth=C.shift(),n.host=n.hostname=C.shift())}return m=m||n.host&&E.length,m&&!j&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),l.isNull(n.pathname)&&l.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=f.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{65:65,69:69,89:89}],89:[function(e,t,n){t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"===(void 0===e?"undefined":_typeof2(e))&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],90:[function(e,t,n){(function(e){function n(e,t){function n(){if(!o){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),o=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var o=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(e,t,n){function r(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)o.call(n,r)&&(e[r]=n[r])}return e}t.exports=r;var o=Object.prototype.hasOwnProperty},{}],92:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.authApi={};r.auth=function(){return new e.Promise(function(r,o){t.postJsonAsync(n.createApiUrl("Auth"),{api_key:e.env.global.apiKey,api_secret:e.env.global.apiSecret}).then(function(t){e.env.global.token=t.response.token,r(t)},function(e){o(e)})})},r.renew=function(){return new e.Promise(function(r,o){t.postJsonAsync(n.createApiUrl("Auth/renew"),{api_key:e.env.global.apiKey,api_secret:e.env.global.apiSecret}).then(function(t){e.env.global.token=t.response.token,r(t)},function(e){o(e)})})}}},{}],93:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.badgeApi={};r.badgesInfo=function(e){var r=null;return null!=e&&null!=e.tags&&(r=e.tags),t.getJsonAsync(n.createApiUrl("Badges")+"&"+n.joinIfNotNullAsUrlParam("tags",r))},r.badgeInfo=function(e){return t.getJsonAsync(n.createApiUrl("Badge",e))}}},{}],94:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.communicationApi={};r.sendEmail=function(r,o,i,a){var s={token:e.env.global.token,player_id:r,subject:o,message:i,template_id:a};return t.postJsonAsync(n.createApiUrl("Email/send"),s)},r.sendEmailCoupon=function(r,o,i,a,s){var u={token:e.env.global.token,player_id:r,ref_id:o,subject:i,message:a,template_id:s};return t.postJsonAsync(n.createApiUrl("Email/goods"),u)},r.listRecentEmailSent=function(e,r){var o=["player_id","since"],i=[e,null];return t.getJsonAsync(n.createApiUrl("Email/recent")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.listEmailTemplate=function(){return t.getJsonAsync(n.createApiUrl("Email/template"))},r.getProcessedEmailTemplate=function(e,r){var o=["player_id"],i=[null];return t.getJsonAsync(n.createApiUrl("Email/template",e)+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.sendSMS=function(r,o,i){var a={token:e.env.global.token,player_id:r,message:o,template_id:i};return t.postJsonAsync(n.createApiUrl("Sms/send"),a)},r.sendSMSCoupon=function(r,o,i,a){var s={token:e.env.global.token,player_id:r,ref_id:o,message:i,template_id:a};return t.postJsonAsync(n.createApiUrl("Sms/goods"),s)},r.listRecentSMSSent=function(e,r){var o=["player_id","since"],i=[e,null];return t.getJsonAsync(n.createApiUrl("Sms/recent")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.listSMSTemplate=function(){return t.getJsonAsync(n.createApiUrl("Sms/template"))},r.getProcessedSMSTemplate=function(e,r){var o=["player_id"],i=[null];return t.getJsonAsync(n.createApiUrl("Sms/template",e)+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.registerDevice=function(r,o,i,a,s){var u={token:e.env.global.token,player_id:r,device_token:o,device_description:i,device_name:a,os_type:s};return t.postJsonAsync(n.createApiUrl("Push/deviceRegistration"),u)},r.deregisterDevice=function(r,o){var i={token:e.env.global.token,player_id:r,device_token:o};return t.postJsonAsync(n.createApiUrl("Push/deviceDeRegistration"),i)},r.sendPushNotification=function(r,o,i){var a={token:e.env.global.token,player_id:r,message:o,template_id:i};return t.postJsonAsync(n.createApiUrl("Push/send"),a)},r.sendPushNotificationCoupon=function(r,o,i,a){var s={token:e.env.global.token,player_id:r,message:i,template_id:a};return t.postJsonAsync(n.createApiUrl("Push/goods"),s)},r.listRecentPushNotificationSent=function(e,r){var o=["player_id","since"],i=[e,null];return t.getJsonAsync(n.createApiUrl("Push/recent")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.listPushNotificationTemplate=function(){return t.getJsonAsync(n.createApiUrl("Push/template"))},r.getProcessedPushNotificationTemplate=function(e,r){var o=["player_id"],i=[null];return t.getJsonAsync(n.createApiUrl("Push/template",e)+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))}}},{}],95:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.contentApi={};r.retrieveContent=function(e){var r=["node_id","title","category","date_check","sort","order","offset","limit","full_html","pin","tags","status","player_id","only_new_content","only_new_feedback"],o=[null,null,null,"true","title","asc",0,20,"false",null,null,null,null,null,null];return t.getJsonAsync(n.createApiUrl("Content")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.countContent=function(e){var r=["title","category","date_check","pin","tags","status","player_id","only_new_content","only_new_feedback"],o=[null,null,"false",null,null,null,null,null,null,null];return t.getJsonAsync(n.createApiUrl("Content","count")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.createContent=function(r,o,i,a){var s={token:e.env.global.token,title:r,summary:o,detail:i},u=n.createObjectFromTarget(a,["node_id","category","image","status","date_start","date_end","player_id","pin","tags","key","value"]),l=n.combineObjects(s,u);return t.postJsonAsync(n.createApiUrl("Content","addContent"),l)},r.updateContent=function(r,o){var i={token:e.env.global.token},a=n.createObjectFromTarget(o,["title","summary","detail","category","image","status","date_start","date_end","pin","tags","key","value"]);n.combineObjects(i,a);return t.postJsonAsync(n.createApiUrl("Content",r,"update"),i)},r.deleteContent=function(r){var o={token:e.env.global.token};return t.postJsonAsync(n.createApiUrl("Content",r,"delete"),o)},r.retrieveCategory=function(e){var r=["id","name","sort","order","offset","limit"],o=[null,null,null,null,null,null];return t.getJsonAsync(n.createApiUrl("Content","category")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.createCategory=function(r){var o={token:e.env.global.token,name:r};return t.postJsonAsync(n.createApiUrl("Content","category","create"),o)},r.updateCategory=function(r,o){var i={token:e.env.global.token,id:r,name:o};return t.postJsonAsync(n.createApiUrl("Content","category","update"),i)},r.deleteCategory=function(r){var o={token:e.env.global.token,id:r};return t.postJsonAsync(n.createApiUrl("Content","category","delete"),o)},r.likeContent=function(r,o,i){var a={token:e.env.global.token},s=n.createObjectFromTarget(i,["key","value"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Content",r,"player",o,"like"),u)},r.dislikeContent=function(r,o,i){var a={token:e.env.global.token},s=n.createObjectFromTarget(i,["key","value"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Content",r,"player",o,"dislike"),u)},r.giveFeedbackContent=function(r,o,i,a){var s={token:e.env.global.token,feedback:i},u=n.createObjectFromTarget(a,["key","value"]),l=n.combineObjects(s,u);return t.postJsonAsync(n.createApiUrl("Content",r,"player",o,"feedback"),l)}}},{}],96:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.engineApi={};r.listRules=function(e){var r=["action","player_id"],o=[null,null];return t.getJsonAsync(n.createApiUrl("Engine","rules")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.ruleDetail=function(e,r){var o=["player_id"],i=[null];return t.getJsonAsync(n.createApiUrl("Engine","rule",e)+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.rule=function(r,o,i){var a={token:e.env.global.token,action:r,player_id:o},s=n.createObjectFromTarget(i,["url","reward","quantity","rule_id","node_id","session_id"]),u=n.combineObjects(a,s);return null!=i&&null!=i.post_custom_params&&(u=n.combineObjects(u,i.post_custom_params)),t.postJsonAsync(n.createApiUrl("Engine","rule"),u)}}},{}],97:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.goodsApi={};r.goodsListInfo=function(e){var r=["player_id","active_filter","name","date_start","date_end","offset","limit","tags","custom_param","not_custom_param"],o=[null,null,null,null,null,null,null,null,null,null];return t.getJsonAsync(n.createApiUrl("Goods")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.goodsListInfoWithSelectedFields=function(e){var r=["player_id","selected_field","active_filter","date_start","date_end","offset","limit","tags","custom_param","not_custom_param"],o=[null,null,null,null,null,null,null,null,null,null];return t.getJsonAsync(n.createApiUrl("Goods","field")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.goodsInfo=function(e,r){var o=["player_id"],i=[null];return t.getJsonAsync(n.createApiUrl("Goods",e)+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.goodsGroupAvailable=function(e,r,o){var i=["player_id","group","amount"],a=[e,r,null];return t.getJsonAsync(n.createApiUrl("Redeem","goodsGroup")+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.sponsoredGoodsListInfo=function(){return t.getJsonAsync(n.createApiUrl("Goods","sponsor"))},r.sponsoredGoodsInfo=function(e){return t.getJsonAsync(n.createApiUrl("Goods","sponsor",e))},r.sponsoredGoodsGroupAvailable=function(e,r,o){var i=["player_id","group","amount"],a=[e,r,null];return t.getJsonAsync(n.createApiUrl("Redeem","sponsorGroup")+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.verifyCoupon=function(e,r,o){var i=["goods_id","coupon_code","player_id"],a=[e,r,null];return t.getJsonAsync(n.createApiUrl("Goods","couponVerify")+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.verifyCouponWithRedeem=function(r,o,i){var a={token:e.env.global.token,goods_id:r,coupon_code:o,player_id:i};return t.postJsonAsync(n.createApiUrl("Goods","couponVerify"),a)}}},{}],98:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.livefeedApi={};r.recentActivities=function(e){var r=["player_id","offset","limit","last_read_activity_id","mode","event_type"],o=[null,0,20,null,"all",null];return t.getJsonAsync(n.createApiUrl("Service","recentActivities")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.detailActivity=function(e){return t.getJsonAsync(n.createApiUrl("Service","detailActivityFeed",e))},r.likeActivity=function(r,o){var i={token:e.env.global.token,player_id:o};return t.postJsonAsync(n.createApiUrl("Service","likeActivityFeed",r),i)},r.commentActivity=function(r,o,i){var a={token:e.env.global.token,player_id:o,message:i};return t.postJsonAsync(n.createApiUrl("Service","commentActivityFeed",r),a)}}},{}],99:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.merchantApi={};r.availableBranchForGoodsGroup=function(e){return t.getJsonAsync(n.createApiUrl("Merchant","availableBranchGoodsGroup")+n.appendAndJoinIfNotNullAsUrlParam("goods_group",e))},r.verifyCoupon=function(e,r,o){var i=["goods_group","coupon_code","pin_code","player_id"],a=[e,r,null,null];return t.getJsonAsync(n.createApiUrl("Merchant","goodsGroup","verify")+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.redeemCoupon=function(r,o,i){var a={token:e.env.global.token,goods_group:r,coupon_code:o},s=n.createObjectFromTarget(i,["pin_code","player_id"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Merchant","goodsGroup","redeem"),u)},r.redeemGoods=function(r,o,i){var a={token:e.env.global.token,goods_name:r,player_id:o},s=n.createObjectFromTarget(i,["amount"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Merchant","goods","redeem"),u)}}},{}],100:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.playerApi={};r.playerPublicInfo=function(e){return t.getJsonAsync(n.createApiUrl("Player",e))},r.playerInfo=function(r){return t.postJsonAsync(n.createApiUrl("Player",r),{token:e.env.global.token})},r.listPlayer=function(r){var o=r.join(",");return t.postJsonAsync(n.createApiUrl("Player","list"),{token:e.env.global.token,list_player_id:o})},r.playerDetailedPublicInfo=function(e){return t.getJsonAsync(n.createApiUrl("Player",e,"data","all"))},r.playerDetailedInfo=function(r){return t.postJsonAsync(n.createApiUrl("Player",r,"data","all"),{token:e.env.global.token})},r.listCustomFieldsOfPlayer=function(e){return t.getJsonAsync(n.createApiUrl("Player",e,"custom"))},r.setCustomFieldOfPlayer=function(r,o,i){return t.postJsonAsync(n.createApiUrl("Player",r,"custom"),{token:e.env.global.token,key:o,value:i})},r.register=function(r,o,i){var a={token:e.env.global.token,username:r,email:o};if(null!=i)for(var s in i)"token"!=s&&"username"!=s&&"email"!=s&&(a[s]=i[s]);return t.postJsonAsync(n.createApiUrl("Player",r,"register"),a)},r.referral=function(r,o,i){var a={token:e.env.global.token,player_id:r,referral_code:o};if(null!=i)for(var s in i)"token"!=s&&"player_id"!=s&&"referral_code"!=s&&(a[s]=i[s]);return t.postJsonAsync(n.createApiUrl("Player","referral"),a)},r.update=function(r,o){var i={token:e.env.global.token},a=n.createObjectFromTarget(o,["username","email","image","phone_number","exp","level","facebook_id","twitter_id","password","first_name","last_name","gender","birth_date","device_id"]),s=n.combineObjects(i,a);return t.postJsonAsync(n.createApiUrl("Player",r,"update"),s)},r.resetPlayerPassword=function(r){var o={token:e.env.global.token,email:r};return t.postJsonAsync(n.createApiUrl("Player","password","email"),o)},r.verifyPlayerEmail=function(r){return t.postJsonAsync(n.createApiUrl("Player",r,"email","verify"),{token:e.env.global.token})},r.delete=function(r){return t.postJsonAsync(n.createApiUrl("Player",r,"delete"),{token:e.env.global.token})},r.login=function(r){return t.postJsonAsync(n.createApiUrl("Player",r,"login"),{token:e.env.global.token})},r.requestOTP=function(r){return t.postJsonAsync(n.createApiUrl("Player","auth",r,"requestOTPCode"),{token:e.env.global.token})},r.requestOTPforSetupPhone=function(r,o){return t.postJsonAsync(n.createApiUrl("Player","auth",r,"setupPhone"),{token:e.env.global.token,phone_number:o})},r.performOTPVerification=function(r,o){return t.postJsonAsync(n.createApiUrl("Player","auth",r,"verifyOTPCode"),{token:e.env.global.token,code:o})},r.logout=function(r){return t.postJsonAsync(n.createApiUrl("Player",r,"logout"),{token:e.env.global.token})},r.listActivePlayerSessions=function(e){return t.getJsonAsync(n.createApiUrl("Player",e,"sessions"))},r.findPlayerBySession=function(e){return t.getJsonAsync(n.createApiUrl("Player","session",e))},r.points=function(e){return t.getJsonAsync(n.createApiUrl("Player",e,"points"))},r.point=function(e,r){return t.getJsonAsync(n.createApiUrl("Player",e,"point",r))},r.pointHistory=function(e,r){var o=["point_name","offset","limit","order"],i=[null,0,20,"desc"];return t.getJsonAsync(n.createApiUrl("Player",e,"point_history")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.actionTime=function(e,r){return t.getJsonAsync(n.createApiUrl("Player",e,"action",r,"time"))},r.lastAction=function(e){return t.getJsonAsync(n.createApiUrl("Player",e,"action","time"))},r.actionCount=function(e,r){return t.getJsonAsync(n.createApiUrl("Player",e,"action",r,"count"))},r.level=function(e){return t.getJsonAsync(n.createApiUrl("Player","level",e))},r.levels=function(){return t.getJsonAsync(n.createApiUrl("Player","levels"))},r.badge=function(e,r){var o=["tags"],i=[null];return t.getJsonAsync(n.createApiUrl("Player",e,"badge")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.allBadges=function(e,r){var o=["tags"],i=[null];return t.getJsonAsync(n.createApiUrl("Player",e,"badgeAll")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.rank=function(e,r,o){var i=["mode"],a=["all-time"];return t.getJsonAsync(n.createApiUrl("Player","rank",e,r)+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.ranks=function(e,r){var o=["mode"],i=["all-tiome"];return t.getJsonAsync(n.createApiUrl("Player","ranks",e)+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.goods=function(e,r){var o=["tags","status"],i=[null,"active"];return t.getJsonAsync(n.createApiUrl("Player",e,"goods")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.questOfPlayer=function(e,r){return t.getJsonAsync(n.createApiUrl("Player","quest",r)+"&player_id="+e)},r.questListOfPlayer=function(e,r){var o=["player_id","tags"],i=[e,null];return t.getJsonAsync(n.createApiUrl("Player","quest")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.allQuestsOfPlayer=function(e){return t.getJsonAsync(n.createApiUrl("Player","questAll",e))},r.questRewardHistory=function(e,r){var o=["offset","limit"],i=[0,50];return t.getJsonAsync(n.createApiUrl("Player",e,"quest_reward_history")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.deductReward=function(r,o,i,a){var s={token:e.env.global.token,reward:o,amount:i},u=n.createObjectFromTarget(a,["force"]),l=n.combineObjects(s,u);return t.postJsonAsync(n.createApiUrl("Player",r,"deduct"),l)},r.deductBadge=function(r,o,i,a){var s={token:e.env.global.token,badge:o,amount:i},u=n.createObjectFromTarget(a,["force"]),l=n.combineObjects(s,u);return t.postJsonAsync(n.createApiUrl("Player",r,"deduct","badge"),l)},r.giveGift=function(r,o,i,a,s){var u={token:e.env.global.token,sent_player_id:r,received_player_id:o,gift_id:i,type:a,amount:s};return t.postJsonAsync(n.createApiUrl("Player",r,"giveGift",a),u)},r.playerReferralCode=function(e){return t.getJsonAsync(n.createApiUrl("Player",e,"code"))},r.goodsCount=function(e,r){var o=["tags","status"],i=[null,"active"];return t.getJsonAsync(n.createApiUrl("Player",e,"goods/count")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.favoriteGoods=function(r,o,i){var a={token:e.env.global.token,goods_id:o,status:i?"true":"false"};return t.postJsonAsync(n.createApiUrl("Player",r,"goods","favorite"),a)}}},{}],101:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.pointApi={};r.listCustomStatus=function(e){var r=["player_list","status","from","to","offset","limit"],o=[null,null,null,null,"0","20"];return t.getJsonAsync(n.createApiUrl("Point","custom","list")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.retrieveTransactionCustomPoint=function(e){return t.getJsonAsync(n.createApiUrl("Point","custom","transaction")+n.appendAndJoinIfNotNullAsUrlParam("transaction_id",e))},r.approveTransactionCustomPoint=function(r,o){var i={token:e.env.global.token,transaction_list:r,approve:"true"};return null!=o&&null!=o.approve&&(i.approve=o.approve),t.postJsonAsync(n.createApiUrl("Point","custom","approval"),i)},r.retrieveRemainingPoints=function(e){var r=["name"],o=[null];return t.getJsonAsync(n.createApiUrl("Point","custom","remaining")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))}}},{}],102:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.questApi={};r.questListInfo=function(e){var r=["tags"],o=[null];return t.getJsonAsync(n.createApiUrl("Quest")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.questInfo=function(e){return t.getJsonAsync(n.createApiUrl("Quest",e))},r.missionInfo=function(e,r){return t.getJsonAsync(n.createApiUrl("Quest",e,"mission",r))},r.questListAvailableForPlayer=function(e){return t.getJsonAsync(n.createApiUrl("Quest","available")+n.appendAndJoinIfNotNullAsUrlParam("player_id",e))},r.questAvailableForPlayer=function(e,r){return t.getJsonAsync(n.createApiUrl("Quest",e,"available")+n.appendAndJoinIfNotNullAsUrlParam("player_id",r))},r.joinQuest=function(r,o){var i={token:e.env.global.token,player_id:o};return t.postJsonAsync(n.createApiUrl("Quest",r,"join"),i)},r.joinAllQuests=function(r){var o={token:e.env.global.token,player_id:r};return t.postJsonAsync(n.createApiUrl("Quest","joinAll"),o)},r.cancelQuest=function(r,o){var i={token:e.env.global.token,player_id:o};return t.postJsonAsync(n.createApiUrl("Quest",r,"cancel"),i)},r.resetQuest=function(r,o){var i={token:e.env.global.token,player_id:r},a=n.createObjectFromTarget(o,["quest_id"]);n.combineObjects(i,a);return t.postJsonAsync(n.createApiUrl("Quest","reset"),combineObj)},r.questLeaderboard=function(e,r){var o=["quest_id","completion_element_id","player_id","offset","limit","status"],i=[e,null,null,0,20,"all"];return t.getJsonAsync(n.createApiUrl("Quest","leader")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))}}},{}],103:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.quizApi={};r.listOfActiveQuizzes=function(e){var r=["player_id","type","tags"],o=[null,null,null];return t.getJsonAsync(n.createApiUrl("Quiz","list")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.detailOfQuiz=function(e,r){var o=["player_id"],i=[null];return t.getJsonAsync(n.createApiUrl("Quiz",e,"detail")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.randomQuizForPlayer=function(e,r){var o=["player_id","type","tags"],i=[e,null,null];return t.getJsonAsync(n.createApiUrl("Quiz","random")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.listQuizDone=function(e,r){return t.getJsonAsync(n.createApiUrl("Quiz","player",e,r))},r.listPendingQuiz=function(e,r){return t.getJsonAsync(n.createApiUrl("Quiz","player",e,"pending",r))},r.getQuestionFromQuiz=function(e,r,o){var i=["player_id","question_id","random"],a=[r,null,null];return t.getJsonAsync(n.createApiUrl("Quiz",e,"question")+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.getQuestionFromQuiz_resetTimeStamp=function(r,o,i){var a={token:e.env.global.token,player_id:o},s=n.createObjectFromTarget(i,["question_id","random"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Quiz",r,"question"),u)},r.answerQuestion=function(r,o,i,a){var s={token:e.env.global.token,player_id:o,question_id:i,option_id:a};return t.postJsonAsync(n.createApiUrl("Quiz",r,"answer"),s)},r.rankPlayersByScore=function(e,r){return t.getJsonAsync(n.createApiUrl("Quiz",e,"rank",r))},r.quizStatistics=function(e){return t.getJsonAsync(n.createApiUrl("Quiz",e,"stat"))},r.resetQuiz=function(r,o){var i={token:e.env.global.token,player_id:r,quiz_id:o};return t.postJsonAsync(n.createApiUrl("Quiz","reset"),i)}}},{}],104:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.redeemApi={};r.redeem=function(r,o,i){var a={token:e.env.global.token,goods_id:r,player_id:o},s=n.createObjectFromTarget(i,["amount"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Redeem","goods"),u)},r.redeemGoodsGroup=function(r,o,i){var a={token:e.env.global.token,player_id:r,group:o},s=n.createObjectFromTarget(i,["amount"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Redeem","goodsGroup"),u)},r.redeemVerify=function(r,o,i){var a={token:e.env.global.token,goods_group:r,coupon_code:o,pin_code:i};return t.postJsonAsync(n.createApiUrl("Redeem","goodsGroup","verify"),a)},r.redeemSponsor=function(r,o,i){var a={token:e.env.global.token,goods_id:r,player_id:o},s=n.createObjectFromTarget(i,["amount"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Redeem","sponsor"),u)},r.redeemSponsoredGoodsGroup=function(r,o,i){var a={token:e.env.global.token,player_id:r,group:o},s=n.createObjectFromTarget(i,["amount"]),u=n.combineObjects(a,s);return t.postJsonAsync(n.createApiUrl("Redeem","sponsorGroup"),u)}}},{}],105:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.serviceApi={};r.recentPoint=function(e){var r=["point_name","offset","limit"],o=[null,0,20];return t.getJsonAsync(n.createApiUrl("Service","recent_point")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.resetPoint=function(r){var o={token:e.env.global.token,point_name:r};return t.postJsonAsync(n.createApiUrl("Service","reset_point"),o)}}},{}],106:[function(e,t,n){t.exports=function(e){var t=e.http,n=e.helpers,r=e.storeOrganizeApi={};r.listOrganizations=function(e){var r=["id","search","sort","order","offset","limit"],o=[null,null,"name","asc",0,20];return t.getJsonAsync(n.createApiUrl("StoreOrg","organizes")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.listNodes=function(e){var r=["id","organize_id","parent_id","search","sort","order","offset","limit"],o=[null,null,null,null,"name","asc",0,20];return t.getJsonAsync(n.createApiUrl("StoreOrg","nodes")+n.appendAndJoinIfNotNullAsUrlParam2(r,o,e))},r.addPlayerToNode=function(r,o){var i={token:e.env.global.token};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"addPlayer",o),i)},r.removePlayerFromNode=function(r,o){var i={token:e.env.global.token};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"removePlayer",o),i)},r.setPlayerRole=function(r,o,i){var a={token:e.env.global.token,role:i};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"setPlayerRole",o),a)},r.unsetPlayerRole=function(r,o,i){var a={
token:e.env.global.token,role:i};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"unsetPlayerRole",o),a)},r.listPlayerFromNode=function(e,r){var o=["role"],i=[null];return t.getJsonAsync(n.createApiUrl("StoreOrg","players",e)+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.peerLeaderboard=function(e,r,o){var i=["page","limit","under_org","role","player_id","month","year"],a=[0,20,"false",null,null,null,null];return t.getJsonAsync(n.createApiUrl("StoreOrg","rankPeer",e,r)+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.peerLeaderboardByAction=function(e,r,o,i){var a=["role","page","limit","player_id","month","year"],s=[null,0,20,null,null,null];return t.getJsonAsync(n.createApiUrl("StoreOrg","rankPeerByAccAction",e,r,o)+n.appendAndJoinIfNotNullAsUrlParam2(a,s,i))},r.findChildNodes=function(e,r){return t.getJsonAsync(n.createApiUrl("StoreOrg","nodes",e,"getChildNode",r))},r.saleReport=function(e,r){var o=["month","year","action","parameter"],i=[null,null,null,null];return t.getJsonAsync(n.createApiUrl("StoreOrg","nodes",e,"saleReport")+n.appendAndJoinIfNotNullAsUrlParam2(o,i,r))},r.saleHistory=function(e,r,o){var i=["month","year","action","parameter"],a=[null,null,null,null];return t.getJsonAsync(n.createApiUrl("StoreOrg","nodes",e,"saleHistory",r)+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.saleBoard=function(e,r,o){var i=["month","year","action","parameter","page","limit"],a=[null,null,null,null,0,20];return t.getJsonAsync(n.createApiUrl("StoreOrg","nodes",e,"saleBoard",r)+n.appendAndJoinIfNotNullAsUrlParam2(i,a,o))},r.addContentToNode=function(r,o){var i={token:e.env.global.token};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"addContent",o),i)},r.removeContentFromNode=function(r,o){var i={token:e.env.global.token};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"removeContent",o),i)},r.setContentRole=function(r,o,i){var a={token:e.env.global.token,role:i};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"setContentRole",o),a)},r.unsetContentRole=function(r,o,i){var a={token:e.env.global.token,role:i};return t.postJsonAsync(n.createApiUrl("StoreOrg","nodes",r,"unsetContentRole",o),a)}}},{}],107:[function(e,t,n){t.exports=function(e){e.const={},e.const.errorCode={internetConnectionIssue:99999,InvalidToken:900,RequestExceeded:901,TokenRequired:902,ParameterMissing:903,InternalError:800,CannotSentEmail:801,AllEmailsInBlacklist:802,EmailAlreadyInBlacklist:803,EmailNotInBlacklist:804,UnknownSNSMessageType:805,UnknownNotificationMessage:806,CannotVerifyPaypalIPN:807,InvalidPaypalIPN:808,InvalidApiKeyOrSecret:1,AccessDenied:2,LimitExceeded:3,UserNotExist:200,UserAlreadyExist:201,TooManyUsers:202,UserOrRewardNotExist:203,UserIdInvalid:204,UserPhoneInvalid:205,RewardForUserNotExist:206,RewardForUserNotEnough:207,EmailIsAlreadyUsed:216,ActionNotFound:301,RewardNotFound:401,GoodsNotFound:501,OverLimitRedeem:601,QuestAlreadyJoined:701,QuestAlreadyFinished:702,QuestNotEnoughPermissionToJoinQuest:703,NotYetJoinQuest:704,QuestJoinOrCancelNotFound:705,QuizNotFound:1001,QuizQuestionNotFound:1002,QuizOptionNotFound:1003,QuizQuestionAlreadyCompleted:1004}}},{}],108:[function(e,t,n){t.exports=function(){var t=function(){return this};return t.static={defaults:{global:{baseUrl:null,baseAsyncUrl:null}}},t.env={global:{baseUrl:null,baseAsyncUrl:null,apiKey:null,apiSecret:null,token:null}},t.Promise=e(2),t.Playbasis=new t,t}},{2:2}],109:[function(e,t,n){t.exports=function(e){var t=e.builder={},n={baseUrl:e.static.defaults.global.baseUrl,baseAsyncUrl:e.static.defaults.global.baseAsyncUrl,apiKey:null,apiSecret:null};t.setEndpoint=function(e){return n.baseUrl=e,t},t.setApiKey=function(e){return n.apiKey=e,t},t.setApiSecret=function(e){return n.apiSecret=e,t},t.setBaseUrl=function(e){return n.baseUrl=e,t},t.setBaseAsyncUrl=function(e){return n.baseAsyncUrl=e,t},t.build=function(){e.env.global.baseUrl=n.baseUrl,e.env.global.baseAsyncUrl=n.baseAsyncUrl,e.env.global.apiKey=n.apiKey,e.env.global.apiSecret=n.apiSecret}}},{}],110:[function(e,t,n){t.exports=function(e){var t=e.helpers={};t.joinParams=function(e){if(null==e)return"";for(var t="",n=Object.keys(e),r=n.length,o=0;o<r;o++)t+=encodeURIComponent(n[o])+"="+encodeURIComponent(e[n[o]]),o<r-1&&(t+="&");return t},t.joinIfNotNullAsUrlParam=function(e){if(0==arguments.length||arguments.length%2!=0)throw"number of argument cannot be 0, and must be multiple of 2";for(var t="",n=0;n<arguments.length;n+=2){var r=arguments[n],o=arguments[n+1];null!=r&&null!=o&&(0!=n&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(o))}return t},t.appendAndJoinIfNotNullAsUrlParam=function(e){if(0==arguments.length||arguments.length%2!=0)throw"number of argument cannot be 0, and must be multiple of 2";for(var t="",n=0;n<arguments.length;n+=2){var r=arguments[n],o=arguments[n+1];null!=r&&null!=o&&(t+="&",t+=encodeURIComponent(r)+"="+encodeURIComponent(o))}return t},t.appendAndJoinIfNotNullAsUrlParam2=function(e,t,n){for(var r="",o=0;o<e.length;o++){var i=e[o],a=t[o];null!=n&&null!=n[i]&&(a=n[i]),null!=i&&null!=a&&(r+="&",r+=encodeURIComponent(i)+"="+encodeURIComponent(a))}return r},t.createObjectFromTarget=function(e,t){var n={};if(null==e)return n;for(var r=Object.keys(e),o=0;o<r.length;o++){var i=r[o],a=e[i];null!=i&&null!=a&&(null!=t?-1!=t.indexOf(i)&&(n[i]=a):n[i]=a)}return n},t.combineObjects=function(e,t){var n={};if(null==e&&null==t)return n;if(null==e)return n=t;if(null==t)return n=e;var r=Object.keys(t);n=e;for(var o=0;o<r.length;o++){var i=r[o],a=t[i];null!=i&&null!=a&&(n[i]=a)}return n},t.createApiUrl=function(t,n){for(var r=[],o=1;o<arguments.length;o++)r.push(arguments[o]);if(r&&r.length>0){var i=r.join("/");return e.env.global.baseUrl+"/"+t+"/"+i+"?api_key="+e.env.global.apiKey}return e.env.global.baseUrl+"/"+t+"?api_key="+e.env.global.apiKey}}},{}],111:[function(e,t,n){(function(n){t.exports=function(t){var r=t.helpers,o=t.http={},i=t.Promise.OperationalError,a={};a.isRelateToInternetConnectionIssue=function(e){return e.search("XHR error")>-1||e.search("Failed to fetch")>-1},o.getJsonAsync=function(n){return new t.Promise(function(r,o){var s=e(-1!=n.search("https")?9:80),u=[];s.get(n,function(e){if(200!=e.statusCode){var t=new i("Failed to load page, status code: "+e.statusCode);return t.code=e.statusCode,t.isApiLevel=!1,o(t)}e.on("data",function(e){u.push(e)}),e.on("end",function(){var e=u.join("");if(null==e)return o(new i("Failed on api response. Response is null"));var t=null;try{t=JSON.parse(e)}catch(e){return o(new i("Failed on parsing JSON response message. Error: "+e.message))}var n=parseInt(t.error_code);if(0==n)return r(t);var a=new i("Failed on response message. Error code: "+n+" with "+t.message);return a.code=n,a.isApiLevel=!0,o(a)}),e.on("error",function(e){return o(new i(e.message))})}).on("error",function(e){if(a.isRelateToInternetConnectionIssue(e.message)){var n=new i("Request error. "+e.message);return n.code=t.const.errorCode.internetConnectionIssue,o(n)}return o(new i("Request error. "+e.message))})})},o.postJsonAsync=function(s,u){return new t.Promise(function(l,c){var f=null,h=!0;-1!=s.search("https")?(f=e(9),h=!0):(f=e(80),h=!1);var p="";if(null!=u)for(var d=Object.keys(u),y=d.length,v=0;v<y;v++){var _=d[v],g=u[d[v]];null!=_&&null!=g&&(0!=v&&(p+="&"),p+=encodeURIComponent(_)+"="+encodeURIComponent(g))}var m=h?s.substring(8):s.substring(7),b=m.indexOf("/"),w=m.substring(0,b),A="/"+m.substring(b+1),E={hostname:w,path:A,port:h?443:80,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","Content-Length":n.byteLength(p)}},O=[],C=f.request(E,function(e){if(200!=e.statusCode){var n=new i("Failed to load page, status code: "+e.statusCode);return n.code=e.statusCode,n.isApiLevel=!1,c(n)}e.setEncoding("utf8"),e.on("data",function(e){O.push(e)}),e.on("end",function(){var e=O.join("");if(null==e)return c(new i("Failed on api response. Response is null"));var n=null;try{n=JSON.parse(e)}catch(e){return c(new i("Failed on parsing JSON response message. Error: "+e.message))}var a=parseInt(n.error_code);if(0==a)return l(n);if(900!=a&&902!=a){var f=new i("Failed on response message. Error code: "+a+" with "+n.message);return f.code=a,f.isApiLevel=!0,c(f)}o.postJsonAsync(r.createApiUrl("Auth"),{api_key:t.env.global.apiKey,api_secret:t.env.global.apiSecret}).then(function(e){t.env.global.token=e.response.token,u.token=t.env.global.token,o.postJsonAsync(s,u).then(function(e){return l(e)},function(e){return c(e)})},function(e){return c(e)})}),e.on("error",function(e){return c(new i(e.message))})});C.on("error",function(e){if(a.isRelateToInternetConnectionIssue(e.message)){var n=new i("Request error. "+e.message);return n.code=t.const.errorCode.internetConnectionIssue,c(n)}return c(new i("Request error. "+e.message))}),C.write(p),C.end()})}}}).call(this,e(5).Buffer)},{5:5,80:80,9:9}],112:[function(e,t,n){var r=e(108)();e(107)(r),e(110)(r),e(109)(r),e(111)(r),e(92)(r),e(100)(r),e(93)(r),e(97)(r),e(99)(r),e(96)(r),e(102)(r),e(104)(r),e(94)(r),e(98)(r),e(105)(r),e(106)(r),e(95)(r),e(103)(r),e(101)(r),e(113)(r),e(115)(r),e(114)(r),t.exports=r,new Function("try {return this===window;}catch(e){ return false;}")()&&(window.Playbasis=r)},{100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,113:113,114:114,115:115,92:92,93:93,94:94,95:95,96:96,97:97,98:98,99:99}],113:[function(e,t,n){t.exports=function(e){var t=function(e,t){var n=e.split("."),r=n[0];return"80x80"==t?r+="-80x80":"240x240"==t&&(r+="-240x240"),r+"."+n[1]};(e.util={}).getThumbnailURL=function(e,n){var r=e.split("/");r[r.length-1]=t(r[r.length-1],n);for(var o=r[0],i=!1,a=1;a<r.length;a++)i||"data"!=r[a]||(i=!0,r[a]="cache/data"),o+="/"+r[a];return o}}},{}],114:[function(e,t,n){t.exports=function(t){var n=e(14);(t.barCode={}).generate=function(e,t,r){null==r?n(e,t):n(e,t,r)}}},{14:14}],115:[function(e,t,n){t.exports=function(t){var n=e(66);(t.qrCode={}).generate=function(e,t,r){var o=4,i="L",a="medium";null!=r&&(null!=r.type&&"number"==typeof r.type&&(o=r.type),null!=r.error_correction_level&&"string"==typeof r.error_correction_level&&(i=r.error_correction_level),null!=r.size&&"string"==typeof r.size&&(a=r.size));var s=4;"small"==a?s=2:"large"==a&&(s=7);var u=n(o,i);u.addData(t),u.make();var l=u.createImgTag(s);document.getElementById(e).innerHTML=l}}},{66:66}]},{},[112])(112)});