webdnn
Version:
Deep Neural Network Execution Framework for Web Browsers
14 lines • 132 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebDNN=t():e.WebDNN=t()}(window,function(){var _StringfromCharCode=String.fromCharCode;return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(t){return e[t]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=19)}([function(e,t,r){(function(t){var r;
/*!
localForage -- Offline Storage, Improved
Version 1.7.3
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
/*!
localForage -- Offline Storage, Improved
Version 1.7.3
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
!function(t){e.exports=t()}(function(){return function e(t,n,i){function a(s,l){if(!n[s]){if(!t[s]){if(!l&&("function"==typeof r&&r))return r(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var r=t[s][1][e];return a(r||e)},u,u.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof r&&r,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(e,r){(function(e){"use strict";function t(){c=!0;for(var e,t,r=u.length;r;){for(t=u,u=[],e=-1;++e<r;)t[e]();r=u.length}c=!1}var n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var a=0,o=new i(t),s=e.document.createTextNode("");o.observe(s,{characterData:!0}),n=function(){s.data=a=++a%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var r=e.document.createElement("script");r.onreadystatechange=function(){t(),r.onreadystatechange=null,r.parentNode.removeChild(r),r=null},e.document.documentElement.appendChild(r)}:function(){setTimeout(t,0)};else{var l=new e.MessageChannel;l.port1.onmessage=t,n=function(){l.port2.postMessage(0)}}var c,u=[];r.exports=function(e){1!==u.push(e)||c||n()}}).call(this,void 0===t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)},{}],2:[function(e,t){"use strict";function r(){}function n(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,e!==r&&s(this,e)}function i(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function a(e,t,r){c(function(){var n;try{n=t(r)}catch(t){return u.reject(e,t)}n===e?u.reject(e,new TypeError("Cannot resolve promise with itself")):u.resolve(e,n)})}function o(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function s(e,t){function r(t){i||(i=!0,u.reject(e,t))}function n(t){i||(i=!0,u.resolve(e,t))}var i=!1,a=l(function(){t(n,r)});"error"===a.status&&r(a.value)}function l(e,t){var r={};try{r.value=e(t),r.status="success"}catch(t){r.status="error",r.value=t}return r}var c=e(1),u={},h=["REJECTED"],f=["FULFILLED"],d=["PENDING"];t.exports=n,n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(e,t){if("function"!=typeof e&&this.state===f||"function"!=typeof t&&this.state===h)return this;var n=new this.constructor(r);this.state!==d?a(n,this.state===f?e:t,this.outcome):this.queue.push(new i(n,e,t));return n},i.prototype.callFulfilled=function(e){u.resolve(this.promise,e)},i.prototype.otherCallFulfilled=function(e){a(this.promise,this.onFulfilled,e)},i.prototype.callRejected=function(e){u.reject(this.promise,e)},i.prototype.otherCallRejected=function(e){a(this.promise,this.onRejected,e)},u.resolve=function(e,t){var r=l(o,t);if("error"===r.status)return u.reject(e,r.value);var n=r.value;if(n)s(e,n);else{e.state=f,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},u.reject=function(e,t){e.state=h,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},n.resolve=function(e){return e instanceof this?e:u.resolve(new this(r),e)},n.reject=function(e){var t=new this(r);return u.reject(t,e)},n.all=function(e){function t(e,t){n.resolve(e).then(function(e){o[t]=e,++s!==i||a||(a=!0,u.resolve(c,o))},function(e){a||(a=!0,u.reject(c,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,a=!1;if(!i)return this.resolve([]);for(var o=Array(i),s=0,l=-1,c=new this(r);++l<i;)t(e[l],l);return c},n.race=function(e){function t(e){n.resolve(e).then(function(e){a||(a=!0,u.resolve(s,e))},function(e){a||(a=!0,u.reject(s,e))})}var n=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var i=e.length,a=!1;if(!i)return this.resolve([]);for(var o=-1,s=new this(r);++o<i;)t(e[o]);return s}},{1:1}],3:[function(e){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0===t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)},{2:2}],4:[function(e,t){"use strict";function r(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var r=new("undefined"==typeof BlobBuilder?"undefined"==typeof MSBlobBuilder?"undefined"==typeof MozBlobBuilder?WebKitBlobBuilder:MozBlobBuilder:MSBlobBuilder:BlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}function n(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function i(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function a(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e+=""),e}function o(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function s(e){return"boolean"==typeof R?C.resolve(R):function(e){return new C(function(t){var n=e.transaction(B,P),i=r([""]);n.objectStore(B).put(i,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||43<=parseInt(e[1],10))}}).catch(function(){return!1})}(e).then(function(e){return R=e})}function l(e){var t=D[e.name],r={};r.promise=new C(function(e,t){r.resolve=e,r.reject=t}),t.deferredOperations.push(r),t.dbReady=t.dbReady?t.dbReady.then(function(){return r.promise}):r.promise}function c(e){var t=D[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function u(e,t){var r=D[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function h(e,t){return new C(function(r,n){if(D[e.name]=D[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);l(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var a=I.open.apply(I,i);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),1>=t.oldVersion&&r.createObjectStore(B)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){r(a.result),c(e)}})}function f(e){return h(e,!1)}function d(e){return h(e,!0)}function p(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function _(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}(atob(e.data));return r([t],{type:e.type})}function m(e){return e&&e.__local_forage_encoded_blob}function w(e){var t=this,r=t._initReady().then(function(){var e=D[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return i(r,e,e),r}function b(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(i){if(0<n&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return C.resolve().then(function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),d(e)}).then(function(){return function(e){l(e);for(var t,r=D[e.name],n=r.forages,i=0;i<n.length;i++)(t=n[i])._dbInfo.db&&(t._dbInfo.db.close(),t._dbInfo.db=null);return e.db=null,f(e).then(function(t){return e.db=t,p(e)?d(e):t}).then(function(t){e.db=r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t}).catch(function(t){throw u(e,t),t})}(e).then(function(){b(e,t,r,n-1)})}).catch(r);r(i)}}function g(e){var t,r,n,i,a,o=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),u=new Uint8Array(c);for(t=0;t<s;t+=4)r=F.indexOf(e[t]),n=F.indexOf(e[t+1]),i=F.indexOf(e[t+2]),a=F.indexOf(e[t+3]),u[l++]=r<<2|n>>4,u[l++]=(15&n)<<4|i>>2,u[l++]=(3&i)<<6|63&a;return c}function y(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=F[r[t]>>2],n+=F[(3&r[t])<<4|r[t+1]>>4],n+=F[(15&r[t+1])<<2|r[t+2]>>6],n+=F[63&r[t+2]];return 2==r.length%3?n=n.substring(0,n.length-1)+"=":1==r.length%3&&(n=n.substring(0,n.length-2)+"=="),n}function v(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function E(e,t,r,n,i,a){e.executeSql(r,n,i,function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,s){s.rows.length?a(e,o):v(e,t,function(){e.executeSql(r,n,i,a)},a)},a):a(e,o)},a)}function k(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function x(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||0<localStorage.length}function A(e,t){e[t]=function(){var r=arguments;return e.ready().then(function(){return e[t].apply(e,r)})}}function S(){for(var e,t=1;t<arguments.length;t++)if(e=arguments[t])for(var r in e)e.hasOwnProperty(r)&&(arguments[0][r]=q(e[r])?e[r].slice():e[r]);return arguments[0]}var T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){}}();"undefined"==typeof Promise&&e(3);var C=Promise,B="local-forage-detect-blob-support",R=void 0,D={},z=Object.prototype.toString,N="readonly",P="readwrite",O={_driver:"asyncStorage",_initStorage:function(e){function t(){return C.resolve()}var r=this,n={db:null};if(e)for(var i in e)n[i]=e[i];var a=D[n.name];a||(a={forages:[],db:null,dbReady:null,deferredOperations:[]},D[n.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=w);for(var o,s=[],l=0;l<a.forages.length;l++)(o=a.forages[l])!==r&&s.push(o._initReady().catch(t));var c=a.forages.slice(0);return C.all(s).then(function(){return n.db=a.db,f(n)}).then(function(e){return n.db=e,p(n,r._defaultConfig.version)?d(n):e}).then(function(e){n.db=a.db=e,r._dbInfo=n;for(var t,i=0;i<c.length;i++)(t=c[i])!==r&&(t._dbInfo.db=n.db,t._dbInfo.version=n.version)})},_support:function(){try{if(!I)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}(),iterate:function(e,t){var r=this,i=new C(function(t,n){r.ready().then(function(){b(r._dbInfo,N,function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var r=o.result;if(r){var n=r.value;m(n)&&(n=_(n));var i=e(n,r.key,s++);void 0===i?r.continue():t(i)}else t()},o.onerror=function(){n(o.error)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},getItem:function(e,t){var r=this;e=a(e);var i=new C(function(t,n){r.ready().then(function(){b(r._dbInfo,N,function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),m(e)&&(e=_(e)),t(e)},o.onerror=function(){n(o.error)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},setItem:function(e,t,r){var i=this;e=a(e);var o=new C(function(r,n){var a;i.ready().then(function(){return a=i._dbInfo,"[object Blob]"===z.call(t)?s(a.db).then(function(e){return e?t:function(e){return new C(function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)})}(t)}):t}).then(function(t){b(i._dbInfo,P,function(a,o){if(a)return n(a);try{var s=o.objectStore(i._dbInfo.storeName);null===t&&(t=void 0);var l=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),r(t)},o.onabort=o.onerror=function(){var e=l.error?l.error:l.transaction.error;n(e)}}catch(e){n(e)}})}).catch(n)});return n(o,r),o},removeItem:function(e,t){var r=this;e=a(e);var i=new C(function(t,n){r.ready().then(function(){b(r._dbInfo,P,function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){n(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},clear:function(e){var t=this,r=new C(function(e,r){t.ready().then(function(){b(t._dbInfo,P,function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(e){r(e)}})}).catch(r)});return n(r,e),r},length:function(e){var t=this,r=new C(function(e,r){t.ready().then(function(){b(t._dbInfo,N,function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){r(a.error)}}catch(e){r(e)}})}).catch(r)});return n(r,e),r},key:function(e,t){var r=this,i=new C(function(t,n){return 0>e?void t(null):void r.ready().then(function(){b(r._dbInfo,N,function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName),s=!1,l=o.openCursor();l.onsuccess=function(){var r=l.result;return r?void(0===e?t(r.key):s?t(r.key):(s=!0,r.advance(e))):void t(null)},l.onerror=function(){n(l.error)}}catch(e){n(e)}})}).catch(n)});return n(i,t),i},keys:function(e){var t=this,r=new C(function(e,r){t.ready().then(function(){b(t._dbInfo,N,function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).openCursor(),o=[];a.onsuccess=function(){var t=a.result;return t?(o.push(t.key),void t.continue()):void e(o)},a.onerror=function(){r(a.error)}}catch(e){r(e)}})}).catch(r)});return n(r,e),r},dropInstance:function(e,t){t=o.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var i;if(e.name){var a=e.name===r.name&&this._dbInfo.db?C.resolve(this._dbInfo.db):f(e).then(function(t){var r=D[e.name],n=r.forages;r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t});i=e.storeName?a.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;l(e);var n=D[e.name],i=n.forages;t.close();for(var a,o=0;o<i.length;o++)(a=i[o])._dbInfo.db=null,a._dbInfo.version=r;return new C(function(t,n){var i=I.open(e.name,r);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}).then(function(e){n.db=e;for(var t,r=0;r<i.length;r++)(t=i[r])._dbInfo.db=e,c(t._dbInfo)}).catch(function(t){throw(u(e,t)||C.resolve()).catch(function(){}),t})}}):a.then(function(t){l(e);var r=D[e.name],n=r.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;return new C(function(t,r){var n=I.deleteDatabase(e.name);n.onerror=n.onblocked=function(e){var t=n.result;t&&t.close(),r(e)},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<n.length;t++)c(n[t]._dbInfo)}).catch(function(t){throw(u(e,t)||C.resolve()).catch(function(){}),t})})}else i=C.reject("Invalid arguments");return n(i,t),i}},F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L=/^~~local_forage_type~([^~]+)~/,U="__lfsc__:",M=U.length,j="arbf",W="blob",H="si08",V=M+j.length,$=Object.prototype.toString,G={serialize:function(e,t){var r="";if(e&&(r=$.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===$.call(e.buffer))){var n,i=U;e instanceof ArrayBuffer?(n=e,i+=j):(n=e.buffer,"[object Int8Array]"===r?i+=H:"[object Uint8Array]"===r?i+="ui08":"[object Uint8ClampedArray]"===r?i+="uic8":"[object Int16Array]"===r?i+="si16":"[object Uint16Array]"===r?i+="ur16":"[object Int32Array]"===r?i+="si32":"[object Uint32Array]"===r?i+="ui32":"[object Float32Array]"===r?i+="fl32":"[object Float64Array]"===r?i+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(i+y(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r="~~local_forage_type~"+e.type+"~"+y(this.result);t(U+W+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(i){console.error("Couldn't convert value into a JSON string: ",e),t(null,i)}},deserialize:function(e){if(e.substring(0,M)!==U)return JSON.parse(e);var t,n=e.substring(V),i=e.substring(M,V);if(i===W&&L.test(n)){var a=n.match(L);t=a[1],n=n.substring(a[0].length)}var o=g(n);switch(i){case j:return o;case W:return r([o],{type:t});case H:return new Int8Array(o);case"ui08":return new Uint8Array(o);case"uic8":return new Uint8ClampedArray(o);case"si16":return new Int16Array(o);case"ur16":return new Uint16Array(o);case"si32":return new Int32Array(o);case"ui32":return new Uint32Array(o);case"fl32":return new Float32Array(o);case"fl64":return new Float64Array(o);default:throw new Error("Unkown type: "+i)}},stringToBuffer:g,bufferToString:y},X={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"==typeof e[n]?e[n]:e[n].toString();var i=new C(function(e,n){try{r.db=openDatabase(r.name,r.version+"",r.description,r.size)}catch(e){return n(e)}r.db.transaction(function(i){v(i,r,function(){t._dbInfo=r,e()},function(e,t){n(t)})},n)});return r.serializer=G,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,i=new C(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"SELECT * FROM "+i.storeName,[],function(r,n){for(var a=n.rows,o=a.length,s=0;s<o;s++){var l=a.item(s),c=l.value;if(c&&(c=i.serializer.deserialize(c)),void 0!==(c=e(c,l.key,s+1)))return void t(c)}t()},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},getItem:function(e,t){var r=this;e=a(e);var i=new C(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},setItem:function(e,t,r){return function e(t,r,i,o){var s=this;t=a(t);var l=new C(function(n,a){s.ready().then(function(){void 0===r&&(r=null);var l=r,c=s._dbInfo;c.serializer.serialize(r,function(r,u){u?a(u):c.db.transaction(function(e){E(e,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[t,r],function(){n(l)},function(e,t){a(t)})},function(r){if(r.code===r.QUOTA_ERR){if(0<o)return void n(e.apply(s,[t,l,i,o-1]));a(r)}})})}).catch(a)});return n(l,i),l}.apply(this,[e,t,r,1])},removeItem:function(e,t){var r=this;e=a(e);var i=new C(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},clear:function(e){var t=this,r=new C(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){E(t,n,"DELETE FROM "+n.storeName,[],function(){e()},function(e,t){r(t)})})}).catch(r)});return n(r,e),r},length:function(e){var t=this,r=new C(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){E(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(t,r){var n=r.rows.item(0).c;e(n)},function(e,t){r(t)})})}).catch(r)});return n(r,e),r},key:function(e,t){var r=this,i=new C(function(t,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(r){E(r,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)},function(e,t){n(t)})})}).catch(n)});return n(i,t),i},keys:function(e){var t=this,r=new C(function(e,r){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(t){E(t,n,"SELECT key FROM "+n.storeName,[],function(t,r){for(var n=[],i=0;i<r.rows.length;i++)n.push(r.rows.item(i).key);e(n)},function(e,t){r(t)})})}).catch(r)});return n(r,e),r},dropInstance:function(e,t){t=o.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var i,a=this;return i=e.name?new C(function(t){var n;n=e.name===r.name?a._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(function(e){return new C(function(t,r){e.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var i=[],a=0;a<n.rows.length;a++)i.push(n.rows.item(a).name);t({db:e,storeNames:i})},function(e,t){r(t)})},function(e){r(e)})})}(n))}).then(function(e){return new C(function(t,r){e.db.transaction(function(n){function i(e){return new C(function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){r(t)})})}for(var a=[],o=0,s=e.storeNames.length;o<s;o++)a.push(i(e.storeNames[o]));C.all(a).then(function(){t()}).catch(function(e){r(e)})},function(e){r(e)})})}):C.reject("Invalid arguments"),n(i,t),i}},Y={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=k(e,this._defaultConfig),x()?(this._dbInfo=t,t.serializer=G,C.resolve()):C.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,i=r.ready().then(function(){for(var t,n=r._dbInfo,i=n.keyPrefix,a=i.length,o=localStorage.length,s=1,l=0;l<o;l++)if(0===(t=localStorage.key(l)).indexOf(i)){var c=localStorage.getItem(t);if(c&&(c=n.serializer.deserialize(c)),void 0!==(c=e(c,t.substring(a),s++)))return c}});return n(i,t),i},getItem:function(e,t){var r=this;e=a(e);var i=r.ready().then(function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n});return n(i,t),i},setItem:function(e,t,r){var i=this;e=a(e);var o=i.ready().then(function(){void 0===t&&(t=null);var r=t;return new C(function(n,a){var o=i._dbInfo;o.serializer.serialize(t,function(t,i){if(i)a(i);else try{localStorage.setItem(o.keyPrefix+e,t),n(r)}catch(t){("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&a(t),a(t)}})})});return n(o,r),o},removeItem:function(e,t){var r=this;e=a(e);var i=r.ready().then(function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return n(i,t),i},clear:function(e){var t=this,r=t.ready().then(function(){for(var e,r=t._dbInfo.keyPrefix,n=localStorage.length-1;0<=n;n--)0===(e=localStorage.key(n)).indexOf(r)&&localStorage.removeItem(e)});return n(r,e),r},length:function(e){var t=this.keys().then(function(e){return e.length});return n(t,e),t},key:function(e,t){var r=this,i=r.ready().then(function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t});return n(i,t),i},keys:function(e){var t=this,r=t.ready().then(function(){for(var e,r=t._dbInfo,n=localStorage.length,i=[],a=0;a<n;a++)0===(e=localStorage.key(a)).indexOf(r.keyPrefix)&&i.push(e.substring(r.keyPrefix.length));return i});return n(r,e),r},dropInstance:function(e,t){if(t=o.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var i,a=this;return n(i=e.name?new C(function(t){e.storeName?t(k(e,a._defaultConfig)):t(e.name+"/")}).then(function(e){for(var t,r=localStorage.length-1;0<=r;r--)0===(t=localStorage.key(r)).indexOf(e)&&localStorage.removeItem(t)}):C.reject("Invalid arguments"),t),i}},Z=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},K=function(e,t){for(var r=e.length,n=0;n<r;){if(Z(e[n],t))return!0;n++}return!1},q=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Q={},J={},ee={INDEXEDDB:O,WEBSQL:X,LOCALSTORAGE:Y},te=[ee.INDEXEDDB._driver,ee.WEBSQL._driver,ee.LOCALSTORAGE._driver],re=["dropInstance"],ne=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(re),ie={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},ae=new(function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ee)if(ee.hasOwnProperty(r)){var n=ee[r],i=n._driver;this[r]=i,Q[i]||this.defineDriver(n)}this._defaultConfig=S({},ie),this._config=S({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":T(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"==t&&(e[t]=e[t].replace(/\W/g,"_")),"version"==t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e&&e.driver)||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var a=new C(function(t,r){try{var i=e._driver,a=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(a);for(var o=ne.concat("_initStorage"),s=0,l=o.length;s<l;s++){var c=o[s];if((!K(re,c)||e[c])&&"function"!=typeof e[c])return void r(a)}!function(){for(var t,r=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=C.reject(t);return n(r,arguments[arguments.length-1]),r}},i=0,a=re.length;i<a;i++)e[t=re[i]]||(e[t]=r(t))}();var u=function(r){Q[i]&&console.info("Redefining LocalForage driver: "+i),Q[i]=e,J[i]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(u,r):u(!!e._support):u(!0)}catch(t){r(t)}});return i(a,t,r),a},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=Q[e]?C.resolve(Q[e]):C.reject(new Error("Driver not found."));return i(n,t,r),n},e.prototype.getSerializer=function(e){var t=C.resolve(G);return i(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return i(r,e,e),r},e.prototype.setDriver=function(e,t,r){function n(){o._config.driver=o.driver()}function a(e){return o._extend(e),n(),o._ready=o._initStorage(o._config),o._ready}var o=this;q(e)||(e=[e]);var s=this._getSupportedDrivers(e),l=null===this._driverSet?C.resolve():this._driverSet.catch(function(){return C.resolve()});return this._driverSet=l.then(function(){var e=s[0];return o._dbInfo=null,o._ready=null,o.getDriver(e).then(function(e){o._driver=e._driver,n(),o._wrapLibraryMethodsWithReady(),o._initDriver=function(e){return function(){var t=0;return function r(){for(;t<e.length;){var i=e[t];return t++,o._dbInfo=null,o._ready=null,o.getDriver(i).then(a).catch(r)}n();var s=new Error("No available storage method found.");return o._driverSet=C.reject(s),o._driverSet}()}}(s)})}).catch(function(){n();var e=new Error("No available storage method found.");return o._driverSet=C.reject(e),o._driverSet}),i(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!J[e]},e.prototype._extend=function(e){S(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t,r=[],n=0,i=e.length;n<i;n++)t=e[n],this.supports(t)&&r.push(t);return r},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=ne.length;e<t;e++)A(this,ne[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=ae},{3:3}]},{},[4])(4)})}).call(this,r(10))},function(e,t){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(n)},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",function(){return PlaceholderContext});class PlaceholderContext{constructor(e){this.values={},e&&this.update(e)}get isResolved(){return Object.values(this.values).every(e=>"number"==typeof e)}update(e){this.values=Object.assign(this.values,e)}resolve(placeholder){if("object"!=typeof placeholder)return placeholder;if(1==Object.keys(placeholder).length&&"eval"in placeholder){if(!this.isResolved)throw Error(`Not all placeholders are resolved: ${this}`);return eval("(function(placeholders){return "+placeholder.eval+";})")(this.values)}return placeholder instanceof Array?placeholder.map(e=>this.resolve(e)):Object.entries(placeholder).reduce((e,[t,r])=>(e[t]=this.resolve(r),e),{})}toString(){return JSON.stringify(this.values)}}},function(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e){"use strict";e.exports=function(e,t,r,n){for(var i=0|65535&e,a=0|65535&e>>>16,o=0;0!==r;){r-=o=2e3<r?2e3:r;do{a=0|a+(i=0|i+t[n++])}while(--o);i%=65521,a%=65521}return i|a<<16|0}},function(e){"use strict";var t=function(){for(var e,t=[],r=0;256>r;r++){e=r;for(var n=0;8>n;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){e^=-1;for(var a=i;a<i+n;a++)e=e>>>8^t[255&(e^r[a])];return-1^e}},function(e,t,r){"use strict";function n(e,t){if(65534>t&&(e.subarray&&o||!e.subarray&&a))return _StringfromCharCode.apply(null,i.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=_StringfromCharCode(e[n]);return r}var i=r(1),a=!0,o=!0;try{_StringfromCharCode.apply(null,[0])}catch(e){a=!1}try{_StringfromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new i.Buf8(256),l=0;256>l;l++)s[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;s[254]=s[254]=1,t.string2buf=function(e){var t,r,n,a,o,s=e.length,l=0;for(a=0;a<s;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<s&&(56320==(64512&(n=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++)),l+=128>r?1:2048>r?2:65536>r?3:4;for(t=new i.Buf8(l),o=0,a=0;o<l;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<s&&(56320==(64512&(n=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++)),128>r?t[o++]=r:2048>r?(t[o++]=192|r>>>6,t[o++]=128|63&r):65536>r?(t[o++]=224|r>>>12,t[o++]=128|63&r>>>6,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|63&r>>>12,t[o++]=128|63&r>>>6,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return n(e,e.length)},t.binstring2buf=function(e){for(var t=new i.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,i,a,o,l=t||e.length,c=Array(2*l);for(i=0,r=0;r<l;)if(128>(a=e[r++]))c[i++]=a;else if(4<(o=s[a]))c[i++]=65533,r+=o-1;else{for(a&=2===o?31:3===o?15:7;1<o&&r<l;)a=a<<6|63&e[r++],o--;1<o?c[i++]=65533:65536>a?c[i++]=a:(a-=65536,c[i++]=55296|1023&a>>10,c[i++]=56320|1023&a)}return n(c,i)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return 0>r?t:0===r?t:r+s[e[r]]>t?r:t}},function(e){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,r){"use strict";var n={};(0,r(1).assign)(n,r(11),r(14),r(8)),e.exports=n},function(e){var t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=o.assign({level:f,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&16>t.windowBits&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==h)throw new Error(l[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var i;if(i="string"==typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,i))!==h)throw new Error(l[r]);this._dict_set=!0}}function i(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||l[r.err];return r.result}var a=r(12),o=r(1),s=r(6),l=r(3),c=r(7),u=Object.prototype.toString,h=0,f=-1,d=0,p=8;n.prototype.push=function(e,t){var r,n,i=this.strm,l=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,i.input="string"==typeof e?s.string2buf(e):"[object ArrayBuffer]"===u.call(e)?new Uint8Array(e):e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new o.Buf8(l),i.next_out=0,i.avail_out=l),1!==(r=a.deflate(i,n))&&r!==h)return this.onEnd(r),this.ended=!0,!1;(0===i.avail_out||0===i.avail_in&&(4===n||2===n))&&("string"===this.options.to?this.onData(s.buf2binstring(o.shrinkBuf(i.output,i.next_out))):this.onData(o.shrinkBuf(i.output,i.next_out)))}while((0<i.avail_in||0===i.avail_out)&&1!==r);return 4===n?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===h):2!==n||(this.onEnd(h),i.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===h&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=n,t.deflate=i,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,i(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,i(e,t)}},function(e,t,r){"use strict";function n(e,t){return e.msg=T[t],t}function i(e){return(e<<1)-(4<e?9:0)}function a(e){for(var t=e.length;0<=--t;)e[t]=0}function o(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0===r||(k.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function s(e,t){x._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,o(e.strm)}function l(e,t){e.pending_buf[e.pending++]=t}function c(e,t){e.pending_buf[e.pending++]=255&t>>>8,e.pending_buf[e.pending++]=255&t}function u(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,k.arraySet(t,e.input,e.next_in,i,r),1===e.state.wrap?e.adler=A(e.adler,t,i,r):2===e.state.wrap&&(e.adler=S(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function h(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-Q?e.strstart-(e.w_size-Q):0,c=e.window,u=e.w_mask,h=e.prev,f=e.strstart+q,d=c[a+o-1],p=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+o]===p&&c[r+o-1]===d&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do{}while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&a<f);if(n=q-(f-a),a=f-q,n>o){if(e.match_start=t,o=n,n>=s)break;d=c[a+o-1],p=c[a+o]}}}while((t=h[t&u])>l&&0!=--i);return o<=e.lookahead?o:e.lookahead}function f(e){var t,r,n,i,a,o=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=o+(o-Q)){k.arraySet(e.window,e.window,o,o,0),e.match_start-=o,e.strstart-=o,e.block_start-=o,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=o?n-o:0}while(--r);t=r=o;do{n=e.prev[--t],e.prev[t]=n>=o?n-o:0}while(--r);i+=o}if(0===e.strm.avail_in)break;if(r=u(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=K)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+K-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<K)););}while(e.lookahead<Q&&0!==e.strm.avail_in)}function d(e,t){for(var r,n;;){if(e.lookahead<Q){if(f(e),e.lookahead<Q&&t===I)return se;if(0===e.lookahead)break}if(r=0,e.lookahead>=K&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+K-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-Q&&(e.match_length=h(e,r)),e.match_length>=K)if(n=x._tr_tally(e,e.strstart-e.match_start,e.match_length-K),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=K){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+K-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=x._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(s(e,!1),0===e.strm.avail_out))return se}return e.insert=e.strstart<K-1?e.strstart:K-1,t===R?(s(e,!0),0===e.strm.avail_out?ce:ue):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?se:le}function p(e,t){for(var r,n,i;;){if(e.lookahead<Q){if(f(e),e.lookahead<Q&&t===I)return se;if(0===e.lookahead)break}if(r=0,e.lookahead>=K&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+K-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=K-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Q&&(e.match_length=h(e,r),5>=e.match_length&&(e.strategy===L||e.match_length===K&&4096<e.strstart-e.match_start)&&(e.match_length=K-1)),e.prev_length>=K&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-K,n=x._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-K),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+K-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=K-1,e.strstart++,n&&(s(e,!1),0===e.strm.avail_out))return se}else if(e.match_available){if((n=x._tr_tally(e,0,e.window[e.strstart-1]))&&s(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return se}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=x._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<K-1?e.strstart:K-1,t===R?(s(e,!0),0===e.strm.avail_out?ce:ue):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?se:le}function _(e,t){for(var r,n,i,a,o=e.window;;){if(e.lookahead<=q){if(f(e),e.lookahead<=q&&t===I)return se;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=K&&0<e.strstart&&((n=o[i=e.strstart-1])===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+q;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);e.match_length=q-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=K?(r=x._tr_tally(e,1,e.match_length-K),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=x._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(s(e,!1),0===e.strm.avail_out))return se}return e.insert=0,t===R?(s(e,!0),0===e.strm.avail_out?ce:ue):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?se:le}function m(e,t){for(var r;;){if(0===e.lookahead&&(f(e),0===e.lookahead)){if(t===I)return se;break}if(e.match_length=0,r=x._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(s(e,!1),0===e.strm.avail_out))return se}return e.insert=0,t===R?(s(e,!0),0===e.strm.avail_out?ce:ue):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?se:le}function w(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function b(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=H,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new k.Buf16(2*Y),this.dyn_dtree=new k.Buf16(2*(2*G+1)),this.bl_tree=new k.Buf16(2*(2*X+1)),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new k.Buf16(Z+1),this.heap=new k.Buf16(2*$+1),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new k.Buf16(2*$+1),a(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function g(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=W,(t=e.state).pending=0,t.pending_out=0,0>t.wrap&&(t.wrap=-t.wrap),t.status=t.wrap?ee:ae,e.adler=2===t.wrap?0:1,t.last_flush=I,x._tr_init(t),z):n(e,P)}function y(e){var t=g(e);return t===z&&function(e){e.window_size=2*e.w_size,a(e.head),e.max_lazy_match=E[e.level].max_lazy,e.good_match=E[e.level].good_length,e.nice_match=E[e.level].nice_length,e.max_chain_length=E[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=K-1,e.match_available=0,e.ins_h=0}(e.state),t}function v(e,t,r,i,a,o){if(!e)return P;var s=1;if(t===F&&(t=6),0>i?(s=0,i=-i):15<i&&(s=2,i-=16),1>a||a>V||r!==H||8>i||15<i||0>t||9<t||0>o||o>j)return n(e,P);8===i&&(i=9);var l=new b;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+K-1)/K),l.window=new k.Buf8(2*l.w_size),l.head=new k.Buf16(l.hash_size),l.prev=new k.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new k.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=r,y(e)}var E,k=r(1),x=r(13),A=r(4),S=r(5),T=r(3),I=0,C=1,B=3,R=4,D=5,z=0,N=1,P=-2,O=-5,F=-1,L=1,U=2,M=3,j=4,W=2,H=8,V=9,$=286,G=30,X=19,Y=2*$+1,Z=15,K=3,q=258,Q=q+K+1,J=32,ee=42,te=69,re=73,ne=91,ie=103,ae=113,oe=666,se=1,le=2,ce=3,ue=4,he=3;E=[new w(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(1>=e.lookahead){if(f(e),0===e.lookahead&&t===I)return se;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,s(e,!1),0===e.strm.avail_out))return se;if(e.strstart-e.block_start>=e.w_size-Q&&(s(e,!1),0===e.strm.avail_out))return se}return e.insert=0,t===R?(s(e,!0),0===e.strm.avail_out?ce:ue):(e.strstart>e.block_start&&(s(e,!1),e.strm.avail_out),se)}),new w(4,4,8,4,d),new w(4,5,16,8,d),new w(4,6,32,32,d),new w(4,4,16,16,p),new w(8,16,32,32,p),new w(8,16,128,128,p),new w(8,32,128,256,p),new w(32,128,258,1024,p),new w(32,258,258,4096,p)],t.deflateInit=function(e,t){return v(e,t,H,15,8,0)},t.deflateInit2=v,t.deflateReset=y,t.deflateResetKeep=g,t.deflateSetHeader=function(e,t){return e&&e.state&&2===e.state.wrap?(e.state.gzhead=t,z):P},t.deflate=function(e,t){var r,s,u,h;if(!e||!e.state||t>D||0>t)return e?n(e,P):P;if(s=e.state,!e.output||!e.input&&0!==e.avail_in||s.status===oe&&t!==R)return n(e,0===e.avail_out?O:P);if(s.strm=e,r=s.last_flush,s.last_flush=t,s.status===ee)if(2===s.wrap)e.adler=0,l(s,31),l(s,139),l(s,8),s.gzhead?(l(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),l(s,255&s.gzhead.time),l(s,255&s.gzhead.time>>8),l(s,255&s.gzhead.time>>16),l(s,255&s.gzhead.time>>24),l(s,9===s.level?2:s.strategy>=U||2>s.level?4:0),l(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(l(s,255&s.gzhead.extra.length),l(s,255&s.gzhead.extra.length>>8)),s.gzhead.hcrc&&(e.adler=S(e.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=te):(l(s,0),l(s,0),l(s,0),l(s,0),l(s,0),l(s,9===s.level?2:s.strategy>=U||2>s.level?4:0),l(s,he),s.status=ae);else{var f=H+(s.w_bits-8<<4)<<8;f|=(s.strategy>=U||2>s.level?0:6>s.level?1:6===s.level?2:3)<<6,0!==s.strstart&&(f|=J),f+=31-f%31,s.status=ae,c(s,f),0!==s.strstart&&(c(s,e.adler>>>16),c(s,65535&e.adler)),e.adler=1}if(s.status===te)if(s.gzhead.extra){for(u=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>u&&(e.adler=S(e.adler,s.pending_buf,s.pending-u,u)),o(e),u=s.pending,s.pending!==s.pending_buf_size));)l(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>u&&(e.adler=S(e.adler,s.pending_buf,s.pending-u,u)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=re)}else s.status=re;if(s.status===re)if(s.gzhead.name){u=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>u&&(e.adler=S(e.adler,s.pending_buf,s.pending-u,u)),o(e),u=s.pending,s.pending===s.pending_buf_size)){h=1;break}h=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,l(s,h)}while(0!==h);s.gzhead.hcrc&&s.pending>u&&(e.adler=S(e.adler,s.pending_buf,s.pending-u,u)),0===h&&(s.gzindex=0,s.status=ne)}else s.status=ne;if(s.status===ne)if(s.gzhead.comment){u=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>u&&(e.adler=S(e.adler,s.pending_buf,s.pending-u,u)),o(e),u=s.pending,s.pending===s.pending_buf_size)){h=1;break}h=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,l(s,h)}while(0!==h);s.gzhead.hcrc&&s.pending>u&&(e.adler=S(e.adler,s.pending_buf,s.pending-u,u)),0===h&&(s.status=ie)}else s.status=ie;if(s.status===ie&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&o(e),s.pending+2<=s.pending_buf_size&&(l(s,255&e.adler),l(s,255&e.adler>>8),e.adler=0,s.status=ae)):s.status=ae),0!==s.pending){if(o(e),0===e.avail_out)return s.last_flush=-1,z}else if(0===e.avail_in&&i(t)<=i(r)&&t!==R)return n(e,O);if(s.status===oe&&0!==e.avail_in)return n(e,O);if(0!==e.avail_in||0!==s.lookahead||t!==I&&s.status!==oe){var d=s.strategy===U?m(s,t):s.strategy===M?_(s,t):E[s.level].func(s,t);if((d===ce||d===ue)&&(s.status=oe),d===se||d===ce)retur