1/*! For license information please see 2.da820321.chunk.js.LICENSE.txt */ 2(this["webpackJsonpopen-studio"]=this["webpackJsonpopen-studio"]||[]).push([[2],[function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"g",(function(){return u})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return l}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function u(t){var e="function"===typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}Object.create},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(5);var i=n(39);function o(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=Object(r.a)(t);if(e){var a=Object(r.a)(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return Object(i.a)(this,n)}}},function(t,e,n){"use strict";function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(5);function i(t,e,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return v})),n.d(e,"b",(function(){return A})),n.d(e,"c",(function(){return M})),n.d(e,"d",(function(){return H})),n.d(e,"e",(function(){return C})),n.d(e,"f",(function(){return s})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return l})),n.d(e,"i",(function(){return h})),n.d(e,"j",(function(){return $})),n.d(e,"k",(function(){return F})),n.d(e,"l",(function(){return q})),n.d(e,"m",(function(){return d})),n.d(e,"n",(function(){return p})),n.d(e,"o",(function(){return X})),n.d(e,"p",(function(){return m})),n.d(e,"q",(function(){return D})),n.d(e,"r",(function(){return b})),n.d(e,"s",(function(){return _})),n.d(e,"t",(function(){return x})),n.d(e,"u",(function(){return B})),n.d(e,"v",(function(){return T})),n.d(e,"w",(function(){return O})),n.d(e,"x",(function(){return g})),n.d(e,"y",(function(){return y}
2)),n.d(e,"z",(function(){return S})),n.d(e,"A",(function(){return w})),n.d(e,"B",(function(){return E})),n.d(e,"C",(function(){return L})),n.d(e,"D",(function(){return P})),n.d(e,"E",(function(){return V})),n.d(e,"F",(function(){return z})),n.d(e,"G",(function(){return U})),n.d(e,"H",(function(){return Z})),n.d(e,"I",(function(){return J})),n.d(e,"J",(function(){return R})),n.d(e,"K",(function(){return Y})),n.d(e,"L",(function(){return K})),n.d(e,"M",(function(){return Q})),n.d(e,"N",(function(){return k}));var r=n(0),i=!1,o=!1,a="${JSCORE_VERSION}",s=function(t,e){if(!t)throw u(e)},u=function(t){return new Error("Firebase Database ("+a+") INTERNAL ASSERT FAILED: "+t)},c=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296===(64512&i)&&r+1<t.length&&56320===(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},l={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],a=i+1<t.length,s=a?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,l=o>>2,h=(3&o)<<4|s>>4,f=(15&s)<<2|c>>6,d=63&c;u||(d=64,a||(f=64)),r.push(n[l],n[h],n[f],n[d])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(c(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(1023&a))}else{o=t[n++];var s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0,s=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==a||null==s||null==u)throw Error();var c=o<<2|a>>4;if(r.push(c),64!==s){var l=a<<4&240|s>>2;if(r.push(l),64!==u){var h=s<<6&192|u;r.push(h)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},h=function(t){var e=c(t);return l.encodeByteArray(e,!0)},f=function(t){try{return l.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function d(t){return p(void 0,t)}function p(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&"__proto__"!==n&&(t[n]=p(t[n],e[n]));return t}var v=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"===typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();function m(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function g(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(m())}function y(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(e){return!1}}function b(){return"object"===typeof self&&self.self===self}function _(){var t="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof t&&void 0!==t.id}function w(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function x(){return m().indexOf("Electron/")>=0}function T(){var t=m();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function E(){return m().indexOf("MSAppHost/")>=0}function S(){return!0===i||!0===o}function O(){return"indexedDB"in self&&null!=indexedDB}function k(){return new Promise((function(t,e){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=window.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||window.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var t;e((null===(t=i.error)||void 0===t?void 0:t.message)||"")}}catch(o){e(o)}}))}function C(){return!(!navigator||!navigator.cookieEnabled)}var M=function(t){function e(n,r,i){var o=t.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,A.prototype.create),o}return Object(r.c)(e,t),e}(Error),A=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],a=o?I(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",u=new M(i,s,r);return u},t}();function I(t,e){return t.replace(j,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var j=/\{\$([^}]+)}/g;function P(t){return JSON.parse(t)}function R(t){return JSON.stringify(t)}var N=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=P(f(o[0])||""),n=P(f(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:e,claims:n,data:r,signature:i}},L=function(t){var e=N(t).claims;return!!e&&"object"===typeof e&&e.hasOwnProperty("iat")},D=function(t){var e=N(t).claims;return"object"===typeof e&&!0===e.admin};function F(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function U(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function B(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function V(t,e,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r}function z(t){for(var e=[],n=function(t,n){Array.isArray(n)?n.forEac
2h((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))},r=0,i=Object.entries(t);r<i.length;r++){var o=i[r];n(o[0],o[1])}return e.length?"&"+e.join("&"):""}var H=function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}return t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"===typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],l=this.chain_[3],h=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=l^u&(c^l),a=1518500249):(o=u^c^l,a=1859775393):r<60?(o=u&c|l&(u|c),a=2400959708):(o=u^c^l,a=3395469782);i=(s<<5|s>>>27)+o+h+a+n[r]&4294967295;h=l,l=c,c=4294967295&(u<<30|u>>>2),u=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0===o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"===typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},t}();function q(t,e){var n=new W(t,e);return n.subscribe.bind(n)}var W=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!==typeof t||null===t)return!1;for(var n=0,r=e;n<r.length;n++){var i=r[n];if(i in t&&"function"===typeof t[i])return!0}return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n}).next&&(r.next=G),void 0===r.error&&(r.error=G),void 0===r.complete&&(r.complete=G);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(t){}})),this.observers.push(r),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(r){"undefined"!==typeof console&&console.error&&console.error(r)}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function G(){}var Y=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")};function X(t,e,n){var r="";switch(e){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?")}var i=t+" failed: ";return i+=r+" argument "}function K(t,e,n,r){if((!r||n)&&"function"!==typeof n)throw new Error(X(t,e,r)+"must be a valid function.")}function Q(t,e,n,r){if((!r||n)&&("object"!==typeof n||null===n))throw new Error(X(t,e,r)+"must be a valid context object.")}var J=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);if(i>=55296&&i<=56319){var o=i-55296;r++,s(r<t.length,"Surrogate pair missing trail surrogate."),i=65536+(o<<10)+(t.charCodeAt(r)-56320)}i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},Z=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);
2r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e};function $(t,e,n){void 0===e&&(e=1e3),void 0===n&&(n=2);var r=e*Math.pow(n,t),i=Math.round(.5*r*(Math.random()-.5)*2);return Math.min(144e5,r+i)}}).call(this,n(45))},function(t,e,n){"use strict";t.exports=n(96)},function(t,e,n){"use strict";n.d(e,"a",(function(){return x})),n.d(e,"b",(function(){return gu})),n.d(e,"c",(function(){return _s})),n.d(e,"d",(function(){return Bo})),n.d(e,"e",(function(){return At})),n.d(e,"f",(function(){return Bn})),n.d(e,"g",(function(){return tn})),n.d(e,"h",(function(){return _n})),n.d(e,"i",(function(){return pa})),n.d(e,"j",(function(){return va})),n.d(e,"k",(function(){return M})),n.d(e,"l",(function(){return ju})),n.d(e,"m",(function(){return Qe})),n.d(e,"n",(function(){return ga})),n.d(e,"o",(function(){return As})),n.d(e,"p",(function(){return Ps})),n.d(e,"q",(function(){return ma})),n.d(e,"r",(function(){return mu})),n.d(e,"s",(function(){return w})),n.d(e,"t",(function(){return he})),n.d(e,"u",(function(){return ft})),n.d(e,"v",(function(){return ks})),n.d(e,"w",(function(){return ln})),n.d(e,"x",(function(){return _})),n.d(e,"y",(function(){return ro})),n.d(e,"z",(function(){return Eu})),n.d(e,"A",(function(){return ho})),n.d(e,"B",(function(){return po})),n.d(e,"C",(function(){return us})),n.d(e,"D",(function(){return Y})),n.d(e,"E",(function(){return X})),n.d(e,"F",(function(){return fe})),n.d(e,"G",(function(){return ea})),n.d(e,"H",(function(){return Ko})),n.d(e,"I",(function(){return oa})),n.d(e,"J",(function(){return ia})),n.d(e,"K",(function(){return R})),n.d(e,"L",(function(){return L})),n.d(e,"M",(function(){return N})),n.d(e,"N",(function(){return Ss})),n.d(e,"O",(function(){return wu})),n.d(e,"P",(function(){return y})),n.d(e,"Q",(function(){return He})),n.d(e,"R",(function(){return mt})),n.d(e,"S",(function(){return bt})),n.d(e,"T",(function(){return ee})),n.d(e,"U",(function(){return Fn})),n.d(e,"V",(function(){return Je})),n.d(e,"W",(function(){return is})),n.d(e,"X",(function(){return rs})),n.d(e,"Y",(function(){return es})),n.d(e,"Z",(function(){return ts})),n.d(e,"ab",(function(){return $a})),n.d(e,"bb",(function(){return A})),n.d(e,"cb",(function(){return I})),n.d(e,"db",(function(){return P})),n.d(e,"eb",(function(){return j})),n.d(e,"fb",(function(){return vs})),n.d(e,"gb",(function(){return Oe})),n.d(e,"hb",(function(){return pu})),n.d(e,"ib",(function(){return Xa})),n.d(e,"jb",(function(){return Gn})),n.d(e,"kb",(function(){return rr})),n.d(e,"lb",(function(){return rr})),n.d(e,"mb",(function(){return du})),n.d(e,"nb",(function(){return ha})),n.d(e,"ob",(function(){return aa})),n.d(e,"pb",(function(){return Xu})),n.d(e,"qb",(function(){return Ot})),n.d(e,"rb",(function(){return gs})),n.d(e,"sb",(function(){return q})),n.d(e,"tb",(function(){return H})),n.d(e,"ub",(function(){return $u})),n.d(e,"vb",(function(){return C})),n.d(e,"wb",(function(){return lo})),n.d(e,"xb",(function(){return qn})),n.d(e,"yb",(function(){return Ho})),n.d(e,"zb",(function(){return Uo})),n.d(e,"Ab",(function(){return Gt})),n.d(e,"Bb",(function(){return Qa})),n.d(e,"Cb",(function(){return nc})),n.d(e,"Db",(function(){return uu})),n.d(e,"Eb",(function(){return b})),n.d(e,"Fb",(function(){return st})),n.d(e,"Gb",(function(){return xt})),n.d(e,"Hb",(function(){return js})),n.d(e,"Ib",(function(){return nt})),n.d(e,"Jb",(function(){return et})),n.d(e,"Kb",(function(){return Hn})),n.d(e,"Lb",(function(){return gt})),n.d(e,"Mb",(function(){return kt})),n.d(e,"Nb",(function(){return bs})),n.d(e,"Ob",(function(){return St})),n.d(e,"Pb",(function(){return so})),n.d(e,"Qb",(function(){return it}));var r,i=n(11),o=n.n(i),a=n(16),s=n(20),u=n(18),c=n(14),l=n(39),h=n(6),f=n(5),d=n(10),p=n(3),v=n(4),m=n(1),g=n(2),y={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},b={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},_=0,w=2,x=2,T=100,E=301,S=302,O=306,k=307,C=1e3,M=1001,A=1002,I=1003,j=1004,P=1005,R=1006,N=1007,L=1008,D=1009,F=1012,U=1014,B=1015,V=1016,z=1020,H=1022,q=1023,W=1026,G=1027,Y=2300,X=2301,K=2302,Q=2400,J=2401,Z=2402,$=2500,tt
2=2501,et=1,nt=2,rt=3e3,it=3001,ot=3007,at=3002,st=0,ut=7680,ct=35044,lt=35048,ht="300 es";function ft(){}Object.assign(ft.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,t)}}}});for(var dt=[],pt=0;pt<256;pt++)dt[pt]=(pt<16?"0":"")+pt.toString(16);var vt=1234567,mt={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(dt[255&t]+dt[t>>8&255]+dt[t>>16&255]+dt[t>>24&255]+"-"+dt[255&e]+dt[e>>8&255]+"-"+dt[e>>16&15|64]+dt[e>>24&255]+"-"+dt[63&n|128]+dt[n>>8&255]+"-"+dt[n>>16&255]+dt[n>>24&255]+dt[255&r]+dt[r>>8&255]+dt[r>>16&255]+dt[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},damp:function(t,e,n,r){return mt.lerp(t,e,1-Math.exp(-n*r))},pingpong:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e-Math.abs(mt.euclideanModulo(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(vt=t%2147483647),((vt=16807*vt%2147483647)-1)/2147483646},degToRad:function(t){return t*mt.DEG2RAD},radToDeg:function(t){return t*mt.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),u=a(n/2),c=o((e+r)/2),l=a((e+r)/2),h=o((e-r)/2),f=a((e-r)/2),d=o((r-e)/2),p=a((r-e)/2);switch(i){case"XYX":t.set(s*l,u*h,u*f,s*c);break;case"YZY":t.set(u*f,s*l,u*h,s*c);break;case"ZXZ":t.set(u*h,u*f,s*l,s*c);break;case"XZX":t.set(s*l,u*p,u*d,s*c);break;case"YXY":t.set(u*d,s*l,u*p,s*c);break;case"ZYZ":t.set(u*p,u*d,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},gt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(m.a)(this,t),this.x=e,this.y=n}return Object(g.a)(t,[{key:"width",get:function(){return this.x},set:function(t){this.x=t}},{key:"height",get:function(){return this.y},set:function(t){this.y=t}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this}},{key:"add",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}},{key:"sub",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"applyMatrix3",value:function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}},{key:"clampLength",value:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}}
2,{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y}},{key:"cross",value:function(t){return this.x*t.y-this.y*t.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){var t=Math.atan2(-this.y,-this.x)+Math.PI;return t}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}},{key:"lerpVectors",value:function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t}},{key:"fromBufferAttribute",value:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}},{key:"rotateAround",value:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}}]),t}();gt.prototype.isVector2=!0;var yt,bt=function(){function t(){Object(m.a)(this,t),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}return Object(g.a)(t,[{key:"set",value:function(t,e,n,r,i,o,a,s,u){var c=this.elements;return c[0]=t,c[1]=r,c[2]=a,c[3]=e,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}},{key:"extractBasis",value:function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}},{key:"multiply",value:function(t){return this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[3],s=n[6],u=n[1],c=n[4],l=n[7],h=n[2],f=n[5],d=n[8],p=r[0],v=r[3],m=r[6],g=r[1],y=r[4],b=r[7],_=r[2],w=r[5],x=r[8];return i[0]=o*p+a*g+s*_,i[3]=o*v+a*y+s*w,i[6]=o*m+a*b+s*x,i[1]=u*p+c*g+l*_,i[4]=u*v+c*y+l*w,i[7]=u*m+c*b+l*x,i[2]=h*p+f*g+d*_,i[5]=h*v+f*y+d*w,i[8]=h*m+f*b+d*x,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*o*c-e*a*u-n*i*c+n*a*s+r*i*u-r*o*s}},{key:"invert",value:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=c*o-a*u,h=a*s-c*i,f=u*i-o*s,d=e*l+n*h+r*f;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var p=1/d;return t[0]=l*p,t[1]=(r*u-c*n)*p,t[2]=(a*n-r*o)*p,t[3]=h*p,t[4]=(c*e-r*s)*p,t[5]=(r*i-a*e)*p,t[6]=f*p,t[7]=(n*s-u*e)*p,t[8]=(o*e-n*i)*p,this}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}},{key:"getNormalMatrix",value:function(t){return this.setFromMatrix4(t).invert().transpose()}},{key:"transposeIntoArray",value:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}},{key:"setUvTransform",value:function(t,e,n,r,i,o,a){var s=Math.cos(i),u=Math.sin(i);return this.set(n*s,n*u,-n*(s*o+u*a)+o+t,-r*u,r*s,-r*(-u*o+s*a)+a+e,0,0,1),this}},{key:"scale",value:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}},{key:"rotate",value:function(t){var e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],u=r[4],c=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*u,r[6]=e*a+n*c,r[1]=-n*i+e*s,r[4]=-n*o+e*u,r[7]=-n*a+e*c,this}},{key:"translate",value:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}},{key:"equals",value:function(t){for(var e=this.elements,n=t.elements,r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=t[n+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}]),t}();bt.prototype.isMatrix3=!0;var _t={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;var e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===yt&&(yt=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),yt.width=t.width,yt.height=t.height;var n=yt.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=yt}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},wt=0,xt=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.DEFAULT_IMAGE,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:M,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:R,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:L,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:q,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:D,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:rt;
2return Object(m.a)(this,n),t=e.call(this),Object.defineProperty(Object(d.a)(t),"id",{value:wt++}),t.uuid=mt.generateUUID(),t.name="",t.image=r,t.mipmaps=[],t.mapping=i,t.wrapS=o,t.wrapT=a,t.magFilter=s,t.minFilter=u,t.anisotropy=h,t.format=c,t.internalFormat=null,t.type=l,t.offset=new gt(0,0),t.repeat=new gt(1,1),t.center=new gt(0,0),t.rotation=0,t.matrixAutoUpdate=!0,t.matrix=new bt,t.generateMipmaps=!0,t.premultiplyAlpha=!1,t.flipY=!0,t.unpackAlignment=4,t.encoding=f,t.version=0,t.onUpdate=null,t}return Object(g.a)(n,[{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this}},{key:"toJSON",value:function(t){var e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=mt.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o<a;o++)r[o].isDataTexture?i.push(Tt(r[o].image)):i.push(Tt(r[o]))}else i=Tt(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case C:t.x=t.x-Math.floor(t.x);break;case M:t.x=t.x<0?0:1;break;case A:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case C:t.y=t.y-Math.floor(t.y);break;case M:t.y=t.y<0?0:1;break;case A:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}},{key:"needsUpdate",set:function(t){!0===t&&this.version++}}]),n}(ft);function Tt(t){return"undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?_t.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}xt.DEFAULT_IMAGE=void 0,xt.DEFAULT_MAPPING=300,xt.prototype.isTexture=!0;var Et=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(m.a)(this,t),this.x=e,this.y=n,this.z=r,this.w=i}return Object(g.a)(t,[{key:"width",get:function(){return this.z},set:function(t){this.z=t}},{key:"height",get:function(){return this.w},set:function(t){this.w=t}},{key:"set",value:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setW",value:function(t){return this.w=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}},{key:"add",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}},{key:"sub",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}},{key:"multiply",value:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}},{key:"applyMatrix4",value:function(t){var e=this.x,n=this.y,r=this.z,i=this.w,o=t.elements;
2return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"setAxisAngleFromQuaternion",value:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}},{key:"setAxisAngleFromRotationMatrix",value:function(t){var e,n,r,i,o=.01,a=.1,s=t.elements,u=s[0],c=s[4],l=s[8],h=s[1],f=s[5],d=s[9],p=s[2],v=s[6],m=s[10];if(Math.abs(c-h)<o&&Math.abs(l-p)<o&&Math.abs(d-v)<o){if(Math.abs(c+h)<a&&Math.abs(l+p)<a&&Math.abs(d+v)<a&&Math.abs(u+f+m-3)<a)return this.set(1,0,0,0),this;e=Math.PI;var g=(u+1)/2,y=(f+1)/2,b=(m+1)/2,_=(c+h)/4,w=(l+p)/4,x=(d+v)/4;return g>y&&g>b?g<o?(n=0,r=.707106781,i=.707106781):(r=_/(n=Math.sqrt(g)),i=w/n):y>b?y<o?(n=.707106781,r=0,i=.707106781):(n=_/(r=Math.sqrt(y)),i=x/r):b<o?(n=.707106781,r=.707106781,i=0):(n=w/(i=Math.sqrt(b)),r=x/i),this.set(n,r,i,e),this}var T=Math.sqrt((v-d)*(v-d)+(l-p)*(l-p)+(h-c)*(h-c));return Math.abs(T)<.001&&(T=1),this.x=(v-d)/T,this.y=(l-p)/T,this.z=(h-c)/T,this.w=Math.acos((u+f+m-1)/2),this}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}},{key:"clampLength",value:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}},{key:"lerpVectors",value:function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}},{key:"fromBufferAttribute",value:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}]),t}();Et.prototype.isVector4=!0;var St=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i){var o;return Object(m.a)(this,n),(o=e.call(this)).width=t,o.height=r,o.depth=1,o.scissor=new Et(0,0,t,r),o.scissorTest=!1,o.viewport=new Et(0,0,t,r),i=i||{},o.texture=new xt(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),o.texture.image={},o.texture.image.width=t,o.texture.image.height=r,o.texture.image.depth=1,o.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,o.texture.minFilter=void 0!==i.minFilter?i.minFilter:R,o.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,o.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,o.depthTexture=void 0!==i.depthTexture?i.depthTexture:null,o}return Object(g.a)(n,[{key:"setTexture",value:function(t){t.image={width:this.width,height:this.height,depth:this.depth},this.texture=t}},{key:"setSize",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}}]),n}(ft);St.prototype.isWebGLRenderTarget=!0,function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i){var o;return Object(m.a)(this,n),(o=e.call(this,t,r,i)).samples=4,o}
2return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.samples=t.samples,this}}]),n}(St).prototype.isWebGLMultisampleRenderTarget=!0;var Ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(m.a)(this,t),this._x=e,this._y=n,this._z=r,this._w=i}return Object(g.a)(t,[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}},{key:"set",value:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,o=t._order,a=Math.cos,s=Math.sin,u=a(n/2),c=a(r/2),l=a(i/2),h=s(n/2),f=s(r/2),d=s(i/2);switch(o){case"XYZ":this._x=h*c*l+u*f*d,this._y=u*f*l-h*c*d,this._z=u*c*d+h*f*l,this._w=u*c*l-h*f*d;break;case"YXZ":this._x=h*c*l+u*f*d,this._y=u*f*l-h*c*d,this._z=u*c*d-h*f*l,this._w=u*c*l+h*f*d;break;case"ZXY":this._x=h*c*l-u*f*d,this._y=u*f*l+h*c*d,this._z=u*c*d+h*f*l,this._w=u*c*l-h*f*d;break;case"ZYX":this._x=h*c*l-u*f*d,this._y=u*f*l+h*c*d,this._z=u*c*d-h*f*l,this._w=u*c*l+h*f*d;break;case"YZX":this._x=h*c*l+u*f*d,this._y=u*f*l+h*c*d,this._z=u*c*d-h*f*l,this._w=u*c*l-h*f*d;break;case"XZY":this._x=h*c*l-u*f*d,this._y=u*f*l-h*c*d,this._z=u*c*d+h*f*l,this._w=u*c*l+h*f*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t){var e=t.elements,n=e[0],r=e[4],i=e[8],o=e[1],a=e[5],s=e[9],u=e[2],c=e[6],l=e[10],h=n+a+l;if(h>0){var f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(c-s)*f,this._y=(i-u)*f,this._z=(o-r)*f}else if(n>a&&n>l){var d=2*Math.sqrt(1+n-a-l);this._w=(c-s)/d,this._x=.25*d,this._y=(r+o)/d,this._z=(i+u)/d}else if(a>l){var p=2*Math.sqrt(1+a-n-l);this._w=(i-u)/p,this._x=(r+o)/p,this._y=.25*p,this._z=(s+c)/p}else{var v=2*Math.sqrt(1+l-n-a);this._w=(o-r)/v,this._x=(i+u)/v,this._y=(s+c)/v,this._z=.25*v}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(t){return 2*Math.acos(Math.abs(mt.clamp(this.dot(t),-1,1)))}},{key:"rotateTowards",value:function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}},{key:"multiply",value:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}},{key:"premultiply",value:function(t){return this.multiplyQuaternions(t,this)}},{key:"multiplyQuaternions",value:function(t,e){var n=t._x,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,u=e._z,c=e._w;return this._x=n*c+o*a+r*u-i*s,this._y=r*c+o*s+i*a-n*u,this._z=i*c+o*u+n*s-r*a,this._w=o*c-n*a-r*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*r+e*this._y,this._z=u*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,a),h=Math.sin((1-e)*l)/c,f=Math.sin(e*l)/c;return this._w=o*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,this._onChangeCallback(),this}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}},{key:"fromBufferAttribute",value:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}}],[{key:"slerp",value:function(t,e,n,r){return n.copy(t).slerp(e,r)}},{key:"slerpFlat",value:function(t,e,n,r,i,o,a){var s=n[r+0],u=n[r+1
2],c=n[r+2],l=n[r+3],h=i[o+0],f=i[o+1],d=i[o+2],p=i[o+3];if(0===a)return t[e+0]=s,t[e+1]=u,t[e+2]=c,void(t[e+3]=l);if(1===a)return t[e+0]=h,t[e+1]=f,t[e+2]=d,void(t[e+3]=p);if(l!==p||s!==h||u!==f||c!==d){var v=1-a,m=s*h+u*f+c*d+l*p,g=m>=0?1:-1,y=1-m*m;if(y>Number.EPSILON){var b=Math.sqrt(y),_=Math.atan2(b,m*g);v=Math.sin(v*_)/b,a=Math.sin(a*_)/b}var w=a*g;if(s=s*v+h*w,u=u*v+f*w,c=c*v+d*w,l=l*v+p*w,v===1-a){var x=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=x,u*=x,c*=x,l*=x}}t[e]=s,t[e+1]=u,t[e+2]=c,t[e+3]=l}},{key:"multiplyQuaternionsFlat",value:function(t,e,n,r,i,o){var a=n[r],s=n[r+1],u=n[r+2],c=n[r+3],l=i[o],h=i[o+1],f=i[o+2],d=i[o+3];return t[e]=a*d+c*l+s*f-u*h,t[e+1]=s*d+c*h+u*l-a*f,t[e+2]=u*d+c*f+a*h-s*l,t[e+3]=c*d-a*l-s*h-u*f,t}}]),t}();Ot.prototype.isQuaternion=!0;var kt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(m.a)(this,t),this.x=e,this.y=n,this.z=r}return Object(g.a)(t,[{key:"set",value:function(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}},{key:"setScalar",value:function(t){return this.x=t,this.y=t,this.z=t,this}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"setComponent",value:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}},{key:"getComponent",value:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}},{key:"add",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}},{key:"addScalar",value:function(t){return this.x+=t,this.y+=t,this.z+=t,this}},{key:"addVectors",value:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}},{key:"addScaledVector",value:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}},{key:"sub",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}},{key:"subScalar",value:function(t){return this.x-=t,this.y-=t,this.z-=t,this}},{key:"subVectors",value:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}},{key:"multiply",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}},{key:"multiplyScalar",value:function(t){return this.x*=t,this.y*=t,this.z*=t,this}},{key:"multiplyVectors",value:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}},{key:"applyEuler",value:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Mt.setFromEuler(t))}},{key:"applyAxisAngle",value:function(t,e){return this.applyQuaternion(Mt.setFromAxisAngle(t,e))}},{key:"applyMatrix3",value:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}},{key:"applyNormalMatrix",value:function(t){return this.applyMatrix3(t).normalize()}},{key:"applyMatrix4",value:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this}},{key:"applyQuaternion",value:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,u=s*e+o*r-a*n,c=s*n+a*e-i*r,l=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=u*s+h*-i+c*-a-l*-o,this.y=c*s+h*-o+l*-i-u*-a,this.z=l*s+h*-a+u*-o-c*-i,this}},{key:"project",value:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}},{key:"unproject",value:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}},{key:"transformDirection",value:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}},{key:"divideScalar",value:function(t){return this.multiplyScalar(1/t)}},{key:"min",value:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}},{key:"max",value:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}},{key:"clamp",value:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}},{key:"clampScalar",value:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}},{key:"clampLength",value:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}}
2,{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(t){return this.x*t.x+this.y*t.y+this.z*t.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(t){return this.normalize().multiplyScalar(t)}},{key:"lerp",value:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}},{key:"lerpVectors",value:function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}},{key:"cross",value:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}},{key:"crossVectors",value:function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}},{key:"projectOnVector",value:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}},{key:"projectOnPlane",value:function(t){return Ct.copy(this).projectOnVector(t),this.sub(Ct)}},{key:"reflect",value:function(t){return this.sub(Ct.copy(t).multiplyScalar(2*this.dot(t)))}},{key:"angleTo",value:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(mt.clamp(n,-1,1))}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceToSquared(t))}},{key:"distanceToSquared",value:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}},{key:"manhattanDistanceTo",value:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}},{key:"setFromSpherical",value:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}},{key:"setFromSphericalCoords",value:function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}},{key:"setFromCylindrical",value:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}},{key:"setFromCylindricalCoords",value:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}},{key:"setFromMatrixPosition",value:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}},{key:"setFromMatrixScale",value:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}},{key:"setFromMatrixColumn",value:function(t,e){return this.fromArray(t.elements,4*e)}},{key:"setFromMatrix3Column",value:function(t,e){return this.fromArray(t.elements,3*e)}},{key:"equals",value:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}},{key:"fromBufferAttribute",value:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}]),t}();kt.prototype.isVector3=!0;var Ct=new kt,Mt=new Ot,At=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt(-1/0,-1/0,-1/0);Object(m.a)(this,t),this.min=e,this.max=n}return Object(g.a)(t,[{key:"set",value:function(t,e){return this.min.copy(t),this.max.copy(e),this}},{key:"setFromArray",value:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.length;s<u;s+=3){var c=t[s],l=t[s+1],h=t[s+2];c<e&&(e=c),l<n&&(n=l),h<r&&(r=h),c>i&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this}},{key:"setFromBufferAttribute",value:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.count;s<u;s++){var c=t.getX(s),l=t.getY(s),h=t.getZ(s);c<e&&(e=c),l<n&&(n=l),h<r&&(r=h),c>i&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this}},{key:"setFromPoints",value:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}},{key:"setFromCenterAndSize",value:function(t,e){var n=jt.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}},{key:"setFromObject",value:function(t){return this.makeEmpty(),this.expandByObject(t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.min.copy(t.min),this.max.copy(t.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new kt),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new kt),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(t){return this.min.min(t),this.max.max(t),this}},{key:"expandByVector",value:function(t){return this.min.sub(t),this.max.add(t),this}},{key:"expandByScalar",value:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this}},{key:"expandByObject",value:function(t){t.updateWorldMatrix(!1,!1);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),Pt.copy(e.boundingBox),Pt.applyM
2atrix4(t.matrixWorld),this.union(Pt));for(var n=t.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this}},{key:"containsPoint",value:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}},{key:"containsBox",value:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}},{key:"getParameter",value:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new kt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}},{key:"intersectsSphere",value:function(t){return this.clampPoint(t.center,jt),jt.distanceToSquared(t.center)<=t.radius*t.radius}},{key:"intersectsPlane",value:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}},{key:"intersectsTriangle",value:function(t){if(this.isEmpty())return!1;this.getCenter(Bt),Vt.subVectors(this.max,Bt),Rt.subVectors(t.a,Bt),Nt.subVectors(t.b,Bt),Lt.subVectors(t.c,Bt),Dt.subVectors(Nt,Rt),Ft.subVectors(Lt,Nt),Ut.subVectors(Rt,Lt);var e=[0,-Dt.z,Dt.y,0,-Ft.z,Ft.y,0,-Ut.z,Ut.y,Dt.z,0,-Dt.x,Ft.z,0,-Ft.x,Ut.z,0,-Ut.x,-Dt.y,Dt.x,0,-Ft.y,Ft.x,0,-Ut.y,Ut.x,0];return!!qt(e,Rt,Nt,Lt,Vt)&&(!!qt(e=[1,0,0,0,1,0,0,0,1],Rt,Nt,Lt,Vt)&&(zt.crossVectors(Dt,Ft),qt(e=[zt.x,zt.y,zt.z],Rt,Nt,Lt,Vt)))}},{key:"clampPoint",value:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new kt),e.copy(t).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(t){return jt.copy(t).clamp(this.min,this.max).sub(t).length()}},{key:"getBoundingSphere",value:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(jt).length(),t}},{key:"intersect",value:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(t){return this.min.min(t.min),this.max.max(t.max),this}},{key:"applyMatrix4",value:function(t){return this.isEmpty()||(It[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),It[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),It[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),It[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),It[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),It[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),It[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),It[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(It)),this}},{key:"translate",value:function(t){return this.min.add(t),this.max.add(t),this}},{key:"equals",value:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}]),t}();At.prototype.isBox3=!0;var It=[new kt,new kt,new kt,new kt,new kt,new kt,new kt,new kt],jt=new kt,Pt=new At,Rt=new kt,Nt=new kt,Lt=new kt,Dt=new kt,Ft=new kt,Ut=new kt,Bt=new kt,Vt=new kt,zt=new kt,Ht=new kt;function qt(t,e,n,r,i){for(var o=0,a=t.length-3;o<=a;o+=3){Ht.fromArray(t,o);var s=i.x*Math.abs(Ht.x)+i.y*Math.abs(Ht.y)+i.z*Math.abs(Ht.z),u=e.dot(Ht),c=n.dot(Ht),l=r.dot(Ht);if(Math.max(-Math.max(u,c,l),Math.min(u,c,l))>s)return!1}return!0}var Wt=new At,Gt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;Object(m.a)(this,t),this.center=e,this.radius=n}return Object(g.a)(t,[{key:"set",value:function(t,e){return this.center.copy(t),this.radius=e,this}},{key:"setFromPoints",value:function(t,e){var n=this.center;void 0!==e?n.copy(e):Wt.setFromPoints(t).getCenter(n);for(var r=0,i=0,o=t.length;i<o;i++)r=Math.max(r,n.distanceToSquared(t[i]));return this.radius=Math.sqrt(r),this}},{key:"copy",value:function(t){return this.center.copy(t.center),this.radius=t.radius,this}},{key:"isEmpty",value:function(){return this.radius<0}},{key:"makeEmpty",value:function(){return this.center.set(0,0,0),this.radius=-1,this}},{key:"containsPoint",value:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}},{key:"distanceToPoint",value:function(t){return t.distanceTo(this.center)-this.radius}},{key:"intersectsSphere",value:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}},{key:"intersectsBox",value:function(t){return t.intersectsSphere(this)}},{key:"intersectsPlane",value:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}},{key:"clampPoint",value:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new kt),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}},{key:"getBoundingBox",value:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new At),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}},{key:"applyMatrix4",value:function(t){return this.center.applyM
2atrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}},{key:"translate",value:function(t){return this.center.add(t),this}},{key:"equals",value:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),t}(),Yt=new kt,Xt=new kt,Kt=new kt,Qt=new kt,Jt=new kt,Zt=new kt,$t=new kt,te=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt(0,0,-1);Object(m.a)(this,t),this.origin=e,this.direction=n}return Object(g.a)(t,[{key:"set",value:function(t,e){return this.origin.copy(t),this.direction.copy(e),this}},{key:"copy",value:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}},{key:"at",value:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new kt),e.copy(this.direction).multiplyScalar(t).add(this.origin)}},{key:"lookAt",value:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this}},{key:"recast",value:function(t){return this.origin.copy(this.at(t,Yt)),this}},{key:"closestPointToPoint",value:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new kt),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}},{key:"distanceToPoint",value:function(t){return Math.sqrt(this.distanceSqToPoint(t))}},{key:"distanceSqToPoint",value:function(t){var e=Yt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Yt.copy(this.direction).multiplyScalar(e).add(this.origin),Yt.distanceToSquared(t))}},{key:"distanceSqToSegment",value:function(t,e,n,r){Xt.copy(t).add(e).multiplyScalar(.5),Kt.copy(e).sub(t).normalize(),Qt.copy(this.origin).sub(Xt);var i,o,a,s,u=.5*t.distanceTo(e),c=-this.direction.dot(Kt),l=Qt.dot(this.direction),h=-Qt.dot(Kt),f=Qt.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(o=c*l-h,s=u*d,(i=c*h-l)>=0)if(o>=-s)if(o<=s){var p=1/d;a=(i*=p)*(i+c*(o*=p)+2*l)+o*(c*i+o+2*h)+f}else o=u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+f;else o=-u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+f;else o<=-s?a=-(i=Math.max(0,-(-c*u+l)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+f:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+f):a=-(i=Math.max(0,-(c*u+l)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+f;else o=c>0?-u:u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+f;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Kt).multiplyScalar(o).add(Xt),a}},{key:"intersectSphere",value:function(t,e){Yt.subVectors(t.center,this.origin);var n=Yt.dot(this.direction),r=Yt.dot(Yt)-n*n,i=t.radius*t.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)}},{key:"intersectsSphere",value:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}},{key:"distanceToPlane",value:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}},{key:"intersectPlane",value:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}},{key:"intersectsPlane",value:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}},{key:"intersectBox",value:function(t,e){var n,r,i,o,a,s,u=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,h=this.origin;return u>=0?(n=(t.min.x-h.x)*u,r=(t.max.x-h.x)*u):(n=(t.max.x-h.x)*u,r=(t.min.x-h.x)*u),c>=0?(i=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(i=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),n>o||i>r?null:((i>n||n!==n)&&(n=i),(o<r||r!==r)&&(r=o),l>=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),n>s||a>r?null:((a>n||n!==n)&&(n=a),(s<r||r!==r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))}},{key:"intersectsBox",value:function(t){return null!==this.intersectBox(t,Yt)}},{key:"intersectTriangle",value:function(t,e,n,r,i){Jt.subVectors(e,t),Zt.subVectors(n,t),$t.crossVectors(Jt,Zt);var o,a=this.direction.dot($t);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Qt.subVectors(this.origin,t);var s=o*this.direction.dot(Zt.crossVectors(Qt,Zt));if(s<0)return null;var u=o*this.direction.dot(Jt.cross(Qt));if(u<0)return null;if(s+u>a)return null;var c=-o*Qt.dot($t);return c<0?null:this.at(c/a,i)}},{key:"applyMatrix4",value:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}},{key:"equals",value:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),t}(),ee=function(){function t(){Object(m.a)(this,t),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}return Object(g.a)(t,[{key:"set",value:function(t,e,n,r,i,o,a,s,u,c,l,h,f,d,p,v){var m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=r,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=u,m[6]=c,m[10]=l,m[14]=h,m[3]=f,m[7]=d,m[11]=p,m[15]=v,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new t).fromArray(this.elements)}},{key:"copy",value:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}},{key:"copyPosition",value:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}},{key:"setFromMatrix3",value:function(t){var e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(t){var e=this.elements,n=t.elements,r=1/ne.setFromMatrixColumn(t,0).length(),i=1/ne.setFromMatrixColumn(t,1).length(),o=1/ne.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromEuler",value:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),u=Math.sin(r),c=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*c,f=o*l,d=a*c,p=a*l;e[0]=s*c,e[4]=-s*l,e[8]=u,e[1]=f+d*u,e[5]=h-p*u,e[9]=-a*s,e[2]=p-h*u,e[6]=d+f*u,e[10]=o*s}else if("YXZ"===t.order){var v=s*c,m=s*l,g=u*c,y=u*l;e[0]=v+y*a,e[4]=g*a-m,e[8]=o*u,e[1]=o*l,e[5]=o*c,e[9]=-a,e[2]=m*a-g,e[6]=y+v*a,e[10]=o*s}else if("ZXY"===t.order){var b=s*c,_=s*l,w=u*c,x=u*l;e[0]=b-x*a,e[4]=-o*l,e[8]=w+_*a,e[1]=_+w*a,e[5]=o*c,e[9]=x-b*a,e[2]=-o*u,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){var T=o*c,E=o*l,S=a*c,O=a*l;e[0]=s*c,e[4]=S*u-E,e[8]=T*u+O,e[1]=s*l,e[5]=O*u+T,e[9]=E*u-S,e[2]=-u,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var k=o*s,C=o*u,M=a*s,A=a*u;e[0]=s*c,e[4]=A-k*l,e[8]=M*l+C,e[1]=l,e[5]=o*c,e[9]=-a*c,e[2]=-u*c,e[6]=C*l+M,e[10]=k-A*l}
2else if("XZY"===t.order){var I=o*s,j=o*u,P=a*s,R=a*u;e[0]=s*c,e[4]=-l,e[8]=u*c,e[1]=I*l+R,e[5]=o*c,e[9]=j*l-P,e[2]=P*l-j,e[6]=a*c,e[10]=R*l+I}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(t){return this.compose(ie,t,oe)}},{key:"lookAt",value:function(t,e,n){var r=this.elements;return ue.subVectors(t,e),0===ue.lengthSq()&&(ue.z=1),ue.normalize(),ae.crossVectors(n,ue),0===ae.lengthSq()&&(1===Math.abs(n.z)?ue.x+=1e-4:ue.z+=1e-4,ue.normalize(),ae.crossVectors(n,ue)),ae.normalize(),se.crossVectors(ue,ae),r[0]=ae.x,r[4]=se.x,r[8]=ue.x,r[1]=ae.y,r[5]=se.y,r[9]=ue.y,r[2]=ae.z,r[6]=se.z,r[10]=ue.z,this}},{key:"multiply",value:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}},{key:"premultiply",value:function(t){return this.multiplyMatrices(t,this)}},{key:"multiplyMatrices",value:function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],u=n[12],c=n[1],l=n[5],h=n[9],f=n[13],d=n[2],p=n[6],v=n[10],m=n[14],g=n[3],y=n[7],b=n[11],_=n[15],w=r[0],x=r[4],T=r[8],E=r[12],S=r[1],O=r[5],k=r[9],C=r[13],M=r[2],A=r[6],I=r[10],j=r[14],P=r[3],R=r[7],N=r[11],L=r[15];return i[0]=o*w+a*S+s*M+u*P,i[4]=o*x+a*O+s*A+u*R,i[8]=o*T+a*k+s*I+u*N,i[12]=o*E+a*C+s*j+u*L,i[1]=c*w+l*S+h*M+f*P,i[5]=c*x+l*O+h*A+f*R,i[9]=c*T+l*k+h*I+f*N,i[13]=c*E+l*C+h*j+f*L,i[2]=d*w+p*S+v*M+m*P,i[6]=d*x+p*O+v*A+m*R,i[10]=d*T+p*k+v*I+m*N,i[14]=d*E+p*C+v*j+m*L,i[3]=g*w+y*S+b*M+_*P,i[7]=g*x+y*O+b*A+_*R,i[11]=g*T+y*k+b*I+_*N,i[15]=g*E+y*C+b*j+_*L,this}},{key:"multiplyScalar",value:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}},{key:"determinant",value:function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],u=t[13],c=t[2],l=t[6],h=t[10],f=t[14];return t[3]*(+i*s*l-r*u*l-i*a*h+n*u*h+r*a*f-n*s*f)+t[7]*(+e*s*f-e*u*h+i*o*h-r*o*f+r*u*c-i*s*c)+t[11]*(+e*u*l-e*a*f-i*o*l+n*o*f+i*a*c-n*u*c)+t[15]*(-r*a*c-e*s*l+e*a*h+r*o*l-n*o*h+n*s*c)}},{key:"transpose",value:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}},{key:"setPosition",value:function(t,e,n){var r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}},{key:"invert",value:function(){var t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15],g=l*v*u-p*h*u+p*s*f-a*v*f-l*s*m+a*h*m,y=d*h*u-c*v*u-d*s*f+o*v*f+c*s*m-o*h*m,b=c*p*u-d*l*u+d*a*f-o*p*f-c*a*m+o*l*m,_=d*l*s-c*p*s-d*a*h+o*p*h+c*a*v-o*l*v,w=e*g+n*y+r*b+i*_;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var x=1/w;return t[0]=g*x,t[1]=(p*h*i-l*v*i-p*r*f+n*v*f+l*r*m-n*h*m)*x,t[2]=(a*v*i-p*s*i+p*r*u-n*v*u-a*r*m+n*s*m)*x,t[3]=(l*s*i-a*h*i-l*r*u+n*h*u+a*r*f-n*s*f)*x,t[4]=y*x,t[5]=(c*v*i-d*h*i+d*r*f-e*v*f-c*r*m+e*h*m)*x,t[6]=(d*s*i-o*v*i-d*r*u+e*v*u+o*r*m-e*s*m)*x,t[7]=(o*h*i-c*s*i+c*r*u-e*h*u-o*r*f+e*s*f)*x,t[8]=b*x,t[9]=(d*l*i-c*p*i-d*n*f+e*p*f+c*n*m-e*l*m)*x,t[10]=(o*p*i-d*a*i+d*n*u-e*p*u-o*n*m+e*a*m)*x,t[11]=(c*a*i-o*l*i-c*n*u+e*l*u+o*n*f-e*a*f)*x,t[12]=_*x,t[13]=(c*p*r-d*l*r+d*n*h-e*p*h-c*n*v+e*l*v)*x,t[14]=(d*a*r-o*p*r-d*n*s+e*p*s+o*n*v-e*a*v)*x,t[15]=(o*l*r-c*a*r+c*n*s-e*l*s-o*n*h+e*a*h)*x,this}},{key:"scale",value:function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}},{key:"makeTranslation",value:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}},{key:"makeRotationY",value:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,a=t.y,s=t.z,u=i*o,c=i*a;return this.set(u*o+n,u*a-r*s,u*s+r*a,0,u*a+r*s,c*a+n,c*s-r*o,0,u*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this}},{key:"compose",value:function(t,e,n){var r=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,d=i*l,p=o*c,v=o*l,m=a*l,g=s*u,
2y=s*c,b=s*l,_=n.x,w=n.y,x=n.z;return r[0]=(1-(p+m))*_,r[1]=(f+b)*_,r[2]=(d-y)*_,r[3]=0,r[4]=(f-b)*w,r[5]=(1-(h+m))*w,r[6]=(v+g)*w,r[7]=0,r[8]=(d+y)*x,r[9]=(v-g)*x,r[10]=(1-(h+p))*x,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}},{key:"decompose",value:function(t,e,n){var r=this.elements,i=ne.set(r[0],r[1],r[2]).length(),o=ne.set(r[4],r[5],r[6]).length(),a=ne.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],re.copy(this);var s=1/i,u=1/o,c=1/a;return re.elements[0]*=s,re.elements[1]*=s,re.elements[2]*=s,re.elements[4]*=u,re.elements[5]*=u,re.elements[6]*=u,re.elements[8]*=c,re.elements[9]*=c,re.elements[10]*=c,e.setFromRotationMatrix(re),n.x=i,n.y=o,n.z=a,this}},{key:"makePerspective",value:function(t,e,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(e-t),u=2*i/(n-r),c=(e+t)/(e-t),l=(n+r)/(n-r),h=-(o+i)/(o-i),f=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}},{key:"makeOrthographic",value:function(t,e,n,r,i,o){var a=this.elements,s=1/(e-t),u=1/(n-r),c=1/(o-i),l=(e+t)*s,h=(n+r)*u,f=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}},{key:"equals",value:function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=t[n+e];return this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}]),t}();ee.prototype.isMatrix4=!0;var ne=new kt,re=new ee,ie=new kt(0,0,0),oe=new kt(1,1,1),ae=new kt,se=new kt,ue=new kt,ce=new ee,le=new Ot,he=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.DefaultOrder;Object(m.a)(this,t),this._x=e,this._y=n,this._z=r,this._order=i}return Object(g.a)(t,[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}},{key:"set",value:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(t,e,n){var r=mt.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],u=i[1],c=i[5],l=i[9],h=i[2],f=i[6],d=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(t,e,n){return ce.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ce,e,n)}},{key:"setFromVector3",value:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)}},{key:"reorder",value:function(t){return le.setFromEuler(this),this.setFromQuaternion(le,t)}},{key:"equals",value:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}},{key:"fromArray",value:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}},{key:"toVector3",value:function(t){return t?t.set(this._x,this._y,this._z):new kt(this._x,this._y,this._z)}},{key:"_onChange",value:function(t){return this._onChangeCallback=t,this}},{key:"_onChangeCallback",value:function(){}}]),t}();he.prototype.isEuler=!0,he.DefaultOrder="XYZ",he.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var fe=function(){function t(){Object(m.a)(this,t),this.mask=1}return Object(g.a)(t,[{key:"set",value:function(t){this.mask=1<<t|0}},{key:"enable",value:function(t){this.mask|=1<<t|0}},{key:"enableAll",value:function(){this.mask=-1}},{key:"toggle",value:function(t){this.mask^=1<<t|0}},{key:"disable",value:function(t){this.mask&=~(1<<t|0)}},{key:"disableAll",value:function(){this.mask=0}},{key:"test",value:function(t){return 0!==(this.mask&t.mask)}}]),t}(),de=0,pe=new kt,ve=new Ot,me=new ee,ge=new kt,ye=new kt,be=new kt,_e=new Ot,we=new kt(1,0,0),xe=new kt(0,1,0),Te=new kt(0,0,1),Ee={type:"added"},Se={type:"removed"};function Oe(){Object.defineProperty(this,"id",{value:de++}),this.uuid=mt.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Oe.DefaultUp.clone();
vendor: 3,176 bytes, line 2
2var t=new kt,e=new he,n=new Ot,r=new kt(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new ee},normalMatrix:{value:new bt}}),this.matrix=new ee,this.matrixWorld=new ee,this.matrixAutoUpdate=Oe.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new fe,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}Oe.DefaultUp=new kt(0,1,0),Oe.DefaultMatrixAutoUpdate=!0,Oe.prototype=Object.assign(Object.create(ft.prototype),{constructor:Oe,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return ve.setFromAxisAngle(t,e),this.quaternion.multiply(ve),this},rotateOnWorldAxis:function(t,e){return ve.setFromAxisAngle(t,e),this.quaternion.premultiply(ve),this},rotateX:function(t){return this.rotateOnAxis(we,t)},rotateY:function(t){return this.rotateOnAxis(xe,t)},rotateZ:function(t){return this.rotateOnAxis(Te,t)},translateOnAxis:function(t,e){return pe.copy(t).applyQuaternion(this.quaternion),this.position.add(pe.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(we,t)},translateY:function(t){return this.translateOnAxis(xe,t)},translateZ:function(t){return this.translateOnAxis(Te,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(me.copy(this.matrixWorld).invert())},lookAt:function(t,e,n){t.isVector3?ge.copy(t):ge.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),ye.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?me.lookAt(ye,ge,this.up):me.lookAt(ge,ye,this.up),this.quaternion.setFromRotationMatrix(me),r&&(me.extractRotation(r.matrixWorld),ve.setFromRotationMatrix(me),this.quaternion.premultiply(ve.invert()))},add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(Ee)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);
2return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(Se)),this},clear:function(){for(var t=0;t<this.children.length;t++){var e=this.children[t];e.parent=null,e.dispatchEvent(Se)}return this.children.length=0,this},attach:function(t){return this.updateWorldMatrix(!0,!1),me.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),me.multiply(t.parent.matrixWorld)),t.applyMatrix4(me),this.add(t),t.updateWorldMatrix(!1,!0),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new kt),this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new Ot),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ye,t,be),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new kt),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ye,_e,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new kt),this.updateWorldMatrix(!0,!1);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var r=this.children,i=0,o=r.length;i<o;i++)r[i].updateWorldMatrix(!1,!0)},toJSON:function(t){var e=void 0===t||"string"===typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,u=a.length;s<u;s++){var c=a[s];i(t.shapes,c)}else i(t.shapes,a)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){for(var l=[],h=0,f=this.material.length;h<f;h++)l.push(i(t.materials,this.material[h]));r.material=l}else r.material=i(t.materials,this.material);
2if(this.children.length>0){r.children=[];for(var d=0;d<this.children.length;d++)r.children.push(this.children[d].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(var p=0;p<this.animations.length;p++){var v=this.animations[p];r.animations.push(i(t.animations,v))}}if(e){var m=T(t.geometries),g=T(t.materials),y=T(t.textures),b=T(t.images),_=T(t.shapes),w=T(t.skeletons),x=T(t.animations);m.length>0&&(n.geometries=m),g.length>0&&(n.materials=g),y.length>0&&(n.textures=y),b.length>0&&(n.images=b),_.length>0&&(n.shapes=_),w.length>0&&(n.skeletons=w),x.length>0&&(n.animations=x)}return n.object=r,n;function T(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var r=t.children[n];this.add(r.clone())}return this}});var ke=new kt,Ce=new kt,Me=new bt,Ae=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt(1,0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(m.a)(this,t),this.normal=e,this.constant=n}return Object(g.a)(t,[{key:"set",value:function(t,e){return this.normal.copy(t),this.constant=e,this}},{key:"setComponents",value:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(t,e,n){var r=ke.subVectors(n,e).cross(Ce.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}},{key:"copy",value:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this}},{key:"normalize",value:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(t){return this.normal.dot(t)+this.constant}},{key:"distanceToSphere",value:function(t){return this.distanceToPoint(t.center)-t.radius}},{key:"projectPoint",value:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new kt),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}},{key:"intersectLine",value:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new kt);var n=t.delta(ke),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||i>1?void 0:e.copy(n).multiplyScalar(i).add(t.start)}},{key:"intersectsLine",value:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}},{key:"intersectsBox",value:function(t){return t.intersectsPlane(this)}},{key:"intersectsSphere",value:function(t){return t.intersectsPlane(this)}},{key:"coplanarPoint",value:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new kt),t.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(t,e){var n=e||Me.getNormalMatrix(t),r=this.coplanarPoint(ke).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}},{key:"translate",value:function(t){return this.constant-=t.dot(this.normal),this}},{key:"equals",value:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),t}();Ae.prototype.isPlane=!0;var Ie=new kt,je=new kt,Pe=new kt,Re=new kt,Ne=new kt,Le=new kt,De=new kt,Fe=new kt,Ue=new kt,Be=new kt,Ve=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new kt;Object(m.a)(this,t),this.a=e,this.b=n,this.c=r}return Object(g.a)(t,[{key:"set",value:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}},{key:"setFromPointsAndIndices",value:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}},{key:"getArea",value:function(){return Ie.subVectors(this.c,this.b),je.subVectors(this.a,this.b),.5*Ie.cross(je).length()}},{key:"getMidpoint",value:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new kt),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(e){return t.getNormal(this.a,this.b,this.c,e)}},{key:"getPlane",value:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Ae),t.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(e,n){return t.getBarycoord(e,this.a,this.b,this.c,n)}},{key:"getUV",value:function(e,n,r,i,o){return t.getUV(e,this.a,this.b,this.c,n,r,i,o)}},{key:"containsPoint",value:function(e){return t.containsPoint(e,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(e){return t.isFrontFacing(this.a,this.b,this.c,e)}},{key:"intersectsBox",value:function(t){return t.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new kt);var n,r,i=this.a,o=this.b,a=this.c;Ne.subVectors(o,i),Le.subVectors(a,i),Fe.subVectors(t,i);var s=Ne.dot(Fe),u=Le.dot(Fe);if(s<=0&&u<=0)return e.copy(i);Ue.subVectors(t,o);var c=Ne.dot(Ue),l=Le.dot(Ue);if(c>=0&&l<=c)return e.copy(o);var h=s*l-c*u;if(h<=0&&s>=0&&c<=0)return n=s/(s-c),e.copy(i).addScaledVector(Ne,n);Be.subVectors(t,a);var f=Ne.dot(Be),d=Le.dot(Be);if(d>=0&&f<=d)return e.copy(a);var p=f*u-s*d;if(p<=0&&u>=0&&d<=0)return r=u/(u-d),e.copy(i).addScaledVector(Le,r);var v=c*d-f*l;if(v<=0&&l-c>=0&&f-d>=0)return De.subVectors(a,o),r=(l-c)/(l-c+(f-d)),e.copy(o).addScaledVector(De,r);var m=1/(v+p+h);return n=p*m,r=h*m,e.copy(i).addScaledVector(Ne,n).addScaledVector(Le,r)}},{key:"equals",value:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}],[{key:"getNormal",value:function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new kt),r.subVectors(n,e),Ie.subVectors(t,e),r.cross(Ie);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}},{key:"getBarycoord",value:function(t,e,n,r,i){Ie.subVectors(r,e),je.subVectors(n,e),Pe.subVectors(t,e);
2var o=Ie.dot(Ie),a=Ie.dot(je),s=Ie.dot(Pe),u=je.dot(je),c=je.dot(Pe),l=o*u-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new kt),0===l)return i.set(-2,-1,-1);var h=1/l,f=(u*s-a*c)*h,d=(o*c-a*s)*h;return i.set(1-f-d,d,f)}},{key:"containsPoint",value:function(t,e,n,r){return this.getBarycoord(t,e,n,r,Re),Re.x>=0&&Re.y>=0&&Re.x+Re.y<=1}},{key:"getUV",value:function(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,Re),s.set(0,0),s.addScaledVector(i,Re.x),s.addScaledVector(o,Re.y),s.addScaledVector(a,Re.z),s}},{key:"isFrontFacing",value:function(t,e,n,r){return Ie.subVectors(n,e),je.subVectors(t,e),Ie.cross(je).dot(r)<0}}]),t}(),ze=0;function He(){Object.defineProperty(this,"id",{value:ze++}),this.uuid=mt.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=_,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=T,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ut,this.stencilZFail=ut,this.stencilZPass=ut,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}He.prototype=Object.assign(Object.create(ft.prototype),{constructor:He,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"===typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}
vendor: 9,228 bytes, line 2
2if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==_&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),o=r(t.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(He.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});var qe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},We={h:0,s:0,l:0},Ge={h:0,s:0,l:0};function Ye(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}
2function Xe(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ke(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var Qe=function(){function t(e,n,r){return Object(m.a)(this,t),void 0===n&&void 0===r?this.set(e):this.setRGB(e,n,r)}return Object(g.a)(t,[{key:"set",value:function(t){return t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t),this}},{key:"setScalar",value:function(t){return this.r=t,this.g=t,this.b=t,this}},{key:"setHex",value:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}},{key:"setRGB",value:function(t,e,n){return this.r=t,this.g=e,this.b=n,this}},{key:"setHSL",value:function(t,e,n){if(t=mt.euclideanModulo(t,1),e=mt.clamp(e,0,1),n=mt.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=Ye(i,r,t+1/3),this.g=Ye(i,r,t),this.b=Ye(i,r,t-1/3)}return this}},{key:"setStyle",value:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return e(r[4]),this.setHSL(a,s,u)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){var c=n[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}},{key:"setColorName",value:function(t){var e=qe[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}},{key:"copyGammaToLinear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}},{key:"copyLinearToGamma",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}},{key:"convertGammaToLinear",value:function(t){return this.copyGammaToLinear(this,t),this}},{key:"convertLinearToGamma",value:function(t){return this.copyLinearToGamma(this,t),this}},{key:"copySRGBToLinear",value:function(t){return this.r=Xe(t.r),this.g=Xe(t.g),this.b=Xe(t.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.r=Ke(t.r),this.g=Ke(t.g),this.b=Ke(t.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}},{key:"getHexString",value:function(){return("000000"+this.getHex().toString(16)).slice(-6)}},{key:"getHSL",value:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),u=(s+a)/2;if(s===a)e=0,n=0;else{var c=a-s;switch(n=u<=.5?c/(a+s):c/(2-a-s),a){case r:e=(i-o)/c+(i<o?6:0);break;case i:e=(o-r)/c+2;break;case o:e=(r-i)/c+4}e/=6}return t.h=e,t.s=n,t.l=u,t}},{key:"getStyle",value:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}},{key:"offsetHSL",value:function(t,e,n){return this.getHSL(We),We.h+=t,We.s+=e,We.l+=n,this.setHSL(We.h,We.s,We.l),this}},{key:"add",value:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}},{key:"addColors",value:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}},{key:"addScalar",value:function(t){return this.r+=t,this.g+=t,this.b+=t,this}},{key:"sub",value:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}},{key:"multiply",value:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}},{key:"multiplyScalar",value:function(t){return this.r*=t,this.g*=t,this.b*=t,this}},{key:"lerp",value:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}},{key:"lerpColors",value:function(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}},{key:"lerpHSL",value:function(t,e){this.getHSL(We),t.getHSL(Ge);var n=mt.lerp(We.h,Ge.h,e),r=mt.lerp(We.s,Ge.s,e),i=mt.lerp(We.l,Ge.l,e);return this.setHSL(n,r,i),this}},{key:"equals",value:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}},{key:"fromArray",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}},{key:"toArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}},{key:"fromBufferAttribute",value:function(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}}]),t}();Qe.NAMES=qe,Qe.prototype.isColor=!0,Qe.prototype.r=1,Qe.prototype.g=1,Qe.prototype.b=1;var Je=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="MeshBasicMaterial",r.color=new Qe(16777215),r.map=null,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=null,r.aoMapIntensity=1,r.specularMap=null,r.alphaMap=null,r.envMap=null,r.combine=0,r.reflectivity=1,r.refractionRatio=.98,r.wireframe=!1,r.wireframeLinewidth=1,r.wireframeLinecap="round",r.wireframeLinejoin="round",r.skinning=!1,r.morphTargets=!1,r.setValues(t),r}
2return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this}}]),n}(He);Je.prototype.isMeshBasicMaterial=!0;var Ze=new kt,$e=new gt;function tn(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=ct,this.updateRange={offset:0,count:-1},this.version=0}function en(t,e,n){tn.call(this,new Int8Array(t),e,n)}function nn(t,e,n){tn.call(this,new Uint8Array(t),e,n)}function rn(t,e,n){tn.call(this,new Uint8ClampedArray(t),e,n)}function on(t,e,n){tn.call(this,new Int16Array(t),e,n)}function an(t,e,n){tn.call(this,new Uint16Array(t),e,n)}function sn(t,e,n){tn.call(this,new Int32Array(t),e,n)}function un(t,e,n){tn.call(this,new Uint32Array(t),e,n)}function cn(t,e,n){tn.call(this,new Uint16Array(t),e,n)}function ln(t,e,n){tn.call(this,new Float32Array(t),e,n)}function hn(t,e,n){tn.call(this,new Float64Array(t),e,n)}function fn(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(tn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(tn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new Qe),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new gt),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new kt),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,r=0,i=t.length;r<i;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new Et),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},applyMatrix3:function(t){if(2===this.itemSize)for(var e=0,n=this.count;e<n;e++)$e.fromBufferAttribute(this,e),$e.applyMatrix3(t),this.setXY(e,$e.x,$e.y);else if(3===this.itemSize)for(var r=0,i=this.count;r<i;r++)Ze.fromBufferAttribute(this,r),Ze.applyMatrix3(t),this.setXYZ(r,Ze.x,Ze.y,Ze.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)Ze.x=this.getX(e),Ze.y=this.getY(e),Ze.z=this.getZ(e),Ze.applyMatrix4(t),this.setXYZ(e,Ze.x,Ze.
vendor: 4,756 bytes, line 2
2y,Ze.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)Ze.x=this.getX(e),Ze.y=this.getY(e),Ze.z=this.getZ(e),Ze.applyNormalMatrix(t),this.setXYZ(e,Ze.x,Ze.y,Ze.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)Ze.x=this.getX(e),Ze.y=this.getY(e),Ze.z=this.getZ(e),Ze.transformDirection(t),this.setXYZ(e,Ze.x,Ze.y,Ze.z);return this},set:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),en.prototype=Object.create(tn.prototype),en.prototype.constructor=en,nn.prototype=Object.create(tn.prototype),nn.prototype.constructor=nn,rn.prototype=Object.create(tn.prototype),rn.prototype.constructor=rn,on.prototype=Object.create(tn.prototype),on.prototype.constructor=on,an.prototype=Object.create(tn.prototype),an.prototype.constructor=an,sn.prototype=Object.create(tn.prototype),sn.prototype.constructor=sn,un.prototype=Object.create(tn.prototype),un.prototype.constructor=un,cn.prototype=Object.create(tn.prototype),cn.prototype.constructor=cn,cn.prototype.isFloat16BufferAttribute=!0,ln.prototype=Object.create(tn.prototype),ln.prototype.constructor=ln,hn.prototype=Object.create(tn.prototype),hn.prototype.constructor=hn;Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;var dn=0,pn=new ee,vn=new Oe,mn=new kt,gn=new At,yn=new At,bn=new kt;function _n(){Object.defineProperty(this,"id",{value:dn++}),this.uuid=mt.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}_n.prototype=Object.assign(Object.create(ft.prototype),{constructor:_n,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){return Array.isArray(t)?this.index=new(fn(t)>65535?un:an)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new bt).getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return pn.makeRotationX(t),this.applyMatrix4(pn),this},rotateY:function(t){return pn.makeRotationY(t),this.applyMatrix4(pn),this},rotateZ:function(t){return pn.makeRotationZ(t),this.applyMatrix4(pn),this},translate:function(t,e,n){return pn.makeTranslation(t,e,n),this.applyMatrix4(pn),this},scale:function(t,e,n){return pn.makeScale(t,e,n),this.applyMatrix4(pn),this},lookAt:function(t){return vn.lookAt(t),vn.updateMatrix(),this.applyMatrix4(vn.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(mn).negate(),this.translate(mn.x,mn.y,mn.z),this},setFromPoints:function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new ln(e,3)),this}
2,computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new At);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new kt(-1/0,-1/0,-1/0),new kt(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,r=e.length;n<r;n++){var i=e[n];gn.setFromBufferAttribute(i),this.morphTargetsRelative?(bn.addVectors(this.boundingBox.min,gn.min),this.boundingBox.expandByPoint(bn),bn.addVectors(this.boundingBox.max,gn.max),this.boundingBox.expandByPoint(bn)):(this.boundingBox.expandByPoint(gn.min),this.boundingBox.expandByPoint(gn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Gt);var t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
2se".',this),void this.boundingSphere.set(new kt,1/0);if(t){var n=this.boundingSphere.center;if(gn.setFromBufferAttribute(t),e)for(var r=0,i=e.length;r<i;r++){var o=e[r];yn.setFromBufferAttribute(o),this.morphTargetsRelative?(bn.addVectors(gn.min,yn.min),gn.expandByPoint(bn),bn.addVectors(gn.max,yn.max),gn.expandByPoint(bn)):(gn.expandByPoint(yn.min),gn.expandByPoint(yn.max))}gn.getCenter(n);for(var a=0,s=0,u=t.count;s<u;s++)bn.fromBufferAttribute(t,s),a=Math.max(a,n.distanceToSquared(bn));if(e)for(var c=0,l=e.length;c<l;c++)for(var h=e[c],f=this.morphTargetsRelative,d=0,p=h.count;d<p;d++)bn.fromBufferAttribute(h,d),f&&(mn.fromBufferAttribute(t,d),bn.add(mn)),a=Math.max(a,n.distanceToSquared(bn));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeTangents:function(){var t=this.index,e=this.attributes;if(null!==t&&void 0!==e.position&&void 0!==e.normal&&void 0!==e.uv){var n=t.array,r=e.position.array,i=e.normal.array,o=e.uv.array,a=r.length/3;void 0===e.tangent&&this.setAttribute("tangent",new tn(new Float32Array(4*a),4));for(var s=e.tangent.array,u=[],c=[],l=0;l<a;l++)u[l]=new kt,c[l]=new kt;var h=new kt,f=new kt,d=new kt,p=new gt,v=new gt,m=new gt,g=new kt,y=new kt,b=this.groups;0===b.length&&(b=[{start:0,count:n.length}]);for(var _=0,w=b.length;_<w;++_)for(var x=b[_],T=x.start,E=T,S=T+x.count;E<S;E+=3)L(n[E+0],n[E+1],n[E+2]);for(var O=new kt,k=new kt,C=new kt,M=new kt,A=0,I=b.length;A<I;++A)for(var j=b[A],P=j.start,R=P,N=P+j.count;R<N;R+=3)D(n[R+0]),D(n[R+1]),D(n[R+2])}else console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");function L(t,e,n){h.fromArray(r,3*t),f.fromArray(r,3*e),d.fromArray(r,3*n),p.fromArray(o,2*t),v.fromArray(o,2*e),m.fromArray(o,2*n),f.sub(h),d.sub(h),v.sub(p),m.sub(p);var i=1/(v.x*m.y-m.x*v.y);isFinite(i)&&(g.copy(f).multiplyScalar(m.y).addScaledVector(d,-v.y).multiplyScalar(i),y.copy(d).multiplyScalar(v.x).addScaledVector(f,-m.x).multiplyScalar(i),u[t].add(g),u[e].add(g),u[n].add(g),c[t].add(y),c[e].add(y),c[n].add(y))}function D(t){C.fromArray(i,3*t),M.copy(C);var e=u[t];O.copy(e),O.sub(C.multiplyScalar(C.dot(e))).normalize(),k.crossVectors(M,e);var n=k.dot(c[t])<0?-1:1;s[4*t]=O.x,s[4*t+1]=O.y,s[4*t+2]=O.z,s[4*t+3]=n}},computeVertexNormals:function(){var t=this.index,e=this.getAttribute("position");if(void 0!==e){var n=this.getAttribute("normal");if(void 0===n)n=new tn(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(var r=0,i=n.count;r<i;r++)n.setXYZ(r,0,0,0);var o=new kt,a=new kt,s=new kt,u=new kt,c=new kt,l=new kt,h=new kt,f=new kt;if(t)for(var d=0,p=t.count;d<p;d+=3){var v=t.getX(d+0),m=t.getX(d+1),g=t.getX(d+2);o.fromBufferAttribute(e,v),a.fromBufferAttribute(e,m),s.fromBufferAttribute(e,g),h.subVectors(s,a),f.subVectors(o,a),h.cross(f),u.fromBufferAttribute(n,v),c.fromBufferAttribute(n,m),l.fromBufferAttribute(n,g),u.add(h),c.add(h),l.add(h),n.setXYZ(v,u.x,u.y,u.z),n.setXYZ(m,c.x,c.y,c.z),n.setXYZ(g,l.x,l.y,l.z)}else for(var y=0,b=e.count;y<b;y+=3)o.fromBufferAttribute(e,y+0),a.fromBufferAttribute(e,y+1),s.fromBufferAttribute(e,y+2),h.subVectors(s,a),f.subVectors(o,a),h.cross(f),n.setXYZ(y+0,h.x,h.y,h.z),n.setXYZ(y+1,h.x,h.y,h.z),n.setXYZ(y+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==t.attributes[r])for(var i=n[r].array,o=t.attributes[r],a=o.array,s=o.itemSize*e,u=Math.min(a.length,i.length-s),c=0,l=s;c<u;c++,l++)i[l]=a[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)bn.fromBufferAttribute(t,e),bn.normalize(),t.setXYZ(e,bn.x,bn.y,bn.z)},toNonIndexed:function(){function t(t,e){for(var n=t.array,r=t.itemSize,i=t.normalized,o=new n.constructor(e.length*r),a=0,s=0,u=0,c=e.length;u<c;u++){a=e[u]*r;for(var l=0;l<r;l++)o[s++]=n[a++]}return new tn(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;var e=new _n,n=this.index.array,r=this.attributes;for(var i in r){var o=t(r[i],n);e.setAttribute(i,o)}var a=this.morphAttributes;for(var s in a){for(var u=[],c=a[s],l=0,h=c.length;l<h;l++){var f=t(c[l],n);u.push(f)}e.morphAttributes[s]=u}e.morphTargetsRelative=this.morphTargetsRelative;for(var d=this.groups,p=0,v=d.length;p<v;p++){var m=d[p];e.addGroup(m.start,m.count,m.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
2if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;null!==r&&(t.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var o in i){var a=i[o],s=a.toJSON(t.data);""!==a.name&&(s.name=a.name),t.data.attributes[o]=s}var u={},c=!1;for(var l in this.morphAttributes){for(var h=this.morphAttributes[l],f=[],d=0,p=h.length;d<p;d++){var v=h[d],m=v.toJSON(t.data);""!==v.name&&(m.name=v.name),f.push(m)}f.length>0&&(u[l]=f,c=!0)}c&&(t.data.morphAttributes=u,t.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(t.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(t.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),t},clone:function(){return(new _n).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var e={};this.name=t.name;var n=t.index;null!==n&&this.setIndex(n.clone(e));var r=t.attributes;for(var i in r){var o=r[i];this.setAttribute(i,o.clone(e))}var a=t.morphAttributes;for(var s in a){for(var u=[],c=a[s],l=0,h=c.length;l<h;l++)u.push(c[l].clone(e));this.morphAttributes[s]=u}this.morphTargetsRelative=t.morphTargetsRelative;for(var f=t.groups,d=0,p=f.length;d<p;d++){var v=f[d];this.addGroup(v.start,v.count,v.materialIndex)}var m=t.boundingBox;null!==m&&(this.boundingBox=m.clone());var g=t.boundingSphere;return null!==g&&(this.boundingSphere=g.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var wn=new ee,xn=new te,Tn=new Gt,En=new kt,Sn=new kt,On=new kt,kn=new kt,Cn=new kt,Mn=new kt,An=new kt,In=new kt,jn=new kt,Pn=new gt,Rn=new gt,Nn=new gt,Ln=new kt,Dn=new kt;function Fn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Je;Oe.call(this),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}function Un(t,e,n,r,i,o,a,s,u,c,l,h){En.fromBufferAttribute(i,c),Sn.fromBufferAttribute(i,l),On.fromBufferAttribute(i,h);var f=t.morphTargetInfluences;if(e.morphTargets&&o&&f){An.set(0,0,0),In.set(0,0,0),jn.set(0,0,0);for(var d=0,p=o.length;d<p;d++){var v=f[d],m=o[d];0!==v&&(kn.fromBufferAttribute(m,c),Cn.fromBufferAttribute(m,l),Mn.fromBufferAttribute(m,h),a?(An.addScaledVector(kn,v),In.addScaledVector(Cn,v),jn.addScaledVector(Mn,v)):(An.addScaledVector(kn.sub(En),v),In.addScaledVector(Cn.sub(Sn),v),jn.addScaledVector(Mn.sub(On),v)))}En.add(An),Sn.add(In),On.add(jn)}t.isSkinnedMesh&&e.skinning&&(t.boneTransform(c,En),t.boneTransform(l,Sn),t.boneTransform(h,On));
2var g=function(t,e,n,r,i,o,a,s){if(null===(1===e.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,e.side!==w,s)))return null;Dn.copy(s),Dn.applyMatrix4(t.matrixWorld);var u=n.ray.origin.distanceTo(Dn);return u<n.near||u>n.far?null:{distance:u,point:Dn.clone(),object:t}}(t,e,n,r,En,Sn,On,Ln);if(g){s&&(Pn.fromBufferAttribute(s,c),Rn.fromBufferAttribute(s,l),Nn.fromBufferAttribute(s,h),g.uv=Ve.getUV(Ln,En,Sn,On,Pn,Rn,Nn,new gt)),u&&(Pn.fromBufferAttribute(u,c),Rn.fromBufferAttribute(u,l),Nn.fromBufferAttribute(u,h),g.uv2=Ve.getUV(Ln,En,Sn,On,Pn,Rn,Nn,new gt));var y={a:c,b:l,c:h,normal:new kt,materialIndex:0};Ve.getNormal(En,Sn,On,y.normal),g.face=y}return g}Fn.prototype=Object.assign(Object.create(Oe.prototype),{constructor:Fn,isMesh:!0,copy:function(t){return Oe.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i<o;i++){var a=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=i}}}}else{var s=t.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),Tn.copy(r.boundingSphere),Tn.applyMatrix4(o),!1!==t.ray.intersectsSphere(Tn)&&(wn.copy(o).invert(),xn.copy(t.ray).applyMatrix4(wn),null===r.boundingBox||!1!==xn.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a=r.index,s=r.attributes.position,u=r.morphAttributes.position,c=r.morphTargetsRelative,l=r.attributes.uv,h=r.attributes.uv2,f=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(i))for(var p=0,v=f.length;p<v;p++)for(var m=f[p],g=i[m.materialIndex],y=Math.max(m.start,d.start),b=Math.min(m.start+m.count,d.start+d.count);y<b;y+=3){var _=a.getX(y),w=a.getX(y+1),x=a.getX(y+2);(n=Un(this,g,t,xn,s,u,c,l,h,_,w,x))&&(n.faceIndex=Math.floor(y/3),n.face.materialIndex=m.materialIndex,e.push(n))}else for(var T=Math.max(0,d.start),E=Math.min(a.count,d.start+d.count);T<E;T+=3){var S=a.getX(T),O=a.getX(T+1),k=a.getX(T+2);(n=Un(this,i,t,xn,s,u,c,l,h,S,O,k))&&(n.faceIndex=Math.floor(T/3),e.push(n))}else if(void 0!==s)if(Array.isArray(i))for(var C=0,M=f.length;C<M;C++)for(var A=f[C],I=i[A.materialIndex],j=Math.max(A.start,d.start),P=Math.min(A.start+A.count,d.start+d.count);j<P;j+=3){(n=Un(this,I,t,xn,s,u,c,l,h,j,j+1,j+2))&&(n.faceIndex=Math.floor(j/3),n.face.materialIndex=A.materialIndex,e.push(n))}else for(var R=Math.max(0,d.start),N=Math.min(s.count,d.start+d.count);R<N;R+=3){(n=Un(this,i,t,xn,s,u,c,l,h,R,R+1,R+2))&&(n.faceIndex=Math.floor(R/3),e.push(n))}}else r.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}});var Bn=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;Object(m.a)(this,n),(t=e.call(this)).type="BoxGeometry",t.parameters={width:r,height:i,depth:o,widthSegments:a,heightSegments:s,depthSegments:u};var c=Object(d.a)(t);a=Math.floor(a),s=Math.floor(s),u=Math.floor(u);var l=[],h=[],f=[],p=[],v=0,g=0;function y(t,e,n,r,i,o,a,s,u,d,m){for(var y=o/u,b=a/d,_=o/2,w=a/2,x=s/2,T=u+1,E=d+1,S=0,O=0,k=new kt,C=0;C<E;C++)for(var M=C*b-w,A=0;A<T;A++){var I=A*y-_;k[t]=I*r,k[e]=M*i,k[n]=x,h.push(k.x,k.y,k.z),k[t]=0,k[e]=0,k[n]=s>0?1:-1,f.push(k.x,k.y,k.z),p.push(A/u),p.push(1-C/d),S+=1}for(var j=0;j<d;j++)for(var P=0;P<u;P++){var R=v+P+T*j,N=v+P+T*(j+1),L=v+(P+1)+T*(j+1),D=v+(P+1)+T*j;l.push(R,N,D),l.push(N,L,D),O+=6}c.addGroup(g,O,m),g+=O,v+=S}return y("z","y","x",-1,-1,o,i,r,u,s,0),y("z","y","x",1,-1,o,i,-r,u,s,1),y("x","z","y",1,1,r,o,i,a,u,2),y("x","z","y",1,-1,r,o,-i,a,u,3),y("x","y","z",1,-1,r,i,o,a,s,4),y("x","y","z",-1,-1,r,i,-o,a,s,5),t.setIndex(l),t.setAttribute("position",new ln(h,3)),t.setAttribute("normal",new ln(f,3)),t.setAttribute("uv",new ln(p,2)),t}return n}(_n);function Vn(t){var e={};for(var n in t)for(var r in e[n]={},t[n]){var i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}return e}function zn(t){for(var e={},n=0;n<t.length;n++){var r=Vn(t[n]);for(var i in r)e[i]=r[i]}return e}var Hn={clone:Vn,merge:zn};function qn(t){He.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Wn(){Oe.call(this),this.type="Camera",this.matrixWorldInverse=new ee,this.projectionMatrix=new ee,this.projectionMatrixInverse=new ee}function Gn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;Wn.call(this),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}qn.prototype=Object.create(He.prototype),qn.prototype.constructor=qn,qn.prototype.isShaderMaterial=!0,qn.prototype.copy=function(t){return He.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Vn(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this},qn.prototype.toJSON=function(t){var e=He.prototype.toJSON.call(this,t);for(var n in e.glslVersion=this.glslVersion,e.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},Wn.prototype=Object.assign(Object.create(Oe.prototype),{constructor:Wn,isCamera:!0,copy:function(t,e){return Oe.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new kt),this.updateWorldMatrix(!0,!1);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Oe.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){Oe.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Gn.prototype=Object.assign(Object.create(Wn.prototype),{constructor:Gn,isPerspectiveCamera:!0,copy:function(t,e){return Wn.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*mt.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*mt.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t}
2,getEffectiveFOV:function(){return 2*mt.RAD2DEG*Math.atan(Math.tan(.5*mt.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*mt.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,e-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var u=this.filmOffset;0!==u&&(i+=t*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){var e=Oe.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});var Yn=90,Xn=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i){var o;if(Object(m.a)(this,n),(o=e.call(this)).type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter."),Object(l.a)(o);o.renderTarget=i;var a=new Gn(Yn,1,t,r);a.layers=o.layers,a.up.set(0,-1,0),a.lookAt(new kt(1,0,0)),o.add(a);var s=new Gn(Yn,1,t,r);s.layers=o.layers,s.up.set(0,-1,0),s.lookAt(new kt(-1,0,0)),o.add(s);var u=new Gn(Yn,1,t,r);u.layers=o.layers,u.up.set(0,0,1),u.lookAt(new kt(0,1,0)),o.add(u);var c=new Gn(Yn,1,t,r);c.layers=o.layers,c.up.set(0,0,-1),c.lookAt(new kt(0,-1,0)),o.add(c);var h=new Gn(Yn,1,t,r);h.layers=o.layers,h.up.set(0,-1,0),h.lookAt(new kt(0,0,1)),o.add(h);var f=new Gn(Yn,1,t,r);return f.layers=o.layers,f.up.set(0,-1,0),f.lookAt(new kt(0,0,-1)),o.add(f),o}return Object(g.a)(n,[{key:"update",value:function(t,e){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,r=Object(c.a)(this.children,6),i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],l=r[5],h=t.xr.enabled,f=t.getRenderTarget();t.xr.enabled=!1;var d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,o),t.setRenderTarget(n,2),t.render(e,a),t.setRenderTarget(n,3),t.render(e,s),t.setRenderTarget(n,4),t.render(e,u),n.texture.generateMipmaps=d,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(f),t.xr.enabled=h}}]),n}(Oe),Kn=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i,o,a,s,u,c,l,h){var f;return Object(m.a)(this,n),t=void 0!==t?t:[],r=void 0!==r?r:E,u=void 0!==u?u:H,(f=e.call(this,t,r,i,o,a,s,u,c,l,h))._needsFlipEnvMap=!0,f.flipY=!1,f}return Object(g.a)(n,[{key:"images",get:function(){return this.image},set:function(t){this.image=t}}]),n}(xt);Kn.prototype.isCubeTexture=!0;var Qn=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i){var o;return Object(m.a)(this,n),Number.isInteger(r)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),r=i),o=e.call(this,t,t,r),r=r||{},o.texture=new Kn(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),o.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,o.texture.minFilter=void 0!==r.minFilter?r.minFilter:R,o.texture._needsFlipEnvMap=!1,o}return Object(g.a)(n,[{key:"fromEquirectangularTexture",value:function(t,e){this.texture.type=e.type,this.texture.format=q,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new Bn(5,5,5),a=new qn({name:"CubemapFromEquirect",uniforms:Vn(n),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=e;var s=new Fn(o,a),u=e.minFilter;return e.minFilter===L&&(e.minFilter=R),new Xn(1,10,this).update(t,s),e.minFilter=u,s.geometry.dispose(),s.material.dispose(),this}},{key:"clear",value:function(t,e,n,r){for(var i=t.getRenderTarget(),o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,r);t.setRenderTarget(i)}}]),n}(St);
2Qn.prototype.isWebGLCubeRenderTarget=!0;var Jn=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i,o,a,s,u,c,l,h,f,d){var p;return Object(m.a)(this,n),(p=e.call(this,null,s,u,c,l,h,o,a,f,d)).image={data:t||null,width:r||1,height:i||1},p.magFilter=void 0!==l?l:I,p.minFilter=void 0!==h?h:I,p.generateMipmaps=!1,p.flipY=!1,p.unpackAlignment=1,p.needsUpdate=!0,p}return n}(xt);Jn.prototype.isDataTexture=!0;var Zn=new Gt,$n=new kt,tr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ae,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ae,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ae,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ae,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Ae,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new Ae;Object(m.a)(this,t),this.planes=[e,n,r,i,o,a]}return Object(g.a)(t,[{key:"set",value:function(t,e,n,r,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}},{key:"copy",value:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],c=n[6],l=n[7],h=n[8],f=n[9],d=n[10],p=n[11],v=n[12],m=n[13],g=n[14],y=n[15];return e[0].setComponents(a-r,l-s,p-h,y-v).normalize(),e[1].setComponents(a+r,l+s,p+h,y+v).normalize(),e[2].setComponents(a+i,l+u,p+f,y+m).normalize(),e[3].setComponents(a-i,l-u,p-f,y-m).normalize(),e[4].setComponents(a-o,l-c,p-d,y-g).normalize(),e[5].setComponents(a+o,l+c,p+d,y+g).normalize(),this}},{key:"intersectsObject",value:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Zn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Zn)}},{key:"intersectsSprite",value:function(t){return Zn.center.set(0,0,0),Zn.radius=.7071067811865476,Zn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Zn)}},{key:"intersectsSphere",value:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)<r)return!1}return!0}},{key:"intersectsBox",value:function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if($n.x=r.normal.x>0?t.max.x:t.min.x,$n.y=r.normal.y>0?t.max.y:t.min.y,$n.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint($n)<0)return!1}return!0}},{key:"containsPoint",value:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),t}();function er(){var t=null,e=!1,n=null,r=null;function i(e,o){n(e,o),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function nr(t,e){var n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){var o=r.get(e);(!o||o.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version})}else{e.isInterleavedBufferAttribute&&(e=e.data);var a=r.get(e);void 0===a?r.set(e,function(e,r){var i=e.array,o=e.usage,a=t.createBuffer();t.bindBuffer(r,a),t.bufferData(r,i,o),e.onUploadCallback();var s=5126;return i instanceof Float32Array?s=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?e.isFloat16BufferAttribute?n?s=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):s=5123:i instanceof Int16Array?s=5122:i instanceof Uint32Array?s=5125:i instanceof Int32Array?s=5124:i instanceof Int8Array?s=5120:i instanceof Uint8Array&&(s=5121),{buffer:a,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,i)):a.version<e.version&&(!function(e,r,i){var o=r.array,a=r.updateRange;t.bindBuffer(i,e),-1===a.count?t.bufferSubData(i,0,o):(n?t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(a.buffer,e,i),a.version=e.version)}}}}var rr=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object(m.a)(this,n),(t=e.call(this)).type="PlaneGeometry",t.parameters={width:r,height:i,widthSegments:o,heightSegments:a};for(var s=r/2,u=i/2,c=Math.floor(o),l=Math.floor(a),h=c+1,f=l+1,d=r/c,p=i/l,v=[],g=[],y=[],b=[],_=0;_<f;_++)for(var w=_*p-u,x=0;x<h;x++){var T=x*d-s;
2g.push(T,-w,0),y.push(0,0,1),b.push(x/c),b.push(1-_/l)}for(var E=0;E<l;E++)for(var S=0;S<c;S++){var O=S+h*E,k=S+h*(E+1),C=S+1+h*(E+1),M=S+1+h*E;v.push(O,k,M),v.push(k,C,M)}return t.setIndex(v),t.setAttribute("position",new ln(g,3)),t.setAttribute("normal",new ln(y,3)),t.setAttribute("uv",new ln(b,2)),t}return n}(_n),ir={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:
vendor: 7,835 bytes, line 2
2"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif"
2,bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection
vendor: 44,986 bytes, line 2
2;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"
2float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 25
25.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (
vendor: 6,225 bytes, line 2
2( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;
vendor: 45,385 bytes, line 2
2\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <transmissionmap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},
vendor: 590 bytes, line 2
2or={common:{diffuse:{value:new Qe(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new bt},uv2Transform:{value:new bt},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new gt(1,1)}}
2,displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Qe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Qe(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new bt}},sprite:{diffuse:{value:new Qe(15658734)},opacity:{value:1},center:{value:new gt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new bt}}},ar={basic:{uniforms:zn([or.common,or.specularmap,or.envmap,or.aomap,or.lightmap,or.fog]),vertexShader:ir.meshbasic_vert,fragmentShader:ir.meshbasic_frag},lambert:{uniforms:zn([or.common,or.specularmap,or.envmap,or.aomap,or.lightmap,or.emissivemap,or.fog,or.lights,{emissive:{value:new Qe(0)}}]),vertexShader:ir.meshlambert_vert,fragmentShader:ir.meshlambert_frag},phong:{uniforms:zn([or.common,or.specularmap,or.envmap,or.aomap,or.lightmap,or.emissivemap,or.bumpmap,or.normalmap,or.displacementmap,or.fog,or.lights,{emissive:{value:new Qe(0)},specular:{value:new Qe(1118481)},shininess:{value:30}}]),vertexShader:ir.meshphong_vert,fragmentShader:ir.meshphong_frag},standard:{uniforms:zn([or.common,or.envmap,or.aomap,or.lightmap,or.emissivemap,or.bumpmap,or.normalmap,or.displacementmap,or.roughnessmap,or.metalnessmap,or.fog,or.lights,{emissive:{value:new Qe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ir.meshphysical_vert,fragmentShader:ir.meshphysical_frag},toon:{uniforms:zn([or.common,or.aomap,or.lightmap,or.emissivemap,or.bumpmap,or.normalmap,or.displacementmap,or.gradientmap,or.fog,or.lights,{emissive:{value:new Qe(0)}}]),vertexShader:ir.meshtoon_vert,fragmentShader:ir.meshtoon_frag},matcap:{uniforms:zn([or.common,or.bumpmap,or.normalmap,or.displacementmap,or.fog,{matcap:{value:null}}]),vertexShader:ir.meshmatcap_vert,fragmentShader:ir.meshmatcap_frag},points:{uniforms:zn([or.points,or.fog]),vertexShader:ir.points_vert,fragmentShader:ir.points_frag},dashed:{uniforms:zn([or.common,or.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ir.linedashed_vert,fragmentShader:ir.linedashed_frag},depth:{uniforms:zn([or.common,or.displacementmap]),vertexShader:ir.depth_vert,fragmentShader:ir.depth_frag},normal:{uniforms:zn([or.common,or.bumpmap,or.normalmap,or.displacementmap,{opacity:{value:1}}]),vertexShader:ir.normal_vert,fragmentShader:ir.normal_frag},sprite:{uniforms:zn([or.sprite,or.fog]),vertexShader:ir.sprite_vert,fragmentShader:ir.sprite_frag},background:{uniforms:{uvTransform:{value:new bt},t2D:{value:null}},vertexShader:ir.background_vert,fragmentShader:ir.background_frag},cube:{uniforms:zn([or.envmap,{opacity:{value:1}}]),vertexShader:ir.cube_vert,fragmentShader:ir.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ir.equirect_vert,fragmentShader:ir.equirect_frag},distanceRGBA:{uniforms:zn([or.common,or.displacementmap,{referencePosition:{value:new kt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ir.distanceRGBA_vert,fragmentShader:ir.distanceRGBA_frag},shadow:{uniforms:zn([or.lights,or.fog,{color:{value:new Qe(0)},opacity:{value:1}}]),vertexShader:ir.shadow_vert,fragmentShader:ir.shadow_frag}};function sr(t,e,n,r,i){var o,a,s=new Qe(0),u=0,c=null,l=0,h=null;function f(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}return{getClearColor:function(){return s},setClearColor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;s.set(t),f(s,u=e)},getClearAlpha:function(){return u},setClearAlpha:function(t){f(s,u=t)},render:function(n,i,d,p){var v=!0===i.isScene?i.background:null;
2v&&v.isTexture&&(v=e.get(v));var m=t.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(v=null),null===v?f(s,u):v&&v.isColor&&(f(v,1),p=!0),(t.autoClear||p)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.isWebGLCubeRenderTarget||v.mapping===O)?(void 0===a&&((a=new Fn(new Bn(1,1,1),new qn({name:"BackgroundCubeMaterial",uniforms:Vn(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),v.isWebGLCubeRenderTarget&&(v=v.texture),a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,c===v&&l===v.version&&h===t.toneMapping||(a.material.needsUpdate=!0,c=v,l=v.version,h=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):v&&v.isTexture&&(void 0===o&&((o=new Fn(new rr(2,2),new qn({name:"BackgroundMaterial",uniforms:Vn(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:_,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=v,!0===v.matrixAutoUpdate&&v.updateMatrix(),o.material.uniforms.uvTransform.value.copy(v.matrix),c===v&&l===v.version&&h===t.toneMapping||(o.material.needsUpdate=!0,c=v,l=v.version,h=t.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function ur(t,e,n,r){var i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},u=f(null),c=u;function l(e){return r.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function f(t){for(var e=[],n=[],r=[],o=0;o<i;o++)e[o]=0,n[o]=0,r[o]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:r,object:t,attributes:{},index:null}}function d(){for(var t=c.newAttributes,e=0,n=t.length;e<n;e++)t[e]=0}function p(t){v(t,0)}function v(n,i){var o=c.newAttributes,a=c.enabledAttributes,s=c.attributeDivisors;(o[n]=1,0===a[n]&&(t.enableVertexAttribArray(n),a[n]=1),s[n]!==i)&&((r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i)}function m(){for(var e=c.newAttributes,n=c.enabledAttributes,r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0)}function g(e,n,i,o,a,s){!0!==r.isWebGL2||5124!==i&&5125!==i?t.vertexAttribPointer(e,n,i,o,a,s):t.vertexAttribIPointer(e,n,i,a,s)}function y(){b(),c!==u&&l((c=u).object)}function b(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:function(i,u,h,y,b){var _=!1;if(a){var w=function(e,n,i){var a=!0===i.wireframe,u=s[e.id];void 0===u&&(u={},s[e.id]=u);var c=u[n.id];void 0===c&&(c={},u[n.id]=c);var l=c[a];void 0===l&&(l=f(r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),c[a]=l);return l}(y,h,u);c!==w&&l((c=w).object),(_=function(t,e){var n=c.attributes,r=t.attributes,i=0;for(var o in r){var a=n[o],s=r[o];if(void 0===a)return!0;if(a.attribute!==s)return!0;if(a.data!==s.data)return!0;i++}return c.attributesNum!==i||c.index!==e}(y,b))&&function(t,e){var n={},r=t.attributes,i=0;for(var o in r){var a=r[o],s={};s.attribute=a,a.data&&(s.data=a.data),n[o]=s,i++}c.attributes=n,c.attributesNum=i,c.index=e}(y,b)}else{var x=!0===u.wireframe;c.geometry===y.id&&c.program===h.id&&c.wireframe===x||(c.geometry=y.id,c.program=h.id,c.wireframe=x,_=!0)}!0===i.isInstancedMesh&&(_=!0),null!==b&&n.update(b,34963),_&&(!function(i,o,a,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;d();var u=s.attributes,c=a.getAttributes(),l=o.defaultAttributeValues;for(var h in c){var f=c[h];if(f>=0){var y=u[h];if(void 0!==y){var b=y.normalized,_=y.itemSize,w=n.get(y);if(void 0===w)continue;var x=w.buffer,T=w.type,E=w.bytesPerElement;if(y.isInterleavedBufferAttribute){var S=y.data,O=S.stride,k=y.offset;S&&S.isInstancedInterleavedBuffer?(v(f,S.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=S.meshPerAttribute*S.count)):p(f),t.bindBuffer(34962,x),g(f,_,T,b,O*E,k*E)}else y.isInstancedBufferAttribute?(v(f,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):p(f),t.bindBuffer(34962,x),g(f,_,T,b,0,0)}else if("instanceMatrix"===h){var C=n.get(i.instanceMatrix);if(void 0===C)continue;var M=C.buffer,A=C.type;v(f+0,1),v(f+1,1),v(f+2,1),v(f+3,1),t.bindBuffer(34962,M),t.vertexAttribPointer(f+0,4,A,!1,64,0),t.vertexAttribPointer(f+1,4,A,!1,64,16),t.vertexAttribPointer(f+2,4,A,!1,64,32),t.vertexAttribPointer(f+3,4,A,!1,64,48)}else if("instanceColor"===h){var I=n.get(i.instanceColor);if(void 0===I)continue;var j=I.buffer,P=I.type;v(f,1),t.bindBuffer(34962,j),t.vertexAttribPointer(f,3,P,!1,12,0)}else if(void 0!==l){var R=l[h];if(void 0!==R)switch(R.length){case 2:t.vertexAttrib2fv(f,R);break;case 3:t.vertexAttrib3fv(f,R);break;case 4:t.vertexAttrib4fv(f,R);break;default:t.vertexAttrib1fv(f,R)}}}}m()}(i,u,h,y),null!==b&&t.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){for(var t in y(),s){var e=s[t];for(var n in e){var r=e[n];for(var i in r)h(r[i].object),delete r[i];delete e[n]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0!==s[t.id]){var e=s[t.id];for(var n in e){var r=e[n];for(var i in r)h(r[i].object),delete r[i];delete e[n]}delete s[t.id]}},releaseStatesOfProgram:function(t){for(var e in s){var n=s[e];if(void 0!==n[t.id]){var r=n[t.id];for(var i in r)h(r[i].object),delete r[i];delete n[t.id]}}},initAttributes:d,enableAttribute:p,disableUnusedAttributes:m}}function cr(t,e,n,r){var i,o=r.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i,1)},this.renderInstances=function(r,a,s){if(0!==s){var u,c;if(o)u=t,c="drawArraysInstanced";
2else if(c="drawArraysInstancedANGLE",null===(u=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](i,r,a,s),n.update(a,i,s)}}}function lr(t,e,n){var r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),l=t.getParameter(35660),h=t.getParameter(3379),f=t.getParameter(34076),d=t.getParameter(34921),p=t.getParameter(36347),v=t.getParameter(36348),m=t.getParameter(36349),g=l>0,y=o||e.has("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){var n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:f,maxAttributes:d,maxVertexUniforms:p,maxVaryings:v,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:o?t.getParameter(36183):0}}function hr(t){var e=this,n=null,r=0,i=!1,o=!1,a=new Ae,s=new bt,u={value:null,needsUpdate:!1};function c(){u.value!==n&&(u.value=n,u.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function l(t,n,r,i){var o=null!==t?t.length:0,c=null;if(0!==o){if(c=u.value,!0!==i||null===c){var l=r+4*o,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===c||c.length<l)&&(c=new Float32Array(l));for(var f=0,d=r;f!==o;++f,d+=4)a.copy(t[f]).applyMatrix4(h,s),a.normal.toArray(c,d),c[d+3]=a.constant}u.value=c,u.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,c}this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,o){var a=0!==t.length||e||0!==r||i;return i=e,n=l(t,o,0),r=t.length,a},this.beginShadows=function(){o=!0,l(null)},this.endShadows=function(){o=!1,c()},this.setState=function(e,a,s){var h=e.clippingPlanes,f=e.clipIntersection,d=e.clipShadows,p=t.get(e);if(!i||null===h||0===h.length||o&&!d)o?l(null):c();else{var v=o?0:r,m=4*v,g=p.clippingState||null;u.value=g,g=l(h,a,m,s);for(var y=0;y!==m;++y)g[y]=n[y];p.clippingState=g,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=v}}}function fr(t){var e=new WeakMap;function n(t,e){return 303===e?t.mapping=E:304===e&&(t.mapping=S),t}function r(t){var n=t.target;n.removeEventListener("dispose",r);var i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){var o=i.mapping;if(303===o||304===o){if(e.has(i))return n(e.get(i).texture,i.mapping);var a=i.image;if(a&&a.height>0){var s=t.getRenderTarget(),u=new Qn(a.height/2);return u.fromEquirectangularTexture(t,i),e.set(i,u),t.setRenderTarget(s),i.addEventListener("dispose",r),n(u.texture,i.mapping)}return null}}return i},dispose:function(){e=new WeakMap}}}function dr(t){var e={};
2function n(n){if(void 0!==e[n])return e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,r}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(t){var e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function pr(t,e,n,r){var i={},o=new WeakMap;function a(t){var s=t.target;for(var u in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[u]);s.removeEventListener("dispose",a),delete i[s.id];var c=o.get(s);c&&(e.remove(c),o.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){var n=[],r=t.index,i=t.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var u=0,c=s.length;u<c;u+=3){var l=s[u+0],h=s[u+1],f=s[u+2];n.push(l,h,h,f,f,l)}}else{var d=i.array;a=i.version;for(var p=0,v=d.length/3-1;p<v;p+=3){var m=p+0,g=p+1,y=p+2;n.push(m,g,g,y,y,m)}}var b=new(fn(n)>65535?un:an)(n,1);b.version=a;var _=o.get(t);_&&e.remove(_),o.set(t,b)}return{get:function(t,e){return!0===i[e.id]||(e.addEventListener("dispose",a),i[e.id]=!0,n.memory.geometries++),e},update:function(t){var n=t.attributes;for(var r in n)e.update(n[r],34962);var i=t.morphAttributes;for(var o in i)for(var a=i[o],s=0,u=a.length;s<u;s++)e.update(a[s],34962)},getWireframeAttribute:function(t){var e=o.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&s(t)}else s(t);return o.get(t)}}}function vr(t,e,n,r){var i,o,a,s=r.isWebGL2;this.setMode=function(t){i=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,r){t.drawElements(i,r,o,e*a),n.update(r,i,1)},this.renderInstances=function(r,u,c){if(0!==c){var l,h;if(s)l=t,h="drawElementsInstanced";else if(h="drawElementsInstancedANGLE",null===(l=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](i,u,o,r*a,c),n.update(u,i,c)}}}function mr(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,r){switch(e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function gr(t,e){return t[0]-e[0]}function yr(t,e){return Math.abs(e[1])-Math.abs(t[1])}function br(t){for(var e={},n=new Float32Array(8),r=[],i=0;i<8;i++)r[i]=[i,0];return{update:function(i,o,a,s){var u=i.morphTargetInfluences,c=void 0===u?0:u.length,l=e[o.id];if(void 0===l){l=[];for(var h=0;h<c;h++)l[h]=[h,0];e[o.id]=l}for(var f=0;f<c;f++){var d=l[f];d[0]=f,d[1]=u[f]}l.sort(yr);for(var p=0;p<8;p++)p<c&&l[p][1]?(r[p][0]=l[p][0],r[p][1]=l[p][1]):(r[p][0]=Number.MAX_SAFE_INTEGER,r[p][1]=0);r.sort(gr);for(var v=a.morphTargets&&o.morphAttributes.position,m=a.morphNormals&&o.morphAttributes.normal,g=0,y=0;y<8;y++){var b=r[y],_=b[0],w=b[1];_!==Number.MAX_SAFE_INTEGER&&w?(v&&o.getAttribute("morphTarget"+y)!==v[_]&&o.setAttribute("morphTarget"+y,v[_]),m&&o.getAttribute("morphNormal"+y)!==m[_]&&o.setAttribute("morphNormal"+y,m[_]),n[y]=w,g+=w):(v&&!0===o.hasAttribute("morphTarget"+y)&&o.deleteAttribute("morphTarget"+y),m&&!0===o.hasAttribute("morphNormal"+y)&&o.deleteAttribute("morphNormal"+y),n[y]=0)}var x=o.morphTargetsRelative?1:1-g;s.getUniforms().setValue(t,"morphTargetBaseInfluence",x),s.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function _r(t,e,n,r){var i=new WeakMap;function o(t){var e=t.target;e.removeEventListener("dispose",o),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(t){var a=r.render.frame,s=t.geometry,u=e.get(t,s);return i.get(u)!==a&&(e.update(u),i.set(u,a)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",o)&&t.addEventListener("dispose",o),n.update(t.instanceMatrix,34962),null!==t.instanceColor&&n.update(t.instanceColor,34962)),u},dispose:function(){i=new WeakMap}}}ar.physical={uniforms:zn([ar.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new gt(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Qe(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:ir.meshphysical_vert,fragmentShader:ir.meshphysical_frag};var wr=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(m.a)(this,n),(t=e.call(this,null)).image={data:r,width:i,height:o,depth:a},t.magFilter=I,t.minFilter=I,t.wrapR=M,t.generateMipmaps=!1,t.flipY=!1,t.needsUpdate=!0,t}return n}(xt);wr.prototype.isDataTexture2DArray=!0;var xr=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(m.a)(this,n),(t=e.call(this,null)).image={data:r,width:i,height:o,depth:a},t.magFilter=I,t.minFilter=I,t.wrapR=M,t.generateMipmaps=!1,t.flipY=!1,t.needsUpdate=!0,t}return n}(xt);xr.prototype.isDataTexture3D=!0;var Tr=new xt,Er=new wr,Sr=new xr,Or=new Kn,kr=[],Cr=[],Mr=new Float32Array(16),Ar=new Float32Array(9),Ir=new Float32Array(4);function jr(t,e,n){var r=t[0];if(r<=0||r>0)return t;var i=e*n,o=kr[i];if(void 0===o&&(o=new Float32Array(i),kr[i]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Pr(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Rr(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function Nr(t,e){var n=Cr[e];void 0===n&&(n=new Int32Array(e),Cr[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Lr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Dr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Pr(n,e))return;t.uniform2fv(this.addr,e),Rr(n,e)}}function Fr(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Pr(n,e))return;t.uniform3fv(this.addr,e),Rr(n,e)}}function Ur(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Pr(n,e))return;t.uniform4fv(this.addr,e),Rr(n,e)}}function Br(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(Pr(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Rr(n,e)}else{if(Pr(n,r))return;Ir.set(r),t.uniformMatrix2fv(this.addr,!1,Ir),Rr(n,r)}}function Vr(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(Pr(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Rr(n,e)}else{if(Pr(n,r))return;Ar.set(r),t.uniformMatrix3fv(this.addr,!1,Ar),Rr(n,r)}}function zr(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(Pr(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Rr(n,e)}else{if(Pr(n,r))return;Mr.set(r),t.uniformMatrix4fv(this.addr,!1,Mr),Rr(n,r)}}function Hr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||Tr,i)}function qr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||Er,i)}function Wr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||Sr,i)}function Gr(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(e||Or,i)}function Yr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Xr(t,e){var n=this.cache;Pr(n,e)||(t.uniform2iv(this.addr,e),Rr(n,e))}function Kr(t,e){var n=this.cache;Pr(n,e)||(t.uniform3iv(this.addr,e),Rr(n,e))}function Qr(t,e){var n=this.cache;Pr(n,e)||(t.uniform4iv(this.addr,e),Rr(n,e))}function Jr(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Zr(t,e){t.uniform1fv(this.addr,e)}function $r(t,e){t.uniform1iv(this.addr,e)}function ti(t,e){t.uniform2iv(this.addr,e)}function ei(t,e){t.uniform3iv(this.addr,e)}function ni(t,e){t.uniform4iv(this.addr,e)}function ri(t,e){var n=jr(e,this.size,2);t.uniform2fv(this.addr,n)}function ii(t,e){var n=jr(e,this.size,3);t.uniform3fv(this.addr,n)}function oi(t,e){var n=jr(e,this.size,4);t.uniform4fv(this.addr,n)}function ai(t,e){var n=jr(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function si(t,e){var n=jr(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ui(t,e){var n=jr(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function ci(t,e,n){var r=e.length,i=Nr(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTexture2D(e[o]||Tr,i[o])}function li(t,e,n){var r=e.length,i=Nr(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTextureCube(e[o]||Or,i[o])}function hi(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Lr;case 35664:return Dr;case 35665:return Fr;case 35666:return Ur;case 35674:return Br;case 35675:return Vr;case 35676:return zr;case 5124:case 35670:return Yr;case 35667:case 35671:return Xr;case 35668:case 35672:return Kr;case 35669:case 35673:return Qr;case 5125:return Jr;case 35678:case 36198:case 36298:case 36306:case 35682:return Hr;case 35679:case 36299:case 36307:return Wr;case 35680:case 36300:case 36308:case 36293:return Gr;case 36289:case 36303:case 36311:case 36292:return qr}}(e.type)}function fi(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Zr;case 35664:return ri;case 35665:return ii;case 35666:return oi;case 35674:return ai;case 35675:return si;case 35676:return ui;case 5124:case 35670:return $r;case 35667:case 35671:return ti;case 35668:case 35672:return ei;case 35669:case 35673:return ni;case 35678:case 36198:case 36298:case 36306:case 35682:return ci;case 35680:case 36300:case 36308:case 36293:return li}}(e.type)}function di(t){this.id=t,this.seq=[],this.map={}}fi.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Rr(e,t)},di.prototype.setValue=function(t,e,n){for(var r=this.seq,i=0,o=r.length;i!==o;++i){var a=r[i];a.setValue(t,e[a.id],n)}};var pi=/(\w+)(\])?(\[|\.)?/g;function vi(t,e){t.seq.push(e),t.map[e.id]=e}function mi(t,e,n){var r=t.name,i=r.length;for(pi.lastIndex=0;;){var o=pi.exec(r),a=pi.lastIndex,s=o[1],u="]"===o[2],c=o[3];if(u&&(s|=0),void 0===c||"["===c&&a+2===i){vi(n,void 0===c?new hi(s,t,e):new fi(s,t,e));break}var l=n.map[s];void 0===l&&vi(n,l=new di(s)),n=l}}function gi(t,e){this.seq=[],this.map={};
2for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var i=t.getActiveUniform(e,r);mi(i,t.getUniformLocation(e,i.name),this)}}function yi(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}gi.prototype.setValue=function(t,e,n,r){var i=this.map[e];void 0!==i&&i.setValue(t,n,r)},gi.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},gi.upload=function(t,e,n,r){for(var i=0,o=e.length;i!==o;++i){var a=e[i],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,r)}},gi.seqWithValue=function(t,e){for(var n=[],r=0,i=t.length;r!==i;++r){var o=t[r];o.id in e&&n.push(o)}return n};var bi=0;function _i(t){switch(t){case rt:return["Linear","( value )"];case it:return["sRGB","( value )"];case at:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case ot:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function wi(t,e,n){var r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(t.getShaderSource(e))}function xi(t,e){var n=_i(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Ti(t,e){var n=_i(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Ei(t,e){var n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Si(t){return""!==t}function Oi(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function ki(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var Ci=/^[ \t]*#include +<([\w\d./]+)>/gm;function Mi(t){return t.replace(Ci,Ai)}function Ai(t,e){var n=ir[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Mi(n)}var Ii=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ji=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Pi(t){return t.replace(ji,Ni).replace(Ii,Ri)}function Ri(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ni(t,e,n,r)}function Ni(t,e,n,r){for(var i="",o=parseInt(e);o<parseInt(n);o++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function Li(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Di(t,e,n,r){var i,o,a=t.getContext(),s=n.defines,u=n.vertexShader,c=n.fragmentShader,l=function(t){var e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),h=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case E:case S:e="ENVMAP_TYPE_CUBE";break;case O:case k:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),f=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case S:case k:e="ENVMAP_MODE_REFRACTION"}return e}(n),d=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),p=t.gammaFactor>
vendor: 5,057 bytes, line 2
20?t.gammaFactor:1,v=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Si).join("\n")}(n),m=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(s),g=a.createProgram(),y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[m].filter(Si).join("\n")).length>0&&(i+="\n"),(o=[v,m].filter(Si).join("\n")).length>0&&(o+="\n")):(i=[Li(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Si).join("\n"),o=[v,Li(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.envMap?"#define "+f:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alph
2aMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?ir.tonemapping_pars_fragment:"",0!==n.toneMapping?Ei("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",ir.encodings_pars_fragment,n.map?xi("mapTexelToLinear",n.mapEncoding):"",n.matcap?xi("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?xi("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?xi("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?xi("lightMapTexelToLinear",n.lightMapEncoding):"",Ti("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Si).join("\n")),u=ki(u=Oi(u=Mi(u),n),n),c=ki(c=Oi(c=Mi(c),n),n),u=Pi(u),c=Pi(c),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in",n.glslVersion===ht?"":"out highp vec4 pc_fragColor;",n.glslVersion===ht?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var b,_,w=y+o+c,x=yi(a,35633,y+i+u),T=yi(a,35632,w);if(a.attachShader(g,x),a.attachShader(g,T),void 0!==n.index0AttributeName?a.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(g,0,"position"),a.linkProgram(g),t.debug.checkShaderErrors){var C=a.getProgramInfoLog(g).trim(),M=a.getShaderInfoLog(x).trim(),A=a.getShaderInfoLog(T).trim(),I=!0,j=!0;if(!1===a.getProgramParameter(g,35714)){I=!1;var P=wi(a,x,"vertex"),R=wi(a,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(g,35715),"gl.getProgramInfoLog",C,P,R)}else""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==M&&""!==A||(j=!1);j&&(this.diagnostics={runnable:I,programLog:C,vertexShader:{log:M,prefix:i},fragmentShader:{log:A,prefix:o}})}return a.deleteShader(x),a.deleteShader(T),this.getUniforms=function(){return void 0===b&&(b=new gi(a,g)),b},this.getAttributes=function(){return void 0===_&&(_=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i<r;i++){var o=t.getActiveAttrib(e,i).name;n[o]=t.getAttribLocation(e,o)}return n}(a,g)),_},this.destroy=function(){r.releaseStatesOfProgram(this),a.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=bi++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=x,this.fragmentShader=T,this}function Fi(t,e,n,r,i,o){var a=[],s=r.isWebGL2,u=r.logarithmicDepthBuffer,c=r.floatVertexTextures,l=r.maxVertexUniforms,h=r.vertexTextures,f=r.precision,d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];function v(t){var e;return t&&t.isTexture?e=t.encoding:t&&t.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=rt,e}return{getParameters:function(i,a,p,m,g){var y,b,_=m.fog,x=i.isMeshStandardMaterial?m.environment:null,T=e.get(i.envMap||x),E=d[i.type],S=g.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(c)return 1024;var n=l,r=Math.floor((n-20)/4),i=Math.min(r,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}(g):0;if(null!==i.precision&&(f=r.getMaxPrecision(i.precision))!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",f,"instead."),E){var C=ar[E];y=C.vertexShader,b=C.fragmentShader}else y=i.vertexShader,b=i.fragmentShader;var M=t.getRenderTarget();return{isWebGL2:s,shaderID:E,shaderName:i.type,vertexShader:y,fragmentShader:b,defines:i.defines,isRawShaderMaterial:!0===i.isRawShaderMaterial,glslVersion:i.glslVersion,precision:f,instancing:!0===g.isInstancedMesh,instancingColor:!0===g.isInstancedMesh&&null!==g.instanceColor,supportsVertexTextures:h,outputEncoding:null!==M?v(M.texture):t.outputEncoding,map:!!i.map,mapEncoding:v(i.map),matcap:!!i.matcap,matc
2apEncoding:v(i.matcap),envMap:!!T,envMapMode:T&&T.mapping,envMapEncoding:v(T),envMapCubeUV:!!T&&(T.mapping===O||T.mapping===k),lightMap:!!i.lightMap,lightMapEncoding:v(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:v(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:1===i.normalMapType,tangentSpaceNormalMap:i.normalMapType===st,clearcoatMap:!!i.clearcoatMap,clearcoatRoughnessMap:!!i.clearcoatRoughnessMap,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,transmissionMap:!!i.transmissionMap,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexUvs:!!i.map||!!i.bumpMap||!!i.normalMap||!!i.specularMap||!!i.alphaMap||!!i.emissiveMap||!!i.roughnessMap||!!i.metalnessMap||!!i.clearcoatMap||!!i.clearcoatRoughnessMap||!!i.clearcoatNormalMap||!!i.displacementMap||!!i.transmissionMap,uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||i.transmissionMap)&&!!i.displacementMap,fog:!!_,useFog:i.fog,fogExp2:_&&_.isFogExp2,flatShading:!!i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:u,skinning:i.skinning&&S>0,maxBones:S,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:t.shadowMap.enabled&&p.length>0,shadowMapType:t.shadowMap.type,toneMapping:i.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===w,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);if(!1===e.isRawShaderMaterial){for(var i=0;i<p.length;i++)n.push(e[p[i]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){var e,n=d[t.type];if(n){var r=ar[n];e=Hn.clone(r.uniforms)}else e=t.uniforms;return e},acquireProgram:function(e,n){for(var r,o=0,s=a.length;o<s;o++){var u=a[o];if(u.cacheKey===n){++(r=u).usedTimes;break}}return void 0===r&&(r=new Di(t,n,e,i),a.push(r)),r},releaseProgram:function(t){if(0===--t.usedTimes){var e=a.indexOf(t);a[e]=a[a.length-1],a.pop(),t.destroy()}},programs:a}}function Ui(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}}function Bi(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Vi(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function zi(t){var e=[],n=0,r=[],i=[],o={id:-1};function a(r,i,a,s,u,c){var l=e[n],h=t.get(a);
2return void 0===l?(l={id:r.id,object:r,geometry:i,material:a,program:h.program||o,groupOrder:s,renderOrder:r.renderOrder,z:u,group:c},e[n]=l):(l.id=r.id,l.object=r,l.geometry=i,l.material=a,l.program=h.program||o,l.groupOrder=s,l.renderOrder=r.renderOrder,l.z=u,l.group=c),n++,l}return{opaque:r,transparent:i,init:function(){n=0,r.length=0,i.length=0},push:function(t,e,n,o,s,u){var c=a(t,e,n,o,s,u);(!0===n.transparent?i:r).push(c)},unshift:function(t,e,n,o,s,u){var c=a(t,e,n,o,s,u);(!0===n.transparent?i:r).unshift(c)},finish:function(){for(var t=n,r=e.length;t<r;t++){var i=e[t];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(t,e){r.length>1&&r.sort(t||Bi),i.length>1&&i.sort(e||Vi)}}}function Hi(t){var e=new WeakMap;return{get:function(n,r){var i;return!1===e.has(n)?(i=new zi(t),e.set(n,[i])):r>=e.get(n).length?(i=new zi(t),e.get(n).push(i)):i=e.get(n)[r],i},dispose:function(){e=new WeakMap}}}function qi(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new kt,color:new Qe};break;case"SpotLight":n={position:new kt,direction:new kt,color:new Qe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new kt,color:new Qe,distance:0,decay:0};break;case"HemisphereLight":n={direction:new kt,skyColor:new Qe,groundColor:new Qe};break;case"RectAreaLight":n={color:new Qe,position:new kt,halfWidth:new kt,halfHeight:new kt}}return t[e.id]=n,n}}}var Wi=0;function Gi(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Yi(t,e){for(var n=new qi,r=function(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new gt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)i.probe.push(new kt);var a=new kt,s=new ee,u=new ee;return{setup:function(o){for(var a=0,s=0,u=0,c=0;c<9;c++)i.probe[c].set(0,0,0);var l=0,h=0,f=0,d=0,p=0,v=0,m=0,g=0;o.sort(Gi);for(var y=0,b=o.length;y<b;y++){var _=o[y],w=_.color,x=_.intensity,T=_.distance,E=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)a+=w.r*x,s+=w.g*x,u+=w.b*x;else if(_.isLightProbe)for(var S=0;S<9;S++)i.probe[S].addScaledVector(_.sh.coefficients[S],x);else if(_.isDirectionalLight){var O=n.get(_);if(O.color.copy(_.color).multiplyScalar(_.intensity),_.castShadow){var k=_.shadow,C=r.get(_);C.shadowBias=k.bias,C.shadowNormalBias=k.normalBias,C.shadowRadius=k.radius,C.shadowMapSize=k.mapSize,i.directionalShadow[l]=C,i.directionalShadowMap[l]=E,i.directionalShadowMatrix[l]=_.shadow.matrix,v++}i.directional[l]=O,l++}else if(_.isSpotLight){var M=n.get(_);if(M.position.setFromMatrixPosition(_.matrixWorld),M.color.copy(w).multiplyScalar(x),M.distance=T,M.coneCos=Math.cos(_.angle),M.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),M.decay=_.decay,_.castShadow){var A=_.shadow,I=r.get(_);I.shadowBias=A.bias,I.shadowNormalBias=A.normalBias,I.shadowRadius=A.radius,I.shadowMapSize=A.mapSize,i.spotShadow[f]=I,i.spotShadowMap[f]=E,i.spotShadowMatrix[f]=_.shadow.matrix,g++}i.spot[f]=M,f++}else if(_.isRectAreaLight){var j=n.get(_);j.color.copy(w).multiplyScalar(x),j.halfWidth.set(.5*_.width,0,0),j.halfHeight.set(0,.5*_.height,0),i.rectArea[d]=j,d++}else if(_.isPointLight){var P=n.get(_);if(P.color.copy(_.color).multiplyScalar(_.intensity),P.distance=_.distance,P.decay=_.decay,_.castShadow){var R=_.shadow,N=r.get(_);N.shadowBias=R.bias,N.shadowNormalBias=R.normalBias,N.shadowRadius=R.radius,N.shadowMapSize=R.mapSize,N.shadowCameraNear=R.camera.near,N.shadowCameraFar=R.camera.far,i.pointShadow[h]=N,i.pointShadowMap[h]=E,i.pointShadowMatrix[h]=_.shadow.matrix,m++}i.point[h]=P,h++}else if(_.isHemisphereLight){var L=n.get(_);L.skyColor.copy(_.color).multiplyScalar(x),L.groundColor.copy(_.groundColor).multiplyScalar(x),i.hemi[p]=L,p++}}d>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=or.LTC_FLOAT_1,i.rectAreaLTC2=or.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=or.LTC_HALF_1,i.rectAreaLTC2=or.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=u;var D=i.hash;D.directionalLength===l&&D.pointLength===h&&D.spotLength===f&&D.rectAreaLength===d&&D.hemiLength===p&&D.numDirectionalShadows===v&&D.numPointShadows===m&&D.numSpotShadows===g||(i.directional.length=l,i.spot.length=f,i.rectArea.length=d,i.point.length=h,i.hemi.length=p,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,D.directionalLength=l,D.pointLength=h,D.spotLength=f,D.rectAreaLength=d,D.hemiLength=p,D.numDirectionalShadows=v,D.numPointShadows=m,D.numSpotShadows=g,i.version=Wi++)},setupView:function(t,e){for(var n=0,r=0,o=0,c=0,l=0,h=e.matrixWorldInverse,f=0,d=t.length;f<d;f++){var p=t[f];if(p.isDirectionalLight){var v=i.directional[n];v.direction.setFromMatrixPosition(p.matrixWorld),a.setFromMatrixPosition(p.target.matrixWorld),v.direction.sub(a),v.direction.transformDirection(h),n++}else if(p.isSpotLight){var m=i.spot[o];m.position.setFromMatrixPosition(p.matrixWorld),m.position.applyMatrix4(h),m.direction.setFromMatrixPosition(p.matrixWorld),a.setFromMatrixPosition(p.target.matrixWorld),m.direction.sub(a),m.direction.transformDirection(h),o++}else if(p.isRectAreaLight){var g=i.rectArea[c];g.position.setFromMatrixPosition(p.matrixWorld),g.position.applyMatrix4(h),u.identity(),s.copy(p.matrixWorld),s.premultiply(h),u.extractRotation(s),g.halfWidth.set(.5*p.width,0,0),g.halfHeight.set(0,.5*p.height,0),g.halfWidth.applyMatrix4(u),g.halfHeight.applyMatrix4(u),c++}else if(p.isPointLight){var y=i.point[r];y.position.setFromMatrixPosition(p.matrixWorld),y.position.applyMatrix4(h),r++}else if(p.isHemisphereLight){var b=i.hemi[l];b.direction.setFromMatrixPosition(p.matrixWorld),b.direction.transformDirection(h),b.direction.normalize(),l++}}},state:i}}function Xi(t,e){var n=new Yi(t,e),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(){n.setup(r)},setupLightsView:function(t){n.setupView(r,t)},pushLight:function(t){r.push(t)},pushShadow:function(t){i.push(t)}}}function Ki(t,e){var n=new WeakMap;return{get:function(r){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!1===n.has(r)?(i=new Xi(t,e),n.set(r,[i])):o>=n.get(r).length?(i=new Xi(t,e),n.get(r).push(i)):i=n.get(r)[o],i},dispose:function(){n=new WeakMap}}}var Qi=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="MeshDepthMaterial",r.depthPacking=3200,r.skinning=!1,r.morphTargets=!1,r.map=null,r.alphaMap=null,r.dis
2placementMap=null,r.displacementScale=1,r.displacementBias=0,r.wireframe=!1,r.wireframeLinewidth=1,r.fog=!1,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}]),n}(He);Qi.prototype.isMeshDepthMaterial=!0;var Ji=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="MeshDistanceMaterial",r.referencePosition=new kt,r.nearDistance=1,r.farDistance=1e3,r.skinning=!1,r.morphTargets=!1,r.map=null,r.alphaMap=null,r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.fog=!1,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}]),n}(He);Ji.prototype.isMeshDistanceMaterial=!0;function Zi(t,e,n){var r=new tr,i=new gt,o=new gt,a=new Et,s=[],u=[],c={},l={0:1,1:_,2:w},h=new qn({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new gt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=h.clone();f.defines.HORIZONTAL_PASS=1;var d=new _n;d.setAttribute("position",new tn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var p=new Fn(d,h),v=this;function m(n,r){var i=e.update(p);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,h,p,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,f,p,null)}function g(t,e,n){var r=t<<0|e<<1|n<<2,i=s[r];return void 0===i&&(i=new Qi({depthPacking:3201,morphTargets:t,skinning:e}),s[r]=i),i}function y(t,e,n){var r=t<<0|e<<1|n<<2,i=u[r];return void 0===i&&(i=new Ji({morphTargets:t,skinning:e}),u[r]=i),i}function b(e,n,r,i,o,a,s){var u=null,h=g,f=e.customDepthMaterial;if(!0===i.isPointLight&&(h=y,f=e.customDistanceMaterial),void 0===f){var d=!1;!0===r.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var p=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?p=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),u=h(d,p,!0===e.isInstancedMesh)}else u=f;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var v=u.uuid,m=r.uuid,b=c[v];void 0===b&&(b={},c[v]=b);var _=b[m];void 0===_&&(_=u.clone(),b[m]=_),u=_}return u.visible=r.visible,u.wireframe=r.wireframe,u.side=3===s?
2null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:l[r.side],u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function x(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var u=e.update(n),c=n.material;if(Array.isArray(c))for(var l=u.groups,h=0,f=l.length;h<f;h++){var d=l[h],p=c[d.materialIndex];if(p&&p.visible){var v=b(n,u,p,a,o.near,o.far,s);t.renderBufferDirect(o,null,u,v,n,d)}}else if(c.visible){var m=b(n,u,c,a,o.near,o.far,s);t.renderBufferDirect(o,null,u,m,n,null)}}for(var g=n.children,y=0,_=g.length;y<_;y++)x(g[y],i,o,a,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,s,u){if(!1!==v.enabled&&(!1!==v.autoUpdate||!1!==v.needsUpdate)&&0!==e.length){var c=t.getRenderTarget(),l=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),f=t.state;f.setBlending(0),f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);for(var d=0,p=e.length;d<p;d++){var g=e[d],y=g.shadow;if(void 0!==y){if(!1!==y.autoUpdate||!1!==y.needsUpdate){i.copy(y.mapSize);var b=y.getFrameExtents();if(i.multiply(b),o.copy(y.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/b.x),i.x=o.x*b.x,y.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/b.y),i.y=o.y*b.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var _={minFilter:R,magFilter:R,format:q};y.map=new St(i.x,i.y,_),y.map.texture.name=g.name+".shadowMap",y.mapPass=new St(i.x,i.y,_),y.camera.updateProjectionMatrix()}if(null===y.map){var w={minFilter:I,magFilter:I,format:q};y.map=new St(i.x,i.y,w),y.map.texture.name=g.name+".shadowMap",y.camera.updateProjectionMatrix()}
2t.setRenderTarget(y.map),t.clear();for(var T=y.getViewportCount(),E=0;E<T;E++){var S=y.getViewport(E);a.set(o.x*S.x,o.y*S.y,o.x*S.z,o.y*S.w),f.viewport(a),y.updateMatrices(g,E),r=y.getFrustum(),x(s,u,y.camera,g,this.type)}y.isPointLightShadow||3!==this.type||m(y,u),y.needsUpdate=!1}}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}v.needsUpdate=!1,t.setRenderTarget(c,l,h)}}}function $i(t,e,n){var r,i,o=n.isWebGL2;var a=new function(){var e=!1,n=new Et,r=null,i=new Et(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,o,a,s){!0===s&&(e*=a,r*=a,o*=a),n.set(e,r,o,a),!1===i.equals(n)&&(t.clearColor(e,r,o,a),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},s=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(t){t?U(2929):B(2929)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},c=new function(){var e=!1,n=null,r=null,i=null,o=null,a=null,s=null,u=null,c=null;return{setTest:function(t){e||(t?U(2960):B(2960))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&u===r||(t.stencilOp(e,n,r),a=e,s=n,u=r)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,n=null,r=null,i=null,o=null,a=null,s=null,u=null,c=null}}},l={},h=null,f=!1,d=null,p=null,v=null,m=null,g=null,y=null,b=null,_=!1,E=null,S=null,O=null,k=null,C=null,M=t.getParameter(35661),A=!1,I=0,j=t.getParameter(7938);-1!==j.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(j)[1]),A=I>=1):-1!==j.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),A=I>=2);var P=null,R={},N=new Et,L=new Et;function D(e,n,r){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;a<r;a++)t.texImage2D(n+a,0,6408,1,1,0,6408,5121,i);return o}var F={};function U(e){!0!==l[e]&&(t.enable(e),l[e]=!0)}function B(e){!1!==l[e]&&(t.disable(e),l[e]=!1)}F[3553]=D(3553,3553,1),F[34067]=D(34067,34069,6),a.setClear(0,0,0,1),s.setClear(1),c.setClear(0),U(2929),s.setFunc(3),W(!1),G(1),U(2884),q(0);var V=(r={},Object(u.a)(r,T,32774),Object(u.a)(r,101,32778),Object(u.a)(r,102,32779),r);if(o)V[103]=32775,V[104]=32776;else{var z=e.get("EXT_blend_minmax");null!==z&&(V[103]=z.MIN_EXT,V[104]=z.MAX_EXT)}var H=(i={},Object(u.a)(i,200,0),Object(u.a)(i,201,1),Object(u.a)(i,202,768),Object(u.a)(i,204,770),Object(u.a)(i,210,776),Object(u.a)(i,208,774),Object(u.a)(i,206,772),Object(u.a)(i,203,769),Object(u.a)(i,205,771),Object(u.a)(i,209,775),Object(u.a)(i,207,773),i);function q(e,n,r,i,o,a,s,u){if(0!==e){if(!1===f&&(U(3042),f=!0),5===e)o=o||n,a=a||r,s=s||i,n===p&&o===g||(t.blendEquationSeparate(V[n],V[o]),p=n,g=o),r===v&&i===m&&a===y&&s===b||(t.blendFuncSeparate(H[r],H[i],H[a],H[s]),v=r,m=i,y=a,b=s),d=e,_=null;else if(e!==d||u!==_){if(p===T&&g===T||(t.blendEquation(32774),p=T,g=T),u)switch(e){case 1:t.blendFuncSeparate(1,771,1,771);break;case x:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(770,771,1,771);break;case x:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}v=null,m=null,y=null,b=null,d=e,_=u}}else!0===f&&(B(3042),f=!1)}function W(e){E!==e&&(e?t.frontFace(2304):t.frontFace(2305),E=e)}function G(e){0!==e?(U(2884),e!==S&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):B(2884),S=e}function Y(e,n,r){e?(U(32823),k===n&&C===r||(t.polygonOffset(n,r),k=n,C=r)):B(32823)}function X(e){void 0===e&&(e=33984+M-1),P!==e&&(t.activeTexture(e),P=e)}return{buffers:{color:a,depth:s,stencil:c},enable:U,disable:B,useProgram:function(e){return h!==e&&(t.useProgram(e),h=e,!0)},setBlending:q,setMaterial:function(t,e){t.side===w?B(2884):U(2884);var n=1===t.side;e&&(n=!n),W(n),1===t.blending&&!1===t.transparent?q(0):q(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),a.setMask(t.colorWrite);var r=t.stencilWrite;c.setTest(r),r&&(c.setMask(t.stencilWriteMask),c.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),c.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Y(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:W,setCullFace:G,setLineWidth:function(e){e!==O&&(A&&t.lineWidth(e),O=e)},setPolygonOffset:Y,setScissorTest:function(t){t?U(3089):B(3089)}
2,activeTexture:X,bindTexture:function(e,n){null===P&&X();var r=R[P];void 0===r&&(r={type:void 0,texture:void 0},R[P]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||F[e]),r.type=e,r.texture=n)},unbindTexture:function(){var e=R[P];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(e){!1===N.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),N.copy(e))},viewport:function(e){!1===L.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),L.copy(e))},reset:function(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),l={},P=null,R={},h=null,f=!1,d=null,p=null,v=null,m=null,g=null,y=null,b=null,_=!1,E=null,S=null,O=null,k=null,C=null,a.reset(),s.reset(),c.reset()}}}function to(t,e,n,r,i,o,a){var s,c,l,h=i.isWebGL2,f=i.maxTextures,d=i.maxCubemapSize,p=i.maxTextureSize,v=i.maxSamples,m=new WeakMap,g=!1;try{g="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(ot){}function y(t,e){return g?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(t,e,n,r){var i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){var o=e?mt.floorPowerOfTwo:Math.floor,a=o(i*t.width),s=o(i*t.height);void 0===l&&(l=y(a,s));var u=n?y(a,s):l;return u.width=a,u.height=s,u.getContext("2d").drawImage(t,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+s+")."),u}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function _(t){return mt.isPowerOfTwo(t.width)&&mt.isPowerOfTwo(t.height)}function w(t,e){return t.generateMipmaps&&e&&t.minFilter!==I&&t.minFilter!==R}function x(e,n,i,o){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log2(Math.max(i,o))}function T(n,r,i){if(!1===h)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function E(t){return t===I||t===j||t===P?9728:9729}function S(e){var n=e.target;n.removeEventListener("dispose",S),function(e){var n=r.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),r.remove(e)}(n),n.isVideoTexture&&m.delete(n),a.memory.textures--}function O(e){var n=e.target;n.removeEventListener("dispose",O),function(e){var n=e.texture,i=r.get(e),o=r.get(n);if(!e)return;void 0!==o.__webglTexture&&t.deleteTexture(o.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)t.deleteFramebuffer(i.__webglFramebuffer[a]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[a]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRen
2derbuffer&&t.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer);r.remove(n),r.remove(e)}(n),a.memory.textures--}var k=0;function D(t,e){var i=r.get(t);if(t.isVideoTexture&&function(t){var e=a.render.frame;m.get(t)!==e&&(m.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void Z(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}function Y(e,i){var a=r.get(e);e.version>0&&a.__version!==e.version?function(e,r,i){if(6!==r.image.length)return;J(e,r),n.activeTexture(33984+i),n.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);for(var a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,u=[],c=0;c<6;c++)u[c]=a||s?s?r.image[c].image:r.image[c]:b(r.image[c],!1,!0,d);var l,f=u[0],p=_(f)||h,v=o.convert(r.format),m=o.convert(r.type),g=T(r.internalFormat,v,m);if(Q(34067,r,p),a){for(var y=0;y<6;y++){l=u[y].mipmaps;for(var E=0;E<l.length;E++){var S=l[E];r.format!==q&&r.format!==H?null!==v?n.compressedTexImage2D(34069+y,E,g,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+y,E,g,S.width,S.height,0,v,m,S.data)}}e.__maxMipLevel=l.length-1}else{l=r.mipmaps;for(var O=0;O<6;O++)if(s){n.texImage2D(34069+O,0,g,u[O].width,u[O].height,0,v,m,u[O].data);for(var k=0;k<l.length;k++){var C=l[k].image[O].image;n.texImage2D(34069+O,k+1,g,C.width,C.height,0,v,m,C.data)}}else{n.texImage2D(34069+O,0,g,v,m,u[O]);for(var M=0;M<l.length;M++){var A=l[M];n.texImage2D(34069+O,M+1,g,v,m,A.image[O])}}e.__maxMipLevel=l.length}w(r,p)&&x(34067,r,f.width,f.height);e.__version=r.version,r.onUpdate&&r.onUpdate(r)}(a,e,i):(n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture))}var X=(s={},Object(u.a)(s,C,10497),Object(u.a)(s,M,33071),Object(u.a)(s,A,33648),s),K=(c={},Object(u.a)(c,I,9728),Object(u.a)(c,j,9984),Object(u.a)(c,P,9986),Object(u.a)(c,R,9729),Object(u.a)(c,N,9985),Object(u.a)(c,L,9987),c);function Q(n,o,a){if(a?(t.texParameteri(n,10242,X[o.wrapS]),t.texParameteri(n,10243,X[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,X[o.wrapR]),t.texParameteri(n,10240,K[o.magFilter]),t.texParameteri(n,10241,K[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),o.wrapS===M&&o.wrapT===M||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,E(o.magFilter)),t.texParameteri(n,10241,E(o.minFilter)),o.minFilter!==I&&o.minFilter!==R&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){var s=e.get("EXT_texture_filter_anisotropic");if(o.type===B&&!1===e.has("OES_texture_float_linear"))return;if(!1===h&&o.type===V&&!1===e.has("OES_texture_half_float_linear"))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function J(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",S),e.__webglTexture=t.createTexture(),a.memory.textures++)}function Z(e,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),J(e,r),n.activeTexture(33984+i),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment),t.pixelStorei(37443,0);var s,u=function(t){return!h&&(t.wrapS!==M||t.wrapT!==M||t.minFilter!==I&&t.minFilter!==R)}(r)&&!1===_(r.image),c=b(r.image,u,!1,p),l=_(c)||h,f=o.convert(r.format),d=o.convert(r.type),v=T(r.internalFormat,f,d);Q(a,r,l);var m=r.mipmaps;if(r.isDepthTexture)v=6402,h?v=r.type===B?36012:r.type===U?33190:r.type===z?35056:33189:r.type===B&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===W&&6402===v&&r.type!==F&&r.type!==U&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=F,d=o.convert(r.type)),r.format===G&&6402===v&&(v=34041,r.type!==z&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=z,d=o.convert(r.type))),n.texImage2D(3553,0,v,c.width,c.height,0,f,d,null);else if(r.isDataTexture)if(m.length>0&&l){for(var g=0,y=m.length;g<y;g++)s=m[g],n.texImage2D(3553,g,v,s.width,s.height,0,f,d,s.data);r.generateMipmaps=!1,e.__maxMipLevel=m.length-1}else n.texImage2D(3553,0,v,c.width,c.height,0,f,d,c.data),e.__maxMipLevel=0;else if(r.isCompressedTexture){for(var E=0,S=m.length;E<S;E++)s=m[E],r.format!==q&&r.format!==H?null!==f?n.compressedTexImage2D(3553,E,v,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,E,v,s.width,s.height,0,f,d,s.data);e.__maxMipLevel=m.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,v,c.width,c.height,c.depth,0,f,d,c.data),e.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,v,c.width,c.height,c.depth,0,f,d,c.data),e.__maxMipLevel=0;else if(m.length>0&&l){for(var O=0,k=m.length;O<k;O++)s=m[O],n.texImage2D(3553,O,v,f,d,s);r.generateMipmaps=!1,e.__maxMipLevel=m.length-1}else n.texImage2D(3553,0,v,f,d,c),e.__maxMipLevel=0;w(r,l)&&x(a,r,c.width,c.height),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function $(e,i,a,s){var u=i.texture,c=o.convert(u.format),l=o.convert(u.type),h=T(u.internalFormat,c,l);32879===s||35866===s?n.texImage3D(s,0,h,i.width,i.height,i.depth,0,c,l,null):n.texImage2D(s,0,h,i.width,i.height,0,c,l,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,r.get(u).__webglTexture,0),t.bindFramebuffer(36160,null)}function tt(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var a=n.depthTexture;a&&a.isDepthTexture&&(a.type===B?i=36012:a.type===U&&(i=33190));var s=nt(n);t.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){if(r){var u=nt(n);t.renderbufferStorageMultisample(36161,u,35056,n.width,n.height)}else t.renderbufferStorage(36161,34041,n.width,n.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{var c=n.texture,l=o.convert(c.format),h=o.convert(c.type),f=T(c.internalFormat,l,h);if(r){var d=nt(n);t.renderbufferStorageMultisample(36161,d,f,n.width,n.height)}else t.renderbufferStorage(36161,f,n.width,n.height)}t.bindRenderbuffer(36161,null)}
2function et(e){var n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),D(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===W)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==G)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),tt(n.__webglDepthbuffer[o],e,!1)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),tt(n.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function nt(t){return h&&t.isWebGLMultisampleRenderTarget?Math.min(v,t.samples):0}var rt=!1,it=!1;this.allocateTextureUnit=function(){var t=k;return t>=f&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+f),k+=1,t},this.resetTextureUnits=function(){k=0},this.setTexture2D=D,this.setTexture2DArray=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?Z(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?Z(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=Y,this.setupRenderTarget=function(e){var i=e.texture,s=r.get(e),u=r.get(i);e.addEventListener("dispose",O),u.__webglTexture=t.createTexture(),a.memory.textures++;var c=!0===e.isWebGLCubeRenderTarget,l=!0===e.isWebGLMultisampleRenderTarget,f=i.isDataTexture3D||i.isDataTexture2DArray,d=_(e)||h;if(!h||i.format!==H||i.type!==B&&i.type!==V||(i.format=q,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){s.__webglFramebuffer=[];for(var p=0;p<6;p++)s.__webglFramebuffer[p]=t.createFramebuffer()}else if(s.__webglFramebuffer=t.createFramebuffer(),l)if(h){s.__webglMultisampledFramebuffer=t.createFramebuffer(),s.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var v=o.convert(i.format),m=o.convert(i.type),g=T(i.internalFormat,v,m),y=nt(e);t.renderbufferStorageMultisample(36161,y,g,e.width,e.height),t.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(s.__webglDepthRenderbuffer=t.createRenderbuffer(),tt(s.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,u.__webglTexture),Q(34067,i,d);for(var b=0;b<6;b++)$(s.__webglFramebuffer[b],e,36064,34069+b);w(i,d)&&x(34067,i,e.width,e.height),n.bindTexture(34067,null)}else{var E=3553;if(f)if(h)E=i.isDataTexture3D?32879:35866;else console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.");n.bindTexture(E,u.__webglTexture),Q(E,i,d),$(s.__webglFramebuffer,e,36064,E),w(i,d)&&x(3553,i,e.width,e.height),n.bindTexture(3553,null)}e.depthBuffer&&et(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(w(e,_(t)||h)){var i=t.isWebGLCubeRenderTarget?34067:3553,o=r.get(e).__webglTexture;n.bindTexture(i,o),x(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(h){var n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var i=e.width,o=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===rt&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),rt=!0),t=t.texture),D(t,e)}
2,this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===it&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),it=!0),t=t.texture),Y(t,e)}}function eo(t,e,n){var r=n.isWebGL2;return{convert:function(t){var n;if(t===D)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===F)return 5123;if(1013===t)return 5124;if(t===U)return 5125;if(t===B)return 5126;if(t===V)return r?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(t===H)return 6407;if(t===q)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===W)return 6402;if(t===G)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(n=e.get("EXT_texture_compression_bptc"))?t:null:t===z?r?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function no(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Gn.call(this),this.cameras=t}no.prototype=Object.assign(Object.create(Gn.prototype),{constructor:no,isArrayCamera:!0});var ro=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t;return Object(m.a)(this,n),(t=e.call(this)).type="Group",t}return n}(Oe);function io(){this._targetRay=null,this._grip=null,this._hand=null}function oo(t,e){var n=this,r=null,i=1,s=null,u="local-floor",c=null,l=[],h=new Map,f=new Gn;f.layers.enable(1),f.viewport=new Et;var d=new Gn;d.layers.enable(2),d.viewport=new Et;var p=[f,d],v=new no;v.layers.enable(1),v.layers.enable(2);var m=null,g=null;function y(t){var e=h.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function b(){h.forEach((function(t,e){t.disconnect(e)})),h.clear(),m=null,g=null,t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function _(t){for(var e=r.inputSources,n=0;n<l.length;n++)h.set(e[n],l[n]);for(var i=0;i<t.removed.length;i++){var o=t.removed[i],a=h.get(o);a&&(a.dispatchEvent({type:"disconnected",data:o}),h.delete(o))}for(var s=0;s<t.added.length;s++){var u=t.added[s],c=h.get(u);c&&c.dispatchEvent({type:"connected",data:u})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=l[t];return void 0===e&&(e=new io,l[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){var e=l[t];return void 0===e&&(e=new io,l[t]=e),e.getGripSpace()},this.getHand=function(t){var e=l[t];return void 0===e&&(e=new io,l[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){u=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s}
2,this.getSession=function(){return r},this.setSession=function(){var t=Object(a.a)(o.a.mark((function t(a){var c,l,h;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(r=a)){t.next=24;break}if(r.addEventListener("select",y),r.addEventListener("selectstart",y),r.addEventListener("selectend",y),r.addEventListener("squeeze",y),r.addEventListener("squeezestart",y),r.addEventListener("squeezeend",y),r.addEventListener("end",b),r.addEventListener("inputsourceschange",_),!0===(c=e.getContextAttributes()).xrCompatible){t.next=14;break}return t.next=14,e.makeXRCompatible();case 14:return l={antialias:c.antialias,alpha:c.alpha,depth:c.depth,stencil:c.stencil,framebufferScaleFactor:i},h=new XRWebGLLayer(r,e,l),r.updateRenderState({baseLayer:h}),t.next=19,r.requestReferenceSpace(u);case 19:s=t.sent,S.setContext(r),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"});case 24:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();var w=new kt,x=new kt;function T(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.getCamera=function(t){v.near=d.near=f.near=t.near,v.far=d.far=f.far=t.far,m===v.near&&g===v.far||(r.updateRenderState({depthNear:v.near,depthFar:v.far}),m=v.near,g=v.far);var e=t.parent,n=v.cameras;T(v,e);for(var i=0;i<n.length;i++)T(n[i],e);t.matrixWorld.copy(v.matrixWorld),t.matrix.copy(v.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale);for(var o=t.children,a=0,s=o.length;a<s;a++)o[a].updateMatrixWorld(!0);return 2===n.length?function(t,e,n){w.setFromMatrixPosition(e.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);var r=w.distanceTo(x),i=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),u=(i[9]+1)/i[5],c=(i[9]-1)/i[5],l=(i[8]-1)/i[0],h=(o[8]+1)/o[0],f=a*l,d=a*h,p=r/(-l+h),v=p*-l;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(v),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();var m=a+p,g=s+p,y=f-v,b=d+(r-v),_=u*s/g*m,T=c*s/g*m;t.projectionMatrix.makePerspective(y,b,_,T,m,g)}(v,f,d):v.projectionMatrix.copy(f.projectionMatrix),v};var E=null;var S=new er;S.setAnimationLoop((function(e,n){if(null!==(c=n.getViewerPose(s))){var i=c.views,o=r.renderState.baseLayer;t.setFramebuffer(o.framebuffer);var a=!1;i.length!==v.cameras.length&&(v.cameras.length=0,a=!0);for(var u=0;u<i.length;u++){var h=i[u],f=o.getViewport(h),d=p[u];d.matrix.fromArray(h.transform.matrix),d.projectionMatrix.fromArray(h.projectionMatrix),d.viewport.set(f.x,f.y,f.width,f.height),0===u&&v.matrix.copy(d.matrix),!0===a&&v.cameras.push(d)}}for(var m=r.inputSources,g=0;g<l.length;g++){var y=l[g],b=m[g];y.update(b,n,s)}E&&E(e,n)})),this.setAnimationLoop=function(t){E=t},this.dispose=function(){}}function ao(t){function e(e,n){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);var r,i,o=t.get(n).envMap;if(o){e.envMap.value=o,e.flipEnvMap.value=o.isCubeTexture&&o._needsFlipEnvMap?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio;var a=t.get(o).__maxMipLevel;void 0!==a&&(e.maxMipLevel.value=a)}n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity),n.map?r=n.map:n.specularMap?r=n.specularMap:n.displacementMap?r=n.displacementMap:n.normalMap?r=n.normalMap:n.bumpMap?r=n.bumpMap:n.roughnessMap?r=n.roughnessMap:n.metalnessMap?r=n.metalnessMap:n.alphaMap?r=n.alphaMap:n.emissiveMap?r=n.emissiveMap:n.clearcoatMap?r=n.clearcoatMap:n.clearcoatNormalMap?r=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(r=n.clearcoatRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),n.aoMap?i=n.aoMap:n.lightMap&&(i=n.lightMap),void 0!==i&&(i.isWebG
vendor: 4,526 bytes, line 2
2LRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uv2Transform.value.copy(i.matrix))}function n(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,1===n.side&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),1===n.side&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias),t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,r,i,o){r.isMeshBasicMaterial?e(t,r):r.isMeshLambertMaterial?(e(t,r),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,r)):r.isMeshToonMaterial?(e(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshPhongMaterial?(e(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshStandardMaterial?(e(t,r),r.isMeshPhysicalMaterial?function(t,e){n(t,e),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap);e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate());t.transmission.value=e.transmission,e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap)}(t,r):n(t,r)):r.isMeshMatcapMaterial?(e(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDepthMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDistanceMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,r)):r.isMeshNormalMaterial?(e(t,r),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize
2+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,n,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*r,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,r,i,o):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function so(t){var e=void 0!==(t=t||{}).canvas?t.canvas:function(){var t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return t.style.display="block",t}(),n=void 0!==t.context?t.context:null,r=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,u=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",l=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,h=null,f=null,d=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=rt,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var v=this,m=!1,g=null,y=0,b=0,_=null,w=null,x=-1,T=null,E=new Et,S=new Et,O=null,k=e.width,C=e.height,M=1,A=null,I=null,j=new Et(0,0,k,C),P=new Et(0,0,k,C),R=!1,N=new tr,L=!1,F=!1,U=new ee,z=new kt,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function W(){return null===_?M:1}var G,Y,X,K,Q,J,Z,$,tt,et,nt,it,ot,at,st,ut,ct,lt,ht,ft,dt,pt=n;function vt(t,n){for(var r=0;r<t.length;r++){var i=t[r],o=e.getContext(i,n);if(null!==o)return o}return null}try{var yt={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:l};if(e.addEventListener("webglcontextlost",Tt,!1),e.addEventListener("webglcontextrestored",St,!1),null===pt){var bt=["webgl2","webgl","experimental-webgl"];if(!0===v.isWebGL1Renderer&&bt.shift(),null===(pt=vt(bt,yt)))throw vt(bt)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===pt.getShaderPrecisionFormat&&(pt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Lt){throw console.error("THREE.WebGLRenderer: "+Lt.message),Lt}function _t(){G=new dr(pt),Y=new lr(pt,G,t),G.init(Y),ft=new eo(pt,G,Y),(X=new $i(pt,G,Y)).scissor(S.copy(P).multiplyScalar(M).floor()),X.viewport(E.copy(j).multiplyScalar(M).floor()),K=new mr(pt),Q=new Ui,J=new to(pt,G,X,Q,Y,ft,K),Z=new fr(v),$=new nr(pt,Y),dt=new ur(pt,G,$,Y),tt=new pr(pt,$,K,dt),et=new _r(pt,tt,$,K),ct=new br(pt),st=new hr(Q),nt=new Fi(v,Z,G,Y,dt,st),it=new ao(Q),ot=new Hi(Q),at=new Ki(G,Y),ut=new sr(v,Z,X,et,s),lt=new cr(pt,G,K,Y),ht=new vr(pt,G,K,Y),K.programs=nt.programs,v.capabilities=Y,v.extensions=G,v.properties=Q,v.renderLists=ot,v.state=X,v.info=K}_t();var wt=new oo(v,pt);this.xr=wt;var xt=new Zi(v,et,Y.maxTextureSize);function Tt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function St(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1,_t()}function Ot(t){var e=t.target;e.removeEventListener("dispose",Ot),function(t){Ct(t),Q.remove(t)}(e)}function Ct(t){var e=Q.get(t).program;void 0!==e&&nt.releaseProgram(e)}this.shadowMap=xt,this.getContext=function(){return pt},this.getContextAttributes=function(){return pt.getContextAttributes()},this.forceContextLoss=function(){var t=G.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=G.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return M},this.setPixelRatio=function(t){void 0!==t&&(M=t,this.setSize(k,C,!1))}
vendor: 2,795 bytes, line 2
2,this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new gt),t.set(k,C)},this.setSize=function(t,n,r){wt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(k=t,C=n,e.width=Math.floor(t*M),e.height=Math.floor(n*M),!1!==r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new gt),t.set(k*M,C*M).floor()},this.setDrawingBufferSize=function(t,n,r){k=t,C=n,M=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new Et),t.copy(E)},this.getViewport=function(t){return t.copy(j)},this.setViewport=function(t,e,n,r){t.isVector4?j.set(t.x,t.y,t.z,t.w):j.set(t,e,n,r),X.viewport(E.copy(j).multiplyScalar(M).floor())},this.getScissor=function(t){return t.copy(P)},this.setScissor=function(t,e,n,r){t.isVector4?P.set(t.x,t.y,t.z,t.w):P.set(t,e,n,r),X.scissor(S.copy(P).multiplyScalar(M).floor())},this.getScissorTest=function(){return R},this.setScissorTest=function(t){X.setScissorTest(R=t)},this.setOpaqueSort=function(t){A=t},this.setTransparentSort=function(t){I=t},this.getClearColor=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getClearColor() now requires a Color as an argument"),t=new Qe),t.copy(ut.getClearColor())},this.setClearColor=function(){ut.setClearColor.apply(ut,arguments)},this.getClearAlpha=function(){return ut.getClearAlpha()},this.setClearAlpha=function(){ut.setClearAlpha.apply(ut,arguments)},this.clear=function(t,e,n){var r=0;(void 0===t||t)&&(r|=16384),(void 0===e||e)&&(r|=256),(void 0===n||n)&&(r|=1024),pt.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Tt,!1),e.removeEventListener("webglcontextrestored",St,!1),ot.dispose(),at.dispose(),Q.dispose(),Z.dispose(),et.dispose(),dt.dispose(),wt.dispose(),At.stop()},this.renderBufferImmediate=function(t,e){dt.initAttributes();var n=Q.get(t);t.hasPositions&&!n.position&&(n.position=pt.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=pt.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=pt.createBuffer()),t.hasColors&&!n.color&&(n.color=pt.createBuffer());var r=e.getAttributes();t.hasPositions&&(pt.bindBuffer(34962,n.position),pt.bufferData(34962,t.positionArray,35048),dt.enableAttribute(r.position),pt.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&
2(pt.bindBuffer(34962,n.normal),pt.bufferData(34962,t.normalArray,35048),dt.enableAttribute(r.normal),pt.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(pt.bindBuffer(34962,n.uv),pt.bufferData(34962,t.uvArray,35048),dt.enableAttribute(r.uv),pt.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(pt.bindBuffer(34962,n.color),pt.bufferData(34962,t.colorArray,35048),dt.enableAttribute(r.color),pt.vertexAttribPointer(r.color,3,5126,!1,0,0)),dt.disableUnusedAttributes(),pt.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,r,i,o){null===e&&(e=H);var a=i.isMesh&&i.matrixWorld.determinant()<0,s=Nt(t,e,r,i);X.setMaterial(r,a);var u=n.index,c=n.attributes.position;if(null===u){if(void 0===c||0===c.count)return}else if(0===u.count)return;var l,h=1;!0===r.wireframe&&(u=tt.getWireframeAttribute(n),h=2),(r.morphTargets||r.morphNormals)&&ct.update(i,n,r,s),dt.setup(i,r,s,n,u);var f=lt;null!==u&&(l=$.get(u),(f=ht).setIndex(l));var d=null!==u?u.count:c.count,p=n.drawRange.start*h,v=n.drawRange.count*h,m=null!==o?o.start*h:0,g=null!==o?o.count*h:1/0,y=Math.max(p,m),b=Math.min(d,p+v,m+g)-1,_=Math.max(0,b-y+1);if(0!==_){if(i.isMesh)!0===r.wireframe?(X.setLineWidth(r.wireframeLinewidth*W()),f.setMode(1)):f.setMode(4);else if(i.isLine){var w=r.linewidth;void 0===w&&(w=1),X.setLineWidth(w*W()),i.isLineSegments?f.setMode(1):i.isLineLoop?f.setMode(2):f.setMode(3)}else i.isPoints?f.setMode(0):i.isSprite&&f.setMode(4);if(i.isInstancedMesh)f.renderInstances(y,_,i.count);else if(n.isInstancedBufferGeometry){var x=Math.min(n.instanceCount,n._maxInstanceCount);f.renderInstances(y,_,x)}else f.render(y,_)}},this.compile=function(t,e){(f=at.get(t)).init(),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(f.pushLight(t),t.castShadow&&f.pushShadow(t))})),f.setupLights();var n=new WeakMap;t.traverse((function(e){var r=e.material;if(r)if(Array.isArray(r))for(var i=0;i<r.length;i++){var o=r[i];!1===n.has(o)&&(Rt(o,t,e),n.set(o))}else!1===n.has(r)&&(Rt(r,t,e),n.set(r))}))};var Mt=null;var At=new er;function It(t,e,n,r){if(!1!==t.visible){if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)f.pushLight(t),t.castShadow&&f.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||N.intersectsSprite(t)){r&&z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(U);var i=et.update(t),o=t.material;o.visible&&h.push(t,i,o,n,z.z,null)}}else if(t.isImmediateRenderObject)r&&z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(U),h.push(t,null,t.material,n,z.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==K.render.frame&&(t.skeleton.update(),t.skeleton.frame=K.render.frame),!t.frustumCulled||N.intersectsObject(t))){r&&z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(U);var a=et.update(t),s=t.material;if(Array.isArray(s))for(var u=a.groups,c=0,l=u.length;c<l;c++){var d=u[c],p=s[d.materialIndex];p&&p.visible&&h.push(t,a,p,n,z.z,d)}else s.visible&&h.push(t,a,s,n,z.z,null)}for(var v=t.children,m=0,g=v.length;m<g;m++)It(v[m],e,n,r)}}function jt(t,e,n){for(var r=!0===e.isScene?e.overrideMaterial:null,i=0,o=t.length;i<o;i++){var a=t[i],s=a.object,u=a.geometry,c=null===r?a.material:r,l=a.group;if(n.isArrayCamera)for(var h=n.cameras,d=0,p=h.length;d<p;d++){var v=h[d];s.layers.test(v.layers)&&(X.viewport(E.copy(v.viewport)),f.setupLightsView(v),Pt(s,e,v,u,c,l))}else Pt(s,e,n,u,c,l)}}function Pt(t,e,n,r,i,o){if(t.onBeforeRender(v,e,n,r,i,o),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var a=Nt(n,e,i,t);X.setMaterial(i),dt.reset(),function(t,e){t.render((function(t){v.renderBufferImmediate(t,e)}))}(t,a)}else v.renderBufferDirect(n,e,r,i,t,o);t.onAfterRender(v,e,n,r,i,o)}function Rt(t,e,n){!0!==e.isScene&&(e=H);var r=Q.get(t),i=f.state.lights,o=f.state.shadowsArray,a=i.state.version,s=nt.getParameters(t,i.state,o,e,n),u=nt.getProgramCacheKey(s),c=r.program,l=!0;if(r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=Z.get(t.envMap||r.environment),void 0===c)t.addEventListener("dispose",Ot);else if(c.cacheKey!==u)Ct(t);else if(r.lightsStateVersion!==a)l=!1;else{if(void 0!==s.shaderID)return;l=!1}l&&(s.uniforms=nt.getUniforms(t),t.onBeforeCompile(s,v),c=nt.acquireProgram(s,u),r.program=c,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding);var h=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=st.numPlanes,r.numIntersection=st.numIntersection,h.clippingPlanes=st.uniform),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=a,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotShadowMatrix.value=i.state.spotShadowMatrix,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);var d=r.program.getUniforms(),p=gi.seqWithValue(d.seq,h);r.uniformsList=p}function Nt(t,e,n,r){!0!==e.isScene&&(e=H),J.resetTextureUnits();var i=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=null===_?v.outputEncoding:_.texture.encoding,s=Z.get(n.envMap||o),u=Q.get(n),c=f.state.lights;if(!0===L&&(!0===F||t!==T)){var l=t===T&&n.id===x;st.setState(n,t,l)}n.version===u.__version?n.fog&&u.fog!==i||u.environment!==o||u.needsLights&&u.lightsStateVersion!==c.state.ver
2sion?Rt(n,e,r):void 0===u.numClippingPlanes||u.numClippingPlanes===st.numPlanes&&u.numIntersection===st.numIntersection?(u.outputEncoding!==a||u.envMap!==s)&&Rt(n,e,r):Rt(n,e,r):(Rt(n,e,r),u.__version=n.version);var h,d,p=!1,m=!1,g=!1,y=u.program,b=y.getUniforms(),w=u.uniforms;if(X.useProgram(y.program)&&(p=!0,m=!0,g=!0),n.id!==x&&(x=n.id,m=!0),p||T!==t){if(b.setValue(pt,"projectionMatrix",t.projectionMatrix),Y.logarithmicDepthBuffer&&b.setValue(pt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),T!==t&&(T=t,m=!0,g=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var E=b.map.cameraPosition;void 0!==E&&E.setValue(pt,z.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&b.setValue(pt,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&b.setValue(pt,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){b.setOptional(pt,r,"bindMatrix"),b.setOptional(pt,r,"bindMatrixInverse");var S=r.skeleton;if(S){var O=S.bones;if(Y.floatVertexTextures){if(null===S.boneTexture){var k=Math.sqrt(4*O.length);k=mt.ceilPowerOfTwo(k),k=Math.max(k,4);var A=new Float32Array(k*k*4);A.set(S.boneMatrices);var I=new Jn(A,k,k,q,B);S.boneMatrices=A,S.boneTexture=I,S.boneTextureSize=k}b.setValue(pt,"boneTexture",S.boneTexture,J),b.setValue(pt,"boneTextureSize",S.boneTextureSize)}else b.setOptional(pt,S,"boneMatrices")}}return(m||u.receiveShadow!==r.receiveShadow)&&(u.receiveShadow=r.receiveShadow,b.setValue(pt,"receiveShadow",r.receiveShadow)),m&&(b.setValue(pt,"toneMappingExposure",v.toneMappingExposure),u.needsLights&&(d=g,(h=w).ambientLightColor.needsUpdate=d,h.lightProbe.needsUpdate=d,h.directionalLights.needsUpdate=d,h.directionalLightShadows.needsUpdate=d,h.pointLights.needsUpdate=d,h.pointLightShadows.needsUpdate=d,h.spotLights.needsUpdate=d,h.spotLightShadows.needsUpdate=d,h.rectAreaLights.needsUpdate=d,h.hemisphereLights.needsUpdate=d),i&&n.fog&&it.refreshFogUniforms(w,i),it.refreshMaterialUniforms(w,n,M,C),gi.upload(pt,u.uniformsList,w,J)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(gi.upload(pt,u.uniformsList,w,J),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&b.setValue(pt,"center",r.center),b.setValue(pt,"modelViewMatrix",r.modelViewMatrix),b.setValue(pt,"normalMatrix",r.normalMatrix),b.setValue(pt,"modelMatrix",r.matrixWorld),y}At.setAnimationLoop((function(t){wt.isPresenting||Mt&&Mt(t)})),"undefined"!==typeof window&&At.setContext(window),this.setAnimationLoop=function(t){Mt=t,wt.setAnimationLoop(t),null===t?At.stop():At.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),void 0===e||!0===e.isCamera){if(!0!==m){dt.resetDefaultState(),x=-1,T=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===wt.enabled&&!0===wt.isPresenting&&(e=wt.getCamera(e)),!0===t.isScene&&t.onBeforeRender(v,t,e,n||_),(f=at.get(t,p.length)).init(),p.push(f),U.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),N.setFromProjectionMatrix(U),F=this.localClippingEnabled,L=st.init(this.clippingPlanes,F,e),(h=ot.get(t,d.length)).init(),d.push(h),It(t,e,0,v.sortObjects),h.finish(),!0===v.sortObjects&&h.sort(A,I),!0===L&&st.beginShadows();var i=f.state.shadowsArray;xt.render(i,t,e),f.setupLights(),f.setupLightsView(e),!0===L&&st.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),ut.render(h,t,e,r);var o=h.opaque,a=h.transparent;o.length>0&&jt(o,t,e),a.length>0&&jt(a,t,e),!0===t.isScene&&t.onAfterRender(v,t,e),null!==_&&(J.updateRenderTargetMipmap(_),J.updateMultisampleRenderTarget(_)),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),p.pop(),f=p.length>0?p[p.length-1]:null,d.pop(),h=d.length>0?d[d.length-1]:null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){g!==t&&null===_&&pt.bindFramebuffer(36160,t),g=t},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return _},this.setRenderTarget=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;_=t,y=e,b=n,t&&void 0===Q.get(t).__webglFramebuffer&&J.setupRenderTarget(t);var r=g,i=!1,o=!1;if(t){var a=t.texture;(a.isDataTexture3D||a.isDataTexture2DArray)&&(o=!0);var s=Q.get(t).__webglFramebuffer;
2t.isWebGLCubeRenderTarget?(r=s[e],i=!0):r=t.isWebGLMultisampleRenderTarget?Q.get(t).__webglMultisampledFramebuffer:s,E.copy(t.viewport),S.copy(t.scissor),O=t.scissorTest}else E.copy(j).multiplyScalar(M).floor(),S.copy(P).multiplyScalar(M).floor(),O=R;if(w!==r&&(pt.bindFramebuffer(36160,r),w=r),X.viewport(E),X.scissor(S),X.setScissorTest(O),i){var u=Q.get(t.texture);pt.framebufferTexture2D(36160,36064,34069+e,u.__webglTexture,n)}else if(o){var c=Q.get(t.texture),l=e||0;pt.framebufferTextureLayer(36160,36064,c.__webglTexture,n||0,l)}},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){if(t&&t.isWebGLRenderTarget){var s=Q.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var u=!1;s!==w&&(pt.bindFramebuffer(36160,s),u=!0);try{var c=t.texture,l=c.format,h=c.type;if(l!==q&&ft.convert(l)!==pt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");var f=h===V&&(G.has("EXT_color_buffer_half_float")||Y.isWebGL2&&G.has("EXT_color_buffer_float"));
2if(h!==D&&ft.convert(h)!==pt.getParameter(35738)&&(h!==B||!(Y.isWebGL2||G.has("OES_texture_float")||G.has("WEBGL_color_buffer_float")))&&!f)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===pt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&pt.readPixels(e,n,r,i,ft.convert(l),ft.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{u&&pt.bindFramebuffer(36160,w)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),a=ft.convert(e.format);J.setTexture2D(e,0),pt.copyTexImage2D(3553,n,a,t.x,t.y,i,o,0),X.unbindTexture()},this.copyTextureToTexture=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=e.image.width,o=e.image.height,a=ft.convert(n.format),s=ft.convert(n.type);J.setTexture2D(n,0),pt.pixelStorei(37440,n.flipY),pt.pixelStorei(37441,n.premultiplyAlpha),pt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?pt.texSubImage2D(3553,r,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?pt.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):pt.texSubImage2D(3553,r,t.x,t.y,a,s,e.image),0===r&&n.generateMipmaps&&pt.generateMipmap(3553),X.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(v.isWebGL1Renderer)console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");else{var o,a=n.image,s=a.width,u=a.height,c=a.data,l=ft.convert(r.format),h=ft.convert(r.type);if(r.isDataTexture3D)J.setTexture3D(r,0),o=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");J.setTexture2DArray(r,0),o=35866}pt.pixelStorei(37440,r.flipY),pt.pixelStorei(37441,r.premultiplyAlpha),pt.pixelStorei(3317,r.unpackAlignment);var f=pt.getParameter(3314),d=pt.getParameter(32878),p=pt.getParameter(3316),m=pt.getParameter(3315),g=pt.getParameter(32877);pt.pixelStorei(3314,s),pt.pixelStorei(32878,u),pt.pixelStorei(3316,t.min.x),pt.pixelStorei(3315,t.min.y),pt.pixelStorei(32877,t.min.z),pt.texSubImage3D(o,i,e.x,e.y,e.z,t.max.x-t.min.x+1,t.max.y-t.min.y+1,t.max.z-t.min.z+1,l,h,c),pt.pixelStorei(3314,f),pt.pixelStorei(32878,d),pt.pixelStorei(3316,p),pt.pixelStorei(3315,m),pt.pixelStorei(32877,g),0===i&&r.generateMipmaps&&pt.generateMipmap(o),X.unbindTexture()}},this.initTexture=function(t){J.setTexture2D(t,0),X.unbindTexture()},this.resetState=function(){X.reset(),dt.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}ro.prototype.isGroup=!0,Object.assign(io.prototype,{constructor:io,getHandSpace:function(){return null===this._hand&&(this._hand=new ro,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new ro,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new ro,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){var r=null,i=null,o=null,a=this._targetRay,u=this._grip,c=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(c&&t.hand){o=!0;var l,h=Object(s.a)(t.hand.values());try{for(h.s();!(l=h.n()).done;){var f=l.value,d=e.getJointPose(f,n);if(void 0===c.joints[f.jointName]){var p=new ro;
2p.matrixAutoUpdate=!1,p.visible=!1,c.joints[f.jointName]=p,c.add(p)}var v=c.joints[f.jointName];null!==d&&(v.matrix.fromArray(d.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=d.radius),v.visible=null!==d}}catch(b){h.e(b)}finally{h.f()}var m=c.joints["index-finger-tip"],g=c.joints["thumb-tip"],y=m.position.distanceTo(g.position);c.inputState.pinching&&y>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&y<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&null!==(r=e.getPose(t.targetRaySpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)),null!==u&&t.gripSpace&&null!==(i=e.getPose(t.gripSpace,n))&&(u.matrix.fromArray(i.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale));return null!==a&&(a.visible=null!==r),null!==u&&(u.visible=null!==i),null!==c&&(c.visible=null!==o),this}}),Object.assign(oo.prototype,ft.prototype),function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.apply(this,arguments)}return n}(so).prototype.isWebGL1Renderer=!0;var uo=function(){function t(e,n){Object(m.a)(this,t),this.name="",this.color=new Qe(e),this.density=void 0!==n?n:25e-5}return Object(g.a)(t,[{key:"clone",value:function(){return new t(this.color,this.density)}},{key:"toJSON",value:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}]),t}();uo.prototype.isFogExp2=!0;var co=function(){function t(e,n,r){Object(m.a)(this,t),this.name="",this.color=new Qe(e),this.near=void 0!==n?n:1,this.far=void 0!==r?r:1e3}return Object(g.a)(t,[{key:"clone",value:function(){return new t(this.color,this.near,this.far)}},{key:"toJSON",value:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}]),t}();co.prototype.isFog=!0;var lo=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t;return Object(m.a)(this,n),(t=e.call(this)).type="Scene",t.background=null,t.environment=null,t.fog=null,t.overrideMaterial=null,t.autoUpdate=!0,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:Object(d.a)(t)})),t}return Object(g.a)(n,[{key:"copy",value:function(t,e){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}},{key:"toJSON",value:function(t){var e=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}]),n}(Oe);function ho(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ct,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=mt.generateUUID()}lo.prototype.isScene=!0,Object.defineProperty(ho.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ho.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},set:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(t,e),this},clone:function(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=mt.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);var e=new ho(new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),this.stride);return e.setUsage(this.usage),e},onUpload:function(t){return this.onUploadCallback=t,this},toJSON:function(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=mt.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});var fo=new kt;function po(t,e,n,r){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}Object.defineProperties(po.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(t){this.data.needsUpdate=t}}}),Object.assign(po.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var e=0,n=this.data.count;e<n;e++)fo.x=this.getX(e),fo.y=this.getY(e),fo.z=this.getZ(e),fo.applyMatrix4(t),this.setXYZ(e,fo.x,fo.y,fo.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this},clone:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)e.push(this.data.array[r+i]);return new tn(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new po(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var e=[],n=0;n<this.count;n++)for(var r=n*this.data.stride+this.offset,i=0;i<this.itemSize;i++)e.push(this.data.array[r+i]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}});var vo,mo=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="SpriteMaterial",r.color=new Qe(16777215),r.map=null,r.alphaMap=null,r.rotation=0,r.sizeAttenuation=!0,r.transparent=!0,r.setValues(t),r}
2return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this}}]),n}(He);mo.prototype.isSpriteMaterial=!0;var go=new kt,yo=new kt,bo=new kt,_o=new gt,wo=new gt,xo=new ee,To=new kt,Eo=new kt,So=new kt,Oo=new gt,ko=new gt,Co=new gt,Mo=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;if(Object(m.a)(this,n),(r=e.call(this)).type="Sprite",void 0===vo){vo=new _n;var i=new ho(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);vo.setIndex([0,1,2,0,2,3]),vo.setAttribute("position",new po(i,3,0,!1)),vo.setAttribute("uv",new po(i,2,3,!1))}return r.geometry=vo,r.material=void 0!==t?t:new mo,r.center=new gt(.5,.5),r}return Object(g.a)(n,[{key:"raycast",value:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),yo.setFromMatrixScale(this.matrixWorld),xo.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),bo.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&yo.multiplyScalar(-bo.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var o=this.center;Ao(To.set(-.5,-.5,0),bo,o,yo,n,r),Ao(Eo.set(.5,-.5,0),bo,o,yo,n,r),Ao(So.set(.5,.5,0),bo,o,yo,n,r),Oo.set(0,0),ko.set(1,0),Co.set(1,1);var a=t.ray.intersectTriangle(To,Eo,So,!1,go);if(null!==a||(Ao(Eo.set(-.5,.5,0),bo,o,yo,n,r),ko.set(0,1),null!==(a=t.ray.intersectTriangle(To,So,Eo,!1,go)))){var s=t.ray.origin.distanceTo(go);s<t.near||s>t.far||e.push({distance:s,point:go.clone(),uv:Ve.getUV(go,To,Eo,So,Oo,ko,Co,new gt),face:null,object:this})}}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}]),n}(Oe);function Ao(t,e,n,r,i,o){_o.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(wo.x=o*_o.x-i*_o.y,wo.y=i*_o.x+o*_o.y):wo.copy(_o),t.copy(e),t.x+=wo.x,t.y+=wo.y,t.applyMatrix4(xo)}Mo.prototype.isSprite=!0;var Io=new kt,jo=new kt,Po=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t;return Object(m.a)(this,n),(t=e.call(this))._currentLevel=0,t.type="LOD",Object.defineProperties(Object(d.a)(t),{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),t.autoUpdate=!0,t}return Object(g.a)(n,[{key:"copy",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t,!1);for(var e=t.levels,r=0,i=e.length;r<i;r++){var o=e[r];this.addLevel(o.object.clone(),o.distance)}return this.autoUpdate=t.autoUpdate,this}},{key:"addLevel",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e=Math.abs(e);var n,r=this.levels;for(n=0;n<r.length&&!(e<r[n].distance);n++);return r.splice(n,0,{distance:e,object:t}),this.add(t),this}},{key:"getCurrentLevel",value:function(){return this._currentLevel}},{key:"getObjectForDistance",value:function(t){var e=this.levels;if(e.length>0){var n,r;for(n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object}return null}},{key:"raycast",value:function(t,e){if(this.levels.length>0){Io.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Io);this.getObjectForDistance(n).raycast(t,e)}}},{key:"update",value:function(t){var e=this.levels;if(e.length>1){Io.setFromMatrixPosition(t.matrixWorld),jo.setFromMatrixPosition(this.matrixWorld);var n,r,i=Io.distanceTo(jo)/t.zoom;for(e[0].object.visible=!0,n=1,r=e.length;n<r&&i>=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)e[n].object.visible=!1}}},{key:"toJSON",value:function(t){var e=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var r=this.levels,i=0,o=r.length;i<o;i++){var a=r[i];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}]),n}(Oe),Ro=new kt,No=new Et,Lo=new Et,Do=new kt,Fo=new ee;function Uo(t,e){Fn.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new ee,this.bindMatrixInverse=new ee}function Bo(){Oe.call(this),this.type="Bone"}Uo.prototype=Object.assign(Object.create(Fn.prototype),{constructor:Uo,isSkinnedMesh:!0,copy:function(t){return Fn.prototype.copy.call(this,t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new Et,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Fn.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(t,e){var n=this.skeleton,r=this.geometry;No.fromBufferAttribute(r.attributes.skinIndex,t),Lo.fromBufferAttribute(r.attributes.skinWeight,t),Ro.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(var i=0;i<4;i++){var o=Lo.getComponent(i);if(0!==o){var a=No.getComponent(i);Fo.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),e.addScaledVector(Do.copy(Ro).applyMatrix4(Fo),o)}}return e.applyMatrix4(this.bindMatrixInverse)}}),Bo.prototype=Object.assign(Object.create(Oe.prototype),{constructor:Bo,isBone:!0});var Vo=new ee,zo=new ee,Ho=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Object(m.a)(this,t),this.uuid=mt.generateUUID(),this.bones=e.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}return Object(g.a)(t,[{key:"init",value:function(){var t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new ee)}}},{key:"calculateInverses",value:function(){this.boneInverses.length=0;for(var t=0,e=this.bones.length;t<e;t++){var n=new ee;this.bones[t]&&n.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(n)}}},{key:"pose",value:function(){for(var t=0,e=this.bones.length;t<e;t++){var n=this.bones[t];n&&n.matrixWorld.copy(this.boneInverses[t]).invert()}for(var r=0,i=this.bones.length;r<i;r++){var o=this.bones[r];o&&(o.parent&&o.parent.isBone?(o.matrix.copy(o.parent.matrixWorld).invert(),o.matrix.multiply(o.matrixWorld)):o.matrix.copy(o.matrixWorld),o.matrix.decompose(o.position,o.quaternion,o.scale))}}},{key:"update",value:function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,o=t.length;i<o;i++){var a=t[i]?t[i].matrixWorld:zo;Vo.multiplyMatrices(a,e[i]),Vo.toArray(n,16*i)}null!==r&&(r.needsUpdate=!0)}},{key:"clone",value:function(){return new t(this.bones,this.boneInverses)}},{key:"getBoneByName",value:function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}}},{key:"dispose",value:function(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}},{key:"fromJSON",value:function(t,e){this.uuid=t.uuid;for(var n=0,r=t.bones.length;n<r;n++){var i=t.bones[n],o=e[i];void 0===o&&(console.warn("THREE.Skeleton: No bone found with UUID:",i),o=new Bo),this.bones.push(o),this.boneInverses.push((new ee).fromArray(t.boneInverses[n]))}return this.init(),this}},{key:"toJSON",value:function(){var t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;for(var e=this.bones,n=this.boneInverses,r=0,i=e.length;r<i;r++){var o=e[r];t.bones.push(o.uuid);var a=n[r];t.boneInverses.push(a.toArray())}return t}}]),t}(),qo=new ee,Wo=new ee,Go=[],Yo=new Fn;function Xo(t,e,n){Fn.call(this,t,e),this.instanceMatrix=new tn(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}Xo.prototype=Object.assign(Object.create(Fn.prototype),{constructor:Xo,isInstancedMesh:!0,copy:function(t){return Fn.prototype.copy.call(this,t),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this},getColorAt:function(t,e){e.fromArray(this.instanceColor.array,3*t)},getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,r=this.count;if(Yo.geometry=this.geometry,Yo.material=this.material,void 0!==Yo.material)for(var i=0;i<r;i++){this.getMatrixAt(i,qo),Wo.multiplyMatrices(n,qo),Yo.matrixWorld=Wo,Yo.raycast(t,Go);for(var o=0,a=Go.length;o<a;o++){var s=Go[o];s.instanceId=i,s.object=this,e.push(s)}Go.length=0}},setColorAt:function(t,e){null===this.instanceColor&&(this.instanceColor=new tn(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Ko=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="LineBasicMaterial",r.color=new Qe(16777215),r.linewidth=1,r.linecap="round",r.linejoin="round",r.morphTargets=!1,r.setValues(t),r}
2return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this}}]),n}(He);Ko.prototype.isLineBasicMaterial=!0;var Qo=new kt,Jo=new kt,Zo=new ee,$o=new te,ta=new Gt;function ea(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ko;Oe.call(this),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}ea.prototype=Object.assign(Object.create(Oe.prototype),{constructor:ea,isLine:!0,copy:function(t){return Oe.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)Qo.fromBufferAttribute(e,r-1),Jo.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=Qo.distanceTo(Jo);t.setAttribute("lineDistance",new ln(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this},raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ta.copy(n.boundingSphere),ta.applyMatrix4(r),ta.radius+=i,!1!==t.ray.intersectsSphere(ta)){Zo.copy(r).invert(),$o.copy(t.ray).applyMatrix4(Zo);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,s=new kt,u=new kt,c=new kt,l=new kt,h=this.isLineSegments?2:1;if(n.isBufferGeometry){var f=n.index,d=n.attributes.position;if(null!==f)for(var p=f.array,v=0,m=p.length-1;v<m;v+=h){var g=p[v],y=p[v+1];if(s.fromBufferAttribute(d,g),u.fromBufferAttribute(d,y),!($o.distanceSqToSegment(s,u,l,c)>a)){l.applyMatrix4(this.matrixWorld);var b=t.ray.origin.distanceTo(l);b<t.near||b>t.far||e.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var _=0,w=d.count-1;_<w;_+=h){if(s.fromBufferAttribute(d,_),u.fromBufferAttribute(d,_+1),!($o.distanceSqToSegment(s,u,l,c)>a)){l.applyMatrix4(this.matrixWorld);var x=t.ray.origin.distanceTo(l);x<t.near||x>t.far||e.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},updateMorphTargets:function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i<o;i++){var a=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=i}}}}else{var s=t.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var na=new kt,ra=new kt;function ia(t,e){ea.call(this,t,e),this.type="LineSegments"}ia.prototype=Object.assign(Object.create(ea.prototype),{constructor:ia,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],r=0,i=e.count;r<i;r+=2)na.fromBufferAttribute(e,r),ra.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+na.distanceTo(ra);t.setAttribute("lineDistance",new ln(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}});var oa=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i;return Object(m.a)(this,n),(i=e.call(this,t,r)).type="LineLoop",i}return n}(ea);oa.prototype.isLineLoop=!0;var aa=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="PointsMaterial",r.color=new Qe(16777215),r.map=null,r.alphaMap=null,r.size=1,r.sizeAttenuation=!0,r.morphTargets=!1,r.setValues(t),r}
2return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this}}]),n}(He);aa.prototype.isPointsMaterial=!0;var sa=new ee,ua=new te,ca=new Gt,la=new kt;function ha(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new aa;Oe.call(this),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}function fa(t,e,n,r,i,o,a){var s=ua.distanceSqToPoint(t);if(s<n){var u=new kt;ua.closestPointToPoint(t,u),u.applyMatrix4(r);var c=i.ray.origin.distanceTo(u);if(c<i.near||c>i.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:u,index:e,face:null,object:a})}}ha.prototype=Object.assign(Object.create(Oe.prototype),{constructor:ha,isPoints:!0,copy:function(t){return Oe.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ca.copy(n.boundingSphere),ca.applyMatrix4(r),ca.radius+=i,!1!==t.ray.intersectsSphere(ca)){sa.copy(r).invert(),ua.copy(t.ray).applyMatrix4(sa);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,u=n.attributes.position;if(null!==s)for(var c=s.array,l=0,h=c.length;l<h;l++){var f=c[l];la.fromBufferAttribute(u,f),fa(la,f,a,r,t,e,this)}else for(var d=0,p=u.count;d<p;d++)la.fromBufferAttribute(u,d),fa(la,d,a,r,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},updateMorphTargets:function(){var t=this.geometry;if(t.isBufferGeometry){var e=t.morphAttributes,n=Object.keys(e);if(n.length>0){var r=e[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i<o;i++){var a=r[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=i}}}}else{var s=t.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i,o,a,s,u,c,l){var h;Object(m.a)(this,n),(h=e.call(this,t,r,i,o,a,s,u,c,l)).format=void 0!==u?u:H,h.minFilter=void 0!==s?s:R,h.magFilter=void 0!==a?a:R,h.generateMipmaps=!1;var f=Object(d.a)(h);return"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){f.needsUpdate=!0,t.requestVideoFrameCallback(e)})),h}return Object(g.a)(n,[{key:"clone",value:function(){return new this.constructor(this.image).copy(this)}},{key:"update",value:function(){var t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}]),n}(xt).prototype.isVideoTexture=!0;var da=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i,o,a,s,u,c,l,h,f,d){var p;return Object(m.a)(this,n),(p=e.call(this,null,s,u,c,l,h,o,a,f,d)).image={width:r,height:i},p.mipmaps=t,p.flipY=!1,p.generateMipmaps=!1,p}return n}(xt);da.prototype.isCompressedTexture=!0;var pa=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i,o,a,s,u,c,l){var h;return Object(m.a)(this,n),(h=e.call(this,t,r,i,o,a,s,u,c,l)).needsUpdate=!0,h}return n}(xt);pa.prototype.isCanvasTexture=!0,function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i,o,a,s,u,c,l,h){var f;if(Object(m.a)(this,n),(h=void 0!==h?h:W)!==W&&h!==G)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===i&&h===W&&(i=F),void 0===i&&h===G&&(i=z),(f=e.call(this,null,o,a,s,u,c,h,i,l)).image={width:t,height:r},f.magFilter=void 0!==u?u:I,f.minFilter=void 0!==c?c:I,f.flipY=!1,f.generateMipmaps=!1,f}return n}(xt).prototype.isDepthTexture=!0;var va=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;Object(m.a)(this,n),(t=e.call(this)).type="CircleGeometry",t.parameters={radiu
2s:r,segments:i,thetaStart:o,thetaLength:a},i=Math.max(3,i);var s=[],u=[],c=[],l=[],h=new kt,f=new gt;u.push(0,0,0),c.push(0,0,1),l.push(.5,.5);for(var d=0,p=3;d<=i;d++,p+=3){var v=o+d/i*a;h.x=r*Math.cos(v),h.y=r*Math.sin(v),u.push(h.x,h.y,h.z),c.push(0,0,1),f.x=(u[p]/r+1)/2,f.y=(u[p+1]/r+1)/2,l.push(f.x,f.y)}for(var g=1;g<=i;g++)s.push(g,g+1,0);return t.setIndex(s),t.setAttribute("position",new ln(u,3)),t.setAttribute("normal",new ln(c,3)),t.setAttribute("uv",new ln(l,2)),t}return n}(_n),ma=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;Object(m.a)(this,n),(t=e.call(this)).type="CylinderGeometry",t.parameters={radiusTop:r,radiusBottom:i,height:o,radialSegments:a,heightSegments:s,openEnded:u,thetaStart:c,thetaLength:l};var h=Object(d.a)(t);a=Math.floor(a),s=Math.floor(s);var f=[],p=[],v=[],g=[],y=0,b=[],_=o/2,w=0;function x(){for(var t=new kt,e=new kt,n=0,u=(i-r)/o,d=0;d<=s;d++){for(var m=[],x=d/s,T=x*(i-r)+r,E=0;E<=a;E++){var S=E/a,O=S*l+c,k=Math.sin(O),C=Math.cos(O);e.x=T*k,e.y=-x*o+_,e.z=T*C,p.push(e.x,e.y,e.z),t.set(k,u,C).normalize(),v.push(t.x,t.y,t.z),g.push(S,1-x),m.push(y++)}b.push(m)}for(var M=0;M<a;M++)for(var A=0;A<s;A++){var I=b[A][M],j=b[A+1][M],P=b[A+1][M+1],R=b[A][M+1];f.push(I,j,R),f.push(j,P,R),n+=6}h.addGroup(w,n,0),w+=n}function T(t){for(var e=y,n=new gt,o=new kt,s=0,u=!0===t?r:i,d=!0===t?1:-1,m=1;m<=a;m++)p.push(0,_*d,0),v.push(0,d,0),g.push(.5,.5),y++;for(var b=y,x=0;x<=a;x++){var T=x/a*l+c,E=Math.cos(T),S=Math.sin(T);o.x=u*S,o.y=_*d,o.z=u*E,p.push(o.x,o.y,o.z),v.push(0,d,0),n.x=.5*E+.5,n.y=.5*S*d+.5,g.push(n.x,n.y),y++}for(var O=0;O<a;O++){var k=e+O,C=b+O;!0===t?f.push(C,C+1,k):f.push(C+1,C,k),s+=3}h.addGroup(w,s,!0===t?1:2),w+=s}return x(),!1===u&&(r>0&&T(!0),i>0&&T(!1)),t.setIndex(f),t.setAttribute("position",new ln(p,3)),t.setAttribute("normal",new ln(v,3)),t.setAttribute("uv",new ln(g,2)),t}return n}(_n),ga=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return Object(m.a)(this,n),(t=e.call(this,0,r,i,o,a,s,u,c)).type="ConeGeometry",t.parameters={radius:r,height:i,radialSegments:o,heightSegments:a,openEnded:s,thetaStart:u,thetaLength:c},t}return n}(ma),ya=(new kt,new kt,new kt,new Ve,function(t,e,n){n=n||2;var r,i,o,a,s,u,c,l=e&&e.length,h=l?e[0]*n:t.length,f=ba(t,0,h,n,!0),d=[];if(!f||f.next===f.prev)return d;if(l&&(f=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=ba(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(Aa(a));for(s.sort(Oa),i=0;i<s.length;i++)ka(s[i],n),n=_a(n,n.next);return n}(t,e,f,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var p=n;p<h;p+=n)(s=t[p])<r&&(r=s),(u=t[p+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return wa(f,d,n,r,i,c),d});function ba(t,e,n,r,i){var o,a;if(i===function(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}(t,e,n,r)>0)for(o=e;o<n;o+=r)a=Ba(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=Ba(o,t[o],t[o+1],a);return a&&Ra(a,a.next)&&(Va(a),a=a.next),a}function _a(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Ra(r,r.next)&&0!==Pa(r.prev,r,r.next))r=r.next;else{if(Va(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function wa(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Ma(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<c&&(s++,r=r.nextZ);e++);for(u=c;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,c=t;t.prev!==t.next;
vendor: 1,805 bytes, line 2
2)if(s=t.prev,u=t.next,o?Ta(t,r,i,o):xa(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),Va(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?wa(t=Ea(_a(t),e,n),e,n,r,i,o,2):2===a&&Sa(t,e,n,r,i,o):wa(_a(t),e,n,r,i,o,1);break}}}function xa(t){var e=t.prev,n=t,r=t.next;if(Pa(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ia(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Pa(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ta(t,e,n,r){var i=t.prev,o=t,a=t.next;if(Pa(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=Ma(s,u,e,n,r),f=Ma(c,l,e,n,r),d=t.prevZ,p=t.nextZ;d&&d.z>=h&&p&&p.z<=f;){if(d!==t.prev&&d!==t.next&&Ia(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Pa(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&Ia(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Pa(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&Ia(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Pa(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&Ia(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Pa(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Ea(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Ra(i,o)&&Na(i,r,r.next,o)&&Fa(i,o)&&Fa(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Va(r),Va(r.next),r=t=o),r=r.next}while(r!==t);return _a(r)}function Sa(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ja(a,s)){var u=Ua(a,s);return a=_a(a,a.next),u=_a(u,u.next),wa(a,e,n,r,i,o),void wa(u,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function Oa(t,e){return t.x-e.x}function ka(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y
2);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n;var u,c=n,l=n.x,h=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=l&&i!==r.x&&Ia(o<h?i:a,o,l,h,o<h?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),Fa(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&Ca(n,r)))&&(n=r,f=u)),r=r.next}while(r!==c);return n}(t,e)){var n=Ua(e,t);_a(e,e.next),_a(n,n.next)}}function Ca(t,e){return Pa(t.prev,t,e.prev)<0&&Pa(e.next,t,t.next)<0}function Ma(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Aa(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Ia(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function ja(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Na(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Fa(t,e)&&Fa(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(Pa(t.prev,t,e.prev)||Pa(t,e.prev,e))||Ra(t,e)&&Pa(t.prev,t,t.next)>0&&Pa(e.prev,e,e.next)>0)}function Pa(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ra(t,e){return t.x===e.x&&t.y===e.y}function Na(t,e,n,r){var i=Da(Pa(t,e,n)),o=Da(Pa(t,e,r)),a=Da(Pa(n,r,t)),s=Da(Pa(n,r,e));return i!==o&&a!==s||(!(0!==i||!La(t,n,e))||(!(0!==o||!La(t,r,e))||(!(0!==a||!La(n,t,r))||!(0!==s||!La(n,e,r)))))}function La(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Da(t){return t>0?1:t<0?-1:0}function Fa(t,e){return Pa(t.prev,t,t.next)<0?Pa(t,e,t.next)>=0&&Pa(t,t.prev,e)>=0:Pa(t,e,t.prev)<0||Pa(t,t.next,e)<0}function Ua(t,e){var n=new za(t.i,t.x,t.y),r=new za(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Ba(t,e,n,r){var i=new za(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Va(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function za(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Ha={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return Ha.area(t)<0},triangulateShape:function(t,e){var n=[],r=[],i=[];qa(t),Wa(n,t);var o=t.length;e.forEach(qa);for(var a=0;a<e.length;a++)r.push(o),o+=e[a].length,Wa(n,e[a]);for(var s=ya(n,r),u=0;u<s.length;u+=3)i.push(s.slice(u,u+3));return i}};function qa(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Wa(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}var Ga=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i;Object(m.a)(this,n),(i=e.call(this)).type="ExtrudeGeometry",i.parameters={shapes:t,options:r},t=Array.isArray(t)?t:[t];for(var o=Object(d.a)(i),a=[],s=[],u=0,c=t.length;u<c;u++){l(t[u])}function l(t){var e=[],n=void 0!==r.curveSegments?r.curveSegments:12,i=void 0!==r.steps?r.steps:1,u=void 0!==r.depth?r.depth:100,c=void 0===r.bevelEnabled||r.bevelEnabled,l=void 0!==r.bevelThickness?r.bevelThickness:6,h=void 0!==r.bevelSize?r.bevelSize:l-2,f=void 0!==r.bevelOffset?r.bevelOffset:0,d=void 0!==r.bevelSegments?r.bevelSegments:3,p=r.extrudePath,v=void 0!==r.UVGenerator?r.UVGenerator:Ya;void 0!==r.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=r.amount);var m,g,y,b,_,w=!1;p&&(m=p.getSpacedPoints(i),w=!0,c=!1,g=p.computeFrenetFrames(i,!1),y=new kt,b=new kt,_=new kt),c||(d=0,l=0,h=0,f=0);var x=t.extractPoints(n),T=x.shape,E=x.holes;if(!Ha.isClockWise(T)){T=T.reverse();for(var S=0,O=E.length;S<O;S++){var k=E[S];Ha.isClockWise(k)&&(E[S]=k.reverse())}}for(var C=Ha.triangulateShape(T,E),M=T,A=0,I=E.length;A<I;A++){var j=E[A];T=T.concat(j)}function P(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var R=T.length,N=C.length;function L(t,e,n){var r,i,o,a=t.x-e.x,s=t.y-e.y,u=n.x-t.x,c=n.y-t.y,l=a*a+s*s,h=a*c-s*u;if(Math.abs(h)>Number.EPSILON){var f=Math.sqrt(l),d=Math.sqrt(u*u+c*c),p=e.x-s/f,v=e.y+a/f,m=((n.x-c/d-p)*c-(n.y+u/d-v)*u)/(a*c-s*u),g=(r=p+a*m-t.x)*r+(i=v+s*m-t.y)*i;if(g<=2)return new gt(r,i);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?u>Number.EPSILON&&(y=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(c)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new gt(r/o,i/o)}for(var D=[],F=0,U=M.length,B=U-1,V=F+1;F<U;F++,B++,V++)B===U&&(B=0),V===U&&(V=0),D[F]=L(M[F],M[B],M[V]);for(var z,H=[],q=D.concat(),W=0,G=E.length;W<G;W++){var Y=E[W];z=[];for(var X=0,K=Y.length,Q=K-1,J=X+1;X<K;X++,Q++,J++)Q===K&&(Q=0),J===K&&(J=0),z[X]=L(Y[X],Y[Q],Y[J]);H.push(z),q=q.concat(z)}for(var Z=0;Z<d;Z++){for(var $=Z/d,tt=l*Math.cos($*Math.PI/2),et=h*Math.sin($*Math.PI/2)+f,
2nt=0,rt=M.length;nt<rt;nt++){var it=P(M[nt],D[nt],et);Pt(it.x,it.y,-tt)}for(var ot=0,at=E.length;ot<at;ot++){var st=E[ot];z=H[ot];for(var ut=0,ct=st.length;ut<ct;ut++){var lt=P(st[ut],z[ut],et);Pt(lt.x,lt.y,-tt)}}}for(var ht=h+f,ft=0;ft<R;ft++){var dt=c?P(T[ft],q[ft],ht):T[ft];w?(b.copy(g.normals[0]).multiplyScalar(dt.x),y.copy(g.binormals[0]).multiplyScalar(dt.y),_.copy(m[0]).add(b).add(y),Pt(_.x,_.y,_.z)):Pt(dt.x,dt.y,0)}for(var pt=1;pt<=i;pt++)for(var vt=0;vt<R;vt++){var mt=c?P(T[vt],q[vt],ht):T[vt];w?(b.copy(g.normals[pt]).multiplyScalar(mt.x),y.copy(g.binormals[pt]).multiplyScalar(mt.y),_.copy(m[pt]).add(b).add(y),Pt(_.x,_.y,_.z)):Pt(mt.x,mt.y,u/i*pt)}for(var yt=d-1;yt>=0;yt--){for(var bt=yt/d,_t=l*Math.cos(bt*Math.PI/2),wt=h*Math.sin(bt*Math.PI/2)+f,xt=0,Tt=M.length;xt<Tt;xt++){var Et=P(M[xt],D[xt],wt);Pt(Et.x,Et.y,u+_t)}for(var St=0,Ot=E.length;St<Ot;St++){var Ct=E[St];z=H[St];for(var Mt=0,At=Ct.length;Mt<At;Mt++){var It=P(Ct[Mt],z[Mt],wt);w?Pt(It.x,It.y+m[i-1].y,m[i-1].x+_t):Pt(It.x,It.y,u+_t)}}}function jt(t,e){for(var n=t.length;--n>=0;){var r=n,o=n-1;o<0&&(o=t.length-1);for(var a=0,s=i+2*d;a<s;a++){var u=R*a,c=R*(a+1);Nt(e+r+u,e+o+u,e+o+c,e+r+c)}}}function Pt(t,n,r){e.push(t),e.push(n),e.push(r)}function Rt(t,e,n){Lt(t),Lt(e),Lt(n);var r=a.length/3,i=v.generateTopUV(o,a,r-3,r-2,r-1);Dt(i[0]),Dt(i[1]),Dt(i[2])}function Nt(t,e,n,r){Lt(t),Lt(e),Lt(r),Lt(e),Lt(n),Lt(r);var i=a.length/3,s=v.generateSideWallUV(o,a,i-6,i-3,i-2,i-1);Dt(s[0]),Dt(s[1]),Dt(s[3]),Dt(s[1]),Dt(s[2]),Dt(s[3])}function Lt(t){a.push(e[3*t+0]),a.push(e[3*t+1]),a.push(e[3*t+2])}function Dt(t){s.push(t.x),s.push(t.y)}!function(){var t=a.length/3;if(c){for(var e=0,n=R*e,r=0;r<N;r++){var s=C[r];Rt(s[2]+n,s[1]+n,s[0]+n)}n=R*(e=i+2*d);for(var u=0;u<N;u++){var l=C[u];Rt(l[0]+n,l[1]+n,l[2]+n)}}else{for(var h=0;h<N;h++){var f=C[h];Rt(f[2],f[1],f[0])}for(var p=0;p<N;p++){var v=C[p];Rt(v[0]+R*i,v[1]+R*i,v[2]+R*i)}}o.addGroup(t,a.length/3-t,0)}(),function(){var t=a.length/3,e=0;jt(M,e),e+=M.length;for(var n=0,r=E.length;n<r;n++){var i=E[n];jt(i,e),e+=i.length}o.addGroup(t,a.length/3-t,1)}()}return i.setAttribute("position",new ln(a,3)),i.setAttribute("uv",new ln(s,2)),i.computeVertexNormals(),i}return Object(g.a)(n,[{key:"toJSON",value:function(){var t=_n.prototype.toJSON.call(this);return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}}]),n}(_n),Ya={generateTopUV:function(t,e,n,r,i){var o=e[3*n],a=e[3*n+1],s=e[3*r],u=e[3*r+1],c=e[3*i],l=e[3*i+1];return[new gt(o,a),new gt(s,u),new gt(c,l)]},generateSideWallUV:function(t,e,n,r,i,o){var a=e[3*n],s=e[3*n+1],u=e[3*n+2],c=e[3*r],l=e[3*r+1],h=e[3*r+2],f=e[3*i],d=e[3*i+1],p=e[3*i+2],v=e[3*o],m=e[3*o+1],g=e[3*o+2];return Math.abs(s-l)<.01?[new gt(a,1-u),new gt(c,1-h),new gt(f,1-p),new gt(v,1-g)]:[new gt(s,1-u),new gt(l,1-h),new gt(d,1-p),new gt(m,1-g)]}};function Xa(t,e,n){_n.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n};var r=[],i=[],o=[],a=[],s=1e-5,u=new kt,c=new kt,l=new kt,h=new kt,f=new kt;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var d=e+1,p=0;p<=n;p++)for(var v=p/n,m=0;m<=e;m++){var g=m/e;t(g,v,c),i.push(c.x,c.y,c.z),g-s>=0?(t(g-s,v,l),h.subVectors(c,l)):(t(g+s,v,l),h.subVectors(l,c)),v-s>=0?(t(g,v-s,l),f.subVectors(c,l)):(t(g,v+s,l),f.subVectors(l,c)),u.crossVectors(h,f).normalize(),o.push(u.x,u.y,u.z),a.push(g,v)}for(var y=0;y<n;y++)for(var b=0;b<e;b++){var _=y*d+b,w=y*d+b+1,x=(y+1)*d+b+1,T=(y+1)*d+b;r.push(_,w,T),r.push(w,x,T)}this.setIndex(r),this.setAttribute("position",new ln(i,3)),this.setAttribute("normal",new ln(o,3)),this.setAttribute("uv",new ln(a,2))}Xa.prototype=Object.create(_n.prototype),Xa.prototype.constructor=Xa;var Ka=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;Object(m.a)(this,n),(r=e.call(this)).type="ShapeGeometry",r.parameters={shapes:t,curveSegments:i};var o=[],a=[],s=[],u=[],c=0,l=0;if(!1===Array.isArray(t))f(t);else for(var h=0;h<t.length;h++)f(t[h]),r.addGroup(c,l,h),c+=l,l=0;function f(t){var e=a.length/3,n=t.extractPoints(i),r=n.shape,c=n.holes;!1===Ha.isClockWise(r)&&(r=r.reverse());for(var h=0,f=c.length;h<f;h++){var d=c[h];!0===Ha.isClockWise(d)&&(c[h]=d.reverse())}for(var p=Ha.triangulateShape(r,c),v=0,m=c.length;v<m;v++){var g=c[v];r=r.concat(g)}for(var y=0,b=r.length;y<b;y++){var _=r[y];a.push(_.x,_.y,0),s.push(0,0,1),u.push(_.x,_.y)}for(var w=0,x=p.length;w<x;w++){var T=p[w],E=T[0]+e,S=T[1]+e,O=T[2]+e;o.push(E,S,O),l+=3}}return r.setIndex(o),r.setAttribute("position",new ln(a,3)),r.setAttribute("normal",new ln(s,3)),r.setAttribute("uv",new ln(u,2)),r}return Object(g.a)(n,[{key:"toJSON",value:function(){var t=_n.prototype.toJSON.call(this);return function(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}}]),n}(_n);var Qa=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;Object(m.a)(this,n),(t=e.call(this)).type="SphereGeometry",t.parameters={radiu
2s:r,widthSegments:i,heightSegments:o,phiStart:a,phiLength:s,thetaStart:u,thetaLength:c},i=Math.max(3,Math.floor(i)),o=Math.max(2,Math.floor(o));for(var l=Math.min(u+c,Math.PI),h=0,f=[],d=new kt,p=new kt,v=[],g=[],y=[],b=[],_=0;_<=o;_++){var w=[],x=_/o,T=0;0==_&&0==u?T=.5/i:_==o&&l==Math.PI&&(T=-.5/i);for(var E=0;E<=i;E++){var S=E/i;d.x=-r*Math.cos(a+S*s)*Math.sin(u+x*c),d.y=r*Math.cos(u+x*c),d.z=r*Math.sin(a+S*s)*Math.sin(u+x*c),g.push(d.x,d.y,d.z),p.copy(d).normalize(),y.push(p.x,p.y,p.z),b.push(S+T,1-x),w.push(h++)}f.push(w)}for(var O=0;O<o;O++)for(var k=0;k<i;k++){var C=f[O][k+1],M=f[O][k],A=f[O+1][k],I=f[O+1][k+1];(0!==O||u>0)&&v.push(C,M,I),(O!==o-1||l<Math.PI)&&v.push(M,A,I)}return t.setIndex(v),t.setAttribute("position",new ln(g,3)),t.setAttribute("normal",new ln(y,3)),t.setAttribute("uv",new ln(b,2)),t}return n}(_n),Ja=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="ShadowMaterial",r.color=new Qe(0),r.transparent=!0,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this}}]),n}(He);Ja.prototype.isShadowMaterial=!0;var Za=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this,t)).type="RawShaderMaterial",r}return n}(qn);function $a(t){He.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Qe(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Qe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=st,this.normalScale=new gt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(t)}function ts(t){$a.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new gt(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=mt.clamp(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(t)}Za.prototype.isRawShaderMaterial=!0,$a.prototype=Object.create(He.prototype),$a.prototype.constructor=$a,$a.prototype.isMeshStandardMaterial=!0,$a.prototype.copy=function(t){return He.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this},ts.prototype=Object.create($a.prototype),ts.prototype.constructor=ts,ts.prototype.isMeshPhysicalMaterial=!0,ts.prototype.copy=function(t){return $a.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new Qe).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this};var es=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="MeshPhongMaterial",r.color=new Qe(16777215),r.specular=new Qe(1118481),r.shininess=30,r.map=null,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=null,r.aoMapIntensity=1,r.emissive=new Qe(0),r.emissiveIntensity=1,r.emissiveMap=null,r.bumpMap=null,r.bumpScale=1,r.normalMap=null,r.normalMapType=st,r.normalScale=new gt(1,1),r.displacementMap=null,r.dis
2placementScale=1,r.displacementBias=0,r.specularMap=null,r.alphaMap=null,r.envMap=null,r.combine=0,r.reflectivity=1,r.refractionRatio=.98,r.wireframe=!1,r.wireframeLinewidth=1,r.wireframeLinecap="round",r.wireframeLinejoin="round",r.skinning=!1,r.morphTargets=!1,r.morphNormals=!1,r.flatShading=!1,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}]),n}(He);es.prototype.isMeshPhongMaterial=!0;var ns=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).defines={TOON:""},r.type="MeshToonMaterial",r.color=new Qe(16777215),r.map=null,r.gradientMap=null,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=null,r.aoMapIntensity=1,r.emissive=new Qe(0),r.emissiveIntensity=1,r.emissiveMap=null,r.bumpMap=null,r.bumpScale=1,r.normalMap=null,r.normalMapType=st,r.normalScale=new gt(1,1),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.alphaMap=null,r.wireframe=!1,r.wireframeLinewidth=1,r.wireframeLinecap="round",r.wireframeLinejoin="round",r.skinning=!1,r.morphTargets=!1,r.morphNormals=!1,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}]),n}(He);ns.prototype.isMeshToonMaterial=!0;var rs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="MeshNormalMaterial",r.bumpMap=null,r.bumpScale=1,r.normalMap=null,r.normalMapType=st,r.normalScale=new gt(1,1),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.wireframe=!1,r.wireframeLinewidth=1,r.fog=!1,r.skinning=!1,r.morphTargets=!1,r.morphNormals=!1,r.flatShading=!1,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}]),n}(He);rs.prototype.isMeshNormalMaterial=!0;var is=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="MeshLambertMaterial",r.color=new Qe(16777215),r.map=null,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=null,r.aoMapIntensity=1,r.emissive=new Qe(0),r.emissiveIntensity=1,r.emissiveMap=null,r.specularMap=null,r.alphaMap=null,r.envMap=null,r.combine=0,r.reflectivity=1,r.refractionRatio=.98,r.wireframe=!1,r.wireframeLinewidth=1,r.wireframeLinecap="round",r.wireframeLinejoin="round",r.skinning=!1,r.morphTargets=!1,r.morphNormals=!1,r.setValues(t),r}
2return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this}}]),n}(He);is.prototype.isMeshLambertMaterial=!0;var os=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).defines={MATCAP:""},r.type="MeshMatcapMaterial",r.color=new Qe(16777215),r.matcap=null,r.map=null,r.bumpMap=null,r.bumpScale=1,r.normalMap=null,r.normalMapType=st,r.normalScale=new gt(1,1),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.alphaMap=null,r.skinning=!1,r.morphTargets=!1,r.morphNormals=!1,r.flatShading=!1,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.flatShading=t.flatShading,this}}]),n}(He);os.prototype.isMeshMatcapMaterial=!0;var as=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="LineDashedMaterial",r.scale=1,r.dashSize=3,r.gapSize=1,r.setValues(t),r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}]),n}(Ko);as.prototype.isLineDashedMaterial=!0;var ss={arraySlice:function(t,e,n){return ss.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"===typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),r=0;r!==e;++r)n[r]=r;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*e,u=0;u!==e;++u)i[a++]=t[s+u];return i},flattenJSON:function(t,e,n,r){for(var i=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)}},subclip:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30,o=t.clone();o.name=e;for(var a=[],s=0;s<o.tracks.length;++s){for(var u=o.tracks[s],c=u.getValueSize(),l=[],h=[],f=0;f<u.times.length;++f){var d=u.times[f]*i;if(!(d<n||d>=r)){l.push(u.times[f]);for(var p=0;p<c;++p)h.push(u.values[f*c+p])}}0!==l.length&&(u.times=ss.convertArray(l,u.times.constructor),u.values=ss.convertArray(h,u.values.constructor),a.push(u))}o.tracks=a;for(var v=1/0,m=0;m<o.tracks.length;++m)v>o.tracks[m].times[0]&&(v=o.tracks[m].times[0]);for(var g=0;g<o.tracks.length;++g)o.tracks[g].shift(-1*v);return o.resetDuration(),o},makeClipAdditive:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);for(var i=n.tracks.length,o=e/r,a=function(e){var r=n.tracks[e],i=r.ValueTypeName;if("bool"===i||"string"===i)return"continue";var a=t.tracks.find((function(t){return t.name===r.name&&t.ValueTypeName===i}));if(void 0===a)return"continue";var s=0,u=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=u/3);var c=0,l=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=l/3);var h=r.times.length-1,f=void 0;if(o<=r.times[0]){var d=s,p=u-s;f=ss.arraySlice(r.values,d,p)}else if(o>=r.times[h]){var v=h*u+s,m=v+u-s;f=ss.arraySlice(r.values,v,m)}else{var g=r.createInterpolant(),y=s,b=u-s;g.evaluate(o),f=ss.arraySlice(g.resultBuffer,y,b)}"quaternion"===i&&(new Ot).fromArray(f).normalize().conjugate().toArray(f);for(var _=a.times.length,w=0;w<_;++w){var x=w*l+c;if("quaternion"===i)Ot.multiplyQuaternionsFlat(a.values,x,f,0,a.values,x);else for(var T=l-2*c,E=0;E<T;++E)a.values[x+E]-=f[E]}},s=0;s<i;++s)a(s);return t.blendMode=tt,t}};function us(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function cs(t,e,n,r){us.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ls(t,e,n,r){us.call(this,t,e,n,r)}function hs(t,e,n,r){us.call(this,t,e,n,r)}Object.assign(us.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var o;n:{r:if(!(t<r)){for(var a=n+2;;){if(void 0===r){if(t<i)break r;
2return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===a)break;if(i=r,t<(r=e[++n]))break e}o=e.length;break n}if(t>=i)break t;var s=e[1];t<s&&(n=2,i=s);for(var u=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===u)break;if(r=i,t>=(i=e[--n-1]))break e}o=n,n=0}for(;n<o;){var c=n+o>>>1;t<e[c]?o=c:n=c+1}if(r=e[n],void 0===(i=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r,o=0;o!==r;++o)e[o]=n[i+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(us.prototype,{beforeStart_:us.prototype.copySampleValue_,afterEnd_:us.prototype.copySampleValue_}),cs.prototype=Object.assign(Object.create(us.prototype),{constructor:cs,DefaultSettings_:{endingStart:Q,endingEnd:Q},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,o=t+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case J:i=t,a=2*e-n;break;case Z:a=e+r[i=r.length-2]-r[i+1];break;default:i=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case J:o=t,s=2*n-e;break;case Z:o=1,s=n+r[1]-r[0];break;default:o=t-1,s=e}var u=.5*(n-e),c=this.valueSize;this._weightPrev=u/(e-a),this._weightNext=u/(s-n),this._offsetPrev=i*c,this._offsetNext=o*c},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,u=s-a,c=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,f=this._weightNext,d=(n-e)/(r-e),p=d*d,v=p*d,m=-h*v+2*h*p-h*d,g=(1+h)*v+(-1.5-2*h)*p+(-.5+h)*d+1,y=(-1-f)*v+(1.5+f)*p+.5*d,b=f*v-f*p,_=0;_!==a;++_)i[_]=m*o[c+_]+g*o[u+_]+y*o[s+_]+b*o[l+_];return i}}),ls.prototype=Object.assign(Object.create(us.prototype),{constructor:ls,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,u=s-a,c=(n-e)/(r-e),l=1-c,h=0;h!==a;++h)i[h]=o[u+h]*l+o[s+h]*c;return i}}),hs.prototype=Object.assign(Object.create(us.prototype),{constructor:hs,interpolate_:function(t){return this.copySampleValue_(t-1)}});var fs=function(){function t(e,n,r,i){if(Object(m.a)(this,t),void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===n||0===n.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ss.convertArray(n,this.TimeBufferType),this.values=ss.convertArray(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}return Object(g.a)(t,[{key:"InterpolantFactoryMethodDiscrete",value:function(t){return new hs(this.times,this.values,this.getValueSize(),t)}},{key:"InterpolantFactoryMethodLinear",value:function(t){return new ls(this.times,this.values,this.getValueSize(),t)}},{key:"InterpolantFactoryMethodSmooth",value:function(t){return new cs(this.times,this.values,this.getValueSize(),t)}},{key:"setInterpolation",value:function(t){var e;switch(t){case Y:e=this.InterpolantFactoryMethodDiscrete;break;case X:e=this.InterpolantFactoryMethodLinear;break;case K:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}},{key:"getInterpolation",value:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Y;case this.InterpolantFactoryMethodLinear:return X;case this.InterpolantFactoryMethodSmooth:return K}}},{key:"getValueSize",value:function(){return this.values.length/this.times.length}},{key:"shift",value:function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this}},{key:"scale",value:function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this}},{key:"trim",value:function(t,e){for(var n=this.times,r=n.length,i=0,o=r-1;i!==r&&n[i]<t;)++i;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=ss.arraySlice(n,i,o),this.values=ss.arraySlice(this.values,i*a,o*a)}return this}},{key:"validate",value:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"===typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==r&&ss.isTypedArray(r))for(var u=0,c=r.length;u!==c;++u){var l=r[u];
2if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,l),t=!1;break}}return t}},{key:"optimize",value:function(){for(var t=ss.arraySlice(this.times),e=ss.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===K,i=t.length-1,o=1,a=1;a<i;++a){var s=!1,u=t[a];if(u!==t[a+1]&&(1!==a||u!==t[0]))if(r)s=!0;else for(var c=a*n,l=c-n,h=c+n,f=0;f!==n;++f){var d=e[c+f];if(d!==e[l+f]||d!==e[h+f]){s=!0;break}}if(s){if(a!==o){t[o]=t[a];for(var p=a*n,v=o*n,m=0;m!==n;++m)e[v+m]=e[p+m]}++o}}if(i>0){t[o]=t[i];for(var g=i*n,y=o*n,b=0;b!==n;++b)e[y+b]=e[g+b];++o}return o!==t.length?(this.times=ss.arraySlice(t,0,o),this.values=ss.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this}},{key:"clone",value:function(){var t=ss.arraySlice(this.times,0),e=ss.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}],[{key:"toJSON",value:function(t){var e,n=t.constructor;if(n.toJSON!==this.toJSON)e=n.toJSON(t);else{e={name:t.name,times:ss.convertArray(t.times,Array),values:ss.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}]),t}();fs.prototype.TimeBufferType=Float32Array,fs.prototype.ValueBufferType=Float32Array,fs.prototype.DefaultInterpolation=X;var ds=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.apply(this,arguments)}return n}(fs);ds.prototype.ValueTypeName="bool",ds.prototype.ValueBufferType=Array,ds.prototype.DefaultInterpolation=Y,ds.prototype.InterpolantFactoryMethodLinear=void 0,ds.prototype.InterpolantFactoryMethodSmooth=void 0;var ps=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.apply(this,arguments)}return n}(fs);ps.prototype.ValueTypeName="color";var vs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.apply(this,arguments)}return n}(fs);function ms(t,e,n,r){us.call(this,t,e,n,r)}vs.prototype.ValueTypeName="number",ms.prototype=Object.assign(Object.create(us.prototype),{constructor:ms,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-e)/(r-e),u=t*a,c=u+a;u!==c;u+=4)Ot.slerpFlat(i,0,o,u-a,o,u,s);return i}});var gs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.apply(this,arguments)}return Object(g.a)(n,[{key:"InterpolantFactoryMethodLinear",value:function(t){return new ms(this.times,this.values,this.getValueSize(),t)}}]),n}(fs);gs.prototype.ValueTypeName="quaternion",gs.prototype.DefaultInterpolation=X,gs.prototype.InterpolantFactoryMethodSmooth=void 0;var ys=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.apply(this,arguments)}return n}(fs);ys.prototype.ValueTypeName="string",ys.prototype.ValueBufferType=Array,ys.prototype.DefaultInterpolation=Y,ys.prototype.InterpolantFactoryMethodLinear=void 0,ys.prototype.InterpolantFactoryMethodSmooth=void 0;var bs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.apply(this,arguments)}return n}(fs);bs.prototype.ValueTypeName="vector";var _s=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$;Object(m.a)(this,t),this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=mt.generateUUID(),this.duration<0&&this.resetDuration()}return Object(g.a)(t,[{key:"resetDuration",value:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}},{key:"trim",value:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}},{key:"validate",value:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}},{key:"optimize",value:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}},{key:"clone",value:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}},{key:"toJSON",value:function(){return this.constructor.toJSON(this)}}],[{key:"parse",value:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(ws(n[i]).scale(r));var a=new this(t.name,t.duration,e,t.blendMode);return a.uuid=t.uuid,a}},{key:"toJSON",value:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},i=0,o=n.length;i!==o;++i)e.push(fs.toJSON(n[i]));return r}},{key:"CreateFromMorphTargetSequence",value:function(t,e,n,r){for(var i=e.length,o=[],a=0;a<i;a++){var s=[],u=[];s.push((a+i-1)%i,a,(a+1)%i),u.push(0,1,0);var c=ss.getKeyframeOrder(s);s=ss.sortedArray(s,1,c),u=ss.sortedArray(u,1,c),r||0!==s[0]||(s.push(i),u.push(u[0])),o.push(new vs(".morphTargetInfluences["+e[a].name+"]",s,u).scale(1/n))}return new this(t,-1,o)}},{key:"findByName",value:function(t,e){var n=t;if(!Array.isArray(t)){var r=t;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null}},{key:"CreateClipsFromMorphTargetSequences",value:function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],u=s.name.match(i);if(u&&u.length>1){var c=u[1],l=r[c];l||(r[c]=l=[]),l.push(s)}}var h=[];for(var f in r)h.push(this.CreateFromMorphTargetSequence(f,r[f],e,n));return h}},{key:"parseAnimation",value:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var o=[],a=[];ss.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.fps||30,a=t.blendMode,s=t.length||-1,u=t.hierarchy||[],c=0;c<u.length;c++){var l=u[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){var h={},f=void 0;for(f=0;f<l.length;f++)if(l[f].morphTargets)for(var d=0;d<l[f].morphTargets.length;d++)h[l[f].morphTargets[d]]=-1;for(var p in h){for(var v=[],m=[],g=0;g!==l[f].morphTargets.length;++g){var y=l[f];v.push(y.time),m.push(y.morphTarget===p?1:0)}r.push(new vs(".morphTargetInfluence["+p+"]",v,m))}s=h.length*(o||1)}else{var b=".bones["+e[c].name+"]";n(bs,b+".position",l,"pos",r),n(gs,b+".quaternion",l,"rot",r),n(bs,b+".scale",l,"scl",r)}}return 0===r.length?null:new this(i,s,r,a)}}]),t}();function ws(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return vs;
2case"vector":case"vector2":case"vector3":case"vector4":return bs;case"color":return ps;case"quaternion":return gs;case"bool":case"boolean":return ds;case"string":return ys}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],r=[];ss.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}var xs={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function Ts(t,e,n){var r=this,i=!1,o=0,a=0,s=void 0,u=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===i&&void 0!==r.onStart&&r.onStart(t,o,a),i=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return u.push(t,e),this},this.removeHandler=function(t){var e=u.indexOf(t);return-1!==e&&u.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=u.length;e<n;e+=2){var r=u[e],i=u[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}}var Es=new Ts;function Ss(t){this.manager=void 0!==t?t:Es,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(Ss.prototype,{load:function(){},loadAsync:function(t,e){var n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});var Os={};function ks(t){Ss.call(this,t)}ks.prototype=Object.assign(Object.create(Ss.prototype),{constructor:ks,load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=xs.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;if(void 0===Os[t]){var a,s=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(s){var u=s[1],c=!!s[2],l=s[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var h,f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);h="blob"===f?new Blob([d.buffer],{type:u}):d.buffer;break;case"document":var v=new DOMParser;h=v.parseFromString(l,u);break;case"json":h=JSON.parse(l);break;default:h=l}setTimeout((function(){e&&e(h),i.manager.itemEnd(t)}),0)}catch(g){setTimeout((function(){r&&r(g),i.manager.itemError(t),i.manager.itemEnd(t)}),0)}}else{for(var m in Os[t]=[],Os[t].push({onLoad:e,onProgress:n,onError:r}),(a=new XMLHttpRequest).open("GET",t,!0),a.addEventListener("load",(function(e){var n=this.response,r=Os[t];if(delete Os[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),xs.add(t,n);for(var o=0,a=r.length;o<a;o++){var s=r[o];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(t)}else{for(var u=0,c=r.length;u<c;u++){var l=r[u];l.onError&&l.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}}),!1),a.addEventListener("progress",(function(e){for(var n=Os[t],r=0,i=n.length;r<i;r++){var o=n[r];o.onProgress&&o.onProgress(e)}}),!1),a.addEventListener("error",(function(e){var n=Os[t];delete Os[t];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}),!1),a.addEventListener("abort",(function(e){var n=Os[t];delete Os[t];for(var r=0,o=n.length;r<o;r++){var a=n[r];a.onError&&a.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.overrideMimeType&&a.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)a.setRequestHeader(m,this.requestHeader[m]);a.send(null)}return i.manager.itemStart(t),a}Os[t].push({onLoad:e,onProgress:n,onError:r})},setResponseType:function(t){return this.responseType=t,this},setMimeType:function(t){return this.mimeType=t,this}});function Cs(t){Ss.call(this,t)}Cs.prototype=Object.assign(Object.create(Ss.prototype),{constructor:Cs,load:function(t,e,n,r){var i=this,o=[],a=new da,s=new ks(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);var u=0;function c(c){s.load(t[c],(function(t){var n=i.parse(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(u+=1)&&(1===n.mipmapCount&&(a.minFilter=R),a.image=o,a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,r)}if(Array.isArray(t))for(var l=0,h=t.length;l<h;++l)c(l);else s.load(t,(function(t){var n=i.parse(t,!0);if(n.isCubemap){for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){o[s]={mipmaps:[]};for(var u=0;u<n.mipmapCount;u++)o[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+u]),o[s].format=n.format,o[s].width=n.width,o[s].height=n.height}a.image=o}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=R),a.format=n.format,a.needsUpdate=!0,e&&e(a)}),n,r);return a}});var Ms=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){return Object(m.a)(this,n),e.call(this,t)}return Object(g.a)(n,[{key:"load",value:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=xs.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",u,!1),xs.add(t,this),e&&e(this),i.manager.itemEnd(t)}function u(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",u,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",u,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(t),a.src=t,a}}]),n}(Ss),As=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){return Object(m.a)(this,n),e.call(this,t)}return Object(g.a)(n,[{key:"load",value:function(t,e,n,r){var i=new Kn,o=new Ms(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(n){o.load(t[n],(function(t){i.images[n]=t,6===++a&&(i.needsUpdate=!0,e&&e(i))}),void 0,r)}for(var u=0;u<t.length;++u)s(u);return i}}]),n}(Ss);function Is(t){Ss.call(this,t)}function js(t){Ss.call(this,t)}function Ps(){this.type="Curve",this.arcLengthDivisions=200}Is.prototype=Object.assign(Object.create(Ss.prototype),{constructor:Is,load:function(t,e,n,r){var i=this,o=new Jn,a=new ks(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(i.withCredentials),a.load(t,(function(t){var n=i.parse(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:M,o.wrapT=void 0!==n.wrapT?n.wrapT:M,o.magFilter=void 0!==n.magFilter?n.magFilter:R,o.minFilter=void 0!==n.minFilter?n.minFilter:R,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(o.encoding=n.encoding),void 0!==n.flipY&&(o.flipY=n.flipY),void 0!==n.format&&(o.format=n.format),void 0!==n.t
2ype&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=L),1===n.mipmapCount&&(o.minFilter=R),o.needsUpdate=!0,e&&e(o,n))}),n,r),o}}),js.prototype=Object.assign(Object.create(Ss.prototype),{constructor:js,load:function(t,e,n,r){var i=new xt,o=new Ms(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){i.image=n;var r=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);i.format=r?H:q,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}),Object.assign(Ps.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=t;o++)i+=(e=this.getPoint(o/t)).distanceTo(r),n.push(i),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,r=this.getLengths(),i=0,o=r.length;n=e||t*r[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=r[i=Math.floor(s+(u-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(o-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(o-1)},getTangent:function(t,e){var n=1e-4,r=t-n,i=t+n;r<0&&(r=0),i>1&&(i=1);var o=this.getPoint(r),a=this.getPoint(i),s=e||(o.isVector2?new gt:new kt);return s.copy(a).sub(o).normalize(),s},getTangentAt:function(t,e){var n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){for(var n=new kt,r=[],i=[],o=[],a=new kt,s=new ee,u=0;u<=t;u++){var c=u/t;r[u]=this.getTangentAt(c,new kt),r[u].normalize()}i[0]=new kt,o[0]=new kt;var l=Number.MAX_VALUE,h=Math.abs(r[0].x),f=Math.abs(r[0].y),d=Math.abs(r[0].z);h<=l&&(l=h,n.set(1,0,0)),f<=l&&(l=f,n.set(0,1,0)),d<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(var p=1;p<=t;p++){if(i[p]=i[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(r[p-1],r[p]),a.length()>Number.EPSILON){a.normalize();var v=Math.acos(mt.clamp(r[p-1].dot(r[p]),-1,1));i[p].applyMatrix4(s.makeRotationAxis(a,v))}o[p].crossVectors(r[p],i[p])}if(!0===e){var m=Math.acos(mt.clamp(i[0].dot(i[t]),-1,1));m/=t,r[0].dot(a.crossVectors(i[0],i[t]))>0&&(m=-m);for(var g=1;g<=t;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],m*g)),o[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}});var Rs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return Object(m.a)(this,n),(t=e.call(this)).type="EllipseCurve",t.aX=r,t.aY=i,t.xRadius=o,t.yRadius=a,t.aStartAngle=s,t.aEndAngle=u,t.aClockwise=c,t.aRotation=l,t}return Object(g.a)(n,[{key:"getPoint",value:function(t,e){for(var n=e||new gt,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);var a=this.aStartAngle+t*i,s=this.aX+this.xRadius*Math.cos(a),u=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),l=Math.sin(this.aRotation),h=s-this.aX,f=u-this.aY;s=h*c-f*l+this.aX,u=h*l+f*c+this.aY}return n.set(s,u)}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}]),n}(Ps);Rs.prototype.isEllipseCurve=!0;var Ns=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i,o,a,s){var u;return Object(m.a)(this,n),(u=e.call(this,t,r,i,i,o,a,s)).type="ArcCurve",u}return n}(Rs);function Ls(){var t=0,e=0,n=0,r=0;function i(i,o,a,s){t=i,e=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(t,e,n,r,o){i(e,n,o*(n-t),o*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,o,a,s){var u=(e-t)/o-(n-t)/(o+a)+(n-e)/a,c=(n-e)/a-(r-e)/(a+s)+(r-n)/s;i(e,n,u*=a,c*=a)},calc:function(i){var o=i*i;
2return t+e*i+n*o+r*(o*i)}}}Ns.prototype.isArcCurve=!0;var Ds=new kt,Fs=new Ls,Us=new Ls,Bs=new Ls,Vs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return Object(m.a)(this,n),(t=e.call(this)).type="CatmullRomCurve3",t.points=r,t.closed=i,t.curveType=o,t.tension=a,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt,i=r,o=this.points,a=o.length,s=(a-(this.closed?0:1))*t,u=Math.floor(s),c=s-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/a)+1)*a:0===c&&u===a-1&&(u=a-2,c=1),this.closed||u>0?e=o[(u-1)%a]:(Ds.subVectors(o[0],o[1]).add(o[0]),e=Ds);var l=o[u%a],h=o[(u+1)%a];if(this.closed||u+2<a?n=o[(u+2)%a]:(Ds.subVectors(o[a-1],o[a-2]).add(o[a-1]),n=Ds),"centripetal"===this.curveType||"chordal"===this.curveType){var f="chordal"===this.curveType?.5:.25,d=Math.pow(e.distanceToSquared(l),f),p=Math.pow(l.distanceToSquared(h),f),v=Math.pow(h.distanceToSquared(n),f);p<1e-4&&(p=1),d<1e-4&&(d=p),v<1e-4&&(v=p),Fs.initNonuniformCatmullRom(e.x,l.x,h.x,n.x,d,p,v),Us.initNonuniformCatmullRom(e.y,l.y,h.y,n.y,d,p,v),Bs.initNonuniformCatmullRom(e.z,l.z,h.z,n.z,d,p,v)}else"catmullrom"===this.curveType&&(Fs.initCatmullRom(e.x,l.x,h.x,n.x,this.tension),Us.initCatmullRom(e.y,l.y,h.y,n.y,this.tension),Bs.initCatmullRom(e.z,l.z,h.z,n.z,this.tension));return i.set(Fs.calc(c),Us.calc(c),Bs.calc(c)),i}},{key:"copy",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.points=[];for(var e=0,r=t.points.length;e<r;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);t.points=[];for(var e=0,r=this.points.length;e<r;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}},{key:"fromJSON",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.points=[];for(var e=0,r=t.points.length;e<r;e++){var i=t.points[e];this.points.push((new kt).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}]),n}(Ps);function zs(t,e,n,r,i){var o=.5*(r-e),a=.5*(i-n),s=t*t;return(2*n-2*r+o+a)*(t*s)+(-3*n+3*r-2*o-a)*s+o*t+n}function Hs(t,e,n,r){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function qs(t,e,n,r,i){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}Vs.prototype.isCatmullRomCurve3=!0;var Ws=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new gt,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new gt;return Object(m.a)(this,n),(t=e.call(this)).type="CubicBezierCurve",t.v0=r,t.v1=i,t.v2=o,t.v3=a,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt,n=e,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(qs(t,r.x,i.x,o.x,a.x),qs(t,r.y,i.y,o.y,a.y)),n}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}]),n}(Ps);Ws.prototype.isCubicBezierCurve=!0;var Gs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new kt,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new kt;return Object(m.a)(this,n),(t=e.call(this)).type="CubicBezierCurve3",t.v0=r,t.v1=i,t.v2=o,t.v3=a,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt,n=e,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(qs(t,r.x,i.x,o.x,a.x),qs(t,r.y,i.y,o.y,a.y),qs(t,r.z,i.z,o.z,a.z)),n}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}]),n}(Ps);Gs.prototype.isCubicBezierCurve3=!0;var Ys=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt;return Object(m.a)(this,n),(t=e.call(this)).type="LineCurve",t.v1=r,t.v2=i,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt,n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"getTangent",value:function(t,e){var n=e||new gt;return n.copy(this.v2).sub(this.v1).normalize(),n}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}]),n}(Ps);Ys.prototype.isLineCurve=!0;var Xs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt;return Object(m.a)(this,n),(t=e.call(this)).type="LineCurve3",t.isLineCurve3=!0,t.v1=r,t.v2=i,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt,n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}},{key:"getPointAt",value:function(t,e){return this.getPoint(t,e)}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}]),n}(Ps),Ks=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new gt;return Object(m.a)(this,n),(t=e.call(this)).type="QuadraticBezierCurve",t.v0=r,t.v1=i,t.v2=o,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt,n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(Hs(t,r.x,i.x,o.x),Hs(t,r.y,i.y,o.y)),n}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}]),n}(Ps);Ks.prototype.isQuadraticBezierCurve=!0;var Qs=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new kt;return Object(m.a)(this,n),(t=e.call(this)).type="QuadraticBezierCurve3",t.v0=r,t.v1=i,t.v2=o,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt,n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(Hs(t,r.x,i.x,o.x),Hs(t,r.y,i.y,o.y),Hs(t,r.z,i.z,o.z)),n}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}]),n}(Ps);Qs.prototype.isQuadraticBezierCurve3=!0;var Js=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Object(m.a)(this,n),(t=e.call(this)).type="SplineCurve",t.points=r,t}return Object(g.a)(n,[{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt,n=e,r=this.points,i=(r.length-1)*t,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],u=r[o],c=r[o>r.length-2?r.length-1:o+1],l=r[o>r.length-3?r.length-1:o+2];return n.set(zs(a,s.x,u.x,c.x,l.x),zs(a,s.y,u.y,c.y,l.y)),n}},{key:"copy",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.points=[];for(var e=0,r=t.points.length;e<r;e++){var i=t.points[e];this.points.push(i.clone())}return this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);t.points=[];for(var e=0,r=this.points.length;e<r;e++){var i=this.points[e];t.points.push(i.toArray())}return t}},{key:"fromJSON",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.points=[];for(var e=0,r=t.points.length;e<r;e++){var i=t.points[e];this.points.push((new gt).fromArray(i))}return this}}]),n}(Ps);Js.prototype.isSplineCurve=!0;var Zs=Object.freeze({__proto__:null,ArcCurve:Ns,CatmullRomCurve3:Vs,CubicBezierCurve:Ws,CubicBezierCurve3:Gs,EllipseCurve:Rs,LineCurve:Ys,LineCurve3:Xs,QuadraticBezierCurve:Ks,QuadraticBezierCurve3:Qs,SplineCurve:Js}),$s=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="Path",r.currentPoint=new gt,t&&r.setFromPoints(t),r}return Object(g.a)(n,[{key:"setFromPoints",value:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}},{key:"moveTo",value:function(t,e){return this.currentPoint.set(t,e),this}},{key:"lineTo",value:function(t,e){var n=new Ys(this.currentPoint.clone(),new gt(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,n,r){var i=new Ks(this.currentPoint.clone(),new gt(t,e),new gt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}},{key:"bezierCurveTo",value:function(t,e,n,r,i,o){var a=new Ws(this.currentPoint.clone(),new gt(t,e),new gt(n,r),new gt(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this}},{key:"splineThru",value:function(t){var e=[this.currentPoint.clone()].concat(t),n=new Js(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}},{key:"arc",value:function(t,e,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+a,e+s,n,r,i,o),this}},{key:"absarc",value:function(t,e,n,r,i,o){return this.absellipse(t,e,n,n,r,i,o),this}},{key:"ellipse",value:function(t,e,n,r,i,o,a,s){var u=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+u,e+c,n,r,i,o,a,s),this}},{key:"absellipse",value:function(t,e,n,r,i,o,a,s){var u=new Rs(t,e,n,r,i,o,a,s);if(this.curves.length>0){var c=u.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(u);var l=u.getPoint(1);return this.currentPoint.copy(l),this}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.currentPoint.copy(t.currentPoint),this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);return t.currentPoint=this.currentPoint.toArray(),t}},{key:"fromJSON",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}]),n}(function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t;return Object(m.a)(this,n),(t=e.call(this)).type="CurvePath",t.curves=[],t.autoClose=!1,t}return Object(g.a)(n,[{key:"add",value:function(t){this.curves.push(t)}},{key:"closePath",value:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Ys(e,t))}},{key:"getPoint",value:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null}},{key:"getLength",value:function(){var t=this.getCurveLengths();return t[t.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}},{key:"getSpacedPoints",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}},{key:"getPoints",value:function(){for(var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=[],r=0,i=this.curves;r<i.length;r++)for(var o=i[r],a=o&&o.isEllipseCurve?2*e:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,s=o.getPoints(a),u=0;u<s.length;u++){var c=s[u];t&&t.equals(c)||(n.push(c),t=c)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}},{key:"copy",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.curves=[];for(var e=0,r=t.curves.length;e<r;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,r=this.curves.length;e<r;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t}},{key:"fromJSON",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,r=t.curves.length;e<r;e++){var i=t.curves[e];this.curves.push((new Zs[i.type]).fromJSON(i))}return this}}]),n}(Ps)),tu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this,t)).uuid=mt.generateUUID(),r.type="Shape",r.holes=[
2],r}return Object(g.a)(n,[{key:"getPointsHoles",value:function(t){for(var e=[],n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}},{key:"extractPoints",value:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}},{key:"copy",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.holes=[];for(var e=0,r=t.holes.length;e<r;e++){var i=t.holes[e];this.holes.push(i.clone())}return this}},{key:"toJSON",value:function(){var t=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,r=this.holes.length;e<r;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t}},{key:"fromJSON",value:function(t){Object(h.a)(Object(f.a)(n.prototype),"fromJSON",this).call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,r=t.holes.length;e<r;e++){var i=t.holes[e];this.holes.push((new $s).fromJSON(i))}return this}}]),n}($s),eu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Object(m.a)(this,n),(r=e.call(this)).type="Light",r.color=new Qe(t),r.intensity=i,r}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this}},{key:"toJSON",value:function(t){var e=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}]),n}(Oe);eu.prototype.isLight=!0;var nu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r,i){var o;return Object(m.a)(this,n),(o=e.call(this,t,i)).type="HemisphereLight",o.position.copy(Oe.DefaultUp),o.updateMatrix(),o.groundColor=new Qe(r),o}return Object(g.a)(n,[{key:"copy",value:function(t){return eu.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}]),n}(eu);nu.prototype.isHemisphereLight=!0;var ru=new ee,iu=new kt,ou=new kt,au=function(){function t(e){Object(m.a)(this,t),this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new gt(512,512),this.map=null,this.mapPass=null,this.matrix=new ee,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new tr,this._frameExtents=new gt(1,1),this._viewportCount=1,this._viewports=[new Et(0,0,1,1)]}return Object(g.a)(t,[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(t){var e=this.camera,n=this.matrix;iu.setFromMatrixPosition(t.matrixWorld),e.position.copy(iu),ou.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(ou),e.updateMatrixWorld(),ru.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ru),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)}},{key:"getViewport",value:function(t){return this._viewports[t]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"copy",value:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}]),t}(),su=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t;return Object(m.a)(this,n),(t=e.call(this,new Gn(50,1,.5,500))).focus=1,t}return Object(g.a)(n,[{key:"updateMatrices",value:function(t){var e=this.camera,r=2*mt.RAD2DEG*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,o=t.distance||e.far;r===e.fov&&i===e.aspect&&o===e.far||(e.fov=r,e.aspect=i,e.far=o,e.updateProjectionMatrix()),Object(h.a)(Object(f.a)(n.prototype),"updateMatrices",this).call(this,t)}}]),n}(au);su.prototype.isSpotLightShadow=!0;var uu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return Object(m.a)(this,n),(i=e.call(this,t,r)).type="SpotLight",i.position.copy(Oe.DefaultUp),i.updateMatrix(),i.target=new Oe,i.distance=o,i.angle=a,i.penumbra=s,i.decay=u,i.shadow=new su,i}return Object(g.a)(n,[{key:"power",get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}]),n}(eu);uu.prototype.isSpotLight=!0;var cu=new ee,lu=new kt,hu=new kt,fu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t;return Object(m.a)(this,n),(t=e.call(this,new Gn(90,1,.5,500)))._frameExtents=new gt(4,2),t._viewportCount=6,t._viewports=[new Et(2,1,1,1),new Et(0,1,1,1),new Et(3,1,1,1),new Et(1,1,1,1),new Et(3,0,1,1),new Et(1,0,1,1)],t._cubeDirections=[new kt(1,0,0),new kt(-1,0,0),new kt(0,0,1),new kt(0,0,-1),new kt(0,1,0),new kt(0,-1,0)],t._cubeUps=[new kt(0,1,0),new kt(0,1,0),new kt(0,1,0),new kt(0,1,0),new kt(0,0,1),new kt(0,0,-1)],t}return Object(g.a)(n,[{key:"updateMatrices",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,r=this.matrix;lu.setFromMatrixPosition(t.matrixWorld),n.position.copy(lu),hu.copy(n.position),hu.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(hu),n.updateMatrixWorld(),r.makeTranslation(-lu.x,-lu.y,-lu.z),cu.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(cu)}}]),n}(au);fu.prototype.isPointLightShadow=!0;var du=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Object(m.a)(this,n),(i=e.call(this,t,r)).type="PointLight",i.distance=o,i.decay=a,i.shadow=new fu,i}return Object(g.a)(n,[{key:"power",get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}},{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}]),n}(eu);du.prototype.isPointLight=!0;var pu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;
2return Object(m.a)(this,n),(t=e.call(this)).type="OrthographicCamera",t.zoom=1,t.view=null,t.left=r,t.right=i,t.top=o,t.bottom=a,t.near=s,t.far=u,t.updateProjectionMatrix(),t}return Object(g.a)(n,[{key:"copy",value:function(t,e){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-t,o=n+t,a=r+e,s=r-e;if(null!==this.view&&this.view.enabled){var u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=u*this.view.offsetX)+u*this.view.width,s=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(t){var e=Oe.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}]),n}(Wn);pu.prototype.isOrthographicCamera=!0;var vu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){return Object(m.a)(this,n),e.call(this,new pu(-5,5,5,-5,.5,500))}return n}(au);vu.prototype.isDirectionalLightShadow=!0;var mu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i;return Object(m.a)(this,n),(i=e.call(this,t,r)).type="DirectionalLight",i.position.copy(Oe.DefaultUp),i.updateMatrix(),i.target=new Oe,i.shadow=new vu,i}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}]),n}(eu);mu.prototype.isDirectionalLight=!0;var gu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i;return Object(m.a)(this,n),(i=e.call(this,t,r)).type="AmbientLight",i}return n}(eu);gu.prototype.isAmbientLight=!0;var yu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;return Object(m.a)(this,n),(i=e.call(this,t,r)).type="RectAreaLight",i.width=o,i.height=a,i}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.width=t.width,this.height=t.height,this}},{key:"toJSON",value:function(t){var e=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}]),n}(eu);yu.prototype.isRectAreaLight=!0;var bu=function(){function t(){Object(m.a)(this,t),this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new kt)}return Object(g.a)(t,[{key:"set",value:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}},{key:"zero",value:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}},{key:"getAt",value:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*r),e.addScaledVector(o[2],.488603*i),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*r*1.092548),e.addScaledVector(o[5],r*i*1.092548),e.addScaledVector(o[6],.315392*(3*i*i-1)),e.addScaledVector(o[7],n*i*1.092548),e.addScaledVector(o[8],.546274*(n*n-r*r)),e}},{key:"getIrradianceAt",value:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*r),e.addScaledVector(o[2],1.023328*i),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*r),e.addScaledVector(o[5],.858086*r*i),e.addScaledVector(o[6],.743125*i*i-.247708),e.addScaledVector(o[7
2],.858086*n*i),e.addScaledVector(o[8],.429043*(n*n-r*r)),e}},{key:"add",value:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}},{key:"addScaledSH",value:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}},{key:"scale",value:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}},{key:"lerp",value:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}},{key:"equals",value:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}},{key:"copy",value:function(t){return this.set(t.coefficients)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.coefficients,r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}}],[{key:"getBasisAt",value:function(t,e){var n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)}}]),t}();bu.prototype.isSphericalHarmonics3=!0;var _u=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bu,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Object(m.a)(this,n),(t=e.call(this,void 0,i)).sh=r,t}return Object(g.a)(n,[{key:"copy",value:function(t){return Object(h.a)(Object(f.a)(n.prototype),"copy",this).call(this,t),this.sh.copy(t.sh),this}},{key:"fromJSON",value:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}},{key:"toJSON",value:function(t){var e=Object(h.a)(Object(f.a)(n.prototype),"toJSON",this).call(this,t);return e.object.sh=this.sh.toArray(),e}}]),n}(eu);_u.prototype.isLightProbe=!0;var wu={decodeText:function(t){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(i){return e}},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function xu(){_n.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function Tu(t,e,n,r){"number"===typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),tn.call(this,t,e,n),this.meshPerAttribute=r||1}xu.prototype=Object.assign(Object.create(_n.prototype),{constructor:xu,isInstancedBufferGeometry:!0,copy:function(t){return _n.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=_n.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),Tu.prototype=Object.assign(Object.create(tn.prototype),{constructor:Tu,isInstancedBufferAttribute:!0,copy:function(t){return tn.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=tn.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}});function Eu(t){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),Ss.call(this,t),this.options={premultiplyAlpha:"none"}}Eu.prototype=Object.assign(Object.create(Ss.prototype),{constructor:Eu,isImageBitmapLoader:!0,setOptions:function(t){return this.options=t,this},load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=xs.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;var a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(t,a).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){xs.add(t,n),e&&e(n),i.manager.itemEnd(t)})).catch((function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)})),i.manager.itemStart(t)}});var Su=function(){function t(){Object(m.a)(this,t),this.type="ShapePath",this.color=new Qe,this.subPaths=[],this.currentPath=null}return Object(g.a)(t,[{key:"moveTo",value:function(t,e){return this.currentPath=new $s,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.currentPath.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this}},{key:"bezierCurveTo",value:function(t,e,n,r,i,o){return this.currentPath.bezierCurveTo(t,e,n,r,i,o),this}},{key:"splineThru",value:function(t){return this.currentPath.splineThru(t),this}},{key:"toShapes",value:function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],o=new tu;o.curves=i.curves,e.push(o)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=e[i],s=e[o],u=s.x-a.x,c=s.y-a.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(a=e[o],u=-u,s=e[i],c=-c),t.y<a.y||t.y>s.y)continue;
2if(t.y===a.y){if(t.x===a.x)return!0}else{var l=c*(t.x-a.x)-u*(t.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return r}var i,o,a,s=Ha.isClockWise,u=this.subPaths;if(0===u.length)return[];if(!0===e)return n(u);var c=[];if(1===u.length)return o=u[0],(a=new tu).curves=o.curves,c.push(a),c;var l=!s(u[0].getPoints());l=t?!l:l;var h,f,d=[],p=[],v=[],m=0;p[m]=void 0,v[m]=[];for(var g=0,y=u.length;g<y;g++)i=s(h=(o=u[g]).getPoints()),(i=t?!i:i)?(!l&&p[m]&&m++,p[m]={s:new tu,p:h},p[m].s.curves=o.curves,l&&m++,v[m]=[]):v[m].push({h:o,p:h[0]});if(!p[0])return n(u);if(p.length>1){for(var b=!1,_=[],w=0,x=p.length;w<x;w++)d[w]=[];for(var T=0,E=p.length;T<E;T++)for(var S=v[T],O=0;O<S.length;O++){for(var k=S[O],C=!0,M=0;M<p.length;M++)r(k.p,p[M].p)&&(T!==M&&_.push({froms:T,tos:M,hole:O}),C?(C=!1,d[M].push(k)):b=!0);C&&d[T].push(k)}_.length>0&&(b||(v=d))}for(var A=0,I=p.length;A<I;A++){a=p[A].s,c.push(a);for(var j=0,P=(f=v[A]).length;j<P;j++)a.holes.push(f[j].h)}return c}}]),t}(),Ou=function(){function t(e){Object(m.a)(this,t),this.type="Font",this.data=e}return Object(g.a)(t,[{key:"generateShapes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=[],r=ku(t,e,this.data),i=0,o=r.length;i<o;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}]),t}();function ku(t,e,n){for(var r=Array.from(t),i=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[],s=0,u=0,c=0;c<r.length;c++){var l=r[c];if("\n"===l)s=0,u-=o;else{var h=Cu(l,i,s,u,n);s+=h.offsetX,a.push(h.path)}}return a}function Cu(t,e,n,r,i){var o=i.glyphs[t]||i.glyphs["?"];if(o){var a,s,u,c,l,h,f,d,p=new Su;if(o.o)for(var v=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),m=0,g=v.length;m<g;){switch(v[m++]){case"m":a=v[m++]*e+n,s=v[m++]*e+r,p.moveTo(a,s);break;case"l":a=v[m++]*e+n,s=v[m++]*e+r,p.lineTo(a,s);break;case"q":u=v[m++]*e+n,c=v[m++]*e+r,l=v[m++]*e+n,h=v[m++]*e+r,p.quadraticCurveTo(l,h,u,c);break;
2case"b":u=v[m++]*e+n,c=v[m++]*e+r,l=v[m++]*e+n,h=v[m++]*e+r,f=v[m++]*e+n,d=v[m++]*e+r,p.bezierCurveTo(l,h,f,d,u,c)}}return{offsetX:o.ha*e,path:p}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".")}Ou.prototype.isFont=!0;var Mu,Au=function(){return void 0===Mu&&(Mu=new(window.AudioContext||window.webkitAudioContext)),Mu},Iu=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){return Object(m.a)(this,n),e.call(this,t)}return Object(g.a)(n,[{key:"load",value:function(t,e,n,r){var i=this,o=new ks(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(n){try{var o=n.slice(0);Au().decodeAudioData(o,(function(t){e(t)}))}catch(a){r?r(a):console.error(a),i.manager.itemError(t)}}),n,r)}}]),n}(Ss);(function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;Object(m.a)(this,n),i=e.call(this,void 0,o);var a=(new Qe).set(t),s=(new Qe).set(r),u=new kt(a.r,a.g,a.b),c=new kt(s.r,s.g,s.b),l=Math.sqrt(Math.PI),h=l*Math.sqrt(.75);return i.sh.coefficients[0].copy(u).add(c).multiplyScalar(l),i.sh.coefficients[1].copy(u).sub(c).multiplyScalar(h),i}return n})(_u).prototype.isHemisphereLightProbe=!0,function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;Object(m.a)(this,n),r=e.call(this,void 0,i);var o=(new Qe).set(t);return r.sh.coefficients[0].set(o.r,o.g,o.b).multiplyScalar(2*Math.sqrt(Math.PI)),r}return n}(_u).prototype.isAmbientLightProbe=!0;new ee,new ee;var ju=function(){function t(e){Object(m.a)(this,t),this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}return Object(g.a)(t,[{key:"start",value:function(){this.startTime=Pu(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=Pu();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}]),t}();function Pu(){return("undefined"===typeof performance?Date:performance).now()}var Ru=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this)).type="Audio",r.listener=t,r.context=t.context,r.gain=r.context.createGain(),r.gain.connect(t.getInput()),r.autoplay=!1,r.buffer=null,r.detune=0,r.loop=!1,r.loopStart=0,r.loopEnd=0,r.offset=0,r.duration=void 0,r.playbackRate=1,r.isPlaying=!1,r.hasPlaybackControl=!0,r.source=null,r.sourceType="empty",r._startedAt=0,r._progress=0,r._connected=!1,r.filters=[],r}return Object(g.a)(n,[{key:"getOutput",value:function(){return this.gain}},{key:"setNodeSource",value:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}},{key:"setMediaElementSource",value:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}},{key:"setMediaStreamSource",value:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}},{key:"setBuffer",value:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}},{key:"play",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")}},{key:"pause",value:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"stop",value:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"connect",value:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}},{key:"disconnect",value:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}},{key:"getFilters",value:function(){return this.filters}},{key:"setFilters",value:function(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}},{key:"setDetune",value:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}},{key:"getDetune",value:function(){return this.detune}},{key:"getFilter",value:function(){return this.getFilters()[0]}},{key:"setFilter",value:function(t){return this.setFilters(t?[t]:[])}},{key:"setPlaybackRate",value:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"getPlaybackRate",value:function(){return this.playbackRate}},{key:"onEnded",value:function(){this.isPlaying=!1}},{key:"getLoop",value:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}},{key:"setLoop",value:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}},{key:"setLoopStart",value:function(t){return this.loopStart=t,this}},{key:"setLoopEnd",value:function(t){return this.loopEnd=t,this}},{key:"getVolume",value:function(){return this.gain.gain.value}},{key:"setVolume",value:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}]),n}(Oe),Nu=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048;Object(m.a)(this,t),this.analyser=e.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}return Object(g.a)(t,[{key:"getFrequencyData",value:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},{key:"getAverageFrequency",value:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}]),t}(),Lu=function(){function t(e,n,r){var i,o,a;switch(Object(m.a)(this,t),this.binding=e,this.valueSize=r,n){case"quaternion":i=this._slerp,o=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*r),this._workIndex=5;break;case"string":case"bool":i=this._select,o=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(5*r);break;default:i=this._lerp,o=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*r)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=o,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}return Object(g.a)(t,[{key:"accumulate",value:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o}},{key:"accumulateAdditive",value:function(t){var e=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t}},{key:"apply",value:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=e*this._origIndex;this._mixBufferRegion(n,r,s,1-i,e)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(var u=e,c=e+e;u!==c;++u)if(n[u]!==n[u+e]){a.setValue(n,r);break}}},{key:"saveOriginalState",value:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(var i=n,o=r;i!==o;++i)e[i]=e[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}},{key:"restoreOriginalState",value:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)}},{key:"_setAdditiveIdentityNumeric",value:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,n=t;n<e;n++)this.buffer[n]=0}},{key:"_setAdditiveIdentityQuaternion",value:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}},{key:"_setAdditiveIdentityOther",value:function(){for(var t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]}},{key:"_select",value:function(t,e,n,r,i){if(r>=.5)for(var o=0;o!==i;++o)t[e+o]=t[n+o]}},{key:"_slerp",value:function(t,e,n,r){Ot.slerpFlat(t,e,t,e,t,n,r)}},{key:"_slerpAdditive",value:function(t,e,n,r,i){var o=this._workIndex*i;Ot.multiplyQuaternionsFlat(t,o,t,e,t,n),Ot.slerpFlat(t,e,t,e,t,o,r)}},{key:"_lerp",value:function(t,e,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*r}}},{key:"_lerpAdditive",value:function(t,e,n,r,i){for(var o=0;o!==i;++o){var a=e+o;t[a]=t[a]+t[n+o]*r}}}]),t}(),Du="\\[\\]\\.:\\/",Fu=new RegExp("[\\[\\]\\.:\\/]","g"),Uu="[^\\[\\]\\.:\\/]",Bu="[^"+Du.replace("\\.","")+"]",Vu=/((?:WC+[\/:])*)/.source.replace("WC",Uu),zu=/(WCOD+)?/.source.replace("WCOD",Bu),Hu=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Uu),qu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Uu),Wu=ne
vendor: 4,776 bytes, line 2
2w RegExp("^"+Vu+zu+Hu+qu+"$"),Gu=["material","materials","bones"];function Yu(t,e,n){var r=n||Xu.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function Xu(t,e,n){this.path=e,this.parsedPath=n||Xu.parseTrackName(e),this.node=Xu.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(Yu.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Xu,{Composite:Yu,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Xu.Composite(t,e,n):new Xu(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Fu,"")},parseTrackName:function(t){var e=Wu.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Gu.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var r=function t(n){for(var r=0;r<n.length;r++){var i=n[r];if(i.name===e||i.uuid===e)return i;var o=t(i.children);if(o)return o}return null}(t.children);if(r)return r}return null}}),Object.assign(Xu.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=Xu.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[r];
2if(void 0!==s){var u=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?u=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[i]&&(i=t.morphTargetDictionary[i])}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][u]}else{var l=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+r+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Xu.prototype,{_getValue_unbound:Xu.prototype.getValue,_setValue_unbound:Xu.prototype.setValue}),function(){function t(){Object(m.a)(this,t),this.uuid=mt.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}return Object(g.a)(t,[{key:"add",value:function(){for(var t=this._objects,e=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,o=i.length,a=void 0,s=t.length,u=this.nCachedObjects_,c=0,l=arguments.length;c!==l;++c){var h=arguments[c],f=h.uuid,d=e[f];if(void 0===d){d=s++,e[f]=d,t.push(h);for(var p=0,v=o;p!==v;++p)i[p].push(new Xu(h,n[p],r[p]))}else if(d<u){a=t[d];var m=--u,g=t[m];e[g.uuid]=d,t[d]=g,e[f]=m,t[m]=h;for(var y=0,b=o;y!==b;++y){var _=i[y],w=_[m],x=_[d];_[d]=w,void 0===x&&(x=new Xu(h,n[y],r[y])),_[m]=x}}else t[d]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}},{key:"remove",value:function(){for(var t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],u=s.uuid,c=e[u];if(void 0!==c&&c>=i){var l=i++,h=t[l];e[h.uuid]=c,t[c]=h,e[u]=l,t[l]=s;for(var f=0,d=r;f!==d;++f){var p=n[f],v=p[l],m=p[c];p[c]=v,p[l]=m}}}this.nCachedObjects_=i}},{key:"uncache",value:function(){for(var t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=t.length,a=0,s=arguments.length;a!==s;++a){var u=arguments[a],c=u.uuid,l=e[c];if(void 0!==l)if(delete e[c],l<i){var h=--i,f=t[h],d=--o,p=t[d];e[f.uuid]=l,t[l]=f,e[p.uuid]=h,t[h]=p,t.pop();for(var v=0,m=r;v!==m;++v){var g=n[v],y=g[h],b=g[d];g[l]=y,g[h]=b,g.pop()}}else{var _=--o,w=t[_];_>0&&(e[w.uuid]=l),t[l]=w,t.pop();for(var x=0,T=r;x!==T;++x){var E=n[x];E[l]=E[_],E.pop()}}}this.nCachedObjects_=i}},{key:"subscribe_",value:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,u=s.length,c=this.nCachedObjects_,l=new Array(u);r=i.length,n[t]=r,o.push(t),a.push(e),i.push(l);for(var h=c,f=s.length;h!==f;++h){var d=s[h];l[h]=new Xu(d,t,e)}
2return l}},{key:"unsubscribe_",value:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}]),t}().prototype.isAnimationObjectGroup=!0;var Ku=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.blendMode;Object(m.a)(this,t),this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;for(var o=n.tracks,a=o.length,s=new Array(a),u={endingStart:Q,endingEnd:Q},c=0;c!==a;++c){var l=o[c].createInterpolant(null);s[c]=l,l.settings=u}this._interpolantSettings=u,this._interpolants=s,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}return Object(g.a)(t,[{key:"play",value:function(){return this._mixer._activateAction(this),this}},{key:"stop",value:function(){return this._mixer._deactivateAction(this),this.reset()}},{key:"reset",value:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}},{key:"isRunning",value:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}},{key:"isScheduled",value:function(){return this._mixer._isActiveAction(this)}},{key:"startAt",value:function(t){return this._startTime=t,this}},{key:"setLoop",value:function(t,e){return this.loop=t,this.repetitions=e,this}},{key:"setEffectiveWeight",value:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}},{key:"getEffectiveWeight",value:function(){return this._effectiveWeight}},{key:"fadeIn",value:function(t){return this._scheduleFading(t,0,1)}},{key:"fadeOut",value:function(t){return this._scheduleFading(t,1,0)}},{key:"crossFadeFrom",value:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,o=i/r,a=r/i;t.warp(1,o,e),this.warp(a,1,e)}return this}},{key:"crossFadeTo",value:function(t,e,n){return t.crossFadeFrom(this,e,n)}},{key:"stopFading",value:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}},{key:"setEffectiveTimeScale",value:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}},{key:"getEffectiveTimeScale",value:function(){return this._effectiveTimeScale}},{key:"setDuration",value:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}},{key:"syncWith",value:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}},{key:"halt",value:function(t){return this.warp(this._effectiveTimeScale,0,t)}},{key:"warp",value:function(t,e,n){var r=this._mixer,i=r.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+n,u[0]=t/o,u[1]=e/o,this}},{key:"stopWarping",value:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}},{key:"getMixer",value:function(){return this._mixer}},{key:"getClip",value:function(){return this._clip}},{key:"getRoot",value:function(){return this._localRoot||this._mixer._root}},{key:"_update",value:function(t,e,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(t-i)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0){var u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case tt:for(var l=0,h=u.length;l!==h;++l)u[l].evaluate(a),c[l].accumulateAdditive(s);break;case $:default:for(var f=0,d=u.length;f!==d;++f)u[f].evaluate(a),c[f].accumulate(r,s)}}}else this._updateWeight(t)}},{key:"_updateWeight",value:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e}},{key:"_updateTimeScale",value:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e}},{key:"_updateTime",value:function(t){var e=this._clip.duration,n=this.loop,r=this.time+t,i=this._loopCount,o=2202===n;if(0===t)return-1===i?r:o&&1===(1&i)?e-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=e||r<0){var a=Math.floor(r/e);r-=e*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var u=t<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&1===(1&i))return e-r}return r}},{key:"_setEndings",value:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=J,r.endingEnd=J):(r.endingStart=t?this.zeroSlopeAtStart?J:Q:Z,r.endingEnd=e?this.zeroSlopeAtEnd?J:Q:Z)}},{key:"_scheduleFading",value:function(t,e,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}]),t}();(function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;return Object(m.a)(this,n),(r=e.call(this))._root=t,r._initMemoryManager(),r._accuIndex=0,r.time=0,r.timeScale=1,r}return Object(g.a)(n,[{key:"_bindAction",value:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,u=this._bindingsByRootAndName,c=u[s];void 0===c&&(c={},u[s]=c);for(var l=0;l!==i;++l){var h=r[l],f=h.name,d=c[f];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,f));continue}var p=e&&e._propertyBindings[l].binding.parsedPath;++(d=new Lu(Xu.create(n,f,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,f),o[l]=d}a[l].resultBuffer=d.buffer}}},{key:"_activateAction",value:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r
2=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}}},{key:"_deactivateAction",value:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}},{key:"_initMemoryManager",value:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}},{key:"_isActiveAction",value:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions}},{key:"_addInactiveAction",value:function(t,e,n){var r=this._actions,i=this._actionsByClip,o=i[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[n]=t}},{key:"_removeInactiveAction",value:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;n._cacheIndex=r,e[r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,u=s[s.length-1],c=t._byClipCacheIndex;u._byClipCacheIndex=c,s[c]=u,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(t)}},{key:"_removeInactiveBindingsForAction",value:function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0===--i.referenceCount&&this._removeInactiveBinding(i)}}},{key:"_lendAction",value:function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}},{key:"_takeBackAction",value:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}},{key:"_addInactiveBinding",value:function(t,e,n){var r=this._bindingsByRootAndName,i=this._bindings,o=r[e];void 0===o&&(o={},r[e]=o),o[n]=t,t._cacheIndex=i.length,i.push(t)}},{key:"_removeInactiveBinding",value:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],u=t._cacheIndex;s._cacheIndex=u,e[u]=s,e.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]}},{key:"_lendBinding",value:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}},{key:"_takeBackBinding",value:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i}},{key:"_lendControlInterpolant",value:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new ls(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n}},{key:"_takeBackControlInterpolant",value:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];t.__cacheIndex=r,e[r]=t,i.__cacheIndex=n,e[n]=i}},{key:"clipAction",value:function(t,e,n){var r=e||this._root,i=r.uuid,o="string"===typeof t?_s.findByName(r,t):t,a=null!==o?o.uuid:t,s=this._actionsByClip[a],u=null;if(void 0===n&&(n=null!==o?o.blendMode:$),void 0!==s){var c=s.actionByRoot[i];if(void 0!==c&&c.blendMode===n)return c;u=s.knownActions[0],null===o&&(o=u._clip)}if(null===o)return null;var l=new Ku(this,o,e,n);return this._bindAction(l,u),this._addInactiveAction(l,a,i),l}},{key:"existingAction",value:function(t,e){var n=e||this._root,r=n.uuid,i="string"===typeof t?_s.findByName(n,t):t,o=i?i.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null}},{key:"stopAllAction",value:function(){for(var t=this._actions,e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}},{key:"update",value:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a){e[a]._update(r,t,i,o)}for(var s=this._bindings,u=this._nActiveBindings,c=0;c!==u;++c)s[c].apply(o);return this}},{key:"setTime",value:function(t){this.time=0;for(var e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)}},{key:"getRoot",value:function(){return this._root}},{key:"uncacheClip",value:function(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var o=i.knownActions,a=0,s=o.length;a!==s;++a){var u=o[a];this._deactivateAction(u);var c=u._cacheIndex,l=e[e.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,l._cacheIndex=c,e[c]=l,e.pop(),this._removeInactiveBindingsForAction(u)}delete r[n]}}},{key:"uncacheRoot",value:function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}}},{key:"uncacheAction",value:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}]),n})(ft).prototype._controlInterpolantsResultBuffer=new Float32Array(1);var Qu=function(){function t(e){Object(m.a)(this,t),"string"===typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}return Object(g.a)(t,[{key:"clone",value:function(){return new t(void 0===this.value.clone?this.value:this.value.clone())}}]),t}();function Ju(t,e,n){ho.call(this,t,e),this.meshPerAttribute=n||1}function Zu(t,e,n,r,i){this.buffer=t,this.type=e,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}function $u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;this.ray=new te(t,e),this.near=n,this.far=r,this.camera=null,this.layers=new fe,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function tc(t,e){return t.distance-e.distance}
2function ec(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r)for(var i=t.children,o=0,a=i.length;o<a;o++)ec(i[o],e,n,!0)}Ju.prototype=Object.assign(Object.create(ho.prototype),{constructor:Ju,isInstancedInterleavedBuffer:!0,copy:function(t){return ho.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},clone:function(t){var e=ho.prototype.clone.call(this,t);return e.meshPerAttribute=this.meshPerAttribute,e},toJSON:function(t){var e=ho.prototype.toJSON.call(this,t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}),Object.defineProperty(Zu.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Zu.prototype,{isGLBufferAttribute:!0,setBuffer:function(t){return this.buffer=t,this},setType:function(t,e){return this.type=t,this.elementSize=e,this},setItemSize:function(t){return this.itemSize=t,this},setCount:function(t){return this.count=t,this}}),Object.assign($u.prototype,{set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)},intersectObject:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return ec(t,this,n,e),n.sort(tc),n},intersectObjects:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=0,i=t.length;r<i;r++)ec(t[r],this,n,e);return n.sort(tc),n}});var nc=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Object(m.a)(this,t),this.radius=e,this.phi=n,this.theta=r,this}return Object(g.a)(t,[{key:"set",value:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}},{key:"copy",value:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}},{key:"makeSafe",value:function(){var t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}},{key:"setFromVector3",value:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}},{key:"setFromCartesianCoords",value:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(mt.clamp(e/this.radius,-1,1))),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),t}(),rc=new gt,ic=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gt(1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new gt(-1/0,-1/0);Object(m.a)(this,t),this.min=e,this.max=n}return Object(g.a)(t,[{key:"set",value:function(t,e){return this.min.copy(t),this.max.copy(e),this}},{key:"setFromPoints",value:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}},{key:"setFromCenterAndSize",value:function(t,e){var n=rc.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(t){return this.min.copy(t.min),this.max.copy(t.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y}},{key:"getCenter",value:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new gt),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new gt),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(t){return this.min.min(t),this.max.max(t),this}},{key:"expandByVector",value:function(t){return this.min.sub(t),this.max.add(t),this}},{key:"expandByScalar",value:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this}},{key:"containsPoint",value:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}},{key:"containsBox",value:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}},{key:"getParameter",value:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new gt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}},{key:"intersectsBox",value:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}},{key:"clampPoint",value:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new gt),e.copy(t).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(t){return rc.copy(t).clamp(this.min,this.max).sub(t).length()}},{key:"intersect",value:function(t){return this.min.max(t.min),this.max.min(t.max),this}},{key:"union",value:function(t){return this.min.min(t.min),this.max.max(t.max),this}},{key:"translate",value:function(t){return this.min.add(t),this.max.add(t),this}},{key:"equals",value:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}]),t}();ic.prototype.isBox2=!0;var oc=new kt,ac=new kt,sc=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kt,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt;Object(m.a)(this,t),this.start=e,this.end=n}return Object(g.a)(t,[{key:"set",value:function(t,e){return this.start.copy(t),this.end.copy(e),this}},{key:"copy",value:function(t){return this.start.copy(t.start),this.end.copy(t.end),this}},{key:"getCenter",value:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new kt),t.addVectors(this.start,this.end).multiplyScalar(.5)}},{key:"delta",value:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new kt),t.subVectors(this.end,this.start)}},{key:"distanceSq",value:function(){return this.start.distanceToSquared(this.end)}},{key:"distance",value:function(){return this.start.distanceTo(this.end)}},{key:"at",value:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at(
2) target is now required"),e=new kt),this.delta(e).multiplyScalar(t).add(this.start)}},{key:"closestPointToPointParameter",value:function(t,e){oc.subVectors(t,this.start),ac.subVectors(this.end,this.start);var n=ac.dot(ac),r=ac.dot(oc)/n;return e&&(r=mt.clamp(r,0,1)),r}},{key:"closestPointToPoint",value:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new kt),this.delta(n).multiplyScalar(r).add(this.start)}},{key:"applyMatrix4",value:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}},{key:"equals",value:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}]),t}();function uc(t){Oe.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}uc.prototype=Object.create(Oe.prototype),uc.prototype.constructor=uc,uc.prototype.isImmediateRenderObject=!0;var cc=new kt,lc=new ee,hc=new ee,fc=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(t){var r;Object(m.a)(this,n);for(var i=dc(t),o=new _n,a=[],s=[],u=new Qe(0,0,1),c=new Qe(0,1,0),l=0;l<i.length;l++){var h=i[l];h.parent&&h.parent.isBone&&(a.push(0,0,0),a.push(0,0,0),s.push(u.r,u.g,u.b),s.push(c.r,c.g,c.b))}o.setAttribute("position",new ln(a,3)),o.setAttribute("color",new ln(s,3));var f=new Ko({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});return(r=e.call(this,o,f)).type="SkeletonHelper",r.isSkeletonHelper=!0,r.root=t,r.bones=i,r.matrix=t.matrixWorld,r.matrixAutoUpdate=!1,r}return Object(g.a)(n,[{key:"updateMatrixWorld",value:function(t){var e=this.bones,r=this.geometry,i=r.getAttribute("position");hc.copy(this.root.matrixWorld).invert();for(var o=0,a=0;o<e.length;o++){var s=e[o];s.parent&&s.parent.isBone&&(lc.multiplyMatrices(hc,s.matrixWorld),cc.setFromMatrixPosition(lc),i.setXYZ(a,cc.x,cc.y,cc.z),lc.multiplyMatrices(hc,s.parent.matrixWorld),cc.setFromMatrixPosition(lc),i.setXYZ(a+1,cc.x,cc.y,cc.z),a+=2)}r.getAttribute("position").needsUpdate=!0,Object(h.a)(Object(f.a)(n.prototype),"updateMatrixWorld",this).call(this,t)}}]),n}(ia);function dc(t){var e=[];t&&t.isBone&&e.push(t);for(var n=0;n<t.children.length;n++)e.push.apply(e,dc(t.children[n]));return e}var pc=function(t){Object(p.a)(n,t);var e=Object(v.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;Object(m.a)(this,n),o=new Qe(o),a=new Qe(a);for(var s=i/2,u=r/i,c=r/2,l=[],h=[],f=0,d=0,p=-c;f<=i;f++,p+=u){l.push(-c,0,p,c,0,p),l.push(p,0,-c,p,0,c);var v=f===s?o:a;v.toArray(h,d),d+=3,v.toArray(h,d),d+=3,v.toArray(h,d),d+=3,v.toArray(h,d),d+=3}var g=new _n;g.setAttribute("position",new ln(l,3)),g.setAttribute("color",new ln(h,3));var y=new Ko({vertexColors:!0,toneMapped:!1});return(t=e.call(this,g,y)).type="GridHelper",t}return n}(ia);var vc=new Float32Array(1),mc=(new Int32Array(vc.buffer),Math.pow(2,8),[.125,.215,.35,.446,.526,.582]),gc=5+mc.length,yc=(r={},Object(u.a)(r,rt,0),Object(u.a)(r,it,1),Object(u.a)(r,at,2),Object(u.a)(r,3004,3),Object(u.a)(r,3005,4),Object(u.a)(r,3006,5),Object(u.a)(r,ot,6),new Je({side:1,depthWrite:!1,depthTest:!1})),bc=(new Fn(new Bn,yc),_c());bc._lodPlanes,bc._sizeLods,bc._sigmas,Math.sqrt(5);function _c(){for(var t=[],e=[],n=[],r=8,i=0;i<gc;i++){var o=Math.pow(2,r);e.push(o);var a=1/o;i>4?a=mc[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),u=-s/2,c=1+s/2,l=[u,u,c,u,c,c,u,u,c,c,u,c],h=new Float32Array(108),f=new Float32Array(72),d=new Float32Array(36),p=0;p<6;p++){var v=p%3*2/3-1,m=p>2?0:-1,g=[v,m,0,v+2/3,m,0,v+2/3,m+1,0,v,m,0,v+2/3,m+1,0,v,m+1,0];h.set(g,18*p),f.set(l,12*p);var y=[p,p,p,p,p,p];d.set(y,6*p)}var b=new _n;b.setAttribute("position",new tn(h,3)),b.setAttribute("uv",new tn(f,2)),b.setAttribute("faceIndex",new tn(d,1)),t.push(b),r>4&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}Ps.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Ps.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},$s.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},pc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},fc.prototype.update=function(){console.error("THREE.SkeletonHelper: update(
2) no longer needs to be called.")},Ss.prototype.extractUrlBase=function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),wu.extractUrlBase(t)},Ss.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},ic.prototype.center=function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},ic.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},ic.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},ic.prototype.size=function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)},At.prototype.center=function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},At.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},At.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},At.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},At.prototype.size=function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)},Gt.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},tr.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},sc.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},mt.random16=function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},mt.nearestPowerOfTwo=function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),mt.floorPowerOfTwo(t)},mt.nextPowerOfTwo=function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),mt.ceilPowerOfTwo(t)},bt.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},bt.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix3: .multiplyVector3(
2) has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},bt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},bt.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},bt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},bt.prototype.getInverse=function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},ee.prototype.extractPosition=function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},ee.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},ee.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new kt).setFromMatrixColumn(this,3)},ee.prototype.setRotationFromQuaternion=function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},ee.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},ee.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix4: .multiplyVector3(
2) has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},ee.prototype.multiplyVector4=function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},ee.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},ee.prototype.rotateAxis=function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},ee.prototype.crossVector=function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},ee.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},ee.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},ee.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},ee.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},ee.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},ee.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},ee.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},ee.prototype.makeFrustum=function(t,e,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)},ee.prototype.getInverse=function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},Ae.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Ot.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3(
2) has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Ot.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},te.prototype.isIntersectionBox=function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},te.prototype.isIntersectionPlane=function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},te.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},Ve.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Ve.prototype.barycoordFromPoint=function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},Ve.prototype.midpoint=function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},Ve.prototypenormal=function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},Ve.prototype.plane=function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)},Ve.barycoordFromPoint=function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Ve.getBarycoord(t,e,n,r,i)},Ve.normal=function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Ve.getNormal(t,e,n,r)},tu.prototype.extractAllPoints=function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},tu.prototype.extrude=function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ga(this,t)},tu.prototype.makeGeometry=function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Ka(this,t)},gt.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},gt.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},gt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},kt.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},kt.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},kt.prototype.getPositionFromMatrix=function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},kt.prototype.getScaleFromMatrix=function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},kt.prototype.getColumnFromMatrix=function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},kt.prototype.applyProjection=function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},kt.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},kt.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},kt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Et.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},Et.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Oe.prototype.getChildByName=function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},Oe.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Oe.prototype.translate=function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},Oe.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}
vendor: 8,894 bytes, line 2
2,Oe.prototype.applyMatrix=function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(Oe.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Fn.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Fn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Po.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Ho.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Uo.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Ps.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Gn.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(eu.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(tn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===lt},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(lt)}}}),tn.prototype.setDynamic=function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?lt:ct),this},tn.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},tn.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},_n.prototype.addIndex=function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},_n.prototype.addAttribute=function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new tn(arguments[1],arguments[2])))},_n.prototype.addDrawCall=function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},_n.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},_n.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},_n.prototype.removeAttribute=function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},_n.prototype.applyMatrix=function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(_n.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(xu.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties($u.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(ho.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===lt},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),ho.prototype.setDynamic=function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?lt:ct),this},ho.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Ga.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Ga.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Ga.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},lo.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Object.defineProperties(Qu.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(He.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")}
vendor: 4,541 bytes, line 2
2,set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Qe}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(es.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(ts.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(qn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),so.prototype.clearTarget=function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},so.prototype.animate=function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},so.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},so.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},so.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},so.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},so.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},so.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},so.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},so.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},so.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},so.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},so.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},so.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_
2instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},so.prototype.enableScissorTest=function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},so.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},so.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},so.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},so.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},so.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},so.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},so.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},so.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},so.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},so.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(so.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?it:rt}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Zi.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(St.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy
2is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Ru.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new Iu).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Nu.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Xn.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update(
2)."),this.update(t,e)},Xn.prototype.clear=function(t,e,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,n,r)},_t.crossOrigin=void 0,_t.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new js;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},_t.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new As;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},_t.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},_t.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"126"}})),"undefined"!==typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="126")},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){t.exports=n(99)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(18);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}},function(t,e,n){"use strict";t.exports=n(86)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(41);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(t,e)||Object(r.a)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(t,e,n){"use strict";var r,i,o=n(0),a=n(7),s=n(22),u=n(21),c=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),l=new a.b("app","Firebase",c),h="@firebase/app",f="[DEFAULT]",d=((i={})[h]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),p=new u.b("@firebase/app"),v=function(){function t(t,e,n){var r=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=Object(a.m)(t),this.container=new s.b(e.name),this._addComponent(new s.a("app",(function(){return r}
2),"PUBLIC")),this.firebase_.INTERNAL.components.forEach((function(t){return r._addComponent(t)}))}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){return void 0===e&&(e=f),this.checkDestroyed_(),this.container.getProvider(t).getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e=f),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){p.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},t}();v.prototype.name&&v.prototype.options||v.prototype.delete||console.log("dc");var m=function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={}),"object"===typeof i&&null!==i||(i={name:i});var o=i;void 0===o.name&&(o.name=f);var s=o.name;if("string"!==typeof s||!s)throw l.create("bad-app-name",{appName:String(s)});
2if(Object(a.k)(e,s))throw l.create("duplicate-app",{appName:s});var u=new t(n,o,r);return e[s]=u,u},app:i,registerVersion:function(t,e,n){var r,i=null!==(r=d[t])&&void 0!==r?r:t;n&&(i+="-"+n);var a=i.match(/\s|\//),u=e.match(/\s|\//);if(a||u){var c=['Unable to register library "'+i+'" with version "'+e+'":'];return a&&c.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),a&&u&&c.push("and"),u&&c.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void p.warn(c.join(" "))}o(new s.a(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:u.c,onLog:function(t,e){if(null!==t&&"function"!==typeof t)throw l.create("invalid-log-argument");Object(u.d)(t,e)},apps:null,SDK_VERSION:"8.3.0",INTERNAL:{registerComponent:o,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){return"serverAuth"===e?null:e}}};function i(t){if(t=t||f,!Object(a.k)(e,t))throw l.create("no-app",{appName:t});return e[t]}function o(o){var s=o.name;if(n.has(s))return p.debug("There were multiple attempts to register component "+s+"."),"PUBLIC"===o.type?r[s]:null;if(n.set(s,o),"PUBLIC"===o.type){var u=function(t){if(void 0===t&&(t=i()),"function"!==typeof t[s])throw l.create("invalid-app-argument",{appName:s});return t[s]()};void 0!==o.serviceProps&&Object(a.n)(u,o.serviceProps),r[s]=u,t.prototype[s]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._getService.bind(this,s).apply(this,o.multipleInstances?t:[])}}for(var c=0,h=Object.keys(e);c<h.length;c++){var f=h[c];e[f]._addComponent(o)}return"PUBLIC"===o.type?r[s]:null}return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(e).map((function(t){return e[t]}))}}),i.App=t,r}(v);return e.INTERNAL=Object(o.a)(Object(o.a)({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){Object(a.n)(e,t)},createSubscribe:a.l,ErrorFactory:a.b,deepExtend:a.n}),e}(),g=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(t){if(function(t){var e=t.getComponent();return"VERSION"===(null===e||void 0===e?void 0:e.type)}(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();if(Object(a.r)()&&void 0!==self.firebase){p.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var y=self.firebase.SDK_VERSION;y&&y.indexOf("LITE")>=0&&p.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var b=m.initializeApp;m.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(a.y)()&&p.warn('\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the "main" field in package.json.\n \n If you are using Webpack, you can specify "main" as the first item in\n "resolve.mainFields":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n as the first item in "mainFields", e.g. [\'main\', \'module\'].\n https://github.com/rollup/@rollup/plugin-node-resolve\n '),b.apply(void 0,t)};var _=m;!function(t,e){t.INTERNAL.registerComponent(new s.a("platform-logger",(function(t){return new g(t)}),"PRIVATE")),t.registerVersion(h,"0.6.16",e),t.registerVersion("fire-js","")}(_),e.a=_},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(c){return void n(c)}s.done?e(u):Promise.resolve(u).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,u,"next",t)}function u(t){r(a,i,o,s,u,"throw",t)}s(void 0)}))}}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}
2));var r=n(48);var i=n(41);function o(t){return function(t){if(Array.isArray(t))return Object(r.a)(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Object(i.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(t,e,n){t.exports=n(91)()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(41);function i(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Object(r.a)(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}},function(t,e,n){"use strict";function r(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}var i;n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return d}));var o,a=[];!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(o||(o={}));var s={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},u=o.INFO,c=((i={})[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),l=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString(),a=c[e];if(!a)throw new Error("Attempted to log a message with an invalid logType (value: "+e+")");console[a].apply(console,r(["["+o+"] "+t.name+":"],n))}},h=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=l,this._userLogHandler=null,a.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in o))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"===typeof t?s[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!==typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.DEBUG],t)),this._logHandler.apply(this,r([this,o.DEBUG],t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.VERBOSE],t)),this._logHandler.apply(this,r([this,o.VERBOSE],t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.INFO],t)),this._logHandler.apply(this,r([this,o.INFO],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.WARN],t)),this._logHandler.apply(this,r([this,o.WARN],t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.ERROR],t)),this._logHandler.apply(this,r([this,o.ERROR],t))},t}();function f(t){a.forEach((function(e){e.setLogLevel(t)}
2))}function d(t,e){for(var n=function(n){var r=null;e&&e.level&&(r=s[e.level]),n.userLogHandler=null===t?null:function(e,n){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=i.map((function(t){if(null==t)return null;if("string"===typeof t)return t;if("number"===typeof t||"boolean"===typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(e){return null}})).filter((function(t){return t})).join(" ");n>=(null!==r&&void 0!==r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:s,args:i,type:e.name})}},r=0,i=a;r<i.length;r++){n(i[r])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return s}));var r=n(0),i=n(7),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t}(),a="[DEFAULT]",s=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return t.prototype.get=function(t){void 0===t&&(t=a);var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.a;this.instancesDeferred.set(e,n);try{var r=this.getOrInitializeService(e);r&&n.resolve(r)}catch(o){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e=Object(r.a)({identifier:a,optional:!1},t),n=e.identifier,i=e.optional,o=this.normalizeInstanceIdentifier(n);try{var s=this.getOrInitializeService(o);if(!s){if(i)return null;throw Error("Service "+this.name+" is not available")}return s}catch(u){if(i)return null;throw u}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=t,function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService(a)}catch(f){}try{for(var i=Object(r.g)(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=Object(r.e)(o.value,2),u=s[0],c=s[1],l=this.normalizeInstanceIdentifier(u);try{var h=this.getOrInitializeService(l);c.resolve(h)}catch(f){}}}catch(d){e={error:d}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.clearInstance=function(t){void 0===t&&(t=a),this.instancesDeferred.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return Object(r.b)(this,void 0,void 0,(function(){var t;return Object(r.d)(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(Object(r.f)(Object(r.f)([],Object(r.e)(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})))),Object(r.e)(t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()})))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.isInitialized=function(t){return void 0===t&&(t=a),this.instances.has(t)},t.prototype.getOrInitializeService=function(t){var e=this.instances.get(t);return!e&&this.component&&(e=this.component.instanceFactory(this.container,function(t){return t===a?void 0:t}(t)),this.instances.set(t,e)),e||null},t.prototype.normalizeInstanceIdentifier=function(t){return this.component?this.component.multipleInstances?t:a:t},t}();var u=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new s(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}()},function(t,e,n){"use strict";
2(function(t){n.d(e,"a",(function(){return vc})),n.d(e,"b",(function(){return gc})),n.d(e,"c",(function(){return R})),n.d(e,"d",(function(){return cc})),n.d(e,"e",(function(){return hc})),n.d(e,"f",(function(){return lc})),n.d(e,"g",(function(){return dc})),n.d(e,"h",(function(){return Eu})),n.d(e,"i",(function(){return Tu})),n.d(e,"j",(function(){return Ps})),n.d(e,"k",(function(){return wc})),n.d(e,"l",(function(){return Ac})),n.d(e,"m",(function(){return Mc})),n.d(e,"n",(function(){return Tc})),n.d(e,"o",(function(){return Oc})),n.d(e,"p",(function(){return pc})),n.d(e,"q",(function(){return Cc})),n.d(e,"r",(function(){return Sc})),n.d(e,"s",(function(){return xc})),n.d(e,"t",(function(){return Ic}));var r=n(21),i=n(7),o=n(26),a=n(0),s=function(t,e,n,r,i,o){this.t=t,this.persistenceKey=e,this.host=n,this.ssl=r,this.forceLongPolling=i,this.i=o},u=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"o",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t}(),c=new r.b("@firebase/firestore");function l(){return c.logLevel}function h(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(c.logLevel<=r.a.DEBUG){var i=e.map(p);c.debug.apply(c,Object(a.f)(["Firestore (8.3.0): "+t],i))}}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(c.logLevel<=r.a.ERROR){var i=e.map(p);c.error.apply(c,Object(a.f)(["Firestore (8.3.0): "+t],i))}}function d(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(c.logLevel<=r.a.WARN){var i=e.map(p);c.warn.apply(c,Object(a.f)(["Firestore (8.3.0): "+t],i))}}function p(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t}var e}function v(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (8.3.0) INTERNAL ASSERTION FAILED: "+t;throw f(e),new Error(e)}function m(t,e){t||v()}function g(t,e){return t}function y(t){var e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(var r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}var b=function(){function t(){}return t.u=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Math.floor(256/t.length)*t.length,n="";n.length<20;)for(var r=y(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function _(t,e){return t<e?-1:t>e?1:0}function w(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function x(t){return t+"\0"}var T=function(){function t(t){this.h=t}return t.fromBase64String=function(e){return new t(atob(e))},t.fromUint8Array=function(e){return new t(function(t){for(var e="",n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(e))},t.prototype.toBase64=function(){return t=this.h,btoa(t);var t},t.prototype.toUint8Array=function(){return function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.h)},t.prototype.l=function(){return 2*this.h.length},t.prototype._=function(t){return _(this.h,t.h)},t.prototype.isEqual=function(t){return this.h===t.h},t}();T.T=new T("");var E={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},S=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return Object(a.c)(e,t),e}(Error),O=function(){function t(t){this.I=t}return t.fromBase64String=function(e){try{return new t(T.fromBase64String(e))}catch(e){throw new S(E.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(T.fromUint8Array(e))},t.prototype.toBase64=function(){return this.I.toBase64()},t.prototype.toUint8Array=function(){return this.I.toUint8Array()},t.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this.I.isEqual(t.I)},t}(),k=function(){function t(t){this.uid=t}return t.prototype.m=function(){return null!=this.uid},t.prototype.A=function(){return this.m()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}();k.UNAUTHENTICATED=new k(null),k.R=new k("google-credentials-uid"),k.P=new k("first-party-uid");var C=function(t,e){this.user=e,this.type="OAuth",this.g={},this.g.Authorization="Bearer "+t},M=function(){function t(){this.V=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.p=function(){},t.prototype.v=function(t){this.V=t,t(k.UNAUTHENTICATED)},t.prototype.S=function(){this.V=null},t}(),A=function(){function t(t){var e=this;this.D=null,this.currentUser=k.UNAUTHENTICATED,this.C=!1,this.N=0,this.V=null,this.forceRefresh=!1,this.D=function(){e.N++,e.currentUser=e.$(),e.C=!0,e.V&&e.V(e.currentUser)},this.N=0,this.auth=t.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.D):(this.D(null),t.get().then((function(t){e.auth=t,e.D&&e.auth.addAuthTokenListener(e.D)}),(function(){})))}return t.prototype.getToken=function(){var t=this,e=this.N,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.N!==e?(h("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(m("string"==typeof n.accessToken),new C(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype.p=function(){this.forceRefresh=!0},t.prototype.v=function(t){this.V=t,this.C&&t(this.currentUser)},t.prototype.S=function(){this.auth&&this.auth.removeAuthTokenListener(this.D),this.D=null,this.V=null},t.prototype.$=function(){var t=this.auth&&this.auth.getUid();return m(null===t||"string"==typeof t),new k(t)},t}(),I=function(){function t(t,e){this.F=t,this.O=e,this.type="FirstParty",this.user=k.P}return Object.defineProperty(t.prototype,"g",{get:function(){var t={"X-Goog-AuthUser":this.O},e=this.F.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),t}
2,enumerable:!1,configurable:!0}),t}(),j=function(){function t(t,e){this.F=t,this.O=e}return t.prototype.getToken=function(){return Promise.resolve(new I(this.F,this.O))},t.prototype.v=function(t){t(k.P)},t.prototype.S=function(){},t.prototype.p=function(){},t}(),P=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.k=function(t){return n.M(t)},this.L=function(t){return e.B(t)})}return t.prototype.M=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.L&&this.L(t),t},t}();P.q=-1;var R=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new S(E.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new S(E.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new S(E.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new S(E.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,1e6*(e-1e3*n))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype.U=function(t){return this.seconds===t.seconds?_(this.nanoseconds,t.nanoseconds):_(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},t.prototype.valueOf=function(){var t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},t}(),N=function(){function t(t){this.timestamp=t}return t.K=function(e){return new t(e)},t.min=function(){return new t(new R(0,0))},t.prototype._=function(t){return this.timestamp.U(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.W=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.j=function(){return this.timestamp},t}(),L=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&v(),void 0===n?n=t.length-e:n>t.length-e&&v(),this.segments=t,this.offset=e,this.G=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.G},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.H(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach((function(t){n.push(t)})):n.push(e),this.J(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.Y=function(t){return t=void 0===t?1:t,this.J(this.segments,this.offset+t,this.length-t)},t.prototype.X=function(){return this.J(this.segments,this.offset,this.length-1)},t.prototype.Z=function(){return this.segments[this.offset]},t.prototype.tt=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.et=function(){return 0===this.length},t.prototype.nt=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.st=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.it=function(){return this.segments.slice(this.offset,this.limit())},t.H=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.J=function(t,n,r){return new e(t,n,r)},e.prototype.rt=function(){return this.it().join("/")},e.prototype.toString=function(){return this.rt()},e.ot=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=[],i=0,o=t;i<o.length;i++){var a=o[i];if(a.indexOf("//")>=0)throw new S(E.INVALID_ARGUMENT,"Invalid segment ("+a+"). Paths must not contain // in them.");r.push.apply(r,a.split("/").filter((function(t){return t.length>0})))}return new e(r)},e.ct=function(){return new e([])},e}(L),F=/^[_a-zA-Z][_a-zA-Z0-9]*$/,U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.J=function(t,n,r){return new e(t,n,r)},e.at=function(t){return F.test(t)},e.prototype.rt=function(){return this.it().map((function(t){return t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),e.at(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.rt()},e.prototype.ut=function(){return 1===this.length&&"__name__"===this.get(0)},e.ht=function(){return new e(["__name__"])},e.lt=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new S(E.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},a=!1;i<t.length;){var s=t[i];if("\\"===s){if(i+1===t.length)throw new S(E.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new S(E.INVALID_ARGUMENT,"Path has invali
2d escape sequence: "+t);r+=u,i+=2}else"`"===s?(a=!a,i++):"."!==s||a?(r+=s,i++):(o(),i++)}if(o(),a)throw new S(E.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.ct=function(){return new e([])},e}(L),B=function(){function t(t){this.path=t}return t._t=function(e){return new t(D.ot(e))},t.ft=function(e){return new t(D.ot(e).Y(5))},t.prototype.dt=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===D.H(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.H=function(t,e){return D.H(t.path,e.path)},t.wt=function(t){return t.length%2==0},t.Et=function(e){return new t(new D(e.slice()))},t}();function V(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function z(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function H(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var q=function(){function t(t){this.fields=t,t.sort(U.H)}return t.prototype.Tt=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].nt(t))return!0;return!1},t.prototype.isEqual=function(t){return w(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),W=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function G(t){if(m(!!t),"string"==typeof t){var e=0,n=W.exec(t);if(m(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:Y(t.seconds),nanos:Y(t.nanos)}}function Y(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function X(t){return"string"==typeof t?T.fromBase64String(t):T.fromUint8Array(t)}function K(t){var e,n;return"server_timestamp"===(null===(n=((null===(e=null==t?void 0:t.mapValue)||void 0===e?void 0:e.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Q(t){var e=t.mapValue.fields.__previous_value__;return K(e)?Q(e):e}function J(t){var e=G(t.mapValue.fields.__local_write_time__.timestampValue);return new R(e.seconds,e.nanos)}function Z(t){return null==t}function $(t){return 0===t&&1/t==-1/0}function tt(t){return"number"==typeof t&&Number.isInteger(t)&&!$(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}function et(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?K(t)?4:10:v()}function nt(t,e){var n=et(t);if(n!==et(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return J(t).isEqual(J(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;var n=G(t.timestampValue),r=G(e.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return X(t.bytesValue).isEqual(X(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Y(t.geoPointValue.latitude)===Y(e.geoPointValue.latitude)&&Y(t.geoPointValue.longitude)===Y(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Y(t.integerValue)===Y(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=Y(t.doubleValue),r=Y(e.doubleValue);return n===r?$(n)===$(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return w(t.arrayValue.values||[],e.arrayValue.values||[],nt);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(V(n)!==V(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!nt(n[i],r[i])))return!1;return!0}(t,e);default:return v()}}function rt(t,e){return void 0!==(t.values||[]).find((function(t){return nt(t,e)}))}function it(t,e){var n=et(t),r=et(e);if(n!==r)return _(n,r);switch(n){case 0:return 0;case 1:return _(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=Y(t.integerValue||t.doubleValue),r=Y(e.integerValue||e.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(t,e);case 3:return ot(t.timestampValue,e.timestampValue);case 4:return ot(J(t),J(e));case 5:return _(t.stringValue,e.stringValue);case 6:return function(t,e){var n=X(t),r=X(e);return n._(r)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){for(var n=t.split("/"),r=e.split("/"),i=0;i<n.length&&i<r.length;i++){var o=_(n[i],r[i]);if(0!==o)return o}return _(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=_(Y(t.latitude),Y(e.latitude));return 0!==n?n:_(Y(t.longitude),Y(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(t,e){for(var n=t.values||[],r=e.values||[],i=0;i<n.length&&i<r.length;++i){var o=it(n[i],r[i]);if(o)return o}return _(n.length,r.length)}(t.arrayValue,e.arrayValue);case 10:return function(t,e){var n=t.fields||{},r=Object.keys(n),i=e.fields||{},o=Object.keys(i);r.sort(),o.sort();for(var a=0;a<r.length&&a<o.length;++a){var s=_(r[a],o[a]);if(0!==s)return s;var u=it(n[r[a]],i[o[a]]);if(0!==u)return u}return _(r.length,o.length)}(t.mapValue,e.mapValue);default:throw v()}}function ot(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return _(t,e);var n=G(t),r=G(e),i=_(n.seconds,r.seconds);return 0!==i?i:_(n.nanos,r.nanos)}function at(t){return st(t)}function st(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){var e=G
2(t);return"time("+e.seconds+","+e.nanos+")"}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?X(t.bytesValue).toBase64():"referenceValue"in t?(n=t.referenceValue,B.ft(n).toString()):"geoPointValue"in t?"geo("+(e=t.geoPointValue).latitude+","+e.longitude+")":"arrayValue"in t?function(t){for(var e="[",n=!0,r=0,i=t.values||[];r<i.length;r++)n?n=!1:e+=",",e+=st(i[r]);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){for(var e="{",n=!0,r=0,i=Object.keys(t.fields||{}).sort();r<i.length;r++){var o=i[r];n?n=!1:e+=",",e+=o+":"+st(t.fields[o])}return e+"}"}(t.mapValue):v();var e,n}function ut(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.rt()}}function ct(t){return!!t&&"integerValue"in t}function lt(t){return!!t&&"arrayValue"in t}function ht(t){return!!t&&"nullValue"in t}function ft(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function dt(t){return!!t&&"mapValue"in t}var pt=function(){function t(t){this.proto=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(t){if(t.et())return this.proto;for(var e=this.proto,n=0;n<t.length-1;++n){if(!e.mapValue.fields)return null;if(!dt(e=e.mapValue.fields[t.get(n)]))return null}return(e=(e.mapValue.fields||{})[t.tt()])||null},t.prototype.isEqual=function(t){return nt(this.proto,t.proto)},t}(),vt=function(){function t(t){void 0===t&&(t=pt.empty()),this.It=t,this.At=new Map}return t.prototype.set=function(t,e){return this.Rt(t,e),this},t.prototype.delete=function(t){return this.Rt(t,null),this},t.prototype.Rt=function(t,e){for(var n=this.At,r=0;r<t.length-1;++r){var i=t.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===et(o)?(o=new Map(Object.entries(o.mapValue.fields||{})),n.set(i,o),n=o):(o=new Map,n.set(i,o),n=o)}n.set(t.tt(),e)},t.prototype.Pt=function(){var t=this.yt(U.ct(),this.At);return null!=t?new pt(t):this.It},t.prototype.yt=function(t,e){var n=this,r=!1,i=this.It.field(t),o=dt(i)?Object.assign({},i.mapValue.fields):{};return e.forEach((function(e,i){if(e instanceof Map){var a=n.yt(t.child(i),e);null!=a&&(o[i]=a,r=!0)}else null!==e?(o[i]=e,r=!0):o.hasOwnProperty(i)&&(delete o[i],r=!0)})),r?{mapValue:{fields:o}}:null},t}();function mt(t){var e=[];return z(t.fields||{},(function(t,n){var r=new U([t]);if(dt(n)){var i=mt(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,a=i;o<a.length;o++){var s=a[o];e.push(r.child(s))}}else e.push(r)})),new q(e)}var gt=function(t,e){this.key=t,this.version=e},yt=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this,e,n)||this).gt=r,o.Vt=!!i.Vt,o.hasCommittedMutations=!!i.hasCommittedMutations,o}return Object(a.c)(e,t),e.prototype.field=function(t){return this.gt.field(t)},e.prototype.data=function(){return this.gt},e.prototype.bt=function(){return this.gt.proto},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.Vt===t.Vt&&this.hasCommittedMutations===t.hasCommittedMutations&&this.gt.isEqual(t.gt)},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.gt.toString()+", {hasLocalMutations: "+this.Vt+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.Vt||this.hasCommittedMutations},enumerable:!1,configurable:!0}),e}(gt),bt=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n)||this).hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return Object(a.c)(e,t),e.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.hasCommittedMutations===this.hasCommittedMutations&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(gt),_t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!0}
2,enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(gt),wt=function(t,e,n,r,i,o,a){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=a,this.vt=null};function xt(t,e,n,r,i,o,a){return void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===a&&(a=null),new wt(t,e,n,r,i,o,a)}function Tt(t){var e=g(t);if(null===e.vt){var n=e.path.rt();null!==e.collectionGroup&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((function(t){return function(t){return t.field.rt()+t.op.toString()+at(t.value)}(t)})).join(","),n+="|ob:",n+=e.orderBy.map((function(t){return function(t){return t.field.rt()+t.dir}(t)})).join(","),Z(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=Lt(e.startAt)),e.endAt&&(n+="|ub:",n+=Lt(e.endAt)),e.vt=n}return e.vt}function Et(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(var n=0;n<t.orderBy.length;n++)if(!Ft(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(var r=0;r<t.filters.length;r++)if(i=t.filters[r],o=e.filters[r],i.op!==o.op||!i.field.isEqual(o.field)||!nt(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!Bt(t.startAt,e.startAt)&&Bt(t.endAt,e.endAt)}function St(t){return B.wt(t.path)&&null===t.collectionGroup&&0===t.filters.length}var Ot=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).field=e,i.op=n,i.value=r,i}return Object(a.c)(e,t),e.create=function(t,n,r){return t.ut()?"in"===n||"not-in"===n?this.St(t,n,r):new kt(t,n,r):"array-contains"===n?new It(t,r):"in"===n?new jt(t,r):"not-in"===n?new Pt(t,r):"array-contains-any"===n?new Rt(t,r):new e(t,n,r)},e.St=function(t,e,n){return"in"===e?new Ct(t,n):new Mt(t,n)},e.prototype.matches=function(t){var e=t.field(this.field);return"!="===this.op?null!==e&&this.Dt(it(e,this.value)):null!==e&&et(this.value)===et(e)&&this.Dt(it(e,this.value))},e.prototype.Dt=function(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case"!=":return 0!==t;case">":return t>0;case">=":return t>=0;default:return v()}},e.prototype.Ct=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}((function(){})),kt=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=B.ft(r.referenceValue),i}return Object(a.c)(e,t),e.prototype.matches=function(t){var e=B.H(t.key,this.key);return this.Dt(e)},e}(Ot),Ct=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=At("in",n),r}return Object(a.c)(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Ot),Mt=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=At("not-in",n),r}return Object(a.c)(e,t),e.prototype.matches=function(t){return!this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Ot);function At(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(t){return B.ft(t.referenceValue)}))}var It=function(t){function e(e,n){return t.call(this,e,"array-contains",n)||this}return Object(a.c)(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return lt(e)&&rt(e.arrayValue,this.value)},e}(Ot),jt=function(t){function e(e,n){return t.call(this,e,"in",n)||this}return Object(a.c)(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return null!==e&&rt(this.value.arrayValue,e)},e}(Ot),Pt=function(t){function e(e,n){return t.call(this,e,"not-in",n)||this}return Object(a.c)(e,t),e.prototype.matches=function(t){if(rt(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.field(this.field);return null!==e&&!rt(this.value.arrayValue,e)},e}(Ot),Rt=function(t){function e(e,n){return t.call(this,e,"array-contains-any",n)||this}return Object(a.c)(e,t),e.prototype.matches=function(t){var e=this,n=t.field(this.field);return!(!lt(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return rt(e.value.arrayValue,t)}))},e}(Ot),Nt=function(t,e){this.position=t,this.before=e};function Lt(t){return(t.before?"b":"a")+":"+t.position.map((function(t){return at(t)})).join(",")}var Dt=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function Ft(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function Ut(t,e,n){for(var r=0,i=0;i<t.position.length;i++){var o=e[i],a=t.position[i];if(r=o.field.ut()?B.H(B.ft(a.referenceValue),n.key):it(a,n.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function Bt(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.before!==e.before||t.position.length!==e.position.length)return!1;for(var n=0;n<t.position.length;n++)if(!nt(t.position[n],e.position[n]))return!1;return!0}var Vt=function(t,e,n,r,i,o,a,s){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o="F"),void 0===a&&(a=null),void 0===s&&(s=null),this.path=t,this.collectionGroup=e,this.xt=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=a,this.endAt=s,this.Nt=null,this.$t
2=null,this.startAt,this.endAt};function zt(t,e,n,r,i,o,a,s){return new Vt(t,e,n,r,i,o,a,s)}function Ht(t){return new Vt(t)}function qt(t){return!Z(t.limit)&&"F"===t.limitType}function Wt(t){return!Z(t.limit)&&"L"===t.limitType}function Gt(t){return t.xt.length>0?t.xt[0].field:null}function Yt(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.Ct())return r.field}return null}function Xt(t){return null!==t.collectionGroup}function Kt(t){var e=g(t);if(null===e.Nt){e.Nt=[];var n=Yt(e),r=Gt(e);if(null!==n&&null===r)n.ut()||e.Nt.push(new Dt(n)),e.Nt.push(new Dt(U.ht(),"asc"));else{for(var i=!1,o=0,a=e.xt;o<a.length;o++){var s=a[o];e.Nt.push(s),s.field.ut()&&(i=!0)}if(!i){var u=e.xt.length>0?e.xt[e.xt.length-1].dir:"asc";e.Nt.push(new Dt(U.ht(),u))}}}return e.Nt}function Qt(t){var e=g(t);if(!e.$t)if("F"===e.limitType)e.$t=xt(e.path,e.collectionGroup,Kt(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=Kt(e);r<i.length;r++){var o=i[r],a="desc"===o.dir?"asc":"desc";n.push(new Dt(o.field,a))}var s=e.endAt?new Nt(e.endAt.position,!e.endAt.before):null,u=e.startAt?new Nt(e.startAt.position,!e.startAt.before):null;e.$t=xt(e.path,e.collectionGroup,n,e.filters,e.limit,s,u)}return e.$t}function Jt(t,e,n){return new Vt(t.path,t.collectionGroup,t.xt.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Zt(t,e){return Et(Qt(t),Qt(e))&&t.limitType===e.limitType}function $t(t){return Tt(Qt(t))+"|lt:"+t.limitType}function te(t){return"Query(target="+function(t){var e=t.path.rt();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=", filters: ["+t.filters.map((function(t){return(e=t).field.rt()+" "+e.op+" "+at(e.value);var e})).join(", ")+"]"),Z(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=", orderBy: ["+t.orderBy.map((function(t){return function(t){return t.field.rt()+" ("+t.dir+")"}(t)})).join(", ")+"]"),t.startAt&&(e+=", startAt: "+Lt(t.startAt)),t.endAt&&(e+=", endAt: "+Lt(t.endAt)),"Target("+e+")"}(Qt(t))+"; limitType="+t.limitType+")"}function ee(t,e){return function(t,e){var n=e.key.path;return null!==t.collectionGroup?e.key.dt(t.collectionGroup)&&t.path.nt(n):B.wt(t.path)?t.path.isEqual(n):t.path.st(n)}(t,e)&&function(t,e){for(var n=0,r=t.xt;n<r.length;n++){var i=r[n];if(!i.field.ut()&&null===e.field(i.field))return!1}return!0}(t,e)&&function(t,e){for(var n=0,r=t.filters;n<r.length;n++)if(!r[n].matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!Ut(t.startAt,Kt(t),e))&&(!t.endAt||!Ut(t.endAt,Kt(t),e))}(t,e)}function ne(t){return function(e,n){for(var r=!1,i=0,o=Kt(t);i<o.length;i++){var a=o[i],s=re(a,e,n);if(0!==s)return s;r=r||a.field.ut()}return 0}}function re(t,e,n){var r=t.field.ut()?B.H(e.key,n.key):function(t,e,n){var r=e.field(t),i=n.field(t);return null!==r&&null!==i?it(r,i):v()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return v()}}var ie=function(){function t(t,e,n,r,i,o,a){void 0===i&&(i=N.min()),void 0===o&&(o=N.min()),void 0===a&&(a=T.T),this.target=t,this.targetId=e,this.Ft=n,this.sequenceNumber=r,this.Ot=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a}return t.prototype.kt=function(e){return new t(this.target,this.targetId,this.Ft,e,this.Ot,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.Mt=function(e,n){return new t(this.target,this.targetId,this.Ft,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.Lt=function(e){return new t(this.target,this.targetId,this.Ft,this.sequenceNumber,this.Ot,e,this.resumeToken)},t}();function oe(t,e){if(t.Bt){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:$(e)?"-0":e}}function ae(t){return{integerValue:""+t}}function se(t,e){return tt(e)?ae(e):oe(t,e)}var ue=function(){this.qt=void 0};function ce(t,e,n){return t instanceof fe?function(t,e){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof de?pe(t,e):t instanceof ve?me(t,e):function(t,e){var n=he(t,e),r=ye(n)+ye(t.Ut);return ct(n)&&ct(t.Ut)?ae(r):oe(t.Qt,r)}(t,e)}function le(t,e,n){return t instanceof de?pe(t,e):t instanceof ve?me(t,e):n}function he(t,e){return t instanceof ge?ct(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}var fe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e}(ue),de=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return Object(a.c)(e,t),e}(ue);function pe(t,e){for(var n=be(e),r=function(t){n.some((function(e){return nt(e,t)}))||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var ve=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return Object(a.c)(e,t),e}(ue);function me(t,e){for(var n=be(e),r=function(t){n=n.filter((function(e){return!nt(e,t)}))},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var ge=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Qt=e,r.Ut=n,r}return Object(a.c)(e,t),e}(ue);function ye(t){return Y(t.integerValue||t.doubleValue)}function be(t){return lt(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var _e=function(t,e){this.field=t,this.transform=e},we=function(t,e){this.version=t,this.transformResults=e},xe=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.Kt=function(){return new t},t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"Wt",{get:function(){return void 0===this.updateTime&&void 0===this.exists}
2,enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},t}();function Te(t,e){return void 0!==t.updateTime?e instanceof yt&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e instanceof yt}var Ee=function(){};function Se(t,e,n){return t instanceof Ae?function(t,e,n){var r=t.value,i=Pe(t.fieldTransforms,e,n.transformResults);return r=Ne(t.fieldTransforms,r,i),new yt(t.key,n.version,r,{hasCommittedMutations:!0})}(t,e,n):t instanceof Ie?function(t,e,n){if(!Te(t.jt,e))return new _t(t.key,n.version);var r=je(t,e,Pe(t.fieldTransforms,e,n.transformResults));return new yt(t.key,n.version,r,{hasCommittedMutations:!0})}(t,e,n):function(t,e,n){return new bt(t.key,n.version,{hasCommittedMutations:!0})}(t,0,n)}function Oe(t,e,n){return t instanceof Ae?function(t,e,n){if(!Te(t.jt,e))return e;var r=t.value,i=Re(t.fieldTransforms,n,e);r=Ne(t.fieldTransforms,r,i);var o=Me(e);return new yt(t.key,o,r,{Vt:!0})}(t,e,n):t instanceof Ie?function(t,e,n){if(!Te(t.jt,e))return e;var r=Me(e),i=je(t,e,Re(t.fieldTransforms,n,e));return new yt(t.key,r,i,{Vt:!0})}(t,e,n):function(t,e){return Te(t.jt,e)?new bt(t.key,N.min()):e}(t,e)}function ke(t,e){return function(t,e){for(var n=null,r=0,i=t;r<i.length;r++){var o=i[r],a=e instanceof yt?e.field(o.field):void 0,s=he(o.transform,a||null);null!=s&&(n=null==n?(new vt).set(o.field,s):n.set(o.field,s))}return n?n.Pt():null}(t.fieldTransforms,e)}function Ce(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.jt.isEqual(e.jt)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&w(t,e,(function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof de&&e instanceof de||t instanceof ve&&e instanceof ve?w(t.elements,e.elements,nt):t instanceof ge&&e instanceof ge?nt(t.Ut,e.Ut):t instanceof fe&&e instanceof fe}(t.transform,e.transform)}(t,e)}))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.Gt.isEqual(e.Gt))}function Me(t){return t instanceof yt?t.version:N.min()}var Ae=function(t){function e(e,n,r,i){void 0===i&&(i=[]);var o=this;return(o=t.call(this)||this).key=e,o.value=n,o.jt=r,o.fieldTransforms=i,o.type=0,o}return Object(a.c)(e,t),e}(Ee),Ie=function(t){function e(e,n,r,i,o){void 0===o&&(o=[]);var a=this;return(a=t.call(this)||this).key=e,a.data=n,a.Gt=r,a.jt=i,a.fieldTransforms=o,a.type=1,a}return Object(a.c)(e,t),e}(Ee);function je(t,e,n){var r;return r=function(t,e){var n=new vt(e);return t.Gt.fields.forEach((function(e){if(!e.et()){var r=t.data.field(e);null!==r?n.set(e,r):n.delete(e)}})),n.Pt()}(t,r=e instanceof yt?e.data():pt.empty()),Ne(t.fieldTransforms,r,n)}function Pe(t,e,n){var r=[];m(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],a=o.transform,s=null;e instanceof yt&&(s=e.field(o.field)),r.push(le(a,s,n[i]))}return r}function Re(t,e,n){for(var r=[],i=0,o=t;i<o.length;i++){var a=o[i],s=a.transform,u=null;n instanceof yt&&(u=n.field(a.field)),r.push(ce(s,u,e))}return r}function Ne(t,e,n){for(var r=new vt(e),i=0;i<t.length;i++){var o=t[i];r.set(o.field,n[i])}return r.Pt()}var Le,De,Fe=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.jt=n,r.type=2,r.fieldTransforms=[],r}return Object(a.c)(e,t),e}(Ee),Ue=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.jt=n,r.type=3,r.fieldTransforms=[],r}return Object(a.c)(e,t),e}(Ee),Be=function(t){this.count=t};function Ve(t){switch(t){case E.OK:return v();case E.CANCELLED:case E.UNKNOWN:case E.DEADLINE_EXCEEDED:case E.RESOURCE_EXHAUSTED:case E.INTERNAL:case E.UNAVAILABLE:case E.UNAUTHENTICATED:return!1;case E.INVALID_ARGUMENT:case E.NOT_FOUND:case E.ALREADY_EXISTS:case E.PERMISSION_DENIED:case E.FAILED_PRECONDITION:case E.ABORTED:case E.OUT_OF_RANGE:case E.UNIMPLEMENTED:case E.DATA_LOSS:return!0;default:return v()}}function ze(t){if(void 0===t)return f("GRPC error has no .code"),E.UNKNOWN;switch(t){case Le.OK:return E.OK;case Le.CANCELLED:return E.CANCELLED;case Le.UNKNOWN:return E.UNKNOWN;case Le.DEADLINE_EXCEEDED:return E.DEADLINE_EXCEEDED;case Le.RESOURCE_EXHAUSTED:return E.RESOURCE_EXHAUSTED;case Le.INTERNAL:return E.INTERNAL;case Le.UNAVAILABLE:return E.UNAVAILABLE;case Le.UNAUTHENTICATED:return E.UNAUTHENTICATED;case Le.INVALID_ARGUMENT:return E.INVALID_ARGUMENT;case Le.NOT_FOUND:return E.NOT_FOUND;case Le.ALREADY_EXISTS:return E.ALREADY_EXISTS;case Le.PERMISSION_DENIED:return E.PERMISSION_DENIED;case Le.FAILED_PRECONDITION:return E.FAILED_PRECONDITION;case Le.ABORTED:return E.ABORTED;case Le.OUT_OF_RANGE:return E.OUT_OF_RANGE;
2case Le.UNIMPLEMENTED:return E.UNIMPLEMENTED;case Le.DATA_LOSS:return E.DATA_LOSS;default:return v()}}(De=Le||(Le={}))[De.OK=0]="OK",De[De.CANCELLED=1]="CANCELLED",De[De.UNKNOWN=2]="UNKNOWN",De[De.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",De[De.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",De[De.NOT_FOUND=5]="NOT_FOUND",De[De.ALREADY_EXISTS=6]="ALREADY_EXISTS",De[De.PERMISSION_DENIED=7]="PERMISSION_DENIED",De[De.UNAUTHENTICATED=16]="UNAUTHENTICATED",De[De.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",De[De.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",De[De.ABORTED=10]="ABORTED",De[De.OUT_OF_RANGE=11]="OUT_OF_RANGE",De[De.UNIMPLEMENTED=12]="UNIMPLEMENTED",De[De.INTERNAL=13]="INTERNAL",De[De.UNAVAILABLE=14]="UNAVAILABLE",De[De.DATA_LOSS=15]="DATA_LOSS";var He=function(){function t(t,e){this.H=t,this.root=e||We.EMPTY}return t.prototype.zt=function(e,n){return new t(this.H,this.root.zt(e,n,this.H).copy(null,null,We.Ht,null,null))},t.prototype.remove=function(e){return new t(this.H,this.root.remove(e,this.H).copy(null,null,We.Ht,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.et();){var n=this.H(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.et();){var r=this.H(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.et=function(){return this.root.et()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.Jt=function(){return this.root.Jt()},t.prototype.Yt=function(){return this.root.Yt()},t.prototype.Xt=function(t){return this.root.Xt(t)},t.prototype.forEach=function(t){this.Xt((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.Xt((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.Zt=function(t){return this.root.Zt(t)},t.prototype.te=function(){return new qe(this.root,null,this.H,!1)},t.prototype.ee=function(t){return new qe(this.root,t,this.H,!1)},t.prototype.ne=function(){return new qe(this.root,null,this.H,!0)},t.prototype.se=function(t){return new qe(this.root,t,this.H,!0)},t}(),qe=function(){function t(t,e,n,r){this.ie=r,this.re=[];for(var i=1;!t.et();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.ie?t.left:t.right;else{if(0===i){this.re.push(t);break}this.re.push(t),t=this.ie?t.right:t.left}}return t.prototype.oe=function(){var t=this.re.pop(),e={key:t.key,value:t.value};if(this.ie)for(t=t.left;!t.et();)this.re.push(t),t=t.right;else for(t=t.right;!t.et();)this.re.push(t),t=t.left;return e},t.prototype.ce=function(){return this.re.length>0},t.prototype.ae=function(){if(0===this.re.length)return null;var t=this.re[this.re.length-1];return{key:t.key,value:t.value}},t}(),We=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.et=function(){return!1},t.prototype.Xt=function(t){return this.left.Xt(t)||t(this.key,this.value)||this.right.Xt(t)},t.prototype.Zt=function(t){return this.right.Zt(t)||t(this.key,this.value)||this.left.Zt(t)},t.prototype.min=function(){return this.left.et()?this:this.left.min()},t.prototype.Jt=function(){return this.min().key},t.prototype.Yt=function(){return this.right.et()?this.key:this.right.Yt()},t.prototype.zt=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.zt(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.zt(t,e,n))).ue()},t.prototype.he=function(){if(this.left.et())return t.EMPTY;var e=this;return e.left.le()||e.left.left.le()||(e=e._e()),(e=e.copy(null,null,null,e.left.he(),null)).ue()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.et()||i.left.le()||i.left.left.le()||(i=i._e()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.le()&&(i=i.fe()),i.right.et()||i.right.le()||i.right.left.le()||(i=i.de()),0===n(e,i.key)){if(i.right.et())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.he())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.ue()},t.prototype.le=function(){return this.color},t.prototype.ue=function(){var t=this;return t.right.le()&&!t.left.le()&&(t=t.we()),t.left.le()&&t.left.left.le()&&(t=t.fe()),t.left.le()&&t.right.le()&&(t=t.Ee()),t},t.prototype._e=function(){var t=this.Ee();return t.right.left.le()&&(t=(t=(t=t.copy(null,null,null,null,t.right.fe())).we()).Ee()),t},t.prototype.de=function(){var t=this.Ee();
2return t.left.left.le()&&(t=(t=t.fe()).Ee()),t},t.prototype.we=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.fe=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.Ee=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.Te=function(){var t=this.Ie();return Math.pow(2,t)<=this.size+1},t.prototype.Ie=function(){if(this.le()&&this.left.le())throw v();if(this.right.le())throw v();var t=this.left.Ie();if(t!==this.right.Ie())throw v();return t+(this.le()?0:1)},t}();We.EMPTY=null,We.RED=!0,We.Ht=!1,We.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw v()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw v()},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.zt=function(t,e,n){return new We(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.et=function(){return!0},t.prototype.Xt=function(t){return!1},t.prototype.Zt=function(t){return!1},t.prototype.Jt=function(){return null},t.prototype.Yt=function(){return null},t.prototype.le=function(){return!1},t.prototype.Te=function(){return!0},t.prototype.Ie=function(){return 0},t}());var Ge=function(){function t(t){this.H=t,this.data=new He(this.H)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.Jt()},t.prototype.last=function(){return this.data.Yt()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.Xt((function(e,n){return t(e),!1}))},t.prototype.me=function(t,e){for(var n=this.data.ee(t[0]);n.ce();){var r=n.oe();if(this.H(r.key,t[1])>=0)return;e(r.key)}},t.prototype.Ae=function(t,e){var n;for(n=void 0!==e?this.data.ee(e):this.data.te();n.ce();)if(!t(n.oe().key))return},t.prototype.Re=function(t){var e=this.data.ee(t);return e.ce()?e.oe().key:null},t.prototype.te=function(){return new Ye(this.data.te())},t.prototype.ee=function(t){return new Ye(this.data.ee(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).zt(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.et=function(){return this.data.et()},t.prototype.Pe=function(t){var e=this;return e.size<t.size&&(e=t,t=this),t.forEach((function(t){e=e.add(t)})),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.te(),r=e.data.te();n.ce();){var i=n.oe().key,o=r.oe().key;if(0!==this.H(i,o))return!1}return!0},t.prototype.it=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},t.prototype.toString=function(){var t=[];return this.forEach((function(e){return t.push(e)})),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.H);return n.data=e,n},t}(),Ye=function(){function t(t){this.ye=t}return t.prototype.oe=function(){return this.ye.oe().key},t.prototype.ce=function(){return this.ye.ce()},t}(),Xe=new He(B.H);function Ke(){return Xe}function Qe(){return Ke()}var Je=new He(B.H);function Ze(){return Je}var $e=new He(B.H);function tn(){return $e}var en=new Ge(B.H);function nn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=en,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var rn=new Ge(_);function on(){return rn}var an=function(){function t(t){this.H=t?function(e,n){return t(e,n)||B.H(e.key,n.key)}:function(t,e){return B.H(t.key,e.key)},this.ge=Ze(),this.Ve=new He(this.H)}return t.pe=function(e){return new t(e.H)},t.prototype.has=function(t){return null!=this.ge.get(t)},t.prototype.get=function(t){return this.ge.get(t)},t.prototype.first=function(){return this.Ve.Jt()},t.prototype.last=function(){return this.Ve.Yt()},t.prototype.et=function(){return this.Ve.et()},t.prototype.indexOf=function(t){var e=this.ge.get(t);return e?this.Ve.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.Ve.size}
2,enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.Ve.Xt((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.ge.zt(t.key,t),e.Ve.zt(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.ge.remove(t),this.Ve.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.Ve.te(),r=e.Ve.te();n.ce();){var i=n.oe().key,o=r.oe().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach((function(e){t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.H=this.H,r.ge=e,r.Ve=n,r},t}(),sn=function(){function t(){this.be=new He(B.H)}return t.prototype.track=function(t){var e=t.doc.key,n=this.be.get(e);n?0!==t.type&&3===n.type?this.be=this.be.zt(e,t):3===t.type&&1!==n.type?this.be=this.be.zt(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.be=this.be.zt(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.be=this.be.zt(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.be=this.be.remove(e):1===t.type&&2===n.type?this.be=this.be.zt(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.be=this.be.zt(e,{type:2,doc:t.doc}):v():this.be=this.be.zt(e,t)},t.prototype.ve=function(){var t=[];return this.be.Xt((function(e,n){t.push(n)})),t},t}(),un=function(){function t(t,e,n,r,i,o,a,s){this.query=t,this.docs=e,this.Se=n,this.docChanges=r,this.De=i,this.fromCache=o,this.Ce=a,this.xe=s}return t.Ne=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,an.pe(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.De.et()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.Ce===t.Ce&&this.De.isEqual(t.De)&&Zt(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.Se.isEqual(t.Se)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),cn=function(){function t(t,e,n,r,i){this.Ot=t,this.$e=e,this.Fe=n,this.Oe=r,this.ke=i}return t.Me=function(e,n){var r=new Map;return r.set(e,ln.Le(e,n)),new t(N.min(),r,on(),Ke(),nn())},t}(),ln=function(){function t(t,e,n,r,i){this.resumeToken=t,this.Be=e,this.qe=n,this.Ue=r,this.Qe=i}return t.Le=function(e,n){return new t(T.T,n,nn(),nn(),nn())},t}(),hn=function(t,e,n,r){this.Ke=t,this.removedTargetIds=e,this.key=n,this.We=r},fn=function(t,e){this.targetId=t,this.je=e},dn=function(t,e,n,r){void 0===n&&(n=T.T),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},pn=function(){function t(){this.Ge=0,this.ze=gn(),this.He=T.T,this.Je=!1,this.Ye=!0}return Object.defineProperty(t.prototype,"Be",{get:function(){return this.Je},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.He},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Xe",{get:function(){return 0!==this.Ge},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ze",{get:function(){return this.Ye},enumerable:!1,configurable:!0}),t.prototype.tn=function(t){t.l()>0&&(this.Ye=!0,this.He=t)},t.prototype.en=function(){var t=nn(),e=nn(),n=nn();return this.ze.forEach((function(r,i){switch(i){case 0:t=t.add(r);break;case 2:e=e.add(r);break;case 1:n=n.add(r);break;default:v()}})),new ln(this.He,this.Je,t,e,n)},t.prototype.nn=function(){this.Ye=!1,this.ze=gn()},t.prototype.sn=function(t,e){this.Ye=!0,this.ze=this.ze.zt(t,e)},t.prototype.rn=function(t){this.Ye=!0,this.ze=this.ze.remove(t)},t.prototype.on=function(){this.Ge+=1},t.prototype.cn=function(){this.Ge-=1},t.prototype.an=function(){this.Ye=!0,this.Je=!0},t}(),vn=function(){function t(t){this.un=t,this.hn=new Map,this.ln=Ke(),this._n=mn(),this.fn=new Ge(_)}return t.prototype.dn=function(t){for(var e=0,n=t.Ke;e<n.length;e++){var r=n[e];t.We instanceof yt?this.wn(r,t.We):t.We instanceof bt&&this.En(r,t.key,t.We)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)r=o[i],this.En(r,t.key,t.We)},t.prototype.Tn=function(t){var e=this;this.In(t,(function(n){var r=e.mn(n);switch(t.state){case 0:e.An(n)&&r.tn(t.resumeToken);break;case 1:r.cn(),r.Xe||r.nn(),r.tn(t.resumeToken);break;case 2:r.cn(),r.Xe||e.removeTarget(n);break;case 3:e.An(n)&&(r.an(),r.tn(t.resumeToken));break;case 4:e.An(n)&&(e.Rn(n),r.tn(t.resumeToken));break;default:v()}}))},t.prototype.In=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.hn.forEach((function(t,r){n.An(r)&&e(r)}))},t.prototype.Pn=function(t){var e=t.targetId,n=t.je.count,r=this.yn(e);if(r){var i=r.target;if(St(i))if(0===n){var o=new B(i.path);this.En(e,o,new bt(o,N.min()))}else m(1===n);else this.gn(e)!==n&&(this.Rn(e),this.fn=this.fn.add(e))}},t.prototype.Vn=function(t){var e=this,n=new Map;this.hn.forEach((function(r,i){var o=e.yn(i);if(o){if(r.Be&&St(o.target)){var a=new B(o.target.path);null!==e.ln.get(a)||e.pn(i,a)||e.En(i,a,new bt(a,t))}r.Ze&&(n.set(i,r.en()),r.nn())}}));var r=nn();
2this._n.forEach((function(t,n){var i=!0;n.Ae((function(t){var n=e.yn(t);return!n||2===n.Ft||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new cn(t,n,this.fn,this.ln,r);return this.ln=Ke(),this._n=mn(),this.fn=new Ge(_),i},t.prototype.wn=function(t,e){if(this.An(t)){var n=this.pn(t,e.key)?2:0;this.mn(t).sn(e.key,n),this.ln=this.ln.zt(e.key,e),this._n=this._n.zt(e.key,this.bn(e.key).add(t))}},t.prototype.En=function(t,e,n){if(this.An(t)){var r=this.mn(t);this.pn(t,e)?r.sn(e,1):r.rn(e),this._n=this._n.zt(e,this.bn(e).delete(t)),n&&(this.ln=this.ln.zt(e,n))}},t.prototype.removeTarget=function(t){this.hn.delete(t)},t.prototype.gn=function(t){var e=this.mn(t).en();return this.un.vn(t).size+e.qe.size-e.Qe.size},t.prototype.on=function(t){this.mn(t).on()},t.prototype.mn=function(t){var e=this.hn.get(t);return e||(e=new pn,this.hn.set(t,e)),e},t.prototype.bn=function(t){var e=this._n.get(t);return e||(e=new Ge(_),this._n=this._n.zt(t,e)),e},t.prototype.An=function(t){var e=null!==this.yn(t);return e||h("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.yn=function(t){var e=this.hn.get(t);return e&&e.Xe?null:this.un.Sn(t)},t.prototype.Rn=function(t){var e=this;this.hn.set(t,new pn),this.un.vn(t).forEach((function(n){e.En(t,n,null)}))},t.prototype.pn=function(t,e){return this.un.vn(t).has(e)},t}();function mn(){return new He(B.H)}function gn(){return new He(B.H)}var yn={asc:"ASCENDING",desc:"DESCENDING"},bn={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},_n=function(t,e){this.t=t,this.Bt=e};function wn(t,e){return t.Bt?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function xn(t,e){return t.Bt?e.toBase64():e.toUint8Array()}function Tn(t,e){return wn(t,e.j())}function En(t){return m(!!t),N.K(function(t){var e=G(t);return new R(e.seconds,e.nanos)}(t))}function Sn(t,e){return function(t){return new D(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).rt()}function On(t){var e=D.ot(t);return m(Qn(e)),e}function kn(t,e){return Sn(t.t,e.path)}function Cn(t,e){var n=On(e);if(n.get(1)!==t.t.projectId)throw new S(E.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.t.projectId);if(n.get(3)!==t.t.database)throw new S(E.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.t.database);return new B(jn(n))}function Mn(t,e){return Sn(t.t,e)}function An(t){var e=On(t);return 4===e.length?D.ct():jn(e)}function In(t){return new D(["projects",t.t.projectId,"databases",t.t.database]).rt()}function jn(t){return m(t.length>4&&"documents"===t.get(4)),t.Y(5)}function Pn(t,e,n){return{name:kn(t,e),fields:n.proto.mapValue.fields}}function Rn(t,e,n){var r=Cn(t,e.name),i=En(e.updateTime),o=new pt({mapValue:{fields:e.fields}});return new yt(r,i,o,{hasCommittedMutations:!!n})}function Nn(t,e){var n;if(e instanceof Ae)n={update:Pn(t,e.key,e.value)};else if(e instanceof Fe)n={delete:kn(t,e.key)};else if(e instanceof Ie)n={update:Pn(t,e.key,e.data),updateMask:Kn(e.Gt)};else{if(!(e instanceof Ue))return v();n={verify:kn(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((function(t){return function(t,e){var n=e.transform;if(n instanceof fe)return{fieldPath:e.field.rt(),setToServerValue:"REQUEST_TIME"};if(n instanceof de)return{fieldPath:e.field.rt(),appendMissingElements:{values:n.elements}};if(n instanceof ve)return{fieldPath:e.field.rt(),removeAllFromArray:{values:n.elements}};if(n instanceof ge)return{fieldPath:e.field.rt(),increment:n.Ut};throw v()}(0,t)}))),e.jt.Wt||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Tn(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:v()}(t,e.jt)),n}function Ln(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?xe.updateTime(En(t.updateTime)):void 0!==t.exists?xe.exists(t.exists):xe.Kt()}
2(e.currentDocument):xe.Kt(),r=e.updateTransforms?e.updateTransforms.map((function(e){return function(t,e){var n=null;if("setToServerValue"in e)m("REQUEST_TIME"===e.setToServerValue),n=new fe;else if("appendMissingElements"in e){var r=e.appendMissingElements.values||[];n=new de(r)}else if("removeAllFromArray"in e){var i=e.removeAllFromArray.values||[];n=new ve(i)}else"increment"in e?n=new ge(t,e.increment):v();var o=U.lt(e.fieldPath);return new _e(o,n)}(t,e)})):[];if(e.update){e.update.name;var i=Cn(t,e.update.name),o=new pt({mapValue:{fields:e.update.fields}});if(e.updateMask){var a=function(t){var e=t.fieldPaths||[];return new q(e.map((function(t){return U.lt(t)})))}(e.updateMask);return new Ie(i,o,a,n,r)}return new Ae(i,o,n,r)}if(e.delete){var s=Cn(t,e.delete);return new Fe(s,n)}if(e.verify){var u=Cn(t,e.verify);return new Ue(u,n)}return v()}function Dn(t,e){return{documents:[Mn(t,e.path)]}}function Fn(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Mn(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Mn(t,r.X()),n.structuredQuery.from=[{collectionId:r.tt()}]);var i=function(t){if(0!==t.length){var e=t.map((function(t){return function(t){if("=="===t.op){if(ft(t.value))return{unaryFilter:{field:Wn(t.field),op:"IS_NAN"}};if(ht(t.value))return{unaryFilter:{field:Wn(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(ft(t.value))return{unaryFilter:{field:Wn(t.field),op:"IS_NOT_NAN"}};if(ht(t.value))return{unaryFilter:{field:Wn(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Wn(t.field),op:qn(t.op),value:t.value}}}(t)}));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}}(e.filters);i&&(n.structuredQuery.where=i);var o=function(t){if(0!==t.length)return t.map((function(t){return function(t){return{field:Wn(t.field),direction:Hn(t.dir)}}(t)}))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var a=function(t,e){return t.Bt||Z(e)?e:{value:e}}(t,e.limit);return null!==a&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=Vn(e.startAt)),e.endAt&&(n.structuredQuery.endAt=Vn(e.endAt)),n}function Un(t){var e=An(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){m(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var a=[];n.where&&(a=Bn(n.where));var s=[];n.orderBy&&(s=n.orderBy.map((function(t){return function(t){return new Dt(Gn(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t)})));var u=null;n.limit&&(u=function(t){var e;return Z(e="object"==typeof t?t.value:t)?null:e}(n.limit));var c=null;n.startAt&&(c=zn(n.startAt));var l=null;return n.endAt&&(l=zn(n.endAt)),zt(e,i,s,a,u,"F",c,l)}function Bn(t){return t?void 0!==t.unaryFilter?[Xn(t)]:void 0!==t.fieldFilter?[Yn(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return Bn(t)})).reduce((function(t,e){return t.concat(e)})):v():[]}function Vn(t){return{before:t.before,values:t.position}}function zn(t){var e=!!t.before,n=t.values||[];return new Nt(n,e)}function Hn(t){return yn[t]}function qn(t){return bn[t]}function Wn(t){return{fieldPath:t.rt()}}function Gn(t){return U.lt(t.fieldPath)}function Yn(t){return Ot.create(Gn(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return v()}}(t.fieldFilter.op),t.fieldFilter.value)}function Xn(t){switch(t.unaryFilter.op){case"IS_NAN":var e=Gn(t.unaryFilter.field);return Ot.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=Gn(t.unaryFilter.field);return Ot.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=Gn(t.unaryFilter.field);return Ot.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=Gn(t.unaryFilter.field);return Ot.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return v()}}function Kn(t){var e=[];return t.fields.forEach((function(t){return e.push(t.rt())})),{fieldPaths:e}}function Qn(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}var Jn=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Zn=function(){function t(t){var e=this;this.Dn=null,this.Cn=null,this.result=void 0,this.error=void 0,this.xn=!1,this.Nn=!1,t((function(t){e.xn=!0,e.result=t,e.Dn&&e.Dn(t)}),(function(t){e.xn=!0,e.error=t,e.Cn&&e.Cn(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.Nn&&v(),this.Nn=!0,this.xn?this.error?this.$n(n,this.error):this.Fn(e,this.result):new t((function(t,i){r.Dn=function(n){r.Fn(e,n).next(t,i)},r.Cn=function(e){r.$n(n,e).next(t,i)}}))},t.prototype.On=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.kn=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.Fn=function(e,n){return e?this.kn((function(){return e(n)})):t.resolve(n)},t.prototype.$n=function(e,n){return e?this.kn((function(){return e(n)})):t.reject(n)},t.resolve=function(e){return new t((function(t,n){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.Mn=function(e){return new t((function(t,n){var r=0,i=0,o=!1;e.forEach((function(e){++r,e.next((function(){++i,o&&i===r&&t()}),(function(t){return n(t)}))})),o=!0,i===r&&t()}))},t.Ln=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next((function(n){return n?t.resolve(n):e()}))},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach((function(t,i){r.push(e.call(n,t,i))})),this.Mn(r)},t}(),$n=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.Bn=new Jn,this.transaction.oncomplete=function(){n.Bn.resolve()},this.transaction.onabort=function(){e.error?n.Bn.reject(new nr(t,e.error)):n.Bn.resolve()},this.transaction.onerror=function(e){var r=sr(e.target.error);n.Bn.reject(new nr(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new nr(n,e)}},Object.defineProperty(t.prototype,"qn",{get:function(){return this.Bn.promise}
2,enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.Bn.reject(t),this.aborted||(h("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return new ir(e)},t}(),tr=function(){function e(t,n,r){this.name=t,this.version=n,this.Un=r,12.2===e.Qn(Object(i.p)())&&f("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return e.delete=function(t){return h("SimpleDb","Removing database:",t),or(window.indexedDB.deleteDatabase(t)).On()},e.Kn=function(){if("undefined"==typeof indexedDB)return!1;if(e.Wn())return!0;var t=Object(i.p)(),n=e.Qn(t),r=0<n&&n<10,o=e.jn(t),a=0<o&&o<4.5;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||r||a)},e.Wn=function(){var e;return"undefined"!=typeof t&&"YES"===(null===(e=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}))||void 0===e?void 0:e.Gn)},e.zn=function(t,e){return t.store(e)},e.Qn=function(t){var e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)},e.jn=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},e.prototype.Hn=function(t){return Object(a.b)(this,void 0,void 0,(function(){var e,n=this;return Object(a.d)(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(h("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(t){var n=t.target.result;e(n)},i.onblocked=function(){r(new nr(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(e){var n=e.target.error;"VersionError"===n.name?r(new S(E.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):r(new nr(t,n))},i.onupgradeneeded=function(t){h("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',t.oldVersion);var e=t.target.result;n.Un.Jn(e,i.transaction,t.oldVersion,n.version).next((function(){h("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:e.db=r.sent(),r.label=2;case 2:return[2,(this.Yn&&(this.db.onversionchange=function(t){return n.Yn(t)}),this.db)]}}))}))},e.prototype.Xn=function(t){this.Yn=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},e.prototype.runTransaction=function(t,e,n,r){return Object(a.b)(this,void 0,void 0,(function(){var i,o,s,u,c;return Object(a.d)(this,(function(l){switch(l.label){case 0:i="readonly"===e,o=0,s=function(){var e,s,c,l,f;return Object(a.d)(this,(function(a){switch(a.label){case 0:++o,a.label=1;case 1:return a.trys.push([1,4,,5]),[4,u.Hn(t)];case 2:return u.db=a.sent(),e=$n.open(u.db,t,i?"readonly":"readwrite",n),s=r(e).catch((function(t){return e.abort(t),Zn.reject(t)})).On(),c={},s.catch((function(){})),[4,e.qn];case 3:return[2,(c.value=(a.sent(),s),c)];case 4:return l=a.sent(),f="FirebaseError"!==l.name&&o<3,h("SimpleDb","Transaction failed with error:",l.message,"Retrying:",f),u.close(),f?[3,5]:[2,{value:Promise.reject(l)}];case 5:return[2]}}
2))},u=this,l.label=1;case 1:return[5,s()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}}))}))},e.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},e}(),er=function(){function t(t){this.Zn=t,this.ts=!1,this.es=null}return Object.defineProperty(t.prototype,"xn",{get:function(){return this.ts},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ns",{get:function(){return this.es},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.Zn=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.ts=!0},t.prototype.ss=function(t){this.es=t},t.prototype.delete=function(){return or(this.Zn.delete())},t}(),nr=function(t){function e(e,n){var r=this;return(r=t.call(this,E.UNAVAILABLE,"IndexedDB transaction '"+e+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return Object(a.c)(e,t),e}(S);function rr(t){return"IndexedDbTransactionError"===t.name}var ir=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(h("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(h("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),or(n)},t.prototype.add=function(t){return h("SimpleDb","ADD",this.store.name,t,t),or(this.store.add(t))},t.prototype.get=function(t){var e=this;return or(this.store.get(t)).next((function(n){return void 0===n&&(n=null),h("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return h("SimpleDb","DELETE",this.store.name,t),or(this.store.delete(t))},t.prototype.count=function(){return h("SimpleDb","COUNT",this.store.name),or(this.store.count())},t.prototype.rs=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.os(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.cs=function(t,e){h("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.us=!1;var r=this.cursor(n);return this.os(r,(function(t,e,n){return n.delete()}))},t.prototype.hs=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.os(r,e)},t.prototype.ls=function(t){var e=this.cursor({});return new Zn((function(n,r){e.onerror=function(t){var e=sr(t.target.error);r(e)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next((function(t){t?r.continue():n()})):n()}}))},t.prototype.os=function(t,e){var n=[];return new Zn((function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new er(i),a=e(i.primaryKey,i.value,o);if(a instanceof Zn){var s=a.catch((function(t){return o.done(),Zn.reject(t)}));n.push(s)}o.xn?r():null===o.ns?i.continue():i.continue(o.ns)}else r()}})).next((function(){return Zn.Mn(n)}))},t.prototype.options=function(t,e){var n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.us?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function or(t){return new Zn((function(e,n){t.onsuccess=function(t){var n=t.target.result;e(n)},t.onerror=function(t){var e=sr(t.target.error);n(e)}}))}var ar=!1;function sr(t){var e=tr.Qn(Object(i.p)());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var r=new S("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return ar||(ar=!0,setTimeout((function(){throw r}),0)),r}}return t}var ur=function(){function t(t,e,n,r,i){this._s=t,this.fs=e,this.ds=n,this.op=r,this.ws=i,this.Es=new Jn,this.then=this.Es.promise.then.bind(this.Es.promise),this.Es.promise.catch((function(t){}))}return t.Ts=function(e,n,r,i,o){var a=new t(e,n,Date.now()+r,i,o);return a.start(r),a},t.prototype.start=function(t){var e=this;this.Is=setTimeout((function(){return e.As()}),t)},t.prototype.Rs=function(){return this.As()},t.prototype.cancel=function(t){null!==this.Is&&(this.clearTimeout(),this.Es.reject(new S(E.CANCELLED,"Operation cancelled"+(t?": "+t:"")))
2)},t.prototype.As=function(){var t=this;this._s.Ps((function(){return null!==t.Is?(t.clearTimeout(),t.op().then((function(e){return t.Es.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.Is&&(this.ws(this),clearTimeout(this.Is),this.Is=null)},t}();function cr(t,e){if(f("AsyncQueue",e+": "+t),rr(t))return new S(E.UNAVAILABLE,e+": "+t);throw t}var lr="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",hr=function(){function t(){this.ys=[]}return t.prototype.gs=function(t){this.ys.push(t)},t.prototype.Vs=function(){this.ys.forEach((function(t){return t()}))},t}();function fr(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=pr(e)),e=dr(t.get(n),e);return pr(e)}function dr(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="\x01\x10";break;case"\x01":n+="\x01\x11";break;default:n+=o}}return n}function pr(t){return t+"\x01\x01"}function vr(t){var e=t.length;if(m(e>=2),2===e)return m("\x01"===t.charAt(0)&&"\x01"===t.charAt(1)),D.ct();for(var n=e-2,r=[],i="",o=0;o<e;){var a=t.indexOf("\x01",o);switch((a<0||a>n)&&v(),t.charAt(a+1)){case"\x01":var s=t.substring(o,a),u=void 0;0===i.length?u=s:(u=i+=s,i=""),r.push(u);break;case"\x10":i+=t.substring(o,a),i+="\0";break;case"\x11":i+=t.substring(o,a+1);break;default:v()}o=a+2}return new D(r)}var mr=function(t,e){this.seconds=t,this.nanoseconds=e},gr=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};gr.store="owner",gr.key="owner";var yr=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};yr.store="mutationQueues",yr.keyPath="userId";var br=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};br.store="mutations",br.keyPath="batchId",br.userMutationsIndex="userMutationsIndex",br.userMutationsKeyPath=["userId","batchId"];var _r=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,fr(e)]},t.key=function(t,e,n){return[t,fr(e),n]},t}();_r.store="documentMutations",_r.PLACEHOLDER=new _r;var wr=function(t,e){this.path=t,this.readTime=e},xr=function(t,e){this.path=t,this.version=e},Tr=function(t,e,n,r,i,o){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};Tr.store="remoteDocuments",Tr.readTimeIndex="readTimeIndex",Tr.readTimeIndexPath="readTime",Tr.collectionReadTimeIndex="collectionReadTimeIndex",Tr.collectionReadTimeIndexPath=["parentPath","readTime"];var Er=function(t){this.byteSize=t};Er.store="remoteDocumentGlobal",Er.key="remoteDocumentGlobalKey";var Sr=function(t,e,n,r,i,o,a){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a};Sr.store="targets",Sr.keyPath="targetId",Sr.queryTargetsIndexName="queryTargetsIndex",Sr.queryTargetsKeyPath=["canonicalId","targetId"];var Or=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};Or.store="targetDocuments",Or.keyPath=["targetId","path"],Or.documentTargetsIndex="documentTargetsIndex",Or.documentTargetsKeyPath=["path","targetId"];var kr=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};kr.key="targetGlobalKey",kr.store="targetGlobal";var Cr=function(t,e){this.collectionId=t,this.parent=e};Cr.store="collectionParents",Cr.keyPath=["collectionId","parent"];var Mr=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};Mr.store="clientMetadata",Mr.keyPath="clientId";var Ar=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};Ar.store="bundles",Ar.keyPath="bundleId";var Ir=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};Ir.store="namedQueries",Ir.keyPath="name";var jr=Object(a.f)(Object(a.f)([],Object(a.f)(Object(a.f)([],Object(a.f)(Object(a.f)([],Object(a.f)(Object(a.f)([],[yr.store,br.store,_r.store,Tr.store,Sr.store,gr.store,kr.store,Or.store]),[Mr.store])),[Er.store])),[Cr.store])),[Ar.store,Ir.store]),Pr=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).ps=e,r.bs=n,r}return Object(a.c)(e,t),e}(hr);function Rr(t,e){var n=g(t);return tr.zn(n.ps,e)}var Nr=function(){function t(t,e,n,r){this.batchId=t,this.vs=e,this.baseMutations=n,this.mutations=r}return t.prototype.Ss=function(t,e,n){for(var r=n.Ds,i=0;i<this.mutations.length;i++){var o=this.mutations[i];o.key.isEqual(t)&&(e=Se(o,e,r[i]))}return e},t.prototype.Cs=function(t,e){for(var n=0,r=this.baseMutations;n<r.length;n++)(a=r[n]).key.isEqual(t)&&(e=Oe(a,e,this.vs));for(var i=0,o=this.mutations;i<o.length;i++){var a;(a=o[i]).key.isEqual(t)&&(e=Oe(a,e,this.vs))}return e},t.prototype.xs=function(t){var e=this,n=t;return this.mutations.forEach((function(r){var i=e.Cs(r.key,t.get(r.key));i&&(n=n.zt(r.key,i))})),n},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),nn())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&w(this.mutations,t.mutations,(function(t,e){return Ce(t,e)}))&&w(this.baseMutations,t.baseMutations,(function(t,e){return Ce(t,e)}))},t}(),Lr=function(){function t(t,e,n,r){this.batch=t,this.Ns=e,this.Ds=n,this.$s=r}return t.from=function(e,n,r){m(e.mutations.length===r.length);for(var i=tn(),o=e.mutations,a=0;a<o.length;
2a++)i=i.zt(o[a].key,r[a].version);return new t(e,n,r,i)},t}(),Dr=function(t){this.Fs=t};function Fr(t,e){if(e.document)return Rn(t.Fs,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=B.Et(e.noDocument.path),r=Hr(e.noDocument.readTime);return new bt(n,r,{hasCommittedMutations:!!e.hasCommittedMutations})}if(e.unknownDocument){var i=B.Et(e.unknownDocument.path);return r=Hr(e.unknownDocument.version),new _t(i,r)}return v()}function Ur(t,e,n){var r=Br(n),i=e.key.path.X().it();if(e instanceof yt){var o=function(t,e){return{name:kn(t,e.key),fields:e.bt().mapValue.fields,updateTime:wn(t,e.version.j())}}(t.Fs,e),a=e.hasCommittedMutations;return new Tr(null,null,o,a,r,i)}if(e instanceof bt){var s=e.key.path.it(),u=zr(e.version);return a=e.hasCommittedMutations,new Tr(null,new wr(s,u),null,a,r,i)}if(e instanceof _t){var c=e.key.path.it(),l=zr(e.version);return new Tr(new xr(c,l),null,null,!0,r,i)}return v()}function Br(t){var e=t.j();return[e.seconds,e.nanoseconds]}function Vr(t){var e=new R(t[0],t[1]);return N.K(e)}function zr(t){var e=t.j();return new mr(e.seconds,e.nanoseconds)}function Hr(t){var e=new R(t.seconds,t.nanoseconds);return N.K(e)}function qr(t,e){for(var n=(e.baseMutations||[]).map((function(e){return Ln(t.Fs,e)})),r=0;r<e.mutations.length-1;++r){var i=e.mutations[r];if(r+1<e.mutations.length&&void 0!==e.mutations[r+1].transform){var o=e.mutations[r+1];i.updateTransforms=o.transform.fieldTransforms,e.mutations.splice(r+1,1),++r}}var a=e.mutations.map((function(e){return Ln(t.Fs,e)})),s=R.fromMillis(e.localWriteTimeMs);return new Nr(e.batchId,s,n,a)}function Wr(t){var e,n,r=Hr(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?Hr(t.lastLimboFreeSnapshotVersion):N.min();return void 0!==t.query.documents?(m(1===(n=t.query).documents.length),e=Qt(Ht(An(n.documents[0])))):e=function(t){return Qt(Un(t))}(t.query),new ie(e,t.targetId,0,t.lastListenSequenceNumber,r,i,T.fromBase64String(t.resumeToken))}function Gr(t,e){var n,r=zr(e.Ot),i=zr(e.lastLimboFreeSnapshotVersion);n=St(e.target)?Dn(t.Fs,e.target):Fn(t.Fs,e.target);var o=e.resumeToken.toBase64();return new Sr(e.targetId,Tt(e.target),r,o,e.sequenceNumber,i,n)}function Yr(t){var e=Un({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Jt(e,e.limit,"L"):e}var Xr=function(){function t(){}return t.prototype.Os=function(t,e){return Kr(t).get(e).next((function(t){if(t)return{id:(e=t).bundleId,createTime:Hr(e.createTime),version:e.version};var e}))},t.prototype.ks=function(t,e){return Kr(t).put({bundleId:(n=e).id,createTime:zr(En(n.createTime)),version:n.version});var n},t.prototype.Ms=function(t,e){return Qr(t).get(e).next((function(t){if(t)return{name:(e=t).name,query:Yr(e.bundledQuery),readTime:Hr(e.readTime)};var e}))},t.prototype.Ls=function(t,e){return Qr(t).put(function(t){return{name:t.name,readTime:zr(En(t.readTime)),bundledQuery:t.bundledQuery}}(e))},t}();function Kr(t){return Rr(t,Ar.store)}function Qr(t){return Rr(t,Ir.store)}var Jr=function(){function t(){this.Bs=new Zr}return t.prototype.qs=function(t,e){return this.Bs.add(e),Zn.resolve()},t.prototype.Us=function(t,e){return Zn.resolve(this.Bs.getEntries(e))},t}(),Zr=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t.tt(),n=t.X(),r=this.index[e]||new Ge(D.H),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t.tt(),n=t.X(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new Ge(D.H)).it()},t}(),$r=function(){function t(){this.Qs=new Zr}return t.prototype.qs=function(t,e){var n=this;if(!this.Qs.has(e)){var r=e.tt(),i=e.X();t.gs((function(){n.Qs.add(e)}));var o={collectionId:r,parent:fr(i)};return ti(t).put(o)}return Zn.resolve()},t.prototype.Us=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[x(e),""],!1,!0);return ti(t).rs(r).next((function(t){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.collectionId!==e)break;n.push(vr(o.parent))}return n}))},t}();function ti(t){return Rr(t,Cr.store)}var ei={Ks:!1,Ws:0,js:0,Gs:0},ni=function(){function t(t,e,n){this.zs=t,this.Hs=e,this.Js=n}return t.Ys=function(e){return new t(e,t.Xs,t.Zs)},t}();function ri(t){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(e){if(t.code!==E.FAILED_PRECONDITION||t.message!==lr)throw t;return h("LocalStore","Unexpectedly lost primary lease"),[2]}))}
2))}ni.Xs=10,ni.Zs=1e3,ni.ti=new ni(41943040,ni.Xs,ni.Zs),ni.ei=new ni(-1,0,0);var ii=function(){function t(t,e){this.ni=t,this.si=e,this.ii={}}return t.prototype.get=function(t){var e=this.ni(t),n=this.ii[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];if(this.si(a,t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.ni(t),r=this.ii[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.si(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.ii[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.ni(t),n=this.ii[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.si(n[r][0],t))return 1===n.length?delete this.ii[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){z(this.ii,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r],a=o[0],s=o[1];t(a,s)}}))},t.prototype.et=function(){return H(this.ii)},t}(),oi=function(){function t(){this.ri=new ii((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),this.oi=!1}return t.prototype.ci=function(t){var e=this.ri.get(t);return e?e.readTime:N.min()},t.prototype.ai=function(t,e){this.ui(),this.ri.set(t.key,{hi:t,readTime:e})},t.prototype.li=function(t,e){void 0===e&&(e=null),this.ui(),this.ri.set(t,{hi:null,readTime:e})},t.prototype._i=function(t,e){this.ui();var n=this.ri.get(e);return void 0!==n?Zn.resolve(n.hi):this.fi(t,e)},t.prototype.getEntries=function(t,e){return this.di(t,e)},t.prototype.apply=function(t){return this.ui(),this.oi=!0,this.wi(t)},t.prototype.ui=function(){},t}();function ai(t,e,n){var r=t.store(br.store),i=t.store(_r.store),o=[],a=IDBKeyRange.only(n.batchId),s=0,u=r.hs({range:a},(function(t,e,n){return s++,n.delete()}));o.push(u.next((function(){m(1===s)})));for(var c=[],l=0,h=n.mutations;l<h.length;l++){var f=h[l],d=_r.key(e,f.key.path,n.batchId);o.push(i.delete(d)),c.push(f.key)}return Zn.Mn(o).next((function(){return c}))}function si(t){var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw v();e=t.noDocument}return JSON.stringify(e).length}var ui=function(){function t(t,e,n,r){this.userId=t,this.Qt=e,this.Ei=n,this.Ti=r,this.Ii={}}return t.mi=function(e,n,r,i){return m(""!==e.uid),new t(e.m()?e.uid:"",n,r,i)},t.prototype.Ai=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return li(t).hs({index:br.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.Ri=function(t,e,n,r){var i=this,o=hi(t),a=li(t);return a.add({}).next((function(s){m("number"==typeof s);for(var u=new Nr(s,e,n,r),c=function(t,e,n){var r=n.baseMutations.map((function(e){return Nn(t.Fs,e)})),i=n.mutations.map((function(e){return Nn(t.Fs,e)}));return new br(e,n.batchId,n.vs.toMillis(),r,i)}(i.Qt,i.userId,u),l=[],h=new Ge((function(t,e){return _(t.rt(),e.rt())})),f=0,d=r;f<d.length;f++){var p=d[f],v=_r.key(i.userId,p.key.path,s);h=h.add(p.key.path.X()),l.push(a.put(c)),l.push(o.put(v,_r.PLACEHOLDER))}return h.forEach((function(e){l.push(i.Ei.qs(t,e))})),t.gs((function(){i.Ii[s]=u.keys()})),Zn.Mn(l).next((function(){return u}))}))},t.prototype.Pi=function(t,e){var n=this;return li(t).get(e).next((function(t){return t?(m(t.userId===n.userId),qr(n.Qt,t)):null}))},t.prototype.yi=function(t,e){var n=this;return this.Ii[e]?Zn.resolve(this.Ii[e]):this.Pi(t,e).next((function(t){if(t){var r=t.keys();return n.Ii[e]=r,r}return null}))},t.prototype.gi=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return li(t).hs({index:br.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(m(e.batchId>=r),o=qr(n.Qt,e)),i.done()})).next((function(){return o}))},t.prototype.Vi=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return li(t).hs({index:br.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.pi=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return li(t).rs(br.userMutationsIndex,n).next((function(t){return t.map((function(t){return qr(e.Qt,t)}))}))},t.prototype.bi=function(t,e){var n=this,r=_r.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return hi(t).hs({range:i},(function(r,i,a){var s=r[0],u=r[1],c=r[2],l=vr(u);if(s===n.userId&&e.path.isEqual(l))return li(t).get(c).next((function(t){if(!t)throw v();m(t.userId===n.userId),o.push(qr(n.Qt,t))}));a.done()})).next((function(){return o}
2))},t.prototype.vi=function(t,e){var n=this,r=new Ge(_),i=[];return e.forEach((function(e){var o=_r.prefixForPath(n.userId,e.path),a=IDBKeyRange.lowerBound(o),s=hi(t).hs({range:a},(function(t,i,o){var a=t[0],s=t[1],u=t[2],c=vr(s);a===n.userId&&e.path.isEqual(c)?r=r.add(u):o.done()}));i.push(s)})),Zn.Mn(i).next((function(){return n.Si(t,r)}))},t.prototype.Di=function(t,e){var n=this,r=e.path,i=r.length+1,o=_r.prefixForPath(this.userId,r),a=IDBKeyRange.lowerBound(o),s=new Ge(_);return hi(t).hs({range:a},(function(t,e,o){var a=t[0],u=t[1],c=t[2],l=vr(u);a===n.userId&&r.nt(l)?l.length===i&&(s=s.add(c)):o.done()})).next((function(){return n.Si(t,s)}))},t.prototype.Si=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(li(t).get(e).next((function(t){if(null===t)throw v();m(t.userId===n.userId),r.push(qr(n.Qt,t))})))})),Zn.Mn(i).next((function(){return r}))},t.prototype.Ci=function(t,e){var n=this;return ai(t.ps,this.userId,e).next((function(r){return t.gs((function(){n.xi(e.batchId)})),Zn.forEach(r,(function(e){return n.Ti.Ni(t,e)}))}))},t.prototype.xi=function(t){delete this.Ii[t]},t.prototype.$i=function(t){var e=this;return this.Ai(t).next((function(n){if(!n)return Zn.resolve();var r=IDBKeyRange.lowerBound(_r.prefixForUser(e.userId)),i=[];return hi(t).hs({range:r},(function(t,n,r){if(t[0]===e.userId){var o=vr(t[1]);i.push(o)}else r.done()})).next((function(){m(0===i.length)}))}))},t.prototype.Fi=function(t,e){return ci(t,this.userId,e)},t.prototype.Oi=function(t){var e=this;return fi(t).get(this.userId).next((function(t){return t||new yr(e.userId,-1,"")}))},t}();function ci(t,e,n){var r=_r.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),a=!1;return hi(t).hs({range:o,us:!0},(function(t,n,r){var o=t[0],s=t[1];t[2],o===e&&s===i&&(a=!0),r.done()})).next((function(){return a}))}function li(t){return Rr(t,br.store)}function hi(t){return Rr(t,_r.store)}function fi(t){return Rr(t,yr.store)}var di=function(){function t(t){this.ki=t}return t.prototype.next=function(){return this.ki+=2,this.ki},t.Mi=function(){return new t(0)},t.Li=function(){return new t(-1)},t}(),pi=function(){function t(t,e){this.Ti=t,this.Qt=e}return t.prototype.Bi=function(t){var e=this;return this.qi(t).next((function(n){var r=new di(n.highestTargetId);return n.highestTargetId=r.next(),e.Ui(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.Qi=function(t){return this.qi(t).next((function(t){return N.K(new R(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.Ki=function(t){return this.qi(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.Wi=function(t,e,n){var r=this;return this.qi(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.j()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.Ui(t,i)}))},t.prototype.ji=function(t,e){var n=this;return this.Gi(t,e).next((function(){return n.qi(t).next((function(r){return r.targetCount+=1,n.zi(e,r),n.Ui(t,r)}))}))},t.prototype.Hi=function(t,e){return this.Gi(t,e)},t.prototype.Ji=function(t,e){var n=this;return this.Yi(t,e.targetId).next((function(){return vi(t).delete(e.targetId)})).next((function(){return n.qi(t)})).next((function(e){return m(e.targetCount>0),e.targetCount-=1,n.Ui(t,e)}))},t.prototype.Xi=function(t,e,n){var r=this,i=0,o=[];return vi(t).hs((function(a,s){var u=Wr(s);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.Ji(t,u)))})).next((function(){return Zn.Mn(o)})).next((function(){return i}))},t.prototype.In=function(t,e){return vi(t).hs((function(t,n){var r=Wr(n);e(r)}))},t.prototype.qi=function(t){return mi(t).get(kr.key).next((function(t){return m(null!==t),t}))},t.prototype.Ui=function(t,e){return mi(t).put(kr.key,e)},t.prototype.Gi=function(t,e){return vi(t).put(Gr(this.Qt,e))},t.prototype.zi=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.Zi=function(t){return this.qi(t).next((function(t){return t.targetCount}))},t.prototype.tr=function(t,e){var n=Tt(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return vi(t).hs({range:r,index:Sr.queryTargetsIndexName},(function(t,n,r){var o=Wr(n);Et(e,o.target)&&(i=o,r.done())})).next((function(){return i}))},t.prototype.er=function(t,e,n){var r=this,i=[],o=gi(t);return e.forEach((function(e){var a=fr(e.path);i.push(o.put(new Or(n,a))),i.push(r.Ti.nr(t,n,e))})),Zn.Mn(i)},t.prototype.sr=function(t,e,n){var r=this,i=gi(t);return Zn.forEach(e,(function(e){var o=fr(e.path);return Zn.Mn([i.delete([n,o]),r.Ti.ir(t,n,e)])}))},t.prototype.Yi=function(t,e){var n=gi(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.rr=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=gi(t),i=nn();return r.hs({range:n,us:!0},(function(t,e,n){var r=vr(t[1]),o=new B(r);i=i.add(o)})).next((function(){return i}))},t.prototype.Fi=function(t,e){var n=fr(e.path),r=IDBKeyRange.bound([n],[x(n)],!1,!0),i=0;return gi(t).hs({index:Or.documentTargetsIndex,us:!0,range:r},(function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},t.prototype.Sn=function(t,e){return vi(t).get(e).next((function(t){return t?Wr(t):null}))},t}();function vi(t){return Rr(t,Sr.store)}function mi(t){return Rr(t,kr.store)}function gi(t){return Rr(t,Or.store)}function yi(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=_(n,i);return 0===a?_(r,o):a}var bi=function(){function t(t){this.cr=t,this.buffer=new Ge(yi),this.ar=0}return t.prototype.ur=function(){return++this.ar},t.prototype.hr=function(t){var e=[t,this.ur()];if(this.buffer.size<this.cr)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();yi(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]}
2,enumerable:!1,configurable:!0}),t}(),_i=function(){function t(t,e){this.lr=t,this._s=e,this._r=!1,this.dr=null}return t.prototype.start=function(t){-1!==this.lr.params.zs&&this.wr(t)},t.prototype.stop=function(){this.dr&&(this.dr.cancel(),this.dr=null)},Object.defineProperty(t.prototype,"Er",{get:function(){return null!==this.dr},enumerable:!1,configurable:!0}),t.prototype.wr=function(t){var e=this,n=this._r?3e5:6e4;h("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.dr=this._s.Tr("lru_garbage_collection",n,(function(){return Object(a.b)(e,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:this.dr=null,this._r=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t.Ir(this.lr)];case 2:return n.sent(),[3,7];case 3:return rr(e=n.sent())?(h("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,ri(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.wr(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),wi=function(){function t(t,e){this.mr=t,this.params=e}return t.prototype.Ar=function(t,e){return this.mr.Rr(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.Pr=function(t,e){var n=this;if(0===e)return Zn.resolve(P.q);var r=new bi(e);return this.mr.In(t,(function(t){return r.hr(t.sequenceNumber)})).next((function(){return n.mr.yr(t,(function(t){return r.hr(t)}))})).next((function(){return r.maxValue}))},t.prototype.Xi=function(t,e,n){return this.mr.Xi(t,e,n)},t.prototype.gr=function(t,e){return this.mr.gr(t,e)},t.prototype.Vr=function(t,e){var n=this;return-1===this.params.zs?(h("LruGarbageCollector","Garbage collection skipped; disabled"),Zn.resolve(ei)):this.pr(t).next((function(r){return r<n.params.zs?(h("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.zs),ei):n.br(t,e)}))},t.prototype.pr=function(t){return this.mr.pr(t)},t.prototype.br=function(t,e){var n,i,o,a,s,u,c,f=this,d=Date.now();return this.Ar(t,this.params.Hs).next((function(e){return e>f.params.Js?(h("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+f.params.Js+" from "+e),i=f.params.Js):i=e,a=Date.now(),f.Pr(t,i)})).next((function(r){return n=r,s=Date.now(),f.Xi(t,n,e)})).next((function(e){return o=e,u=Date.now(),f.gr(t,n)})).next((function(t){return c=Date.now(),l()<=r.a.DEBUG&&h("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(a-d)+"ms\n\tDetermined least recently used "+i+" in "+(s-a)+"ms\n\tRemoved "+o+" targets in "+(u-s)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-d)+"ms"),Zn.resolve({Ks:!0,Ws:i,js:o,Gs:t})}))},t}(),xi=function(){function t(t,e){this.db=t,this.lr=function(t,e){return new wi(t,e)}(this,e)}return t.prototype.Rr=function(t){var e=this.vr(t);return this.db.Sr().Zi(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.vr=function(t){var e=0;return this.yr(t,(function(t){e++})).next((function(){return e}))},t.prototype.In=function(t,e){return this.db.Sr().In(t,e)},t.prototype.yr=function(t,e){return this.Dr(t,(function(t,n){return e(n)}))},t.prototype.nr=function(t,e,n){return Ti(t,n)},t.prototype.ir=function(t,e,n){return Ti(t,n)},t.prototype.Xi=function(t,e,n){return this.db.Sr().Xi(t,e,n)},t.prototype.Ni=function(t,e){return Ti(t,e)},t.prototype.Cr=function(t,e){return function(t,e){var n=!1;return fi(t).ls((function(r){return ci(t,r,e).next((function(t){return t&&(n=!0),Zn.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.gr=function(t,e){var n=this,r=this.db.$r().Nr(),i=[],o=0;return this.Dr(t,(function(a,s){if(s<=e){var u=n.Cr(t,a).next((function(e){if(!e)return o++,r._i(t,a).next((function(){return r.li(a),gi(t).delete([0,fr(a.path)])}))}));i.push(u)}})).next((function(){return Zn.Mn(i)})).next((function(){return r.apply(t)})).next((function(){return o}))},t.prototype.removeTarget=function(t,e){var n=e.kt(t.bs);return this.db.Sr().Hi(t,n)},t.prototype.Fr=function(t,e){return Ti(t,e)},t.prototype.Dr=function(t,e){var n,r=gi(t),i=P.q;return r.hs({index:Or.documentTargetsIndex},(function(t,r){var o=t[0],a=(t[1],r.path),s=r.sequenceNumber;0===o?(i!==P.q&&e(new B(vr(n)),i),i=s,n=a):i=P.q})).next((function(){i!==P.q&&e(new B(vr(n)),i)}))},t.prototype.pr=function(t){return this.db.$r().Or(t)},t}();function Ti(t,e){return gi(t).put(function(t,e){return new Or(0,fr(t.path),e)}(e,t.bs))}var Ei=function(){function t(t,e){this.Qt=t,this.Ei=e}return t.prototype.ai=function(t,e,n){return ki(t).put(Ci(e),n)},t.prototype.li=function(t,e){var n=ki(t),r=Ci(e);return n.delete(r)},t.prototype.updateMetadata=function(t,e){var n=this;return this.getMetadata(t).next((function(r){return r.byteSize+=e,n.kr(t,r)}))},t.prototype._i=function(t,e){var n=this;return ki(t).get(Ci(e)).next((function(t){return n.Mr(t)}))},t.prototype.Lr=function(t,e){var n=this;return ki(t).get(Ci(e)).next((function(t){var e=n.Mr(t);return e?{hi:e,size:si(t)}:null}))},t.prototype.getEntries=function(t,e){var n=this,r=Qe();return this.Br(t,e,(function(t,e){var i=n.Mr(e);r=r.zt(t,i)})).next((function(){return r}))}
2,t.prototype.qr=function(t,e){var n=this,r=Qe(),i=new He(B.H);return this.Br(t,e,(function(t,e){var o=n.Mr(e);o?(r=r.zt(t,o),i=i.zt(t,si(e))):(r=r.zt(t,null),i=i.zt(t,0))})).next((function(){return{Ur:r,Qr:i}}))},t.prototype.Br=function(t,e,n){if(e.et())return Zn.resolve();var r=IDBKeyRange.bound(e.first().path.it(),e.last().path.it()),i=e.te(),o=i.oe();return ki(t).hs({range:r},(function(t,e,r){for(var a=B.Et(t);o&&B.H(o,a)<0;)n(o,null),o=i.oe();o&&o.isEqual(a)&&(n(o,e),o=i.ce()?i.oe():null),o?r.ss(o.path.it()):r.done()})).next((function(){for(;o;)n(o,null),o=i.ce()?i.oe():null}))},t.prototype.Kr=function(t,e,n){var r=this,i=Ze(),o=e.path.length+1,a={};if(n.isEqual(N.min())){var s=e.path.it();a.range=IDBKeyRange.lowerBound(s)}else{var u=e.path.it(),c=Br(n);a.range=IDBKeyRange.lowerBound([u,c],!0),a.index=Tr.collectionReadTimeIndex}return ki(t).hs(a,(function(t,n,a){if(t.length===o){var s=Fr(r.Qt,n);e.path.nt(s.key.path)?s instanceof yt&&ee(e,s)&&(i=i.zt(s.key,s)):a.done()}})).next((function(){return i}))},t.prototype.Nr=function(t){return new Si(this,!!t&&t.Wr)},t.prototype.Or=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return Oi(t).get(Er.key).next((function(t){return m(!!t),t}))},t.prototype.kr=function(t,e){return Oi(t).put(Er.key,e)},t.prototype.Mr=function(t){if(t){var e=Fr(this.Qt,t);return e instanceof bt&&e.version.isEqual(N.min())?null:e}return null},t}(),Si=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).jr=e,r.Wr=n,r.Gr=new ii((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),r}return Object(a.c)(e,t),e.prototype.wi=function(t){var e=this,n=[],r=0,i=new Ge((function(t,e){return _(t.rt(),e.rt())}));return this.ri.forEach((function(o,a){var s=e.Gr.get(o);if(a.hi){var u=Ur(e.jr.Qt,a.hi,e.ci(o));i=i.add(o.path.X());var c=si(u);r+=c-s,n.push(e.jr.ai(t,o,u))}else if(r-=s,e.Wr){var l=Ur(e.jr.Qt,new bt(o,N.min()),e.ci(o));n.push(e.jr.ai(t,o,l))}else n.push(e.jr.li(t,o))})),i.forEach((function(r){n.push(e.jr.Ei.qs(t,r))})),n.push(this.jr.updateMetadata(t,r)),Zn.Mn(n)},e.prototype.fi=function(t,e){var n=this;return this.jr.Lr(t,e).next((function(t){return null===t?(n.Gr.set(e,0),null):(n.Gr.set(e,t.size),t.hi)}))},e.prototype.di=function(t,e){var n=this;return this.jr.qr(t,e).next((function(t){var e=t.Ur;return t.Qr.forEach((function(t,e){n.Gr.set(t,e)})),e}))},e}(oi);function Oi(t){return Rr(t,Er.store)}function ki(t){return Rr(t,Tr.store)}function Ci(t){return t.path.it()}var Mi=function(){function t(t){this.Qt=t}return t.prototype.Jn=function(t,e,n,r){var i=this;m(n<r&&n>=0&&r<=11);var o=new $n("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(gr.store)}(t),function(t){t.createObjectStore(yr.store,{keyPath:yr.keyPath}),t.createObjectStore(br.store,{keyPath:br.keyPath,autoIncrement:!0}).createIndex(br.userMutationsIndex,br.userMutationsKeyPath,{unique:!0}),t.createObjectStore(_r.store)}(t),Ai(t),function(t){t.createObjectStore(Tr.store)}(t));var a=Zn.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(Or.store),t.deleteObjectStore(Sr.store),t.deleteObjectStore(kr.store)}(t),Ai(t)),a=a.next((function(){return function(t){var e=t.store(kr.store),n=new kr(0,0,N.min().j(),0);return e.put(kr.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(a=a.next((function(){return function(t,e){return e.store(br.store).rs().next((function(n){t.deleteObjectStore(br.store),t.createObjectStore(br.store,{keyPath:br.keyPath,autoIncrement:!0}).createIndex(br.userMutationsIndex,br.userMutationsKeyPath,{unique:!0});var r=e.store(br.store),i=n.map((function(t){return r.put(t)}));return Zn.Mn(i)}))}(t,o)}))),a=a.next((function(){!function(t){t.createObjectStore(Mr.store,{keyPath:Mr.keyPath})}(t)}))),n<5&&r>=5&&(a=a.next((function(){return i.zr(o)}))),n<6&&r>=6&&(a=a.next((function(){return function(t){t.createObjectStore(Er.store)}(t),i.Hr(o)}))),n<7&&r>=7&&(a=a.next((function(){return i.Jr(o)}))),n<8&&r>=8&&(a=a.next((function(){return i.Yr(t,o)}))),n<9&&r>=9&&(a=a.next((function(){!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}
2(t),function(t){var e=t.objectStore(Tr.store);e.createIndex(Tr.readTimeIndex,Tr.readTimeIndexPath,{unique:!1}),e.createIndex(Tr.collectionReadTimeIndex,Tr.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&r>=10&&(a=a.next((function(){return i.Xr(o)}))),n<11&&r>=11&&(a=a.next((function(){!function(t){t.createObjectStore(Ar.store,{keyPath:Ar.keyPath})}(t),function(t){t.createObjectStore(Ir.store,{keyPath:Ir.keyPath})}(t)}))),a},t.prototype.Hr=function(t){var e=0;return t.store(Tr.store).hs((function(t,n){e+=si(n)})).next((function(){var n=new Er(e);return t.store(Er.store).put(Er.key,n)}))},t.prototype.zr=function(t){var e=this,n=t.store(yr.store),r=t.store(br.store);return n.rs().next((function(n){return Zn.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.rs(br.userMutationsIndex,i).next((function(r){return Zn.forEach(r,(function(r){m(r.userId===n.userId);var i=qr(e.Qt,r);return ai(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.Jr=function(t){var e=t.store(Or.store),n=t.store(Tr.store);return t.store(kr.store).get(kr.key).next((function(t){var r=[];return n.hs((function(n,i){var o=new D(n),a=function(t){return[0,fr(t)]}(o);r.push(e.get(a).next((function(n){return n?Zn.resolve():function(n){return e.put(new Or(0,fr(n),t.highestListenSequenceNumber))}(o)})))})).next((function(){return Zn.Mn(r)}))}))},t.prototype.Yr=function(t,e){t.createObjectStore(Cr.store,{keyPath:Cr.keyPath});var n=e.store(Cr.store),r=new Zr,i=function(t){if(r.add(t)){var e=t.tt(),i=t.X();return n.put({collectionId:e,parent:fr(i)})}};return e.store(Tr.store).hs({us:!0},(function(t,e){var n=new D(t);return i(n.X())})).next((function(){return e.store(_r.store).hs({us:!0},(function(t,e){t[0];var n=t[1],r=(t[2],vr(n));return i(r.X())}))}))},t.prototype.Xr=function(t){var e=this,n=t.store(Sr.store);return n.hs((function(t,r){var i=Wr(r),o=Gr(e.Qt,i);return n.put(o)}))},t}();function Ai(t){t.createObjectStore(Or.store,{keyPath:Or.keyPath}).createIndex(Or.documentTargetsIndex,Or.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Sr.store,{keyPath:Sr.keyPath}).createIndex(Sr.queryTargetsIndexName,Sr.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(kr.store)}var Ii="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",ji=function(){function t(e,n,r,i,o,a,s,u,c,l){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Zr=o,this.window=a,this.document=s,this.eo=c,this.no=l,this.so=null,this.io=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ro=null,this.inForeground=!1,this.oo=null,this.co=null,this.ao=Number.NEGATIVE_INFINITY,this.uo=function(t){return Promise.resolve()},!t.Kn())throw new S(E.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.Ti=new xi(this,i),this.ho=n+"main",this.Qt=new Dr(u),this.lo=new tr(this.ho,11,new Mi(this.Qt)),this._o=new pi(this.Ti,this.Qt),this.Ei=new $r,this.fo=function(t,e){return new Ei(t,e)}(this.Qt,this.Ei),this.wo=new Xr,this.window&&this.window.localStorage?this.Eo=this.window.localStorage:(this.Eo=null,!1===l&&f("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.prototype.start=function(){var t=this;return this.To().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new S(E.FAILED_PRECONDITION,Ii);return t.Io(),t.mo(),t.Ao(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t._o.Ki(e)}))})).then((function(e){t.so=new P(e,t.eo)})).then((function(){t.io=!0})).catch((function(e){return t.lo&&t.lo.close(),Promise.reject(e)}))},t.prototype.Ro=function(t){var e=this;return this.uo=function(n){return Object(a.b)(e,void 0,void 0,(function(){return Object(a.d)(this,(function(e){return this.Er?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.Po=function(t){var e=this;this.lo.Xn((function(n){return Object(a.b)(e,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return null===n.newVersion?[4,t()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
2))}))}))},t.prototype.yo=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Zr.Ps((function(){return Object(a.b)(e,void 0,void 0,(function(){return Object(a.d)(this,(function(t){switch(t.label){case 0:return this.Er?[4,this.To()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.To=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return Ri(e).put(new Mr(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.Vo(e).next((function(e){e||(t.isPrimary=!1,t.Zr.po((function(){return t.uo(!1)})))}))})).next((function(){return t.bo(e)})).next((function(n){return t.isPrimary&&!n?t.vo(e).next((function(){return!1})):!!n&&t.So(e).next((function(){return!0}))}))})).catch((function(e){if(rr(e))return h("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return h("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t.Zr.po((function(){return t.uo(e)})),t.isPrimary=e}))},t.prototype.Vo=function(t){var e=this;return Pi(t).get(gr.key).next((function(t){return Zn.resolve(e.Do(t))}))},t.prototype.Co=function(t){return Ri(t).delete(this.clientId)},t.prototype.xo=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e,n,r,i=this;return Object(a.d)(this,(function(o){switch(o.label){case 0:return!this.isPrimary||this.No(this.ao,18e5)?[3,2]:(this.ao=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(t){var e=Rr(t,Mr.store);return e.rs().next((function(t){var n=i.$o(t,18e5),r=t.filter((function(t){return-1===n.indexOf(t)}));return Zn.forEach(r,(function(t){return e.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(t=o.sent(),this.Eo)for(e=0,n=t;e<n.length;e++)r=n[e],this.Eo.removeItem(this.Fo(r.clientId));o.label=2;case 2:return[2]}}
2))}))},t.prototype.Ao=function(){var t=this;this.co=this.Zr.Tr("client_metadata_refresh",4e3,(function(){return t.To().then((function(){return t.xo()})).then((function(){return t.Ao()}))}))},t.prototype.Do=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.bo=function(t){var e=this;return this.no?Zn.resolve(!0):Pi(t).get(gr.key).next((function(n){if(null!==n&&e.No(n.leaseTimestampMs,5e3)&&!e.Oo(n.ownerId)){if(e.Do(n)&&e.networkEnabled)return!0;if(!e.Do(n)){if(!n.allowTabSynchronization)throw new S(E.FAILED_PRECONDITION,Ii);return!1}}return!(!e.networkEnabled||!e.inForeground)||Ri(t).rs().next((function(t){return void 0===e.$o(t,5e3).find((function(t){if(e.clientId!==t.clientId){var n=!e.networkEnabled&&t.networkEnabled,r=!e.inForeground&&t.inForeground,i=e.networkEnabled===t.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(t){return e.isPrimary!==t&&h("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.ko=function(){return Object(a.b)(this,void 0,void 0,(function(){var t=this;return Object(a.d)(this,(function(e){switch(e.label){case 0:return this.io=!1,this.Mo(),this.co&&(this.co.cancel(),this.co=null),this.Lo(),this.Bo(),[4,this.lo.runTransaction("shutdown","readwrite",[gr.store,Mr.store],(function(e){var n=new Pr(e,P.q);return t.vo(n).next((function(){return t.Co(n)}))}))];case 1:return e.sent(),this.lo.close(),this.qo(),[2]}}))}))},t.prototype.$o=function(t,e){var n=this;return t.filter((function(t){return n.No(t.updateTimeMs,e)&&!n.Oo(t.clientId)}))},t.prototype.Uo=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return Ri(e).rs().next((function(e){return t.$o(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"Er",{get:function(){return this.io},enumerable:!1,configurable:!0}),t.prototype.Qo=function(t){return ui.mi(t,this.Qt,this.Ei,this.Ti)},t.prototype.Sr=function(){return this._o},t.prototype.$r=function(){return this.fo},t.prototype.Ko=function(){return this.Ei},t.prototype.Wo=function(){return this.wo},t.prototype.runTransaction=function(t,e,n){var r=this;h("IndexedDbPersistence","Starting transaction:",t);var i,o="readonly"===e?"readonly":"readwrite";return this.lo.runTransaction(t,o,jr,(function(o){return i=new Pr(o,r.s
2o?r.so.next():P.q),"readwrite-primary"===e?r.Vo(i).next((function(t){return!!t||r.bo(i)})).next((function(e){if(!e)throw f("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.Zr.po((function(){return r.uo(!1)})),new S(E.FAILED_PRECONDITION,lr);return n(i)})).next((function(t){return r.So(i).next((function(){return t}))})):r.jo(i).next((function(){return n(i)}))})).then((function(t){return i.Vs(),t}))},t.prototype.jo=function(t){var e=this;return Pi(t).get(gr.key).next((function(t){if(null!==t&&e.No(t.leaseTimestampMs,5e3)&&!e.Oo(t.ownerId)&&!e.Do(t)&&!(e.no||e.allowTabSynchronization&&t.allowTabSynchronization))throw new S(E.FAILED_PRECONDITION,Ii)}))},t.prototype.So=function(t){var e=new gr(this.clientId,this.allowTabSynchronization,Date.now());return Pi(t).put(gr.key,e)},t.Kn=function(){return tr.Kn()},t.prototype.vo=function(t){var e=this,n=Pi(t);return n.get(gr.key).next((function(t){return e.Do(t)?(h("IndexedDbPersistence","Releasing primary lease."),n.delete(gr.key)):Zn.resolve()}))},t.prototype.No=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(f("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.Io=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.oo=function(){t.Zr.Ps((function(){return t.inForeground="visible"===t.document.visibilityState,t.To()}))},this.document.addEventListener("visibilitychange",this.oo),this.inForeground="visible"===this.document.visibilityState)},t.prototype.Lo=function(){this.oo&&(this.document.removeEventListener("visibilitychange",this.oo),this.oo=null)},t.prototype.mo=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.ro=function(){e.Mo(),e.Zr.Ps((function(){return e.ko()}))},this.window.addEventListener("unload",this.ro))},t.prototype.Bo=function(){this.ro&&(this.window.removeEventListener("unload",this.ro),this.ro=null)},t.prototype.Oo=function(t){var e;try{var n=null!==(null===(e=this.Eo)||void 0===e?void 0:e.getItem(this.Fo(t)));return h("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return f("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.Mo=function(){if(this.Eo)try{this.Eo.setItem(this.Fo(this.clientId),String(Date.now()))}catch(t){f("Failed to set zombie client id.",t)}},t.prototype.qo=function(){if(this.Eo)try{this.Eo.removeItem(this.Fo(this.clientId))}catch(t){}},t.prototype.Fo=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function Pi(t){return Rr(t,gr.store)}function Ri(t){return Rr(t,Mr.store)}function Ni(t,e){var n=t.projectId;return t.o||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var Li=function(t,e){this.progress=t,this.Go=e},Di=function(){function t(t,e,n){this.fo=t,this.zo=e,this.Ei=n}return t.prototype.Ho=function(t,e){var n=this;return this.zo.bi(t,e).next((function(r){return n.Jo(t,e,r)}))},t.prototype.Jo=function(t,e,n){return this.fo._i(t,e).next((function(t){for(var r=0,i=n;r<i.length;r++)t=i[r].Cs(e,t);return t}))},t.prototype.Yo=function(t,e,n){var r=Qe();return e.forEach((function(t,e){for(var i=0,o=n;i<o.length;i++)e=o[i].Cs(t,e);r=r.zt(t,e)})),r},t.prototype.Xo=function(t,e){var n=this;return this.fo.getEntries(t,e).next((function(e){return n.Zo(t,e)}))},t.prototype.Zo=function(t,e){var n=this;return this.zo.vi(t,e).next((function(r){var i=n.Yo(t,e,r),o=Ke();return i.forEach((function(t,e){e||(e=new bt(t,N.min())),o=o.zt(t,e)})),o}))},t.prototype.Kr=function(t,e,n){return function(t){return B.wt(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.tc(t,e.path):Xt(e)?this.ec(t,e,n):this.nc(t,e,n)},t.prototype.tc=function(t,e){return this.Ho(t,new B(e)).next((function(t){var e=Ze();return t instanceof yt&&(e=e.zt(t.key,t)),e}))},t.prototype.ec=function(t,e,n){var r=this,i=e.collectionGroup,o=Ze();return this.Ei.Us(t,i).next((function(a){return Zn.forEach(a,(function(a){var s=function(t,e){return new Vt(e,null,t.xt.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,a.child(i));return r.nc(t,s,n).next((function(t){t.forEach((function(t,e){o=o.zt(t,e)}))}
2))})).next((function(){return o}))}))},t.prototype.nc=function(t,e,n){var r,i,o=this;return this.fo.Kr(t,e,n).next((function(n){return r=n,o.zo.Di(t,e)})).next((function(e){return i=e,o.sc(t,i,r).next((function(t){r=t;for(var e=0,n=i;e<n.length;e++)for(var o=n[e],a=0,s=o.mutations;a<s.length;a++){var u=s[a],c=u.key,l=Oe(u,r.get(c),o.vs);r=l instanceof yt?r.zt(c,l):r.remove(c)}}))})).next((function(){return r.forEach((function(t,n){ee(e,n)||(r=r.remove(t))})),r}))},t.prototype.sc=function(t,e,n){for(var r=nn(),i=0,o=e;i<o.length;i++)for(var a=0,s=o[i].mutations;a<s.length;a++){var u=s[a];u instanceof Ie&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.fo.getEntries(t,r).next((function(t){return t.forEach((function(t,e){null!==e&&e instanceof yt&&(c=c.zt(t,e))})),c}))},t}(),Fi=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.ic=n,this.rc=r}return t.oc=function(e,n){for(var r=nn(),i=nn(),o=0,a=n.docChanges;o<a.length;o++){var s=a[o];switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}}return new t(e,n.fromCache,r,i)},t}(),Ui=function(){function t(){}return t.prototype.cc=function(t){this.ac=t},t.prototype.Kr=function(t,e,n,i){var o=this;return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.xt.length||1===t.xt.length&&t.xt[0].field.ut())}(e)||n.isEqual(N.min())?this.uc(t,e):this.ac.Xo(t,i).next((function(a){var s=o.hc(e,a);return(qt(e)||Wt(e))&&o.lc(e.limitType,s,i,n)?o.uc(t,e):(l()<=r.a.DEBUG&&h("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),te(e)),o.ac.Kr(t,e,n).next((function(t){return s.forEach((function(e){t=t.zt(e.key,e)})),t})))}))},t.prototype.hc=function(t,e){var n=new Ge(ne(t));return e.forEach((function(e,r){r instanceof yt&&ee(t,r)&&(n=n.add(r))})),n},t.prototype.lc=function(t,e,n,r){if(n.size!==e.size)return!0;var i="F"===t?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version._(r)>0)},t.prototype.uc=function(t,e){return l()<=r.a.DEBUG&&h("QueryEngine","Using full collection scan to execute query:",te(e)),this.ac.Kr(t,e,N.min())},t}(),Bi=function(){function t(t,e,n,r){this.persistence=t,this._c=e,this.Qt=r,this.fc=new He(_),this.dc=new ii((function(t){return Tt(t)}),Et),this.wc=N.min(),this.zo=t.Qo(n),this.Ec=t.$r(),this._o=t.Sr(),this.Tc=new Di(this.Ec,this.zo,this.persistence.Ko()),this.wo=t.Wo(),this._c.cc(this.Tc)}return t.prototype.Ir=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.Vr(n,e.fc)}))},t}();function Vi(t,e,n,r){return new Bi(t,e,n,r)}function zi(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o;return Object(a.d)(this,(function(a){switch(a.label){case 0:return n=g(t),r=n.zo,i=n.Tc,[4,n.persistence.runTransaction("Handle user change","readonly",(function(t){var o;return n.zo.pi(t).next((function(a){return o=a,r=n.persistence.Qo(e),i=new Di(n.Ec,r,n.persistence.Ko()),r.pi(t)})).next((function(e){for(var n=[],r=[],a=nn(),s=0,u=o;s<u.length;s++){var c=u[s];n.push(c.batchId);for(var l=0,h=c.mutations;l<h.length;l++){var f=h[l];a=a.add(f.key)}}for(var d=0,p=e;d<p.length;d++){var v=p[d];r.push(v.batchId);for(var m=0,g=v.mutations;m<g.length;m++){var y=g[m];a=a.add(y.key)}}return i.Xo(t,a).next((function(t){return{Ic:t,mc:n,Ac:r}}))}))}))];case 1:return o=a.sent(),[2,(n.zo=r,n.Tc=i,n._c.cc(n.Tc),o)]}}))}))}function Hi(t,e){var n=g(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(t){var r=e.batch.keys(),i=n.Ec.Nr({Wr:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),a=Zn.resolve();return o.forEach((function(t){a=a.next((function(){return r._i(e,t)})).next((function(e){var o=e,a=n.$s.get(t);m(null!==a),(!o||o.version._(a)<0)&&(o=i.Ss(t,o,n))&&r.ai(o,n.Ns)}))})),a.next((function(){return t.zo.Ci(e,i)}))}(n,t,e,i).next((function(){return i.apply(t)})).next((function(){return n.zo.$i(t)})).next((function(){return n.Tc.Xo(t,r)}))}))}function qi(t){var e=g(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(function(t){return e._o.Qi(t)}))}function Wi(t,e){var n=g(t),r=e.Ot,i=n.fc;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(t){var o=n.Ec.Nr({Wr:!0});i=n.fc;var a=[];e.$e.forEach((function(e,o){var s=i.get(o);if(s){a.push(n._o.sr(t,e.Qe,o).next((function(){return n._o.er(t,e.qe,o)})));var u=e.resumeToken;if(u.l()>0){var c=s.Mt(u,r).kt(t.bs);i=i.zt(o,c),function(t,e,n){return m(e.resumeToken.l()>0),0===t.resumeToken.l()||e.Ot.W()-t.Ot.W()>=3e8||n.qe.size+n.Ue.size+n.Qe.size>0}(s,c,e)&&a.push(n._o.Hi(t,c))}}}));var s=Ke();if(e.Oe.forEach((function(r,i){e.ke.has(r)&&a.push(n.persistence.Ti.Fr
2(t,r))})),a.push(Gi(t,o,e.Oe,r,void 0).next((function(t){s=t}))),!r.isEqual(N.min())){var u=n._o.Qi(t).next((function(e){return n._o.Wi(t,t.bs,r)}));a.push(u)}return Zn.Mn(a).next((function(){return o.apply(t)})).next((function(){return n.Tc.Zo(t,s)}))})).then((function(t){return n.fc=i,t}))}function Gi(t,e,n,r,i){var o=nn();return n.forEach((function(t){return o=o.add(t)})),e.getEntries(t,o).next((function(t){var o=Ke();return n.forEach((function(n,a){var s=t.get(n),u=(null==i?void 0:i.get(n))||r;a instanceof bt&&a.version.isEqual(N.min())?(e.li(n,u),o=o.zt(n,a)):null==s||a.version._(s.version)>0||0===a.version._(s.version)&&s.hasPendingWrites?(e.ai(a,u),o=o.zt(n,a)):h("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",a.version)})),o}))}function Yi(t,e){var n=g(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(t){return void 0===e&&(e=-1),n.zo.gi(t,e)}))}function Xi(t,e){var n=g(t);return n.persistence.runTransaction("Allocate target","readwrite",(function(t){var r;return n._o.tr(t,e).next((function(i){return i?(r=i,Zn.resolve(r)):n._o.Bi(t).next((function(i){return r=new ie(e,i,0,t.bs),n._o.ji(t,r).next((function(){return r}))}))}))})).then((function(t){var r=n.fc.get(t.targetId);return(null===r||t.Ot._(r.Ot)>0)&&(n.fc=n.fc.zt(t.targetId,t),n.dc.set(e,t.targetId)),t}))}function Ki(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o,s;return Object(a.d)(this,(function(a){switch(a.label){case 0:r=g(t),i=r.fc.get(e),o=n?"readwrite":"readwrite-primary",a.label=1;case 1:return a.trys.push([1,4,,5]),n?[3,3]:[4,r.persistence.runTransaction("Release target",o,(function(t){return r.persistence.Ti.removeTarget(t,i)}))];case 2:a.sent(),a.label=3;case 3:return[3,5];case 4:if(!rr(s=a.sent()))throw s;return h("LocalStore","Failed to update sequence numbers for target "+e+": "+s),[3,5];case 5:return r.fc=r.fc.remove(e),r.dc.delete(i.target),[2]}}))}))}function Qi(t,e,n){var r=g(t),i=N.min(),o=nn();return r.persistence.runTransaction("Execute query","readonly",(function(t){return function(t,e,n){var r=g(t),i=r.dc.get(n);return void 0!==i?Zn.resolve(r.fc.get(i)):r._o.tr(e,n)}(r,t,Qt(e)).next((function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r._o.rr(t,e.targetId).next((function(t){o=t}))})).next((function(){return r._c.Kr(t,e,n?i:N.min(),n?o:nn())})).next((function(t){return{documents:t,Rc:o}}))}))}function Ji(t,e){var n=g(t),r=g(n._o),i=n.fc.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(t){return r.Sn(t,e).next((function(t){return t?t.target:null}))}))}function Zi(t){var e=g(t);return e.persistence.runTransaction("Get new document changes","readonly",(function(t){return function(t,e,n){var r=g(t),i=Ke(),o=Br(n),a=ki(e),s=IDBKeyRange.lowerBound(o,!0);return a.hs({index:Tr.readTimeIndex,range:s},(function(t,e){var n=Fr(r.Qt,e);i=i.zt(n.key,n),o=e.readTime})).next((function(){return{Go:i,readTime:Vr(o)}}))}(e.Ec,t,e.wc)})).then((function(t){var n=t.Go,r=t.readTime;return e.wc=r,n}))}function $i(t){return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){return[2,(e=g(t)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return function(t){var e=ki(t),n=N.min();return e.hs({index:Tr.readTimeIndex,reverse:!0},(function(t,e,r){e.readTime&&(n=Vr(e.readTime)),r.done()})).next((function(){return n}))}(t)})).then((function(t){e.wc=t}))]}))}))}function to(t,e,n,r){return Object(a.b)(this,void 0,void 0,(function(){var i,o,s,u,c,l,h,f,d,p;return Object(a.d)(this,(function(a){switch(a.label){case 0:for(i=g(t),o=nn(),s=Ke(),u=tn(),c=0,l=n;c<l.length;c++)h=l[c],f=e.Pc(h.metadata.name),h.document&&(o=o.add(f)),s=s.zt(f,e.yc(h)),u=u.zt(f,e.gc(h.metadata.readTime));return d=i.Ec.Nr({Wr:!0}),[4,Xi(i,function(t){return Qt(Ht(D.ot("__bundle__/docs/"+t)))}(r))];case 1:return p=a.sent(),[2,i.persistence.runTransaction("Apply bundle documents","readwrite",(function(t){return Gi(t,d,s,N.min(),u).next((function(e){return d.apply(t),e})).next((function(e){return i._o.Yi(t,p.targetId).next((function(){return i._o.er(t,o,p.targetId)})).next((function(){return i.Tc.Zo(t,e)}))}
2))}))]}}))}))}function eo(t,e,n){return void 0===n&&(n=nn()),Object(a.b)(this,void 0,void 0,(function(){var r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:return[4,Xi(t,Qt(Yr(e.bundledQuery)))];case 1:return r=o.sent(),[2,(i=g(t)).persistence.runTransaction("Save named query","readwrite",(function(t){var o=En(e.readTime);if(r.Ot._(o)>=0)return i.wo.Ls(t,e);var a=r.Mt(T.T,o);return i.fc=i.fc.zt(a.targetId,a),i._o.Hi(t,a).next((function(){return i._o.Yi(t,r.targetId)})).next((function(){return i._o.er(t,n,r.targetId)})).next((function(){return i.wo.Ls(t,e)}))}))]}}))}))}var no=function(){function t(t){this.Qt=t,this.Vc=new Map,this.bc=new Map}return t.prototype.Os=function(t,e){return Zn.resolve(this.Vc.get(e))},t.prototype.ks=function(t,e){var n;return this.Vc.set(e.id,{id:(n=e).id,version:n.version,createTime:En(n.createTime)}),Zn.resolve()},t.prototype.Ms=function(t,e){return Zn.resolve(this.bc.get(e))},t.prototype.Ls=function(t,e){return this.bc.set(e.name,function(t){return{name:t.name,query:Yr(t.bundledQuery),readTime:En(t.readTime)}}(e)),Zn.resolve()},t}(),ro=function(){function t(){this.vc=new Ge(io.Sc),this.Dc=new Ge(io.Cc)}return t.prototype.et=function(){return this.vc.et()},t.prototype.nr=function(t,e){var n=new io(t,e);this.vc=this.vc.add(n),this.Dc=this.Dc.add(n)},t.prototype.xc=function(t,e){var n=this;t.forEach((function(t){return n.nr(t,e)}))},t.prototype.ir=function(t,e){this.Nc(new io(t,e))},t.prototype.$c=function(t,e){var n=this;t.forEach((function(t){return n.ir(t,e)}))},t.prototype.Fc=function(t){var e=this,n=new B(new D([])),r=new io(n,t),i=new io(n,t+1),o=[];return this.Dc.me([r,i],(function(t){e.Nc(t),o.push(t.key)})),o},t.prototype.Oc=function(){var t=this;this.vc.forEach((function(e){return t.Nc(e)}))},t.prototype.Nc=function(t){this.vc=this.vc.delete(t),this.Dc=this.Dc.delete(t)},t.prototype.kc=function(t){var e=new B(new D([])),n=new io(e,t),r=new io(e,t+1),i=nn();return this.Dc.me([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.Fi=function(t){var e=new io(t,0),n=this.vc.Re(e);return null!==n&&t.isEqual(n.key)},t}(),io=function(){function t(t,e){this.key=t,this.Mc=e}return t.Sc=function(t,e){return B.H(t.key,e.key)||_(t.Mc,e.Mc)},t.Cc=function(t,e){return _(t.Mc,e.Mc)||B.H(t.key,e.key)},t}(),oo=function(){function t(t,e){this.Ei=t,this.Ti=e,this.zo=[],this.Lc=1,this.Bc=new Ge(io.Sc)}return t.prototype.Ai=function(t){return Zn.resolve(0===this.zo.length)},t.prototype.Ri=function(t,e,n,r){var i=this.Lc;this.Lc++,this.zo.length>0&&this.zo[this.zo.length-1];var o=new Nr(i,e,n,r);this.zo.push(o);for(var a=0,s=r;a<s.length;a++){var u=s[a];this.Bc=this.Bc.add(new io(u.key,i)),this.Ei.qs(t,u.key.path.X())}return Zn.resolve(o)},t.prototype.Pi=function(t,e){return Zn.resolve(this.qc(e))},t.prototype.gi=function(t,e){var n=e+1,r=this.Uc(n),i=r<0?0:r;return Zn.resolve(this.zo.length>i?this.zo[i]:null)},t.prototype.Vi=function(){return Zn.resolve(0===this.zo.length?-1:this.Lc-1)},t.prototype.pi=function(t){return Zn.resolve(this.zo.slice())},t.prototype.bi=function(t,e){var n=this,r=new io(e,0),i=new io(e,Number.POSITIVE_INFINITY),o=[];return this.Bc.me([r,i],(function(t){var e=n.qc(t.Mc);o.push(e)})),Zn.resolve(o)},t.prototype.vi=function(t,e){var n=this,r=new Ge(_);return e.forEach((function(t){var e=new io(t,0),i=new io(t,Number.POSITIVE_INFINITY);n.Bc.me([e,i],(function(t){r=r.add(t.Mc)}))})),Zn.resolve(this.Qc(r))},t.prototype.Di=function(t,e){var n=e.path,r=n.length+1,i=n;B.wt(i)||(i=i.child(""));var o=new io(new B(i),0),a=new Ge(_);return this.Bc.Ae((function(t){var e=t.key.path;return!!n.nt(e)&&(e.length===r&&(a=a.add(t.Mc)),!0)}),o),Zn.resolve(this.Qc(a))},t.prototype.Qc=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.qc(t);null!==r&&n.push(r)})),n},t.prototype.Ci=function(t,e){var n=this;m(0===this.Kc(e.batchId,"removed")),this.zo.shift();var r=this.Bc;return Zn.forEach(e.mutations,(function(i){var o=new io(i.key,e.batchId);return r=r.delete(o),n.Ti.Ni(t,i.key)})).next((function(){n.Bc=r}))},t.prototype.xi=function(t){},t.prototype.Fi=function(t,e){var n=new io(e,0),r=this.Bc.Re(n);return Zn.resolve(e.isEqual(r&&r.key))},t.prototype.$i=function(t){return this.zo.length,Zn.resolve()},t.prototype.Kc=function(t,e){return this.Uc(t)},t.prototype.Uc=function(t){return 0===this.zo.length?0:t-this.zo[0].batchId},t.prototype.qc=function(t){var e=this.Uc(t);return e<0||e>=this.zo.length?null:this.zo[e]},t}(),ao=function(){function t(t,e){this.Ei=t,this.Wc=e,this.docs=new He(
2B.H),this.size=0}return t.prototype.ai=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,a=this.Wc(e);return this.docs=this.docs.zt(r,{hi:e,size:a,readTime:n}),this.size+=a-o,this.Ei.qs(t,r.path.X())},t.prototype.li=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype._i=function(t,e){var n=this.docs.get(e);return Zn.resolve(n?n.hi:null)},t.prototype.getEntries=function(t,e){var n=this,r=Qe();return e.forEach((function(t){var e=n.docs.get(t);r=r.zt(t,e?e.hi:null)})),Zn.resolve(r)},t.prototype.Kr=function(t,e,n){for(var r=Ze(),i=new B(e.path.child("")),o=this.docs.ee(i);o.ce();){var a=o.oe(),s=a.key,u=a.value,c=u.hi,l=u.readTime;if(!e.path.nt(s.path))break;l._(n)<=0||c instanceof yt&&ee(e,c)&&(r=r.zt(c.key,c))}return Zn.resolve(r)},t.prototype.jc=function(t,e){return Zn.forEach(this.docs,(function(t){return e(t)}))},t.prototype.Nr=function(t){return new so(this)},t.prototype.Or=function(t){return Zn.resolve(this.size)},t}(),so=function(t){function e(e){var n=this;return(n=t.call(this)||this).jr=e,n}return Object(a.c)(e,t),e.prototype.wi=function(t){var e=this,n=[];return this.ri.forEach((function(r,i){i&&i.hi?n.push(e.jr.ai(t,i.hi,e.ci(r))):e.jr.li(r)})),Zn.Mn(n)},e.prototype.fi=function(t,e){return this.jr._i(t,e)},e.prototype.di=function(t,e){return this.jr.getEntries(t,e)},e}(oi),uo=function(){function t(t){this.persistence=t,this.Gc=new ii((function(t){return Tt(t)}),Et),this.lastRemoteSnapshotVersion=N.min(),this.highestTargetId=0,this.zc=0,this.Hc=new ro,this.targetCount=0,this.Jc=di.Mi()}return t.prototype.In=function(t,e){return this.Gc.forEach((function(t,n){return e(n)})),Zn.resolve()},t.prototype.Qi=function(t){return Zn.resolve(this.lastRemoteSnapshotVersion)},t.prototype.Ki=function(t){return Zn.resolve(this.zc)},t.prototype.Bi=function(t){return this.highestTargetId=this.Jc.next(),Zn.resolve(this.highestTargetId)},t.prototype.Wi=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.zc&&(this.zc=e),Zn.resolve()},t.prototype.Gi=function(t){this.Gc.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.Jc=new di(e),this.highestTargetId=e),t.sequenceNumber>this.zc&&(this.zc=t.sequenceNumber)},t.prototype.ji=function(t,e){return this.Gi(e),this.targetCount+=1,Zn.resolve()},t.prototype.Hi=function(t,e){return this.Gi(e),Zn.resolve()},t.prototype.Ji=function(t,e){return this.Gc.delete(e.target),this.Hc.Fc(e.targetId),this.targetCount-=1,Zn.resolve()},t.prototype.Xi=function(t,e,n){var r=this,i=0,o=[];return this.Gc.forEach((function(a,s){s.sequenceNumber<=e&&null===n.get(s.targetId)&&(r.Gc.delete(a),o.push(r.Yi(t,s.targetId)),i++)})),Zn.Mn(o).next((function(){return i}))},t.prototype.Zi=function(t){return Zn.resolve(this.targetCount)},t.prototype.tr=function(t,e){var n=this.Gc.get(e)||null;return Zn.resolve(n)},t.prototype.er=function(t,e,n){return this.Hc.xc(e,n),Zn.resolve()},t.prototype.sr=function(t,e,n){this.Hc.$c(e,n);var r=this.persistence.Ti,i=[];return r&&e.forEach((function(e){i.push(r.Ni(t,e))})),Zn.Mn(i)},t.prototype.Yi=function(t,e){return this.Hc.Fc(e),Zn.resolve()},t.prototype.rr=function(t,e){var n=this.Hc.kc(e);return Zn.resolve(n)},t.prototype.Fi=function(t,e){return Zn.resolve(this.Hc.Fi(e))},t}(),co=function(){function t(t,e){var n=this;this.Yc={},this.so=new P(0),this.io=!1,this.io=!0,this.Ti=t(this),this._o=new uo(this),this.Ei=new Jr,this.fo=function(t,e){return new ao(t,(function(t){return n.Ti.Xc(t)}))}(this.Ei),this.Qt=new Dr(e),this.wo=new no(this.Qt)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.ko=function(){return this.io=!1,Promise.resolve()},Object.defineProperty(t.prototype,"Er",{get:function(){return this.io},enumerable:!1,configurable:!0}),t.prototype.Po=function(){},t.prototype.yo=function(){},t.prototype.Ko=function(){return this.Ei},t.prototype.Qo=function(t){var e=this.Yc[t.A()];return e||(e=new oo(this.Ei,this.Ti),this.Yc[t.A()]=e),e},t.prototype.Sr=function(){return this._o},t.prototype.$r=function(){return this.fo},t.prototype.Wo=function(){return this.wo},t.prototype.runTransaction=function(t,e,n){var r=this;h("MemoryPersistence","Starting transaction:",t);var i=new lo(this.so.next());return this.Ti.Zc(),n(i).next((function(t){return r.Ti.ta(i).next((function(){return t}))})).On().then((function(t){return i.Vs(),t}))},t.prototype.ea=function(t,e){return Zn.Ln(Object.values(this.Yc).map((function(n){return function(){return n.Fi(t,e)}})))},t}(),lo=function(t){function e(e){var n=this;return(n=t.call(this)||this).bs=e,n}return Object(a.c)(e,t),e}(hr),ho=function(){function t(t){this.persistence=t,this.na=new ro,this.sa=null}return t.ia=function(e){return new t(e)},Object.defineProperty(t.prototype,"ra",{get:function(){if(this.sa)return this.sa;
2throw v()},enumerable:!1,configurable:!0}),t.prototype.nr=function(t,e,n){return this.na.nr(n,e),this.ra.delete(n.toString()),Zn.resolve()},t.prototype.ir=function(t,e,n){return this.na.ir(n,e),this.ra.add(n.toString()),Zn.resolve()},t.prototype.Ni=function(t,e){return this.ra.add(e.toString()),Zn.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.na.Fc(e.targetId).forEach((function(t){return n.ra.add(t.toString())}));var r=this.persistence.Sr();return r.rr(t,e.targetId).next((function(t){t.forEach((function(t){return n.ra.add(t.toString())}))})).next((function(){return r.Ji(t,e)}))},t.prototype.Zc=function(){this.sa=new Set},t.prototype.ta=function(t){var e=this,n=this.persistence.$r().Nr();return Zn.forEach(this.ra,(function(r){var i=B._t(r);return e.oa(t,i).next((function(t){t||n.li(i)}))})).next((function(){return e.sa=null,n.apply(t)}))},t.prototype.Fr=function(t,e){var n=this;return this.oa(t,e).next((function(t){t?n.ra.delete(e.toString()):n.ra.add(e.toString())}))},t.prototype.Xc=function(t){return 0},t.prototype.oa=function(t,e){var n=this;return Zn.Ln([function(){return Zn.resolve(n.na.Fi(e))},function(){return n.persistence.Sr().Fi(t,e)},function(){return n.persistence.ea(t,e)}])},t}();function fo(t,e){return"firestore_clients_"+t+"_"+e}function po(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.m()&&(r+="_"+e.uid),r}function vo(t,e){return"firestore_targets_"+t+"_"+e}var mo=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.ca=function(e,n,r){var i,o=JSON.parse(r),a="object"==typeof o&&-1!==["pending","acknowledged","rejected"].indexOf(o.state)&&(void 0===o.error||"object"==typeof o.error);return a&&o.error&&(a="string"==typeof o.error.message&&"string"==typeof o.error.code)&&(i=new S(o.error.code,o.error.message)),a?new t(e,n,o.state,i):(f("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.aa=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),go=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.ca=function(e,n){var r,i=JSON.parse(n),o="object"==typeof i&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new S(i.error.code,i.error.message)),o?new t(e,i.state,r):(f("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.aa=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),yo=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.ca=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=on(),a=0;i&&a<r.activeTargetIds.length;++a)i=tt(r.activeTargetIds[a]),o=o.add(r.activeTargetIds[a]);return i?new t(e,o):(f("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),bo=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.ca=function(e){var n=JSON.parse(e);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new t(n.clientId,n.onlineState):(f("SharedClientState","Failed to parse online state: "+e),null)},t}(),_o=function(){function t(){this.activeTargetIds=on()}return t.prototype.ua=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.ha=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.aa=function(){var t={activeTargetIds:this.activeTargetIds.it(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),wo=function(){function t(t,e,n,r,i){this.window=t,this.Zr=e,this.persistenceKey=n,this.la=r,this._a=null,this.fa=null,this.k=null,this.da=this.wa.bind(this),this.Ea=new He(_),this.Er=!1,this.Ta=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Ia=fo(this.persistenceKey,this.la),this.ma=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.Ea=this.Ea.zt(this.la,new _o),this.Aa=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Ra=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.Pa=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.ya=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.ga=function(t){return"firestore_bundle_loaded_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.da)}return t.Kn=function(t){return!(!t||!t.localStorage)},t.prototype.start=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e,n,r,i,o,s,u,c,l,h,f=this;return Object(a.d)(this,(function(a){switch(a.label){case 0:return[4,this._a.Uo()];case 1:for(t=a.sent(),e=0,n=t;e<n.length;e++)(r=n[e])!==this.la&&(i=this.getItem(fo(this.persistenceKey,r)))&&(o=yo.ca(r,i))&&(this.Ea=this.Ea.zt(o.clientId,o));
2for(this.Va(),(s=this.storage.getItem(this.ya))&&(u=this.pa(s))&&this.ba(u),c=0,l=this.Ta;c<l.length;c++)h=l[c],this.wa(h);return this.Ta=[],this.window.addEventListener("unload",(function(){return f.ko()})),this.Er=!0,[2]}}))}))},t.prototype.B=function(t){this.setItem(this.ma,JSON.stringify(t))},t.prototype.va=function(){return this.Sa(this.Ea)},t.prototype.Da=function(t){var e=!1;return this.Ea.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.Ca=function(t){this.xa(t,"pending")},t.prototype.Na=function(t,e,n){this.xa(t,e,n),this.$a(t)},t.prototype.Fa=function(t){var e="not-current";if(this.Da(t)){var n=this.storage.getItem(vo(this.persistenceKey,t));if(n){var r=go.ca(t,n);r&&(e=r.state)}}return this.Oa.ua(t),this.Va(),e},t.prototype.ka=function(t){this.Oa.ha(t),this.Va()},t.prototype.Ma=function(t){return this.Oa.activeTargetIds.has(t)},t.prototype.La=function(t){this.removeItem(vo(this.persistenceKey,t))},t.prototype.Ba=function(t,e,n){this.qa(t,e,n)},t.prototype.Ua=function(t,e,n){var r=this;e.forEach((function(t){r.$a(t)})),this.currentUser=t,n.forEach((function(t){r.Ca(t)}))},t.prototype.Qa=function(t){this.Ka(t)},t.prototype.Wa=function(){this.ja()},t.prototype.ko=function(){this.Er&&(this.window.removeEventListener("storage",this.da),this.removeItem(this.Ia),this.Er=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return h("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){h("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){h("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.wa=function(t){var e=this,n=t;if(n.storageArea===this.storage){if(h("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Ia)return void f("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Zr.po((function(){return Object(a.b)(e,void 0,void 0,(function(){var t,e,r,i,o,s;return Object(a.d)(this,(function(a){if(this.Er){if(null!==n.key)if(this.Aa.test(n.key)){if(null==n.newValue)return t=this.Ga(n.key),[2,this.za(t,null)];if(e=this.Ha(n.key,n.newValue))return[2,this.za(e.clientId,e)]}else if(this.Ra.test(n.key)){if(null!==n.newValue&&(r=this.Ja(n.key,n.newValue)))return[2,this.Ya(r)]}else if(this.Pa.test(n.key)){if(null!==n.newValue&&(i=this.Xa(n.key,n.newValue)))return[2,this.Za(i)]}else if(n.key===this.ya){if(null!==n.newValue&&(o=this.pa(n.newValue)))return[2,this.ba(o)]}else if(n.key===this.ma)(s=function(t){var e=P.q;if(null!=t)try{var n=JSON.parse(t);m("number"==typeof n),e=n}catch(t){f("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(n.newValue))!==P.q&&this.k(s);else if(n.key===this.ga)return[2,this._a.tu()]}else this.Ta.push(n);return[2]}))}))}))}},Object.defineProperty(t.prototype,"Oa",{get:function(){return this.Ea.get(this.la)},enumerable:!1,configurable:!0}),t.prototype.Va=function(){this.setItem(this.Ia,this.Oa.aa())},t.prototype.xa=function(t,e,n){var r=new mo(this.currentUser,t,e,n),i=po(this.persistenceKey,this.currentUser,t);this.setItem(i,r.aa())},t.prototype.$a=function(t){var e=po(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.Ka=function(t){var e={clientId:this.la,onlineState:t};this.storage.setItem(this.ya,JSON.stringify(e))},t.prototype.qa=function(t,e,n){var r=vo(this.persistenceKey,t),i=new go(t,e,n);this.setItem(r,i.aa())},t.prototype.ja=function(){this.setItem(this.ga,"value-not-used")},t.prototype.Ga=function(t){var e=this.Aa.exec(t);return e?e[1]:null},t.prototype.Ha=function(t,e){var n=this.Ga(t);return yo.ca(n,e)},t.prototype.Ja=function(t,e){var n=this.Ra.exec(t),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return mo.ca(new k(i),r,e)},t.prototype.Xa=function(t,e){var n=this.Pa.exec(t),r=Number(n[1]);return go.ca(r,e)},t.prototype.pa=function(t){return bo.ca(t)},t.prototype.Ya=function(t){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(e){return t.user.uid===this.currentUser.uid?[2,this._a.eu(t.batchId,t.state,t.error)]:(h("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.Za=function(t){return this._a.nu(t.targetId,t.state,t.error)},t.prototype.za=function(t,e){var n=this,r=e?this.Ea.zt(t,e):this.Ea.remove(t),i=this.Sa(this.Ea),o=this.Sa(r),a=[],s=[];return o.forEach((function(t){i.has(t)||a.push(t)}
2)),i.forEach((function(t){o.has(t)||s.push(t)})),this._a.su(a,s).then((function(){n.Ea=r}))},t.prototype.ba=function(t){this.Ea.get(t.clientId)&&this.fa(t.onlineState)},t.prototype.Sa=function(t){var e=on();return t.forEach((function(t,n){e=e.Pe(n.activeTargetIds)})),e},t}(),xo=function(){function t(){this.iu=new _o,this.ru={},this.fa=null,this.k=null}return t.prototype.Ca=function(t){},t.prototype.Na=function(t,e,n){},t.prototype.Fa=function(t){return this.iu.ua(t),this.ru[t]||"not-current"},t.prototype.Ba=function(t,e,n){this.ru[t]=e},t.prototype.ka=function(t){this.iu.ha(t)},t.prototype.Ma=function(t){return this.iu.activeTargetIds.has(t)},t.prototype.La=function(t){delete this.ru[t]},t.prototype.va=function(){return this.iu.activeTargetIds},t.prototype.Da=function(t){return this.iu.activeTargetIds.has(t)},t.prototype.start=function(){return this.iu=new _o,Promise.resolve()},t.prototype.Ua=function(t,e,n){},t.prototype.Qa=function(t){},t.prototype.ko=function(){},t.prototype.B=function(t){},t.prototype.Wa=function(){},t}(),To=function(){function t(){}return t.prototype.ou=function(t){},t.prototype.ko=function(){},t}(),Eo=function(){function t(){var t=this;this.cu=function(){return t.au()},this.uu=function(){return t.hu()},this.lu=[],this._u()}return t.prototype.ou=function(t){this.lu.push(t)},t.prototype.ko=function(){window.removeEventListener("online",this.cu),window.removeEventListener("offline",this.uu)},t.prototype._u=function(){window.addEventListener("online",this.cu),window.addEventListener("offline",this.uu)},t.prototype.au=function(){h("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.lu;t<e.length;t++)(0,e[t])(0)},t.prototype.hu=function(){h("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.lu;t<e.length;t++)(0,e[t])(1)},t.Kn=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),So={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},Oo=function(){function t(t){this.fu=t.fu,this.du=t.du}return t.prototype.wu=function(t){this.Eu=t},t.prototype.Tu=function(t){this.Iu=t},t.prototype.onMessage=function(t){this.mu=t},t.prototype.close=function(){this.du()},t.prototype.send=function(t){this.fu(t)},t.prototype.Au=function(){this.Eu()},t.prototype.Ru=function(t){this.Iu(t)},t.prototype.Pu=function(t){this.mu(t)},t}(),ko=function(t){function e(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n.i=e.i,n}return Object(a.c)(e,t),e.prototype.Su=function(t,e,n,r){return new Promise((function(i,a){var s=new o.f;s.listenOnce(o.c.COMPLETE,(function(){try{switch(s.getLastErrorCode()){case o.a.NO_ERROR:var e=s.getResponseJson();h("Connection","XHR received:",JSON.stringify(e)),i(e);break;case o.a.TIMEOUT:h("Connection",'RPC "'+t+'" timed out'),a(new S(E.DEADLINE_EXCEEDED,"Request time out"));break;case o.a.HTTP_ERROR:var n=s.getStatus();if(h("Connection",'RPC "'+t+'" failed with status:',n,"response text:",s.getResponseText()),n>0){var r=s.getResponseJson().error;if(r&&r.status&&r.message){var u=function(t){var e=t.toLowerCase().replace(/_/g,"-");return Object.values(E).indexOf(e)>=0?e:E.UNKNOWN}(r.status);a(new S(u,r.message))}else a(new S(E.UNKNOWN,"Server responded with status "+s.getStatus()))}else a(new S(E.UNAVAILABLE,"Connection failed."));break;default:v()}}finally{h("Connection",'RPC "'+t+'" completed.')}}));var u=JSON.stringify(r);s.send(e,"POST",u,n,15)}))},e.prototype.Cu=function(t,e){var n=[this.gu,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=Object(o.g)(),a=Object(o.h)(),s={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.t.projectId+"/databases/"+this.t.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.i};this.vu(s.initMessageHeaders,e),Object(i.x)()||Object(i.A)()||Object(i.t)()||Object(i.v)()||Object(i.B)()||Object(i.s)()||(s.httpHeadersOverwriteParam="$httpHeaders");var u=n.join("");h("Connection","Creating WebChannel: "+u,s);var c=r.createWebChannel(u,s),l=!1,f=!1,p=new Oo({fu:function(t){f?h("Connection","Not sending because WebChannel is closed:",t):(l||(h("Connection","Opening WebChannel transport."),c.open(),l=!0),h("Connection","WebChannel sending:",t),c.send(t))},du:function(){return c.close()}}),v=function(t,e,n){t.listen(e,(function(t){try{n(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return v(c,o.e.EventType.OPEN,(function(){f||h("Connection","WebChannel transport opened.")})),v(c,o.e.EventType.CLOSE,(function(){f||(f=!0,h("Connection","WebChannel transport closed"),p.Ru())}
2)),v(c,o.e.EventType.ERROR,(function(t){f||(f=!0,d("Connection","WebChannel transport errored:",t),p.Ru(new S(E.UNAVAILABLE,"The operation could not be completed")))})),v(c,o.e.EventType.MESSAGE,(function(t){var e;if(!f){var n=t.data[0];m(!!n);var r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){h("Connection","WebChannel received error:",i);var o=i.status,a=function(t){var e=Le[t];if(void 0!==e)return ze(e)}(o),s=i.message;void 0===a&&(a=E.INTERNAL,s="Unknown error status: "+o+" with message "+i.message),f=!0,p.Ru(new S(a,s)),c.close()}else h("Connection","WebChannel received:",n),p.Pu(n)}})),v(a,o.b.STAT_EVENT,(function(t){t.stat===o.d.PROXY?h("Connection","Detected buffering proxy"):t.stat===o.d.NOPROXY&&h("Connection","Detected no buffering proxy")})),setTimeout((function(){p.Au()}),0),p},e}(function(){function t(t){this.yu=t,this.t=t.t;var e=t.ssl?"https":"http";this.gu=e+"://"+t.host,this.Vu="projects/"+this.t.projectId+"/databases/"+this.t.database+"/documents"}return t.prototype.pu=function(t,e,n,r){var i=this.bu(t,e);h("RestConnection","Sending: ",i,n);var o={};return this.vu(o,r),this.Su(t,i,o,n).then((function(t){return h("RestConnection","Received: ",t),t}),(function(e){throw d("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e}))},t.prototype.Du=function(t,e,n,r){return this.pu(t,e,n,r)},t.prototype.vu=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/8.3.0",t["Content-Type"]="text/plain",e)for(var n in e.g)e.g.hasOwnProperty(n)&&(t[n]=e.g[n])},t.prototype.bu=function(t,e){var n=So[t];return this.gu+"/v1/"+e+":"+n},t}());function Co(){return"undefined"!=typeof window?window:null}function Mo(){return"undefined"!=typeof document?document:null}function Ao(t){return new _n(t,!0)}var Io=function(){function t(t,e,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this.Zr=t,this.fs=e,this.xu=n,this.Nu=r,this.$u=i,this.Fu=0,this.Ou=null,this.ku=Date.now(),this.reset()}return t.prototype.reset=function(){this.Fu=0},t.prototype.Mu=function(){this.Fu=this.$u},t.prototype.Lu=function(t){var e=this;this.cancel();var n=Math.floor(this.Fu+this.Bu()),r=Math.max(0,Date.now()-this.ku),i=Math.max(0,n-r);i>0&&h("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.Fu+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Ou=this.Zr.Tr(this.fs,i,(function(){return e.ku=Date.now(),t()})),this.Fu*=this.Nu,this.Fu<this.xu&&(this.Fu=this.xu),this.Fu>this.$u&&(this.Fu=this.$u)},t.prototype.qu=function(){null!==this.Ou&&(this.Ou.Rs(),this.Ou=null)},t.prototype.cancel=function(){null!==this.Ou&&(this.Ou.cancel(),this.Ou=null)},t.prototype.Bu=function(){return(Math.random()-.5)*this.Fu},t}(),jo=function(){function t(t,e,n,r,i,o){this.Zr=t,this.Uu=n,this.Qu=r,this.Ku=i,this.listener=o,this.state=0,this.Wu=0,this.ju=null,this.stream=null,this.Gu=new Io(t,e)}return t.prototype.zu=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.Hu=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.Ju()},t.prototype.stop=function(){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(t){switch(t.label){case 0:return this.zu()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
2))}))},t.prototype.Yu=function(){this.state=0,this.Gu.reset()},t.prototype.Xu=function(){var t=this;this.Hu()&&null===this.ju&&(this.ju=this.Zr.Tr(this.Uu,6e4,(function(){return t.Zu()})))},t.prototype.th=function(t){this.eh(),this.stream.send(t)},t.prototype.Zu=function(){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(t){return this.Hu()?[2,this.close(0)]:[2]}))}))},t.prototype.eh=function(){this.ju&&(this.ju.cancel(),this.ju=null)},t.prototype.close=function(t,e){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(n){switch(n.label){case 0:return this.eh(),this.Gu.cancel(),this.Wu++,3!==t?this.Gu.reset():e&&e.code===E.RESOURCE_EXHAUSTED?(f(e.toString()),f("Using maximum backoff delay to prevent overloading the backend."),this.Gu.Mu()):e&&e.code===E.UNAUTHENTICATED&&this.Ku.p(),null!==this.stream&&(this.nh(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Tu(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.nh=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.sh(this.Wu),n=this.Wu;this.Ku.getToken().then((function(e){t.Wu===n&&t.ih(e)}),(function(n){e((function(){var e=new S(E.UNKNOWN,"Fetching auth token failed: "+n.message);return t.rh(e)}))}))},t.prototype.ih=function(t){var e=this,n=this.sh(this.Wu);this.stream=this.oh(t),this.stream.wu((function(){n((function(){return e.state=2,e.listener.wu()}))})),this.stream.Tu((function(t){n((function(){return e.rh(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.Ju=function(){var t=this;this.state=4,this.Gu.Lu((function(){return Object(a.b)(t,void 0,void 0,(function(){return Object(a.d)(this,(function(t){return this.state=0,this.start(),[2]}))}))}))},t.prototype.rh=function(t){return h("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.sh=function(t){var e=this;return function(n){e.Zr.Ps((function(){return e.Wu===t?n():(h("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),Po=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).Qt=i,a}return Object(a.c)(e,t),e.prototype.oh=function(t){return this.Qu.Cu("Listen",t)},e.prototype.onMessage=function(t){this.Gu.reset();var e=function(t,e){var n;if("targetChange"in e){e.targetChange;var r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:v()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.Bt?(m(void 0===e||"string"==typeof e),T.fromBase64String(e||"")):(m(void 0===e||e instanceof Uint8Array),T.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),a=(s=e.targetChange.cause)&&function(t){var e=void 0===t.code?E.UNKNOWN:ze(t.code);return new S(e,t.message||"")}(s);n=new dn(r,i,o,a||null)}else if("documentChange"in e){e.documentChange,(r=e.documentChange).document,r.document.name,r.document.updateTime,i=Cn(t,r.document.name),o=En(r.document.updateTime);var s=new pt({mapValue:{fields:r.document.fields}}),u=(a=new yt(i,o,s,{}),r.targetIds||[]),c=r.removedTargetIds||[];n=new hn(u,c,a.key,a)}else if("documentDelete"in e)e.documentDelete,(r=e.documentDelete).document,i=Cn(t,r.document),o=r.readTime?En(r.readTime):N.min(),s=new bt(i,o),a=r.removedTargetIds||[],n=new hn([],a,s.key,s);else if("documentRemove"in e)e.documentRemove,(r=e.documentRemove).document,i=Cn(t,r.document),o=r.removedTargetIds||[],n=new hn([],o,i,null);else{if(!("filter"in e))return v();e.filter;var l=e.filter;l.targetId,r=l.count||0,i=new Be(r),o=l.targetId,n=new fn(o,i)}return n}(this.Qt,t),n=function(t){if(!("targetChange"in t))return N.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?N.min():e.readTime?En(e.readTime):N.min()}(t);return this.listener.ah(e,n)},e.prototype.uh=function(t){var e={};e.database=In(this.Qt),e.addTarget=function(t,e){var n,r=e.target;return(n=St(r)?{documents:Dn(t,r)}:{query:Fn(t,r)}).targetId=e.targetId,e.resumeToken.l()>0?n.resumeToken=xn(t,e.resumeToken):e.Ot._(N.min())>0&&(n.readTime=wn(t,e.Ot.j())),n}(this.Qt,t);var n=function(t,e){var n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return v()}}(0,e.Ft);return null==n?null:{"goog-listen-tags":n}}(this.Qt,t);n&&(e.labels=n),this.th(e)},e.prototype.hh=function(t){var e={};e.database=In(this.Qt),e.removeTarget=t,this.th(e)},e}(jo),Ro=function(t){function e(e,n,r,i,o){var a=this;return(a=t.call(this,e,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).Qt=i,a.lh=!1,a}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"_h",{get:function(){return this.lh}
2,enumerable:!1,configurable:!0}),e.prototype.start=function(){this.lh=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.nh=function(){this.lh&&this.fh([])},e.prototype.oh=function(t){return this.Qu.Cu("Write",t)},e.prototype.onMessage=function(t){if(m(!!t.streamToken),this.lastStreamToken=t.streamToken,this.lh){this.Gu.reset();var e=function(t,e){return t&&t.length>0?(m(void 0!==e),t.map((function(t){return function(t,e){var n=t.updateTime?En(t.updateTime):En(e);return n.isEqual(N.min())&&(n=En(e)),new we(n,t.transformResults||[])}(t,e)}))):[]}(t.writeResults,t.commitTime),n=En(t.commitTime);return this.listener.dh(n,e)}return m(!t.writeResults||0===t.writeResults.length),this.lh=!0,this.listener.wh()},e.prototype.Eh=function(){var t={};t.database=In(this.Qt),this.th(t)},e.prototype.fh=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map((function(t){return Nn(e.Qt,t)}))};this.th(n)},e}(jo),No=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.Qu=n,i.Qt=r,i.Th=!1,i}return Object(a.c)(e,t),e.prototype.Ih=function(){if(this.Th)throw new S(E.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.pu=function(t,e,n){var r=this;return this.Ih(),this.credentials.getToken().then((function(i){return r.Qu.pu(t,e,n,i)})).catch((function(t){throw t.code===E.UNAUTHENTICATED&&r.credentials.p(),t}))},e.prototype.Du=function(t,e,n){var r=this;return this.Ih(),this.credentials.getToken().then((function(i){return r.Qu.Du(t,e,n,i)})).catch((function(t){throw t.code===E.UNAUTHENTICATED&&r.credentials.p(),t}))},e.prototype.terminate=function(){this.Th=!1},e}((function(){})),Lo=function(){function t(t,e){this._s=t,this.fa=e,this.state="Unknown",this.mh=0,this.Ah=null,this.Rh=!0}return t.prototype.Ph=function(){var t=this;0===this.mh&&(this.yh("Unknown"),this.Ah=this._s.Tr("online_state_timeout",1e4,(function(){return t.Ah=null,t.gh("Backend didn't respond within 10 seconds."),t.yh("Offline"),Promise.resolve()})))},t.prototype.Vh=function(t){"Online"===this.state?this.yh("Unknown"):(this.mh++,this.mh>=1&&(this.ph(),this.gh("Connection failed 1 times. Most recent error: "+t.toString()),this.yh("Offline")))},t.prototype.set=function(t){this.ph(),this.mh=0,"Online"===t&&(this.Rh=!1),this.yh(t)},t.prototype.yh=function(t){t!==this.state&&(this.state=t,this.fa(t))},t.prototype.gh=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Rh?(f(e),this.Rh=!1):h("OnlineStateTracker",e)},t.prototype.ph=function(){null!==this.Ah&&(this.Ah.cancel(),this.Ah=null)},t}(),Do=function(t,e,n,r,i){var o=this;this.bh=t,this.Sh=e,this._s=n,this.Dh={},this.Ch=[],this.xh=new Map,this.Nh=new Set,this.$h=[],this.Fh=i,this.Fh.ou((function(t){n.Ps((function(){return Object(a.b)(o,void 0,void 0,(function(){return Object(a.d)(this,(function(t){switch(t.label){case 0:return Go(this)?(h("RemoteStore","Restarting streams for network reachability change."),[4,function(t){return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return(e=g(t)).Nh.add(4),[4,Uo(e)];case 1:return n.sent(),e.Oh.set("Unknown"),e.Nh.delete(4),[4,Fo(e)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
2))}))}))})),this.Oh=new Lo(n,r)};function Fo(t){return Object(a.b)(this,void 0,void 0,(function(){var e,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:if(!Go(t))return[3,4];e=0,n=t.$h,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!0)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Uo(t){return Object(a.b)(this,void 0,void 0,(function(){var e,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:e=0,n=t.$h,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!1)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Bo(t,e){var n=g(t);n.xh.has(e.targetId)||(n.xh.set(e.targetId,e),Wo(n)?qo(n):sa(n).Hu()&&zo(n,e))}function Vo(t,e){var n=g(t),r=sa(n);n.xh.delete(e),r.Hu()&&Ho(n,e),0===n.xh.size&&(r.Hu()?r.Xu():Go(n)&&n.Oh.set("Unknown"))}function zo(t,e){t.kh.on(e.targetId),sa(t).uh(e)}function Ho(t,e){t.kh.on(e),sa(t).hh(e)}function qo(t){t.kh=new vn({vn:function(e){return t.Dh.vn(e)},Sn:function(e){return t.xh.get(e)||null}}),sa(t).start(),t.Oh.Ph()}function Wo(t){return Go(t)&&!sa(t).zu()&&t.xh.size>0}function Go(t){return 0===g(t).Nh.size}function Yo(t){t.kh=void 0}function Xo(t){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(e){return t.xh.forEach((function(e,n){zo(t,e)})),[2]}))}))}function Ko(t,e){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(n){return Yo(t),Wo(t)?(t.Oh.Vh(e),qo(t)):t.Oh.set("Unknown"),[2]}))}))}function Qo(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o;return Object(a.d)(this,(function(s){switch(s.label){case 0:if(t.Oh.set("Online"),!(e instanceof dn&&2===e.state&&e.cause))return[3,6];s.label=1;case 1:return s.trys.push([1,3,,5]),[4,function(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o;return Object(a.d)(this,(function(a){switch(a.label){case 0:n=e.cause,r=0,i=e.targetIds,a.label=1;case 1:return r<i.length?(o=i[r],t.xh.has(o)?[4,t.Dh.Mh(o,n)]:[3,3]):[3,5];case 2:a.sent(),t.xh.delete(o),t.kh.removeTarget(o),a.label=3;case 3:a.label=4;case 4:return r++,[3,1];case 5:return[2]}}
2))}))}(t,e)];case 2:return s.sent(),[3,5];case 3:return r=s.sent(),h("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),[4,Jo(t,r)];case 4:return s.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof hn?t.kh.dn(e):e instanceof fn?t.kh.Pn(e):t.kh.Tn(e),n.isEqual(N.min()))return[3,13];s.label=7;case 7:return s.trys.push([7,11,,13]),[4,qi(t.bh)];case 8:return i=s.sent(),n._(i)>=0?[4,function(t,e){var n=t.kh.Vn(e);return n.$e.forEach((function(n,r){if(n.resumeToken.l()>0){var i=t.xh.get(r);i&&t.xh.set(r,i.Mt(n.resumeToken,e))}})),n.Fe.forEach((function(e){var n=t.xh.get(e);if(n){t.xh.set(e,n.Mt(T.T,n.Ot)),Ho(t,e);var r=new ie(n.target,e,1,n.sequenceNumber);zo(t,r)}})),t.Dh.Lh(n)}(t,n)]:[3,10];case 9:s.sent(),s.label=10;case 10:return[3,13];case 11:return h("RemoteStore","Failed to raise snapshot:",o=s.sent()),[4,Jo(t,o)];case 12:return s.sent(),[3,13];case 13:return[2]}}))}))}function Jo(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r=this;return Object(a.d)(this,(function(i){switch(i.label){case 0:if(!rr(e))throw e;return t.Nh.add(1),[4,Uo(t)];case 1:return i.sent(),t.Oh.set("Offline"),n||(n=function(){return qi(t.bh)}),t._s.po((function(){return Object(a.b)(r,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return h("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return e.sent(),t.Nh.delete(1),[4,Fo(t)];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))}function Zo(t,e){return e().catch((function(n){return Jo(t,n,e)}))}function $o(t){return Object(a.b)(this,void 0,void 0,(function(){var e,n,r,i,o;return Object(a.d)(this,(function(a){switch(a.label){case 0:e=g(t),n=ua(e),r=e.Ch.length>0?e.Ch[e.Ch.length-1].batchId:-1,a.label=1;case 1:if(!function(t){return Go(t)&&t.Ch.length<10}(e))return[3,7];a.label=2;case 2:return a.trys.push([2,4,,6]),[4,Yi(e.bh,r)];case 3:return null===(i=a.sent())?(0===e.Ch.length&&n.Xu(),[3,7]):(r=i.batchId,function(t,e){t.Ch.push(e);var n=ua(t);n.Hu()&&n._h&&n.fh(e.mutations)}(e,i),[3,6]);case 4:return o=a.sent(),[4,Jo(e,o)];case 5:return a.sent(),[3,6];case 6:return[3,1];case 7:return ta(e)&&ea(e),[2]}}))}))}function ta(t){return Go(t)&&!ua(t).zu()&&t.Ch.length>0}function ea(t){ua(t).start()}function na(t){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(e){return ua(t).Eh(),[2]}))}
2))}function ra(t){return Object(a.b)(this,void 0,void 0,(function(){var e,n,r,i;return Object(a.d)(this,(function(o){for(e=ua(t),n=0,r=t.Ch;n<r.length;n++)i=r[n],e.fh(i.mutations);return[2]}))}))}function ia(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:return r=t.Ch.shift(),i=Lr.from(r,e,n),[4,Zo(t,(function(){return t.Dh.Bh(i)}))];case 1:return o.sent(),[4,$o(t)];case 2:return o.sent(),[2]}}))}))}function oa(t,e){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(n){switch(n.label){case 0:return e&&ua(t)._h?[4,function(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r;return Object(a.d)(this,(function(i){switch(i.label){case 0:return Ve(r=e.code)&&r!==E.ABORTED?(n=t.Ch.shift(),ua(t).Yu(),[4,Zo(t,(function(){return t.Dh.qh(n.batchId,e)}))]):[3,3];case 1:return i.sent(),[4,$o(t)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return ta(t)&&ea(t),[2]}}))}))}function aa(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return n=g(t),e?(n.Nh.delete(2),[4,Fo(n)]):[3,2];case 1:return r.sent(),[3,5];case 2:return e?[3,4]:(n.Nh.add(2),[4,Uo(n)]);case 3:r.sent(),n.Oh.set("Unknown"),r.label=4;case 4:r.label=5;case 5:return[2]}}
2))}))}function sa(t){var e=this;return t.Uh||(t.Uh=function(t,e,n){var r=g(t);return r.Ih(),new Po(e,r.Qu,r.credentials,r.Qt,n)}(t.Sh,t._s,{wu:Xo.bind(null,t),Tu:Ko.bind(null,t),ah:Qo.bind(null,t)}),t.$h.push((function(n){return Object(a.b)(e,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return n?(t.Uh.Yu(),Wo(t)?qo(t):t.Oh.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.Uh.stop()];case 2:e.sent(),Yo(t),e.label=3;case 3:return[2]}}))}))}))),t.Uh}function ua(t){var e=this;return t.Qh||(t.Qh=function(t,e,n){var r=g(t);return r.Ih(),new Ro(e,r.Qu,r.credentials,r.Qt,n)}(t.Sh,t._s,{wu:na.bind(null,t),Tu:oa.bind(null,t),wh:ra.bind(null,t),dh:ia.bind(null,t)}),t.$h.push((function(n){return Object(a.b)(e,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return n?(t.Qh.Yu(),[4,$o(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.Qh.stop()];case 3:e.sent(),t.Ch.length>0&&(h("RemoteStore","Stopping write stream with "+t.Ch.length+" pending writes"),t.Ch=[]),e.label=4;case 4:return[2]}}
2))}))}))),t.Qh}var ca=function(){this.Kh=void 0,this.listeners=[]},la=function(){this.queries=new ii((function(t){return $t(t)}),Zt),this.onlineState="Unknown",this.Wh=new Set};function ha(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s,u,c;return Object(a.d)(this,(function(a){switch(a.label){case 0:if(n=g(t),r=e.query,i=!1,(o=n.queries.get(r))||(i=!0,o=new ca),!i)return[3,4];a.label=1;case 1:return a.trys.push([1,3,,4]),s=o,[4,n.jh(r)];case 2:return s.Kh=a.sent(),[3,4];case 3:return u=a.sent(),c=cr(u,"Initialization of query '"+te(e.query)+"' failed"),[2,void e.onError(c)];case 4:return n.queries.set(r,o),o.listeners.push(e),e.Gh(n.onlineState),o.Kh&&e.zh(o.Kh)&&va(n),[2]}}))}))}function fa(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s;return Object(a.d)(this,(function(a){return n=g(t),r=e.query,i=!1,(o=n.queries.get(r))&&(s=o.listeners.indexOf(e))>=0&&(o.listeners.splice(s,1),i=0===o.listeners.length),i?[2,(n.queries.delete(r),n.Hh(r))]:[2]}))}))}function da(t,e){for(var n=g(t),r=!1,i=0,o=e;i<o.length;i++){var a=o[i],s=a.query,u=n.queries.get(s);if(u){for(var c=0,l=u.listeners;c<l.length;c++)l[c].zh(a)&&(r=!0);u.Kh=a}}r&&va(n)}function pa(t,e,n){var r=g(t),i=r.queries.get(e);if(i)for(var o=0,a=i.listeners;o<a.length;o++)a[o].onError(n);r.queries.delete(e)}function va(t){t.Wh.forEach((function(t){t.next()}))}var ma=function(){function t(t,e,n){this.query=t,this.Jh=e,this.Yh=!1,this.Xh=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.zh=function(t){if(!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];3!==i.type&&e.push(i)}t=new un(t.query,t.docs,t.Se,e,t.De,t.fromCache,t.Ce,!0)}var o=!1;return this.Yh?this.Zh(t)&&(this.Jh.next(t),o=!0):this.tl(t,this.onlineState)&&(this.el(t),o=!0),this.Xh=t,o},t.prototype.onError=function(t){this.Jh.error(t)},t.prototype.Gh=function(t){this.onlineState=t;var e=!1;return this.Xh&&!this.Yh&&this.tl(this.Xh,t)&&(this.el(this.Xh),e=!0),e},t.prototype.tl=function(t,e){if(!t.fromCache)return!0;var n="Offline"!==e;return!(this.options.nl&&n||t.docs.et()&&"Offline"!==e)},t.prototype.Zh=function(t){if(t.docChanges.length>0)return!0;var e=this.Xh&&this.Xh.hasPendingWrites!==t.hasPendingWrites;return!(!t.Ce&&!e)&&!0===this.options.includeMetadataChanges},t.prototype.el=function(t){t=un.Ne(t.query,t.docs,t.De,t.fromCache),this.Yh=!0,this.Jh.next(t)},t}(),ga=function(){function t(t,e){this.payload=t,this.byteLength=e}return t.prototype.sl=function(){return"metadata"in this.payload},t}(),ya=function(){function t(t){this.Qt=t}return t.prototype.Pc=function(t){return Cn(this.Qt,t)},t.prototype.yc=function(t){return t.metadata.exists?Rn(this.Qt,t.document,!1):new bt(this.Pc(t.metadata.name),this.gc(t.metadata.readTime))},t.prototype.gc=function(t){return En(t)},t}(),ba=function(){function t(t,e,n){this.il=t,this.bh=e,this.Qt=n,this.queries=[],this.documents=[],this.progress=_a(t)}return t.prototype.rl=function(t){this.progress.bytesLoaded+=t.byteLength;var e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null},t.prototype.ol=function(t){for(var e=new Map,n=new ya(this.Qt),r=0,i=t;r<i.length;r++){var o=i[r];if(o.metadata.queries)for(var a=n.Pc(o.metadata.name),s=0,u=o.metadata.queries;s<u.length;s++){var c=u[s],l=(e.get(c)||nn()).add(a);e.set(c,l)}}return e},t.prototype.complete=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e,n,r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:return[4,to(this.bh,new ya(this.Qt),this.documents,this.il.id)];case 1:t=o.sent(),e=this.ol(this.documents),n=0,r=this.queries,o.label=2;case 2:return n<r.length?(i=r[n],[4,eo(this.bh,i,e.get(i.name))]):[3,5];case 3:o.sent(),o.label=4;case 4:return n++,[3,2];case 5:return[2,(this.progress.taskState="Success",new Li(Object.assign({},this.progress),t))]}}))}))},t}();function _a(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}var wa=function(t){this.key=t},xa=function(t){this.key=t},Ta=function(){function t(t,e){this.query=t,this.cl=e,this.al=null,this.Be=!1,this.ul=nn(),this.De=nn(),this.hl=ne(t),this.ll=new an(this.hl)}return Object.defineProperty(t.prototype,"_l",{get:function(){return this.cl}
2,enumerable:!1,configurable:!0}),t.prototype.fl=function(t,e){var n=this,r=e?e.dl:new sn,i=e?e.ll:this.ll,o=e?e.De:this.De,a=i,s=!1,u=qt(this.query)&&i.size===this.query.limit?i.last():null,c=Wt(this.query)&&i.size===this.query.limit?i.first():null;if(t.Xt((function(t,e){var l=i.get(t),h=e instanceof yt?e:null;h&&(h=ee(n.query,h)?h:null);var f=!!l&&n.De.has(l.key),d=!!h&&(h.Vt||n.De.has(h.key)&&h.hasCommittedMutations),p=!1;l&&h?l.data().isEqual(h.data())?f!==d&&(r.track({type:3,doc:h}),p=!0):n.wl(l,h)||(r.track({type:2,doc:h}),p=!0,(u&&n.hl(h,u)>0||c&&n.hl(h,c)<0)&&(s=!0)):!l&&h?(r.track({type:0,doc:h}),p=!0):l&&!h&&(r.track({type:1,doc:l}),p=!0,(u||c)&&(s=!0)),p&&(h?(a=a.add(h),o=d?o.add(t):o.delete(t)):(a=a.delete(t),o=o.delete(t)))})),qt(this.query)||Wt(this.query))for(;a.size>this.query.limit;){var l=qt(this.query)?a.last():a.first();a=a.delete(l.key),o=o.delete(l.key),r.track({type:1,doc:l})}return{ll:a,dl:r,lc:s,De:o}},t.prototype.wl=function(t,e){return t.Vt&&e.hasCommittedMutations&&!e.Vt},t.prototype.wi=function(t,e,n){var r=this,i=this.ll;this.ll=t.ll,this.De=t.De;var o=t.dl.ve();o.sort((function(t,e){return function(t,e){var n=function(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return v()}};return n(t)-n(e)}(t.type,e.type)||r.hl(t.doc,e.doc)})),this.El(n);var a=e?this.Tl():[],s=0===this.ul.size&&this.Be?1:0,u=s!==this.al;return this.al=s,0!==o.length||u?{snapshot:new un(this.query,t.ll,i,o,t.De,0===s,u,!1),Il:a}:{Il:a}},t.prototype.Gh=function(t){return this.Be&&"Offline"===t?(this.Be=!1,this.wi({ll:this.ll,dl:new sn,De:this.De,lc:!1},!1)):{Il:[]}},t.prototype.ml=function(t){return!this.cl.has(t)&&!!this.ll.has(t)&&!this.ll.get(t).Vt},t.prototype.El=function(t){var e=this;t&&(t.qe.forEach((function(t){return e.cl=e.cl.add(t)})),t.Ue.forEach((function(t){})),t.Qe.forEach((function(t){return e.cl=e.cl.delete(t)})),this.Be=t.Be)},t.prototype.Tl=function(){var t=this;if(!this.Be)return[];var e=this.ul;this.ul=nn(),this.ll.forEach((function(e){t.ml(e.key)&&(t.ul=t.ul.add(e.key))}));var n=[];return e.forEach((function(e){t.ul.has(e)||n.push(new xa(e))})),this.ul.forEach((function(t){e.has(t)||n.push(new wa(t))})),n},t.prototype.Al=function(t){this.cl=t.Rc,this.ul=nn();var e=this.fl(t.documents);return this.wi(e,!0)},t.prototype.Rl=function(){return un.Ne(this.query,this.ll,this.De,0===this.al)},t}(),Ea=function(t,e,n){this.query=t,this.targetId=e,this.view=n},Sa=function(t){this.key=t,this.Pl=!1},Oa=function(){function t(t,e,n,r,i,o){this.bh=t,this.yl=e,this.gl=n,this.Vl=r,this.currentUser=i,this.pl=o,this.bl={},this.vl=new ii((function(t){return $t(t)}),Zt),this.Sl=new Map,this.Dl=new Set,this.Cl=new He(B.H),this.xl=new Map,this.Nl=new ro,this.$l={},this.Fl=new Map,this.Ol=di.Li(),this.onlineState="Unknown",this.kl=void 0}return Object.defineProperty(t.prototype,"Ml",{get:function(){return!0===this.kl},enumerable:!1,configurable:!0}),t}();function ka(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s,u;return Object(a.d)(this,(function(a){switch(a.label){case 0:return n=ns(t),(o=n.vl.get(e))?(r=o.targetId,n.Vl.Fa(r),i=o.view.Rl(),[3,4]):[3,1];case 1:return[4,Xi(n.bh,Qt(e))];case 2:return s=a.sent(),u=n.Vl.Fa(s.targetId),r=s.targetId,[4,Ca(n,e,r,"current"===u)];case 3:i=a.sent(),n.Ml&&Bo(n.yl,s),a.label=4;case 4:return[2,i]}}))}))}function Ca(t,e,n,r){return Object(a.b)(this,void 0,void 0,(function(){var i,o,s,u,c,l;return Object(a.d)(this,(function(h){switch(h.label){case 0:return t.Ll=function(e,n,r){return function(t,e,n,r){return Object(a.b)(this,void 0,void 0,(function(){var i,o,s;return Object(a.d)(this,(function(a){switch(a.label){case 0:return(i=e.view.fl(n)).lc?[4,Qi(t.bh,e.query,!1).then((function(t){var n=t.documents;return e.view.fl(n,i)}))]:[3,2];case 1:i=a.sent(),a.label=2;case 2:return o=r&&r.$e.get(e.targetId),s=e.view.wi(i,t.Ml,o),[2,(Va(t,e.targetId,s.Il),s.snapshot)]}}))}))}(t,e,n,r)},[4,Qi(t.bh,e,!0)];case 1:return i=h.sent(),o=new Ta(e,i.Rc),s=o.fl(i.documents),u=ln.Le(n,r&&"Offline"!==t.onlineState),c=o.wi(s,t.Ml,u),Va(t,n,c.Il),l=new Ea(e,n,o),[2,(t.vl.set(e,l),t.Sl.has(n)?t.Sl.get(n).push(e):t.Sl.set(n,[e]),c.snapshot)]}}))}))}function Ma(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:return n=g(t),r=n.vl.get(e),(i=n.Sl.get(r.targetId)).length>1?[2,(n.Sl.set(r.targetId,i.filter((function(t){return!Zt(t,e)}
2))),void n.vl.delete(e))]:n.Ml?(n.Vl.ka(r.targetId),n.Vl.Da(r.targetId)?[3,2]:[4,Ki(n.bh,r.targetId,!1).then((function(){n.Vl.La(r.targetId),Vo(n.yl,r.targetId),Ua(n,r.targetId)})).catch(ri)]):[3,3];case 1:o.sent(),o.label=2;case 2:return[3,5];case 3:return Ua(n,r.targetId),[4,Ki(n.bh,r.targetId,!0)];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))}function Aa(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o,s;return Object(a.d)(this,(function(a){switch(a.label){case 0:r=rs(t),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,function(t,e){var n,r=g(t),i=R.now(),o=e.reduce((function(t,e){return t.add(e.key)}),nn());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(t){return r.Tc.Xo(t,o).next((function(o){n=o;for(var a=[],s=0,u=e;s<u.length;s++){var c=u[s],l=ke(c,n.get(c.key));null!=l&&a.push(new Ie(c.key,l,mt(l.proto.mapValue),xe.exists(!0)))}return r.zo.Ri(t,i,a,e)}))})).then((function(t){var e=t.xs(n);return{batchId:t.batchId,ri:e}}))}(r.bh,e)];case 2:return i=a.sent(),r.Vl.Ca(i.batchId),function(t,e,n){var r=t.$l[t.currentUser.A()];r||(r=new He(_)),r=r.zt(e,n),t.$l[t.currentUser.A()]=r}(r,i.batchId,n),[4,qa(r,i.ri)];case 3:return a.sent(),[4,$o(r.yl)];case 4:return a.sent(),[3,6];case 5:return o=a.sent(),s=cr(o,"Failed to persist write"),n.reject(s),[3,6];case 6:return[2]}}
2))}))}function Ia(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r;return Object(a.d)(this,(function(i){switch(i.label){case 0:n=g(t),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,Wi(n.bh,e)];case 2:return r=i.sent(),e.$e.forEach((function(t,e){var r=n.xl.get(e);r&&(m(t.qe.size+t.Ue.size+t.Qe.size<=1),t.qe.size>0?r.Pl=!0:t.Ue.size>0?m(r.Pl):t.Qe.size>0&&(m(r.Pl),r.Pl=!1))})),[4,qa(n,r,e)];case 3:return i.sent(),[3,6];case 4:return[4,ri(i.sent())];case 5:return i.sent(),[3,6];case 6:return[2]}}))}))}function ja(t,e,n){var r=g(t);if(r.Ml&&0===n||!r.Ml&&1===n){var i=[];r.vl.forEach((function(t,n){var r=n.view.Gh(e);r.snapshot&&i.push(r.snapshot)})),function(t,e){var n=g(t);n.onlineState=e;var r=!1;n.queries.forEach((function(t,n){for(var i=0,o=n.listeners;i<o.length;i++)o[i].Gh(e)&&(r=!0)})),r&&va(n)}(r.gl,e),i.length&&r.bl.ah(i),r.onlineState=e,r.Ml&&r.Vl.Qa(e)}}function Pa(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o,s,u,c;return Object(a.d)(this,(function(a){switch(a.label){case 0:return(r=g(t)).Vl.Ba(e,"rejected",n),i=r.xl.get(e),(o=i&&i.key)?(s=(s=new He(B.H)).zt(o,new bt(o,N.min())),u=nn().add(o),c=new cn(N.min(),new Map,new Ge(_),s,u),[4,Ia(r,c)]):[3,2];case 1:return a.sent(),r.Cl=r.Cl.remove(o),r.xl.delete(e),Ha(r),[3,4];case 2:return[4,Ki(r.bh,e,!1).then((function(){return Ua(r,e,n)}
2)).catch(ri)];case 3:a.sent(),a.label=4;case 4:return[2]}}))}))}function Ra(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:n=g(t),r=e.batch.batchId,o.label=1;case 1:return o.trys.push([1,4,,6]),[4,Hi(n.bh,e)];case 2:return i=o.sent(),Fa(n,r,null),Da(n,r),n.Vl.Na(r,"acknowledged"),[4,qa(n,i)];case 3:return o.sent(),[3,6];case 4:return[4,ri(o.sent())];case 5:return o.sent(),[3,6];case 6:return[2]}}))}))}function Na(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:r=g(t),o.label=1;case 1:return o.trys.push([1,4,,6]),[4,function(t,e){var n=g(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(t){var r;return n.zo.Pi(t,e).next((function(e){return m(null!==e),r=e.keys(),n.zo.Ci(t,e)})).next((function(){return n.zo.$i(t)})).next((function(){return n.Tc.Xo(t,r)}))}))}(r.bh,e)];case 2:return i=o.sent(),Fa(r,e,n),Da(r,e),r.Vl.Na(e,"rejected",n),[4,qa(r,i)];case 3:return o.sent(),[3,6];case 4:return[4,ri(o.sent())];case 5:return o.sent(),[3,6];case 6:return[2]}}
2))}))}function La(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s;return Object(a.d)(this,(function(a){switch(a.label){case 0:Go((n=g(t)).yl)||h("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,function(t){var e=g(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(t){return e.zo.Vi(t)}))}(n.bh)];case 2:return-1===(r=a.sent())?[2,void e.resolve()]:((i=n.Fl.get(r)||[]).push(e),n.Fl.set(r,i),[3,4]);case 3:return o=a.sent(),s=cr(o,"Initialization of waitForPendingWrites() operation failed"),e.reject(s),[3,4];case 4:return[2]}}))}))}function Da(t,e){(t.Fl.get(e)||[]).forEach((function(t){t.resolve()})),t.Fl.delete(e)}function Fa(t,e,n){var r=g(t),i=r.$l[r.currentUser.A()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.$l[r.currentUser.A()]=i}}function Ua(t,e,n){void 0===n&&(n=null),t.Vl.ka(e);for(var r=0,i=t.Sl.get(e);r<i.length;r++){var o=i[r];t.vl.delete(o),n&&t.bl.Bl(o,n)}t.Sl.delete(e),t.Ml&&t.Nl.Fc(e).forEach((function(e){t.Nl.Fi(e)||Ba(t,e)}))}function Ba(t,e){t.Dl.delete(e.path.rt());var n=t.Cl.get(e);null!==n&&(Vo(t.yl,n),t.Cl=t.Cl.remove(e),t.xl.delete(n),Ha(t))}function Va(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof wa?(t.Nl.nr(o.key,e),za(t,o)):o instanceof xa?(h("SyncEngine","Document no longer in limbo: "+o.key),t.Nl.ir(o.key,e),t.Nl.Fi(o.key)||Ba(t,o.key)):v()}}function za(t,e){var n=e.key,r=n.path.rt();t.Cl.get(n)||t.Dl.has(r)||(h("SyncEngine","New document in limbo: "+n),t.Dl.add(r),Ha(t))}function Ha(t){for(;t.Dl.size>0&&t.Cl.size<t.pl;){var e=t.Dl.values().next().value;t.Dl.delete(e);var n=new B(D.ot(e)),r=t.Ol.next();t.xl.set(r,new Sa(n)),t.Cl=t.Cl.zt(n,r),Bo(t.yl,new ie(Qt(Ht(n.path)),r,2,P.q))}}function qa(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o,s;return Object(a.d)(this,(function(u){switch(u.label){case 0:return r=g(t),i=[],o=[],s=[],r.vl.et()?[3,3]:(r.vl.forEach((function(t,a){s.push(r.Ll(a,e,n).then((function(t){if(t){r.Ml&&r.Vl.Ba(a.targetId,t.fromCache?"not-current":"current"),i.push(t);var e=Fi.oc(a.targetId,t);o.push(e)}})))})),[4,Promise.all(s)]);case 1:return u.sent(),r.bl.ah(i),[4,function(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,l,f;return Object(a.d)(this,(function(a){switch(a.label){case 0:n=g(t),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(t){return Zn.forEach(e,(function(e){return Zn.forEach(e.ic,(function(r){return n.persistence.Ti.nr(t,e.targetId,r)})).next((function(){return Zn.forEach(e.rc,(function(r){return n.persistence.Ti.ir(t,e.targetId,r)}))}))}))}))];case 2:return a.sent(),[3,4];case 3:if(!rr(r=a.sent()))throw r;return h("LocalStore","Failed to update sequence numbers: "+r),[3,4];case 4:for(i=0,o=e;i<o.length;i++)s=o[i],u=s.targetId,s.fromCache||(c=n.fc.get(u),l=c.Ot,f=c.Lt(l),n.fc=n.fc.zt(u,f));return[2]}}))}))}(r.bh,o)];case 2:u.sent(),u.label=3;case 3:return[2]}}
2))}))}function Wa(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r;return Object(a.d)(this,(function(i){switch(i.label){case 0:return(n=g(t)).currentUser.isEqual(e)?[3,3]:(h("SyncEngine","User change. New user:",e.A()),[4,zi(n.bh,e)]);case 1:return r=i.sent(),n.currentUser=e,function(t,e){t.Fl.forEach((function(t){t.forEach((function(t){t.reject(new S(E.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Fl.clear()}(n),n.Vl.Ua(e,r.mc,r.Ac),[4,qa(n,r.Ic)];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))}function Ga(t,e){var n=g(t),r=n.xl.get(e);if(r&&r.Pl)return nn().add(r.key);var i=nn(),o=n.Sl.get(e);if(!o)return i;for(var a=0,s=o;a<s.length;a++){var u=s[a],c=n.vl.get(u);i=i.Pe(c.view._l)}return i}function Ya(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:return[4,Qi((n=g(t)).bh,e.query,!0)];case 1:return r=o.sent(),i=e.view.Al(r),[2,(n.Ml&&Va(n,e.targetId,i.Il),i)]}}))}))}function Xa(t){return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){return[2,Zi((e=g(t)).bh).then((function(t){return qa(e,t)}))]}))}))}function Ka(t,e,n,r){return Object(a.b)(this,void 0,void 0,(function(){var i,o;return Object(a.d)(this,(function(a){switch(a.label){case 0:return[4,function(t,e){var n=g(t),r=g(n.zo);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(t){return r.yi(t,e).next((function(e){return e?n.Tc.Xo(t,e):Zn.resolve(null)}))}))}((i=g(t)).bh,e)];case 1:return null===(o=a.sent())?[3,6]:"pending"!==n?[3,3]:[4,$o(i.yl)];case 2:return a.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(Fa(i,e,r||null),Da(i,e),function(t,e){g(g(t).zo).xi(e)}(i.bh,e)):v(),a.label=4;case 4:return[4,qa(i,o)];case 5:return a.sent(),[3,7];case 6:h("SyncEngine","Cannot apply mutation batch with id: "+e),a.label=7;case 7:return[2]}}
2))}))}function Qa(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,l;return Object(a.d)(this,(function(a){switch(a.label){case 0:return ns(n=g(t)),rs(n),!0!==e||!0===n.kl?[3,3]:(r=n.Vl.va(),[4,Ja(n,r.it())]);case 1:return i=a.sent(),n.kl=!0,[4,aa(n.yl,!0)];case 2:for(a.sent(),o=0,s=i;o<s.length;o++)u=s[o],Bo(n.yl,u);return[3,7];case 3:return!1!==e||!1===n.kl?[3,7]:(c=[],l=Promise.resolve(),n.Sl.forEach((function(t,e){n.Vl.Ma(e)?c.push(e):l=l.then((function(){return Ua(n,e),Ki(n.bh,e,!0)})),Vo(n.yl,e)})),[4,l]);case 4:return a.sent(),[4,Ja(n,c)];case 5:return a.sent(),function(t){var e=g(t);e.xl.forEach((function(t,n){Vo(e.yl,n)})),e.Nl.Oc(),e.xl=new Map,e.Cl=new He(B.H)}(n),n.kl=!1,[4,aa(n.yl,!1)];case 6:a.sent(),a.label=7;case 7:return[2]}}))}))}function Ja(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,l,h,f,d,p,v,m;return Object(a.d)(this,(function(a){switch(a.label){case 0:n=g(t),r=[],i=[],o=0,s=e,a.label=1;case 1:return o<s.length?(u=s[o],c=void 0,(l=n.Sl.get(u))&&0!==l.length?[4,Xi(n.bh,Qt(l[0]))]:[3,7]):[3,13];case 2:c=a.sent(),h=0,f=l,a.label=3;case 3:return h<f.length?(d=f[h],p=n.vl.get(d),[4,Ya(n,p)]):[3,6];case 4:(v=a.sent()).snapshot&&i.push(v.snapshot),a.label=5;case 5:return h++,[3,3];case 6:return[3,11];case 7:return[4,Ji(n.bh,u)];case 8:return m=a.sent(),[4,Xi(n.bh,m)];case 9:return c=a.sent(),[4,Ca(n,Za(m),u,!1)];case 10:a.sent(),a.label=11;case 11:r.push(c),a.label=12;case 12:return o++,[3,1];case 13:return[2,(n.bl.ah(i),r)]}}))}))}function Za(t){return zt(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function $a(t){var e=g(t);return g(g(e.bh).persistence).Uo()}function ts(t,e,n,r){return Object(a.b)(this,void 0,void 0,(function(){var i,o,s;return Object(a.d)(this,(function(a){switch(a.label){case 0:return(i=g(t)).kl?(h("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!i.Sl.has(e))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,Zi(i.bh)];case 3:return o=a.sent(),s=cn.Me(e,"current"===n),[4,qa(i,o,s)];case 4:return a.sent(),[3,8];case 5:return[4,Ki(i.bh,e,!0)];case 6:return a.sent(),Ua(i,e,r),[3,8];case 7:v(),a.label=8;case 8:return[2]}}
2))}))}function es(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o,s,u,c,l,f,d,p;return Object(a.d)(this,(function(v){switch(v.label){case 0:if(!(r=ns(t)).kl)return[3,10];i=0,o=e,v.label=1;case 1:return i<o.length?(s=o[i],r.Sl.has(s)?(h("SyncEngine","Adding an already active target "+s),[3,5]):[4,Ji(r.bh,s)]):[3,6];case 2:return u=v.sent(),[4,Xi(r.bh,u)];case 3:return c=v.sent(),[4,Ca(r,Za(u),c.targetId,!1)];case 4:v.sent(),Bo(r.yl,c),v.label=5;case 5:return i++,[3,1];case 6:l=function(t){return Object(a.d)(this,(function(e){switch(e.label){case 0:return r.Sl.has(t)?[4,Ki(r.bh,t,!1).then((function(){Vo(r.yl,t),Ua(r,t)})).catch(ri)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},f=0,d=n,v.label=7;case 7:return f<d.length?(p=d[f],[5,l(p)]):[3,10];case 8:v.sent(),v.label=9;case 9:return f++,[3,7];case 10:return[2]}}))}))}function ns(t){var e=g(t);return e.yl.Dh.Lh=Ia.bind(null,e),e.yl.Dh.vn=Ga.bind(null,e),e.yl.Dh.Mh=Pa.bind(null,e),e.bl.ah=da.bind(null,e.gl),e.bl.Bl=pa.bind(null,e.gl),e}function rs(t){var e=g(t);return e.yl.Dh.Bh=Ra.bind(null,e),e.yl.Dh.qh=Na.bind(null,e),e}function is(t,e,n){var r=g(t);(function(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o,s,u,c;return Object(a.d)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,14,,15]),[4,e.getMetadata()];case 1:return r=a.sent(),[4,function(t,e){var n=g(t),r=En(e.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",(function(t){return n.wo.Os(t,e.id)})).then((function(t){return!!t&&t.createTime._(r)>=0}))}(t.bh,r)];case 2:return a.sent()?[4,e.close()]:[3,4];case 3:return[2,(a.sent(),void n.ql(function(t){return{taskState:"Success",documentsLoaded:t.totalDocuments,bytesLoaded:t.totalBytes,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(r)))];case 4:return n.Ul(_a(r)),i=new ba(r,t.bh,e.Qt),[4,e.Ql()];case 5:o=a.sent(),a.label=6;case 6:return o?[4,i.rl(o)]:[3,10];case 7:return(s=a.sent())&&n.Ul(s),[4,e.Ql()];case 8:o=a.sent(),a.label=9;case 9:return[3,6];case 10:return[4,i.complete()];case 11:return u=a.sent(),[4,qa(t,u.Go,void 0)];case 12:return a.sent(),[4,function(t,e){var n=g(t);return n.persistence.runTransaction("Save bundle","readwrite",(function(t){return n.wo.ks(t,e)}))}(t.bh,r)];case 13:return a.sent(),n.ql(u.progress),[3,15];case 14:return d("SyncEngine","Loading bundle failed with "+(c=a.sent())),n.Kl(c),[3,15];case 15:return[2]}}
2))}))})(r,e,n).then((function(){r.Vl.Wa()}))}var os=function(){function t(){this.synchronizeTabs=!1}return t.prototype.initialize=function(t){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return this.Qt=Ao(t.yu.t),this.Vl=this.Wl(t),this.persistence=this.jl(t),[4,this.persistence.start()];case 1:return e.sent(),this.Gl=this.zl(t),this.bh=this.Hl(t),[2]}}))}))},t.prototype.zl=function(t){return null},t.prototype.Hl=function(t){return Vi(this.persistence,new Ui,t.Jl,this.Qt)},t.prototype.jl=function(t){return new co(ho.ia,this.Qt)},t.prototype.Wl=function(t){return new xo},t.prototype.terminate=function(){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(t){switch(t.label){case 0:return this.Gl&&this.Gl.stop(),[4,this.Vl.ko()];case 1:return t.sent(),[4,this.persistence.ko()];case 2:return t.sent(),[2]}}))}))},t}(),as=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).Yl=e,i.cacheSizeBytes=n,i.forceOwnership=r,i.synchronizeTabs=!1,i}return Object(a.c)(e,t),e.prototype.initialize=function(e){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(n){switch(n.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return n.sent(),[4,$i(this.bh)];case 2:return n.sent(),[4,this.Yl.initialize(this,e)];case 3:return n.sent(),[4,rs(this.Yl._a)];case 4:return n.sent(),[4,$o(this.Yl.yl)];case 5:return n.sent(),[2]}}))}))},e.prototype.Hl=function(t){return Vi(this.persistence,new Ui,t.Jl,this.Qt)},e.prototype.zl=function(t){var e=this.persistence.Ti.lr;return new _i(e,t._s)},e.prototype.jl=function(t){var e=Ni(t.yu.t,t.yu.persistenceKey),n=void 0!==this.cacheSizeBytes?ni.Ys(this.cacheSizeBytes):ni.ti;return new ji(this.synchronizeTabs,e,t.clientId,n,t._s,Co(),Mo(),this.Qt,this.Vl,!!this.forceOwnership)},e.prototype.Wl=function(t){return new xo},e}(os),ss=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n,!1)||this).Yl=e,r.cacheSizeBytes=n,r.synchronizeTabs=!0,r}return Object(a.c)(e,t),e.prototype.initialize=function(e){return Object(a.b)(this,void 0,void 0,(function(){var n,r=this;return Object(a.d)(this,(function(i){switch(i.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return i.sent(),n=this.Yl._a,this.Vl instanceof wo?(this.Vl._a={eu:Ka.bind(null,n),nu:ts.bind(null,n),su:es.bind(null,n),Uo:$a.bind(null,n),tu:Xa.bind(null,n)},[4,this.Vl.start()]):[3,3];case 2:i.sent(),i.label=3;case 3:return[4,this.persistence.Ro((function(t){return Object(a.b)(r,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return[4,Qa(this.Yl._a,t)];case 1:return e.sent(),this.Gl&&(t&&!this.Gl.Er?this.Gl.start(this.bh):t||this.Gl.stop()),[2]}}))}))}))];case 4:return i.sent(),[2]}}))}))},e.prototype.Wl=function(t){var e=Co();if(!wo.Kn(e))throw new S(E.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=Ni(t.yu.t,t.yu.persistenceKey);return new wo(e,t._s,n,t.clientId,t.Jl)},e}(as),us=function(){function t(){}return t.prototype.initialize=function(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n=this;return Object(a.d)(this,(function(r){switch(r.label){case 0:return this.bh?[3,2]:(this.bh=t.bh,this.Vl=t.Vl,this.Sh=this.Xl(e),this.yl=this.Zl(e),this.gl=this.t_(e),this._a=this.e_(e,!t.synchronizeTabs),this.Vl.fa=function(t){return ja(n._a,t,1)},this.yl.Dh.n_=Wa.bind(null,this._a),[4,aa(this.yl,this._a.Ml)]);case 1:r.sent(),r.label=2;case 2:return[2]}}
2))}))},t.prototype.t_=function(t){return new la},t.prototype.Xl=function(t){var e,n=Ao(t.yu.t),r=(e=t.yu,new ko(e));return function(t,e,n){return new No(t,e,n)}(t.credentials,r,n)},t.prototype.Zl=function(t){var e,n,r,i,o,a=this;return e=this.bh,n=this.Sh,r=t._s,i=function(t){return ja(a._a,t,0)},o=Eo.Kn()?new Eo:new To,new Do(e,n,r,i,o)},t.prototype.e_=function(t,e){return function(t,e,n,r,i,o,a){var s=new Oa(t,e,n,r,i,o);return a&&(s.kl=!0),s}(this.bh,this.yl,this.gl,this.Vl,t.Jl,t.pl,e)},t.prototype.terminate=function(){return function(t){return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return e=g(t),h("RemoteStore","RemoteStore shutting down."),e.Nh.add(5),[4,Uo(e)];case 1:return n.sent(),e.Fh.ko(),e.Oh.set("Unknown"),[2]}}))}))}(this.yl)},t}();function cs(t,e){void 0===e&&(e=10240);var n=0;return{read:function(){return Object(a.b)(this,void 0,void 0,(function(){var r;return Object(a.d)(this,(function(i){return n<t.byteLength?(r={value:t.slice(n,n+e),done:!1},[2,(n+=e,r)]):[2,{done:!0}]}))}))},cancel:function(){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(t){return[2]}))}))},releaseLock:function(){},closed:Promise.reject("unimplemented")}}var ls=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.s_(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.s_(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.i_=function(){this.muted=!0},t.prototype.s_=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),hs=function(){function t(t,e){var n=this;this.r_=t,this.Qt=e,this.metadata=new Jn,this.buffer=new Uint8Array,this.o_=new TextDecoder("utf-8"),this.c_().then((function(t){t&&t.sl()?n.metadata.resolve(t.payload.metadata):n.metadata.reject(new Error("The first element of the bundle is not a metadata, it is\n "+JSON.stringify(null==t?void 0:t.payload)))}),(function(t){return n.metadata.reject(t)}))}return t.prototype.close=function(){return this.r_.cancel()},t.prototype.getMetadata=function(){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(t){return[2,this.metadata.promise]}))}))},t.prototype.Ql=function(){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(t){switch(t.label){case 0:return[4,this.getMetadata()];case 1:return[2,(t.sent(),this.c_())]}}))}))},t.prototype.c_=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e,n,r;return Object(a.d)(this,(function(i){switch(i.label){case 0:return[4,this.a_()];case 1:return null===(t=i.sent())?[2,null]:(e=this.o_.decode(t),n=Number(e),isNaN(n)&&this.u_("length string ("+e+") is not valid number"),[4,this.h_(n)]);case 2:return r=i.sent(),[2,new ga(JSON.parse(r),t.length+n)]}}))}))},t.prototype.l_=function(){return this.buffer.findIndex((function(t){return t==="{".charCodeAt(0)}))},t.prototype.a_=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return this.l_()<0?[4,this.__()]:[3,3];case 1:if(n.sent())return[3,3];n.label=2;case 2:return[3,0];case 3:return 0===this.buffer.length?[2,null]:((t=this.l_())<0&&this.u_("Reached the end of bundle when a length string is expected."),e=this.buffer.slice(0,t),[2,(this.buffer=this.buffer.slice(t),e)])}}))}))},t.prototype.h_=function(t){return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return this.buffer.length<t?[4,this.__()]:[3,3];case 1:n.sent()&&this.u_("Reached the end of bundle when more is expected."),n.label=2;case 2:return[3,0];case 3:return e=this.o_.decode(this.buffer.slice(0,t)),[2,(this.buffer=this.buffer.slice(t),e)]}}))}))},t.prototype.u_=function(t){throw this.r_.cancel(),new Error("Invalid bundle format: "+t)},t.prototype.__=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return[4,this.r_.read()];
2case 1:return(t=n.sent()).done||((e=new Uint8Array(this.buffer.length+t.value.length)).set(this.buffer),e.set(t.value,this.buffer.length),this.buffer=e),[2,t.done]}}))}))},t}(),fs=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0;n<t.length;++n)if(0===t[n].length)throw new S(E.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this.f_=new U(t)}return t.prototype.isEqual=function(t){return this.f_.isEqual(t.f_)},t}(),ds=function(t){this._methodName=t},ps=function(t){this.d_=t};function vs(t,e,n){if(!n)throw new S(E.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function ms(t,e){if(void 0===e)return{merge:!1};if(void 0!==e.mergeFields&&void 0!==e.merge)throw new S(E.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function gs(t,e,n,r){if(!0===e&&!0===r)throw new S(E.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function ys(t){if(!B.wt
2(t))throw new S(E.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function bs(t){if(B.wt(t))throw new S(E.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function _s(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":v()}function ws(t,e){if("_delegate"in t&&(t=t.d_),!(t instanceof e)){if(e.name===t.constructor.name)throw new S(E.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=_s(t);throw new S(E.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function xs(t,e){if(e<=0)throw new S(E.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")}var Ts=function(){function t(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new S(E.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new S(E.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,g
2s("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties},t}(),Es=new Map,Ss=function(){function t(t,e){this.w_="(lite)",this.E_=new Ts({}),this.T_=!1,t instanceof u?(this.I_=t,this.m_=new M):(this.A_=t,this.I_=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new S(E.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new u(t.options.projectId)}(t),this.m_=new A(e))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this.A_)throw new S(E.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.A_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"R_",{get:function(){return this.T_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"P_",{get:function(){return void 0!==this.y_},enumerable:!1,configurable:!0}),t.prototype.g_=function(t){if(this.T_)throw new S(E.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this.E_=new Ts(t),void 0!==t.credentials&&(this.m_=function(t){if(!t)return new M;switch(t.type){case"gapi":var e=t.client;return m(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new j(e,t.sessionIndex||"0");case"provider":return t.client;default:throw new S(E.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))},t.prototype.V_=function(){return this.E_},t.prototype.p_=function(){return this.T_=!0,this.E_},t.prototype._delete=function(){return this.y_||(this.y_=this.b_()),this.y_},t.prototype.toJSON=function(){return{app:this.A_,t:this.I_,settings:this.E_}},t.prototype.b_=function(){return this,(t=Es.get(this))&&(h("ComponentProvider","Removing Datastore"),Es.delete(this),t.terminate()),Promise.resolve();var t},t}(),Os=function(){function t(t,e,n){this.v_=e,this.S_=n,this.type="document",this.firestore=t}return Object.defineProperty(t.prototype,"D_",{get:function(){return this.S_.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.S_.path.tt()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this.S_.path.rt()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new Cs(this.firestore,this.v_,this.S_.path.X())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this.S_)},t}(),ks=function(){function t(t,e,n){this.v_=e,this.C_=n,this.type="query",this.firestore=t}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this.C_)},t}(),Cs=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,Ht(r))||this).firestore=e,i.D_=r,i.type="collection",i}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.C_.path.tt()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.C_.path.rt()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this.D_.X();return t.et()?null:new Os(this.firestore,null,new B(t))},enumerable:!1,configurable:!0}),e.prototype.withConverter=function(t){return new e(this.firestore,t,this.D_)},e}(ks);function Ms(t,e){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t instanceof ps&&(t=t.d_),vs("collection","path",e),t instanceof Ss)return bs(n=D.ot.apply(D,Object(a.f)([e],r))),new Cs(t,null,n);if(!(t instanceof Os||t instanceof Cs))throw new S(E.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return bs(n=D.ot.apply(D,Object(a.f)([t.path],r)).child(D.ot(e))),new Cs(t.firestore,
2null,n)}function As(t,e){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t instanceof ps&&(t=t.d_),1===arguments.length&&(e=b.u()),vs("doc","path",e),t instanceof Ss)return ys(n=D.ot.apply(D,Object(a.f)([e],r))),new Os(t,null,new B(n));if(!(t instanceof Os||t instanceof Cs))throw new S(E.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return ys(n=t.D_.child(D.ot.apply(D,Object(a.f)([e],r)))),new Os(t.firestore,t instanceof Cs?t.v_:null,new B(n))}function Is(t,e){return t instanceof ps&&(t=t.d_),e instanceof ps&&(e=e.d_),(t instanceof Os||t instanceof Cs)&&(e instanceof Os||e instanceof Cs)&&t.firestore===e.firestore&&t.path===e.path&&t.v_===e.v_}function js(t,e){return t instanceof ps&&(t=t.d_),e instanceof ps&&(e=e.d_),t instanceof ks&&e instanceof ks&&t.firestore===e.firestore&&Zt(t.C_,e.C_)&&t.v_===e.v_}var Ps=function(){function t(t,e){if(!isFinite(t)||t<-90||t>90)throw new S(E.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new S(E.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this.x_=t,this.N_=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this.x_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this.N_},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.x_===t.x_&&this.N_===t.N_},t.prototype.toJSON=function(){return{latitude:this.x_,longitude:this.N_}},t.prototype.U=function(t){return _(this.x_,t.x_)||_(this.N_,t.N_)},t}(),Rs=/^__.*__$/,Ns=function(){function t(t,e,n){this.data=t,this.Gt=e,this.fieldTransforms=n}return t.prototype.F_=function(t,e){return null!==this.Gt?new Ie(t,this.data,this.Gt,e,this.fieldTransforms):new Ae(t,this.data,e,this.fieldTransforms)},t}(),Ls=function(){function t(t,e,n){this.data=t,this.Gt=e,this.fieldTransforms=n}return t.prototype.F_=function(t,e){return new Ie(t,this.data,this.Gt,e,this.fieldTransforms)},t}();function Ds(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw v()}}var Fs=function(){function t(t,e,n,r,i,o){this.settings=t,this.t=e,this.Qt=n,this.ignoreUndefinedProperties=r,void 0===i&&this.O_(),this.fieldTransforms=i||[],this.Gt=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"k_",{get:function(){return this.settings.k_},enumerable:!1,configurable:!0}),t.prototype.M_=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.t,this.Qt,this.ignoreUndefinedProperties,this.fieldTransforms,this.Gt)},t.prototype.L_=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.M_({path:n,B_:!1});return r.q_(t),r},t.prototype.U_=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.M_({path:n,B_:!1});return r.O_(),r},t.prototype.Q_=function(t){return this.M_({path:void 0,B_:!0})},t.prototype.K_=function(t){return iu(t,this.settings.methodName,this.settings.W_||!1,this.path,this.settings.j_)},t.prototype.contains=function(t){return void 0!==this.Gt.find((function(e){return t.nt(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.nt(e.field)}))},t.prototype.O_=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.q_(this.path.get(t))},t.prototype.q_=function(t){if(0===t.length)throw this.K_("Document fields must not be empty");if(Ds(this.k_)&&Rs.test(t))throw this.K_('Document fields cannot begin and end with "__"')},t}(),Us=function(){function t(t,e,n){this.t=t,this.ignoreUndefinedProperties=e,this.Qt=n||Ao(t)}return t.prototype.G_=function(t,e,n,r){return void 0===r&&(r=!1),new Fs({k_:t,methodName:e,j_:n,path:U.ct(),B_:!1,W_:r},this.t,this.Qt,this.ignoreUndefinedProperties)},t}();function Bs(t){var e=t.p_(),n=Ao(t.I_);return new Us(t.I_,!!e.ignoreUndefinedProperties,n)}function Vs(t,e,n,r,i,o){void 0===o&&(o={});var a=t.G_(o.merge||o.mergeFields?2:0,e,n,i);tu("Data must be an object, but it was:",a,r);var s,u,c=Zs(r,a);if(o.merge)s=new q(a.Gt),u=a.fieldTransforms;else if(o.mergeFields){for(var l=[],h=0,f=o.mergeFields;h<f.length;h++){var d=eu(e,f[h],n);if(!a.contains(d))throw new S(E.INVALID_ARGUMENT,"Field '"+d+"' is specified in your field mask but missing from your input data.");ou(l,d)||l.push(d)}s=new q(l),u=a.fieldTransforms.filter((function(t){return s.Tt(t.field)}))}else s=null,u=a.fieldTransforms;return new Ns(new pt(c),s,u)}var zs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.z_=function(t){if(2!==t.k_)throw 1===t.k_?t.K_(this._methodName+"() can only appear at the top level of your update data"):t.K_(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return t.Gt.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(ds);function Hs(t,e,n){return new Fs({k_:3,j_:e.settings.j_,methodName:t._methodName,B_:n},e.t,e.Qt,e.ignoreUndefinedProperties)}var qs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.z_=function(t){return new _e(t.path,new fe)},e.prototype.isEqual=function(t){return t instanceof e},e}(ds),Ws=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).H_=n,r}return Object(a.c)(e,t),e.prototype.z_=function(t){var e=Hs(this,t,!0),n=this.H_.map((function(t){return Js(t,e)})),r=new de(n);return new _e(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(ds),Gs=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).H_=n,r}return Object(a.c)(e,t),e.prototype.z_=function(t){var e=Hs(this,t,!0),n=this.H_.map((function(t){return Js(t,e)})),r=new ve(n);return new _e(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(ds),Ys=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).J_=n,r}return Object(a.c)(e,t),e.prototype.z_=function(t){var e=new ge(t.Qt,se(t.Qt,this.J_));return new _e(t.path,e)},e.prototype.isEqual=function(t){return this===t},e}(ds);function Xs(t,e,n,r){var i=t.G_(1,e,n);tu("Data must be an object, but it was:",i,r);var o=[],a=new vt;z(r,(function(t,r){var s=ru(e,t,n);r instanceof ps&&(r=r.d_);var u=i.U_(s);if(r instanceof zs)o.push(s);else{var c=Js(r,u);null!=c&&(o.push(s),a.set(s,c))}}));var s=new q(o);return new Ls(a.Pt(),s,i.fieldTransforms)}function Ks(t,e,n,r,i,o){var a=t.G_(1,e,n),s=[eu(e,r,n)],u=[i];if(o.length%2!=0)throw new S(E.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var c=0;c<o.length;c+=2)s.push(eu(e,o[c])),u.push(o[c+1]);for(var l=[],h=new vt,f=s.length-1;f>=0;--f)if(!ou(l,s[f])){var d=s[f],p=u[f];p instanceof ps&&(p=p.d_);var v=a.U_(d);if(p instanceof zs)l.push(d);else{var m=Js(p,v);null!=m&&(l.push(d),h.set(d,m))}}var g=new q(l);return new Ls(h.Pt(),g,a.fieldTransforms)}function Qs(t,e,n,r){return void 0===r&&(r=!1),Js(n,t.G_(r?4:3,e))}function Js(t,e){if(t instanceof ps&&(t=t.d_),$s(t))return tu("Unsupported field value:",e,t),Zs(t,e);if(t instanceof ds)return function(t,e){if(!Ds(e.k_))throw e.K_(t._methodName+"() can only be used with update(
2) and set()");if(!e.path)throw e.K_(t._methodName+"() is not currently supported inside arrays");var n=t.z_(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.Gt.push(e.path),t instanceof Array){if(e.settings.B_&&4!==e.k_)throw e.K_("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var a=Js(o[i],e.Q_(r));null==a&&(a={nullValue:"NULL_VALUE"}),n.push(a),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(t instanceof ps&&(t=t.d_),null===t)return{nullValue:"NULL_VALUE"};if("number"==typeof t)return se(e.Qt,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=R.fromDate(t);return{timestampValue:wn(e.Qt,n)}}if(t instanceof R)return n=new R(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)),{timestampValue:wn(e.Qt,n)};if(t instanceof Ps)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof O)return{bytesValue:xn(e.Qt,t.I)};if(t instanceof Os){n=e.t;var r=t.firestore.I_;if(!r.isEqual(n))throw e.K_("Document reference is for database "+r.projectId+"/"+r.database+" but should be for database "+n.projectId+"/"+n.database);return{referenceValue:Sn(t.firestore.I_||e.t,t.S_.path)}}throw e.K_("Unsupported field value: "+_s(t))}(t,e)}function Zs(t,e){var n={};return H(t)?e.path&&e.path.length>0&&e.Gt.push(e.path):z(t,(function(t,r){var i=Js(r,e.L_(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function $s(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof R||t instanceof Ps||t instanceof O||t instanceof Os||t instanceof ds)}function tu(t,e,n){if(!$s(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){var r=_s(n);throw"an object"===r?e.K_(t+" a custom object"):e.K_(t+" "+r)}}function eu(t,e,n){if(e instanceof ps&&(e=e.d_),e instanceof fs)return e.f_;if("string"==typeof e)return ru(t,e);throw iu("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}var nu=new RegExp("[~\\*/\\[\\]]");function ru(t,e,n){if(e.search(nu)>=0)throw iu("Invalid field path ("+e+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,n);try{return(new(fs.bind.apply(fs,Object(a.f)([void 0],e.split("."))))).f_}catch(r){throw iu("Invalid field path ("+e+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,n)}}function iu(t,e,n,r,i){var o=r&&!r.et(),a=void 0!==i,s="Function "+e+"() called with invalid data";n&&(s+=" (via `toFirestore()`)");var u="";return(o||a)&&(u+=" (found",o&&(u+=" in field "+r),a&&(u+=" in document "+i),u+=")"),new S(E.INVALID_ARGUMENT,(s+=". ")+t+u)}function ou(t,e){return t.some((function(t){return t.isEqual(e)}))}var au=function(){function t(t){this.Sh=t,this.Y_=new Map,this.mutations=[],this.X_=!1,this.Z_=null,this.tf=new Set}return t.prototype.ef=function(t){return Object(a.b)(this,void 0,void 0,(function(){var e,n=this;return Object(a.d)(this,(function(r){switch(r.label){case 0:if(this.nf(),this.mutations.length>0)throw new S(E.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i,o,s,u;return Object(a.d)(this,(function(a){switch(a.label){case 0:return n=g(t),r=In(n.Qt)+"/documents",i={documents:e.map((function(t){return kn(n.Qt,t)}))},[4,n.Du("BatchGetDocuments",r,i)];case 1:return o=a.sent(),s=new Map,o.forEach((function(t){var e=function(t,e){return"found"in e?function(t,e){m(!!e.found),e.found.name,e.found.updateTime;var n=Cn(t,e.found.name),r=En(e.found.updateTime),i=new pt({mapValue:{fields:e.found.fields}});return new yt(n,r,i,{})}(t,e):"missing"in e?function(t,e){m(!!e.missing),m(!!e.readTime);var n=Cn(t,e.missing),r=En(e.readTime);return new bt(n,r)}(t,e):v()}(n.Qt,t);s.set(e.key.toString(),e)})),u=[],[2,(e.forEach((function(t){var e=s.get(t.toString());m(!!e),u.push(e)})),u)]}}))}))}(this.Sh,t)];
2case 1:return[2,((e=r.sent()).forEach((function(t){t instanceof bt||t instanceof yt?n.sf(t):v()})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.F_(t,this.jt(t))),this.tf.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.F_(t,this.rf(t)))}catch(t){this.Z_=t}this.tf.add(t.toString())},t.prototype.delete=function(t){this.write(new Fe(t,this.jt(t))),this.tf.add(t.toString())},t.prototype.commit=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e=this;return Object(a.d)(this,(function(n){switch(n.label){case 0:if(this.nf(),this.Z_)throw this.Z_;return t=this.Y_,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=B._t(n);e.mutations.push(new Ue(r,e.jt(r)))})),[4,function(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:return n=g(t),r=In(n.Qt)+"/documents",i={writes:e.map((function(t){return Nn(n.Qt,t)}))},[4,n.pu("Commit",r,i)];case 1:return o.sent(),[2]}}))}))}(this.Sh,this.mutations)];case 1:return n.sent(),this.X_=!0,[2]}}))}))},t.prototype.sf=function(t){var e;if(t instanceof yt)e=t.version;else{if(!(t instanceof bt))throw v();e=N.min()}var n=this.Y_.get(t.key.toString());if(n){if(!e.isEqual(n))throw new S(E.ABORTED,"Document version changed between two reads.")}else this.Y_.set(t.key.toString(),e)},t.prototype.jt=function(t){var e=this.Y_.get(t.toString());return!this.tf.has(t.toString())&&e?xe.updateTime(e):xe.Kt()},t.prototype.rf=function(t){var e=this.Y_.get(t.toString());if(!this.tf.has(t.toString())&&e){if(e.isEqual(N.min()))throw new S(E.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return xe.updateTime(e)}return xe.exists(!0)},t.prototype.write=function(t){this.nf(),this.mutations.push(t)},t.prototype.nf=function(){},t}(),su=function(){function t(t,e,n,r){this._s=t,this.Sh=e,this.updateFunction=n,this.Es=r,this.cf=5,this.Gu=new Io(this._s,"transaction_retry")}return t.prototype.run=function(){this.af()},t.prototype.af=function(){var t=this;this.Gu.Lu((function(){return Object(a.b)(t,void 0,void 0,(function(){var t,e,n=this;return Object(a.d)(this,(function(r){return t=new au(this.Sh),(e=this.uf(t))&&e.then((function(e){n._s.Ps((function(){return t.commit().then((function(){n.Es.resolve(e)})).catch((function(t){n.hf(t)}))}))})).catch((function(t){n.hf(t)})),[2]}))}))}))},t.prototype.uf=function(t){try{var e=this.updateFunction(t);return!Z(e)&&e.catch&&e.then?e:(this.Es.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.Es.reject(t),null}},t.prototype.hf=function(t){var e=this;this.cf>0&&this.lf(t)?(this.cf-=1,this._s.Ps((function(){return e.af(),Promise.resolve()}))):this.Es.reject(t)},t.prototype.lf=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!Ve(e)}return!1},t}(),uu=function(){function t(t,e,n){var r=this;this.credentials=t,this._s=e,this.yu=n,this.user=k.UNAUTHENTICATED,this.clientId=b.u(),this._f=function(){},this.C=new Jn,this.credentials.v((function(t){h("FirestoreClient","Received user=",t.uid),r.user=t,r._f(t),r.C.resolve()}))}return t.prototype.getConfiguration=function(){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(t){switch(t.label){case 0:return[4,this.C.promise];case 1:return[2,(t.sent(),{_s:this._s,yu:this.yu,clientId:this.clientId,credentials:this.credentials,Jl:this.user,pl:100})]}}))}))},t.prototype.ff=function(t){var e=this;this._f=t,this.C.promise.then((function(){return e._f(e.user)}))},t.prototype.df=function(){if(this._s.wf)throw new S(E.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var t=this;this._s.Ef();var e=new Jn;return this._s.Tf((function(){return Object(a.b)(t,void 0,void 0,(function(){var t,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.If?[4,this.If.terminate()]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.mf?[4,this.mf.terminate()]:[3,4];case 3:r.sent(),r.label=4;case 4:return this.credentials.S(),e.resolve(),[3,6];case 5:return t=r.sent(),n=cr(t,"Failed to shutdown persistence"),e.reject(n),[3,6];case 6:return[2]}}
2))}))})),e.promise},t}();function cu(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r,i=this;return Object(a.d)(this,(function(o){switch(o.label){case 0:return t._s.Af(),h("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return n=o.sent(),[4,e.initialize(n)];case 2:return o.sent(),r=n.Jl,t.ff((function(n){r.isEqual(n)||(r=n,t._s.po((function(){return Object(a.b)(i,void 0,void 0,(function(){return Object(a.d)(this,(function(t){switch(t.label){case 0:return[4,zi(e.bh,n)];case 1:return t.sent(),[2]}}))}))})))})),e.persistence.Po((function(){return t.terminate()})),t.mf=e,[2]}}))}))}function lu(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r;return Object(a.d)(this,(function(i){switch(i.label){case 0:return t._s.Af(),[4,hu(t)];case 1:return n=i.sent(),h("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return r=i.sent(),[4,e.initialize(n,r)];case 3:return i.sent(),t.ff((function(n){return t._s.po((function(){return function(t,e){return Object(a.b)(this,void 0,void 0,(function(){var n,r;return Object(a.d)(this,(function(i){switch(i.label){case 0:return(n=g(t))._s.Af(),h("RemoteStore","RemoteStore received new credentials"),r=Go(n),n.Nh.add(3),[4,Uo(n)];case 1:return i.sent(),r&&n.Oh.set("Unknown"),[4,n.Dh.n_(e)];case 2:return i.sent(),n.Nh.delete(3),[4,Fo(n)];case 3:return i.sent(),[2]}}))}))}(e.yl,n)}))})),t.If=e,[2]}}))}))}function hu(t){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return t.mf?[3,2]:(h("FirestoreClient","Using default OfflineComponentProvider"),[4,cu(t,new os)]);case 1:e.sent(),e.label=2;case 2:return[2,t.mf]}}))}))}function fu(t){return Object(a.b)(this,void 0,void 0,(function(){return Object(a.d)(this,(function(e){switch(e.label){case 0:return t.If?[3,2]:(h("FirestoreClient","Using default OnlineComponentProvider"),[4,lu(t,new us)]);case 1:e.sent(),e.label=2;case 2:return[2,t.If]}}))}))}function du(t){return hu(t).then((function(t){return t.persistence}))}function pu(t){return hu(t).then((function(t){return t.bh}))}function vu(t){return fu(t).then((function(t){return t.yl}))}function mu(t){return fu(t).then((function(t){return t._a}))}function gu(t){return Object(a.b)(this,void 0,void 0,(function(){var e,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return[4,fu(t)];case 1:return e=r.sent(),[2,((n=e.gl).jh=ka.bind(null,e._a),n.Hh=Ma.bind(null,e._a),n)]}}))}))}function yu(t,e,n){var r=this;void 0===n&&(n={});var i=new Jn;return t._s.Ps((function(){return Object(a.b)(r,void 0,void 0,(function(){var r;return Object(a.d)(this,(function(o){switch(o.label){case 0:return r=function(t,e,n,r,i){var o=new ls({next:function(o){e.Ps((function(){return fa(t,a)}));var s=o.docs.has(n);!s&&o.fromCache?i.reject(new S(E.UNAVAILABLE,"Failed to get document because the client is offline.")):s&&o.fromCache&&r&&"server"===r.source?i.reject(new S(E.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(o)},error:function(t){return i.reject(t)}}),a=new ma(Ht(n.path),o,{includeMetadataChanges:!0,nl:!0});return ha(t,a)},[4,gu(t)];case 1:return[2,r.apply(void 0,[o.sent(),t._s,e,n,i])]}}))}))})),i.promise}function bu(t,e,n){var r=this;void 0===n&&(n={});var i=new Jn;return t._s.Ps((function(){return Object(a.b)(r,void 0,void 0,(function(){var r;return Object(a.d)(this,(function(o){switch(o.label){case 0:return r=function(t,e,n,r,i){var o=new ls({next:function(n){e.Ps((function(){return fa(t,a)})),n.fromCache&&"server"===r.source?i.reject(new S(E.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:function(t){return i.reject(t)}}),a=new ma(n,o,{includeMetadataChanges:!0,nl:!0});return ha(t,a)},[4,gu(t)];case 1:return[2,r.apply(void 0,[o.sent(),t._s,e,n,i])]}}))}))})),i.promise}var _u=function(){function t(){var t=this;this.Rf=Promise.resolve(),this.Pf=[],this.yf=!1,this.gf=[],this.Vf=null,this.pf=!1,this.bf=[],this.Gu=new Io(this,"async_queue_retry"),this.vf=function(){var e=Mo();e&&h("AsyncQueue","Visibility state changed to "+e.visibilityState),t.Gu.qu()};var e=Mo();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.vf)}return Object.defineProperty(t.prototype,"wf",{get:function(){return this.yf}
2,enumerable:!1,configurable:!0}),t.prototype.Ps=function(t){this.enqueue(t)},t.prototype.Tf=function(t){this.Sf(),this.Df(t)},t.prototype.Ef=function(){if(!this.yf){this.yf=!0;var t=Mo();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.vf)}},t.prototype.enqueue=function(t){return this.Sf(),this.yf?new Promise((function(t){})):this.Df(t)},t.prototype.po=function(t){var e=this;this.Ps((function(){return e.Pf.push(t),e.Cf()}))},t.prototype.Cf=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,e=this;return Object(a.d)(this,(function(n){switch(n.label){case 0:if(0===this.Pf.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.Pf[0]()];case 2:return n.sent(),this.Pf.shift(),this.Gu.reset(),[3,4];case 3:if(!rr(t=n.sent()))throw t;return h("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.Pf.length>0&&this.Gu.Lu((function(){return e.Cf()})),n.label=5;case 5:return[2]}}))}))},t.prototype.Df=function(t){var e=this,n=this.Rf.then((function(){return e.pf=!0,t().catch((function(t){throw e.Vf=t,e.pf=!1,f("INTERNAL UNHANDLED ERROR: ",function(t){var e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t)),t})).then((function(t){return e.pf=!1,t}))}));return this.Rf=n,n},t.prototype.Tr=function(t,e,n){var r=this;this.Sf(),this.bf.indexOf(t)>-1&&(e=0);var i=ur.Ts(this,t,e,n,(function(t){return r.xf(t)}));return this.gf.push(i),i},t.prototype.Sf=function(){this.Vf&&v()},t.prototype.Af=function(){},t.prototype.Nf=function(){return Object(a.b)(this,void 0,void 0,(function(){var t;return Object(a.d)(this,(function(e){switch(e.label){case 0:return[4,t=this.Rf];case 1:e.sent(),e.label=2;case 2:if(t!==this.Rf)return[3,0];e.label=3;case 3:return[2]}}
2))}))},t.prototype.$f=function(t){for(var e=0,n=this.gf;e<n.length;e++)if(n[e].fs===t)return!0;return!1},t.prototype.Ff=function(t){var e=this;return this.Nf().then((function(){e.gf.sort((function(t,e){return t.ds-e.ds}));for(var n=0,r=e.gf;n<r.length;n++){var i=r[n];if(i.Rs(),"all"!==t&&i.fs===t)break}return e.Nf()}))},t.prototype.Of=function(t){this.bf.push(t)},t.prototype.xf=function(t){var e=this.gf.indexOf(t);this.gf.splice(e,1)},t}();function wu(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}var xu=function(){function t(){this.kf={},this.Mf=new Jn,this.Lf={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}return t.prototype.onProgress=function(t,e,n){this.kf={next:t,error:e,complete:n}},t.prototype.catch=function(t){return this.Mf.promise.catch(t)},t.prototype.then=function(t,e){return this.Mf.promise.then(t,e)},t.prototype.ql=function(t){this.Ul(t),this.kf.complete&&this.kf.complete(),this.Mf.resolve(t)},t.prototype.Kl=function(t){this.Lf.taskState="Error",this.kf.next&&this.kf.next(this.Lf),this.kf.error&&this.kf.error(t),this.Mf.reject(t)},t.prototype.Ul=function(t){this.Lf=t,this.kf.next&&this.kf.next(t)},t}(),Tu=-1,Eu=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).Bf=new _u,r.w_="name"in e?e.name:"[DEFAULT]",r}return Object(a.c)(e,t),e.prototype.b_=function(){return this.qf||Ou(this),this.qf.terminate()},e}(Ss);function Su(t){return t.qf||Ou(t),t.qf.df(),t.qf}function Ou(t){var e=t.p_(),n=function(t,e,n){return new s(t,e,n.host,n.ssl,n.experimentalForceLongPolling,n.experimentalAutoDetectLongPolling)}(t.I_,t.w_,e);t.qf=new uu(t.m_,t.Bf,n)}function ku(t,e,n){var r=this,i=new Jn;return t._s.enqueue((function(){return Object(a.b)(r,void 0,void 0,(function(){var r;return Object(a.d)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,cu(t,n)];case 1:return o.sent(),[4,lu(t,e)];case 2:return o.sent(),i.resolve(),[3,4];case 3:if(!function(t){return"FirebaseError"===t.name?t.code===E.FAILED_PRECONDITION||t.code===E.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(r=o.sent()))throw r;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+r),i.reject(r),[3,4];case 4:return[2]}}
2))}))})).then((function(){return i.promise}))}function Cu(t){if(t.R_||t.P_)throw new S(E.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")}var Mu=function(){function t(){}return t.prototype.Uf=function(t,e){switch(void 0===e&&(e="none"),et(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Y(t.integerValue||t.doubleValue);case 3:return this.Qf(t.timestampValue);case 4:return this.Kf(t,e);case 5:return t.stringValue;case 6:return this.Wf(X(t.bytesValue));case 7:return this.jf(t.referenceValue);case 8:return this.Gf(t.geoPointValue);case 9:return this.zf(t.arrayValue,e);case 10:return this.Hf(t.mapValue,e);default:throw v()}},t.prototype.Hf=function(t,e){var n=this,r={};return z(t.fields||{},(function(t,i){r[t]=n.Uf(i,e)})),r},t.prototype.Gf=function(t){return new Ps(Y(t.latitude),Y(t.longitude))},t.prototype.zf=function(t,e){var n=this;return(t.values||[]).map((function(t){return n.Uf(t,e)}))},t.prototype.Kf=function(t,e){switch(e){case"previous":var n=Q(t);return null==n?null:this.Uf(n,e);case"estimate":return this.Qf(J(t));default:return null}},t.prototype.Qf=function(t){var e=G(t);return new R(e.seconds,e.nanos)},t.prototype.Jf=function(t,e){var n=D.ot(t);m(Qn(n));var r=new u(n.get(1),n.get(3)),i=new B(n.Y(5));return r.isEqual(e)||f("Document "+i+" contains a document reference within a different database ("+r.projectId+"/"+r.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),i},t}(),Au=function(){function t(t,e,n,r,i){this.Yf=t,this.Xf=e,this.S_=n,this.Zf=r,this.v_=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this.S_.path.tt()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Os(this.Yf,this.v_,this.S_)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return null!==this.Zf},t.prototype.data=function(){if(this.Zf){if(this.v_){var t=new Iu(this.Yf,this.Xf,this.S_,this.Zf,null);return this.v_.fromFirestore(t)}return this.Xf.Uf(this.Zf.bt())}},t.prototype.get=function(t){if(this.Zf){var e=this.Zf.data().field(ju("DocumentSnapshot.get",t));if(null!==e)return this.Xf.Uf(e)}},t}(),Iu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.data=function(){return t.prototype.data.call(this)},e}(Au);function ju(t,e){return"string"==typeof e?ru(t,e):e instanceof ps?e.d_.f_:e.f_}function Pu(t){if(Wt(t)&&0===t.xt.length)throw new S(E.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Ru=function(){};function Nu(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];t=o.td(t)}return t}var Lu=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).ed=e,i.nd=n,i.sd=r,i.type="where",i}return Object(a.c)(e,t),e.prototype.td=function(t){var e=Bs(t.firestore),n=function(t,e,n,r,i,o,a){var s;if(i.ut()){if("array-contains"===o||"array-contains-any"===o)throw new S(E.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){Hu(a,o);for(var u=[],c=0,l=a;c<l.length;c++){var h=l[c];u.push(zu(r,t,h))}s={arrayValue:{values:u}}}else s=zu(r,t,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||Hu(a,o),s=Qs(n,"where",a,"in"===o||"not-in"===o);var f=Ot.create(i,o,s);return function(t,e){if(e.Ct()){var n=Yt(t);if(null!==n&&!n.isEqual(e.field))throw new S(E.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");var r=Gt(t);null!==r&&qu(t,e.field,r)}var i=function(t,e){for(var n=0,r=t.filters;n<r.length;n++){var i=r[n];if(e.indexOf(i.op)>=0)return i.op}return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","
2not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==i)throw i===e.op?new S(E.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter."):new S(E.INVALID_ARGUMENT,"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,f),f}(t.C_,0,e,t.firestore.I_,this.ed,this.nd,this.sd);return new ks(t.firestore,t.v_,function(t,e){var n=t.filters.concat([e]);return new Vt(t.path,t.collectionGroup,t.xt.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t.C_,n))},e}(Ru),Du=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).ed=e,r.rd=n,r.type="orderBy",r}return Object(a.c)(e,t),e.prototype.td=function(t){var e=function(t,e,n){if(null!==t.startAt)throw new S(E.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new S(E.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Dt(e,n);return function(t,e){if(null===Gt(t)){var n=Yt(t);null!==n&&qu(t,n,e.field)}}(t,r),r}(t.C_,this.ed,this.rd);return new ks(t.firestore,t.v_,function(t,e){var n=t.xt.concat([e]);return new Vt(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t.C_,e))},e}(Ru),Fu=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.od=n,i.ad=r,i}return Object(a.c)(e,t),e.prototype.td=function(t){return new ks(t.firestore,t.v_,Jt(t.C_,this.od,this.ad))},e}(Ru),Uu=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.ud=n,i.hd=r,i}return Object(a.c)(e,t),e.prototype.td=function(t){var e=Vu(t,this.type,this.ud,this.hd);return new ks(t.firestore,t.v_,function(t,e){return new Vt(t.path,t.collectionGroup,t.xt.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t.C_,e))},e}(Ru),Bu=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.ud=n,i.hd=r,i}return Object(a.c)(e,t),e.prototype.td=function(t){var e=Vu(t,this.type,this.ud,this.hd);return new ks(t.firestore,t.v_,function(t,e){return new Vt(t.path,t.collectionGroup,t.xt.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t.C_,e))},e}(Ru);function Vu(t,e,n,r){if(n[0]instanceof ps&&(n[0]=n[0].d_),n[0]instanceof Au)return function(t,e,n,r,i){if(!r)throw new S(E.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],a=0,s=Kt(t);a<s.length;a++){var u=s[a];if(u.field.ut())o.push(ut(e,r.key));else{var c=r.field(u.field);if(K(c))throw new S(E.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+u.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===c){var l=u.field.rt();throw new S(E.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+l+"' (used as the orderBy) does not exist.")}o.push(c)}}return new Nt(o,i)}(t.C_,t.firestore.I_,e,n[0].Zf,r);var i=Bs(t.firestore);return function(t,e,n,r,i,o){var a=t.xt;if(i.length>a.length)throw new S(E.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var s=[],u=0;u<i.length;u++){var c=i[u];if(a[u].field.ut()){if("string"!=typeof c)throw new S(E.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof c);if(!Xt(t)&&-1!==c.indexOf("/"))throw new S(E.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+c+"' contains a slash.");var l=t.path.child(D.ot(c));
2if(!B.wt(l))throw new S(E.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+l+"' is not because it contains an odd number of segments.");var h=new B(l);s.push(ut(e,h))}else{var f=Qs(n,r,c);s.push(f)}}return new Nt(s,o)}(t.C_,t.firestore.I_,i,e,n,r)}function zu(t,e,n){if(n instanceof ps&&(n=n.d_),"string"==typeof n){if(""===n)throw new S(E.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!Xt(e)&&-1!==n.indexOf("/"))throw new S(E.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=e.path.child(D.ot(n));if(!B.wt(r))throw new S(E.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return ut(t,new B(r))}if(n instanceof Os)return ut(t,n.S_);throw new S(E.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+_s(n)+".")}function Hu(t,e){if(!Array.isArray(t)||0===t.length)throw new S(E.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new S(E.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function qu(t,e,n){if(!n.isEqual(e))throw new S(E.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}function Wu(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var Gu=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return Object(a.c)(e,t),e.prototype.Wf=function(t){return new O(t)},e.prototype.jf=function(t){var e=this.Jf(t,this.firestore.I_);return new Os(this.firestore,null,e)},e}(Mu),Yu=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),Xu=function(t){function e(e,n,r,i,o,a){var s=this;return(s=t.call(this,e,n,r,i,a)||this).Yf=e,s.ld=e,s.metadata=o,s}return Object(a.c)(e,t),e.prototype.exists=function(){return t.prototype.exists.call(this)},e.prototype.data=function(t){if(void 0===t&&(t={}),this.Zf){if(this.v_){var e=new Ku(this.Yf,this.Xf,this.S_,this.Zf,this.metadata,null);return this.v_.fromFirestore(e,t)}return this.Xf.Uf(this.Zf.bt(),t.serverTimestamps)}},e.prototype.get=function(t,e){if(void 0===e&&(e={}),this.Zf){var n=this.Zf.data().field(ju("DocumentSnapshot.get",t));if(null!==n)return this.Xf.Uf(n,e.serverTimestamps)}},e}(Au),Ku=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.data=function(e){return void 0===e&&(e={}),t.prototype.data.call(this,e)},e}(Xu),Qu=function(){function t(t,e,n,r){this.Yf=t,this.Xf=e,this._d=r,this.metadata=new Yu(r.hasPendingWrites,r.fromCache),this.query=n}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._d.docs.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;this._d.docs.forEach((function(r){t.call(e,new Ku(n.Yf,n.Xf,r.key,r,new Yu(n._d.De.has(r.key),n._d.fromCache),n.query.v_))}))},t.prototype.docChanges=function(t){void 0===t&&(t={});var e=!!t.includeMetadataChanges;if(e&&this._d.xe)throw new S(E.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.fd&&this.dd===e||(this.fd=function(t,e){if(t._d.Se.et()){var n=0;return t._d.docChanges.map((function(e){var r=new Ku(t.Yf,t.Xf,e.doc.key,e.doc,new Yu(t._d.De.has(e.doc.key),t._d.fromCache),t.query.v_);return e.doc,{type:"added",doc:r,oldIndex:-1,newIndex:n++}}))}var r=t._d.Se;return t._d.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var n=new Ku(t.Yf,t.Xf,e.doc.key,e.doc,new Yu(t._d.De.has(e.doc.key),t._d.fromCache),t.query.v_),i=-1,o=-1;return 0!==e.type&&(i=r.indexOf(e.doc.key),r=r.delete(e.doc.key)),1!==e.type&&(o=(r=r.add(e.doc)).indexOf(e.doc.key)),{type:Ju(e.type),doc:n,oldIndex:i,newIndex:o}}))}(this,e),this.dd=e),this.fd},t}();function Ju(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return v()}}function Zu(t,e){return t instanceof Xu&&e instanceof Xu?t.Yf===e.Yf&&t.S_.isEqual(e.S_)&&(null===t.Zf?null===e.Zf:t.Zf.isEqual(e.Zf))&&t.v_===e.v_:t instanceof Qu&&e instanceof Qu&&t.Yf===e.Yf&&js(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._d.isEqual(e._d)}var $u=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return Object(a.c)(e,t),e.prototype.Wf=function(t){return new O(t)},e.prototype.jf=function(t){var e=this.Jf(t,this.firestore.I_);
2return new Os(this.firestore,null,e)},e}(Mu);function tc(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];t=ws(t,Os);var o=ws(t.firestore,Eu),a=Bs(o);return e instanceof ps&&(e=e.d_),nc(o,[("string"==typeof e||e instanceof fs?Ks(a,"updateDoc",t.S_,e,n,r):Xs(a,"updateDoc",t.S_,e)).F_(t.S_,xe.exists(!0))])}function ec(t){for(var e,n,r,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];t instanceof ps&&(t=t.d_);var s={includeMetadataChanges:!1},u=0;"object"!=typeof i[u]||wu(i[u])||(s=i[u],u++);var c,l,h,f={includeMetadataChanges:s.includeMetadataChanges};if(wu(i[u])){var d=i[u];i[u]=null===(e=d.next)||void 0===e?void 0:e.bind(d),i[u+1]=null===(n=d.error)||void 0===n?void 0:n.bind(d),i[u+2]=null===(r=d.complete)||void 0===r?void 0:r.bind(d)}if(t instanceof Os)l=ws(t.firestore,Eu),h=Ht(t.S_.path),c={next:function(e){i[u]&&i[u](rc(l,t,e))},error:i[u+1],complete:i[u+2]};else{var p=ws(t,ks);l=ws(p.firestore,Eu),h=p.C_;var v=new $u(l);c={next:function(t){i[u]&&i[u](new Qu(l,v,p,t))},error:i[u+1],complete:i[u+2]},Pu(t.C_)}return function(t,e,n,r){var i=this,o=new ls(r),s=new ma(e,o,n);return t._s.Ps((function(){return Object(a.b)(i,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return e=ha,[4,gu(t)];case 1:return[2,e.apply(void 0,[n.sent(),s])]}}))}))})),function(){o.i_(),t._s.Ps((function(){return Object(a.b)(i,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return e=fa,[4,gu(t)];case 1:return[2,e.apply(void 0,[n.sent(),s])]}}))}))}))}}(Su(l),h,f,c)}function nc(t,e){return function(t,e){var n=this,r=new Jn;return t._s.Ps((function(){return Object(a.b)(n,void 0,void 0,(function(){var n;return Object(a.d)(this,(function(i){switch(i.label){case 0:return n=Aa,[4,mu(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(Su(t),e)}function rc(t,e,n){var r=n.docs.get(e.S_),i=new $u(t);return new Xu(t,i,e.S_,r,new Yu(n.hasPendingWrites,n.fromCache),e.v_)}var ic=function(){function t(t,e){this.Yf=t,this.wd=e,this.Ed=[],this.Td=!1,this.Id=Bs(t)}return t.prototype.set=function(t,e,n){this.md();var r=oc(t,this.Yf),i=Wu(r.v_,e,n),o=Vs(this.Id,"WriteBatch.set",r.S_,i,null!==r.v_,n);return this.Ed.push(o.F_(r.S_,xe.Kt())),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];this.md();var o,a=oc(t,this.Yf);return e instanceof ps&&(e=e.d_),o="string"==typeof e||e instanceof fs?Ks(this.Id,"WriteBatch.update",a.S_,e,n,r):Xs(this.Id,"WriteBatch.update",a.S_,e),this.Ed.push(o.F_(a.S_,xe.exists(!0))),this},t.prototype.delete=function(t){this.md();var e=oc(t,this.Yf);return this.Ed=this.Ed.concat(new Fe(e.S_,xe.Kt())),this},t.prototype.commit=function(){return this.md(),this.Td=!0,this.Ed.length>0?this.wd(this.Ed):Promise.resolve()},t.prototype.md=function(){if(this.Td)throw new S(E.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}();function oc(t,e){if(t instanceof ps&&(t=t.d_),t.firestore!==e)throw new S(E.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var ac=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).Yf=e,r}return Object(a.c)(e,t),e.prototype.get=function(e){var n=this,r=oc(e,this.Yf),i=new $u(this.Yf);return t.prototype.get.call(this,e).then((function(t){return new Xu(n.Yf,i,r.S_,t.Zf,new Yu(!1,!1),r.v_)}))},e}(function(){function t(t,e){this.Yf=t,this.Ad=e,this.Id=Bs(t)}return t.prototype.get=function(t){var e=this,n=oc(t,this.Yf),r=new Gu(this.Yf);return this.Ad.ef([n.S_]).then((function(t){if(!t||1!==t.length)return v();var i=t[0];if(i instanceof bt)return new Au(e.Yf,r,n.S_,null,n.v_);if(i instanceof yt)return new Au(e.Yf,r,i.key,i,n.v_);throw v()}))},t.prototype.set=function(t,e,n){var r=oc(t,this.Yf),i=Wu(r.v_,e,n),o=Vs(this.Id,"Transaction.set",r.S_,i,null!==r.v_,n);return this.Ad.set(r.S_,o),this},t.prototype.update=function(t,e,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var o,a=oc(t,this.Yf);return e instanceof ps&&(e=e.d_),o="string"==typeof e||e instanceof fs?Ks(this.Id,"Transaction.update",a.S_,e,n,r):Xs(this.Id,"Transaction.update",a.S_,e),this.Ad.update(a.S_,o),this},t.prototype.delete=function(t){var e=oc(t,this.Yf);return this.Ad.delete(e.S_),this},t}());function sc(){if("undefined"==typeof Uint8Array)throw new S(E.UNIMPLEMENT
2ED,"Uint8Arrays are not available in this environment.")}function uc(){if("undefined"==typeof atob)throw new S(E.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var cc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.fromBase64String=function(t){return uc(),new e(O.fromBase64String(t))},e.fromUint8Array=function(t){return sc(),new e(O.fromUint8Array(t))},e.prototype.toBase64=function(){return uc(),this.d_.toBase64()},e.prototype.toUint8Array=function(){return sc(),this.d_.toUint8Array()},e.prototype.isEqual=function(t){return this.d_.isEqual(t.d_)},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e}(ps),lc=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(t,e){return function(t,e){Cu(t=ws(t,Eu));var n=Su(t),r=t.p_(),i=new us;return ku(n,i,new as(i,r.cacheSizeBytes,null==e?void 0:e.forceOwnership))}(t.d_,{forceOwnership:e})},t.prototype.enableMultiTabIndexedDbPersistence=function(t){return function(t){Cu(t=ws(t,Eu));var e=Su(t),n=t.p_(),r=new us;return ku(e,r,new ss(r,n.cacheSizeBytes))}(t.d_)},t.prototype.clearIndexedDbPersistence=function(t){return function(t){var e=this;if(t.R_&&!t.P_)throw new S(E.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var n=new Jn;return t.Bf.Tf((function(){return Object(a.b)(e,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,function(t){return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return tr.Kn()?(e=t+"main",[4,tr.delete(e)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(Ni(t.I_,t.w_))];case 1:return r.sent(),n.resolve(),[3,3];case 2:return e=r.sent(),n.reject(e),[3,3];case 3:return[2]}}
2))}))})),n.promise}(t.d_)},t}(),hc=function(t){function e(e,n,r){var i=this;return(i=t.call(this,n)||this).Rd=r,i.INTERNAL={delete:function(){return i.terminate()}},e instanceof u||(i.Pd=e),i}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"I_",{get:function(){return this.d_.I_},enumerable:!1,configurable:!0}),e.prototype.settings=function(t){t.merge&&delete(t=Object.assign(Object.assign({},this.d_.V_()),t)).merge,this.d_.g_(t)},e.prototype.useEmulator=function(t,e){!function(t,e,n){var r=(t=ws(t,Ss)).V_();"firestore.googleapis.com"!==r.host&&r.host!==e&&d("Host has been set in both settings() and useEmulator(), emulator host will be used"),t.g_(Object.assign(Object.assign({},r),{host:e+":"+n,ssl:!1}))}(this.d_,t,e)},e.prototype.enableNetwork=function(){return function(t){var e=this;return t._s.enqueue((function(){return Object(a.b)(e,void 0,void 0,(function(){var e,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return[4,du(t)];case 1:return e=r.sent(),[4,vu(t)];case 2:return n=r.sent(),[2,(e.yo(!0),function(t){var e=g(t);return e.Nh.delete(0),Fo(e)}(n))]}}))}))}))}(Su(ws(this.d_,Eu)))},e.prototype.disableNetwork=function(){return function(t){var e=this;return t._s.enqueue((function(){return Object(a.b)(e,void 0,void 0,(function(){var e,n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return[4,du(t)];case 1:return e=r.sent(),[4,vu(t)];case 2:return n=r.sent(),[2,(e.yo(!1),function(t){return Object(a.b)(this,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return(e=g(t)).Nh.add(0),[4,Uo(e)];case 1:return n.sent(),e.Oh.set("Offline"),[2]}}))}))}(n))]}}))}))}))}(Su(ws(this.d_,Eu)))},e.prototype.enablePersistence=function(t){var e=!1,n=!1;return t&&gs("synchronizeTabs",e=!!t.synchronizeTabs,"experimentalForceOwningTab",n=!!t.experimentalForceOwningTab),e?this.Rd.enableMultiTabIndexedDbPersistence(this):this.Rd.enableIndexedDbPersistence(this,n)},e.prototype.clearPersistence=function(){return this.Rd.clearIndexedDbPersistence(this)},e.prototype.terminate=function(){return this.Pd&&(this.Pd._removeServiceInstance("firestore"),this.Pd._removeServiceInstance("firestore-exp")),this.d_._delete()},e.prototype.waitForPendingWrites=function(){return function(t){var e=this,n=new Jn;return t._s.Ps((function(){return Object(a.b)(e,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(r){switch(r.label){case 0:return e=La,[4,mu(t)];case 1:return[2,e.apply(void 0,[r.sent(),n])]}}))}))})),n.promise}(Su(ws(this.d_,Eu)))},e.prototype.onSnapshotsInSync=function(t){return function(t,e){return function(t,e){var n=this,r=new ls(e);return t._s.Ps((function(){return Object(a.b)(n,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return e=function(t,e){g(t).Wh.add(e),e.next()},[4,gu(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))})),function(){r.i_(),t._s.Ps((function(){return Object(a.b)(n,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return e=function(t,e){g(t).Wh.delete(e)},[4,gu(t)];case 1:return[2,e.apply(void 0,[n.sent(),r])]}}))}))}))}}(Su(t=ws(t,Eu)),wu(e)?e:{next:e})}(this.d_,t)},Object.defineProperty(e.prototype,"app",{get:function(){if(!this.Pd)throw new S(E.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.Pd},enumerable:!1,configurable:!0}),e.prototype.collection=function(t){try{return new Oc(this,Ms(this.d_,t))}catch(t){throw yc(t,"collection()","Firestore.collection()")}},e.prototype.doc=function(t){try{return new gc(this,As(this.d_,t))}catch(t){throw yc(t,"doc()","Firestore.doc()")}},e.prototype.collectionGroup=function(t){try{return new Tc(this,function(t,e){if(t=ws(t,Ss),vs("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new S(E.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new ks(t,null,function(t){return new Vt(D.ct(),t)}(e))}(this.d_,t))}catch(t){throw yc(t,"collectionGroup()","Firestore.collectionGroup()")}},e.prototype.runTransaction=function(t){var e=this;return function(t,e){return function(t,e){var n=this,r=new Jn;return t._s.Ps((function(){return Object(a.b)(n,void 0,void 0,(function(){var n;return Object(a.d)(this,(function(i){switch(i.label){case 0:return[4,function(t){return fu(t).then((function(t){return t.Sh}))}(t)];case 1:return n=i.sent(),new su(t._s,n,e,r).run(),[2]}}))}))})),r.promise}(Su(t),(function(n){return e(new ac(t,n))}
2))}(this.d_,(function(n){return t(new pc(e,n))}))},e.prototype.batch=function(){var t=this;return Su(this.d_),new vc(new ic(this.d_,(function(e){return nc(t.d_,e)})))},e.prototype.loadBundle=function(t){throw new S(E.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},e.prototype.namedQuery=function(t){throw new S(E.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},e}(ps),fc=function(t){function e(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return Object(a.c)(e,t),e.prototype.Wf=function(t){return new cc(new O(t))},e.prototype.jf=function(t){var e=this.Jf(t,this.firestore.I_);return gc.yd(e,this.firestore,null)},e}(Mu);function dc(t){var e;e=t,c.setLogLevel(e)}var pc=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).Yf=e,r.Xf=new fc(e),r}return Object(a.c)(e,t),e.prototype.get=function(t){var e=this,n=kc(t);return this.d_.get(n).then((function(t){return new wc(e.Yf,new Xu(e.Yf.d_,e.Xf,t.S_,t.Zf,t.metadata,n.v_))}))},e.prototype.set=function(t,e,n){var r=kc(t);return n?(ms("Transaction.set",n),this.d_.set(r,e,n)):this.d_.set(r,e),this},e.prototype.update=function(t,e,n){for(var r,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var s=kc(t);return 2===arguments.length?this.d_.update(s,e):(r=this.d_).update.apply(r,Object(a.f)([s,e,n],i)),this},e.prototype.delete=function(t){var e=kc(t);return this.d_.delete(e),this},e}(ps),vc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.set=function(t,e,n){var r=kc(t);return n?(ms("WriteBatch.set",n),this.d_.set(r,e,n)):this.d_.set(r,e),this},e.prototype.update=function(t,e,n){for(var r,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var s=kc(t);return 2===arguments.length?this.d_.update(s,e):(r=this.d_).update.apply(r,Object(a.f)([s,e,n],i)),this},e.prototype.delete=function(t){var e=kc(t);return this.d_.delete(e),this},e.prototype.commit=function(){return this.d_.commit()},e}(ps),mc=function(t){function e(e,n,r){var i=this;return(i=t.call(this,r)||this).Yf=e,i.Xf=n,i}return Object(a.c)(e,t),e.prototype.fromFirestore=function(t,e){var n=new Ku(this.Yf.d_,this.Xf,t.S_,t.Zf,t.metadata,null);return this.d_.fromFirestore(new xc(this.Yf,n),null!=e?e:{})},e.prototype.toFirestore=function(t,e){return e?this.d_.toFirestore(t,e):this.d_.toFirestore(t)},e.gd=function(t,n){var r=e.Vd,i=r.get(t);i||(i=new WeakMap,r.set(t,i));var o=i.get(n);return o||(o=new e(t,new fc(t),n),i.set(n,o)),o},e}(ps);mc.Vd=new WeakMap;var gc=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).firestore=e,r.Xf=new fc(e),r}return Object(a.c)(e,t),e.pd=function(t,n,r){if(t.length%2!=0)throw new S(E.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t.rt()+" has "+t.length);return new e(n,new Os(n.d_,r,new B(t)))},e.yd=function(t,n,r){return new e(n,new Os(n.d_,r,t))},Object.defineProperty(e.prototype,"id",{get:function(){return this.d_.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new Oc(this.firestore,this.d_.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.d_.path},enumerable:!1,configurable:!0}),e.prototype.collection=function(t){try{return new Oc(this.firestore,Ms(this.d_,t))}catch(t){throw yc(t,"collection()","DocumentReference.collection()")}},e.prototype.isEqual=function(t){return t instanceof ps&&(t=t.d_),t instanceof Os&&Is(this.d_,t)},e.prototype.set=function(t,e){e=ms("DocumentReference.set",e);try{return function(t,e,n){t=ws(t,Os);var r=ws(t.firestore,Eu),i=Wu(t.v_,e,n);return nc(r,[Vs(Bs(r),"setDoc",t.S_,i,null!==t.v_,n).F_(t.S_,xe.Kt())])}(this.d_,t,e)}catch(t){throw yc(t,"setDoc()","DocumentReference.set()")}},e.prototype.update=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];try{return 1===arguments.length?tc(this.d_,t):tc.apply(void 0,Object(a.f)([this.d_,t,e],n))}
2catch(t){throw yc(t,"updateDoc()","DocumentReference.update()")}},e.prototype.delete=function(){return nc(ws((t=this.d_).firestore,Eu),[new Fe(t.S_,xe.Kt())]);var t},e.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=bc(e),i=_c(e,(function(e){return new wc(t.firestore,new Xu(t.firestore.d_,t.Xf,e.S_,e.Zf,e.metadata,t.d_.v_))}));return ec(this.d_,r,i)},e.prototype.get=function(t){var e=this;return("cache"===(null==t?void 0:t.source)?function(t){t=ws(t,Os);var e=ws(t.firestore,Eu),n=Su(e),r=new $u(e);return function(t,e){var n=this,r=new Jn;return t._s.Ps((function(){return Object(a.b)(n,void 0,void 0,(function(){var n;return Object(a.d)(this,(function(i){switch(i.label){case 0:return n=function(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i;return Object(a.d)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,function(t,e){var n=g(t);return n.persistence.runTransaction("read document","readonly",(function(t){return n.Tc.Ho(t,e)}))}(t,e)];case 1:return(i=o.sent())instanceof yt?n.resolve(i):i instanceof bt?n.resolve(null):n.reject(new S(E.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return r=o.sent(),i=cr(r,"Failed to get document '"+e+" from cache"),n.reject(i),[3,3];case 3:return[2]}}
2))}))},[4,pu(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(n,t.S_).then((function(n){return new Xu(e,r,t.S_,n,new Yu(n instanceof yt&&n.Vt,!0),t.v_)}))}(this.d_):"server"===(null==t?void 0:t.source)?function(t){t=ws(t,Os);var e=ws(t.firestore,Eu);return yu(Su(e),t.S_,{source:"server"}).then((function(n){return rc(e,t,n)}))}(this.d_):function(t){t=ws(t,Os);var e=ws(t.firestore,Eu);return yu(Su(e),t.S_).then((function(n){return rc(e,t,n)}))}(this.d_)).then((function(t){return new wc(e.firestore,new Xu(e.firestore.d_,e.Xf,t.S_,t.Zf,t.metadata,e.d_.v_))}))},e.prototype.withConverter=function(t){return new e(this.firestore,t?this.d_.withConverter(mc.gd(this.firestore,t)):this.d_.withConverter(null))},e}(ps);function yc(t,e,n){return t.message=t.message.replace(e,n),t}function bc(t){for(var e=0,n=t;e<n.length;e++){var r=n[e];if("object"==typeof r&&!wu(r))return r}return{}}function _c(t,e){var n,r,i;return{next:function(t){i.next&&i.next(e(t))},error:null===(n=(i=wu(t[0])?t[0]:wu(t[1])?t[1]:"function"==typeof t[0]?{next:t[0],error:t[1],complete:t[2]}:{next:t[1],error:t[2],complete:t[3]}).error)||void 0===n?void 0:n.bind(i),complete:null===(r=i.complete)||void 0===r?void 0:r.bind(i)}}var wc=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).Yf=e,r}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"ref",{get:function(){return new gc(this.Yf,this.d_.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.d_.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this.d_.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"exists",{get:function(){return this.d_.exists()},enumerable:!1,configurable:!0}),e.prototype.data=function(t){return this.d_.data(t)},e.prototype.get=function(t,e){return this.d_.get(t,e)},e.prototype.isEqual=function(t){return Zu(this.d_,t.d_)},e}(ps),xc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.data=function(t){return this.d_.data(t)},e}(wc),Tc=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).firestore=e,r.Xf=new fc(e),r}return Object(a.c)(e,t),e.prototype.where=function(t,n,r){try{return new e(this.firestore,Nu(this.d_,function(t,e,n){var r=e,i=ju("where",t);return new Lu(i,r,n)}(t,n,r)))}catch(t){throw yc(t,/(orderBy|where)\(\)/,"Query.$1()")}},e.prototype.orderBy=function(t,n){try{return new e(this.firestore,Nu(this.d_,function(t,e){void 0===e&&(e="asc");var n=e,r=ju("orderBy",t);return new Du(r,n)}(t,n)))}catch(t){throw yc(t,/(orderBy|where)\(\)/,"Query.$1()")}},e.prototype.limit=function(t){try{return new e(this.firestore,Nu(this.d_,function(t){return xs("limit",t),new Fu("limit",t,"F")}(t)))}catch(t){throw yc(t,"limit()","Query.limit()")}},e.prototype.limitToLast=function(t){try{return new e(this.firestore,Nu(this.d_,function(t){return xs("limitToLast",t),new Fu("limitToLast",t,"L")}(t)))}catch(t){throw yc(t,"limitToLast()","Query.limitToLast()")}},e.prototype.startAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,Nu(this.d_,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Uu("startAt",t,!0)}.apply(void 0,t)))}catch(t){throw yc(t,"startAt()","Query.startAt()")}},e.prototype.startAfter=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,Nu(this.d_,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Uu("startAfter",t,!1)}.apply(void 0,t)))}catch(t){throw yc(t,"startAfter()","Query.startAfter()")}},e.prototype.endBefore=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,Nu(this.d_,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Bu("endBefore",t,!0)}.apply(void 0,t)))}catch(t){throw yc(t,"endBefore()","Query.endBefore()")}},e.prototype.endAt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return new e(this.firestore,Nu(this.d_,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Bu("endAt",t,!1)}.apply(void 0,t)))}catch(t){throw yc(t,"endAt()","Query.endAt()")}},e.prototype.isEqual=function(t){return js(this.d_,t.d_)},e.prototype.get=function(t){var e=this;
2return("cache"===(null==t?void 0:t.source)?function(t){t=ws(t,ks);var e=ws(t.firestore,Eu),n=Su(e),r=new $u(e);return function(t,e){var n=this,r=new Jn;return t._s.Ps((function(){return Object(a.b)(n,void 0,void 0,(function(){var n;return Object(a.d)(this,(function(i){switch(i.label){case 0:return n=function(t,e,n){return Object(a.b)(this,void 0,void 0,(function(){var r,i,o,s,u;return Object(a.d)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,Qi(t,e,!0)];case 1:return u=a.sent(),r=new Ta(e,u.Rc),i=r.fl(u.documents),o=r.wi(i,!1),n.resolve(o.snapshot),[3,3];case 2:return s=a.sent(),u=cr(s,"Failed to execute query '"+e+" against cache"),n.reject(u),[3,3];case 3:return[2]}}))}))},[4,pu(t)];case 1:return[2,n.apply(void 0,[i.sent(),e,r])]}}))}))})),r.promise}(n,t.C_).then((function(n){return new Qu(e,r,t,n)}))}(this.d_):"server"===(null==t?void 0:t.source)?function(t){t=ws(t,ks);var e=ws(t.firestore,Eu),n=Su(e),r=new $u(e);return bu(n,t.C_,{source:"server"}).then((function(n){return new Qu(e,r,t,n)}))}(this.d_):function(t){t=ws(t,ks);var e=ws(t.firestore,Eu),n=Su(e),r=new $u(e);return Pu(t.C_),bu(n,t.C_).then((function(n){return new Qu(e,r,t,n)}))}(this.d_)).then((function(t){return new Sc(e.firestore,new Qu(e.firestore.d_,e.Xf,e.d_,t._d))}))},e.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=bc(e),i=_c(e,(function(e){return new Sc(t.firestore,new Qu(t.firestore.d_,t.Xf,t.d_,e._d))}));return ec(this.d_,r,i)},e.prototype.withConverter=function(t){return new e(this.firestore,t?this.d_.withConverter(mc.gd(this.firestore,t)):this.d_.withConverter(null))},e}(ps),Ec=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).Yf=e,r}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return this.d_.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doc",{get:function(){return new xc(this.Yf,this.d_.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"oldIndex",{get:function(){return this.d_.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"newIndex",{get:function(){return this.d_.newIndex},enumerable:!1,configurable:!0}),e}(ps),Sc=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).Yf=e,r}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"query",{get:function(){return new Tc(this.Yf,this.d_.query)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this.d_.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.d_.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"empty",{get:function(){return this.d_.empty},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"docs",{get:function(){var t=this;return this.d_.docs.map((function(e){return new xc(t.Yf,e)}))},enumerable:!1,configurable:!0}),e.prototype.docChanges=function(t){var e=this;return this.d_.docChanges(t).map((function(t){return new Ec(e.Yf,t)}))},e.prototype.forEach=function(t,e){var n=this;this.d_.forEach((function(r){t.call(e,new xc(n.Yf,r))}))},e.prototype.isEqual=function(t){return Zu(this.d_,t.d_)},e}(ps),Oc=function(t){function e(e,n){var r=this;return(r=t.call(this,e,n)||this).firestore=e,r.d_=n,r}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.d_.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.d_.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this.d_.parent;return t?new gc(this.firestore,t):null},enumerable:!1,configurable:!0}),e.prototype.doc=function(t){try{return new gc(this.firestore,void 0===t?As(this.d_):As(this.d_,t))}catch(t){throw yc(t,"doc()","CollectionReference.doc()")}},e.prototype.add=function(t){var e=this;return function(t,e){var n=ws(t.firestore,Eu),r=As(t),i=Wu(t.v_,e);return nc(n,[Vs(Bs(t.firestore),"addDoc",r.S_,i,null!==t.v_,{}).F_(r.S_,xe.exists(!1))]).then((function(){return r}))}(this.d_,t).then((function(t){return new gc(e.firestore,t)}))},e.prototype.isEqual=function(t){return Is(this.d_,t.d_)},e.prototype.withConverter=function(t){return new e(this.firestore,t?this.d_.withConverter(mc.gd(this.firestore,t)):this.d_.withConverter(null))},e}(Tc);function kc(t){return t instanceof ps&&(t=t.d_),ws(t,Os)}var Cc=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.call(this,new(fs.bind.apply(fs,Object(a.f)([void 0],e))))||this}return Object(a.c)(e,t),e.documentId=function(){return new e(U.ht().rt())},e.prototype.isEqual=function(t){return t instanceof ps&&(t=t.d_),t instanceof fs&&this.d_.f_.isEqual(t.f_)},e}(ps),Mc=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.serverTimestamp=function(){var t=new qs("serverTimestamp");return t._methodName="FieldValue.serverTimestamp",new e(t)},e.delete=function(){var t=new zs("deleteField");return t._methodName="FieldValue.delete",new e(t)},e.arrayUnion=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Ws("arrayUnion",t)}.apply(void 0,t);return r._methodName="FieldValue.arrayUnion",new e(r)},e.arrayRemove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Gs("arrayRemove",t)}.apply(void 0,t);return r._methodName="FieldValue.arrayRemove",new e(r)},e.increment=function(t){var n=function(t){return new Ys("increment",t)}(t);return n._methodName="FieldValue.increment",new e(n)},e.prototype.isEqual=function(t){return this.d_.isEqual(t.d_)},e}(ps);function Ac(t){return function(t,e){var n=Su(t=ws(t,Eu)),r=new xu;return function(t,e,n,r){var i=this,o=function(t,e){return function(t,e){return new hs(t,e)}(function(t,e){if(t instanceof Uint8Array)return cs(t,e);if(t instanceof ArrayBuffer)return cs(new Uint8Array(t),e);if(t instanceof ReadableStream)return t.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}
2("string"==typeof t?(new TextEncoder).encode(t):t),e)}(n,Ao(e));t._s.Ps((function(){return Object(a.b)(i,void 0,void 0,(function(){var e;return Object(a.d)(this,(function(n){switch(n.label){case 0:return e=is,[4,mu(t)];case 1:return e.apply(void 0,[n.sent(),o,r]),[2]}}))}))}))}(n,t.I_,e,r),r}(this.d_,t)}function Ic(t){var e,n,r=this;return(e=this.d_,n=t,function(t,e){var n=this;return t._s.enqueue((function(){return Object(a.b)(n,void 0,void 0,(function(){var n;return Object(a.d)(this,(function(r){switch(r.label){case 0:return n=function(t,e){var n=g(t);return n.persistence.runTransaction("Get named query","readonly",(function(t){return n.wo.Ms(t,e)}))},[4,pu(t)];case 1:return[2,n.apply(void 0,[r.sent(),e])]}}))}))}))}(Su(e=ws(e,Eu)),n).then((function(t){return t?new ks(e,null,t.query):null}))).then((function(t){return t?new Tc(r,t):null}))}}).call(this,n(54))},function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return v})),n.d(e,"c",(function(){return S})),n.d(e,"d",(function(){return p})),n.d(e,"e",(function(){return y})),n.d(e,"f",(function(){return k})),n.d(e,"g",(function(){return C}));var r=n(28),i=n(13),o=n.n(i),a=(n(19),n(29)),s=n(59),u=n(27),c=n(25),l=n(60),h=n.n(l),f=(n(78),n(38)),d=(n(85),function(t){var e=Object(s.a)();return e.displayName=t,e}("Router-History")),p=function(t){var e=Object(s.a)();return e.displayName=t,e}("Router"),v=function(t){function e(e){var n;return(n=t.call(this,e)||this).state={location:e.history.location},n._isMounted=!1,n._pendingLocation=null,e.staticContext||(n.unlisten=e.history.listen((function(t){n._isMounted?n.setState({location:t}):n._pendingLocation=t}))),n}Object(r.a)(e,t),e.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var n=e.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return o.a.createElement(p.Provider,{value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},o.a.createElement(d.Provider,{children:this.props.children||null,value:this.props.history}))},e}(o.a.Component);o.a.Component;o.a.Component;var m={},g=0;function y(t,e){void 0===e&&(e={}),("string"===typeof e||Array.isArray(e))&&(e={path:e});var n=e,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce((function(e,n){if(!n&&""!==n)return null;if(e)return e;var r=function(t,e){var n=""+e.end+e.strict+e.sensitive,r=m[n]||(m[n]={});if(r[t])return r[t];var i=[],o={regexp:h()(t,i,e),keys:i};return g<1e4&&(r[t]=o,g++),o}(n,{end:o,strict:s,sensitive:c}),i=r.regexp,a=r.keys,u=i.exec(t);if(!u)return null;var l=u[0],f=u.slice(1),d=t===l;return o&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce((function(t,e,n){return t[e.name]=f[n],t}),{})}}),null)}var b=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.render=function(){var t=this;return o.a.createElement(p.Consumer,null,(function(e){e||Object(u.a)(!1);var n=t.props.location||e.location,r=t.props.computedMatch?t.props.computedMatch:t.props.path?y(n.pathname,t.props):e.match,i=Object(c.a)({},e,{location:n,match:r}),a=t.props,s=a.children,l=a.component,h=a.render;return Array.isArray(s)&&0===s.length&&(s=null),o.a.createElement(p.Provider,{value:i},i.match?s?"function"===typeof s?s(i):s:l?o.a.createElement(l,i):h?h(i):null:"function"===typeof s?s(i):null)}))},e}(o.a.Component);function _(t){return"/"===t.charAt(0)?t:"/"+t}function w(t,e){if(!t)return e;var n=_(t);return 0!==e.pathname.indexOf(n)?e:Object(c.a)({},e,{pathname:e.pathname.substr(n.length)})}function x(t){return"string"===typeof t?t:Object(a.e)(t)}function T(t){return function(){Object(u.a)(!1)}}function E(){}o.a.Component;var S=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.render=function(){var t=this;return o.a.createElement(p.Consumer,null,(function(e){e||Object(u.a)(!1);var n,r,i=t.props.location||e.location;
2return o.a.Children.forEach(t.props.children,(function(t){if(null==r&&o.a.isValidElement(t)){n=t;var a=t.props.path||t.props.from;r=a?y(i.pathname,Object(c.a)({},t.props,{path:a})):e.match}})),r?o.a.cloneElement(n,{location:i,computedMatch:r}):null}))},e}(o.a.Component);var O=o.a.useContext;function k(){return O(d)}function C(){var t=O(p).match;return t?t.params:{}}},function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return ir})),n.d(e,"b",(function(){return ar})),n.d(e,"c",(function(){return or})),n.d(e,"d",(function(){return sr})),n.d(e,"e",(function(){return ur})),n.d(e,"f",(function(){return cr})),n.d(e,"g",(function(){return nr})),n.d(e,"h",(function(){return rr}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t){var e="function"===typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var o,a="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},s=s||{},u=a||self;function c(){}function l(t){var e=typeof t;return"array"==(e="object"!=e?e:t?Array.isArray(t)?"array":e:"null")||"object"==e&&"number"==typeof t.length}function h(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var f="closure_uid_"+(1e9*Math.random()>>>0),d=0;function p(t,e,n){return t.call.apply(t.bind,arguments)}function v(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function m(t,e,n){return(m=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?p:v).apply(null,arguments)}function g(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}function y(){return Date.now()}function b(t,e){function n(){}n.prototype=e.prototype,t.X=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.Kb=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function _(){this.j=this.j,this.i=this.i}_.prototype.j=!1,_.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0))(function(t){Object.prototype.hasOwnProperty.call(t,f)&&t[f]||(t[f]=++d)})(this)},_.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var w=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"===typeof t)return"string"!==typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},x=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"===typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};function T(t){return Array.prototype.concat.apply([],arguments)}function E(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function S(t){return/^[\s\xa0]*$/.test(t)}var O,k=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function C(t,e){return-1!=t.indexOf(e)}function M(t,e){return t<e?-1:t>e?1:0}t:{var A=u.navigator;if(A){var I=A.userAgent;if(I){O=I;break t}}O=""}function j(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function P(t){var e={};for(var n in t)e[n]=t[n];return e}var R="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
2ing toString valueOf".split(" ");function N(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<R.length;o++)n=R[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function L(t){return L[" "](t),t}L[" "]=c;var D,F=C(O,"Opera"),U=C(O,"Trident")||C(O,"MSIE"),B=C(O,"Edge"),V=B||U,z=C(O,"Gecko")&&!(C(O.toLowerCase(),"webkit")&&!C(O,"Edge"))&&!(C(O,"Trident")||C(O,"MSIE"))&&!C(O,"Edge"),H=C(O.toLowerCase(),"webkit")&&!C(O,"Edge");function q(){var t=u.document;return t?t.documentMode:void 0}t:{var W="",G=function(){var t=O;return z?/rv:([^\);]+)(\)|;)/.exec(t):B?/Edge\/([\d\.]+)/.exec(t):U?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):H?/WebKit\/(\S+)/.exec(t):F?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(G&&(W=G?G[1]:""),U){var Y=q();if(null!=Y&&Y>parseFloat(W)){D=String(Y);break t}}D=W}var X,K={};function Q(t){return function(t,e){var n=K;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,(function(){for(var e=0,n=k(String(D)).split("."),r=k(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=M(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||M(0==a[2].length,0==s[2].length)||M(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}if(u.document&&U){var J=q();X=J||(parseInt(D,10)||void 0)}else X=void 0;var Z=X,$=!U||9<=Number(Z),tt=U&&!Q("9"),et=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{u.addEventListener("test",c,e),u.removeEventListener("test",c,e)}catch(n){}return t}();function nt(t,e){this.type=t,this.a=this.target=e,this.defaultPrevented=!1}function rt(t,e){if(nt.call(this,t?t.type:""),this.relatedTarget=this.a=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.c=null,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.a=e,e=t.relatedTarget){if(z){t:{try{L(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"===typeof t.pointerType?t.pointerType:it[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}nt.prototype.b=function(){this.defaultPrevented=!0},b(rt,nt);var it={2:"touch",3:"pen",4:"mouse"};rt.prototype.b=function(){rt.X.b.call(this);var t=this.c;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,tt)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var ot="closure_listenable_"+(1e6*Math.random()|0),at=0;function st(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.ca=i,this.key=++at,this.Y=this.Z=!1}function ut(t){t.Y=!0,t.listener=null,t.proxy=null,t.src=null,t.ca=null}function ct(t){this.src=t,this.a={},this.b=0}function lt(t,e){var n=e.type;if(n in t.a){var r,i=t.a[n],o=w(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ut(e),0==t.a[n].length&&(delete t.a[n],t.b--))}}function ht(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.Y&&o.listener==e&&o.capture==!!n&&o.ca==r)return i}return-1}ct.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=ht(t,e,r,i);return-1<a?(e=t[a],n||(e.Z=!1)):((e=new st(e,this.src,o,!!r,i)).Z=n,t.push(e)),e};var ft="closure_lm_"+(1e6*Math.random()|0),dt={};function pt(t,e,n,r,i){if(r&&r.once)return mt(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)pt(t,e[o],n,r,i);return null}return n=Et(n),t&&t[ot]?t.va(e,n,h(r)?!!r.capture:!!r,i):vt(t,e,n,!1,r,i)}function vt(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=h(i)?!!i.capture:!!i;if(a&&!$)return null;var s=xt(t);if(s||(t[ft]=s=new ct(t)),(n=s.add(e,n,r,a,o)).proxy)return n;if(r=function(){var t=wt,e=$?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)et||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(bt(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function mt(t,e,n,r,i){if(Array.isArray(e)){for(var o=0;o<e.length;o++)mt(t,e[o],n,r,i);return null}return n=Et(n),t&&t[ot]?t.wa(e,n,h(r)?!!r.capture:!!r,i):vt(t,e,n,!0,r,i)}function gt(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)gt(t,e[o],n,r,i);else r=h(r)?!!r.capture:!!r,n=Et(n),t&&t[ot]?(t=t.c,(e=String(e).toString())in t.a&&(-1<(n=ht(o=t.a[e],n,r,i))&&(ut(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=xt(t))&&(e=t.a[e.toString()],t=-1,e&&(t=ht(e,n,r,i)),(n=-1<t?e[t]:null)&&yt(n))}function yt(t){if("number"!==typeof t&&t&&!t.Y){var e=t.src;if(e&&e[ot])lt(e.c,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(bt(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=xt(e))?(lt(n,t),0==n.b&&(n.src=null,e[ft]=null)):ut(t)}}}function bt(t){return t in dt?dt[t]:dt[t]="on"+t}function _t(t,e){var n=t.listener,r=t.ca||t.src;return t.Z&&yt(t),n.call(r,e)}function wt(t,e){if(t.Y)return!0;
2if(!$){if(!e)t:{e=["window","event"];for(var n=u,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}return _t(t,e=new rt(e,this))}return _t(t,new rt(e,this))}function xt(t){return(t=t[ft])instanceof ct?t:null}var Tt="__closure_events_fn_"+(1e9*Math.random()>>>0);function Et(t){return"function"===typeof t?t:(t[Tt]||(t[Tt]=function(e){return t.handleEvent(e)}),t[Tt])}function St(){_.call(this),this.c=new ct(this),this.J=this,this.C=null}function Ot(t,e){var n,r=t.C;if(r)for(n=[];r;r=r.C)n.push(r);if(t=t.J,r=e.type||e,"string"===typeof e)e=new nt(e,t);else if(e instanceof nt)e.target=e.target||t;else{var i=e;N(e=new nt(r,t),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var a=e.a=n[o];i=kt(a,r,!0,e)&&i}if(i=kt(a=e.a=t,r,!0,e)&&i,i=kt(a,r,!1,e)&&i,n)for(o=0;o<n.length;o++)i=kt(a=e.a=n[o],r,!1,e)&&i}function kt(t,e,n,r){if(!(e=t.c.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.Y&&a.capture==n){var s=a.listener,u=a.ca||a.src;a.Z&<(t.c,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}b(St,_),St.prototype[ot]=!0,(o=St.prototype).addEventListener=function(t,e,n,r){pt(this,t,e,n,r)},o.removeEventListener=function(t,e,n,r){gt(this,t,e,n,r)},o.G=function(){if(St.X.G.call(this),this.c){var t,e=this.c;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)ut(n[r]);delete e.a[t],e.b--}}this.C=null},o.va=function(t,e,n,r){return this.c.add(String(t),e,!1,n,r)},o.wa=function(t,e,n,r){return this.c.add(String(t),e,!0,n,r)};var Ct=u.JSON.stringify;function Mt(){this.b=this.a=null}var At,It=new(function(){function t(t,e){this.c=t,this.f=e,this.b=0,this.a=null}return t.prototype.get=function(){var t;return 0<this.b?(this.b--,t=this.a,this.a=t.next,t.next=null):t=this.c(),t},t}())((function(){return new Pt}),(function(t){t.reset()}));function jt(){var t=Dt,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function Pt(){this.next=this.b=this.a=null}function Rt(t){u.setTimeout((function(){throw t}),0)}function Nt(t,e){At||function(){var t=u.Promise.resolve(void 0);At=function(){t.then(Ft)}}(),Lt||(At(),Lt=!0),Dt.add(t,e)}Mt.prototype.add=function(t,e){var n=It.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},Pt.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},Pt.prototype.reset=function(){this.next=this.b=this.a=null};var Lt=!1,Dt=new Mt;function Ft(){for(var t;t=jt();){try{t.a.call(t.b)}catch(n){Rt(n)}var e=It;e.f(t),100>e.b&&(e.b++,t.next=e.a,e.a=t)}Lt=!1}function Ut(t,e){St.call(this),this.b=t||1,this.a=e||u,this.f=m(this.Za,this),this.g=y()}function Bt(t){t.aa=!1,t.M&&(t.a.clearTimeout(t.M),t.M=null)}function Vt(t,e,n){if("function"===typeof t)n&&(t=m(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=m(t.handleEvent,t)}return 2147483647<Number(e)?-1:u.setTimeout(t,e||0)}function zt(t){t.a=Vt((function(){t.a=null,t.c&&(t.c=!1,zt(t))}),t.h);var e=t.b;t.b=null,t.g.apply(null,e)}b(Ut,St),(o=Ut.prototype).aa=!1,o.M=null,o.Za=function(){if(this.aa){var t=y()-this.g;0<t&&t<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-t):(this.M&&(this.a.clearTimeout(this.M),this.M=null),Ot(this,"tick"),this.aa&&(Bt(this),this.start()))}},o.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=y())},o.G=function(){Ut.X.G.call(this),Bt(this),delete this.a};var Ht=function(t){function e(e,n){var r=t.call(this)||this;return r.g=e,r.h=n,r.b=null,r.c=!1,r.a=null,r}return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.f=function(t){this.b=arguments,this.a?this.c=!0:zt(this)},e.prototype.G=function(){t.prototype.G.call(this),this.a&&(u.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},e}(_);function qt(t){_.call(this),this.b=t,this.a={}}b(qt,_);var Wt=[];function Gt(t,e,n,r){Array.isArray(n)||(n&&(Wt[0]=n.toString()),n=Wt);for(var i=0;i<n.length;i++){var o=pt(e,n[i],r||t.handleEvent,!1,t.b||t);if(!o)break;t.a[o.key]=o}}function Yt(t){j(t.a,(function(t,e){this.a.hasOwnProperty(e)&&yt(t)}),t),t.a={}}function Xt(){this.a=!0}function Kt(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+function(t,e){if(!t.a)return e;if(!e)return null;try{var n=JSON.parse(e);if(n)for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var r=n[t];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var a=1;a<i.length;a++)i[a]=""}}}return Ct(n)}catch(s){return e}}(t,n)+(r?" "+r:"")}))}qt.prototype.G=function(){qt.X.G.call(this),Yt(this)},qt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Xt.prototype.info=function(){};var Qt={},Jt=null;function Zt(){return Jt=Jt||new St}function $t(t){nt.call(this,Qt.Fa,t)}function te(t){var e=Zt();Ot(e,new $t(e,t))}function ee(t,e){nt.call(this,Qt.STAT_EVENT,t),this.stat=e}function ne(t){var e=Zt();Ot(e,new ee(e,t))}function re(t){nt.call(this,Qt.Ga,t)}function ie(t,e){if("function"!==typeof t)throw Error("Fn must not be null and must be a function");return u.setTimeout((function(){t()}),e)}Qt.Fa="serverreachability",b($t,nt),Qt.STAT_EVENT="statevent",b(ee,nt),Qt.Ga="timingevent",b(re,nt);var oe={NO_ERROR:0,$a:1,nb:2,mb:3,hb:4,lb:5,ob:6,Da:7,TIMEOUT:8,rb:9},ae={fb:"complete",Bb:"success",Ea:"error",Da:"abort",tb:"ready",ub:"readystatechange",TIMEOUT:"timeout",pb:"incrementaldata",sb:"progress",ib:"downloadprogress",Jb:"uploadprogress"};function se(){}function ue(t){var e;return(e=t.a)||(e=t.a={}),e}function ce(){}se.prototype.a=null;var le,he={OPEN:"a",eb:"b",Ea:"c",qb:"d"};function fe(){nt.call(this,"d")}function de(){nt.call(this,"c")}function pe(){}function ve(t,e,n,r){this.g=t,this.c=e,this.f=n,this.S=r||1,this.J=new qt(this),this.P=me,t=V?125:void 0,this.R=new Ut(t),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.T=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.V=this.C=this.U=this.I=!1}b(fe,nt),b(de,nt),b(pe,se),le=new pe;var me=45e3,ge={},ye={};function be(t,e,n){t.H=1,t.i=Ve(Ne(e)),t.j=n,t.I=!0,_e(t,null)}function _e(t,e){t.u=y(),Te(t),t.l=Ne(t.i);var n=t.l,r=t.S;Array.isArray(r)||(r=[String(r)]),tn(n.b,"t",r),t.D=0,t.a=Kn(t.g,t.g.C?e:null),0<t.O&&(t.F=new Ht(m(t.Ca,t,t.a),t.O)),Gt(t.J,t.a,"readystatechange",t.Xa),e=t.B?P(t.B):{},t.j?(t.m||(t.m="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.a.ba(t.l,t.m,t.j,e)):(t.m="GET",t.a.ba(t.l,t.m,null,e)),te(1),function(t,e,n,r,i,o){t.info((function(){if(t.a)if(o)for(var a="",s=o.split("&"),u=0;u<s.length;u++){var c=s[u].split("=");if(1<c.length){var l=c[0];c=c[1];var h=l.split("_");a=2<=h.length&&"type"==h[1]?a+(l+"=")+c+"&":a+(l+"=redacted&")}}else a=null;else a=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+a}))}(t.c,t.m,t.l,t.f,t.S,t.j)}function we(t,e,n){for(var r=!0;!t.A&&t.D<n.length;){var i=xe(t,n);if(i==ye){4==e&&(t.h=4,ne(14),r=!1),Kt(t.c,t.f,null,"[Incomplete Response]");break}if(i==ge){t.h=4,ne(15),Kt(t.c,t.f,n,"[Invalid Chunk]"),r=!1;break}Kt(t.c,t.f,i,null),Ce(t,i)}4==e&&0==n.length&&(t.h=1,ne(16),r=!1),t.b=t.b&&r,r?0<n.length&&!t.V&&(t.V=!0,(e=t.g).a==t&&e.U&&!e.F&&(e.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),Vn(e),e.F=!0,ne(11))):(Kt(t.c,t.f,n,"[Invalid Chunked Response]"),ke(t),Oe(t))}function xe(t,e){var n=t.D,r=e.indexOf("\n",n);return-1==r?ye:(n=Number(e.substring(n,r)),isNaN(n)?ge:(r+=1)+n>e.length?ye:(e=e.substr(r,n),t.D=r+n,e))}function Te(t){t.T=y()+t.P,Ee(t,t.P)}function Ee(t,e){if(null!=t.o)throw Error("WatchDog timer not null");t.o=ie(m(t.Va,t),e)}function Se(t){t.o&&(u.clearTimeout(t.o),t.o=null)}function Oe(t){0==t.g.v||t.A||qn(t.g,t)}function ke(t){Se(t);var e=t.F;e&&"function"==typeof e.ja&&e.ja(),t.F=null,Bt(t.R),Yt(t.J),t.a&&(e=t.a,t.a=null,e.abort(),e.ja())}function Ce(t,e){try{var n=t.g;if(0!=n.v&&(n.a==t||un(n.b,t)))if(n.I=t.N,!t.C&&un(n.b,t)&&3==n.v){try{var r=n.ka.a.parse(e)}catch(g){r=null}if(Array.isArray(r)&&3==r.length){var i=r;
2if(0==i[0]){t:if(!n.j){if(n.a){if(!(n.a.u+3e3<t.u))break t;Hn(n),jn(n)}Bn(n),ne(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=ie(m(n.Sa,n),6e3));if(1>=sn(n.b)&&n.ea){try{n.ea()}catch(g){}n.ea=void 0}}else Gn(n,11)}else if((t.C||n.a==t)&&Hn(n),!S(e))for(e=r=n.ka.a.parse(e),r=0;r<e.length;r++)if(i=e[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var o=i[3];null!=o&&(n.ha=o,n.c.info("VER="+n.ha));var a=i[4];null!=a&&(n.pa=a,n.c.info("SVER="+n.pa));var s=i[5];if(null!=s&&"number"===typeof s&&0<s){var u=1.5*s;n.D=u,n.c.info("backChannelRequestTimeoutMs_="+u)}u=n;var c=t.a;if(c){var l=c.a?c.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(l){var h=u.b;!h.a&&(C(l,"spdy")||C(l,"quic")||C(l,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(cn(h,h.b),h.b=null))}if(u.A){var f=c.a?c.a.getResponseHeader("X-HTTP-Session-Id"):null;f&&(u.na=f,Be(u.B,u.A,f))}}n.v=3,n.f&&n.f.ta(),n.U&&(n.N=y()-t.u,n.c.info("Handshake RTT: "+n.N+"ms"));var d=t;if((u=n).la=Xn(u,u.C?u.ga:null,u.fa),d.C){ln(u.b,d);var p=d,v=u.D;v&&p.setTimeout(v),p.o&&(Se(p),Te(p)),u.a=d}else Un(u);0<n.g.length&&Nn(n)}else"stop"!=i[0]&&"close"!=i[0]||Gn(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?Gn(n,7):In(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);te(4)}catch(g){}}function Me(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(l(t)||"string"===typeof t)x(t,e,void 0);else{if(t.L&&"function"==typeof t.L)var n=t.L();else if(t.K&&"function"==typeof t.K)n=void 0;else if(l(t)||"string"===typeof t){n=[];for(var r=t.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,t)n[r++]=i;i=(r=function(t){if(t.K&&"function"==typeof t.K)return t.K();if("string"===typeof t)return t.split("");if(l(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}(t)).length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function Ae(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof Ae)for(n=t.L(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Ie(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];je(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)je(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function je(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(o=ve.prototype).setTimeout=function(t){this.P=t},o.Xa=function(t){t=t.target;var e=this.F;e&&3==kn(t)?e.f():this.Ca(t)},o.Ca=function(t){try{if(t==this.a)t:{var e=kn(this.a),n=this.a.ua(),r=this.a.W();if(!(3>e||3==e&&!V&&!this.a.$())){this.A||4!=e||7==n||te(8==n||0>=r?3:2),Se(this);var i=this.a.W();this.N=i;var o=this.a.$();if(this.b=200==i,function(t,e,n,r,i,o,a){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+a}))}(this.c,this.m,this.l,this.f,this.S,e,i),this.b){if(this.U&&!this.C){e:{if(this.a){var a,s=this.a;if((a=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!S(a)){var u=a;break e}}u=null}if(!u){this.b=!1,this.h=3,ne(12),ke(this),Oe(this);break t}Kt(this.c,this.f,u,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Ce(this,u)}this.I?(we(this,e,o),V&&this.b&&3==e&&(Gt(this.J,this.R,"tick",this.Wa),this.R.start())):(Kt(this.c,this.f,o,null),Ce(this,o)),4==e&&ke(this),this.b&&!this.A&&(4==e?qn(this.g,this):(this.b=!1,Te(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.h=3,ne(12)):(this.h=0,ne(13)),ke(this),Oe(this)}}}catch(c){}},o.Wa=function(){if(this.a){var t=kn(this.a),e=this.a.$();this.D<e.length&&(Se(this),we(this,t,e),this.b&&4!=t&&Te(this))}},o.cancel=function(){this.A=!0,ke(this)},o.Va=function(){this.o=null;var t=y();0<=t-this.T?(function(t,e){t.info((function(){return"TIMEOUT: "+e}))}(this.c,this.l),2!=this.H&&(te(3),ne(17)),ke(this),this.h=2,Oe(this)):Ee(this,this.T-t)},(o=Ae.prototype).K=function(){Ie(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},o.L=function(){return Ie(this),this.a.concat()},o.get=function(t,e){return je(this.b,t)?this.b[t]:e},o.set=function(t,e){je(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},o.forEach=function(t,e){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Pe=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Re(t,e){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,t instanceof Re){this.a=void 0!==e?e:t.a,Le(this,t.f),this.j=t.j,De(this,t.c),Fe(this,t.h),this.g=t.g,e=t.b;var n=new Qe;n.c=e.c,e.a&&(n.a=new Ae(e.a),n.b=e.b),Ue(this,n),this.i=t.i}else t&&(n=String(t).match(Pe))?(this.a=!!e,Le(this,n[1]||"",!0),this.j=ze(n[2]||""),De(this,n[3]||"",!0),Fe(this,n[4]),this.g=ze(n[5]||"",!0),Ue(this,n[6]||"",!0),this.i=ze(n[7]||"")):(this.a=!!e,this.b=new Qe(null,this.a))}function Ne(t){return new Re(t)}
vendor: 5,664 bytes, line 2
2function Le(t,e,n){t.f=n?ze(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function De(t,e,n){t.c=n?ze(e,!0):e}function Fe(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.h=e}else t.h=null}function Ue(t,e,n){e instanceof Qe?(t.b=e,function(t,e){e&&!t.f&&(Je(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(Ze(this,e),tn(this,n,t))}),t)),t.f=e}(t.b,t.a)):(n||(e=He(e,Xe)),t.b=new Qe(e,t.a))}function Be(t,e,n){t.b.set(e,n)}function Ve(t){return Be(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^y()).toString(36)),t}function ze(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function He(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,qe),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function qe(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Re.prototype.toString=function(){var t=[],e=this.f;e&&t.push(He(e,We,!0),":");var n=this.c;return(n||"file"==e)&&(t.push("//"),(e=this.j)&&t.push(He(e,We,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(He(n,"/"==n.charAt(0)?Ye:Ge,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",He(n,Ke)),t.join("")};var We=/[#\/\?@]/g,Ge=/[#\?:]/g,Ye=/[#\?]/g,Xe=/[#\?@]/g,Ke=/#/g;function Qe(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Je(t){t.a||(t.a=new Ae,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function Ze(t,e){Je(t),e=en(t,e),je(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,je((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Ie(t)))}function $e(t,e){return Je(t),e=en(t,e),je(t.a.b,e)}function tn(t,e,n){Ze(t,e),0<n.length&&(t.c=null,t.a.set(en(t,e),E(n)),t.b+=n.length)}function en(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}(o=Qe.prototype).add=function(t,e){Je(this),this.c=null,t=en(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},o.forEach=function(t,e){Je(this),this.a.forEach((function(n,r){x(n,(function(n){t.call(e,n,r,this)}),this)}),this)},o.L=function(){Je(this);for(var t=this.a.K(),e=this.a.L(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},o.K=function(t){Je(this);var e=[];if("string"===typeof t)$e(this,t)&&(e=T(e,this.a.get(en(this,t))));else{t=this.a.K();for(var n=0;n<t.length;n++)e=T(e,t[n])}return e},o.set=function(t,e){return Je(this),this.c=null,$e(this,t=en(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},o.get=function(t,e){return t&&0<(t=this.K(t)).length?String(t[0]):e},o.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.L(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.K(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var nn=function(t,e){this.b=t,this.a=e};function rn(t){this.g=t||on,u.PerformanceNavigationTiming?t=0<(t=u.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):t=!!(u.ia&&u.ia.ya&&u.ia.ya()&&u.ia.ya().Lb),this.f=t?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}var on=10;function an(t){return!!t.b||!!t.a&&t.a.size>=t.f}function sn(t){return t.b?1:t.a?t.a.size:0}function un(t,e){return t.b?t.b==e:!!t.a&&t.a.has(e)}function cn(t,e){t.a?t.a.add(e):t.b=e}function ln(t,e){t.b&&t.b==e?t.b=null:t.a&&t.a.has(e)&&t.a.delete(e)}function hn(t){var e,n;if(null!=t.b)return t.c.concat(t.b.s);if(null!=t.a&&0!==t.a.size){var r=t.c;try{for(var o=i(t.a.values()),a=o.next();!a.done;a=o.next()){var s=a.value;r=r.concat(s.s)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}return E(t.c)}function fn(){}function dn(){this.a=new fn}function pn(t,e,n){var r=n||"";try{Me(t,(function(t,n){var i=t;h(t)&&(i=Ct(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}}function vn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){}}rn.prototype.cancel=function(){var t,e;if(this.c=hn(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=i(this.a.values()),r=n.next();!r.done;r=n.next()){r.value.cancel()}}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.a.clear()}},fn.prototype.stringify=function(t){return u.JSON.stringify(t,void 0)},fn.prototype.parse=function(t){return u.JSON.parse(t,void 0)};var mn=u.JSON.parse;function gn(t){St.call(this),this.headers=new Ae,this.H=t||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=yn,this.D=this.F=!1}b(gn,St);var yn="",bn=/^https?$/i,_n=["POST","PUT"];function wn(t){return"content-type"==t.toLowerCase()}function xn(t,e){t.b=!1,t.a&&(t.g=!0,t.a.abort(),t.g=!1),t.f=e,t.h=5,Tn(t),Sn(t)}function Tn(t){t.u||(t.u=!0,Ot(t,"complete"),Ot(t,"error"))}function En(t){if(t.b&&"undefined"!=typeof s&&(!t.s[1]||4!=kn(t)||2!=t.W()))if(t.l&&4==kn(t))Vt(t.za,0,t);else if(Ot(t,"readystatechange"),4==kn(t)){t.b=!1;try{var e,n=t.W();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r
2=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.B).match(Pe)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}i=!bn.test(o?o.toLowerCase():"")}e=i}if(e)Ot(t,"complete"),Ot(t,"success");else{t.h=6;try{var c=2<kn(t)?t.a.statusText:""}catch(n){c=""}t.f=c+" ["+t.W()+"]",Tn(t)}}finally{Sn(t)}}}function Sn(t,e){if(t.a){On(t);var n=t.a,r=t.s[0]?c:null;t.a=null,t.s=null,e||Ot(t,"ready");try{n.onreadystatechange=r}catch(i){}}}function On(t){t.a&&t.D&&(t.a.ontimeout=null),t.m&&(u.clearTimeout(t.m),t.m=null)}function kn(t){return t.a?t.a.readyState:0}function Cn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=function(t){var e="";return j(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}(n),"string"===typeof t?null!=n&&encodeURIComponent(String(n)):Be(t,e,n))}function Mn(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function An(t){this.pa=0,this.g=[],this.c=new Xt,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.V=this.i=this.O=this.l=null,this.Oa=this.R=0,this.La=Mn("failFast",!1,t),this.H=this.m=this.j=this.h=this.f=null,this.S=!0,this.I=this.oa=this.P=-1,this.T=this.o=this.u=0,this.Ha=Mn("baseRetryDelayMs",5e3,t),this.Ra=Mn("retryDelaySeedMs",1e4,t),this.Ma=Mn("forwardChannelMaxRetries",2,t),this.ma=Mn("forwardChannelRequestTimeoutMs",2e4,t),this.Na=t&&t.g||void 0,this.D=void 0,this.C=t&&t.supportsCrossDomainXhr||!1,this.J="",this.b=new rn(t&&t.concurrentRequestLimit),this.ka=new dn,this.da=t&&t.fastHandshake||!1,this.Ia=t&&t.b||!1,t&&t.f&&(this.c.a=!1),t&&t.forceLongPolling&&(this.S=!1),this.U=!this.da&&this.S&&t&&t.detectBufferingProxy||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null,(this.Ka=t&&t.c||!1)&&this.c.info("Opt-in to enable Chrome Origin Trials.")}function In(t){if(Pn(t),3==t.v){var e=t.R++,n=Ne(t.B);Be(n,"SID",t.J),Be(n,"RID",e),Be(n,"TYPE","terminate"),Dn(t,n),(e=new ve(t,t.c,e,void 0)).H=2,e.i=Ve(Ne(n)),n=!1,u.navigator&&u.navigator.sendBeacon&&(n=u.navigator.sendBeacon(e.i.toString(),"")),!n&&u.Image&&((new Image).src=e.i,n=!0),n||(e.a=Kn(e.g,null),e.a.ba(e.i)),e.u=y(),Te(e)}Yn(t)}function jn(t){t.a&&(Vn(t),t.a.cancel(),t.a=null)}function Pn(t){jn(t),t.j&&(u.clearTimeout(t.j),t.j=null),Hn(t),t.b.cancel(),t.h&&("number"===typeof t.h&&u.clearTimeout(t.h),t.h=null)}function Rn(t,e){t.g.push(new nn(t.Oa++,e)),3==t.v&&Nn(t)}function Nn(t){an(t.b)||t.h||(t.h=!0,Nt(t.Ba,t),t.u=0)}function Ln(t,e){var n;n=e?e.f:t.R++;var r=Ne(t.B);Be(r,"SID",t.J),Be(r,"RID",n),Be(r,"AID",t.P),Dn(t,r),t.i&&t.l&&Cn(r,t.i,t.l),n=new ve(t,t.c,n,t.u+1),null===t.i&&(n.B=t.l),e&&(t.g=e.s.concat(t.g)),e=Fn(t,n,1e3),n.setTimeout(Math.round(.5*t.ma)+Math.round(.5*t.ma*Math.random())),cn(t.b,n),be(n,r,e)}function Dn(t,e){t.f&&Me({},(function(t,n){Be(e,n,t)}))}function Fn(t,e,n){n=Math.min(t.g.length,n);var r=t.f?m(t.f.Ja,t.f,t):null;t:for(var i=t.g,o=-1;;){var a=["count="+n];-1==o?0<n?(o=i[0].b,a.push("ofs="+o)):o=0:a.push("ofs="+o);for(var s=!0,u=0;u<n;u++){var c=i[u].b,l=i[u].a;if(0>(c-=o))o=Math.max(0,i[u].b-100),s=!1;else try{pn(l,a,"req"+c+"_")}catch(h){r&&r(l)}}if(s){r=a.join("&");break t}}return t=t.g.splice(0,n),e.s=t,r}function Un(t){t.a||t.j||(t.T=1,Nt(t.Aa,t),t.o=0)}function Bn(t){return!(t.a||t.j||3<=t.o)&&(t.T++,t.j=ie(m(t.Aa,t),Wn(t,t.o)),t.o++,!0)}function Vn(t){null!=t.s&&(u.clearTimeout(t.s),t.s=null)}function zn(t){t.a=new ve(t,t.c,"rpc",t.T),null===t.i&&(t.a.B=t.l),t.a.O=0;var e=Ne(t.la);Be(e,"RID","rpc"),Be(e,"SID",t.J),Be(e,"CI",t.H?"0":"1"),Be(e,"AID",t.P),Dn(t,e),Be(e,"TYPE","xmlhttp"),t.i&&t.l&&Cn(e,t.i,t.l),t.D&&t.a.setTimeout(t.D);var n=t.a;t=t.ga,n.H=1,n.i=Ve(Ne(e)),n.j=null,n.I=!0,_e(n,t)}function Hn(t){null!=t.m&&(u.clearTimeout(t.m),t.m=null)}function qn(t,e){var n=null;if(t.a==e){Hn(t),Vn(t),t.a=null;var r=2}else{if(!un(t.b,e))return;n=e.s,ln(t.b,e),r=1}if(t.I=e.N,0!=t.v)if(e.b)if(1==r){n=e.j?e.j.length:0,e=y()-e.u;var i=t.u;Ot(r=Zt(),new re(r,n,e,i)),Nn(t)}else Un(t);else if(3==(i=e.h)||0==i&&0<t.I||!(1==r&&function(t,e){return!(sn(t.b)>=t.b.f-(t.h?1:0))&&(t.h?(t.g=e.s.concat(t.g),!0):!(1==t.v||2==t.v||t.u>
2=(t.La?0:t.Ma))&&(t.h=ie(m(t.Ba,t,e),Wn(t,t.u)),t.u++,!0))}(t,e)||2==r&&Bn(t)))switch(n&&0<n.length&&(e=t.b,e.c=e.c.concat(n)),i){case 1:Gn(t,5);break;case 4:Gn(t,10);break;case 3:Gn(t,6);break;default:Gn(t,2)}}function Wn(t,e){var n=t.Ha+Math.floor(Math.random()*t.Ra);return t.f||(n*=2),n*e}function Gn(t,e){if(t.c.info("Error code "+e),2==e){var n=null;t.f&&(n=null);var r=m(t.Ya,t);n||(n=new Re("//www.google.com/images/cleardot.gif"),u.location&&"http"==u.location.protocol||Le(n,"https"),Ve(n)),function(t,e){var n=new Xt;if(u.Image){var r=new Image;r.onload=g(vn,n,r,"TestLoadImage: loaded",!0,e),r.onerror=g(vn,n,r,"TestLoadImage: error",!1,e),r.onabort=g(vn,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=g(vn,n,r,"TestLoadImage: timeout",!1,e),u.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}(n.toString(),r)}else ne(2);t.v=0,t.f&&t.f.ra(e),Yn(t),Pn(t)}function Yn(t){t.v=0,t.I=-1,t.f&&(0==hn(t.b).length&&0==t.g.length||(t.b.c.length=0,E(t.g),t.g.length=0),t.f.qa())}function Xn(t,e,n){var r=function(t){return t instanceof Re?Ne(t):new Re(t,void 0)}(n);if(""!=r.c)e&&De(r,e+"."+r.c),Fe(r,r.h);else{var i=u.location;r=function(t,e,n,r){var i=new Re(null,void 0);return t&&Le(i,t),e&&De(i,e),n&&Fe(i,n),r&&(i.g=r),i}(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.V&&j(t.V,(function(t,e){Be(r,e,t)})),e=t.A,n=t.na,e&&n&&Be(r,e,n),Be(r,"VER",t.ha),Dn(t,r),r}function Kn(t,e){if(e&&!t.C)throw Error("Can't create secondary domain capable XhrIo object.");return(e=new gn(t.Na)).F=t.C,e}function Qn(){}function Jn(){if(U&&!(10<=Number(Z)))throw Error("Environmental error: no available transport.")}function Zn(t,e){St.call(this),this.a=new An(e),this.o=t,this.b=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.a.l=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.a&&(t?t["X-WebChannel-Client-Profile"]=e.a:t={"X-WebChannel-Client-Profile":e.a}),this.a.O=t,(t=e&&e.httpHeadersOverwriteParam)&&!S(t)&&(this.a.i=t),this.m=e&&e.supportsCrossDomainXhr||!1,this.l=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!S(e)&&(this.a.A=e,null!==(t=this.b)&&e in t&&(e in(t=this.b)&&delete t[e])),this.f=new er(this)}function $n(t){fe.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.c=t)?(t=this.c,this.data=null!==e&&t in e?e[t]:void 0):this.data=e}else this.data=t}function tr(){de.call(this),this.status=1}function er(t){this.a=t}(o=gn.prototype).ba=function(t,e,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+t);e=e?e.toUpperCase():"GET",this.B=t,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?ue(this.H):ue(le),this.a.onreadystatechange=m(this.za,this);try{this.A=!0,this.a.open(e,String(t),!0),this.A=!1}catch(o){return void xn(this,o)}t=n||"";var i=new Ae(this.headers);r&&Me(r,(function(t,e){i.set(e,t)})),r=function(t){t:{for(var e=wn,n=t.length,r="string"===typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"===typeof t?t.charAt(e):t[e]}(i.L()),n=u.FormData&&t instanceof u.FormData,!(0<=w(_n,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(t,e){this.a.setRequestHeader(e,t)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{On(this),0<this.o&&((this.D=function(t){return U&&Q(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=m(this.xa,this)):this.m=Vt(this.xa,this.o,this)),this.l=!0,this.a.send(t),this.l=!1}catch(o){xn(this,o)}},o.xa=function(){"undefined"!=typeof s&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,Ot(this,"timeout"),this.abort(8))},o.abort=function(t){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=t||7,Ot(this,"complete"),Ot(this,"abort"),Sn(this))},o.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),Sn(this,!0)),gn.X.G.call(this)},o.za=function(){this.j||(this.A||this.l||this.g?En(this):this.Ua())},o.Ua=function(){En(this)},o.W=function(){try{return 2<kn(this)?this.a.status:-1}catch(t){return-1}},o.$=function(){try{return this.a?this.a.responseText:""}catch(t){return""}},o.Pa=function(t){if(this.a){var e=this.a.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),mn(e)}},o.ua=function(){return this.h},o.Qa=function(){return"string"===typeof this.f?this.f:String(this.f)},(o=An.prototype).ha=8,o.v=1,o.Ba=function(t){if(this.h)if(this.h=null,1==this.v){if(!t){this.R=Math.floor(1e5*Math.random()),t=this.R++;var e,n=new ve(this,this.c,t,void 0),r=this.l;if(this.O&&(r?N(r=P(r),this.O):r=this.O),null===this.i&&(n.B=r),this.da)t:{for(var i=e=0;i<this.g.length;i++){var o=this.g[i];if(void 0===(o="__data__"in o.a&&"string"===typeof(o=o.a.__data__)?o.length:void 0))break;if(4096<(e+=o)){e=i;break t}if(4096===e||i===this.g.length-1){e=i+1;break t}}e=1e3}else e=1e3;
2e=Fn(this,n,e),Be(i=Ne(this.B),"RID",t),Be(i,"CVER",22),this.A&&Be(i,"X-HTTP-Session-Id",this.A),Dn(this,i),this.i&&r&&Cn(i,this.i,r),cn(this.b,n),this.Ia&&Be(i,"TYPE","init"),this.da?(Be(i,"$req",e),Be(i,"SID","null"),n.U=!0,be(n,i,null)):be(n,i,e),this.v=2}}else 3==this.v&&(t?Ln(this,t):0==this.g.length||an(this.b)||Ln(this))},o.Aa=function(){if(this.j=null,zn(this),this.U&&!(this.F||null==this.a||0>=this.N)){var t=2*this.N;this.c.info("BP detection timer enabled: "+t),this.s=ie(m(this.Ta,this),t)}},o.Ta=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,ne(10),jn(this),zn(this))},o.Sa=function(){null!=this.m&&(this.m=null,jn(this),Bn(this),ne(19))},o.Ya=function(t){t?(this.c.info("Successfully pinged google.com"),ne(2)):(this.c.info("Failed to ping google.com"),ne(1))},(o=Qn.prototype).ta=function(){},o.sa=function(){},o.ra=function(){},o.qa=function(){},o.Ja=function(){},Jn.prototype.a=function(t,e){return new Zn(t,e)},b(Zn,St),Zn.prototype.g=function(){this.a.f=this.f,this.m&&(this.a.C=!0);var t=this.a,e=this.o,n=this.b||void 0;ne(0),t.fa=e,t.V=n||{},t.H=t.S,t.B=Xn(t,null,t.fa),Nn(t)},Zn.prototype.close=function(){In(this.a)},Zn.prototype.h=function(t){if("string"===typeof t){var e={};e.__data__=t,Rn(this.a,e)}else this.l?((e={}).__data__=Ct(t),Rn(this.a,e)):Rn(this.a,t)},Zn.prototype.G=function(){this.a.f=null,delete this.f,In(this.a),delete this.a,Zn.X.G.call(this)},b($n,fe),b(tr,de),b(er,Qn),er.prototype.ta=function(){Ot(this.a,"a")},er.prototype.sa=function(t){Ot(this.a,new $n(t))},er.prototype.ra=function(t){Ot(this.a,new tr(t))},er.prototype.qa=function(){Ot(this.a,"b")},Jn.prototype.createWebChannel=Jn.prototype.a,Zn.prototype.send=Zn.prototype.h,Zn.prototype.open=Zn.prototype.g,Zn.prototype.close=Zn.prototype.close,oe.NO_ERROR=0,oe.TIMEOUT=8,oe.HTTP_ERROR=6,ae.COMPLETE="complete",ce.EventType=he,he.OPEN="a",he.CLOSE="b",he.ERROR="c",he.MESSAGE="d",St.prototype.listen=St.prototype.va,gn.prototype.listenOnce=gn.prototype.wa,gn.prototype.getLastError=gn.prototype.Qa,gn.prototype.getLastErrorCode=gn.prototype.ua,gn.prototype.getStatus=gn.prototype.W,gn.prototype.getResponseJson=gn.prototype.Pa,gn.prototype.getResponseText=gn.prototype.$,gn.prototype.send=gn.prototype.ba;var nr=function(){return new Jn},rr=function(){return Zt()},ir=oe,or=ae,ar=Qt,sr={gb:0,jb:1,kb:2,Db:3,Ib:4,Fb:5,Gb:6,Eb:7,Cb:8,Hb:9,PROXY:10,NOPROXY:11,Ab:12,wb:13,xb:14,vb:15,yb:16,zb:17,bb:18,ab:19,cb:20},ur=ce,cr=gn}).call(this,n(45))},function(t,e,n){"use strict";var r="Invariant failed";e.a=function(t,e){if(!t)throw new Error(r)}},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return T})),n.d(e,"b",(function(){return M})),n.d(e,"d",(function(){return I})),n.d(e,"c",(function(){return v})),n.d(e,"f",(function(){return m})),n.d(e,"e",(function(){return p}));var r=n(25);function i(t){return"/"===t.charAt(0)}function o(t,e){for(var n=e,r=n+1,i=t.length;r<i;n+=1,r+=1)t[n]=t[r];t.pop()}var a=function(t,e){void 0===e&&(e="");var n,r=t&&t.split("/")||[],a=e&&e.split("/")||[],s=t&&i(t),u=e&&i(e),c=s||u;if(t&&i(t)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var l=a[a.length-1];n="."===l||".."===l||""===l}else n=!1;for(var h=0,f=a.length;f>=0;f--){var d=a[f];"."===d?o(a,f):".."===d?(o(a,f),h++):h&&(o(a,f),h--)}if(!c)for(;h--;h)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var p=a.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};function s(t){return t.valueOf?t.valueOf():Object.prototype.valueOf.call(t)}var u=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every((function(e,r){return t(e,n[r])}));if("object"===typeof e||"object"===typeof n){var r=s(e),i=s(n);return r!==e||i!==n?t(r,i):Object.keys(Object.assign({},e,n)).every((function(r){return t(e[r],n[r])}))}return!1},c=n(27);function l(t){return"/"===t.charAt(0)?t:"/"+t}function h(t){return"/"===t.charAt(0)?t.substr(1):t}function f(t,e){return function(t,e){return 0===t.toLowerCase().indexOf(e.toLowerCase())&&-1!=="/?#".indexOf(t.charAt(e.length))}(t,e)?t.substr(e.length):t}function d(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function p(t){var e=t.pathname,n=t.search,r=t.hash,i=e||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function v(t,e,n,i){var o;"string"===typeof t?(o=function(t){var e=t||"/",n="",r="",i=e.indexOf("#");-1!==i&&(r=e.substr(i),e=e.substr(0,i));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(o=Object(r.a)({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invali
2d percent-encoding.'):s}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function m(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&u(t.state,e.state)}function g(){var t=null;var e=[];return{setPrompt:function(e){return t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,r,i){if(null!=t){var o="function"===typeof t?t(e,n):t;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(t){var n=!0;function r(){n&&t.apply(void 0,arguments)}return e.push(r),function(){n=!1,e=e.filter((function(t){return t!==r}))}},notifyListeners:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.forEach((function(t){return t.apply(void 0,n)}))}}}var y=!("undefined"===typeof window||!window.document||!window.document.createElement);function b(t,e){e(window.confirm(t))}var _="popstate",w="hashchange";function x(){try{return window.history.state||{}}catch(t){return{}}}function T(t){void 0===t&&(t={}),y||Object(c.a)(!1);var e=window.history,n=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history}(),i=!(-1===window.navigator.userAgent.indexOf("Trident")),o=t,a=o.forceRefresh,s=void 0!==a&&a,u=o.getUserConfirmation,h=void 0===u?b:u,m=o.keyLength,T=void 0===m?6:m,E=t.basename?d(l(t.basename)):"";function S(t){var e=t||{},n=e.key,r=e.state,i=window.location,o=i.pathname+i.search+i.hash;return E&&(o=f(o,E)),v(o,r,n)}function O(){return Math.random().toString(36).substr(2,T)}var k=g();function C(t){Object(r.a)(B,t),B.length=e.length,k.notifyListeners(B.location,B.action)}function M(t){(function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")})(t)||j(S(t.state))}function A(){j(S(x()))}var I=!1;function j(t){if(I)I=!1,C();else{k.confirmTransitionTo(t,"POP",h,(function(e){e?C({action:"POP",location:t}):function(t){var e=B.location,n=R.indexOf(e.key);-1===n&&(n=0);var r=R.indexOf(t.key);-1===r&&(r=0);var i=n-r;i&&(I=!0,L(i))}(t)}))}}var P=S(x()),R=[P.key];function N(t){return E+p(t)}function L(t){e.go(t)}var D=0;function F(t){1===(D+=t)&&1===t?(window.addEventListener(_,M),i&&window.addEventListener(w,A)):0===D&&(window.removeEventListener(_,M),i&&window.removeEventListener(w,A))}var U=!1;var B={length:e.length,action:"POP",location:P,createHref:N,push:function(t,r){var i="PUSH",o=v(t,r,O(),B.location);k.confirmTransitionTo(o,i,h,(function(t){if(t){var r=N(o),a=o.key,u=o.state;if(n)if(e.pushState({key:a,state:u},null,r),s)window.location.href=r;else{var c=R.indexOf(B.location.key),l=R.slice(0,c+1);l.push(o.key),R=l,C({action:i,location:o})}else window.location.href=r}}))},replace:function(t,r){var i="REPLACE",o=v(t,r,O(),B.location);k.confirmTransitionTo(o,i,h,(function(t){if(t){var r=N(o),a=o.key,u=o.state;if(n)if(e.replaceState({key:a,state:u},null,r),s)window.location.replace(r);else{var c=R.indexOf(B.location.key);-1!==c&&(R[c]=o.key),C({action:i,location:o})}else window.location.replace(r)}}))},go:L,goBack:function(){L(-1)},goForward:function(){L(1)},block:function(t){void 0===t&&(t=!1);var e=k.setPrompt(t);return U||(F(1),U=!0),function(){return U&&(U=!1,F(-1)),e()}},listen:function(t){var e=k.appendListener(t);return F(1),function(){F(-1),e()}}};return B}var E="hashchange",S={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+h(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:h,decodePath:l},slash:{encodePath:l,decodePath:l}};function O(t){var e=t.indexOf("#");return-1===e?t:t.slice(0,e)}function k(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)}function C(t){window.location.replace(O(window.location.href)+"#"+t)}function M(t){void 0===t&&(t={}),y||Object(c.a)(!1);var e=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),t),i=n.getUserConfirmation,o=void 0===i?b:i,a=n.hashType,s=void 0===a?"slash":a,u=t.basename?d(l(t.basename)):"",h=S[s],m=h.encodePath,_=h.decodePath;function w(){var t=_(k());return u&&(t=f(t,u)),v(t)}var x=g();function T(t){Object(r.a)(B,t),B.length=e.length,x.notifyListeners(B.location,B.action)}var M=!1,A=null;function I(){var t,e,n=k(),r=m(n);if(n!==r)C(r);else{var i=w(),a=B.location;if(!M&&(e=i,(t=a).pathname===e.pathname&&t.search===e.search&&t.hash===e.hash))return;if(A===p(i))return;A=null,function(t){if(M)M=!1,T();else{var e="POP";x.confirmTransitionTo(t,e,o,(function(n){n?T({action:e,location:t}):function(t){var e=B.location,n=N.lastIndexOf(p(e));-1===n&&(n=0);var r=N.lastIndexOf(p(t));-1===r&&(r=0);var i=n-r;i&&(M=!0,L(i))}(t)}))}}(i)}}var j=k(),P=m(j);j!==P&&C(P);var R=w(),N=[p(R)];function L(t){e.go(t)}var D=0;function F(t){1===(D+=t)&&1===t?window.addEventListener(E,I):0===D&&window.removeEventListener(E,I)}var U=!1;var B={length:e.length,action:"POP",location:R,createHref:function(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=O(window.location.href)),n+"#"+m(u+p(t))},push:function(t,e){var n="PUSH",r=v(t,void 0,void 0,B.location);x.confirmTransitionTo(r,n,o,(function(t){if(t){var e=p(r),i=m(u+e);if(k()!==i){A=e,function(t){window.location.hash=t}(i);var o=N.lastIndexOf(p(B.location)),a=N.slice(0,o+1);a.push(e),N=a,T({action:n,location:r})}else T()}}))},replace:function(t,e){var n="REPLACE",r=v(t,void 0,void 0,B.location);x.confirmTransitionTo(r,n,o,(function(t){if(t){var e=p(r),i=m(u+e);k()!==i&&(A=e,C(i));var o=N.indexOf(p(B.location));-1!==o&&(N[o]=e),T({action:n,location:r})}}))},go:L,goBack:function(){L(-1)},goForward:function(){L(1)},block:function(t){void 0===t&&(t=!1);var e=x.setPrompt(t);return U||(F(1),U=!0),function(){return U&&(U=!1,F(-1)),e()}},listen:function(t){var e=x.appendListener(t);return F(1),function(){F(-1),e()}}};return B}function A(t,e,n){return Math.min(Math.max(t,e),n)}function I(t){void 0===t&&(t={});var e=t,n=e.getUserConfirmation,i=e.initialEntries,o=void 0===i?["/"]:i,a=e.initialIndex,s=void 0===a?0:a,u=e.keyLength,c=void 0===u?6:u,l=g();function h(t){Object(r.a)(_,t),_.length=_.entries.length,l.notifyListeners(_.location,_.action)}function f(){return Math.random().toString(36).substr(2,c)}var d=A(s,0,o.length-1),m=o.map((function(t){return v(t,void 0,"string"===typeof t?f():t.key||f())})),y=p;function b(t){var e=A(_.index+t,0,_.entries.length-1),r=_.entries[e];l.confirmTransitionTo(r,"POP",n,(function(t){t?h({action:"POP",location:r,index:e}):h()}))}var _={length:m.length,action:"POP",location:m[d],index:d,entries:m,createHref:y,push:function(t,e){var r="PUSH",i=v(t,e,f(),_.location);l.confirmTransitionTo(i,r,n,(function(t){if(t){var e=_.index+1,n=_.entries.slice(0);n.length>e?n.splice(e,n.length-e,i):n.push(i),h({action:r,location:i,index:e,entries:n})}}))},replace:function(t,e){var r="REPLACE",i=v(t,e,f(),_.location);l.confirmTransitionTo(i,r,n,(function(t){t&&(_.entries[_.index]=i,h({action:r,location:i}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(t){var e=_.index+t;return e>=0&&e<_.entries.length},block:function(t){return void 0===t&&(t=!1),l.setPrompt(t)},listen:function(t){return l.appendListener(t)}};return _}},function(t,e,n){"use strict";n.d(e,"a",(function(){return Ka})),n.d(e,"c",(function(){return Ho})),n.d(e,"b",(function(){return ds}));
2var r="14.7.77",i=n(35),o=n(14),a=n(1),s=new WeakSet,u=new WeakMap,c=new WeakMap,l=new WeakMap,h=new WeakMap,f=new WeakMap,d=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,g={construct:function(){return g}},y=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,b=function(t,e){for(var n=[],r=t.replace(/^[\s]+/,""),i=r.match(y);null!==i;){var o=i[1].slice(1,-1),a=i[0].replace(/([\s]+)?;?$/,"").replace(o,new URL(o,e).toString());n.push(a),i=(r=r.slice(i[0].length).replace(/^[\s]+/,"")).match(y)}return[n.join(";"),r]},_=function(t){if(void 0!==t&&!Array.isArray(t))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},w=function(t){if(!function(t){try{new new Proxy(t,g)}catch(e){return!1}return!0}(t))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===t.prototype||"object"!==typeof t.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},x=function(t,e){var n=t.get(e);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},T=function(t,e){var n=Array.from(t).filter(e);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");var r=Object(o.a)(n,1)[0];return t.delete(r),r},E=function(t,e,n,r){var i=x(t,e),o=T(i,(function(t){return t[0]===n&&t[1]===r}));return 0===i.size&&t.delete(e),o},S=function(t){return x(d,t)},O=function(t){if(s.has(t))throw new Error("The AudioNode is already stored.");s.add(t),S(t).forEach((function(t){return t(!0)}))},k=function(t){return"port"in t},C=function(t){if(!s.has(t))throw new Error("The AudioNode is not stored.");s.delete(t),S(t).forEach((function(t){return t(!1)}))},M=function(t,e){!k(t)&&e.every((function(t){return 0===t.size}))&&C(t)},A=n(12),I=n(2),j=n(3),P=n(4),R={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},N=n(11),L=n.n(N),D=n(16),F=function(t,e){return t.context===e},U=function(t){try{t.copyToChannel(new Float32Array(1),0,-1)}catch(e){return!1}return!0},B=function(){return new DOMException("","IndexSizeError")},V=function(t){var e;t.getChannelData=(e=t.getChannelData,function(n){try{return e.call(t,n)}catch(r){if(12===r.code)throw B();throw r}})},z={numberOfChannels:1},H=n(10),q=-34028234663852886e22,W=-q,G=function(t){return s.has(t)},Y={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},X=n(17),K=n(20),Q=function(t){return x(u,t)},J=function(t){return x(l,t)},Z=function t(e,n){Q(e).activeInputs.forEach((function(r){return r.forEach((function(r){var i=Object(o.a)(r,1)[0];n.includes(e)||t(i,[].concat(Object(X.a)(n),[e]))}))}));var r,i=function(t){return"playbackRate"in t}(e)?[e.playbackRate]:k(e)?Array.from(e.parameters.values()):function(t){return"frequency"in t&&"gain"in t}(e)?[e.Q,e.detune,e.frequency,e.gain]:function(t){return"offset"in t}(e)?[e.offset]:function(t){return!("frequency"in t)&&"gain"in t}(e)?[e.gain]:function(t){return"detune"in t&&"frequency"in t}(e)?[e.detune,e.frequency]:function(t){return"pan"in t}(e)?[e.pan]:[],a=Object(K.a)(i);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=J(s);void 0!==u&&u.activeInputs.forEach((function(e){var r=Object(o.a)(e,1)[0];return t(r,n)}))}}catch(c){a.e(c)}finally{a.f()}G(e)&&C(e)},$=function(t){Z(t.destination,[])},tt=function(t){return void 0===t||"number"===typeof t||"string"===typeof t&&("balanced"===t||"interactive"===t||"playback"===t)},et=function(t){return"context"in t},nt=function(t){return et(t[0])},rt=function(t,e,n,r){var i,o=Object(K.a)(t);try{for(o.s();!(i=o.n()).done;){if(n(i.value)){if(r)return!1;throw Error("The set contains at least one similar element.")}}}catch(a){o.e(a)}finally{o.f()}return t.add(e),!0},it=function(t,e,n,r){var i=Object(o.a)(n,2),a=i[0],s=i[1];rt(t,[e,a,s],(function(t){return t[0]===e&&t[1]===a}),r)},ot=function(t,e,n){var r=Object(o.a)(e,3),i=r[0],a=r[1],s=r[2],u=t.get(i);void 0===u?t.set(i,new Set([[a,s]])):rt(u,[a,s],(function(t){return t[0]===a}),n)},at=function(t){return"inputs"in t},st=function(t,e,n,r){if(at(e)){var i=e.inputs[r];return t.connect(i,n,0),[i,n,0]}return t.connect(e,n,r),[e,n,r]},ut=function(t,e,n){var r,i=Object(K.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o[0]===e&&o[1]===n)return t.delete(o),o}}catch(a){i.e(a)}finally{i.f()}return null},ct=function(t,e){if(!S(t).delete(e))throw new Error("Missing the expected event listener.")},lt=function(t,e,n){var r=x(t,e),i=T(r,(function(t){return t[0]===n}));return 0===r.size&&t.delete(e),i}
2,ht=function(t,e,n,r){at(e)?t.disconnect(e.inputs[r],n,0):t.disconnect(e,n,r)},ft=function(t){return x(c,t)},dt=function(t){return x(h,t)},pt=function(t){return p.has(t)},vt=function(t){return!s.has(t)},mt=function(t){return new Promise((function(e){var n=t.createScriptProcessor(256,1,1),r=t.createGain(),i=t.createBuffer(1,2,44100),o=i.getChannelData(0);o[0]=1,o[1]=1;var a=t.createBufferSource();a.buffer=i,a.loop=!0,a.connect(n).connect(t.destination),a.connect(r),a.disconnect(r),n.onaudioprocess=function(r){var i=r.inputBuffer.getChannelData(0);Array.prototype.some.call(i,(function(t){return 1===t}))?e(!0):e(!1),a.stop(),n.onaudioprocess=null,a.disconnect(n),n.disconnect(t.destination)},a.start()}))},gt=function(t,e){var n,r=new Map,i=Object(K.a)(t);try{for(i.s();!(n=i.n()).done;){var o,a=n.value,s=Object(K.a)(a);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=r.get(u);r.set(u,void 0===c?1:c+1)}}catch(l){s.e(l)}finally{s.f()}}}catch(l){i.e(l)}finally{i.f()}r.forEach((function(t,n){return e(n,t)}))},yt=function(t){return"context"in t},bt=function(t,e,n,r){var i=J(e),o=i.activeInputs,a=i.passiveInputs,s=Q(t).outputs,u=S(t),c=function(i){var s=ft(t),u=dt(e);if(i){var c=lt(a,t,n);it(o,t,c,!1),r||pt(t)||s.connect(u,n)}else{var l=function(t,e,n){return T(t,(function(t){return t[0]===e&&t[1]===n}))}(o,t,n);ot(a,l,!1),r||pt(t)||s.disconnect(u,n)}};return!!rt(s,[e,n],(function(t){return t[0]===e&&t[1]===n}),!0)&&(u.add(c),G(t)?it(o,t,[n,c],!0):ot(a,[t,n,c],!0),!0)},_t=function(t,e,n,r,i){var a=function(t,e,n,r){var i=Q(e),o=i.activeInputs,a=i.passiveInputs,s=ut(o[r],t,n);return null===s?[E(a,t,n,r)[2],!1]:[s[2],!0]}(t,n,r,i),s=Object(o.a)(a,2),u=s[0],c=s[1];if(null!==u&&(ct(t,u),!c||e||pt(t)||ht(ft(t),ft(n),r,i)),G(n)){var l=Q(n).activeInputs;M(n,l)}},wt=function(t,e,n,r){var i=function(t,e,n){var r=J(e),i=r.activeInputs,o=r.passiveInputs,a=ut(i,t,n);return null===a?[lt(o,t,n)[1],!1]:[a[2],!0]}(t,n,r),a=Object(o.a)(i,2),s=a[0],u=a[1];null!==s&&(ct(t,s),!u||e||pt(t)||ft(t).disconnect(dt(n),r))},xt=function(){function t(e){Object(a.a)(this,t),this._map=new Map(e)}return Object(I.a)(t,[{key:"size",get:function(){return this._map.size}},{key:"entries",value:function(){return this._map.entries()}},{key:"forEach",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._map.forEach((function(r,i){return t.call(n,r,i,e)}))}},{key:"get",value:function(t){return this._map.get(t)}},{key:"has",value:function(t){return this._map.has(t)}},{key:"keys",value:function(){return this._map.keys()}},{key:"values",value:function(){return this._map.values()}}]),t}(),Tt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},Et=n(18);function St(t,e,n,r,i){if("function"===typeof t.copyFromChannel)0===e[n].byteLength&&(e[n]=new Float32Array(128)),t.copyFromChannel(e[n],r,i);else{var o=t.getChannelData(r);if(0===e[n].byteLength)e[n]=o.slice(i,i+128);else{var a=new Float32Array(o.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);e[n].set(a)}}}var Ot=function(t,e,n,r,i){"function"===typeof t.copyToChannel?0!==e[n].byteLength&&t.copyToChannel(e[n],r,i):0!==e[n].byteLength&&t.getChannelData(r).set(e[n],i)},kt=function(t,e){for(var n=[],r=0;r<t;r+=1){for(var i=[],o="number"===typeof e?e:e[r],a=0;a<o;a+=1)i.push(new Float32Array(128));n.push(i)}return n},Ct=function(t,e){var n=x(m,t),r=ft(e);return x(n,r)},Mt=function(){var t=Object(D.a)(L.a.mark((function t(e,n,r,i,o,a,s){var u,c,l,h,f,d,p,v,m,g,y;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=null===n?128*Math.ceil(e.context.length/128):n.length,c=i.channelCount*i.numberOfInputs,l=o.reduce((function(t,e){return t+e}),0),h=0===l?null:r.createBuffer(l,u,r.sampleRate),void 0!==a){t.next=6;break}throw new Error("Missing the processor constructor.");case 6:return f=Q(e),t.next=9,Ct(r,e);case 9:d=t.sent,p=kt(i.numberOfInputs,i.channelCount),v=kt(i.numberOfOutputs,o),m=Array.from(e.parameters.keys()).reduce((function(t,e){return Object(A.a)(Object(A.a)({},t),{},Object(Et.a)({},e,new Float32Array(128)))}),{}),g=function(t){if(i.numberOfInputs>0&&null!==n)for(var u=0;u<i.numberOfInputs;u+=1)for(var l=0;l<i.channelCount;l+=1)St(n,p[u],l,l,t);void 0!==a.parameterDescriptors&&null!==n&&a.parameterDescriptors.forEac
2h((function(e,r){var i=e.name;St(n,m,i,c+r,t)}));for(var g=0;g<i.numberOfInputs;g+=1)for(var y=0;y<o[g];y+=1)0===v[g][y].byteLength&&(v[g][y]=new Float32Array(128));try{var b=p.map((function(t,e){return 0===f.activeInputs[e].size?[]:t})),_=s(t/r.sampleRate,r.sampleRate,(function(){return d.process(b,v,m)}));if(null!==h)for(var w=0,x=0;w<i.numberOfOutputs;w+=1){for(var T=0;T<o[w];T+=1)Ot(h,v[w],T,x+T,t);x+=o[w]}if(!_)return"break"}catch(E){return e.dispatchEvent(new ErrorEvent("processorerror",{colno:E.colno,filename:E.filename,lineno:E.lineno,message:E.message})),"break"}},y=0;case 15:if(!(y<u)){t.next=22;break}if("break"!==g(y)){t.next=19;break}return t.abrupt("break",22);case 19:y+=128,t.next=15;break;case 22:return t.abrupt("return",h);case 23:case"end":return t.stop()}}),t)})));return function(e,n,r,i,o,a,s){return t.apply(this,arguments)}}(),At={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},It={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},jt={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},Pt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},Rt={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Nt=function(t){var e=new MessageChannel,n=e.port1,r=e.port2;return new Promise((function(e){r.onmessage=function(){n.close(),r.close(),e()},n.postMessage(t,[t])}))},Lt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Dt=function(t,e,n){var r=e[n];if(void 0===r)throw t();return r},Ft={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Ut={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},Bt=function(){return new DOMException("","InvalidStateError")},Vt=function(){return new DOMException("","InvalidAccessError")},zt={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Ht=function(t,e,n,r,i,o,a,s,u,c,l){for(var h=c.length,f=s,d=0;d<h;d+=1){for(var p=n[0]*c[d],v=1;v<i;v+=1){var m=f-v&u-1;p+=n[v]*o[m],p-=t[v]*a[m]}for(var g=i;g<r;g+=1)p+=n[g]*o[f-g&u-1];for(var y=i;y<e;y+=1)p-=t[y]*a[f-y&u-1];o[f]=c[d],a[f]=p,f=f+1&u-1,l[d]=p}return f},qt=function(t,e,n,r){var i=n instanceof Float64Array?n:new Float64Array(n),o=r instanceof Float64Array?r:new Float64Array(r),a=i.length,s=o.length,u=Math.min(a,s);if(1!==i[0]){for(var c=0;c<a;c+=1)o[c]/=i[0];for(var l=1;l<s;l+=1)i[l]/=i[0]}for(var h=new Float32Array(32),f=new Float32Array(32),d=e.createBuffer(t.numberOfChannels,t.length,t.sampleRate),p=t.numberOfChannels,v=0;v<p;v+=1){var m=t.getChannelData(v),g=d.getChannelData(v);h.fill(0),f.fill(0),Ht(i,a,o,s,u,h,f,0,32,m,g)}return d},Wt={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},Gt=function(t){var e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{var n=t.decodeAudioData(e.buffer,(function(){}));return void 0!==n&&(n.catch((function(){})),!0)}catch(r){}return!1},Yt={numberOfChannels:1},Xt=function(t,e,n){var r=e[n];void 0!==r&&r!==t[n]&&(t[n]=r)},Kt=function(t,e){Xt(t,e,"channelCount"),Xt(t,e,"channelCountMode"),Xt(t,e,"channelInterpretation")},Qt=function(t){return"function"===typeof t.getFloatTimeDomainData},Jt=function(t,e,n){var r=e[n];void 0!==r&&r!==t[n].value&&(t[n].value=r)},Zt=function(t){var e;t.start=(e=t.start,function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0;if("number"===typeof i&&i<0||r<0||n<0)throw new RangeError("The parameters can't be negative.");e.call(t,n,r,i)})},$t=function(t){var e;t.stop=(e=t.stop,function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(n<0)throw new RangeError("The parameter can't be negative.");e.call(t,n)})},te=function(t,e){return null===t?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(t*e)))))},ee=function(t){return new Promise((function(e,n){var r=new MessageChannel,i=r.port1,o=r.port2;i.onmessage=function(t){var n=t.data;i.close(),o.close(),e(n)},i.onmessageerror=function(t){var e=t.data;i.close(),o.close(),n(e)},o.postMessage(t)}))},ne=function(){var t=Object(D.a)(L.a.mark((function t(e,n){var r;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ee(n);case 2:return r=t.sent,t.abrupt("return",new e(r));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),re=function(t,e){var n=t.createBiquadFilter();return Kt(n,e),Jt(n,e,"Q"),Jt(n,e,"detune"),Jt(n,e,"frequency"),Jt(n,e,"gain"),Xt(n,e,"type"),n},ie=function(t,e){var n=t.createChannelSplitter(e.numberOfOutputs);return Kt(n,e),function(t){var e=t.numberOfOutputs;Object.defineProperty(t,"channelCount",{get:function(){return e},set:function(t){if(t!==e)throw Bt()}}),Object.defineProperty(t,"channelCountMode",{get:function(){return"explicit"},set:function(t){if("explicit"!==t)throw Bt()}}),Object.defineProperty(t,"channelInterpretation",{get:function(){return"discrete"},set:function(t){if("discrete"!==t)throw Bt()}})}(n),n};function oe(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var ae=function(t,e){return t.connect=e.connect.bind(e),t.disconnect=e.disconnect.bind(e),t},se=function(t,e){var n=t.createDelay(e.maxDelayTime);return Kt(n,e),Jt(n,e,"delayTime"),n},ue=function(t,e){var n=t.createGain();return Kt(n,e),Jt(n,e,"gain"),n};function ce(t,e){var n=e[0]*e[0]+e[1]*e[1];return[(t[0]*e[0]+t[1]*e[1])/n,(t[1]*e[0]-t[0]*e[1])/n]}function le(t,e){for(var n,r,i=[0,0],o=t.length-1;o>=0;o-=1)r=e,(i=[(n=i)[0]*r[0]-n[1]*r[1],n[0]*r[1]+n[1]*r[0]])[0]+=t[o];return i}var he,fe,de,pe,ve,me,ge,ye,be,_e,we,xe,Te,Ee,Se,Oe,ke,Ce,Me,Ae,Ie,je,Pe,Re,Ne,Le,De,Fe,Ue,Be,Ve,ze,He,qe,We,Ge,Ye,Xe,Ke,Qe,Je,Ze,$e,tn,en,nn,rn,on,an,sn,un,cn,ln,hn,fn,dn,pn,vn,mn,gn,yn,bn,_n=function(t,e,n,r){return t.createScriptProcessor(e,n,r)},wn=function(){return new DOMException("","NotSupportedError")},xn={numberOfChannels:1},Tn={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},En={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},Sn={disableNormalization:!1},On={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},kn=function(){return new DOMException("","UnknownError")},Cn={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},Mn=function(t){if(null===t)return!1;var e=t.length;return e%2!==0?0!==t[Math.floor(e/2)]:t[e/2-1]+t[e/2]!==0},An=function(t,e,n,r){for(var i=Object.getPrototypeOf(t);!i.hasOwnProperty(e);)i=Object.getPrototypeOf(i);var o=Object.getOwnPropertyDescriptor(i,e),a=o.get,s=o.set;Object.defineProperty(t,e,{get:n(a),set:r(s)})},In=function(t){var e=t.createOscillator();try{e.start(-1)}catch(n){return n instanceof RangeError}return!1},jn=function(t){var e=t.createBuffer(1,1,44100),n=t.createBufferSource();n.buffer=e,n.start(),n.stop();try{return n.stop(),!0}catch(r){return!1}},Pn=function(t){var e=t.createOscillator();try{e.stop(-1)}catch(n){return n instanceof RangeError}return!1},Rn=function(t,e){var n=e.createGain();t.connect(n);var r,i=(r=t.disconnect,function(){r.call(t,n),t.removeEventListener("ended",i)});t.addEventListener("ended",i),ae(t,n),t.stop=function(e){var r=!1;return function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(r)try{e.call(t,i)}catch(o){n.gain.setValueAtTime(0,i)}else e.call(t,i),r=!0}}(t.stop)},Nn=function(t,e){return function(n){var r={value:t};return Object.defineProperties(n,{currentTarget:r,target:r}),"function"===typeof e?e.call(t,n):e.handleEvent.call(t,n)}},Ln=(he=rt,function(t,e,n,r){var i=Object(o.a)(n,3),a=i[0],s=i[1],u=i[2];he(t[s],[e,a,u],(function(t){return t[0]===e&&t[1]===a}),r)}),Dn=function(t){return function(e,n,r,i){var a=Object(o.a)(r,3),s=a[0],u=a[1],c=a[2],l=e.get(s);void 0===l?e.set(s,new Set([[u,n,c]])):t(l,[u,n,c],(function(t){return t[0]===u&&t[1]===n}),i)}}(rt),Fn=(fe=T,function(t,e,n,r){return fe(t[r],(function(t){return t[0]===e&&t[1]===n}))}),Un=new WeakMap,Bn=function(t){return function(e){var n;return null!==(n=t.get(e))&&void 0!==n?n:0}}(Un),Vn=(de=new Map,pe=new WeakMap,function(t,e){var n=pe.get(t);if(void 0!==n)return n;var r=de.get(t);if(void 0!==r)return r;try{var i=e();return i instanceof Promise?(de.set(t,i),i.catch((function(){return!1})).then((function(e){return de.delete(t),pe.set(t,e),e}))):(pe.set(t,i),i)}catch(o){return pe.set(t,!1),!1}}),zn="undefined"===typeof window?null:window,Hn=(ve=Vn,me=B,function(t,e){var n=t.createAnalyser();if(Kt(n,e),!(e.maxDecibels>e.minDecibels))throw me();return Xt(n,e,"fftSize"),Xt(n,e,"maxDecibels"),Xt(n,e,"minDecibels"),Xt(n,e,"smoothingTimeConstant"),ve(Qt,(function(){return Qt(n)}))||function(t){t.getFloatTimeDomainData=function(e){var n=new Uint8Array(e.length);t.getByteTimeDomainData(n);for(var r=Math.max(n.length,t.fftSize),i=0;i<r;i+=1)e[i]=.0078125*(n[i]-128);return e}}(n),n}),qn=(ge=Q,function(t){var e=ge(t);if(null===e.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return e.renderer}),Wn=function(t,e,n){return function(){var r=Object(D.a)(L.a.mark((function r(i,a,s,u){var c,l;return L.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c=t(i),l=[].concat(Object(X.a)(u),[i]),r.next=4,Promise.all(c.activeInputs.map((function(t,r){return Array.from(t).filter((function(t){var e=Object(o.a)(t,1)[0];return!l.includes(e)})).map(function(){var t=Object(D.a)(L.a.mark((function t(u){var c,h,f,d,p,v;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=Object(o.a)(u,2),h=c[0],f=c[1],d=e(h),t.next=4,d.render(h,a,l);case 4:p=t.sent,v=i.context.destination,n(h)||i===v&&n(i)||p.connect(s,f,r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})).reduce((function(t,e){return[].concat(Object(X.a)(t),Object(X.a)(e))}),[]));case 4:case"end":return r.stop()}}),r)})));return function(t,e,n,i){return r.apply(this,arguments)}}()}(Q,qn,pt),Gn=(ye=Hn,be=ft,_e=Wn,function(){var t=new WeakMap,e=function(){var e=Object(D.a)(L.a.mark((function e(n,r,i){var o,a;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=be(n),F(o,r)||(a={channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,fftSize:o.fftSize,maxDecibels:o.maxDecibels,minDecibels:o.minDecibels,smoothingTimeConstant:o.smoothingTimeConstant},o=ye(r,a)),t.set(r,o),e.next=6,_e(n,r,o,i);case 6:return e.abrupt("return",o);case 7:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();return{render:function(n,r,i){var o=t.get(r);return void 0!==o?Promise.resolve(o):e(n,r,i)}}}),Yn=(we=f,function(t){var e=we.get(t);if(void 0===e)throw Bt();return e}),Xn=function(t){return null===t?null:t.hasOwnProperty("OfflineAudioContext")?t.OfflineAudioContext:t.hasOwnProperty("webkitOfflineAudioContext")?t.webkitOfflineAudioContext:null}(zn),Kn=(xe=Xn,function(t){return null!==xe&&t instanceof xe}),Qn=new WeakMap,Jn=(Te=Nn,function(){function t(e){Object(a.a)(this,t),this._nativeEventTarget=e,this._listeners=new WeakMap}return Object(I.a)(t,[{key:"addEventListener",value:function(t,e,n){if(null!==e){var r=this._listeners.get(e);void 0===r&&(r=Te(this,e),"function"===typeof e&&this._listeners.set(e,r)),this._nativeEventTarget.addEventListener(t,r,n)}}},{key:"dispatchEvent",value:function(t){return this._nativeEventTarget.dispatchEvent(t)}},{key:"removeEventListener",value:function(t,e,n){var r=null===e?void 0:this._listeners.get(e);this._nativeEventTarget.removeEventListener(t,void 0===r?null:r,n)}}]),t}()),Zn=function(t){return null===t?null:t.hasOwnProperty("AudioContext")?t.AudioContext:t.hasOwnProperty("webkitAudioContext")?t.webkitAudioContext:null}(zn),$n=(Ee=Zn,function(t){return null!==Ee&&t instanceof Ee}),tr=function(t){return function(e){return null!==t&&"function"===typeof t.AudioNode&&e instanceof t.AudioNode}}(zn),er=function(t){return function(e){return null!==t&&"function"===typeof t.AudioParam&&e instanceof t.AudioParam}}(zn),nr=function(t,e,n,r,i,s,u,l,h,f,p,v,m,g,y){return function(f){Object(j.a)(_,f);var b=Object(P.a)(_);function _(e,r,i,s){var u;
2Object(a.a)(this,_),(u=b.call(this,i))._context=e,u._nativeAudioNode=i;var l=p(e);return v(l)&&!0!==n(mt,(function(){return mt(l)}))&&function(t){var e,n,r=new Map;t.connect=(e=t.connect.bind(t),function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=yt(t)?e(t,n,i):e(t,n),a=r.get(t);return void 0===a?r.set(t,[{input:i,output:n}]):a.every((function(t){return t.input!==i||t.output!==n}))&&a.push({input:i,output:n}),o}),t.disconnect=(n=t.disconnect,function(e,i,a){if(n.apply(t),void 0===e)r.clear();else if("number"===typeof e){var s,u=Object(K.a)(r);try{for(u.s();!(s=u.n()).done;){var c=Object(o.a)(s.value,2),l=c[0],h=c[1].filter((function(t){return t.output!==e}));0===h.length?r.delete(l):r.set(l,h)}}catch(g){u.e(g)}finally{u.f()}}else if(r.has(e))if(void 0===i)r.delete(e);else{var f=r.get(e);if(void 0!==f){var d=f.filter((function(t){return t.output!==i&&(t.input!==a||void 0===a)}));0===d.length?r.delete(e):r.set(e,d)}}var p,v=Object(K.a)(r);try{var m=function(){var e=Object(o.a)(p.value,2),n=e[0];
2e[1].forEach((function(e){yt(n)?t.connect(n,e.output,e.input):t.connect(n,e.output)}))};for(v.s();!(p=v.n()).done;)m()}catch(g){v.e(g)}finally{v.f()}})}(i),c.set(Object(H.a)(u),i),d.set(Object(H.a)(u),new Set),"closed"!==e.state&&r&&O(Object(H.a)(u)),t(Object(H.a)(u),s,i),u}return Object(I.a)(_,[{key:"channelCount",get:function(){return this._nativeAudioNode.channelCount},set:function(t){this._nativeAudioNode.channelCount=t}},{key:"channelCountMode",get:function(){return this._nativeAudioNode.channelCountMode},set:function(t){this._nativeAudioNode.channelCountMode=t}},{key:"channelInterpretation",get:function(){return this._nativeAudioNode.channelInterpretation},set:function(t){this._nativeAudioNode.channelInterpretation=t}},{key:"context",get:function(){return this._context}},{key:"numberOfInputs",get:function(){return this._nativeAudioNode.numberOfInputs}},{key:"numberOfOutputs",get:function(){return this._nativeAudioNode.numberOfOutputs}},{key:"connect",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw i();var a=p(this._context),c=y(a);if(m(t)||g(t))throw s();if(et(t)){var l=ft(t);try{var f,d=st(this._nativeAudioNode,l,n,o),v=vt(this);if(c||v)(f=this._nativeAudioNode).disconnect.apply(f,Object(X.a)(d));"closed"!==this.context.state&&!v&&vt(t)&&O(t)}catch(E){if(12===E.code)throw s();throw E}var b=e(this,t,n,o,c);if(b){var _=h([this],t);gt(_,r(c))}return t}var w=dt(t);if("playbackRate"===w.name&&1024===w.maxValue)throw u();try{this._nativeAudioNode.connect(w,n),(c||vt(this))&&this._nativeAudioNode.disconnect(w,n)}catch(E){if(12===E.code)throw s();throw E}var x=bt(this,t,n,c);if(x){var T=h([this],t);gt(T,r(c))}}},{key:"disconnect",value:function(t,e,n){var r,o=p(this._context),a=y(o);if(void 0===t)r=function(t,e){var n,r=Q(t),i=[],o=Object(K.a)(r.outputs);try{for(o.s();!(n=o.n()).done;){var a=n.value;nt(a)?_t.apply(void 0,[t,e].concat(Object(X.a)(a))):wt.apply(void 0,[t,e].concat(Object(X.a)(a))),i.push(a[0])}}catch(s){o.e(s)}finally{o.f()}return r.outputs.clear(),i}(this,a);else if("number"===typeof t){if(t<0||t>=this.numberOfOutputs)throw i();r=function(t,e,n){var r,i=Q(t),o=[],a=Object(K.a)(i.outputs);try{for(a.s();!(r=a.n()).done;){var s=r.value;s[1]===n&&(nt(s)?_t.apply(void 0,[t,e].concat(Object(X.a)(s))):wt.apply(void 0,[t,e].concat(Object(X.a)(s))),o.push(s[0]),i.outputs.delete(s))}}catch(u){a.e(u)}finally{a.f()}return o}(this,a,t)}else{if(void 0!==e&&(e<0||e>=this.numberOfOutputs))throw i();if(et(t)&&void 0!==n&&(n<0||n>=t.numberOfInputs))throw i();if(0===(r=function(t,e,n,r,i){var o=Q(t);return Array.from(o.outputs).filter((function(t){return t[0]===n&&(void 0===r||t[1]===r)&&(void 0===i||t[2]===i)})).map((function(n){return nt(n)?_t.apply(void 0,[t,e].concat(Object(X.a)(n))):wt.apply(void 0,[t,e].concat(Object(X.a)(n))),o.outputs.delete(n),n[0]}))}(this,a,t,e,n)).length)throw s()}var u,c=Object(K.a)(r);try{for(c.s();!(u=c.n()).done;){var f=u.value,d=h([this],f);gt(d,l)}}catch(v){c.e(v)}finally{c.f()}}}]),_}(f)}((Se=u,function(t,e,n){for(var r=[],i=0;i<n.numberOfInputs;i+=1)r.push(new Set);Se.set(t,{activeInputs:r,outputs:new Set,passiveInputs:new WeakMap,renderer:e})}),function(t,e,n,r,i,o,a,s,u,c,l,h,f){var d=new WeakMap;return function(p,v,m,g,y){var b=o(v),_=b.activeInputs,w=b.passiveInputs,x=o(p).outputs,T=s(p),S=function(o){var s=u(v),c=u(p);if(o){var b=E(w,p,m,g);t(_,p,b,!1),y||h(p)||n(c,s,m,g),f(v)&&O(v)}else{var x=r(_,p,m,g);e(w,g,x,!1),y||h(p)||i(c,s,m,g);var T=a(v);if(0===T)l(v)&&M(v,_);else{var S=d.get(v);void 0!==S&&clearTimeout(S),d.set(v,setTimeout((function(){l(v)&&M(v,_)}),1e3*T))}}};return!!c(x,[v,m,g],(function(t){return t[0]===v&&t[1]===m&&t[2]===g}),!0)&&(T.add(S),l(p)?t(_,p,[m,g,S],!0):e(w,g,[p,m,S],!0),!0)}}(Ln,Dn,st,Fn,ht,Q,Bn,S,ft,rt,G,pt,vt),Vn,function(t,e,n,r,i,o){return function(a){return function(s,u){var c=t.get(s);if(void 0===c){if(!a&&o(s)){var l,h=r(s),f=n(s).outputs,d=Object(K.a)(f);try{for(d.s();!(l=d.n()).done;){var p=l.value;if(nt(p)){var v=r(p[0]);e(h,v,p[1],p[2])}else{var m=i(p[0]);h.disconnect(m,p[1])}}}catch(g){d.e(g)}finally{d.f()}}t.set(s,u)}else t.set(s,c+u)}}}(p,ht,Q,ft,dt,G),B,Vt,wn,function(t,e,n,r,i,o,a,s){return function(u,c){var l=e.get(u);if(void 0===l)throw new Error("Missing the expected cycle count.");var h=o(u.context),f=s(h);if(l===c){if(e.delete(u),!f&&a(u)){var d,p=r(u),v=n(u).outputs,m=Object(K.a)(v);try{for(m.s();!(d=m.n()).done;){var g=d.value;if(nt(g)){var y=r(g[0]);t(p,y,g[1],g[2])}else{var b=i(g[0]);p.connect(b,g[1])}}}catch(_){m.e(_)}finally{m.f()}}}else e.set(u,l-c)}}(st,p,Q,ft,dt,Yn,G,Kn),function(t,e,n){return function r(i,o){var a=et(o)?o:n(t,o);if(function(t){return"delayTime"in t}(a))return[];if(i[0]===a)return[i];if(i.includes(a))return[];var s=e(a).outputs;return Array.from(s).map((function(t){return r([].concat(Object(X.a)(i),[a]),t[0])})).reduce((function(t,e){return t.concat(e)}),[])}}(Qn,Q,x),Jn,Yn,$n,tr,er,Kn),rr=function(t,e,n,r,i,o){return function(t){Object(j.a)(u,t);var s=Object(P.a)(u);function u(t,n){var c;Object(a.a)(this,u);var l=i(t),h=Object(A.a)(Object(A.a)({},R),n),f=r(l,h),d=o(l)?e():null;return(c=s.call(this,t,!1,f,d))._nativeAnalyserNode=f,c}return Object(I.a)(u,[{key:"fftSize",get:function(){return this._nativeAnalyserNode.fftSize},set:function(t){this._nativeAnalyserNode.fftSize=t}},{key:"frequencyBinCount",get:function(){return this._nativeAnalyserNode.frequencyBinCount}},{key:"maxDecibels",get:function(){return this._nativeAnalyserNode.maxDecibels},set:function(t){var e=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=t,!(t>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=e,n()}},{key:"minDecibels",get:function(){return this._nativeAnalyserNode.minDecibels},set:function(t){var e=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=t,!(this._nativeAnalyserNode.maxDecibels>t))throw this._nativeAnalyserNode.minDecibels=e,n()}},{key:"smoothingTimeConstant",get:function(){return this._nativeAnalyserNode.smoothingTimeConstant},set:function(t){this._nativeAnalyserNode.smoothingTimeConstant=t}},{key:"getByteFrequencyData",value:function(t){this._nativeAnalyserNode.getByteFrequencyData(t)}},{key:"getByteTimeDomainData",value:function(t){this._nativeAnalyserNode.getByteTimeDomainData(t)}},{key:"getFloatFrequencyData",value:function(t){this._nativeAnalyserNode.getFloatFrequencyData(t)}},{key:"getFloatTimeDomainData",value:function(t){this._nativeAnalyserNode.getFloatTimeDomainData(t)}}]),u}(t)}(nr,Gn,B,Hn,Yn,Kn),ir=new WeakSet,or=function(t){return null===t?null:t.hasOwnProperty("AudioBuffer")?t.AudioBuffer:null}(zn),ar=(Oe=new Uint32Array(1),function(t){return Oe[0]=t,Oe[0]}),sr=function(t,e){return function(n){n.copyFromChannel=function(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=t(o),s=t(i);if(s>=n.numberOfChannels)throw e();for(var u=n.length,c=n.getChannelData(s),l=r.length,h=a<0?-a:0;h+a<u&&h<l;h+=1)r[h]=c[h+a]},n.copyToChannel=function(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=t(o),s=t(i);if(s>=n.numberOfChannels)throw e();for(var u=n.length,c=n.getChannelData(s),l=r.length,h=a<0?-a:0;h+a<u&&h<l;h+=1)c[h+a]=r[h]}}}(ar,B),ur=function(t){return function(e){e.copyFromChannel=function(n){return function(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=t(o),s=t(i);if(a<e.length)return n.call(e,r,s,a)}}(e.copyFromChannel),e.copyToChannel=function(n){return function(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=t(o),s=t(i);if(a<e.length)return n.call(e,r,s,a)}}(e.copyToChannel)}}(ar),cr=function(t,e,n,r,i,o,s,u){var c=null;return function(){function l(h){if(Object(a.a)(this,l),null===i)throw new Error("Missing the native OfflineAudioContext constructor.");var f=Object(A.a)(Object(A.a)({},z),h),d=f.length,p=f.numberOfChannels,v=f.sampleRate;null===c&&(c=new i(1,1,44100));var m=null!==r&&e(o,o)?new r({length:d,numberOfChannels:p,sampleRate:v}):c.createBuffer(p,d,v);if(0===m.numberOfChannels)throw n();return"function"!==typeof m.copyFromChannel?(s(m),V(m)):e(U,(function(){return U(m)}))||u(m),t.add(m),m}return Object(I.a)(l,null,[{key:Symbol.hasInstance,value:function(e){return null!==e&&"object"===typeof e&&Object.getPrototypeOf(e)===l.prototype||t.has(e)}}]),l}()}(ir,Vn,wn,or,Xn,(ke=or,function(){if(null===ke)return!1;try{new ke({length:1,sampleRate:44100})}catch(t){return!1}return!0}),sr,ur),lr=(Ce=ue,function(t,e){var n=Ce(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});e.connect(n).connect(t.destination),e.addEventListener("ended",(function t(){e.removeEventListener("ended",t),e.disconnect(n),n.disconnect()}))}),hr=(Me=qn,Ae=J,Ie=pt,function(){var t=Object(D.a)(L.a.mark((function t(e,n,r,i){var a;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Ae(e),t.next=3,Promise.all(Array.from(a.activeInputs).map(function(){var t=Object(D.a)(L.a.mark((function t(e){var a,s,u,c,l;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object(o.a)(e,2),s=a[0],u=a[1],c=Me(s),t.next=4,c.render(s,n,i);case 4:l=t.sent,Ie(s)||l.connect(r,u);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:case"end":return t.stop()}}),t)})));return function(e,n,r,i){return t.apply(this,arguments)}}()),fr=function(t){return function(e,n,r,i){return t(n,e,r,i)}}(hr),dr=function(t,e,n,r,i,o,a,s,u,c,l){return function(h,f){var d=h.createBufferSource();
2return Kt(d,f),Jt(d,f,"playbackRate"),Xt(d,f,"buffer"),Xt(d,f,"loop"),Xt(d,f,"loopEnd"),Xt(d,f,"loopStart"),e(n,(function(){return n(h)}))||function(t){t.start=function(e){var n=!1;return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;if(n)throw Bt();e.call(t,r,i,o),n=!0}}(t.start)}(d),e(r,(function(){return r(h)}))||u(d),e(i,(function(){return i(h)}))||c(d,h),e(o,(function(){return o(h)}))||Zt(d),e(a,(function(){return a(h)}))||l(d,h),e(s,(function(){return s(h)}))||$t(d),t(h,d),d}}(lr,Vn,(function(t){var e=t.createBufferSource();e.start();try{e.start()}catch(n){return!0}return!1}),(function(t){var e=t.createBufferSource(),n=t.createBuffer(1,1,44100);e.buffer=n;try{e.start(0,1)}catch(r){return!1}return!0}),(function(t){var e=t.createBufferSource();e.start();try{e.stop()}catch(n){return!1}return!0}),In,jn,Pn,(function(t){var e;t.start=(e=t.start,function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,o=t.buffer,a=null===o?r:Math.min(o.duration,r);null!==o&&a>o.duration-.5/t.context.sampleRate?e.call(t,n,0,0):e.call(t,n,a,i)})}),(je=An,function(t,e){var n=e.createBuffer(1,1,44100);null===t.buffer&&(t.buffer=n),je(t,"buffer",(function(e){return function(){var r=e.call(t);return r===n?null:r}}),(function(e){return function(r){return e.call(t,null===r?n:r)}}))}),Rn),pr=function(t,e){return function(n,r,i,o){return t(r).replay(i),e(r,n,i,o)}}(function(t){return function(e){var n=t(e);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer}}(J),hr),vr=function(t,e,n,r,i){return function(){var o=new WeakMap,a=null,s=null,u=function(){var u=Object(D.a)(L.a.mark((function u(c,l,h){var f,d,p,v;return L.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(f=n(c),(d=F(f,l))||(p={buffer:f.buffer,channelCount:f.channelCount,channelCountMode:f.channelCountMode,channelInterpretation:f.channelInterpretation,loop:f.loop,loopEnd:f.loopEnd,loopStart:f.loopStart,playbackRate:f.playbackRate.value},f=e(l,p),null!==a&&(v=f).start.apply(v,Object(X.a)(a)),null!==s&&f.stop(s)),o.set(l,f),d){u.next=9;break}return u.next=7,r(l,c.playbackRate,f.playbackRate,h);case 7:u.next=11;break;case 9:return u.next=11,t(l,c.playbackRate,f.playbackRate,h);case 11:return u.next=13,i(c,l,f,h);case 13:return u.abrupt("return",f);case 14:case"end":return u.stop()}}),u)})));return function(t,e,n){return u.apply(this,arguments)}}();return{set start(t){a=t},set stop(t){s=t},render:function(t,e,n){var r=o.get(e);return void 0!==r?Promise.resolve(r):u(t,e,n)}}}}(fr,dr,ft,pr,Wn),mr=function(t,e,n,r,o,a,s,u,c,l,h,f,d){return function(p,v,m){var g=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,y=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,b=new i.AutomationEventList(m.defaultValue),_=v?r(b):null,w={get defaultValue(){return m.defaultValue},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===y?m.minValue:y}
2,get value(){return m.value},set value(t){m.value=t,w.setValueAtTime(t,p.context.currentTime)},cancelAndHoldAtTime:function(t){if("function"===typeof m.cancelAndHoldAtTime)null===_&&b.flush(p.context.currentTime),b.add(o(t)),m.cancelAndHoldAtTime(t);else{var e=Array.from(b).pop();null===_&&b.flush(p.context.currentTime),b.add(o(t));var n=Array.from(b).pop();m.cancelScheduledValues(t),e!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return w},cancelScheduledValues:function(t){return null===_&&b.flush(p.context.currentTime),b.add(a(t)),m.cancelScheduledValues(t),w},exponentialRampToValueAtTime:function(t,e){if(0===t)throw new RangeError;if(!Number.isFinite(e)||e<0)throw new RangeError;return null===_&&b.flush(p.context.currentTime),b.add(s(t,e)),m.exponentialRampToValueAtTime(t,e),w},linearRampToValueAtTime:function(t,e){return null===_&&b.flush(p.context.currentTime),b.add(u(t,e)),m.linearRampToValueAtTime(t,e),w},setTargetAtTime:function(t,e,n){return null===_&&b.flush(p.context.currentTime),b.add(c(t,e,n)),m.setTargetAtTime(t,e,n),w},setValueAtTime:function(t,e){return null===_&&b.flush(p.context.currentTime),b.add(l(t,e)),m.setValueAtTime(t,e),w},setValueCurveAtTime:function(t,e,n){var r=t instanceof Float32Array?t:new Float32Array(t);if(null!==f&&"webkitAudioContext"===f.name){for(var i=e+n,o=p.context.sampleRate,a=Math.ceil(e*o),s=Math.floor(i*o),u=s-a,c=new Float32Array(u),l=0;l<u;l+=1){var v=(r.length-1)/n*((a+l)/o-e),g=Math.floor(v),y=Math.ceil(v);c[l]=g===y?r[g]:(1-(v-g))*r[g]+(1-(y-v))*r[y]}null===_&&b.flush(p.context.currentTime),b.add(h(c,e,n)),m.setValueCurveAtTime(c,e,n);var x=s/o;x<i&&d(w,c[c.length-1],x),d(w,r[r.length-1],i)}else null===_&&b.flush(p.context.currentTime),b.add(h(r,e,n)),m.setValueCurveAtTime(r,e,n);return w}};return n.set(w,m),e.set(w,p),t(w,_),w}}((Pe=l,function(t,e){Pe.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:e})}),Qn,h,(function(t){return{replay:function(e){var n,r=Object(K.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("exponentialRampToValue"===i.type){var o=i.endTime,a=i.value;e.exponentialRampToValueAtTime(a,o)}else if("linearRampToValue"===i.type){var s=i.endTime,u=i.value;e.linearRampToValueAtTime(u,s)}else if("setTarget"===i.type){var c=i.startTime,l=i.target,h=i.timeConstant;e.setTargetAtTime(l,c,h)}else if("setValue"===i.type){var f=i.startTime,d=i.value;e.setValueAtTime(d,f)}else{if("setValueCurve"!==i.type)throw new Error("Can't apply an unknown automation.");var p=i.duration,v=i.startTime,m=i.values;e.setValueCurveAtTime(m,v,p)}}}catch(g){r.e(g)}finally{r.f()}}}}),i.createCancelAndHoldAutomationEvent,i.createCancelScheduledValuesAutomationEvent,i.createExponentialRampToValueAutomationEvent,i.createLinearRampToValueAutomationEvent,i.createSetTargetAutomationEvent,i.createSetValueAutomationEvent,i.createSetValueCurveAutomationEvent,Zn,(function t(e,n,r){try{e.setValueAtTime(n,r)}catch(i){if(9!==i.code)throw i;t(e,n,r+1e-7)}})),gr=function(t,e,n,r,i,o,s,u){return function(t){Object(j.a)(l,t);var c=Object(P.a)(l);function l(t,r){var u;Object(a.a)(this,l);var h=o(t),f=Object(A.a)(Object(A.a)({},Y),r),d=i(h,f),p=s(h),v=p?e():null;return(u=c.call(this,t,!1,d,v))._audioBufferSourceNodeRenderer=v,u._isBufferNullified=!1,u._isBufferSet=null!==f.buffer,u._nativeAudioBufferSourceNode=d,u._onended=null,u._playbackRate=n(Object(H.a)(u),p,d.playbackRate,W,q),u}return Object(I.a)(l,[{key:"buffer",get:function(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer},set:function(t){if(this._nativeAudioBufferSourceNode.buffer=t,null!==t){if(this._isBufferSet)throw r();this._isBufferSet=!0}}},{key:"loop",get:function(){return this._nativeAudioBufferSourceNode.loop},set:function(t){this._nativeAudioBufferSourceNode.loop=t}},{key:"loopEnd",get:function(){return this._nativeAudioBufferSourceNode.loopEnd},set:function(t){this._nativeAudioBufferSourceNode.loopEnd=t}},{key:"loopStart",get:function(){return this._nativeAudioBufferSourceNode.loopStart},set:function(t){this._nativeAudioBufferSourceNode.loopStart=t}},{key:"onended",get:function(){return this._onended}
2,set:function(t){var e="function"===typeof t?u(this,t):null;this._nativeAudioBufferSourceNode.onended=e;var n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===e?t:n}},{key:"playbackRate",get:function(){return this._playbackRate}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;if(this._nativeAudioBufferSourceNode.start(e,n,r),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===r?[e,n]:[e,n,r]),"closed"!==this.context.state){O(this);var i=function e(){t._nativeAudioBufferSourceNode.removeEventListener("ended",e),G(t)&&C(t)};this._nativeAudioBufferSourceNode.addEventListener("ended",i)}}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._nativeAudioBufferSourceNode.stop(t),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=t)}}]),l}(t)}(nr,vr,mr,Bt,dr,Yn,Kn,Nn),yr=function(t,e,n,r,i,o,s,u){return function(t){Object(j.a)(l,t);var c=Object(P.a)(l);function l(t,n){var r;Object(a.a)(this,l);var h=o(t),f=s(h),d=i(h,n,f),p=f?e(u):null;return(r=c.call(this,t,!1,d,p))._isNodeOfNativeOfflineAudioContext=f,r._nativeAudioDestinationNode=d,r}return Object(I.a)(l,[{key:"channelCount",get:function(){return this._nativeAudioDestinationNode.channelCount},set:function(t){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(t>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=t}},{key:"channelCountMode",get:function(){return this._nativeAudioDestinationNode.channelCountMode},set:function(t){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=t}},{key:"maxChannelCount",get:function(){return this._nativeAudioDestinationNode.maxChannelCount}}]),l}(t)}(nr,(function(t){var e=null,n=function(){var e=Object(D.a)(L.a.mark((function e(n,r,i){var o;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.destination,e.next=3,t(n,r,o,i);case 3:return e.abrupt("return",o);case 4:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();return{render:function(t,r,i){return null===e&&(e=n(t,r,i)),e}}}),B,Bt,function(t,e){return function(n,r,i){var o=n.destination;if(o.channelCount!==r)try{o.channelCount=r}catch(s){}i&&"explicit"!==o.channelCountMode&&(o.channelCountMode="explicit"),0===o.maxChannelCount&&Object.defineProperty(o,"maxChannelCount",{value:r});var a=t(n,{channelCount:r,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,gain:1});return e(a,"channelCount",(function(t){return function(){return t.call(a)}}),(function(t){return function(e){t.call(a,e);try{o.channelCount=e}catch(n){if(e>o.maxChannelCount)throw n}}})),e(a,"channelCountMode",(function(t){return function(){return t.call(a)}}),(function(t){return function(e){t.call(a,e),o.channelCountMode=e}})),e(a,"channelInterpretation",(function(t){return function(){return t.call(a)}}),(function(t){return function(e){t.call(a,e),o.channelInterpretation=e}})),Object.defineProperty(a,"maxChannelCount",{get:function(){return o.maxChannelCount}}),a.connect(o),a}}(ue,An),Yn,Kn,Wn),br=function(t,e,n,r,i){return function(){var o=new WeakMap,a=function(){var a=Object(D.a)(L.a.mark((function a(s,u,c){var l,h,f;return L.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(l=n(s),(h=F(l,u))||(f={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type},l=e(u,f)),o.set(u,l),h){a.next=15;break}return a.next=7,r(u,s.Q,l.Q,c);case 7:return a.next=9,r(u,s.detune,l.detune,c);case 9:return a.next=11,r(u,s.frequency,l.frequency,c);case 11:return a.next=13,r(u,s.gain,l.gain,c);case 13:a.next=23;break;case 15:return a.next=17,t(u,s.Q,l.Q,c);case 17:return a.next=19,t(u,s.detune,l.detune,c);case 19:return a.next=21,t(u,s.frequency,l.frequency,c);case 21:return a.next=23,t(u,s.gain,l.gain,c);case 23:return a.next=25,i(s,u,l,c);case 25:return a.abrupt("return",l);case 26:case"end":return a.stop()}}),a)})));return function(t,e,n){return a.apply(this,arguments)}}();return{render:function(t,e,n){var r=o.get(e);return void 0!==r?Promise.resolve(r):a(t,e,n)}}}}(fr,re,ft,pr,Wn),_r=function(t){return function(e,n){return t.set(e,n)}}(Un),wr=(Re=mr,Ne=br,Le=Vt,De=re,Fe=Yn,Ue=Kn,Be=_r,function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(t,r){var i;Object(a.a)(this,n);var o=Fe(t),s=Object(A.a)(Object(A.a)({},At),r),u=De(o,s),c=Ue(o),l=c?Ne():null;return(i=e.call(this,t,!1,u,l))._Q=Re(Object(H.a)(i),c,u.Q,W,q),i._detune=Re(Object(H.a)(i),c,u.detune,1200*Math.log2(W),-1200*Math.log2(W)),i._frequency=Re(Object(H.a)(i),c,u.frequency,t.sampleRate/2,0),i._gain=Re(Object(H.a)(i),c,u.gain,40*Math.log10(W),q),i._nativeBiquadFilterNode=u,Be(Object(H.a)(i),1),i}return Object(I.a)(n,[{key:"detune",get:function(){return this._detune}},{key:"frequency",get:function(){return this._frequency}},{key:"gain",get:function(){return this._gain}},{key:"Q",get:function(){return this._Q}},{key:"type",get:function(){return this._nativeBiquadFilterNode.type},set:function(t){this._nativeBiquadFilterNode.type=t}},{key:"getFrequencyResponse",value:function(t,e,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(t,e,n)}catch(r){if(11===r.code)throw Le();throw r}if(t.length!==e.length||e.length!==n.length)throw Le()}}]),n}(nr)),xr=function(t,e){return function(n,r,i){var o,a,s=new Set;return n.connect=(o=n.connect,function(i){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,c=0===s.size;if(e(i))return o.call(n,i,a,u),t(s,[i,a,u],(function(t){return t[0]===i&&t[1]===a&&t[2]===u}),!0),c&&r(),i;o.call(n,i,a),t(s,[i,a],(function(t){return t[0]===i&&t[1]===a}),!0),c&&r()}),n.disconnect=(a=n.disconnect,function(t,r,o){var u=s.size>0;if(void 0===t)a.apply(n),s.clear();else if("number"===typeof t){a.call(n,t);var c,l=Object(K.a)(s);try{for(l.s();!(c=l.n()).done;){var h=c.value;h[1]===t&&s.delete(h)}}catch(m){l.e(m)}finally{l.f()}}else{e(t)?a.call(n,t,r,o):a.call(n,t,r);var f,d=Object(K.a)(s);try{for(d.s();!(f=d.n()).done;){var p=f.value;p[0]!==t||void 0!==r&&p[1]!==r||void 0!==o&&p[2]!==o||s.delete(p)}}catch(m){d.e(m)}finally{d.f()}}var v=0===s.size;u&&v&&i()}),n}}(rt,tr),Tr=(Ve=Bt,ze=xr,function(t,e){e.channelCount=1,e.channelCountMode="explicit",Object.defineProperty(e,"channelCount",{get:function(){return 1},set:function(){throw Ve()}}),Object.defineProperty(e,"channelCountMode",{get:function(){return"explicit"},set:function(){throw Ve()}});var n=t.createBufferSource();ze(e,(function(){for(var t=e.numberOfInputs,r=0;r<t;r+=1)n.connect(e,0,r)}),(function(){return n.disconnect(e)}))}),Er=function(t,e){return function(n,r){var i=n.createChannelMerger(r.numberOfInputs);return null!==t&&"webkitAudioContext"===t.name&&e(n,i),Kt(i,r),i}}(Zn,Tr),Sr=function(t,e,n,r,i){return function(t){Object(j.a)(s,t);var o=Object(P.a)(s);function s(t,u){Object(a.a)(this,s);var c=r(t),l=Object(A.a)(Object(A.a)({},It),u),h=n(c,l),f=i(c)?e():null;return o.call(this,t,!1,h,f)}return s}(t)}(nr,function(t,e,n){return function(){var r=new WeakMap,i=function(){var i=Object(D.a)(L.a.mark((function i(o,a,s){var u,c;return L.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return u=e(o),F(u,a)||(c={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,numberOfInputs:u.numberOfInputs},u=t(a,c)),r.set(a,u),i.next=6,n(o,a,u,s);case 6:return i.abrupt("return",u);case 7:case"end":return i.stop()}}),i)})));return function(t,e,n){return i.apply(this,arguments)}}();return{render:function(t,e,n){var o=r.get(e);return void 0!==o?Promise.resolve(o):i(t,e,n)}}}}(Er,ft,Wn),Er,Yn,Kn),Or=function(t,e,n,r,i,o){return function(t){Object(j.a)(u,t);var s=Object(P.a)(u);function u(t,c){Object(a.a)(this,u);var l=r(t),h=o(Object(A.a)(Object(A.a)({},jt),c)),f=n(l,h),d=i(l)?e():null;return s.call(this,t,!1,f,d)}return u}(t)}(nr,function(t,e,n){return function(){var r=new WeakMap,i=function(){var i=Object(D.a)(L.a.mark((function i(o,a,s){var u,c;return L.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return u=e(o),F(u,a)||(c={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,numberOfOutputs:u.numberOfOutputs},u=t(a,c)),r.set(a,u),i.next=6,n(o,a,u,s);case 6:return i.abrupt("return",u);case 7:case"end":return i.stop()}}),i)})));return function(t,e,n){return i.apply(this,arguments)}}();return{render:function(t,e,n){var o=r.get(e);return void 0!==o?Promise.resolve(o):i(t,e,n)}}}}(ie,ft,Wn),ie,Yn,Kn,(function(t){return Object(A.a)(Object(A.a)({},t),{},{channelCount:t.numberOfOutputs})})),kr=function(t,e,n,r){return function(i,o){var a=o.offset,s=oe(o,["offset"]),u=i.createBuffer(1,2,44100),c=e(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=n(i,Object(A.a)(Object(A.a)({},s),{},{gain:a})),h=u.getChannelData(0);h[0]=1,h[1]=1,c.buffer=u,c.loop=!0;var f={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(t){l.channelCount=t},get channelCountMode(){return l.channelCountMode},set channelCountMode(t){l.channelCountMode=t},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(t){l.channelInterpretation=t},get context(){return l.context},get inputs(){return[]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get offset(){return l.gain},get onended(){return c.onended},set onended(t){c.onended=t},addEventListener:function(){return c.addEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])},dispatchEvent:function(){return c.dispatchEvent(arguments.length<=0?void 0:arguments[0])},removeEventListener:function(){return c.removeEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])},start:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;c.start.call(c,t)},stop:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;c.stop.call(c,t)}};return t(i,c),r(ae(f,l),(function(){return c.connect(l)}),(function(){return c.disconnect(l)}))}}(lr,dr,ue,xr),Cr=function(t,e,n,r,i){return function(o,a){if(void 0===o.createConstantSource)return n(o,a);var s=o.createConstantSource();return Kt(s,a),Jt(s,a,"offset"),e(r,(function(){return r(o)}))||Zt(s),e(i,(function(){return i(o)}))||$t(s),t(o,s),s}}(lr,Vn,kr,In,Pn),Mr=function(t,e,n,r,i,o,s){return function(t){Object(j.a)(c,t);var u=Object(P.a)(c);function c(t,s){var l;Object(a.a)(this,c);var h=i(t),f=Object(A.a)(Object(A.a)({},Pt),s),d=r(h,f),p=o(h),v=p?n():null;return(l=u.call(this,t,!1,d,v))._constantSourceNodeRenderer=v,l._nativeConstantSourceNode=d,l._offset=e(Object(H.a)(l),p,d.offset,W,q),l._onended=null,l}return Object(I.a)(c,[{key:"offset",get:function(){return this._offset}},{key:"onended",get:function(){return this._onended}
2,set:function(t){var e="function"===typeof t?s(this,t):null;this._nativeConstantSourceNode.onended=e;var n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===e?t:n}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){O(this);var n=function e(){t._nativeConstantSourceNode.removeEventListener("ended",e),G(t)&&C(t)};this._nativeConstantSourceNode.addEventListener("ended",n)}}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._nativeConstantSourceNode.stop(t),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=t)}}]),c}(t)}(nr,mr,function(t,e,n,r,i){return function(){var o=new WeakMap,a=null,s=null,u=function(){var u=Object(D.a)(L.a.mark((function u(c,l,h){var f,d,p;return L.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(f=n(c),(d=F(f,l))||(p={channelCount:f.channelCount,channelCountMode:f.channelCountMode,channelInterpretation:f.channelInterpretation,offset:f.offset.value},f=e(l,p),null!==a&&f.start(a),null!==s&&f.stop(s)),o.set(l,f),d){u.next=9;break}return u.next=7,r(l,c.offset,f.offset,h);case 7:u.next=11;break;case 9:return u.next=11,t(l,c.offset,f.offset,h);case 11:return u.next=13,i(c,l,f,h);case 13:return u.abrupt("return",f);case 14:case"end":return u.stop()}}),u)})));return function(t,e,n){return u.apply(this,arguments)}}();return{set start(t){a=t},set stop(t){s=t},render:function(t,e,n){var r=o.get(e);return void 0!==r?Promise.resolve(r):u(t,e,n)}}}}(fr,Cr,ft,pr,Wn),Cr,Yn,Kn,Nn),Ar=function(t,e){return function(n,r){var i=n.createConvolver();if(Kt(i,r),r.disableNormalization===i.normalize&&(i.normalize=!r.disableNormalization),Xt(i,r,"buffer"),r.channelCount>2)throw t();if(e(i,"channelCount",(function(t){return function(){return t.call(i)}}),(function(e){return function(n){if(n>2)throw t();return e.call(i,n)}})),"max"===r.channelCountMode)throw t();return e(i,"channelCountMode",(function(t){return function(){return t.call(i)}}),(function(e){return function(n){if("max"===n)throw t();return e.call(i,n)}})),i}}(wn,An),Ir=function(t,e,n,r,i,o){return function(t){Object(j.a)(u,t);var s=Object(P.a)(u);function u(t,c){var l;Object(a.a)(this,u);var h=r(t),f=Object(A.a)(Object(A.a)({},Rt),c),d=n(h,f),p=i(h)?e():null;return(l=s.call(this,t,!1,d,p))._isBufferNullified=!1,l._nativeConvolverNode=d,null!==f.buffer&&o(Object(H.a)(l),f.buffer.duration),l}return Object(I.a)(u,[{key:"buffer",get:function(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer},set:function(t){if(this._nativeConvolverNode.buffer=t,null===t&&null!==this._nativeConvolverNode.buffer){var e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,44100),this._isBufferNullified=!0,o(this,0)}else this._isBufferNullified=!1,o(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}},{key:"normalize",get:function(){return this._nativeConvolverNode.normalize},set:function(t){this._nativeConvolverNode.normalize=t}}]),u}(t)}(nr,function(t,e,n){return function(){var r=new WeakMap,i=function(){var i=Object(D.a)(L.a.mark((function i(o,a,s){var u,c;return L.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(u=e(o),F(u,a)||(c={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,disableNormalization:!u.normalize},u=t(a,c)),r.set(a,u),!at(u)){i.next=9;break}return i.next=7,n(o,a,u.inputs[0],s);case 7:i.next=11;break;case 9:return i.next=11,n(o,a,u,s);case 11:return i.abrupt("return",u);case 12:case"end":return i.stop()}}),i)})));return function(t,e,n){return i.apply(this,arguments)}}();return{render:function(t,e,n){var o=r.get(e);return void 0!==o?Promise.resolve(o):i(t,e,n)}}}}(Ar,ft,Wn),Ar,Yn,Kn,_r),jr=function(t,e,n,r,i,o,s){return function(t){Object(j.a)(c,t);var u=Object(P.a)(c);function c(t,l){var h;Object(a.a)(this,c);var f=i(t),d=Object(A.a)(Object(A.a)({},Lt),l),p=r(f,d),v=o(f),m=v?n(d.maxDelayTime):null;return(h=u.call(this,t,!1,p,m))._delayTime=e(Object(H.a)(h),v,p.delayTime),s(Object(H.a)(h),d.maxDelayTime),h}return Object(I.a)(c,[{key:"delayTime",get:function(){return this._delayTime}}]),c}(t)}(nr,mr,function(t,e,n,r,i){return function(o){var a=new WeakMap,s=function(){var s=Object(D.a)(L.a.mark((function s(u,c,l){var h,f,d;return L.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(h=n(u),(f=F(h,c))||(d={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,delayTime:h.delayTime.value,maxDelayTime:o},h=e(c,d)),a.set(c,h),f){s.next=9;break}return s.next=7,r(c,u.delayTime,h.delayTime,l);case 7:s.next=11;break;case 9:return s.next=11,t(c,u.delayTime,h.delayTime,l);case 11:return s.next=13,i(u,c,h,l);case 13:return s.abrupt("return",h);case 14:case"end":return s.stop()}}),s)})));return function(t,e,n){return s.apply(this,arguments)}}();return{render:function(t,e,n){var r=a.get(e);return void 0!==r?Promise.resolve(r):s(t,e,n)}}}}(fr,se,ft,pr,Wn),se,Yn,Kn,_r),Pr=(He=wn,function(t,e){var n=t.createDynamicsCompressor();if(Kt(n,e),e.channelCount>2)throw He();if("max"===e.channelCountMode)throw He();return Jt(n,e,"attack"),Jt(n,e,"knee"),Jt(n,e,"ratio"),Jt(n,e,"release"),Jt(n,e,"threshold"),n}),Rr=function(t,e,n,r,i,o,s,u){return function(t){Object(j.a)(l,t);var c=Object(P.a)(l);function l(t,i){var h;Object(a.a)(this,l);var f=o(t),d=Object(A.a)(Object(A.a)({},Ft),i),p=r(f,d),v=s(f),m=v?n():null;return(h=c.call(this,t,!1,p,m))._attack=e(Object(H.a)(h),v,p.attack),h._knee=e(Object(H.a)(h),v,p.knee),h._nativeDynamicsCompressorNode=p,h._ratio=e(Object(H.a)(h),v,p.ratio),h._release=e(Object(H.a)(h),v,p.release),h._threshold=e(Object(H.a)(h),v,p.threshold),u(Object(H.a)(h),.006),h}return Object(I.a)(l,[{key:"attack",get:function(){return this._attack}},{key:"channelCount",get:function(){return this._nativeDynamicsCompressorNode.channelCount},set:function(t){var e=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=t,t>2)throw this._nativeDynamicsCompressorNode.channelCount=e,i()}},{key:"channelCountMode",get:function(){return this._nativeDynamicsCompressorNode.channelCountMode},set:function(t){var e=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=t,"max"===t)throw this._nativeDynamicsCompressorNode.channelCountMode=e,i()}},{key:"knee",get:function(){return this._knee}},{key:"ratio",get:function(){return this._ratio}},{key:"reduction",get:function(){return"number"===typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}},{key:"release",get:function(){return this._release}},{key:"threshold",get:function(){return this._threshold}}]),l}(t)}(nr,mr,function(t,e,n,r,i){return function(){var o=new WeakMap,a=function(){var a=Object(D.a)(L.a.mark((function a(s,u,c){var l,h,f;return L.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(l=n(s),(h=F(l,u))||(f={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value},l=e(u,f)),o.set(u,l),h){a.next=17;break}return a.next=7,r(u,s.attack,l.attack,c);case 7:return a.next=9,r(u,s.knee,l.knee,c);case 9:return a.next=11,r(u,s.ratio,l.ratio,c);case 11:return a.next=13,r(u,s.release,l.release,c);case 13:return a.next=15,r(u,s.threshold,l.threshold,c);case 15:a.next=27;break;case 17:return a.next=19,t(u,s.attack,l.attack,c);case 19:return a.next=21,t(u,s.knee,l.knee,c);case 21:return a.next=23,t(u,s.ratio,l.ratio,c);case 23:return a.next=25,t(u,s.release,l.release,c);case 25:return a.next=27,t(u,s.threshold,l.threshold,c);case 27:return a.next=29,i(s,u,l,c);case 29:return a.abrupt("return",l);case 30:case"end":return a.stop()}}),a)})));return function(t,e,n){return a.apply(this,arguments)}}();return{render:function(t,e,n){var r=o.get(e);return void 0!==r?Promise.resolve(r):a(t,e,n)}}}}(fr,Pr,ft,pr,Wn),Pr,wn,Yn,Kn,_r),Nr=function(t,e,n,r,i,o){return function(t){Object(j.a)(u,t);var s=Object(P.a)(u);function u(t,c){var l;Object(a.a)(this,u);var h=i(t),f=Object(A.a)(Object(A.a)({},Ut),c),d=r(h,f),p=o(h),v=p?n():null;return(l=s.call(this,t,!1,d,v))._gain=e(Object(H.a)(l),p,d.gain,W,q),l}return Object(I.a)(u,[{key:"gain",get:function(){return this._gain}}]),u}(t)}(nr,mr,function(t,e,n,r,i){return function(){var o=new WeakMap,a=function(){var a=Object(D.a)(L.a.mark((function a(s,u,c){var l,h,f;return L.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(l=n(s),(h=F(l,u))||(f={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value},l=e(u,f)),o.set(u,l),h){a.next=9;break}return a.next=7,r(u,s.gain,l.gain,c);case 7:a.next=11;break;case 9:return a.next=11,t(u,s.gain,l.gain,c);case 11:return a.next=13,i(s,u,l,c);case 13:return a.abrupt("return",l);case 14:case"end":return a.stop()}}),a)})));return function(t,e,n){return a.apply(this,arguments)}}();return{render:function(t,e,n){var r=o.get(e);return void 0!==r?Promise.resolve(r):a(t,e,n)}}}}(fr,ue,ft,pr,Wn),ue,Yn,Kn),Lr=function(t,e,n,r){return function(i,o,a){var s=a.channelCount,u=a.channelCountMode,c=a.channelInterpretation,l=a.feedback,h=a.feedforward,f=te(o,i.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),p=h instanceof Float64Array?h:new Float64Array(h),v=d.length,m=p.length,g=Math.min(v,m);if(0===v||v>20)throw r();if(0===d[0])throw e();if(0===m||m>20)throw r();if(0===p[0])throw e();if(1!==d[0]){for(var y=0;y<m;y+=1)p[y]/=d[0];for(var b=1;b<v;b+=1)d[b]/=d[0]}var _=n(i,f,s,s);_.channelCount=s,_.channelCountMode=u,_.channelInterpretation=c;for(var w=[],x=[],T=[],E=0;E<s;E+=1){w.push(0);var S=new Float32Array(32),O=new Float32Array(32);S.fill(0),O.fill(0),x.push(S),T.push(O)}_.onaudioprocess=function(t){for(var e=t.inputBuffer,n=t.outputBuffer,r=e.numberOfChannels,i=0;i<r;i+=1){var o=e.getChannelData(i),a=n.getChannelData(i);w[i]=Ht(d,v,p,m,g,x[i],T[i],w[i],32,o,a)}};var k=i.sampleRate/2;return ae({get bufferSize(){return f},get channelCount(){return _.channelCount},set channelCount(t){_.channelCount=t},get channelCountMode(){return _.channelCountMode},set channelCountMode(t){_.channelCountMode=t},get channelInterpretation(){return _.channelInterpretation},set channelInterpretation(t){_.channelInterpretation=t},get context(){return _.context},get inputs(){return[_]},get numberOfInputs(){return _.numberOfInputs},get numberOfOutputs(){return _.numberOfOutputs},addEventListener:function(){return _.addEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])},dispatchEvent:function(){return _.dispatchEvent(arguments.length<=0?void 0:arguments[0])},getFrequencyResponse:function(e,n,r){if(e.length!==n.length||n.length!==r.length)throw t();for(var i=e.length,o=0;o<i;o+=1){var a=-Math.PI*(e[o]/k),s=[Math.cos(a),Math.sin(a)],u=ce(le(p,s),le(d,s));n[o]=Math.sqrt(u[0]*u[0]+u[1]*u[1]),r[o]=Math.atan2(u[1],u[0])}},removeEventListener:function(){return _.removeEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])}},_)}}(Vt,Bt,_n,wn),Dr=function(t,e,n,r){return function(i){return t(Gt,(function(){return Gt(i)}))?Promise.resolve(t(r,r)).then((function(t){if(!t){var e=n(i,512,0,1);i.oncomplete=function(){e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=function(){return i.currentTime},e.connect(i.destination)}return i.startRendering()})):new Promise((function(t){var n=e(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=function(e){n.disconnect(),t(e.renderedBuffer)},n.connect(i.destination),i.startRendering()}))}}(Vn,ue,_n,function(t,e){return function(){if(null===e)return Promise.resolve(!1);var n=new e(1,1,44100),r=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((function(t){n.oncomplete=function(){r.disconnect(),t(0!==n.currentTime)},n.startRendering()}))}}(ue,Xn)),Fr=function(t,e,n,r,i){return function(o,a){var s=new WeakMap,u=null,c=function(){var c=Object(D.a)(L.a.mark((function c(l,h,f){var d,p,v,m,g;return L.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(d=null,p=e(l),v=F(p,h),void 0===h.createIIRFilter?d=t(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):v||(p=h.createIIRFilter(a,o)),s.set(h,null===d?p:d),null===d){c.next=17;break}if(null!==u){c.next=11;break}if(null!==n){c.next=9;break}throw new Error("Missing the native OfflineAudioContext constructor.");case 9:m=new n(l.context.destination.channelCount,l.context.length,h.sampleRate),u=Object(D.a)(L.a.mark((function t(){var e;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r(l,m,m.destination,f);case 2:return t.next=4,i(m);case 4:return e=t.sent,t.abrupt("return",qt(e,h,o,a));case 6:case"end":return t.stop()}}),t)})))();case 11:return c.next=13,u;case 13:return g=c.sent,d.buffer=g,d.start(0),c.abrupt("return",d);case 17:return c.next=19,r(l,h,p,f);case 19:return c.abrupt("return",p);case 20:case"end":return c.stop()}}),c)})));return function(t,e,n){return c.apply(this,arguments)}}();return{render:function(t,e,n){var r=s.get(e);return void 0!==r?Promise.resolve(r):c(t,e,n)}}}}(dr,ft,Xn,Wn,Dr),Ur=function(t,e,n,r,i,o){return function(t){Object(j.a)(u,t);var s=Object(P.a)(u);function u(t,c){var l;Object(a.a)(this,u);var h=r(t),f=i(h),d=Object(A.a)(Object(A.a)({},zt),c),p=e(h,f?null:t.baseLatency,d),v=f?n(d.feedback,d.feedforward):null;return l=s.call(this,t,!1,p,v),function(t){var e;t.getFrequencyResponse=(e=t.getFrequencyResponse,function(n,r,i){if(n.length!==r.length||r.length!==i.length)throw Vt();return e.call(t,n,r,i)})}(p),l._nativeIIRFilterNode=p,o(Object(H.a)(l),1),l}return Object(I.a)(u,[{key:"getFrequencyResponse",value:function(t,e,n){return this._nativeIIRFilterNode.getFrequencyResponse(t,e,n)}}]),u}(t)}(nr,(qe=Lr,function(t,e,n){if(void 0===t.createIIRFilter)return qe(t,e,n);var r=t.createIIRFilter(n.feedforward,n.feedback);return Kt(r,n),r}),Fr,Yn,Kn,_r),Br=function(t,e,n,r,i){return function(o,a){var s=a.listener,u=void 0===s.forwardX?function(){var u=e(a,{
2channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),c=i(a),l=r(a,256,9,0),h=function(e,r){var i=n(a,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:r});return i.connect(u,0,e),i.start(),Object.defineProperty(i.offset,"defaultValue",{get:function(){return r}}),t({context:o},c,i.offset,W,q)},f=[0,0,-1,0,1,0],d=[0,0,0];return l.onaudioprocess=function(t){var e=t.inputBuffer,n=[e.getChannelData(0)[0],e.getChannelData(1)[0],e.getChannelData(2)[0],e.getChannelData(3)[0],e.getChannelData(4)[0],e.getChannelData(5)[0]];n.some((function(t,e){return t!==f[e]}))&&(s.setOrientation.apply(s,n),f=n);var r=[e.getChannelData(6)[0],e.getChannelData(7)[0],e.getChannelData(8)[0]];r.some((function(t,e){return t!==d[e]}))&&(s.setPosition.apply(s,r),d=r)},u.connect(l),{forwardX:h(0,0),forwardY:h(1,0),forwardZ:h(2,-1),positionX:h(6,0),positionY:h(7,0),positionZ:h(8,0),upX:h(3,0),upY:h(4,1),upZ:h(5,0)}}():s,c=u.forwardX,l=u.forwardY,h=u.forwardZ,f=u.positionX,d=u.positionY,p=u.positionZ,v=u.upX,m=u.upY,g=u.upZ;return{get forwardX(){return c},get forwardY(){return l},get forwardZ(){return h},get positionX(){return f},get positionY(){return d},get positionZ(){return p},get upX(){return v},get upY(){return m},get upZ(){return g}}}}(mr,Er,Cr,_n,Kn),Vr=new WeakMap,zr=function(t,e,n,r,i,o){return function(n){Object(j.a)(u,n);var s=Object(P.a)(u);function u(n,o){var c;return Object(a.a)(this,u),(c=s.call(this,n))._nativeContext=n,f.set(Object(H.a)(c),n),r(n)&&i.set(n,new Set),c._destination=new t(Object(H.a)(c),o),c._listener=e(Object(H.a)(c),n),c._onstatechange=null,c}return Object(I.a)(u,[{key:"currentTime",get:function(){return this._nativeContext.currentTime}},{key:"destination",get:function(){return this._destination}},{key:"listener",get:function(){return this._listener}},{key:"onstatechange",get:function(){return this._onstatechange},set:function(t){var e="function"===typeof t?o(this,t):null;this._nativeContext.onstatechange=e;var n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===e?t:n}},{key:"sampleRate",get:function(){return this._nativeContext.sampleRate}},{key:"state",get:function(){return this._nativeContext.state}}]),u}(n)}(yr,Br,Jn,Kn,Vr,Nn),Hr=function(t,e,n,r,i,o){return function(a,s){var u=a.createOscillator();return Kt(u,s),Jt(u,s,"detune"),Jt(u,s,"frequency"),void 0!==s.periodicWave?u.setPeriodicWave(s.periodicWave):Xt(u,s,"type"),e(n,(function(){return n(a)}))||Zt(u),e(r,(function(){return r(a)}))||o(u,a),e(i,(function(){return i(a)}))||$t(u),t(a,u),u}}(lr,Vn,In,jn,Pn,Rn),qr=function(t,e,n,r,i,o,s){return function(t){Object(j.a)(c,t);var u=Object(P.a)(c);function c(t,s){var l;Object(a.a)(this,c);var h=i(t),f=Object(A.a)(Object(A.a)({},Tn),s),d=n(h,f),p=o(h),v=p?r():null,m=t.sampleRate/2;return(l=u.call(this,t,!1,d,v))._detune=e(Object(H.a)(l),p,d.detune,153600,-153600),l._frequency=e(Object(H.a)(l),p,d.frequency,m,-m),l._nativeOscillatorNode=d,l._onended=null,l._oscillatorNodeRenderer=v,null!==l._oscillatorNodeRenderer&&void 0!==f.periodicWave&&(l._oscillatorNodeRenderer.periodicWave=f.periodicWave),l}return Object(I.a)(c,[{key:"detune",get:function(){return this._detune}},{key:"frequency",get:function(){return this._frequency}},{key:"onended",get:function(){return this._onended},set:function(t){var e="function"===typeof t?s(this,t):null;this._nativeOscillatorNode.onended=e;var n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===e?t:n}},{key:"type",get:function(){return this._nativeOscillatorNode.type},set:function(t){this._nativeOscillatorNode.type=t,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}},{key:"setPeriodicWave",value:function(t){this._nativeOscillatorNode.setPeriodicWave(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=t)}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){O(this);var n=function e(){t._nativeOscillatorNode.removeEventListener("ended",e),G(t)&&C(t)};this._nativeOscillatorNode.addEventListener("ended",n)}}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._nativeOscillatorNode.stop(t),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=t)}}]),c}(t)}(nr,mr,Hr,function(t,e,n,r,i){return function(){var o=new WeakMap,a=null,s=null,u=null,c=function(){var c=Object(D.a)(L.a.mark((function c(l,h,f){var d,p,v;return L.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(d=n(l),(p=F(d,h))||(v={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:null===a?void 0:a,type:d.type},d=e(h,v),null!==s&&d.start(s),null!==u&&d.stop(u)),o.set(h,d),p){c.next=11;break}return c.next=7,r(h,l.detune,d.detune,f);case 7:return c.next=9,r(h,l.frequency,d.frequency,f);case 9:c.next=15;break;case 11:return c.next=13,t(h,l.detune,d.detune,f);case 13:return c.next=15,t(h,l.frequency,d.frequency,f);case 15:return c.next=17,i(l,h,d,f);case 17:return c.abrupt("return",d);case 18:case"end":return c.stop()}}),c)})));return function(t,e,n){return c.apply(this,arguments)}}();return{set periodicWave(t){a=t},set start(t){s=t},set stop(t){u=t},render:function(t,e,n){var r=o.get(e);return void 0!==r?Promise.resolve(r):c(t,e,n)}}}}(fr,Hr,ft,pr,Wn),Yn,Kn,Nn),Wr=(We=dr,function(t,e){var n=We(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=t.createBuffer(1,2,44100);return n.buffer=r,n.loop=!0,n.connect(e),n.start(),function(){n.stop(),n.disconnect(e)}}),Gr=function(t,e,n,r,i){return function(o,a){var s=a.curve,u=a.oversample,c=oe(a,["curve","oversample"]),l=o.createWaveShaper(),h=o.createWaveShaper();Kt(l,c),Kt(h,c);var f=n(o,Object(A.a)(Object(A.a)({},c),{},{gain:1})),d=n(o,Object(A.a)(Object(A.a)({},c),{},{gain:-1})),p=n(o,Object(A.a)(Object(A.a)({},c),{},{gain:1})),v=n(o,Object(A.a)(Object(A.a)({},c),{},{gain:-1})),m=null,g=!1,y=null,b={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(t){f.channelCount=t,d.channelCount=t,l.channelCount=t,p.channelCount=t,h.channelCount=t,v.channelCount=t},get channelCountMode(){return l.channelCountMode},set channelCountMode(t){f.channelCountMode=t,d.channelCountMode=t,l.channelCountMode=t,p.channelCountMode=t,h.channelCountMode=t,v.channelCountMode=t},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(t){f.channelInterpretation=t,d.channelInterpretation=t,l.channelInterpretation=t,p.channelInterpretation=t,h.channelInterpretation=t,v.channelInterpretation=t},get context(){return l.context},get curve(){return y},set curve(n){if(null!==n&&n.length<2)throw e();if(null===n)l.curve=n,h.curve=n;else{var i=n.length,a=new Float32Array(i+2-i%2),s=new Float32Array(i+2-i%2);a[0]=n[0],s[0]=-n[i-1];for(var u=Math.ceil((i+1)/2),c=(i+1)/2-1,d=1;d<u;d+=1){var p=d/u*c,v=Math.floor(p),b=Math.ceil(p);a[d]=v===b?n[v]:(1-(p-v))*n[v]+(1-(b-p))*n[b],s[d]=v===b?-n[i-1-v]:-(1-(p-v))*n[i-1-v]-(1-(b-p))*n[i-1-b]}a[u]=i%2===1?n[u-1]:(n[u-2]+n[u-1])/2,l.curve=a,h.curve=s}y=n,g&&(r(y)&&null===m?m=t(o,f):null!==m&&(m(),m=null))},get inputs(){return[f]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get oversample(){return l.oversample},set oversample(t){l.oversample=t,h.oversample=t},addEventListener:function(){return f.addEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])},dispatchEvent:function(){return f.dispatchEvent(arguments.length<=0?void 0:arguments[0])},removeEventListener:function(){return f.removeEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])}};null!==s&&(b.curve=s instanceof Float32Array?s:new Float32Array(s)),u!==b.oversample&&(b.oversample=u);return i(ae(b,p),(function(){f.connect(l).connect(p),f.connect(d).connect(h).connect(v).connect(p),g=!0,r(y)&&(m=t(o,f))}),(function(){f.disconnect(l),l.disconnect(p),f.disconnect(d),d.disconnect(h),h.disconnect(v),v.disconnect(p),g=!1,null!==m&&(m(),m=null)}))}}(Wr,Bt,ue,Mn,xr),Yr=function(t,e,n,r,i,o,a){return function(s,u){var c=s.createWaveShaper();if(null!==o&&"webkitAudioContext"===o.name&&void 0===s.createGain().gain.automationRate)return n(s,u);Kt(c,u);var l=null===u.curve||u.curve instanceof Float32Array?u.curve:new Float32Array(u.curve);if(null!==l&&l.length<2)throw e();Xt(c,{curve:l},"curve"),Xt(c,u,"oversample");var h=null,f=!1;a(c,"curve",(function(t){return function(){return t.call(c)}}),(function(e){return function(n){return e.call(c,n),f&&(r(n)&&null===h?h=t(s,c):r(n)||null===h||(h(),h=null)),n}}));return i(c,(function(){f=!0,r(c.curve)&&(h=t(s,c))}),(function(){f=!1,null!==h&&(h(),h=null)}))}}(Wr,Bt,Gr,Mn,xr,Zn,An),Xr=function(t,e,n,r,i,o,a,s,u){return function(c,l){var h=l.coneInnerAngle,f=l.coneOuterAngle,d=l.coneOuterGain,p=l.distanceModel,v=l.maxDistance,m=l.orientationX,g=l.orientationY,y=l.orientationZ,b=l.panningModel,_=l.positionX,w=l.positionY,x=l.positionZ,T=l.refDistance,E=l.rolloffFactor,S=oe(l,["coneInnerAngle","coneOuterAngle","coneOuterGain","distanceModel","maxDistance","orientationX","orientationY","orientationZ","panningModel","positionX","positionY","positionZ","refDistance","rolloffFactor"]),O=c.createPanner();if(S.channelCount>2)throw a();if("max"===S.channelCountMode)throw a();Kt(O,S);var k={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},C=n(c,Object(A.a)(Object(A.a)({},k),{},{channelInterpretation:"speakers",numberOfInputs:6})),M=r(c,Object(A.a)(Object(A.a)({},S),{},{gain:1})),I=r(c,Object(A.a)(Object(A.a)({},k),{},{gain:1})),j=r(c,Object(A.a)(Object(A.a)({},k),{},{gain:0})),P=r(c,Object(A.a)(Object(A.a)({},k),{},{gain:0})),R=r(c,Object(A.a)(Object(A.a)({},k),{},{gain:0})),N=r(c,Object(A.a)(Object(A.a)({},k),{},{gain:0})),L=r(c,Object(A.a)(Object(A.a)({},k),{},{gain:0})),D=i(c,256,6,1),F=o(c,Object(A.a)(Object(A.a)({},k),{},{curve:new Float32Array([1,1]),oversample:"none"})),U=[m,g,y],B=[_,w,x];D.onaudioprocess=function(t){var e=t.inputBuffer,n=[e.getChannelData(0)[0],e.getChannelData(1)[0],e.getChannelData(2)[0]];n.some((function(t,e){return t!==U[e]}))&&(O.setOrientation.apply(O,n),U=n);var r=[e.getChannelData(3)[0],e.getChannelData(4)[0],e.getChannelData(5)[0]];r.some((function(t,e){return t!==B[e]}))&&(O.setPosition.apply(O,r),B=r)},Object.defineProperty(j.gain,"defaultValue",{get:function(){return 0}}),Object.defineProperty(P.gain,"defaultValue",{get:function(){return 0}}),Object.defineProperty(R.gain,"defaultValue",{get:function(){return 0}}),Object.defineProperty(N.gain,"defaultValue",{get:function(){return 0}}),Object.defineProperty(L.gain,"defaultValue",{get:function(){return 0}});var V={get bufferSize(){},get channelCount(){return O.channelCount},set channelCount(t){if(t>2)throw a();M.channelCount=t,O.channelCount=t},get channelCountMode(){return O.channelCountMode},set channelCountMode(t){if("max"===t)throw a();M.channelCountMode=t,O.channelCountMode=t},get channelInterpretation(){return O.channelInterpretation},set channelInterpretation(t){M.channelInterpretation=t,O.channelInterpretation=t},get coneInnerAngle(){return O.coneInnerAngle},set coneInnerAngle(t){O.coneInnerAngle=t},get coneOuterAngle(){return O.coneOuterAngle},set coneOuterAngle(t){O.coneOuterAngle=t},get coneOuterGain(){return O.coneOuterGain},set coneOuterGain(t){if(t<0||t>1)throw e();O.coneOuterGain=t},get context(){return O.context},get distanceModel(){return O.distanceModel},set distanceModel(t){O.distanceModel=t},get inputs(){return[M]},get maxDistance(){return O.maxDistance},set maxDistance(t){if(t<0)throw new RangeError;O.maxDistance=t},get numberOfInputs(){return O.numberOfInputs},get numberOfOutputs(){return O.numberOfOutputs},get orientationX(){return I.gain},get orientationY(){return j.gain},get orientationZ(){return P.gain},get panningModel(){return O.panningModel},set panningModel(t){O.panningModel=t},get positionX(){return R.gain},get positionY(){return N.gain},get positionZ(){return L.gain},get refDistance(){return O.refDistance},set refDistance(t){if(t<0)throw new RangeError;O.refDistance=t},get rolloffFactor(){return O.rolloffFactor},set rolloffFactor(t){if(t<0)throw new RangeError;O.rolloffFactor=t},addEventListener:function(){return M.addEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])},dispatchEvent:function(){return M.dispatchEvent(arguments.length<=0?void 0:arguments[0])},removeEventListener:function(){return M.removeEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])}};h!==V.coneInnerAngle&&(V.coneInnerAngle=h),f!==V.coneOuterAngle&&(V.coneOuterAngle=f),d!==V.coneOuterGain&&(V.coneOuterGain=d),p!==V.distanceModel&&(V.distanceModel=p),v!==V.maxDistance&&(V.maxDistance=v),m!==V.orientationX.value&&(V.orientationX.value=m),g!==V.orientationY.value&&(V.orientationY.value=g),y!==V.orientationZ.value&&(V.orientationZ.value=y),b!==V.panningModel&&(V.panningModel=b),_!==V.positionX.value&&(V.positionX.value=_),w!==V.positionY.value&&(V.positionY.value=w),x!==V.positionZ.value&&(V.positionZ.value=x),T!==V.refDistance&&(V.refDistance=T),E!==V.rolloffFactor&&(V.rolloffFactor=E),1===U[0]&&0===U[1]&&0===U[2]||O.setOrientation.apply(O,Object(X.a)(U)),0===B[0]&&0===B[1]&&0===B[2]||O.setPosition.apply(O,Object(X.a)(B));return u(ae(V,O),(function(){M.connect(O),t(M,F,0,0),F.connect(I).connect(C,0,0),F.connect(j).connect(C,0,1),F.connect(P).connect(C,0,2),F.connect(R).connect(C,0,3),F.connect(N).connect(C,0,4),F.connect(L).connect(C,0,5),C.connect(D).connect(c.destination)}),(function(){M.disconnect(O),s(M,F,0,0),F.disconnect(I),I.disconnect(C),F.disconnect(j),j.disconnect(C),F.disconnect(P),P.disconnect(C),F.disconnect(R),R.disconnect(C),F.disconnect(N),N.disconnect(C),F.disconnect(L),L.disconnect(C),C.disconnect(D),D.disconnect(c.destination)}))}}(st,Bt,Er,ue,_n,Yr,wn,ht,xr),Kr=(Ge=Xr,function(t,e){var n=t.createPanner();return void 0===n.orientationX?Ge(t,e):(Kt(n,e),Jt(n,e,"orientationX"),Jt(n,e,"orientationY"),Jt(n,e,"orientationZ"),Jt(n,e,"positionX"),Jt(n,e,"positionY"),Jt(n,e,"positionZ"),Xt(n,e,"coneInnerAngle"),Xt(n,e,"coneOuterAngle"),Xt(n,e,"coneOuterGain"),Xt(n,e,"distanceModel"),Xt(n,e,"maxDistance"),Xt(n,e,"panningModel"),Xt(n,e,"refDistance"),Xt(n,e,"rolloffFactor"),n)}),Qr=function(t,e,n,r,i,o,s){return function(t){Object(j.a)(c,t);var u=Object(P.a)(c);function c(t,l){var h;Object(a.a)(this,c);var f=i(t),d=Object(A.a)(Object(A.a)({},En),l),p=n(f,d),v=o(f),m=v?r():null;return(h=u.call(this,t,!1,p,m))._nativePannerNode=p,h._orientationX=e(Object(H.a)(h),v,p.orientationX,W,q),h._orientationY=e(Object(H.a)(h),v,p.orientationY,W,q),h._orientationZ=e(Object(H.a)(h),v,p.orientationZ,W,q),h._positionX=e(Object(H.a)(h),v,p.positionX,W,q),h._positionY=e(Object(H.a)(h),v,p.positionY,W,q),h._positionZ=e(Object(H.a)(h),v,p.positionZ,W,q),s(Object(H.a)(h),1),h}
2return Object(I.a)(c,[{key:"coneInnerAngle",get:function(){return this._nativePannerNode.coneInnerAngle},set:function(t){this._nativePannerNode.coneInnerAngle=t}},{key:"coneOuterAngle",get:function(){return this._nativePannerNode.coneOuterAngle},set:function(t){this._nativePannerNode.coneOuterAngle=t}},{key:"coneOuterGain",get:function(){return this._nativePannerNode.coneOuterGain},set:function(t){this._nativePannerNode.coneOuterGain=t}},{key:"distanceModel",get:function(){return this._nativePannerNode.distanceModel},set:function(t){this._nativePannerNode.distanceModel=t}},{key:"maxDistance",get:function(){return this._nativePannerNode.maxDistance},set:function(t){this._nativePannerNode.maxDistance=t}},{key:"orientationX",get:function(){return this._orientationX}},{key:"orientationY",get:function(){return this._orientationY}},{key:"orientationZ",get:function(){return this._orientationZ}},{key:"panningModel",get:function(){return this._nativePannerNode.panningModel},set:function(t){this._nativePannerNode.panningModel=t}},{key:"positionX",get:function(){return this._positionX}},{key:"positionY",get:function(){return this._positionY}},{key:"positionZ",get:function(){return this._positionZ}},{key:"refDistance",get:function(){return this._nativePannerNode.refDistance},set:function(t){this._nativePannerNode.refDistance=t}},{key:"rolloffFactor",get:function(){return this._nativePannerNode.rolloffFactor},set:function(t){this._nativePannerNode.rolloffFactor=t}}]),c}(t)}(nr,mr,Kr,function(t,e,n,r,i,o,a,s,u,c){return function(){var l=new WeakMap,h=null,f=function(){var f=Object(D.a)(L.a.mark((function f(d,p,v){var m,g,y,b,_,w,x;return L.a.wrap((function(f){for(;;)switch(f.prev=f.next){case 0:if(m=null,g=o(d),y={channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation},b=Object(A.a)(Object(A.a)({},y),{},{coneInnerAngle:g.coneInnerAngle,coneOuterAngle:g.coneOuterAngle,coneOuterGain:g.coneOuterGain,distanceModel:g.distanceModel,maxDistance:g.maxDistance,panningModel:g.panningModel,refDistance:g.refDistance,rolloffFactor:g.rolloffFactor}),_=F(g,p),"bufferSize"in g?m=r(p,Object(A.a)(Object(A.a)({},y),{},{gain:1})):_||(w=Object(A.a)(Object(A.a)({},b),{},{orientationX:g.orientationX.value,orientationY:g.orientationY.value,orientationZ:g.orientationZ.value,positionX:g.positionX.value,positionY:g.positionY.value,positionZ:g.positionZ.value}),g=i(p,w)),l.set(p,null===m?g:m),null===m){f.next=12;break}return f.delegateYield(L.a.mark((function t(){var o,l,f,g,_,w,x,T,E,S,O,k,C,M;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==h){t.next=7;break}if(null!==a){t.next=3;break}throw new Error("Missing the native OfflineAudioContext constructor.");case 3:o=new a(6,d.context.length,p.sampleRate),(l=e(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6})).connect(o.destination),h=Object(D.a)(L.a.mark((function t(){var e,r;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([d.orientationX,d.orientationY,d.orientationZ,d.positionX,d.positionY,d.positionZ].map(function(){var t=Object(D.a)(L.a.mark((function t(e,r){var i;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===r?1:0}),t.next=3,s(o,e,i.offset,v);case 3:return t.abrupt("return",i);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()));case 2:for(e=t.sent,r=0;r<6;r+=1)e[r].connect(l,0,r),e[r].start(0);return t.abrupt("return",c(o));case 5:case"end":return t.stop()}}),t)})))();case 7:return t.next=9,h;case 9:return f=t.sent,g=r(p,Object(A.a)(Object(A.a)({},y),{},{gain:1})),t.next=13,u(d,p,g,v);case 13:for(_=[],w=0;w<f.numberOfChannels;w+=1)_.push(f.getChannelData(w));for(x=[_[0][0],_[1][0],_[2][0]],T=[_[3][0],_[4][0],_[5][0]],E=r(p,Object(A.a)(Object(A.a)({},y),{},{gain:1})),S=i(p,Object(A.a)(Object(A.a)({},b),{},{orientationX:x[0],orientationY:x[1],orientationZ:x[2],positionX:T[0],positionY:T[1],positionZ:T[2]})),g.connect(E).connect(S.inputs[0]),S.connect(m),O=128;O<f.length;O+=128)k=[_[0][O],_[1][O],_[2][O]],C=[_[3][O],_[4][O],_[5][O]],(k.some((function(t,e){return t!==x[e]}))||C.some((function(t,e){return t!==T[e]})))&&(x=k,T=C,M=O/p.sampleRate,E.gain.setValueAtTime(0,M),E=r(p,Object(A.a)(Object(A.a)({},y),{},{gain:0})),S=i(p,Object(A.a)(Object(A.a)({},b),{},{orientationX:x[0],orientationY:x[1],orientationZ:x[2],positionX:T[0],positionY:T[1],positionZ:T[2]})),E.gain.setValueAtTime(1,M),g.connect(E).connect(S.inputs[0]),S.connect(m));return t.abrupt("return",{v:m});case 23:case"end":return t.stop()}}),t)}))(),"t0",9);case 9:if("object"!==typeof(x=f.t0)){f.next=12;break}return f.abrupt("return",x.v);case 12:if(_){f.next=27;break}return f.next=15,s(p,d.orientationX,g.orientationX,v);case 15:return f.next=17,s(p,d.orientationY,g.orientationY,v);case 17:return f.next=19,s(p,d.orientationZ,g.orientationZ,v);case 19:return f.next=21,s(p,d.positionX,g.positionX,v);case 21:return f.next=23,s(p,d.positionY,g.positionY,v);case 23:return f.next=25,s(p,d.positionZ,g.positionZ,v);case 25:f.next=39;break;case 27:return f.next=29,t(p,d.orientationX,g.orientationX,v);case 29:return f.next=31,t(p,d.orientationY,g.orientationY,v);case 31:return f.next=33,t(p,d.orientationZ,g.orientationZ,v);case 33:return f.next=35,t(p,d.positionX,g.positionX,v);case 35:return f.next=37,t(p,d.positionY,g.positionY,v);case 37:return f.next=39,t(p,d.positionZ,g.positionZ,v);case 39:if(!at(g)){f.next=44;break}
2return f.next=42,u(d,p,g.inputs[0],v);case 42:f.next=46;break;case 44:return f.next=46,u(d,p,g,v);case 46:return f.abrupt("return",g);case 47:case"end":return f.stop()}}),f)})));return function(t,e,n){return f.apply(this,arguments)}}();return{render:function(t,e,n){var r=l.get(e);return void 0!==r?Promise.resolve(r):f(t,e,n)}}}}(fr,Er,Cr,ue,Kr,ft,Xn,pr,Wn,Dr),Yn,Kn,_r),Jr=function(t,e,n,r){return function(){function i(o,s){Object(a.a)(this,i);var u=e(o),c=r(Object(A.a)(Object(A.a)({},Sn),s)),l=t(u,c);return n.add(l),l}return Object(I.a)(i,null,[{key:Symbol.hasInstance,value:function(t){return null!==t&&"object"===typeof t&&Object.getPrototypeOf(t)===i.prototype||n.has(t)}}]),i}()}(function(t){return function(e,n){var r=n.disableNormalization,i=n.imag,o=n.real,a=i instanceof Float32Array?i:new Float32Array(i),s=o instanceof Float32Array?o:new Float32Array(o),u=e.createPeriodicWave(s,a,{disableNormalization:r});if(Array.from(i).length<2)throw t();return u}}(B),Yn,new WeakSet,(function(t){var e=t.imag,n=t.real;return void 0===e?void 0===n?Object(A.a)(Object(A.a)({},t),{},{imag:[0,0],real:[0,0]}):Object(A.a)(Object(A.a)({},t),{},{imag:Array.from(n,(function(){return 0})),real:n}):void 0===n?Object(A.a)(Object(A.a)({},t),{},{imag:e,real:Array.from(e,(function(){return 0}))}):Object(A.a)(Object(A.a)({},t),{},{imag:e,real:n})})),Zr=function(t,e){return function(n,r){var i=r.channelCountMode;if("clamped-max"===i)throw e();if(void 0===n.createStereoPanner)return t(n,r);var o=n.createStereoPanner();return Kt(o,r),Jt(o,r,"pan"),Object.defineProperty(o,"channelCountMode",{get:function(){return i},set:function(t){if(t!==i)throw e()}}),o}}(function(t,e,n,r,i,o){var a=16385,s=new Float32Array([1,1]),u=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},l=Object(A.a)(Object(A.a)({},c),{},{oversample:"none"}),h=function(t,o,h,f,d){if(1===o)return function(t,e,i,o){for(var h=new Float32Array(a),f=new Float32Array(a),d=0;d<a;d+=1){var p=d/16384*u;h[d]=Math.cos(p),f[d]=Math.sin(p)}var v=n(t,Object(A.a)(Object(A.a)({},c),{},{gain:0})),m=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:h})),g=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:s})),y=n(t,Object(A.a)(Object(A.a)({},c),{},{gain:0})),b=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:f}));return{connectGraph:function(){e.connect(v),e.connect(void 0===g.inputs?g:g.inputs[0]),e.connect(y),g.connect(i),i.connect(void 0===m.inputs?m:m.inputs[0]),i.connect(void 0===b.inputs?b:b.inputs[0]),m.connect(v.gain),b.connect(y.gain),v.connect(o,0,0),y.connect(o,0,1)},disconnectGraph:function(){e.disconnect(v),e.disconnect(void 0===g.inputs?g:g.inputs[0]),e.disconnect(y),g.disconnect(i),i.disconnect(void 0===m.inputs?m:m.inputs[0]),i.disconnect(void 0===b.inputs?b:b.inputs[0]),m.disconnect(v.gain),b.disconnect(y.gain),v.disconnect(o,0,0),y.disconnect(o,0,1)}}}(t,h,f,d);if(2===o)return function(t,i,o,h){for(var f=new Float32Array(a),d=new Float32Array(a),p=new Float32Array(a),v=new Float32Array(a),m=Math.floor(8192.5),g=0;g<a;g+=1)if(g>m){var y=(g-m)/(16384-m)*u;f[g]=Math.cos(y),d[g]=Math.sin(y),p[g]=0,v[g]=1}else{var b=g/(16384-m)*u;f[g]=1,d[g]=0,p[g]=Math.cos(b),v[g]=Math.sin(b)}var _=e(t,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),w=n(t,Object(A.a)(Object(A.a)({},c),{},{gain:0})),x=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:f})),T=n(t,Object(A.a)(Object(A.a)({},c),{},{gain:0})),E=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:d})),S=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:s})),O=n(t,Object(A.a)(Object(A.a)({},c),{},{gain:0})),k=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:p})),C=n(t,Object(A.a)(Object(A.a)({},c),{},{gain:0})),M=r(t,Object(A.a)(Object(A.a)({},l),{},{curve:v}));return{connectGraph:function(){i.connect(_),i.connect(void 0===S.inputs?S:S.inputs[0]),_.connect(w,0),_.connect(T,0),_.connect(O,1),_.connect(C,1),S.connect(o),o.connect(void 0===x.inputs?x:x.inputs[0]),o.connect(void 0===E.inputs?E:E.inputs[0]),o.connect(void 0===k.inputs?k:k.inputs[0]),o.connect(void 0===M.inputs?M:M.inputs[0]),x.connect(w.gain),E.connect(T.gain),k.connect(O.gain),M.connect(C.gain),w.connect(h,0,0),O.connect(h,0,0),T.connect(h,0,1),C.connect(h,0,1)},disconnectGraph:function(){i.disconnect(_),i.disconnect(void 0===S.inputs?S:S.inputs[0]),_.disconnect(w,0),_.disconnect(T,0),_.disconnect(O,1),_.disconnect(C,1),S.disconnect(o),o.disconnect(void 0===x.inputs?x:x.inputs[0]),o.disconnect(void 0===E.inputs?E:E.inputs[0]),o.disconnect(void 0===k.inputs?k:k.inputs[0]),o.disconnect(void 0===M.inputs?M:M.inputs[0]),x.disconnect(w.gain),E.disconnect(T.gain),k.disconnect(O.gain),M.disconnect(C.gain),w.disconnect(h,0,0),O.disconnect(h,0,0),T.disconnect(h,0,1),C.disconnect(h,0,1)}}}(t,h,f,d);throw i()};return function(e,r){var a=r.channelCount,s=r.channelCountMode,u=r.pan,c=oe(r,["channelCount","channelCountMode","pan"]);if("max"===s)throw i();
2var l=t(e,Object(A.a)(Object(A.a)({},c),{},{channelCount:1,channelCountMode:s,numberOfInputs:2})),f=n(e,Object(A.a)(Object(A.a)({},c),{},{channelCount:a,channelCountMode:s,gain:1})),d=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:u}),p=h(e,a,f,d,l),v=p.connectGraph,m=p.disconnectGraph;Object.defineProperty(d.gain,"defaultValue",{get:function(){return 0}}),Object.defineProperty(d.gain,"maxValue",{get:function(){return 1}}),Object.defineProperty(d.gain,"minValue",{get:function(){return-1}});var g={get bufferSize(){},get channelCount(){return f.channelCount},set channelCount(t){if(f.channelCount!==t){y&&m();var n=h(e,t,f,d,l);v=n.connectGraph,m=n.disconnectGraph,y&&v()}f.channelCount=t},get channelCountMode(){return f.channelCountMode},set channelCountMode(t){if("clamped-max"===t||"max"===t)throw i();f.channelCountMode=t},get channelInterpretation(){return f.channelInterpretation},set channelInterpretation(t){f.channelInterpretation=t},get context(){return f.context},get inputs(){return[f]},get numberOfInputs(){return f.numberOfInputs},get numberOfOutputs(){return f.numberOfOutputs},get pan(){return d.gain},addEventListener:function(){return f.addEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])},dispatchEvent:function(){return f.dispatchEvent(arguments.length<=0?void 0:arguments[0])},removeEventListener:function(){return f.removeEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])}},y=!1;return o(ae(g,l),(function(){v(),y=!0}),(function(){m(),y=!1}))}}(Er,ie,ue,Yr,wn,xr),wn),$r=function(t,e,n,r,i,o){return function(t){Object(j.a)(u,t);var s=Object(P.a)(u);function u(t,c){var l;Object(a.a)(this,u);var h=i(t),f=Object(A.a)(Object(A.a)({},On),c),d=n(h,f),p=o(h),v=p?r():null;return(l=s.call(this,t,!1,d,v))._pan=e(Object(H.a)(l),p,d.pan),l}return Object(I.a)(u,[{key:"pan",get:function(){return this._pan}}]),u}(t)}(nr,mr,Zr,function(t,e,n,r,i){return function(){var o=new WeakMap,a=function(){var a=Object(D.a)(L.a.mark((function a(s,u,c){var l,h,f;return L.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(l=n(s),(h=F(l,u))||(f={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value},l=e(u,f)),o.set(u,l),h){a.next=9;break}return a.next=7,r(u,s.pan,l.pan,c);case 7:a.next=11;break;case 9:return a.next=11,t(u,s.pan,l.pan,c);case 11:if(!at(l)){a.next=16;break}return a.next=14,i(s,u,l.inputs[0],c);case 14:a.next=18;break;case 16:return a.next=18,i(s,u,l,c);case 18:return a.abrupt("return",l);case 19:case"end":return a.stop()}}),a)})));return function(t,e,n){return a.apply(this,arguments)}}();return{render:function(t,e,n){var r=o.get(e);return void 0!==r?Promise.resolve(r):a(t,e,n)}}}}(fr,Zr,ft,pr,Wn),Yn,Kn),ti=function(t,e,n){return function(){var r=new WeakMap,i=function(){var i=Object(D.a)(L.a.mark((function i(o,a,s){var u,c;return L.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(u=e(o),F(u,a)||(c={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,curve:u.curve,oversample:u.oversample},u=t(a,c)),r.set(a,u),!at(u)){i.next=9;break}return i.next=7,n(o,a,u.inputs[0],s);case 7:i.next=11;break;case 9:return i.next=11,n(o,a,u,s);case 11:return i.abrupt("return",u);case 12:case"end":return i.stop()}}),i)})));return function(t,e,n){return i.apply(this,arguments)}}();return{render:function(t,e,n){var o=r.get(e);return void 0!==o?Promise.resolve(o):i(t,e,n)}}}}(Yr,ft,Wn),ei=function(t,e,n,r,i,o,s){return function(t){Object(j.a)(c,t);var u=Object(P.a)(c);function c(t,e){var l;Object(a.a)(this,c);var h=i(t),f=Object(A.a)(Object(A.a)({},Cn),e),d=n(h,f),p=o(h)?r():null;return(l=u.call(this,t,!0,d,p))._isCurveNullified=!1,l._nativeWaveShaperNode=d,s(Object(H.a)(l),1),l}return Object(I.a)(c,[{key:"curve",get:function(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve},set:function(t){if(null===t)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(t.length<2)throw e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=t}}},{key:"oversample",get:function(){return this._nativeWaveShaperNode.oversample},set:function(t){this._nativeWaveShaperNode.oversample=t}}]),c}(t)}(nr,Bt,Yr,ti,Yn,Kn,_r),ni=function(t){return null!==t&&t.isSecureContext}(zn),ri=function(t){return function(e,n,r){Object.defineProperties(t,{currentFrame:{configurable:!0,get:function(){return Math.round(e*n)}},currentTime:{configurable:!0,get:function(){return e}}});try{return r()}finally{null!==t&&(delete t.currentFrame,delete t.currentTime)}}}(zn),ii=new WeakMap,oi=function(t,e){return function(n){var r=t.get(n);if(void 0!==r)return r;if(null===e)throw new Error("Missing the native OfflineAudioContext constructor.");return r=new e(1,1,44100),t.set(n,r),r}}(ii,Xn),ai=function(t){return null===t?null:t.hasOwnProperty("AudioWorkletNode")?t.AudioWorkletNode:null}(zn),si=ni?function(t,e,n,r,i,s,u,c,l,h,f,d,p){return function(m,g){var y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{credentials:"omit"},x=s(m);if(void 0!==x.audioWorklet)return Promise.all([i(g),Promise.resolve(t(d,d))]).then((function(t){var e=Object(o.a)(t,2),n=Object(o.a)(e[0],2),r=n[0],i=n[1],a=e[1],s=b(r,i),h=Object(o.a)(s,2),f=h[0],d=h[1],p=a?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}",v=a?"":"__c = (a) =>
2 a.forEach(e=>this.__b.add(e.buffer));",m=a?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));",g="".concat(f,";((AudioWorkletProcessor,registerProcessor)=>{").concat(d,"\n})(").concat(p,",(n,p)=>registerProcessor(n,class extends p{").concat(v,"process(i,o,p){").concat(m,"return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac',class extends AudioWorkletProcessor{process(){return !1}})"),_=new Blob([g],{type:"application/javascript; charset=utf-8"}),w=URL.createObjectURL(_);return x.audioWorklet.addModule(w,y).then((function(){if(c(x))return x;var t=u(x);return t.audioWorklet.addModule(w,y).then((function(){return t}))})).then((function(t){if(null===l)throw new SyntaxError;try{new l(t,"__sac")}catch(e){throw new SyntaxError}})).finally((function(){return URL.revokeObjectURL(w)}))}));var T=f.get(m);if(void 0!==T&&T.has(g))return Promise.resolve();var E=h.get(m);if(void 0!==E){var S=E.get(g);if(void 0!==S)return S}var O=i(g).then((function(t){var e=Object(o.a)(t,2),r=e[0],i=e[1],a=b(r,i),s=Object(o.a)(a,2),u=s[0],c=s[1],l="".concat(u,";((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{").concat(c,"\n})})(window,'_AWGS')");return n(l)})).then((function(){var t=p._AWGS.pop();if(void 0===t)throw new SyntaxError;r(x.currentTime,x.sampleRate,(function(){return t((function t(){Object(a.a)(this,t)}),void 0,(function(t,n){if(""===t.trim())throw e();var r=v.get(x);if(void 0!==r){if(r.has(t))throw e();w(n),_(n.parameterDescriptors),r.set(t,n)}else w(n),_(n.parameterDescriptors),v.set(x,new Map([[t,n]]))}),x.sampleRate,void 0,void 0)}))}));return void 0===E?h.set(m,new Map([[g,O]])):E.set(g,O),O.then((function(){var t=f.get(m);void 0===t?f.set(m,new Set([g])):t.add(g)})).finally((function(){var t=h.get(m);void 0!==t&&t.delete(g)})),O}}(Vn,wn,function(t){return function(e){return new Promise((function(n,r){if(null!==t){var i=t.document.head;if(null===i)r(new SyntaxError);else{var o=t.document.createElement("script"),a=new Blob([e],{type:"application/javascript"}),s=URL.createObjectURL(a),u=t.onerror,c=function(){t.onerror=u,URL.revokeObjectURL(s)};t.onerror=function(e,n,i,o,a){return n===s||n===t.location.href&&1===i&&1===o?(c(),r(a),!1):null!==u?u(e,n,i,o,a):void 0},o.onerror=function(){c(),r(new SyntaxError)},o.onload=function(){c(),n()},o.src=s,o.type="module",i.appendChild(o)}}else r(new SyntaxError)}))}}(zn),ri,(Ye=function(){return new DOMException("","AbortError")},function(){var t=Object(D.a)(L.a.mark((function t(e){var n;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(e);case 3:if(!(n=t.sent).ok){t.next=10;break}return t.next=7,n.text();case 7:return t.t0=t.sent,t.t1=n.url,t.abrupt("return",[t.t0,t.t1]);case 10:t.next=14;break;case 12:t.prev=12,t.t2=t.catch(0);case 14:throw Ye();case 15:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}()),Yn,oi,Kn,ai,new WeakMap,new WeakMap,function(t,e){return Object(D.a)(L.a.mark((function n(){var r,i,o,a,s,u,c;return L.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!==t){n.next=2;break}return n.abrupt("return",!0);case 2:if(null!==e){n.next=4;break}return n.abrupt("return",!1);case 4:return r=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),i=new e(1,128,44100),o=URL.createObjectURL(r),a=!1,s=!1,n.prev=9,n.next=12,i.audioWorklet.addModule(o);case 12:return u=new t(i,"a",{numberOfOutputs:0}),c=i.createOscillator(),u.port.onmessage=function(){return a=!0},u.onprocessorerror=function(){return s=!0},c.connect(u),c.start(0),n.next=20,i.startRendering();case 20:n.next=24;break;case 22:n.prev=22,n.t0=n.catch(9);case 24:return n.prev=24,URL.revokeObjectURL(o),n.finish(24);case 27:return n.abrupt("return",a&&!s);case 28:case"end":return n.stop()}}),n,null,[[9,22,24,27]])})))}(ai,Xn),zn):void 0,ui=function(t,e){return function(n){return t(n)||e(n)}}($n,Kn),ci=function(t,e,n,r,i,o,a,s,u,c,l){return function(h,f){var d=a(h)?h:o(h);if(i.has(f)){var p=n();return Promise.reject(p)}try{i.add(f)}catch(v){}return e(u,(function(){return u(d)}))?d.decodeAudioData(f).then((function(n){return Nt(f).catch((function(){})),e(s,(function(){return s(n)}))||l(n),t.add(n),n})):new Promise((function(e,n){var i=function(){var t=Object(D.a)(L.a.mark((function t(){return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Nt(f);case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(){return t.apply(this,arguments)}}(),o=function(t){n(t),i()};try{d.decodeAudioData(f,(function(n){"function"!==typeof n.copyFromChannel&&(c(n),V(n)),t.add(n),i().then((function(){return e(n)}))}),(function(t){o(null===t?r():t)}))}catch(p){o(p)}}))}}(ir,Vn,(function(){return new DOMException("","DataCloneError")}),(function(){return new DOMException("","EncodingError")}),new WeakSet,Yn,ui,U,Gt,sr,ur),li=(Xe=si,Ke=rr,Qe=cr,Je=gr,Ze=wr,$e=Sr,tn=Or,en=Mr,nn=Ir,rn=ci,on=jr,an=Rr,sn=Nr,un=Ur,cn=qr,ln=Qr,hn=Jr,fn=$r,dn=ei,function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(t,r){var i;return Object(a.a)(this,n),(i=e.call(this,t,r))._nativeContext=t,i._audioWorklet=void 0===Xe?void 0:{addModule:function(t,e){return Xe(Object(H.a)(i),t,e)}},i}return Object(I.a)(n,[{key:"audioWorklet",get:function(){return this._audioWorklet}},{key:"createAnalyser",value:function(){return new Ke(this)}},{key:"createBiquadFilter",value:function(){return new Ze(this)}},{key:"createBuffer",value:function(t,e,n){return new Qe({length:e,numberOfChannels:t,sampleRate:n})}},{key:"createBufferSource",value:function(){return new Je(this)}},{key:"createChannelMerger",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6;return new $e(this,{numberOfInputs:t})}},{key:"createChannelSplitter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6;return new tn(this,{numberOfOutputs:t})}},{key:"createConstantSource",value:function(){return new en(this)}},{key:"createConvolver",value:function(){return new nn(this)}},{key:"createDelay",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new on(this,{maxDelayTime:t})}},{key:"createDynamicsCompressor",value:function(){return new an(this)}},{key:"createGain",value:function(){return new sn(this)}},{key:"createIIRFilter",value:function(t,e){return new un(this,{feedback:e,feedforward:t})}},{key:"createOscillator",value:function(){return new cn(this)}},{key:"createPanner",value:function(){return new ln(this)}}
2,{key:"createPeriodicWave",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{disableNormalization:!1};return new hn(this,Object(A.a)(Object(A.a)({},n),{},{imag:e,real:t}))}},{key:"createStereoPanner",value:function(){return new fn(this)}},{key:"createWaveShaper",value:function(){return new dn(this)}},{key:"decodeAudioData",value:function(t,e,n){return rn(this._nativeContext,t).then((function(t){return"function"===typeof e&&e(t),t}),(function(t){throw"function"===typeof n&&n(t),t}))}}]),n}(zr)),hi=function(t,e,n,r){return function(t){Object(j.a)(o,t);var i=Object(P.a)(o);function o(t,s){var u;Object(a.a)(this,o);var c=n(t),l=e(c,s);if(r(c))throw TypeError();return(u=i.call(this,t,!0,l,null))._nativeMediaElementAudioSourceNode=l,u}return Object(I.a)(o,[{key:"mediaElement",get:function(){return this._nativeMediaElementAudioSourceNode.mediaElement}}]),o}(t)}(nr,(function(t,e){return t.createMediaElementSource(e.mediaElement)}),Yn,Kn),fi=function(t,e,n,r){return function(t){Object(j.a)(o,t);var i=Object(P.a)(o);function o(t,s){var u;Object(a.a)(this,o);var c=n(t);if(r(c))throw new TypeError;var l=Object(A.a)(Object(A.a)({},Wt),s),h=e(c,l);return(u=i.call(this,t,!1,h,null))._nativeMediaStreamAudioDestinationNode=h,u}return Object(I.a)(o,[{key:"stream",get:function(){return this._nativeMediaStreamAudioDestinationNode.stream}}]),o}(t)}(nr,(function(t,e){var n=t.createMediaStreamDestination();return Kt(n,e),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:function(){return 0}}),n}),Yn,Kn),di=function(t,e,n,r){return function(t){Object(j.a)(o,t);var i=Object(P.a)(o);function o(t,s){var u;Object(a.a)(this,o);var c=n(t),l=e(c,s);if(r(c))throw new TypeError;return(u=i.call(this,t,!0,l,null))._nativeMediaStreamAudioSourceNode=l,u}return Object(I.a)(o,[{key:"mediaStream",get:function(){return this._nativeMediaStreamAudioSourceNode.mediaStream}}]),o}(t)}(nr,(function(t,e){var n=e.mediaStream,r=n.getAudioTracks();r.sort((function(t,e){return t.id<e.id?-1:t.id>e.id?1:0}));var i=r.slice(0,1),o=t.createMediaStreamSource(new MediaStream(i));return Object.defineProperty(o,"mediaStream",{value:n}),o}),Yn,Kn),pi=function(t,e,n){return function(t){Object(j.a)(i,t);var r=Object(P.a)(i);function i(t,o){Object(a.a)(this,i);var s=n(t),u=e(s,o);return r.call(this,t,!0,u,null)}return i}(t)}(nr,function(t,e){return function(n,r){var i=r.mediaStreamTrack;if("function"===typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(i);var o=new MediaStream([i]),a=n.createMediaStreamSource(o);if("audio"!==i.kind)throw t();if(e(n))throw new TypeError;return a}}(Bt,Kn),Yn),vi=function(t,e,n,r,i,o,s,u,c){return function(t){Object(j.a)(h,t);var l=Object(P.a)(h);function h(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(a.a)(this,h),null===c)throw new Error("Missing the native AudioContext constructor.");try{e=new c(i)}catch(d){if(12===d.code&&"sampleRate is not in range"===d.message)throw n();throw d}if(null===e)throw r();if(!tt(i.latencyHint))throw new TypeError("The provided value '".concat(i.latencyHint,"' is not a valid enum value of type AudioContextLatencyCategory."));if(void 0!==i.sampleRate&&e.sampleRate!==i.sampleRate)throw n();t=l.call(this,e,2);var o=i.latencyHint,s=e,u=s.sampleRate;if(t._baseLatency="number"===typeof e.baseLatency?e.baseLatency:"balanced"===o?512/u:"interactive"===o||void 0===o?256/u:"playback"===o?1024/u:128*Math.max(2,Math.min(128,Math.round(o*u/128)))/u,t._nativeAudioContext=e,"webkitAudioContext"===c.name?(t._nativeGainNode=e.createGain(),t._nativeOscillatorNode=e.createOscillator(),t._nativeGainNode.gain.value=1e-37,t._nativeOscillatorNode.connect(t._nativeGainNode).connect(e.destination),t._nativeOscillatorNode.start()):(t._nativeGainNode=null,t._nativeOscillatorNode=null),t._state=null,"running"===e.state){t._state="suspended";var f=function n(){"suspended"===t._state&&(t._state=null),e.removeEventListener("statechange",n)};e.addEventListener("statechange",f)}return t}return Object(I.a)(h,[{key:"baseLatency",get:function(){return this._baseLatency}},{key:"state",get:function(){return null!==this._state?this._state:this._nativeAudioContext.state}},{key:"close",value:function(){var t=this;return"closed"===this.state?this._nativeAudioContext.close().then((function(){throw e()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((function(){null!==t._nativeGainNode&&null!==t._nativeOscillatorNode&&(t._nativeOscillatorNode.stop(),t._nativeGainNode.disconnect(),t._nativeOscillatorNode.disconnect()),$(t)})))}},{key:"createMediaElementSource",value:function(t){return new i(this,{mediaElement:t})}},{key:"createMediaStreamDestination",value:function(){return new o(this)}},{key:"createMediaStreamSource",value:function(t){return new s(this,{mediaStream:t})}},{key:"createMediaStreamTrackSource",value:function(t){return new u(this,{mediaStreamTrack:t})}},{key:"resume",value:function(){var t=this;return"suspended"===this._state?new Promise((function(e,n){t._nativeAudioContext.addEventListener("statechange",(function r(){t._nativeAudioContext.removeEventListener("statechange",r),"running"===t._nativeAudioContext.state?e():t.resume().then(e,n)}))})):this._nativeAudioContext.resume().catch((function(t){if(void 0===t||15===t.code)throw e();throw t}))}},{key:"suspend",value:function(){return this._nativeAudioContext.suspend().catch((function(t){if(void 0===t)throw e();throw t}))}}]),h}(t)}(li,Bt,wn,kn,hi,fi,di,pi,Zn),mi=(pn=Vr,function(t){var e=pn.get(t);if(void 0===e)throw new Error("The context has no set of AudioWorkletNodes.");return e}),gi=(vn=mi,function(t,e){vn(t).add(e)}),yi=function(t){return function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=e[r];if(void 0===o)throw t();return yt(n)?o.connect(n,0,i):o.connect(n,0)}}(B),bi=function(t){return function(e,n){t(e).delete(n)}}(mi),_i=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return void 0===n?e.forEach((function(t){return t.disconnect()})):"number"===typeof n?Dt(t,e,n).disconnect():yt(n)?void 0===r?e.forEach((function(t){return t.disconnect(n)})):void 0===i?Dt(t,e,r).disconnect(n,0):Dt(t,e,r).disconnect(n,0,i):void 0===r?e.forEach((function(t){return t.disconnect(n)})):Dt(t,e,r).disconnect(n,0)}}(B),wi=new WeakMap,xi=function(t,e){return function(n){return e(t,n)}}(wi,x),Ti=function(t,e,n,r,i,o,a,s,u,c,l,h,f){return function(d,p,v,g){if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw u();var y=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(y.some((function(t){return t<1})))throw u();if(y.length!==g.numberOfOutputs)throw e();if("explicit"!==g.channelCountMode)throw u();var b=g.channelCount*g.numberOfInputs,_=y.reduce((function(t,e){return t+e}),0),w=void 0===v.parameterDescriptors?0:v.parameterDescriptors.length;if(b+w>6||_>6)throw u();for(var x=new MessageChannel,T=[],E=[],S=0;S<g.numberOfInputs;S+=1)T.push(a(d,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),E.push(i(d,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));var O=[];
2if(void 0!==v.parameterDescriptors){var k,C=Object(K.a)(v.parameterDescriptors);try{var M=function(){var t=k.value,e=t.defaultValue,n=t.maxValue,r=t.minValue,i=t.name,a=o(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:void 0!==g.parameterData[i]?g.parameterData[i]:void 0===e?0:e});Object.defineProperties(a.offset,{defaultValue:{get:function(){return void 0===e?0:e}},maxValue:{get:function(){return void 0===n?W:n}},minValue:{get:function(){return void 0===r?q:r}}}),O.push(a)};for(C.s();!(k=C.n()).done;)M()}catch(at){C.e(at)}finally{C.f()}}for(var I=r(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+w)}),j=te(p,d.sampleRate),P=s(d,j,b+w,Math.max(1,_)),R=i(d,{channelCount:Math.max(1,_),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,_)}),N=[],L=0;L<g.numberOfOutputs;L+=1)N.push(r(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:y[L]}));for(var D=0;D<g.numberOfInputs;D+=1){T[D].connect(E[D]);for(var F=0;F<g.channelCount;F+=1)E[D].connect(I,F,D*g.channelCount+F)}var U=new xt(void 0===v.parameterDescriptors?[]:v.parameterDescriptors.map((function(t,e){var n=t.name,r=O[e];return r.connect(I,0,b+e),r.start(0),[n,r.offset]})));I.connect(P);var B=g.channelInterpretation,V=null,z=0===g.numberOfOutputs?[P]:N,H={get bufferSize(){return j},get channelCount(){return g.channelCount},set channelCount(t){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(t){throw n()},get channelInterpretation(){return B},set channelInterpretation(t){var e,n=Object(K.a)(T);try{for(n.s();!(e=n.n()).done;){e.value.channelInterpretation=t}}catch(at){n.e(at)}finally{n.f()}B=t},get context(){return P.context},get inputs(){return T},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return V},set onprocessorerror(t){"function"===typeof V&&H.removeEventListener("processorerror",V),"function"===typeof(V="function"===typeof t?t:null)&&H.addEventListener("processorerror",V)},get parameters(){return U},get port(){return x.port2},addEventListener:function(){return P.addEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])},connect:t.bind(null,z),disconnect:c.bind(null,z),dispatchEvent:function(){return P.dispatchEvent(arguments.length<=0?void 0:arguments[0])},removeEventListener:function(){return P.removeEventListener(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])}},G=new Map;x.port1.addEventListener=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if("message"===n[0]){var i="function"===typeof n[1]?n[1]:"object"===typeof n[1]&&null!==n[1]&&"function"===typeof n[1].handleEvent?n[1].handleEvent:null;if(null!==i){var o=G.get(n[1]);void 0!==o?n[1]=o:(n[1]=function(t){l(d.currentTime,d.sampleRate,(function(){return i(t)}))},G.set(i,n[1]))}}return t.call(x.port1,n[0],n[1],n[2])}}(x.port1.addEventListener),x.port1.removeEventListener=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if("message"===n[0]){var i=G.get(n[1]);void 0!==i&&(G.delete(n[1]),n[1]=i)}return t.call(x.port1,n[0],n[1],n[2])}}(x.port1.removeEventListener);var Y=null;Object.defineProperty(x.port1,"onmessage",{get:function(){return Y},set:function(t){"function"===typeof Y&&x.port1.removeEventListener("message",Y),"function"===typeof(Y="function"===typeof t?t:null)&&(x.port1.addEventListener("message",Y),x.port1.start())}}),v.prototype.port=x.port1;var X=null;(function(t,e,n,r){var i=m.get(t);void 0===i&&(i=new WeakMap,m.set(t,i));var o=ne(n,r);return i.set(e,o),o})(d,H,v,g).then((function(t){return X=t}));var Q=kt(g.numberOfInputs,g.channelCount),J=kt(g.numberOfOutputs,y),Z=void 0===v.parameterDescriptors?[]:v.parameterDescriptors.reduce((function(t,e){var n=e.name;return Object(A.a)(Object(A.a)({},t),{},Object(Et.a)({},n,new Float32Array(128)))}),{}),$=!0,tt=function(){g.numberOfOutputs>0&&P.disconnect(R);for(var t=0,e=0;t<g.numberOfOutputs;t+=1){for(var n=N[t],r=0;r<y[t];r+=1)R.disconnect(n,e+r,r);e+=y[t]}},et=new Map;P.onaudioprocess=function(t){var e=t.inputBuffer,n=t.outputBuffer;null!==X&&function(){for(var t=h(H),r=function(r){for(var i=0;i<g.numberOfInputs;i+=1)for(var o=0;o<g.channelCount;o+=1)St(e,Q[i],o,o,r);
2void 0!==v.parameterDescriptors&&v.parameterDescriptors.forEach((function(t,n){var i=t.name;St(e,Z,i,b+n,r)}));for(var a=0;a<g.numberOfInputs;a+=1)for(var s=0;s<y[a];s+=1)0===J[a][s].byteLength&&(J[a][s]=new Float32Array(128));try{var u=Q.map((function(e,n){if(t[n].size>0)return et.set(n,j/128),e;var r=et.get(n);return void 0===r?[]:(e.every((function(t){return t.every((function(t){return 0===t}))}))&&(1===r?et.delete(n):et.set(n,r-1)),e)})),c=l(d.currentTime+r/d.sampleRate,d.sampleRate,(function(){return X.process(u,J,Z)}));$=c;for(var h=0,f=0;h<g.numberOfOutputs;h+=1){for(var p=0;p<y[h];p+=1)Ot(n,J[h],p,f+p,r);f+=y[h]}}catch(k){$=!1,H.dispatchEvent(new ErrorEvent("processorerror",{colno:k.colno,filename:k.filename,lineno:k.lineno,message:k.message}))}if(!$){for(var m=0;m<g.numberOfInputs;m+=1){T[m].disconnect(E[m]);for(var _=0;_<g.channelCount;_+=1)E[r].disconnect(I,_,m*g.channelCount+_)}if(void 0!==v.parameterDescriptors)for(var w=v.parameterDescriptors.length,x=0;x<w;x+=1){var S=O[x];S.disconnect(I,0,b+x),S.stop()}return I.disconnect(P),P.onaudioprocess=null,nt?tt():ot(),"break"}},i=0;i<j;i+=128){if("break"===r(i))break}}()};var nt=!1,rt=a(d,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),it=function(){return P.connect(rt).connect(d.destination)},ot=function(){P.disconnect(rt),rt.disconnect()};return it(),f(H,(function(){if($){ot(),g.numberOfOutputs>0&&P.connect(R);for(var t=0,e=0;t<g.numberOfOutputs;t+=1){for(var n=N[t],r=0;r<y[t];r+=1)R.connect(n,e+r,r);e+=y[t]}}nt=!0}),(function(){$&&(it(),tt()),nt=!1}))}}(yi,B,Bt,Er,ie,Cr,ue,_n,wn,_i,ri,xi,xr),Ei=function(t,e,n,r,i){return function(o,a,s,u,c,l){if(null!==s)try{var h=new s(o,u,l),f=new Map,d=null;if(Object.defineProperties(h,{channelCount:{get:function(){return l.channelCount},set:function(){throw t()}},channelCountMode:{get:function(){return"explicit"},set:function(){throw t()}},onprocessorerror:{get:function(){return d},set:function(t){"function"===typeof d&&h.removeEventListener("processorerror",d),"function"===typeof(d="function"===typeof t?t:null)&&h.addEventListener("processorerror",d)}}}),h.addEventListener=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if("processorerror"===n[0]){var i="function"===typeof n[1]?n[1]:"object"===typeof n[1]&&null!==n[1]&&"function"===typeof n[1].handleEvent?n[1].handleEvent:null;if(null!==i){var o=f.get(n[1]);void 0!==o?n[1]=o:(n[1]=function(t){"error"===t.type?(Object.defineProperties(t,{type:{value:"processorerror"}}),i(t)):i(new ErrorEvent(n[0],Object(A.a)({},t)))},f.set(i,n[1]))}}return t.call(h,"error",n[1],n[2]),t.call.apply(t,[h].concat(n))}}(h.addEventListener),h.removeEventListener=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if("processorerror"===n[0]){var i=f.get(n[1]);void 0!==i&&(f.delete(n[1]),n[1]=i)}return t.call(h,"error",n[1],n[2]),t.call(h,n[0],n[1],n[2])}}(h.removeEventListener),0!==l.numberOfOutputs){var p=n(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});h.connect(p).connect(o.destination);return i(h,(function(){return p.disconnect()}),(function(){return p.connect(o.destination)}))}return h}catch(v){if(11===v.code)throw r();throw v}if(void 0===c)throw r();return function(t){var e=(new MessageChannel).port1;try{e.postMessage(t)}finally{e.close()}}(l),e(o,a,c,l)}}(Bt,Ti,ue,wn,xr),Si=function(t,e,n,r,i,a,s,u,c,l,h,f,d,p,v,m){return function(g,y,b){var _=new WeakMap,w=null,x=function(){var u=Object(D.a)(L.a.mark((function u(x,T,E){var S,O,k,C,M,A,I,j,P,R,N,U,B,V,z,H,q,W,G,Y,X,Q,J,Z,$,tt,et,nt,rt,it,ot,at,st,ut;return L.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(S=h(x),O=null,k=F(S,T),C=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount),null===f){for(M=C.reduce((function(t,e){return t+e}),0),A=i(T,{channelCount:Math.max(1,M),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,M)}),I=[],j=0;j<x.numberOfOutputs;j+=1)I.push(r(T,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:C[j]}));(P=s(T,{channelCount:y.channelCount,channelCountMode:y.channelCountMode,channelInterpretation:y.channelInterpretation,gain:1})).connect=e.bind(null,I),P.disconnect=c.bind(null,I),O=[A,I,P]}else k||(S=new f(T,g));if(_.set(T,null===O?S:O[2]),null===O){u.next=41;break}if(null!==w){u.next=32;break}if(void 0!==b){u.next=10;break}throw new Error("Missing the processor constructor.");case 10:if(null!==d){u.next=12;break}throw new Error("Missing the native OfflineAudioContext constructor.");case 12:if(R=x.channelCount*x.numberOfInputs,N=void 0===b.parameterDescriptors?0:b.parameterDescriptors.length,U=R+N,B=function(){var t=Object(D.a)(L.a.mark((function t(){var e,n,u,c,l,h,f,g,b,_,w,S,O;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=new d(U,128*Math.ceil(x.context.length/128),T.sampleRate),n=[],u=[],c=0;c<y.numberOfInputs;c+=1)n.push(s(e,{channelCount:y.channelCount,channelCountMode:y.channelCountMode,channelInterpretation:y.channelInterpretation,gain:1})),u.push(i(e,{channelCount:y.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:y.channelCount}));return t.next=6,Promise.all(Array.from(x.parameters.values()).map(function(){var t=Object(D.a)(L.a.mark((function t(n){var r;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:n.value}),t.next=3,p(e,n,r.offset,E);case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:for(l=t.sent,h=r(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,R+N)}),f=0;f<y.numberOfInputs;f+=1)for(n[f].connect(u[f]),g=0;g<y.channelCount;g+=1)u[f].connect(h,g,f*y.channelCount+g);b=Object(K.a)(l.entries());try{for(b.s();!(_=b.n()).done;)w=Object(o.a)(_.value,2),S=w[0],(O=w[1]).connect(h,0,R+S),O.start(0)}catch(k){b.e(k)}finally{b.f()}return h.connect(e.destination),t.next=14,Promise.all(n.map((function(t){return v(x,e,t,E)})));case 14:return t.abrupt("return",m(e));case 15:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),u.t0=Mt,u.t1=x,0!==U){u.next=22;break}u.t2=null,u.next=25;break;case 22:return u.next=24,B();case 24:u.t2=u.sent;case 25:u.t3=u.t2,u.t4=T,u.t5=y,u.t6=C,u.t7=b,u.t8=l,w=(0,u.t0)(u.t1,u.t3,u.t4,u.t5,u.t6,u.t7,u.t8);case 32:return u.next=34,w;case 34:for(V=u.sent,z=n(T,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),H=O,q=Object(o.a)(H,3),W=q[0],G=q[1],Y=q[2],null!==V&&(z.buffer=V,z.start(0)),z.connect(W),X=0,Q=0;X<x.numberOfOutputs;X+=1){for(J=G[X],Z=0;Z<C[X];Z+=1)W.connect(J,Q+Z,Z);Q+=C[X]}return u.abrupt("return",Y);case 41:if(k){u.next=61;break}
2$=Object(K.a)(x.parameters.entries()),u.prev=43,$.s();case 45:if((tt=$.n()).done){u.next=51;break}return et=Object(o.a)(tt.value,2),nt=et[0],rt=et[1],u.next=49,p(T,rt,S.parameters.get(nt),E);case 49:u.next=45;break;case 51:u.next=56;break;case 53:u.prev=53,u.t9=u.catch(43),$.e(u.t9);case 56:return u.prev=56,$.f(),u.finish(56);case 59:u.next=78;break;case 61:it=Object(K.a)(x.parameters.entries()),u.prev=62,it.s();case 64:if((ot=it.n()).done){u.next=70;break}return at=Object(o.a)(ot.value,2),st=at[0],ut=at[1],u.next=68,t(T,ut,S.parameters.get(st),E);case 68:u.next=64;break;case 70:u.next=75;break;case 72:u.prev=72,u.t10=u.catch(62),it.e(u.t10);case 75:return u.prev=75,it.f(),u.finish(75);case 78:return u.next=80,v(x,T,S,E);case 80:return u.abrupt("return",S);case 81:case"end":return u.stop()}}),u,null,[[43,53,56,59],[62,72,75,78]])})));return function(t,e,n){return u.apply(this,arguments)}}();return{render:function(t,e,n){u(e,t);var r=_.get(e);return void 0!==r?Promise.resolve(r):x(t,e,n)}}}}(fr,yi,dr,Er,ie,Cr,ue,bi,_i,ri,ft,ai,Xn,pr,Wn,Dr),Oi=function(t){return function(e){return t.get(e)}}(ii),ki=function(t){return function(e,n){t.set(e,n)}}(wi),Ci=ni?function(t,e,n,r,i,o,s,u,c,l,h,f,d,p){return function(e){Object(j.a)(g,e);var m=Object(P.a)(g);function g(e,p,y){var b,_;Object(a.a)(this,g);var w=u(e),x=c(w),T=h(Object(A.a)(Object(A.a)({},Tt),y));d(T);var E=v.get(w),S=null===E||void 0===E?void 0:E.get(p),O=x||"closed"!==w.state?w:null!==(_=s(w))&&void 0!==_?_:w,k=i(O,x?null:e.baseLatency,l,p,S,T),C=x?r(p,T,S):null;b=m.call(this,e,!0,k,C);var M=[];k.parameters.forEach((function(t,e){var r=n(Object(H.a)(b),x,t);M.push([e,r])})),b._nativeAudioWorkletNode=k,b._onprocessorerror=null,b._parameters=new xt(M),x&&t(w,Object(H.a)(b));var I=o(Object(H.a)(b)).activeInputs;return f(k,I),b}return Object(I.a)(g,[{key:"onprocessorerror",get:function(){return this._onprocessorerror},set:function(t){var e="function"===typeof t?p(this,t):null;this._nativeAudioWorkletNode.onprocessorerror=e;var n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=null!==n&&n===e?t:n}},{key:"parameters",get:function(){return null===this._parameters?this._nativeAudioWorkletNode.parameters:this._parameters}},{key:"port",get:function(){return this._nativeAudioWorkletNode.port}}]),g}(e)}(gi,nr,mr,Si,Ei,Q,Oi,Yn,Kn,ai,(function(t){return Object(A.a)(Object(A.a)({},t),{},{outputChannelCount:void 0!==t.outputChannelCount?t.outputChannelCount:1===t.numberOfInputs&&1===t.numberOfOutputs?[t.channelCount]:Array.from({length:t.numberOfOutputs},(function(){return 1}))})}),ki,(function(t){var e=new MessageChannel,n=e.port1,r=e.port2;try{n.postMessage(t)}finally{n.close(),r.close()}}),Nn):void 0,Mi=(function(t,e,n,r,i){}(Bt,wn,kn,zr,Zn),function(t,e){return function(n,r,i){if(null===e)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(n,r,i)}catch(o){if("SyntaxError"===o.name)throw t();throw o}}}(wn,Xn)),Ai=function(t,e,n,r,i,o,a,s){var u=[];return function(c,l){return n(c).render(c,l,u).then((function(){return Promise.all(Array.from(r(l)).map((function(t){return n(t).render(t,l,u)})))})).then((function(){return i(l)})).then((function(n){return"function"!==typeof n.copyFromChannel?(a(n),V(n)):e(o,(function(){return o(n)}))||s(n),t.add(n),n}))}}(ir,Vn,qn,mi,Dr,U,sr,ur),Ii=(function(t,e,n,r,i){}(Vn,Bt,Mi,zr,Ai),function(t,e,n,r,i){return function(t){Object(j.a)(s,t);var o=Object(P.a)(s);function s(t,n,i){var u,c;if(Object(a.a)(this,s),"number"===typeof t&&void 0!==n&&void 0!==i)c={length:n,numberOfChannels:t,sampleRate:i};else{if("object"!==typeof t)throw new Error("The given parameters are not valid.");c=t}var l=Object(A.a)(Object(A.a)({},xn),c),h=l.length,f=l.numberOfChannels,d=l.sampleRate,p=r(f,h,d);return e(Gt,(function(){return Gt(p)}))||p.addEventListener("statechange",function(){var t=0;return function e(n){"running"===u._state&&(t>0?(p.removeEventListener("statechange",e),n.stopImmediatePropagation(),u._waitForThePromiseToSettle(n)):t+=1)}}()),(u=o.call(this,p,f))._length=h,u._nativeOfflineAudioContext=p,u._state=null,u}return Object(I.a)(s,[{key:"length",get:function(){return void 0===this._nativeOfflineAudioContext.length?this._length:this._nativeOfflineAudioContext.length}},{key:"state",get:function(){return null===this._state?this._nativeOfflineAudioContext.state:this._state}},{key:"startRendering",value:function(){var t=this;return"running"===this._state?Promise.reject(n()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally((function(){t._state=null,$(t)})))}},{key:"_waitForThePromiseToSettle",value:function(t){var e=this;null===this._state?this._nativeOfflineAudioContext.dispatchEvent(t):setTimeout((function(){return e._waitForThePromiseToSettle(t)}))}}]),s}(t)}(li,Vn,Bt,Mi,Ai)),ji=function(t,e){return function(n){var r=t.get(n);return e(r)||e(n)}}(f,$n),Pi=(mn=c,gn=tr,function(t){return mn.has(t)||gn(t)}),Ri=(yn=h,bn=er,function(t){return yn.has(t)||bn(t)}),Ni=function(t,e){return function(n){var r=t.get(n);return e(r)||e(n)}}(f,Kn);function Li(t,e){if(!t)throw new Error(e)}function Di(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;
2if(!(e<=t&&t<=n))throw new RangeError("Value must be within [".concat(e,", ").concat(n,"], got: ").concat(t))}function Fi(t){t.isOffline||"running"===t.state||Vi('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}var Ui=console;function Bi(){var t;(t=Ui).log.apply(t,arguments)}function Vi(){var t;(t=Ui).warn.apply(t,arguments)}function zi(t){return"undefined"===typeof t}function Hi(t){return!zi(t)}function qi(t){return"function"===typeof t}function Wi(t){return"number"===typeof t}function Gi(t){return"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object}function Yi(t){return"boolean"===typeof t}function Xi(t){return Array.isArray(t)}function Ki(t){return"string"===typeof t}function Qi(t){return Ki(t)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(t)}function Ji(t){return new vi(t)}function Zi(t,e,n){return new Ii(t,e,n)}var $i="object"===typeof self?self:null,to=$i&&($i.hasOwnProperty("AudioContext")||$i.hasOwnProperty("webkitAudioContext"));var eo=n(6),no=n(5);function ro(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function io(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}Object.create;Object.create;var oo=function(){function t(e,n,r){Object(a.a)(this,t),this._callback=e,this._type=n,this._updateInterval=r,this._createClock()}return Object(I.a)(t,[{key:"_createWorker",value:function(){var t=new Blob(["\n\t\t\t// the initial timeout time\n\t\t\tlet timeoutTime = ".concat((1e3*this._updateInterval).toFixed(1),";\n\t\t\t// onmessage callback\n\t\t\tself.onmessage = function(msg){\n\t\t\t\ttimeoutTime = parseInt(msg.data);\n\t\t\t};\n\t\t\t// the tick function which posts a message\n\t\t\t// and schedules a new tick\n\t\t\tfunction tick(){\n\t\t\t\tsetTimeout(tick, timeoutTime);\n\t\t\t\tself.postMessage('tick');\n\t\t\t}\n\t\t\t// call tick initially\n\t\t\ttick();\n\t\t\t")],{type:"text/javascript"}),e=URL.createObjectURL(t),n=new Worker(e);n.onmessage=this._callback.bind(this),this._worker=n}},{key:"_createTimeout",value:function(){var t=this;this._timeout=setTimeout((function(){t._createTimeout(),t._callback()}),1e3*this._updateInterval)}},{key:"_createClock",value:function(){if("worker"===this._type)try{this._createWorker()}catch(t){this._type="timeout",this._createClock()}else"timeout"===this._type&&this._createTimeout()}},{key:"_disposeClock",value:function(){this._timeout&&(clearTimeout(this._timeout),this._timeout=0),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}},{key:"updateInterval",get:function(){return this._updateInterval},set:function(t){this._updateInterval=Math.max(t,128/44100),"worker"===this._type&&this._worker.postMessage(Math.max(1e3*t,1))}},{key:"type",get:function(){return this._type},set:function(t){this._disposeClock(),this._type=t,this._createClock()}},{key:"dispose",value:function(){this._disposeClock()}}]),t}();function ao(t){return Ri(t)}function so(t){return Pi(t)}function uo(t){return Ni(t)}function co(t){return ji(t)}function lo(t){return t instanceof AudioBuffer}function ho(t,e){return"value"===t||ao(e)||so(e)||lo(e)}function fo(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(!n.length)return t;var i=n.shift();if(Gi(t)&&Gi(i))for(var o in i)ho(o,i[o])?t[o]=i[o]:Gi(i[o])?(t[o]||Object.assign(t,Object(Et.a)({},o,{})),fo(t[o],i[o])):Object.assign(t,Object(Et.a)({},o,i[o]));return fo.apply(void 0,[t].concat(n))}function po(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,i={},o=Array.from(e);if(Gi(o[0])&&r&&!Reflect.has(o[0],r)){var a=Object.keys(o[0]).some((function(e){return Reflect.has(t,e)}));a||(fo(i,Object(Et.a)({},r,o[0])),n.splice(n.indexOf(r),1),o.shift())}if(1===o.length&&Gi(o[0]))fo(i,o[0]);else for(var s=0;s<n.length;s++)Hi(o[s])&&(i[n[s]]=o[s]);return fo(t,i)}function vo(t,e){return zi(t)?e:t}function mo(t,e){return e.forEach((function(e){Reflect.has(t,e)&&delete t[e]})),t}var go=function(){function t(){Object(a.a)(this,t),this.debug=!1,this._wasDisposed=!1}return Object(I.a)(t,[{key:"log",value:function(){if(this.debug||$i&&this.toString()===$i.TONE_DEBUG_CLASS){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Bi.apply(void 0,[this].concat(e))}}},{key:"dispose",value:function(){return this._wasDisposed=!0,this}},{key:"disposed",get:function(){return this._wasDisposed}},{key:"toString",value:function(){return this.name}}],[{key:"getDefaults",value:function(){return{}}}]),t}();go.version=r;var yo=1e-6;function bo(t,e){return t>e+yo}function _o(t,e){return bo(t,e)||xo(t,e)}function wo(t,e){return t+yo<e}function xo(t,e){return Math.abs(t-e)<yo}function To(t,e,n){return Math.max(Math.min(t,n),e)}var Eo=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this)).name="Timeline",t._timeline=[];var r=po(n.getDefaults(),arguments,["memory"]);return t.memory=r.memory,t.increasing=r.increasing,t}return Object(I.a)(n,[{key:"length",get:function(){return this._timeline.length}},{key:"add",value:function(t){if(Li(Reflect.has(t,"time"),"Timeline: events must have a time attribute"),t.time=t.time.valueOf(),this.increasing&&this.length){var e=this._timeline[this.length-1];Li(_o(t.time,e.time),"The time must be greater than or equal to the last scheduled time"),this._timeline.push(t)}else{var n=this._search(t.time);this._timeline.splice(n+1,0,t)}if(this.length>this.memory){var r=this.length-this.memory;this._timeline.splice(0,r)}return this}},{key:"remove",value:function(t){var e=this._timeline.indexOf(t);return-1!==e&&this._timeline.splice(e,1),this}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"time",n=this._search(t,e);return-1!==n?this._timeline[n]:null}},{key:"peek",value:function(){return this._timeline[0]}},{key:"shift",value:function(){return this._timeline.shift()}},{key:"getAfter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"time",n=this._search(t,e);return n+1<this._timeline.length?this._timeline[n+1]:null}},{key:"getBefore",value:function(t){var e=this._timeline.length;if(e>0&&this._timeline[e-1].time<t)return this._timeline[e-1];var n=this._search(t);return n-1>=0?this._timeline[n-1]:null}},{key:"cancel",value:function(t){if(this._timeline.length>1){var e=this._search(t);if(e>=0)if(xo(this._timeline[e].time,t)){for(var n=e;n>=0&&xo(this._timeline[n].time,t);n--)e=n;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else 1===this._timeline.length&&_o(this._timeline[0].time,t)&&(this._timeline=[]);return this}},{key:"cancelBefore",value:function(t){var e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this}},{key:"previousEvent",value:function(t){var e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null}},{key:"_search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"time";if(0===this._timeline.length)return-1;var n=0,r=this._timeline.length,i=r;if(r>0&&this._timeline[r-1][e]<=t)return r-1;for(;n<i;){var o=Math.floor(n+(i-n)/2),a=this._timeline[o],s=this._timeline[o+1];if(xo(a[e],t)){for(var u=o;u<this._timeline.length;u++){var c=this._timeline[u];if(!xo(c[e],t))break;o=u}return o}if(wo(a[e],t)&&bo(s[e],t))return o;bo(a[e],t)?i=o:n=o+1}return-1}},{key:"_iterate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._timeline.length-1;
2this._timeline.slice(e,n+1).forEach(t)}},{key:"forEach",value:function(t){return this._iterate(t),this}},{key:"forEachBefore",value:function(t,e){var n=this._search(t);return-1!==n&&this._iterate(e,0,n),this}},{key:"forEachAfter",value:function(t,e){var n=this._search(t);return this._iterate(e,n+1),this}},{key:"forEachBetween",value:function(t,e,n){var r=this._search(t),i=this._search(e);return-1!==r&&-1!==i?(this._timeline[r].time!==t&&(r+=1),this._timeline[i].time===e&&(i-=1),this._iterate(n,r,i)):-1===r&&this._iterate(n,0,i),this}},{key:"forEachFrom",value:function(t,e){for(var n=this._search(t);n>=0&&this._timeline[n].time>=t;)n--;return this._iterate(e,n+1),this}},{key:"forEachAtTime",value:function(t,e){var n=this._search(t);if(-1!==n&&xo(this._timeline[n].time,t)){for(var r=n,i=n;i>=0&&xo(this._timeline[i].time,t);i--)r=i;this._iterate((function(t){e(t)}),r,n)}return this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._timeline=[],this}}],[{key:"getDefaults",value:function(){return{memory:1/0,increasing:!1}}}]),n}(go),So=[];function Oo(t){So.push(t)}var ko=[];function Co(t){ko.push(t)}function Mo(t){ko.forEach((function(e){return e(t)}))}var Ao=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="Emitter",t}return Object(I.a)(n,[{key:"on",value:function(t,e){var n=this;return t.split(/\W+/).forEach((function(t){zi(n._events)&&(n._events={}),n._events.hasOwnProperty(t)||(n._events[t]=[]),n._events[t].push(e)})),this}},{key:"once",value:function(t,e){var n=this;return this.on(t,(function r(){e.apply(void 0,arguments),n.off(t,r)})),this}},{key:"off",value:function(t,e){var n=this;return t.split(/\W+/).forEach((function(r){if(zi(n._events)&&(n._events={}),n._events.hasOwnProperty(t))if(zi(e))n._events[t]=[];else for(var i=n._events[t],o=i.length-1;o>=0;o--)i[o]===e&&i.splice(o,1)})),this}},{key:"emit",value:function(t){if(this._events&&this._events.hasOwnProperty(t)){for(var e=this._events[t].slice(0),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=e.length;o<a;o++)e[o].apply(this,r)}return this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._events=void 0,this}}],[{key:"mixin",value:function(t){["on","once","off","emit"].forEach((function(e){var r=Object.getOwnPropertyDescriptor(n.prototype,e);Object.defineProperty(t.prototype,e,r)}))}}]),n}(go),Io=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).isOffline=!1,t}return Object(I.a)(n,[{key:"toJSON",value:function(){return{}}}]),n}(Ao),jo=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this)).name="Context",t._constants=new Map,t._timeouts=new Eo,t._timeoutIds=0,t._initialized=!1,t.isOffline=!1,t._workletModules=new Map;var r=po(n.getDefaults(),arguments,["context"]);return r.context?t._context=r.context:t._context=Ji({latencyHint:r.latencyHint}),t._ticker=new oo(t.emit.bind(Object(H.a)(t),"tick"),r.clockSource,r.updateInterval),t.on("tick",t._timeoutLoop.bind(Object(H.a)(t))),t._context.onstatechange=function(){t.emit("statechange",t.state)},t._setLatencyHint(r.latencyHint),t.lookAhead=r.lookAhead,t}return Object(I.a)(n,[{key:"initialize",value:function(){var t;return this._initialized||(t=this,So.forEach((function(e){return e(t)})),this._initialized=!0),this}},{key:"createAnalyser",value:function(){return this._context.createAnalyser()}},{key:"createOscillator",value:function(){return this._context.createOscillator()}},{key:"createBufferSource",value:function(){return this._context.createBufferSource()}},{key:"createBiquadFilter",value:function(){return this._context.createBiquadFilter()}},{key:"createBuffer",value:function(t,e,n){return this._context.createBuffer(t,e,n)}},{key:"createChannelMerger",value:function(t){return this._context.createChannelMerger(t)}},{key:"createChannelSplitter",value:function(t){return this._context.createChannelSplitter(t)}},{key:"createConstantSource",value:function(){return this._context.createConstantSource()}},{key:"createConvolver",value:function(){return this._context.createConvolver()}},{key:"createDelay",value:function(t){return this._context.createDelay(t)}},{key:"createDynamicsCompressor",value:function(){return this._context.createDynamicsCompressor()}},{key:"createGain",value:function(){return this._context.createGain()}},{key:"createIIRFilter",value:function(t,e){return this._context.createIIRFilter(t,e)}},{key:"createPanner",value:function(){return this._context.createPanner()}}
2,{key:"createPeriodicWave",value:function(t,e,n){return this._context.createPeriodicWave(t,e,n)}},{key:"createStereoPanner",value:function(){return this._context.createStereoPanner()}},{key:"createWaveShaper",value:function(){return this._context.createWaveShaper()}},{key:"createMediaStreamSource",value:function(t){return Li(co(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(t)}},{key:"createMediaElementSource",value:function(t){return Li(co(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(t)}},{key:"createMediaStreamDestination",value:function(){return Li(co(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}},{key:"decodeAudioData",value:function(t){return this._context.decodeAudioData(t)}},{key:"currentTime",get:function(){return this._context.currentTime}},{key:"state",get:function(){return this._context.state}},{key:"sampleRate",get:function(){return this._context.sampleRate}},{key:"listener",get:function(){return this.initialize(),this._listener},set:function(t){Li(!this._initialized,"The listener cannot be set after initialization."),this._listener=t}},{key:"transport",get:function(){return this.initialize(),this._transport},set:function(t){Li(!this._initialized,"The transport cannot be set after initialization."),this._transport=t}},{key:"draw",get:function(){return this.initialize(),this._draw},set:function(t){Li(!this._initialized,"Draw cannot be set after initialization."),this._draw=t}},{key:"destination",get:function(){return this.initialize(),this._destination},set:function(t){Li(!this._initialized,"The destination cannot be set after initialization."),this._destination=t}},{key:"createAudioWorkletNode",value:function(t,e){return function(t,e,n){return Li(Hi(Ci),"This node only works in a secure context (https or localhost)"),new Ci(t,e,n)}(this.rawContext,t,e)}},{key:"addAudioWorkletModule",value:function(t,e){return io(this,void 0,void 0,L.a.mark((function n(){return L.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Li(Hi(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletModules.has(e)||this._workletModules.set(e,this.rawContext.audioWorklet.addModule(t)),n.next=4,this._workletModules.get(e);case 4:case"end":return n.stop()}}),n,this)})))}},{key:"workletsAreReady",value:function(){return io(this,void 0,void 0,L.a.mark((function t(){var e;return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=[],this._workletModules.forEach((function(t){return e.push(t)})),t.next=4,Promise.all(e);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"updateInterval",get:function(){return this._ticker.updateInterval},set:function(t){this._ticker.updateInterval=t}},{key:"clockSource",get:function(){return this._ticker.type},set:function(t){this._ticker.type=t}},{key:"latencyHint",get:function(){return this._latencyHint}},{key:"_setLatencyHint",value:function(t){var e=0;if(this._latencyHint=t,Ki(t))switch(t){case"interactive":e=.1;break;case"playback":e=.5;break;case"balanced":e=.25}this.lookAhead=e,this.updateInterval=e/2}},{key:"rawContext",get:function(){return this._context}},{key:"now",value:function(){return this._context.currentTime+this.lookAhead}},{key:"immediate",value:function(){return this._context.currentTime}},{key:"resume",value:function(){return co(this._context)?this._context.resume():Promise.resolve()}},{key:"close",value:function(){return io(this,void 0,void 0,L.a.mark((function t(){return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!co(this._context)){t.next=3;break}return t.next=3,this._context.close();case 3:this._initialized&&Mo(this);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getConstant",value:function(t){if(this._constants.has(t))return this._constants.get(t);for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),r=0;r<n.length;r++)n[r]=t;var i=this._context.createBufferSource();return i.channelCount=1,i.channelCountMode="explicit",i.buffer=e,i.loop=!0,i.start(0),this._constants.set(t,i),i}},{key:"dispose",value:function(){var t=this;
2return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._ticker.dispose(),this._timeouts.dispose(),Object.keys(this._constants).map((function(e){return t._constants[e].disconnect()})),this}},{key:"_timeoutLoop",value:function(){for(var t=this.now(),e=this._timeouts.peek();this._timeouts.length&&e&&e.time<=t;)e.callback(),this._timeouts.shift(),e=this._timeouts.peek()}},{key:"setTimeout",value:function(t,e){this._timeoutIds++;var n=this.now();return this._timeouts.add({callback:t,id:this._timeoutIds,time:n+e}),this._timeoutIds}},{key:"clearTimeout",value:function(t){var e=this;return this._timeouts.forEach((function(n){n.id===t&&e._timeouts.remove(n)})),this}},{key:"clearInterval",value:function(t){return this.clearTimeout(t)}},{key:"setInterval",value:function(t,e){var n=this,r=++this._timeoutIds;return function i(){var o=n.now();n._timeouts.add({callback:function(){t(),i()},id:r,time:o+e})}(),r}}],[{key:"getDefaults",value:function(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}}]),n}(Io),Po=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).lookAhead=0,t.latencyHint=0,t.isOffline=!1,t}return Object(I.a)(n,[{key:"createAnalyser",value:function(){return{}}},{key:"createOscillator",value:function(){return{}}},{key:"createBufferSource",value:function(){return{}}},{key:"createBiquadFilter",value:function(){return{}}},{key:"createBuffer",value:function(t,e,n){return{}}},{key:"createChannelMerger",value:function(t){return{}}},{key:"createChannelSplitter",value:function(t){return{}}},{key:"createConstantSource",value:function(){return{}}},{key:"createConvolver",value:function(){return{}}},{key:"createDelay",value:function(t){return{}}},{key:"createDynamicsCompressor",value:function(){return{}}},{key:"createGain",value:function(){return{}}},{key:"createIIRFilter",value:function(t,e){return{}}},{key:"createPanner",value:function(){return{}}},{key:"createPeriodicWave",value:function(t,e,n){return{}}},{key:"createStereoPanner",value:function(){return{}}},{key:"createWaveShaper",value:function(){return{}}},{key:"createMediaStreamSource",value:function(t){return{}}},{key:"createMediaElementSource",value:function(t){return{}}},{key:"createMediaStreamDestination",value:function(){return{}}},{key:"decodeAudioData",value:function(t){return Promise.resolve({})}},{key:"createAudioWorkletNode",value:function(t,e){return{}}},{key:"rawContext",get:function(){return{}}},{key:"addAudioWorkletModule",value:function(t,e){return io(this,void 0,void 0,L.a.mark((function t(){return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Promise.resolve());case 1:case"end":return t.stop()}}),t)})))}},{key:"resume",value:function(){return Promise.resolve()}},{key:"setTimeout",value:function(t,e){return 0}},{key:"clearTimeout",value:function(t){return this}},{key:"setInterval",value:function(t,e){return 0}},{key:"clearInterval",value:function(t){return this}},{key:"getConstant",value:function(t){return{}}},{key:"currentTime",get:function(){return 0}},{key:"state",get:function(){return{}}},{key:"sampleRate",get:function(){return 0}},{key:"listener",get:function(){return{}}},{key:"transport",get:function(){return{}}},{key:"draw",get:function(){return{}},set:function(t){}},{key:"destination",get:function(){return{}},set:function(t){}},{key:"now",value:function(){return 0}},{key:"immediate",value:function(){return 0}}]),n}(Io);function Ro(t,e){Xi(e)?e.forEach((function(e){return Ro(t,e)})):Object.defineProperty(t,e,{enumerable:!0,writable:!1})}function No(t,e){Xi(e)?e.forEach((function(e){return No(t,e)})):Object.defineProperty(t,e,{writable:!0})}var Lo=function(){},Do=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this)).name="ToneAudioBuffer",t.onload=Lo;var r=po(n.getDefaults(),arguments,["url","onload","onerror"]);return t.reverse=r.reverse,t.onload=r.onload,r.url&&lo(r.url)||r.url instanceof n?t.set(r.url):Ki(r.url)&&t.load(r.url).catch(r.onerror),t}return Object(I.a)(n,[{key:"sampleRate",get:function(){return this._buffer?this._buffer.sampleRate:Vo().sampleRate}},{key:"set",value:function(t){var e=this;return t instanceof n?t.loaded?this._buffer=t.get():t.onload=function(){e.set(t),e.onload(e)}:this._buffer=t,this._reversed&&this._reverse(),this}},{key:"get",value:function(){return this._buffer}},{key:"load",value:function(t){return io(this,void 0,void 0,L.a.mark((function e(){var r,i,o=this;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.load(t).then((function(t){o.set(t),o.onload(o)})),n.downloads.push(r),e.prev=2,e.next=5,r;case 5:return e.prev=5,i=n.downloads.indexOf(r),n.downloads.splice(i,1),e.finish(5);case 9:return e.abrupt("return",this);case 10:case"end":return e.stop()}}),e,this,[[2,,5,9]])})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),this._buffer=void 0,this}},{key:"fromArray",value:function(t){for(var e=Xi(t)&&t[0].length>0,n=e?t.length:1,r=e?t[0].length:t.length,i=Vo(),o=i.createBuffer(n,r,i.sampleRate),a=e||1!==n?t:[t],s=0;s<n;s++)o.copyToChannel(a[s],s);return this._buffer=o,this}},{key:"toMono",value:function(t){if(Wi(t))this.fromArray(this.toArray(t));else{for(var e=new Float32Array(this.length),n=this.numberOfChannels,r=0;r<n;r++)for(var i=this.toArray(r),o=0;o<i.length;o++)e[o]+=i[o];e=e.map((function(t){return t/n})),this.fromArray(e)}return this}},{key:"toArray",value:function(t){if(Wi(t))return this.getChannelData(t);if(1===this.numberOfChannels)return this.toArray(0);for(var e=[],n=0;n<this.numberOfChannels;n++)e[n]=this.getChannelData(n);return e}},{key:"getChannelData",value:function(t){return this._buffer?this._buffer.getChannelData(t):new Float32Array(0)}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.duration,r=Math.floor(t*this.sampleRate),i=Math.floor(e*this.sampleRate);Li(r<i,"The start time must be less than the end time");for(var o=i-r,a=Vo().createBuffer(this.numberOfChannels,o,this.sampleRate),s=0;s<this.numberOfChannels;s++)a.copyToChannel(this.getChannelData(s).subarray(r,i),s);return new n(a)}},{key:"_reverse",value:function(){if(this.loaded)for(var t=0;t<this.numberOfChannels;t++)this.getChannelData(t).reverse();return this}},{key:"loaded",get:function(){return this.length>0}},{key:"duration",get:function(){return this._buffer?this._buffer.duration:0}},{key:"length",get:function(){return this._buffer?this._buffer.length:0}},{key:"numberOfChannels",get:function(){return this._buffer?this._buffer.numberOfChannels:0}},{key:"reverse",get:function(){return this._reversed},set:function(t){this._reversed!==t&&(this._reversed=t,this._reverse())}}],[{key:"getDefaults",value:function(){return{onerror:Lo,onload:Lo,reverse:!1}}},{key:"fromArray",value:function(t){return(new n).fromArray(t)}},{key:"fromUrl",value:function(t){return io(this,void 0,void 0,L.a.mark((function e(){var r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new n,e.next=3,r.load(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))}},{key:"load",value:function(t){return io(this,void 0,void 0,L.a.mark((function e(){var r,i,o,a,s,u,c,l,h,f;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.match(/\[([^\]\[]+\|.+)\]$/))){e.next=23;break}i=r[1].split("|"),o=i[0],a=Object(K.a)(i),e.prev=5,a.s();case 7:if((s=a.n()).done){e.next=14;break}if(u=s.value,!n.supportsType(u)){e.next=12;break}return o=u,e.abrupt("break",14);case 12:e.next=7;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),a.e(e.t0);case 19:return e.prev=19,a.f(),e.finish(19);case 22:t=t.replace(r[0],o);case 23:return c=""===n.baseUrl||n.baseUrl.endsWith("/")?n.baseUrl:n.baseUrl+"/",e.next=26,fetch(c+t);case 26:if((l=e.sent).ok){e.next=29;break}throw new Error("could not load url: ".concat(t));case 29:return e.next=31,l.arrayBuffer();case 31:return h=e.sent,e.next=34,Vo().decodeAudioData(h);case 34:return f=e.sent,e.abrupt("return",f);case 36:case"end":return e.stop()}}),e,null,[[5,16,19,22]])})))}},{key:"supportsType",value:function(t){var e=t.split("."),n=e[e.length-1];return""!==document.createElement("audio").canPlayType("audio/"+n)}},{key:"loaded",value:function(){return io(this,void 0,void 0,L.a.mark((function t(){return L.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.resolve();case 2:if(!n.downloads.length){t.next=7;break}return t.next=5,n.downloads[0];case 5:t.next=2;break;case 7:case"end":return t.stop()}}),t)})))}}]),n}(go);Do.baseUrl="",Do.downloads=[];var Fo=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.call(this,{clockSource:"offline",context:uo(arguments[0])?arguments[0]:Zi(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:uo(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]})).name="OfflineContext",t._currentTime=0,t.isOffline=!0,t._duration=uo(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1],t}return Object(I.a)(n,[{key:"now",value:function(){return this._currentTime}},{key:"currentTime",get:function(){return this._currentTime}},{key:"_renderClock",value:function(t){return io(this,void 0,void 0,L.a.mark((function e(){var n,r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(this._duration-this._currentTime>=0)){e.next=11;break}
2if(this.emit("tick"),this._currentTime+=128/this.sampleRate,n++,r=Math.floor(this.sampleRate/128),!t||n%r!==0){e.next=9;break}return e.next=9,new Promise((function(t){return setTimeout(t,1)}));case 9:e.next=1;break;case 11:case"end":return e.stop()}}),e,this)})))}},{key:"render",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return io(this,void 0,void 0,L.a.mark((function e(){var n;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.workletsAreReady();case 2:return e.next=4,this._renderClock(t);case 4:return e.next=6,this._context.startRendering();case 6:return n=e.sent,e.abrupt("return",new Do(n));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){return Promise.resolve()}}]),n}(jo),Uo=new Po,Bo=Uo;function Vo(){return Bo===Uo&&to&&zo(new jo),Bo}function zo(t){Bo=co(t)?new jo(t):uo(t)?new Fo(t):t}function Ho(){return Bo.resume()}if($i&&!$i.TONE_SILENCE_LOGGING){var qo="v";0;var Wo=" * Tone.js ".concat(qo).concat(r," * ");console.log("%c".concat(Wo),"background: #000; color: #fff")}function Go(t){return Math.pow(10,t/20)}function Yo(t){return Math.log(t)/Math.LN10*20}function Xo(t){return Math.pow(2,t/12)}var Ko=440;function Qo(t){return Math.round(Jo(t))}function Jo(t){return 69+12*Math.log2(t/Ko)}function Zo(t){return Ko*Math.pow(2,(t-69)/12)}var $o=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="TimeClass",t}return Object(I.a)(n,[{key:"_getExpressions",value:function(){var t=this;return Object.assign(Object(eo.a)(Object(no.a)(n.prototype),"_getExpressions",this).call(this),{now:{method:function(e){return t._now()+new t.constructor(t.context,e).valueOf()},regexp:/^\+(.+)/},quantize:{method:function(e){var r=new n(t.context,e).valueOf();return t._secondsToUnits(t.context.transport.nextSubdivision(r))},regexp:/^@(.+)/}})}},{key:"quantize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=new this.constructor(this.context,t).valueOf(),r=this.valueOf(),i=Math.round(r/n),o=i*n,a=o-r;return r+a*e}},{key:"toNotation",value:function(){for(var t=this,e=this.toSeconds(),r=["1m"],i=1;i<9;i++){var o=Math.pow(2,i);r.push(o+"n."),r.push(o+"n"),r.push(o+"t")}r.push("0");var a=r[0],s=new n(this.context,r[0]).toSeconds();return r.forEach((function(r){var i=new n(t.context,r).toSeconds();Math.abs(i-e)<Math.abs(s-e)&&(a=r,s=i)})),a}},{key:"toBarsBeatsSixteenths",value:function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;e=parseFloat(e.toFixed(4));var n=Math.floor(e/this._getTimeSignature()),r=e%1*4;e=Math.floor(e)%this._getTimeSignature();var i=r.toString();return i.length>3&&(r=parseFloat(parseFloat(i).toFixed(3))),[n,e,r].join(":")}},{key:"toTicks",value:function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.round(e*this._getPPQ())}},{key:"toSeconds",value:function(){return this.valueOf()}},{key:"toMidi",value:function(){return Qo(this.toFrequency())}},{key:"_now",value:function(){return this.context.now()}}]),n}(function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(t,r,i){var o;return Object(a.a)(this,n),(o=e.call(this)).defaultUnits="s",o._val=r,o._units=i,o.context=t,o._expressions=o._getExpressions(),o}return Object(I.a)(n,[{key:"_getExpressions",value:function(){var t=this;return{hz:{method:function(e){return t._frequencyToUnits(parseFloat(e))},regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:function(e){return t._ticksToUnits(parseInt(e,10))},regexp:/^(\d+)i$/i},m:{method:function(e){return t._beatsToUnits(parseInt(e,10)*t._getTimeSignature())},regexp:/^(\d+)m$/i},n:{method:function(e,n){var r=parseInt(e,10),i="."===n?1.5:1;return 1===r?t._beatsToUnits(t._getTimeSignature())*i:t._beatsToUnits(4/r)*i},regexp:/^(\d+)n(\.?)$/i},number:{method:function(e){return t._expressions[t.defaultUnits].method.call(t,e)},regexp:/^(\d+(?:\.\d+)?)$/},s:{method:function(e){return t._secondsToUnits(parseFloat(e))},regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:function(e){return parseInt(e,10)/t.context.sampleRate},regexp:/^(\d+)samples$/},t:{method:function(e){var n=parseInt(e,10);return t._beatsToUnits(8/(3*Math.floor(n)))},regexp:/^(\d+)t$/i},tr:{method:function(e,n,r){var i=0;return e&&"0"!==e&&(i+=t._beatsToUnits(t._getTimeSignature()*parseFloat(e))),n&&"0"!==n&&(i+=t._beatsToUnits(parseFloat(n))),r&&"0"!==r&&(i+=t._beatsToUnits(parseFloat(r)/4)),i},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}},{key:"valueOf",value:function(){if(this._val instanceof n&&this.fromType(this._val),zi(this._val))return this._noArg();if(Ki(this._val)&&zi(this._units)){for(var t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(Gi(this._val)){var e=0;for(var r in this._val)if(Hi(this._val[r])){var i=this._val[r];e+=new this.constructor(this.context,r).valueOf()*i}return e}if(Hi(this._units)){var o=this._expressions[this._units],a=this._val.toString().trim().match(o.regexp);return a?o.method.apply(this,a.slice(1)):o.method.call(this,this._val)}return Ki(this._val)?parseFloat(this._val):this._val}},{key:"_frequencyToUnits",value:function(t){return 1/t}},{key:"_beatsToUnits",value:function(t){return 60/this._getBpm()*t}},{key:"_secondsToUnits",value:function(t){return t}},{key:"_ticksToUnits",value:function(t){return t*this._beatsToUnits(1)/this._getPPQ()}},{key:"_noArg",value:function(){return this._now()}},{key:"_getBpm",value:function(){return this.context.transport.bpm.value}},{key:"_getTimeSignature",value:function(){return this.context.transport.timeSignature}},{key:"_getPPQ",value:function(){return this.context.transport.PPQ}},{key:"fromType",value:function(t){switch(this._units=void 0,this.defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi()}return this}},{key:"toFrequency",value:function(){return 1/this.toSeconds()}},{key:"toSamples",value:function(){return this.toSeconds()*this.context.sampleRate}},{key:"toMilliseconds",value:function(){return 1e3*this.toSeconds()}}]),n}(go));var ta=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="Frequency",t.defaultUnits="hz",t}return Object(I.a)(n,[{key:"_getExpressions",value:function(){return Object.assign({},Object(eo.a)(Object(no.a)(n.prototype),"_getExpressions",this).call(this),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method:function(t){return"midi"===this.defaultUnits?t
2:n.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(t,e){var r=ea[t.toLowerCase()]+12*(parseInt(e,10)+1);return"midi"===this.defaultUnits?r:n.mtof(r)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(t,e,n){var r=1;return t&&"0"!==t&&(r*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(r*=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(r*=this._beatsToUnits(parseFloat(n)/4)),r}}})}},{key:"transpose",value:function(t){return new n(this.context,this.valueOf()*Xo(t))}},{key:"harmonize",value:function(t){var e=this;return t.map((function(t){return e.transpose(t)}))}},{key:"toMidi",value:function(){return Qo(this.valueOf())}},{key:"toNote",value:function(){var t=this.toFrequency(),e=Math.log2(t/n.A4),r=Math.round(12*e)+57,i=Math.floor(r/12);return i<0&&(r+=-12*i),na[r%12]+i.toString()}},{key:"toSeconds",value:function(){return 1/Object(eo.a)(Object(no.a)(n.prototype),"toSeconds",this).call(this)}},{key:"toTicks",value:function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*this._getPPQ())}},{key:"_noArg",value:function(){return 0}},{key:"_frequencyToUnits",value:function(t){return t}},{key:"_ticksToUnits",value:function(t){return 1/(60*t/(this._getBpm()*this._getPPQ()))}},{key:"_beatsToUnits",value:function(t){return 1/Object(eo.a)(Object(no.a)(n.prototype),"_beatsToUnits",this).call(this,t)}},{key:"_secondsToUnits",value:function(t){return 1/t}}],[{key:"A4",get:function(){return Ko},set:function(t){!function(t){Ko=t}(t)}},{key:"mtof",value:function(t){return Zo(t)}},{key:"ftom",value:function(t){return Qo(t)}}]),n}($o),ea={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},na=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];var ra=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="TransportTime",t}return Object(I.a)(n,[{key:"_now",value:function(){return this.context.transport.seconds}}]),n}($o);var ia=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),t=e.call(this);var r=po(n.getDefaults(),arguments,["context"]);return t.defaultContext?t.context=t.defaultContext:t.context=r.context,t}return Object(I.a)(n,[{key:"now",value:function(){return this.context.currentTime+this.context.lookAhead}},{key:"immediate",value:function(){return this.context.currentTime}},{key:"sampleTime",get:function(){return 1/this.context.sampleRate}},{key:"blockTime",get:function(){return 128/this.context.sampleRate}},{key:"toSeconds",value:function(t){return new $o(this.context,t).toSeconds()}},{key:"toFrequency",value:function(t){return new ta(this.context,t).toFrequency()}},{key:"toTicks",value:function(t){return new ra(this.context,t).toTicks()}},{key:"_getPartialProperties",value:function(t){var e=this.get();return Object.keys(e).forEach((function(n){zi(t[n])&&delete e[n]})),e}},{key:"get",value:function(){var t=this,e=this.constructor.getDefaults();return Object.keys(e).forEach((function(r){if(Reflect.has(t,r)){var i=t[r];Hi(i)&&Hi(i.value)&&Hi(i.setValueAtTime)?e[r]=i.value:i instanceof n?e[r]=i._getPartialProperties(e[r]):Xi(i)||Wi(i)||Ki(i)||Yi(i)?e[r]=i:delete e[r]}})),e}},{key:"set",value:function(t){var e=this;return Object.keys(t).forEach((function(r){Reflect.has(e,r)&&Hi(e[r])&&(e[r]&&Hi(e[r].value)&&Hi(e[r].setValueAtTime)?e[r].value!==t[r]&&(e[r].value=t[r]):e[r]instanceof n?e[r].set(t[r]):e[r]=t[r])})),this}}],[{key:"getDefaults",value:function(){return{context:Vo()}}}]),n}(go),oa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"stopped";return Object(a.a)(this,n),(t=e.call(this)).name="StateTimeline",t._initial=r,t.setStateAtTime(t._initial,0),t}return Object(I.a)(n,[{key:"getValueAtTime",value:function(t){var e=this.get(t);return null!==e?e.state:this._initial}},{key:"setStateAtTime",value:function(t,e,n){return Di(e,0),this.add(Object.assign({},n,{state:t,time:e})),this}},{key:"getLastState",value:function(t,e){for(var n=this._search(e);n>=0;n--){var r=this._timeline[n];if(r.state===t)return r}}},{key:"getNextState",value:function(t,e){var n=this._search(e);if(-1!==n)for(var r=n;r<this._timeline.length;r++){var i=this._timeline[r];if(i.state===t)return i}}}]),n}(Eo),aa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["param","units","convert"]))).name="Param",t.overridden=!1,t._minOutput=1e-7;var r=po(n.getDefaults(),arguments,["param","units","convert"]);for(Li(Hi(r.param)&&(ao(r.param)||r.param instanceof n),"param must be an AudioParam");!ao(r.param);)r.param=r.param._param;return t._swappable=!!Hi(r.swappable)&&r.swappable,t._swappable?(t.input=t.context.createGain(),t._param=r.param,t.input.connect(t._param)):t._param=t.input=r.param,t._events=new Eo(1e3),t._initialValue=t._param.defaultValue,t.units=r.units,t.convert=r.convert,t._minValue=r.minValue,t._maxValue=r.maxValue,Hi(r.value)&&r.value!==t._toType(t._initialValue)&&t.setValueAtTime(r.value,0),t}return Object(I.a)(n,[{key:"value",get:function(){var t=this.now();return this.getValueAtTime(t)},set:function(t){this.cancelScheduledValues(this.now()),this.setValueAtTime(t,this.now())}},{key:"minValue",get:function(){return Hi(this._minValue)?this._minValue:"time"===this.units||"frequency"===this.units||"normalRange"===this.units||"positive"===this.units||"transportTime"===this.units||"ticks"===this.units||"bpm"===this.units||"hertz"
2===this.units||"samples"===this.units?0:"audioRange"===this.units?-1:"decibels"===this.units?-1/0:this._param.minValue}},{key:"maxValue",get:function(){return Hi(this._maxValue)?this._maxValue:"normalRange"===this.units||"audioRange"===this.units?1:this._param.maxValue}},{key:"_is",value:function(t,e){return this.units===e}},{key:"_assertRange",value:function(t){return Hi(this.maxValue)&&Hi(this.minValue)&&Di(t,this._fromType(this.minValue),this._fromType(this.maxValue)),t}},{key:"_fromType",value:function(t){return this.convert&&!this.overridden?this._is(t,"time")?this.toSeconds(t):this._is(t,"decibels")?Go(t):this._is(t,"frequency")?this.toFrequency(t):t:this.overridden?0:t}},{key:"_toType",value:function(t){return this.convert&&"decibels"===this.units?Yo(t):t}},{key:"setValueAtTime",value:function(t,e){var n=this.toSeconds(e),r=this._fromType(t);return Li(isFinite(r)&&isFinite(n),"Invalid argument(s) to setValueAtTime: ".concat(JSON.stringify(t),", ").concat(JSON.stringify(e))),this._assertRange(r),this.log(this.units,"setValueAtTime",t,n),this._events.add({time:n,type:"setValueAtTime",value:r}),this._param.setValueAtTime(r,n),this}},{key:"getValueAtTime",value:function(t){var e=Math.max(this.toSeconds(t),0),n=this._events.getAfter(e),r=this._events.get(e),i=this._initialValue;if(null===r)i=this._initialValue;else if("setTargetAtTime"!==r.type||null!==n&&"setValueAtTime"!==n.type)if(null===n)i=r.value;else if("linearRampToValueAtTime"===n.type||"exponentialRampToValueAtTime"===n.type){var o=r.value;if("setTargetAtTime"===r.type){var a=this._events.getBefore(r.time);o=null===a?this._initialValue:a.value}i="linearRampToValueAtTime"===n.type?this._linearInterpolate(r.time,o,n.time,n.value,e):this._exponentialInterpolate(r.time,o,n.time,n.value,e)}else i=r.value;else{var s,u=this._events.getBefore(r.time);s=null===u?this._initialValue:u.value,"setTargetAtTime"===r.type&&(i=this._exponentialApproach(r.time,s,r.value,r.constant,e))}return this._toType(i)}},{key:"setRampPoint",value:function(t){t=this.toSeconds(t);var e=this.getValueAtTime(t);return this.cancelAndHoldAtTime(t),0===this._fromType(e)&&(e=this._toType(this._minOutput)),this.setValueAtTime(e,t),this}},{key:"linearRampToValueAtTime",value:function(t,e){var n=this._fromType(t),r=this.toSeconds(e);return Li(isFinite(n)&&isFinite(r),"Invalid argument(s) to linearRampToValueAtTime: ".concat(JSON.stringify(t),", ").concat(JSON.stringify(e))),this._assertRange(n),this._events.add({time:r,type:"linearRampToValueAtTime",value:n}),this.log(this.units,"linearRampToValueAtTime",t,r),this._param.linearRampToValueAtTime(n,r),this}},{key:"exponentialRampToValueAtTime",value:function(t,e){var n=this._fromType(t);n=xo(n,0)?this._minOutput:n,this._assertRange(n);var r=this.toSeconds(e);return Li(isFinite(n)&&isFinite(r),"Invalid argument(s) to exponentialRampToValueAtTime: ".concat(JSON.stringify(t),", ").concat(JSON.stringify(e))),this._events.add({time:r,type:"exponentialRampToValueAtTime",value:n}),this.log(this.units,"exponentialRampToValueAtTime",t,r),this._param.exponentialRampToValueAtTime(n,r),this}},{key:"exponentialRampTo",value:function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialRampToValueAtTime(t,n+this.toSeconds(e)),this}},{key:"linearRampTo",value:function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.linearRampToValueAtTime(t,n+this.toSeconds(e)),this}},{key:"targetRampTo",value:function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialApproachValueAtTime(t,n,e),this}},{key:"exponentialApproachValueAtTime",value:function(t,e,n){e=this.toSeconds(e),n=this.toSeconds(n);var r=Math.log(n+1)/Math.log(200);return this.setTargetAtTime(t,e,r),this.cancelAndHoldAtTime(e+.9*n),this.linearRampToValueAtTime(t,e+n),this}},{key:"setTargetAtTime",value:function(t,e,n){var r=this._fromType(t);Li(isFinite(n)&&n>0,"timeConstant must be a number greater than 0");var i=this.toSeconds(e);return this._assertRange(r),Li(isFinite(r)&&isFinite(i),"Invalid argument(s) to setTargetAtTime: ".concat(JSON.stringify(t),", ").concat(JSON.stringify(e))),this._events.add({constant:n,time:i,type:"setTargetAtTime",value:r}),this.log(this.units,"setTargetAtTime",t,i,n),this._param.setTargetAtTime(r,i,n),this}},{key:"setValueCurveAtTime",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;n=this.toSeconds(n),e=this.toSeconds(e);var i=this._fromType(t[0])*r;this.setValueAtTime(this._toType(i),e);for(var o=n/(t.length-1),a=1;a<t.length;a++){var s=this._fromType(t[a])*r;this.linearRampToValueAtTime(this._toType(s),e+a*o)}return this}},{key:"cancelScheduledValues",value:function(t){var e=this.toSeconds(t);return Li(isFinite(e),"Invalid argument to cancelScheduledValues: ".concat(JSON.stringify(t))),this._events.cancel(e),this._param.cancelScheduledValues(e),this.log(this.units,"cancelScheduledValues",e),this}},{key:"cancelAndHoldAtTime",value:function(t){var e=this.toSeconds(t),n=this._fromType(this.getValueAtTime(e));Li(isFinite(e),"Invalid argument to cancelAndHoldAtTime: ".concat(JSON.stringify(t))),this.log(this.units,"cancelAndHoldAtTime",e,"value="+n);var r=this._events.get(e),i=this._events.getAfter(e);return r&&xo(r.time,e)?i?(this._param.cancelScheduledValues(i.time),this._events.cancel(i.time)):(this._param.cancelAndHoldAtTime(e),this._events.cancel(e+this.sampleTime)):i&&(this._param.cancelScheduledValues(i.time),this._events.cancel(i.time),"linearRampToValueAtTime"===i.type?this.linearRampToValueAtTime(this._toType(n),e):"exponentialRampToValueAtTime"===i.type&&this.exponentialRampToValueAtTime(this._toType(n),e)),this._events.add({time:e,type:"setValueAtTime",value:n}),this._param.setValueAtTime(n,e),this}},{key:"rampTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.1,n=arguments.length>2?arguments[2]:void 0;return"frequency"===this.units||"bpm"===this.units||"decibels"===this.units?this.exponentialRampTo(t,e,n):this.linearRampTo(t,e,n),this}},{key:"apply",value:function(t){var e=this.context.currentTime;t.setValueAtTime(this.getValueAtTime(e),e);var n=this._events.get(e);if(n&&"setTargetAtTime"===n.type)for(var r=this._events.getAfter(n.time),i=r?r.time:e+2,o=(i-e)/10,a=e;a<i;a+=o)t.linearRampToValueAtTime(this.getValueAtTime(a),a);
2return this._events.forEachAfter(this.context.currentTime,(function(e){"cancelScheduledValues"===e.type?t.cancelScheduledValues(e.time):"setTargetAtTime"===e.type?t.setTargetAtTime(e.value,e.time,e.constant):t[e.type](e.value,e.time)})),this}},{key:"setParam",value:function(t){Li(this._swappable,"The Param must be assigned as 'swappable' in the constructor");var e=this.input;return e.disconnect(this._param),this.apply(t),this._param=t,e.connect(this._param),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._events.dispose(),this}},{key:"defaultValue",get:function(){return this._toType(this._param.defaultValue)}},{key:"_exponentialApproach",value:function(t,e,n,r,i){return n+(e-n)*Math.exp(-(i-t)/r)}},{key:"_linearInterpolate",value:function(t,e,n,r,i){return e+(i-t)/(n-t)*(r-e)}},{key:"_exponentialInterpolate",value:function(t,e,n,r,i){return e*Math.pow(r/e,(i-t)/(n-t))}}],[{key:"getDefaults",value:function(){return Object.assign(ia.getDefaults(),{convert:!0,units:"number"})}}]),n}(ia),sa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="ToneAudioNode",t._internalChannels=[],t}return Object(I.a)(n,[{key:"numberOfInputs",get:function(){return Hi(this.input)?ao(this.input)||this.input instanceof aa?1:this.input.numberOfInputs:0}},{key:"numberOfOutputs",get:function(){return Hi(this.output)?this.output.numberOfOutputs:0}},{key:"_isAudioNode",value:function(t){return Hi(t)&&(t instanceof n||so(t))}},{key:"_getInternalNodes",value:function(){var t=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&t.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&t.push(this.output),t}},{key:"_setChannelProperties",value:function(t){this._getInternalNodes().forEach((function(e){e.channelCount=t.channelCount,e.channelCountMode=t.channelCountMode,e.channelInterpretation=t.channelInterpretation}))}},{key:"_getChannelProperties",value:function(){var t=this._getInternalNodes();Li(t.length>0,"ToneAudioNode does not have any internal nodes");var e=t[0];return{channelCount:e.channelCount,channelCountMode:e.channelCountMode,channelInterpretation:e.channelInterpretation}}},{key:"channelCount",get:function(){return this._getChannelProperties().channelCount},set:function(t){var e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCount:t}))}},{key:"channelCountMode",get:function(){return this._getChannelProperties().channelCountMode},set:function(t){var e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCountMode:t}))}},{key:"channelInterpretation",get:function(){return this._getChannelProperties().channelInterpretation},set:function(t){var e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelInterpretation:t}))}},{key:"connect",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ca(this,t,e,n),this}},{key:"toDestination",value:function(){return this.connect(this.context.destination),this}},{key:"toMaster",value:function(){return Vi("toMaster() has been renamed toDestination()"),this.toDestination()}},{key:"disconnect",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return la(this,t,e,n),this}},{key:"chain",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ua.apply(void 0,[this].concat(e)),this}},{key:"fan",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){return t.connect(e)})),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),Hi(this.input)&&(this.input instanceof n?this.input.dispose():so(this.input)&&this.input.disconnect()),Hi(this.output)&&(this.output instanceof n?this.output.dispose():so(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}]),n}(ia);function ua(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.shift();e.reduce((function(t,e){return t instanceof sa?t.connect(e):so(t)&&ca(t,e),e}),r)}function ca(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;for(Li(Hi(t),"Cannot connect from undefined node"),Li(Hi(e),"Cannot connect to undefined node"),(e instanceof sa||so(e))&&Li(e.numberOfInputs>
20,"Cannot connect to node with no inputs"),Li(t.numberOfOutputs>0,"Cannot connect from node with no outputs");e instanceof sa||e instanceof aa;)Hi(e.input)&&(e=e.input);for(;t instanceof sa;)Hi(t.output)&&(t=t.output);ao(e)?t.connect(e,n):t.connect(e,n,r)}function la(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(Hi(e))for(;e instanceof sa;)e=e.input;for(;!so(t);)Hi(t.output)&&(t=t.output);ao(e)?t.disconnect(e,n):so(e)?t.disconnect(e,n,r):t.disconnect()}var ha=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["gain","units"]))).name="Gain",t._gainNode=t.context.createGain(),t.input=t._gainNode,t.output=t._gainNode;var r=po(n.getDefaults(),arguments,["gain","units"]);return t.gain=new aa({context:t.context,convert:r.convert,param:t._gainNode.gain,units:r.units,value:r.gain,minValue:r.minValue,maxValue:r.maxValue}),Ro(Object(H.a)(t),"gain"),t}return Object(I.a)(n,[{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._gainNode.disconnect(),this.gain.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{convert:!0,gain:1,units:"gain"})}}]),n}(sa),fa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(t){var r;return Object(a.a)(this,n),(r=e.call(this,t)).onended=Lo,r._startTime=-1,r._stopTime=-1,r._timeout=-1,r.output=new ha({context:r.context,gain:0}),r._gainNode=r.output,r.getStateAtTime=function(t){var e=this.toSeconds(t);return-1!==this._startTime&&e>=this._startTime&&(-1===this._stopTime||e<=this._stopTime)?"started":"stopped"},r._fadeIn=t.fadeIn,r._fadeOut=t.fadeOut,r._curve=t.curve,r.onended=t.onended,r}return Object(I.a)(n,[{key:"_startGain",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;Li(-1===this._startTime,"Source cannot be started more than once");var n=this.toSeconds(this._fadeIn);return this._startTime=t+n,this._startTime=Math.max(this._startTime,this.context.currentTime),n>0?(this._gainNode.gain.setValueAtTime(0,t),"linear"===this._curve?this._gainNode.gain.linearRampToValueAtTime(e,t+n):this._gainNode.gain.exponentialApproachValueAtTime(e,t,n)):this._gainNode.gain.setValueAtTime(e,t),this}},{key:"stop",value:function(t){return this.log("stop",t),this._stopGain(this.toSeconds(t)),this}},{key:"_stopGain",value:function(t){var e=this;Li(-1!==this._startTime,"'start' must be called before 'stop'"),this.cancelStop();var n=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(t)+n,this._stopTime=Math.max(this._stopTime,this.context.currentTime),n>0?"linear"===this._curve?this._gainNode.gain.linearRampTo(0,n,t):this._gainNode.gain.targetRampTo(0,n,t):(this._gainNode.gain.cancelAndHoldAtTime(t),this._gainNode.gain.setValueAtTime(0,t)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout((function(){var t="exponential"===e._curve?2*n:0;e._stopSource(e.now()+t),e._onended()}),this._stopTime-this.context.currentTime),this}},{key:"_onended",value:function(){var t=this;if(this.onended!==Lo&&(this.onended(this),this.onended=Lo,!this.context.isOffline)){var e=function(){return t.dispose()};"undefined"!==typeof window.requestIdleCallback?window.requestIdleCallback(e):setTimeout(e,1e3)}}},{key:"state",get:function(){return this.getStateAtTime(this.now())}},{key:"cancelStop",value:function(){return this.log("cancelStop"),Li(-1!==this._startTime,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._gainNode.disconnect(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:Lo})}}]),n}(sa),da=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["offset"]))).name="ToneConstantSource",t._source=t.context.createConstantSource();var r=po(n.getDefaults(),arguments,["offset"]);return ca(t._source,t._gainNode),t.offset=new aa({context:t.context,convert:r.convert,param:t._source.offset,units:r.units,value:r.offset,minValue:r.minValue,maxValue:r.maxValue}),t}return Object(I.a)(n,[{key:"start",value:function(t){var e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._source.start(e),this}},{key:"_stopSource",value:function(t){this._source.stop(t)}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),"started"===this.state&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(fa.getDefaults(),{convert:!0,offset:1,units:"number"})}}]),n}(fa),pa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["value","units"]))).name="Signal",t.override=!0;var r=po(n.getDefaults(),arguments,["value","units"]);return t.output=t._constantSource=new da({context:t.context,convert:r.convert,offset:r.value,units:r.units,minValue:r.minValue,maxValue:r.maxValue}),t._constantSource.start(0),t.input=t._param=t._constantSource.offset,t}return Object(I.a)(n,[{key:"connect",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return va(this,t,e,n),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._param.dispose(),this._constantSource.dispose(),this}},{key:"setValueAtTime",value:function(t,e){return this._param.setValueAtTime(t,e),this}},{key:"getValueAtTime",value:function(t){return this._param.getValueAtTime(t)}},{key:"setRampPoint",value:function(t){return this._param.setRampPoint(t),this}},{key:"linearRampToValueAtTime",value:function(t,e){return this._param.linearRampToValueAtTime(t,e),this}},{key:"exponentialRampToValueAtTime",value:function(t,e){return this._param.exponentialRampToValueAtTime(t,e),this}},{key:"exponentialRampTo",value:function(t,e,n){return this._param.exponentialRampTo(t,e,n),this}},{key:"linearRampTo",value:function(t,e,n){return this._param.linearRampTo(t,e,n),this}},{key:"targetRampTo",value:function(t,e,n){return this._param.targetRampTo(t,e,n),this}},{key:"exponentialApproachValueAtTime",value:function(t,e,n){return this._param.exponentialApproachValueAtTime(t,e,n),this}},{key:"setTargetAtTime",value:function(t,e,n){return this._param.setTargetAtTime(t,e,n),this}},{key:"setValueCurveAtTime",value:function(t,e,n,r){return this._param.setValueCurveAtTime(t,e,n,r),this}},{key:"cancelScheduledValues",value:function(t){return this._param.cancelScheduledValues(t),this}},{key:"cancelAndHoldAtTime",value:function(t){return this._param.cancelAndHoldAtTime(t),this}},{key:"rampTo",value:function(t,e,n){return this._param.rampTo(t,e,n),this}},{key:"value",get:function(){return this._param.value},set:function(t){this._param.value=t}},{key:"convert",get:function(){return this._param.convert},set:function(t){this._param.convert=t}},{key:"units",get:function(){return this._param.units}},{key:"overridden",get:function(){return this._param.overridden},set:function(t){this._param.overridden=t}},{key:"maxValue",get:function(){return this._param.maxValue}},{key:"minValue",get:function(){return this._param.minValue}},{key:"apply",value:function(t){return this._param.apply(t),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{convert:!0,units:"number",value:0})}}]),n}(sa);function va(t,e,n,r){(e instanceof aa||ao(e)||e instanceof pa&&e.override)&&(e.cancelScheduledValues(0),e.setValueAtTime(0,0),e instanceof pa&&(e.overridden=!0)),ca(t,e,n,r)}var ma=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["value"]))).name="TickParam",t._events=new Eo(1/0),t._multiplier=1;var r=po(n.getDefaults(),arguments,["value"]);return t._multiplier=r.multiplier,t._events.cancel(0),t._events.add({ticks:0,time:0,type:"setValueAtTime",value:t._fromType(r.value)}),t.setValueAtTime(r.value,0),t}return Object(I.a)(n,[{key:"setTargetAtTime",value:function(t,e,n){e=this.toSeconds(e),this.setRampPoint(e);for(var r=this._fromType(t),i=this._events.get(e),o=Math.round(Math.max(1/n,1)),a=0;a<=o;a++){var s=n*a+e,u=this._exponentialApproach(i.time,i.value,r,n,s);this.linearRampToValueAtTime(this._toType(u),s)}return this}},{key:"setValueAtTime",value:function(t,e){var r=this.toSeconds(e);Object(eo.a)(Object(no.a)(n.prototype),"setValueAtTime",this).call(this,t,e);var i=this._events.get(r),o=this._events.previousEvent(i),a=this._getTicksUntilEvent(o,r);return i.ticks=Math.max(a,0),this}},{key:"linearRampToValueAtTime",value:function(t,e){var r=this.toSeconds(e);Object(eo.a)(Object(no.a)(n.prototype),"linearRampToValueAtTime",this).call(this,t,e);var i=this._events.get(r),o=this._events.previousEvent(i),a=this._getTicksUntilEvent(o,r);return i.ticks=Math.max(a,0),this}},{key:"exponentialRampToValueAtTime",value:function(t,e){e=this.toSeconds(e);for(var n=this._fromType(t),r=this._events.get(e),i=Math.round(Math.max(10*(e-r.time),1)),o=(e-r.time)/i,a=0;a<=i;a++){var s=o*a+r.time,u=this._exponentialInterpolate(r.time,r.value,e,n,s);this.linearRampToValueAtTime(this._toType(u),s)}return this}},{key:"_getTicksUntilEvent",value:function(t,e){if(null===t)t={ticks:0,time:0,type:"setValueAtTime",value:0};else if(zi(t.ticks)){var n=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(n,t.time)}var r=this._fromType(this.getValueAtTime(t.time)),i=this._fromType(this.getValueAtTime(e)),o=this._events.get(e);return o&&o.time===e&&"setValueAtTime"===o.type&&(i=this._fromType(this.getValueAtTime(e-this.sampleTime))),.5*(e-t.time)*(r+i)+t.ticks}},{key:"getTicksAtTime",value:function(t){var e=this.toSeconds(t),n=this._events.get(e);return Math.max(this._getTicksUntilEvent(n,e),0)}},{key:"getDurationOfTicks",value:function(t,e){var n=this.toSeconds(e),r=this.getTicksAtTime(e);return this.getTimeOfTick(r+t)-n}},{key:"getTimeOfTick",value:function(t){var e=this._events.get(t,"ticks"),n=this._events.getAfter(t,"ticks");
2if(e&&e.ticks===t)return e.time;if(e&&n&&"linearRampToValueAtTime"===n.type&&e.value!==n.value){var r=this._fromType(this.getValueAtTime(e.time)),i=(this._fromType(this.getValueAtTime(n.time))-r)/(n.time-e.time),o=Math.sqrt(Math.pow(r,2)-2*i*(e.ticks-t)),a=(-r+o)/i;return(a>0?a:(-r-o)/i)+e.time}return e?0===e.value?1/0:e.time+(t-e.ticks)/e.value:t/this._initialValue}},{key:"ticksToTime",value:function(t,e){return this.getDurationOfTicks(t,e)}},{key:"timeToTicks",value:function(t,e){var n=this.toSeconds(e),r=this.toSeconds(t),i=this.getTicksAtTime(n);return this.getTicksAtTime(n+r)-i}},{key:"_fromType",value:function(t){return"bpm"===this.units&&this.multiplier?1/(60/t/this.multiplier):Object(eo.a)(Object(no.a)(n.prototype),"_fromType",this).call(this,t)}},{key:"_toType",value:function(t){return"bpm"===this.units&&this.multiplier?t/this.multiplier*60:Object(eo.a)(Object(no.a)(n.prototype),"_toType",this).call(this,t)}},{key:"multiplier",get:function(){return this._multiplier},set:function(t){var e=this.value;this._multiplier=t,this.cancelScheduledValues(0),this.setValueAtTime(e,0)}}],[{key:"getDefaults",value:function(){return Object.assign(aa.getDefaults(),{multiplier:1,units:"hertz",value:1})}}]),n}(aa),ga=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["value"]))).name="TickSignal";var r=po(n.getDefaults(),arguments,["value"]);return t.input=t._param=new ma({context:t.context,convert:r.convert,multiplier:r.multiplier,param:t._constantSource.offset,units:r.units,value:r.value}),t}return Object(I.a)(n,[{key:"ticksToTime",value:function(t,e){return this._param.ticksToTime(t,e)}},{key:"timeToTicks",value:function(t,e){return this._param.timeToTicks(t,e)}},{key:"getTimeOfTick",value:function(t){return this._param.getTimeOfTick(t)}},{key:"getDurationOfTicks",value:function(t,e){return this._param.getDurationOfTicks(t,e)}},{key:"getTicksAtTime",value:function(t){return this._param.getTicksAtTime(t)}},{key:"multiplier",get:function(){return this._param.multiplier},set:function(t){this._param.multiplier=t}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._param.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(pa.getDefaults(),{multiplier:1,units:"hertz",value:1})}}]),n}(pa),ya=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency"]))).name="TickSource",t._state=new oa,t._tickOffset=new Eo;var r=po(n.getDefaults(),arguments,["frequency"]);return t.frequency=new ga({context:t.context,units:r.units,value:r.frequency}),Ro(Object(H.a)(t),"frequency"),t._state.setStateAtTime("stopped",0),t.setTicksAtTime(0,0),t}return Object(I.a)(n,[{key:"state",get:function(){return this.getStateAtTime(this.now())}},{key:"start",value:function(t,e){var n=this.toSeconds(t);return"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),Hi(e)&&this.setTicksAtTime(e,n)),this}},{key:"stop",value:function(t){var e=this.toSeconds(t);if("stopped"===this._state.getValueAtTime(e)){var n=this._state.get(e);n&&n.time>0&&(this._tickOffset.cancel(n.time),this._state.cancel(n.time))}return this._state.cancel(e),this._state.setStateAtTime("stopped",e),this.setTicksAtTime(0,e),this}},{key:"pause",value:function(t){var e=this.toSeconds(t);return"started"===this._state.getValueAtTime(e)&&this._state.setStateAtTime("paused",e),this}},{key:"cancel",value:function(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this}},{key:"getTicksAtTime",value:function(t){var e=this,n=this.toSeconds(t),r=this._state.getLastState("stopped",n),i={state:"paused",time:n};this._state.add(i);var o=r,a=0;return this._state.forEachBetween(r.time,n+this.sampleTime,(function(t){var n=o.time,r=e._tickOffset.get(t.time);r&&r.time>=o.time&&(a=r.ticks,n=r.time),"started"===o.state&&"started"!==t.state&&(a+=e.frequency.getTicksAtTime(t.time)-e.frequency.getTicksAtTime(n)),o=t})),this._state.remove(i),a}},{key:"ticks",get:function(){return this.getTicksAtTime(this.now())},set:function(t){this.setTicksAtTime(t,this.now())}}
2,{key:"seconds",get:function(){return this.getSecondsAtTime(this.now())},set:function(t){var e=this.now(),n=this.frequency.timeToTicks(t,e);this.setTicksAtTime(n,e)}},{key:"getSecondsAtTime",value:function(t){var e=this;t=this.toSeconds(t);var n=this._state.getLastState("stopped",t),r={state:"paused",time:t};this._state.add(r);var i=n,o=0;return this._state.forEachBetween(n.time,t+this.sampleTime,(function(t){var n=i.time,r=e._tickOffset.get(t.time);r&&r.time>=i.time&&(o=r.seconds,n=r.time),"started"===i.state&&"started"!==t.state&&(o+=t.time-n),i=t})),this._state.remove(r),o}},{key:"setTicksAtTime",value:function(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(t,e),ticks:t,time:e}),this}},{key:"getStateAtTime",value:function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)}},{key:"getTimeOfTick",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.now(),n=this._tickOffset.get(e),r=this._state.get(e),i=Math.max(n.time,r.time),o=this.frequency.getTicksAtTime(i)+t-n.ticks;return this.frequency.getTimeOfTick(o)}},{key:"forEachTickBetween",value:function(t,e,n){var r=this,i=this._state.get(t);this._state.forEachBetween(t,e,(function(e){i&&"started"===i.state&&"started"!==e.state&&r.forEachTickBetween(Math.max(i.time,t),e.time-r.sampleTime,n),i=e}));var o=null;if(i&&"started"===i.state){var a=Math.max(i.time,t),s=this.frequency.getTicksAtTime(a),u=s-this.frequency.getTicksAtTime(i.time),c=Math.ceil(u)-u;c=xo(c,1)?0:c;for(var l=this.frequency.getTimeOfTick(s+c);l<e;){try{n(l,Math.round(this.getTicksAtTime(l)))}catch(h){o=h;break}l+=this.frequency.getDurationOfTicks(1,l)}}if(o)throw o;return this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._state.dispose(),this._tickOffset.dispose(),this.frequency.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign({frequency:1,units:"hertz"},ia.getDefaults())}}]),n}(ia),ba=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["callback","frequency"]))).name="Clock",t.callback=Lo,t._lastUpdate=0,t._state=new oa("stopped"),t._boundLoop=t._loop.bind(Object(H.a)(t));var r=po(n.getDefaults(),arguments,["callback","frequency"]);return t.callback=r.callback,t._tickSource=new ya({context:t.context,frequency:r.frequency,units:r.units}),t._lastUpdate=0,t.frequency=t._tickSource.frequency,Ro(Object(H.a)(t),"frequency"),t._state.setStateAtTime("stopped",0),t.context.on("tick",t._boundLoop),t}return Object(I.a)(n,[{key:"state",get:function(){return this._state.getValueAtTime(this.now())}},{key:"start",value:function(t,e){Fi(this.context);var n=this.toSeconds(t);return this.log("start",n),"started"!==this._state.getValueAtTime(n)&&(this._state.setStateAtTime("started",n),this._tickSource.start(n,e),n<this._lastUpdate&&this.emit("start",n,e)),this}},{key:"stop",value:function(t){var e=this.toSeconds(t);return this.log("stop",e),this._state.cancel(e),this._state.setStateAtTime("stopped",e),this._tickSource.stop(e),e<this._lastUpdate&&this.emit("stop",e),this}},{key:"pause",value:function(t){var e=this.toSeconds(t);return"started"===this._state.getValueAtTime(e)&&(this._state.setStateAtTime("paused",e),this._tickSource.pause(e),e<this._lastUpdate&&this.emit("pause",e)),this}},{key:"ticks",get:function(){return Math.ceil(this.getTicksAtTime(this.now()))},set:function(t){this._tickSource.ticks=t}},{key:"seconds",get:function(){return this._tickSource.seconds},set:function(t){this._tickSource.seconds=t}},{key:"getSecondsAtTime",value:function(t){return this._tickSource.getSecondsAtTime(t)}},{key:"setTicksAtTime",value:function(t,e){return this._tickSource.setTicksAtTime(t,e),this}},{key:"getTimeOfTick",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.now();return this._tickSource.getTimeOfTick(t,e)}},{key:"getTicksAtTime",value:function(t){return this._tickSource.getTicksAtTime(t)}},{key:"nextTickTime",value:function(t,e){var n=this.toSeconds(e),r=this.getTicksAtTime(n);return this._tickSource.getTimeOfTick(r+t,n)}},{key:"_loop",value:function(){var t=this,e=this._lastUpdate,n=this.now();this._lastUpdate=n,this.log("loop",e,n),e!==n&&(this._state.forEachBetween(e,n,(function(e){switch(e.state){case"started":var n=t._tickSource.getTicksAtTime(e.time);t.emit("start",e.time,n);break;case"stopped":0!==e.time&&t.emit("stop",e.time);break;case"paused":t.emit("pause",e.time)}})),this._tickSource.forEachTickBetween(e,n,(function(e,n){t.callback(e,n)})))}},{key:"getStateAtTime",value:function(t){var e=this.toSeconds(t);return this._state.getValueAtTime(e)}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(ia.getDefaults(),{callback:Lo,frequency:1,units:"hertz"})}}]),n}(ia);Ao.mixin(ba);var _a=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this)).name="ToneAudioBuffers",t._buffers=new Map,t._loadingCount=0;var r=po(n.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");return t.baseUrl=r.baseUrl,Object.keys(r.urls).forEach((function(e){t._loadingCount++;var n=r.urls[e];t.add(e,n,t._bufferLoaded.bind(Object(H.a)(t),r.onload),r.onerror)})),t}return Object(I.a)(n,[{key:"has",value:function(t){return this._buffers.has(t.toString())}},{key:"get",value:function(t){return Li(this.has(t),"ToneAudioBuffers has no buffer named: ".concat(t)),this._buffers.get(t.toString())}},{key:"_bufferLoaded",value:function(t){this._loadingCount--,0===this._loadingCount&&t&&t()}},{key:"loaded",get:function(){return Array.from(this._buffers).every((function(t){var e=Object(o.a)(t,2);e[0];return e[1].loaded}))}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Lo,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Lo;return Ki(e)?this._buffers.set(t.toString(),new Do(this.baseUrl+e,n,r)):this._buffers.set(t.toString(),new Do(e,n,r)),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._buffers.forEach((function(t){return t.dispose()})),this._buffers.clear(),this}}],[{key:"getDefaults",value:function(){return{baseUrl:"",onerror:Lo,onload:Lo,urls:{}}}}]),n}(go);var wa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="Ticks",t.defaultUnits="i",t}return Object(I.a)(n,[{key:"_now",value:function(){return this.context.transport.ticks}},{key:"_beatsToUnits",value:function(t){return this._getPPQ()*t}},{key:"_secondsToUnits",value:function(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())}},{key:"_ticksToUnits",value:function(t){return t}},{key:"toTicks",value:function(){return this.valueOf()}},{key:"toSeconds",value:function(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}]),n}(ra);var xa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="Draw",t.expiration=.25,t.anticipation=.008,t._events=new Eo,t._boundDrawLoop=t._drawLoop.bind(Object(H.a)(t)),t._animationFrame=-1,t}return Object(I.a)(n,[{key:"schedule",value:function(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),1===this._events.length&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}},{key:"cancel",value:function(t){return this._events.cancel(this.toSeconds(t)),this}},{key:"_drawLoop",value:function(){for(var t=this.context.currentTime;this._events.length&&this._events.peek().time-this.anticipation<=t;){var e=this._events.shift();e&&t-e.time<=this.expiration&&e.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}]),n}(ia);Oo((function(t){t.draw=new xa({context:t})})),Co((function(t){t.draw.dispose()}));var Ta=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="IntervalTimeline",t._root=null,t._length=0,t}return Object(I.a)(n,[{key:"add",value:function(t){Li(Hi(t.time),"Events must have a time property"),Li(Hi(t.duration),"Events must have a duration parameter"),t.time=t.time.valueOf();var e=new Ea(t.time,t.time+t.duration,t);for(null===this._root?this._root=e:this._root.insert(e),this._length++;null!==e;)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this}},{key:"remove",value:function(t){if(null!==this._root){var e=[];this._root.search(t.time,e);for(var n=0,r=e;n<r.length;n++){var i=r[n];if(i.event===t){this._removeNode(i),this._length--;break}}}return this}},{key:"length",get:function(){return this._length}},{key:"cancel",value:function(t){var e=this;return this.forEachFrom(t,(function(t){return e.remove(t)})),this}},{key:"_setRoot",value:function(t){this._root=t,null!==this._root&&(this._root.parent=null)}},{key:"_replaceNodeInParent",value:function(t,e){null!==t.parent?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)}},{key:"_removeNode",value:function(t){if(null===t.left&&null===t.right)this._replaceNodeInParent(t,null);else if(null===t.right)this._replaceNodeInParent(t,t.left);else if(null===t.left)this._replaceNodeInParent(t,t.right);else{var e,n=null;if(t.getBalance()>0)if(null===t.left.right)(e=t.left).right=t.right,n=e;else{for(e=t.left.right;null!==e.right;)e=e.right;e.parent&&(e.parent.right=e.left,n=e.parent,e.left=t.left,e.right=t.right)}else if(null===t.right.left)(e=t.right).left=t.left,n=e;else{for(e=t.right.left;null!==e.left;)e=e.left;e.parent&&(e.parent.left=e.right,n=e.parent,e.left=t.left,e.right=t.right)}null!==t.parent?t.isLeftChild()?t.parent.left=e:t.parent.right=e:this._setRoot(e),n&&this._rebalance(n)}t.dispose()}},{key:"_rotateLeft",value:function(t){var e=t.parent,n=t.isLeftChild(),r=t.right;r&&(t.right=r.left,r.left=t),null!==e?n?e.left=r:e.right=r:this._setRoot(r)}},{key:"_rotateRight",value:function(t){var e=t.parent,n=t.isLeftChild(),r=t.left;r&&(t.left=r.right,r.right=t),null!==e?n?e.left=r:e.right=r:this._setRoot(r)}},{key:"_rebalance",value:function(t){var e=t.getBalance();e>1&&t.left?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&t.right&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))}},{key:"get",value:function(t){if(null!==this._root){var e=[];
2if(this._root.search(t,e),e.length>0){for(var n=e[0],r=1;r<e.length;r++)e[r].low>n.low&&(n=e[r]);return n.event}}return null}},{key:"forEach",value:function(t){if(null!==this._root){var e=[];this._root.traverse((function(t){return e.push(t)})),e.forEach((function(e){e.event&&t(e.event)}))}return this}},{key:"forEachAtTime",value:function(t,e){if(null!==this._root){var n=[];this._root.search(t,n),n.forEach((function(t){t.event&&e(t.event)}))}return this}},{key:"forEachFrom",value:function(t,e){if(null!==this._root){var n=[];this._root.searchAfter(t,n),n.forEach((function(t){t.event&&e(t.event)}))}return this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),null!==this._root&&this._root.traverse((function(t){return t.dispose()})),this._root=null,this}}]),n}(go),Ea=function(){function t(e,n,r){Object(a.a)(this,t),this._left=null,this._right=null,this.parent=null,this.height=0,this.event=r,this.low=e,this.high=n,this.max=this.high}return Object(I.a)(t,[{key:"insert",value:function(t){t.low<=this.low?null===this.left?this.left=t:this.left.insert(t):null===this.right?this.right=t:this.right.insert(t)}},{key:"search",value:function(t,e){t>this.max||(null!==this.left&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),this.low>t||null!==this.right&&this.right.search(t,e))}},{key:"searchAfter",value:function(t,e){this.low>=t&&(e.push(this),null!==this.left&&this.left.searchAfter(t,e)),null!==this.right&&this.right.searchAfter(t,e)}},{key:"traverse",value:function(t){t(this),null!==this.left&&this.left.traverse(t),null!==this.right&&this.right.traverse(t)}},{key:"updateHeight",value:function(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0}},{key:"updateMax",value:function(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))}},{key:"getBalance",value:function(){var t=0;return null!==this.left&&null!==this.right?t=this.left.height-this.right.height:null!==this.left?t=this.left.height+1:null!==this.right&&(t=-(this.right.height+1)),t}},{key:"isLeftChild",value:function(){return null!==this.parent&&this.parent.left===this}},{key:"left",get:function(){return this._left},set:function(t){this._left=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}},{key:"right",get:function(){return this._right},set:function(t){this._right=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}},{key:"dispose",value:function(){this.parent=null,this._left=null,this._right=null,this.event=null}}]),t}(),Sa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["volume"]))).name="Volume";var r=po(n.getDefaults(),arguments,["volume"]);return t.input=t.output=new ha({context:t.context,gain:r.volume,units:"decibels"}),t.volume=t.output.gain,Ro(Object(H.a)(t),"volume"),t._unmutedVolume=r.volume,t.mute=r.mute,t}return Object(I.a)(n,[{key:"mute",get:function(){return this.volume.value===-1/0},set:function(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.input.dispose(),this.volume.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{mute:!1,volume:0})}}]),n}(sa),Oa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments))).name="Destination",t.input=new Sa({context:t.context}),t.output=new ha({context:t.context}),t.volume=t.input.volume;var r=po(n.getDefaults(),arguments);return ua(t.input,t.output,t.context.rawContext.destination),t.mute=r.mute,t._internalChannels=[t.input,t.context.rawContext.destination,t.output],t}return Object(I.a)(n,[{key:"mute",get:function(){return this.input.mute},set:function(t){this.input.mute=t}},{key:"chain",value:function(){this.input.disconnect();for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.unshift(this.input),e.push(this.output),ua.apply(void 0,e),this}},{key:"maxChannelCount",get:function(){return this.context.rawContext.destination.maxChannelCount}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),this.volume.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{mute:!1,volume:0})}}]),n}(sa);Oo((function(t){t.destination=new Oa({context:t})})),Co((function(t){t.destination.dispose()}));var ka=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(t){var r;return Object(a.a)(this,n),(r=e.call(this)).name="TimelineValue",r._timeline=new Eo({memory:10}),r._initialValue=t,r}return Object(I.a)(n,[{key:"set",value:function(t,e){return this._timeline.add({value:t,time:e}),this}},{key:"get",value:function(t){var e=this._timeline.get(t);return e?e.value:this._initialValue}}]),n}(go),Ca=function(){function t(e,n){Object(a.a)(this,t),this.id=t._eventId++;var r=Object.assign(t.getDefaults(),n);this.transport=e,this.callback=r.callback,this._once=r.once,this.time=r.time}return Object(I.a)(t,[{key:"invoke",value:function(t){this.callback&&(this.callback(t),this._once&&this.transport.clear(this.id))}},{key:"dispose",value:function(){return this.callback=void 0,this}}],[{key:"getDefaults",value:function(){return{callback:Lo,once:!1,time:0}}}]),t}();Ca._eventId=0;var Ma=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(t,r){var i;Object(a.a)(this,n),(i=e.call(this,t,r))._currentId=-1,i._nextId=-1,i._nextTick=i.time,i._boundRestart=i._restart.bind(Object(H.a)(i));var o=Object.assign(n.getDefaults(),r);return i.duration=new wa(t.context,o.duration).valueOf(),i._interval=new wa(t.context,o.interval).valueOf(),i._nextTick=o.time,i.transport.on("start",i._boundRestart),i.transport.on("loopStart",i._boundRestart),i.context=i.transport.context,i._restart(),i}return Object(I.a)(n,[{key:"invoke",value:function(t){this._createEvents(t),Object(eo.a)(Object(no.a)(n.prototype),"invoke",this).call(this,t)}},{key:"_createEvents",value:function(t){var e=this.transport.getTicksAtTime(t);e>=this.time&&e>=this._nextTick&&this._nextTick+this._interval<this.time+this.duration&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new wa(this.context,this._nextTick).toSeconds()))}},{key:"_restart",value:function(t){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.time;var e=this.transport.getTicksAtTime(t);e>this.time&&(this._nextTick=this.time+Math.ceil((e-this.time)/this._interval)*this._interval),this._currentId=this.transport.scheduleOnce(this.invoke.bind(this),new wa(this.context,this._nextTick).toSeconds()),this._nextTick+=this._interval,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new wa(this.context,this._nextTick).toSeconds())}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this}}],[{key:"getDefaults",value:function(){return Object.assign({},Ca.getDefaults(),{duration:1/0,interval:1,once:!1})}}]),n}(Ca),Aa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments))).name="Transport",t._loop=new ka(!1),t._loopStart=0,t._loopEnd=0,t._scheduledEvents={},t._timeline=new Eo,t._repeatedEvents=new Ta,t._syncedSignals=[],t._swingAmount=0;var r=po(n.getDefaults(),arguments);return t._ppq=r.ppq,t._clock=new ba({callback:t._processTick.bind(Object(H.a)(t)),context:t.context,frequency:0,units:"bpm"}),t._bindClockEvents(),t.bpm=t._clock.frequency,t._clock.frequency.multiplier=r.ppq,t.bpm.setValueAtTime(r.bpm,0),Ro(Object(H.a)(t),"bpm"),t._timeSignature=r.timeSignature,t._swingTicks=r.ppq/2,t}return Object(I.a)(n,[{key:"_processTick",value:function(t,e){if(this._loop.get(t)&&e>=this._loopEnd&&(this.emit("loopEnd",t),this._clock.setTicksAtTime(this._loopStart,t),e=this._loopStart,this.emit("loopStart",t,this._clock.getSecondsAtTime(t)),this.emit("loop",t)),this._swingAmou
2nt>0&&e%this._ppq!==0&&e%(2*this._swingTicks)!==0){var n=e%(2*this._swingTicks)/(2*this._swingTicks),r=Math.sin(n*Math.PI)*this._swingAmount;t+=new wa(this.context,2*this._swingTicks/3).toSeconds()*r}this._timeline.forEachAtTime(e,(function(e){return e.invoke(t)}))}},{key:"schedule",value:function(t,e){var n=new Ca(this,{callback:t,time:new ra(this.context,e).toTicks()});return this._addEvent(n,this._timeline)}},{key:"scheduleRepeat",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=new Ma(this,{callback:t,duration:new $o(this.context,r).toTicks(),interval:new $o(this.context,e).toTicks(),time:new ra(this.context,n).toTicks()});return this._addEvent(i,this._repeatedEvents)}},{key:"scheduleOnce",value:function(t,e){var n=new Ca(this,{callback:t,once:!0,time:new ra(this.context,e).toTicks()});return this._addEvent(n,this._timeline)}},{key:"clear",value:function(t){if(this._scheduledEvents.hasOwnProperty(t)){var e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this}},{key:"_addEvent",value:function(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id}},{key:"cancel",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=this.toTicks(e);return this._timeline.forEachFrom(n,(function(e){return t.clear(e.id)})),this._repeatedEvents.forEachFrom(n,(function(e){return t.clear(e.id)})),this}},{key:"_bindClockEvents",value:function(){var t=this;
2this._clock.on("start",(function(e,n){n=new wa(t.context,n).toSeconds(),t.emit("start",e,n)})),this._clock.on("stop",(function(e){t.emit("stop",e)})),this._clock.on("pause",(function(e){t.emit("pause",e)}))}},{key:"state",get:function(){return this._clock.getStateAtTime(this.now())}},{key:"start",value:function(t,e){var n;return Hi(e)&&(n=this.toTicks(e)),this._clock.start(t,n),this}},{key:"stop",value:function(t){return this._clock.stop(t),this}},{key:"pause",value:function(t){return this._clock.pause(t),this}},{key:"toggle",value:function(t){return t=this.toSeconds(t),"started"!==this._clock.getStateAtTime(t)?this.start(t):this.stop(t),this}},{key:"timeSignature",get:function(){return this._timeSignature},set:function(t){Xi(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}},{key:"loopStart",get:function(){return new $o(this.context,this._loopStart,"i").toSeconds()},set:function(t){this._loopStart=this.toTicks(t)}},{key:"loopEnd",get:function(){return new $o(this.context,this._loopEnd,"i").toSeconds()},set:function(t){this._loopEnd=this.toTicks(t)}},{key:"loop",get:function(){return this._loop.get(this.now())},set:function(t){this._loop.set(t,this.now())}},{key:"setLoopPoints",value:function(t,e){return this.loopStart=t,this.loopEnd=e,this}}
2,{key:"swing",get:function(){return this._swingAmount},set:function(t){this._swingAmount=t}},{key:"swingSubdivision",get:function(){return new wa(this.context,this._swingTicks).toNotation()},set:function(t){this._swingTicks=this.toTicks(t)}},{key:"position",get:function(){var t=this.now(),e=this._clock.getTicksAtTime(t);return new wa(this.context,e).toBarsBeatsSixteenths()},set:function(t){var e=this.toTicks(t);this.ticks=e}},{key:"seconds",get:function(){return this._clock.seconds},set:function(t){var e=this.now(),n=this._clock.frequency.timeToTicks(t,e);this.ticks=n}},{key:"progress",get:function(){if(this.loop){var t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}},{key:"ticks",get:function(){return this._clock.ticks},set:function(t){if(this._clock.ticks!==t){var e=this.now();if("started"===this.state){var n=this._clock.getTicksAtTime(e),r=e+this._clock.frequency.getDurationOfTicks(Math.ceil(n)-n,e);this.emit("stop",r),this._clock.setTicksAtTime(t,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this._clock.setTicksAtTime(t,e)}}},{key:"getTicksAtTime",value:function(t){return Math.round(this._clock.getTicksAtTime(t))}},{key:"getSecondsAtTime",value:function(t){return this._clock.getSecondsAtTime(t)}},{key:"PPQ",get:function(){return this._clock.frequency.multiplier},set:function(t){this._clock.frequency.multiplier=t}},{key:"nextSubdivision",value:function(t){if(t=this.toTicks(t),"started"!==this.state)return 0;var e=this.now(),n=t-this.getTicksAtTime(e)%t;return this._clock.nextTickTime(n,e)}},{key:"syncSignal",value:function(t,e){if(!e){var n=this.now();if(0!==t.getValueAtTime(n)){var r=1/(60/this.bpm.getValueAtTime(n)/this.PPQ);e=t.getValueAtTime(n)/r}else e=0}var i=new ha(e);return this.bpm.connect(i),i.connect(t._param),this._syncedSignals.push({initial:t.value,ratio:i,signal:t}),t.value=0,this}},{key:"unsyncSignal",value:function(t){for(var e=this._syncedSignals.length-1;e>=0;e--){var n=this._syncedSignals[e];n.signal===t&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(e,1))}return this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._clock.dispose(),No(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(ia.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}}]),n}(ia);Ao.mixin(Aa),Oo((function(t){t.transport=new Aa({context:t})}
2)),Co((function(t){t.transport.dispose()}));var Ia=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(t){var r;return Object(a.a)(this,n),(r=e.call(this,t)).input=void 0,r._state=new oa("stopped"),r._synced=!1,r._scheduled=[],r._syncedStart=Lo,r._syncedStop=Lo,r._state.memory=100,r._state.increasing=!0,r._volume=r.output=new Sa({context:r.context,mute:t.mute,volume:t.volume}),r.volume=r._volume.volume,Ro(Object(H.a)(r),"volume"),r.onstop=t.onstop,r}return Object(I.a)(n,[{key:"state",get:function(){return this._synced?"started"===this.context.transport.state?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}},{key:"mute",get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}},{key:"_clampToCurrentTime",value:function(t){return this._synced?t:Math.max(t,this.context.currentTime)}},{key:"start",value:function(t,e,n){var r=this,i=zi(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(i=this._clampToCurrentTime(i),this._synced||"started"!==this._state.getValueAtTime(i))if(this.log("start",i),this._state.setStateAtTime("started",i),this._synced){var o=this._state.get(i);o&&(o.offset=this.toSeconds(vo(e,0)),o.duration=n?this.toSeconds(n):void 0);var a=this.context.transport.schedule((function(t){r._start(t,e,n)}),i);this._scheduled.push(a),"started"===this.context.transport.state&&this.context.transport.getSecondsAtTime(this.immediate())>i&&this._syncedStart(this.now(),this.context.transport.seconds)}else Fi(this.context),this._start(i,e,n);else Li(bo(i,this._state.get(i).time),"Start time must be strictly greater than previous start time"),this._state.cancel(i),this._state.setStateAtTime("started",i),this.log("restart",i),this.restart(i,e,n);return this}},{key:"stop",value:function(t){var e=zi(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(e=this._clampToCurrentTime(e),"started"===this._state.getValueAtTime(e)||Hi(this._state.getNextState("started",e))){if(this.log("stop",e),this._synced){var n=this.context.transport.schedule(this._stop.bind(this),e);this._scheduled.push(n)}else this._stop(e);this._state.cancel(e),this._state.setStateAtTime("stopped",e)}return this}},{key:"restart",value:function(t,e,n){return t=this.toSeconds(t),"started"===this._state.getValueAtTime(t)&&(this._state.cancel(t),this._restart(t,e,n)),this}},{key:"sync",value:function(){var t=this;return this._synced||(this._synced=!0,this._syncedStart=function(e,n){if(n>0){var r=t._state.get(n);if(r&&"started"===r.state&&r.time!==n){var i,o=n-t.toSeconds(r.time);r.duration&&(i=t.toSeconds(r.duration)-o),t._start(e,t.toSeconds(r.offset)+o,i)}}},this._syncedStop=function(e){var n=t.context.transport.getSecondsAtTime(Math.max(e-t.sampleTime,0));"started"===t._state.getValueAtTime(n)&&t._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}},{key:"unsync",value:function(){var t=this;return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach((function(e){return t.context.transport.clear(e)})),this._scheduled=[],this._state.cancel(0),this._stop(0),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.onstop=Lo,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{mute:!1,onstop:Lo,volume:0})}}]),n}(sa),ja=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["url","onload"]))).name="ToneBufferSource",t._source=t.context.createBufferSource(),t._internalChannels=[t._source],t._sourceStarted=!1,t._sourceStopped=!1;var r=po(n.getDefaults(),arguments,["url","onload"]);return ca(t._source,t._gainNode),t._source.onended=function(){return t._stopSource()},t.playbackRate=new aa({context:t.context,param:t._source.playbackRate,units:"positive",value:r.playbackRate}),t.loop=r.loop,t.loopStart=r.loopStart,t.loopEnd=r.loopEnd,t._buffer=new Do(r.url,r.onload,r.onerror),t._internalChannels.push(t._source),t}return Object(I.a)(n,[{key:"fadeIn",get:function(){return this._fadeIn},set:function(t){this._fadeIn=t}},{key:"fadeOut",get:function(){return this._fadeOut},set:function(t){this._fadeOut=t}},{key:"curve",get:function(){return this._curve},set:function(t){this._curve=t}},{key:"start",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Li(this.buffer.loaded,"buffer is either not set or not loaded");var i=this.toSeconds(t);this._startGain(i,r),e=this.loop?vo(e,this.loopStart):vo(e,0);var o=Math.max(this.toSeconds(e),0);if(this.loop){var a=this.toSeconds(this.loopEnd)||this.buffer.duration,s=this.toSeconds(this.loopStart),u=a-s;_o(o,a)&&(o=(o-s)%u+s),xo(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,wo(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(i,o)),Hi(n)){var c=this.toSeconds(n);c=Math.max(c,0),this.stop(i+c)}return this}},{key:"_stopSource",value:function(t){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(t)),this._onended())}},{key:"loopStart",get:function(){return this._source.loopStart},set:function(t){this._source.loopStart=this.toSeconds(t)}},{key:"loopEnd",get:function(){return this._source.loopEnd},set:function(t){this._source.loopEnd=this.toSeconds(t)}},{key:"buffer",get:function(){return this._buffer},set:function(t){this._buffer.set(t)}},{key:"loop",get:function(){return this._source.loop},set:function(t){this._source.loop=t,this._sourceStarted&&this.cancelStop()}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(fa.getDefaults(),{url:new Do,loop:!1,loopEnd:0,loopStart:0,onload:Lo,onerror:Lo,playbackRate:1})}}]),n}(fa);function Pa(t,e){return io(this,void 0,void 0,L.a.mark((function n(){var r,i,o;return L.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e/t.context.sampleRate,i=new Fo(1,r,t.context.sampleRate),new t.constructor(Object.assign(t.get(),{frequency:2/r,detune:0,context:i})).toDestination().start(0),n.next=6,i.render();case 6:return o=n.sent,n.abrupt("return",o.getChannelData(0));case 8:case"end":return n.stop()}}),n)})))}var Ra=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","type"]))).name="ToneOscillatorNode",t._oscillator=t.context.createOscillator(),t._internalChannels=[t._oscillator];var r=po(n.getDefaults(),arguments,["frequency","type"]);return ca(t._oscillator,t._gainNode),t.type=r.type,t.frequency=new aa({context:t.context,param:t._oscillator.frequency,units:"frequency",value:r.frequency}),t.detune=new aa({context:t.context,param:t._oscillator.detune,units:"cents",value:r.detune}),Ro(Object(H.a)(t),["frequency","detune"]),t}return Object(I.a)(n,[{key:"start",value:function(t){var e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._oscillator.start(e),this}},{key:"_stopSource",value:function(t){this._oscillator.stop(t)}},{key:"setPeriodicWave",value:function(t){return this._oscillator.setPeriodicWave(t),this}},{key:"type",get:function(){return this._oscillator.type},set:function(t){this._oscillator.type=t}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),"started"===this.state&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(fa.getDefaults(),{detune:0,frequency:440,type:"sine"})}}]),n}(fa),Na=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","type"]))).name="Oscillator",t._oscillator=null;var r=po(n.getDefaults(),arguments,["frequency","type"]);return t.frequency=new pa({context:t.context,units:"frequency",value:r.frequency}),Ro(Object(H.a)(t),"frequency"),t.detune=new pa({context:t.context,units:"cents",value:r.detune}),Ro(Object(H.a)(t),"detune"),t._partials=r.partials,t._partialCount=r.partialCount,t._type=r.type,r.partialCount&&"custom"!==r.type&&(t._type=t.baseType+r.partialCount.toString()),t.phase=r.phase,t}return Object(I.a)(n,[{key:"_start",value:function(t){var e=this,n=this.toSeconds(t),r=new Ra({context:this.context,onended:function(){return e.onstop(e)}});this._oscillator=r,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(n)}},{key:"_stop",value:function(t){var e=this.toSeconds(t);this._oscillator&&this._oscillator.stop(e)}},{key:"_restart",value:function(t){var e=this.toSeconds(t);return this.log("restart",e),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(e),this}},{key:"syncFrequency",value:function(){return this.context.transport.syncSignal(this.frequency),this}},{key:"unsyncFrequency",value:function(){return this.context.transport.unsyncSignal(this.frequency),this}},{key:"_getCachedPeriodicWave",value:function(){var t=this;if("custom"===this._type)return n._periodicWaveCache.find((function(e){return e.phase===t._phase&&(n=e.partials,r=t._partials,n.length===r.length&&n.every((function(t,e){return r[e]===t})));var n,r}));var e=n._periodicWaveCache.find((function(e){return e.type===t._type&&e.phase===t._phase}));return this._partialCount=e?e.partialCount:this._partialCount,e}},{key:"type",get:function(){return this._type},set:function(t){this._type=t;var e=-1!==["sine","square","sawtooth","triangle"].indexOf(t);if(0===this._phase&&e)this._wave=void 0,this._partialCount=0,null!==this._oscillator&&(this._oscillator.type=t);else{var r=this._getCachedPeriodicWave();if(Hi(r)){var i=r.partials,a=r.wave;this._wave=a,this._partials=i,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}else{var s=this._getRealImaginary(t,this._phase),u=Object(o.a)(s,2),c=u[0],l=u[1],h=this.context.createPerio
2dicWave(c,l);this._wave=h,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave),n._periodicWaveCache.push({imag:l,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:c,type:this._type,wave:this._wave}),n._periodicWaveCache.length>100&&n._periodicWaveCache.shift()}}}},{key:"baseType",get:function(){return this._type.replace(this.partialCount.toString(),"")},set:function(t){this.partialCount&&"custom"!==this._type&&"custom"!==t?this.type=t+this.partialCount:this.type=t}},{key:"partialCount",get:function(){return this._partialCount},set:function(t){Di(t,0);var e=this._type,n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(n&&(e=n[1]),"custom"!==this._type)this.type=0===t?e:e+t.toString();else{var r=new Float32Array(t);this._partials.forEach((function(t,e){return r[e]=t})),this._partials=Array.from(r),this.type=this._type}}},{key:"_getRealImaginary",value:function(t,e){var n=2048,r=new Float32Array(n),i=new Float32Array(n),o=1;if("custom"===t){if(o=this._partials.length+1,this._partialCount=this._partials.length,n=o,0===this._partials.length)return[r,i]}else{var a=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(t);a?(o=parseInt(a[2],10)+1,this._partialCount=parseInt(a[2],10),t=a[1],n=o=Math.max(o,2)):this._partialCount=0,this._partials=[]}for(var s=1;s<n;++s){var u=2/(s*Math.PI),c=void 0;switch(t){case"sine":c=s<=o?1:0,this._partials[s-1]=c;break;case"square":c=1&s?2*u:0,this._partials[s-1]=c;break;case"sawtooth":c=u*(1&s?1:-1),this._partials[s-1]=c;break;case"triangle":c=1&s?u*u*2*(s-1>>1&1?-1:1):0,this._partials[s-1]=c;break;case"custom":c=this._partials[s-1];break;default:throw new TypeError("Oscillator: invalid type: "+t)}0!==c?(r[s]=-c*Math.sin(e*s),i[s]=c*Math.cos(e*s)):(r[s]=0,i[s]=0)}return[r,i]}},{key:"_inverseFFT",value:function(t,e,n){for(var r=0,i=t.length,o=0;o<i;o++)r+=t[o]*Math.cos(o*n)+e[o]*Math.sin(o*n);return r}},{key:"getInitialValue",value:function(){for(var t=this._getRealImaginary(this._type,0),e=Object(o.a)(t,2),n=e[0],r=e[1],i=0,a=2*Math.PI,s=0;s<32;s++)i=Math.max(this._inverseFFT(n,r,s/32*a),i);return To(-this._inverseFFT(n,r,this._phase)/i,-1,1)}},{key:"partials",get:function(){return this._partials.slice(0,this.partialCount)},set:function(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this.type="custom")}},{key:"phase",get:function(){return this._phase*(180/Math.PI)},set:function(t){this._phase=t*Math.PI/180,this.type=this._type}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Pa(this,t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),null!==this._oscillator&&this._oscillator.dispose(),this._wave=void 0,this.frequency.dispose(),this.detune.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Ia.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:"sine"})}}]),n}(Ia);Na._periodicWaveCache=[];var La=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){return Object(a.a)(this,n),e.call(this,Object.assign(po(n.getDefaults(),arguments,["context"])))}return Object(I.a)(n,[{key:"connect",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return va(this,t,e,n),this}}]),n}(sa),Da=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,Object.assign(po(n.getDefaults(),arguments,["mapping","length"])))).name="WaveShaper",t._shaper=t.context.createWaveShaper(),t.input=t._shaper,t.output=t._shaper;var r=po(n.getDefaults(),arguments,["mapping","length"]);return Xi(r.mapping)||r.mapping instanceof Float32Array?t.curve=Float32Array.from(r.mapping):qi(r.mapping)&&t.setMap(r.mapping,r.length),t}return Object(I.a)(n,[{key:"setMap",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,n=new Float32Array(e),r=0,i=e;r<i;r++){var o=r/(i-1)*2-1;n[r]=t(o,r)}return this.curve=n,this}},{key:"curve",get:function(){return this._shaper.curve},set:function(t){this._shaper.curve=t}},{key:"oversample",get:function(){return this._shaper.oversample}
2,set:function(t){Li(["none","2x","4x"].some((function(e){return e.includes(t)})),"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=t}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._shaper.disconnect(),this}}],[{key:"getDefaults",value:function(){return Object.assign(pa.getDefaults(),{length:1024})}}]),n}(La),Fa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="AudioToGain",t._norm=new Da({context:t.context,mapping:function(t){return(t+1)/2}}),t.input=t._norm,t.output=t._norm,t}return Object(I.a)(n,[{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._norm.dispose(),this}}]),n}(La),Ua=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,Object.assign(po(n.getDefaults(),arguments,["value"])))).name="Multiply",t.override=!1;var r=po(n.getDefaults(),arguments,["value"]);return t._mult=t.input=t.output=new ha({context:t.context,minValue:r.minValue,maxValue:r.maxValue}),t.factor=t._param=t._mult.gain,t.factor.setValueAtTime(r.value,0),t}return Object(I.a)(n,[{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._mult.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(pa.getDefaults(),{value:0})}}]),n}(pa),Ba=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","type","modulationType"]))).name="AMOscillator",t._modulationScale=new Fa({context:t.context}),t._modulationNode=new ha({context:t.context});var r=po(n.getDefaults(),arguments,["frequency","type","modulationType"]);return t._carrier=new Na({context:t.context,detune:r.detune,frequency:r.frequency,onstop:function(){return t.onstop(Object(H.a)(t))},phase:r.phase,type:r.type}),t.frequency=t._carrier.frequency,t.detune=t._carrier.detune,t._modulator=new Na({context:t.context,phase:r.phase,type:r.modulationType}),t.harmonicity=new Ua({context:t.context,units:"positive",value:r.harmonicity}),t.frequency.chain(t.harmonicity,t._modulator.frequency),t._modulator.chain(t._modulationScale,t._modulationNode.gain),t._carrier.chain(t._modulationNode,t.output),Ro(Object(H.a)(t),["frequency","detune","harmonicity"]),t}return Object(I.a)(n,[{key:"_start",value:function(t){this._modulator.start(t),this._carrier.start(t)}},{key:"_stop",value:function(t){this._modulator.stop(t),this._carrier.stop(t)}},{key:"_restart",value:function(t){this._modulator.restart(t),this._carrier.restart(t)}},{key:"type",get:function(){return this._carrier.type},set:function(t){this._carrier.type=t}},{key:"baseType",get:function(){return this._carrier.baseType},set:function(t){this._carrier.baseType=t}},{key:"partialCount",get:function(){return this._carrier.partialCount},set:function(t){this._carrier.partialCount=t}},{key:"modulationType",get:function(){return this._modulator.type},set:function(t){this._modulator.type=t}},{key:"phase",get:function(){return this._carrier.phase},set:function(t){this._carrier.phase=t,this._modulator.phase=t}},{key:"partials",get:function(){return this._carrier.partials},set:function(t){this._carrier.partials=t}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Pa(this,t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Na.getDefaults(),{harmonicity:1,modulationType:"square"})}}]),n}(Ia),Va=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","type","modulationType"]))).name="FMOscillator",t._modulationNode=new ha({context:t.context,gain:0});var r=po(n.getDefaults(),arguments,["frequency","type","modulationType"]);return t._carrier=new Na({context:t.context,detune:r.detune,frequency:0,onstop:function(){return t.onstop(Object(H.a)(t))},phase:r.phase,type:r.type}),t.detune=t._carrier.detune,t.frequency=new pa({context:t.context,units:"frequency",value:r.frequency}),t._modulator=new Na({context:t.context,phase:r.phase,type:r.modulationType}),t.harmonicity=new Ua({context:t.context,units:"positive",value:r.harmonicity}),t.modulationIndex=new Ua({context:t.context,units:"positive",value:r.modulationIndex}),t.frequency.connect(t._carrier.frequency),t.frequency.chain(t.harmonicity,t._modulator.frequency),t.frequency.chain(t.modulationIndex,t._modulationNode),t._modulator.connect(t._modulationNode.gain),t._modulationNode.connect(t._carrier.frequency),t._carrier.connect(t.output),t.detune.connect(t._modulator.detune),Ro(Object(H.a)(t),["modulationIndex","frequency","detune","harmonicity"]),t}return Object(I.a)(n,[{key:"_start",value:function(t){this._modulator.start(t),this._carrier.start(t)}},{key:"_stop",value:function(t){this._modulator.stop(t),this._carrier.stop(t)}},{key:"_restart",value:function(t){return this._modulator.restart(t),this._carrier.restart(t),this}},{key:"type",get:function(){return this._carrier.type},set:function(t){this._carrier.type=t}},{key:"baseType",get:function(){return this._carrier.baseType},set:function(t){this._carrier.baseType=t}},{key:"partialCount",get:function(){return this._carrier.partialCount},set:function(t){this._carrier.partialCount=t}},{key:"modulationType",get:function(){return this._modulator.type},set:function(t){this._modulator.type=t}},{key:"phase",get:function(){return this._carrier.phase},set:function(t){this._carrier.phase=t,this._modulator.phase=t}},{key:"partials",get:function(){return this._carrier.partials},set:function(t){this._carrier.partials=t}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Pa(this,t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Na.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}}]),n}(Ia),za=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","width"]))).name="PulseOscillator",t._widthGate=new ha({context:t.context,gain:0}),t._thresh=new Da({context:t.context,mapping:function(t){return t<=0?-1:1}});var r=po(n.getDefaults(),arguments,["frequency","width"]);return t.width=new pa({context:t.context,units:"audioRange",value:r.width}),t._triangle=new Na({context:t.context,detune:r.detune,frequency:r.frequency,onstop:function(){return t.onstop(Object(H.a)(t))},phase:r.phase,type:"triangle"}),t.frequency=t._triangle.frequency,t.detune=t._triangle.detune,t._triangle.chain(t._thresh,t.output),t.width.chain(t._widthGate,t._thresh),Ro(Object(H.a)(t),["width","frequency","detune"]),t}return Object(I.a)(n,[{key:"_start",value:function(t){t=this.toSeconds(t),this._triangle.start(t),this._widthGate.gain.setValueAtTime(1,t)}},{key:"_stop",value:function(t){t=this.toSeconds(t),this._triangle.stop(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(0,t)}},{key:"_restart",value:function(t){this._triangle.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)}},{key:"phase",get:function(){return this._triangle.phase},set:function(t){this._triangle.phase=t}},{key:"type",get:function(){return"pulse"}},{key:"baseType",get:function(){return"pulse"}},{key:"partials",get:function(){return[]}},{key:"partialCount",get:function(){return 0}},{key:"carrierType",set:function(t){this._triangle.type=t}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Pa(this,t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Ia.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}}]),n}(Ia),Ha=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","type","spread"]))).name="FatOscillator",t._oscillators=[];var r=po(n.getDefaults(),arguments,["frequency","type","spread"]);return t.frequency=new pa({context:t.context,units:"frequency",value:r.frequency}),t.detune=new pa({context:t.context,units:"cents",value:r.detune}),t._spread=r.spread,t._type=r.type,t._phase=r.phase,t._partials=r.partials,t._partialCount=r.partialCount,t.count=r.count,Ro(Object(H.a)(t),["frequency","detune"]),t}return Object(I.a)(n,[{key:"_start",value:function(t){t=this.toSeconds(t),this._forEach((function(e){return e.start(t)}))}},{key:"_stop",value:function(t){t=this.toSeconds(t),this._forEach((function(e){return e.stop(t)}))}},{key:"_restart",value:function(t){this._forEach((function(e){return e.restart(t)}))}},{key:"_forEach",value:function(t){for(var e=0;e<this._oscillators.length;e++)t(this._oscillators[e],e)}},{key:"type",get:function(){return this._type},set:function(t){this._type=t,this._forEach((function(e){return e.type=t}))}},{key:"spread",get:function(){return this._spread},set:function(t){if(this._spread=t,this._oscillators.length>1){var e=-t/2,n=t/(this._oscillators.length-1);this._forEach((function(t,r){return t.detune.value=e+n*r}))}}},{key:"count",get:function(){return this._oscillators.length},set:function(t){var e=this;if(Di(t,1),this._oscillators.length!==t){this._forEach((function(t){return t.dispose()})),this._oscillators=[];for(var n=0;n<t;n++){var r=new Na({context:this.context,volume:-6-1.1*t,type:this._type,phase:this._phase+n/t*360,partialCount:this._partialCount,onstop:0===n?function(){return e.onstop(e)}:Lo});"custom"===this.type&&(r.partials=this._partials),this.frequency.connect(r.frequency),this.detune.connect(r.detune),r.detune.overridden=!1,r.connect(this.output),this._oscillators[n]=r}
2this.spread=this._spread,"started"===this.state&&this._forEach((function(t){return t.start()}))}}},{key:"phase",get:function(){return this._phase},set:function(t){var e=this;this._phase=t,this._forEach((function(t,n){return t.phase=e._phase+n/e.count*360}))}},{key:"baseType",get:function(){return this._oscillators[0].baseType},set:function(t){this._forEach((function(e){return e.baseType=t})),this._type=this._oscillators[0].type}},{key:"partials",get:function(){return this._oscillators[0].partials},set:function(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this._type="custom",this._forEach((function(e){return e.partials=t})))}},{key:"partialCount",get:function(){return this._oscillators[0].partialCount},set:function(t){this._partialCount=t,this._forEach((function(e){return e.partialCount=t})),this._type=this._oscillators[0].type}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Pa(this,t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.frequency.dispose(),this.detune.dispose(),this._forEach((function(t){return t.dispose()})),this}}],[{key:"getDefaults",value:function(){return Object.assign(Na.getDefaults(),{count:3,spread:20,type:"sawtooth"})}}]),n}(Ia),qa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","modulationFrequency"]))).name="PWMOscillator",t.sourceType="pwm",t._scale=new Ua({context:t.context,value:2});var r=po(n.getDefaults(),arguments,["frequency","modulationFrequency"]);return t._pulse=new za({context:t.context,frequency:r.modulationFrequency}),t._pulse.carrierType="sine",t.modulationFrequency=t._pulse.frequency,t._modulator=new Na({context:t.context,detune:r.detune,frequency:r.frequency,onstop:function(){return t.onstop(Object(H.a)(t))},phase:r.phase}),t.frequency=t._modulator.frequency,t.detune=t._modulator.detune,t._modulator.chain(t._scale,t._pulse.width),t._pulse.connect(t.output),Ro(Object(H.a)(t),["modulationFrequency","frequency","detune"]),t}return Object(I.a)(n,[{key:"_start",value:function(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)}},{key:"_stop",value:function(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)}},{key:"_restart",value:function(t){this._modulator.restart(t),this._pulse.restart(t)}},{key:"type",get:function(){return"pwm"}},{key:"baseType",get:function(){return"pwm"}},{key:"partials",get:function(){return[]}},{key:"partialCount",get:function(){return 0}},{key:"phase",get:function(){return this._modulator.phase},set:function(t){this._modulator.phase=t}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Pa(this,t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Ia.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}}]),n}(Ia),Wa={am:Ba,fat:Ha,fm:Va,oscillator:Na,pulse:za,pwm:qa},Ga=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["frequency","type"]))).name="OmniOscillator";var r=po(n.getDefaults(),arguments,["frequency","type"]);return t.frequency=new pa({context:t.context,units:"frequency",value:r.frequency}),t.detune=new pa({context:t.context,units:"cents",value:r.detune}),Ro(Object(H.a)(t),["frequency","detune"]),t.set(r),t}return Object(I.a)(n,[{key:"_start",value:function(t){this._oscillator.start(t)}},{key:"_stop",value:function(t){this._oscillator.stop(t)}},{key:"_restart",value:function(t){return this._oscillator.restart(t),this}},{key:"type",get:function(){var t=this,e="";return["am","fm","fat"].some((function(e){return t._sourceType===e}))&&(e=this._sourceType),e+this._oscillator.type},set:function(t){"fm"===t.substr(0,2)?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):"am"===t.substr(0,2)?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):"fat"===t.substr(0,3)?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(3)):"pwm"===t?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):"pulse"===t?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=t)}},{key:"partials",get:function(){return this._oscillator.partials},set:function(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partials=t)}},{key:"partialCount",get:function(){return this._oscillator.partialCount},set:function(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||(this._oscillator.partialCount=t)}},{key:"set",value:function(t){return Reflect.has(t,"type")&&t.type&&(this.t
2ype=t.type),Object(eo.a)(Object(no.a)(n.prototype),"set",this).call(this,t),this}},{key:"_createNewOscillator",value:function(t){var e=this;if(t!==this._sourceType){this._sourceType=t;var n=Wa[t],r=this.now();if(this._oscillator){var i=this._oscillator;i.stop(r),this.context.setTimeout((function(){return i.dispose()}),this.blockTime)}this._oscillator=new n({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=function(){return e.onstop(e)},"started"===this.state&&this._oscillator.start(r)}}},{key:"phase",get:function(){return this._oscillator.phase},set:function(t){this._oscillator.phase=t}},{key:"sourceType",get:function(){return this._sourceType},set:function(t){var e="sine";"pwm"!==this._oscillator.type&&"pulse"!==this._oscillator.type&&(e=this._oscillator.type),"fm"===t?this.type="fm"+e:"am"===t?this.type="am"+e:"fat"===t?this.type="fat"+e:"oscillator"===t?this.type=e:"pulse"===t?this.type="pulse":"pwm"===t&&(this.type="pwm")}},{key:"_getOscType",value:function(t,e){return t instanceof Wa[e]}},{key:"baseType",get:function(){return this._oscillator.baseType},set:function(t){this._getOscType(this._oscillator,"pulse")||this._getOscType(this._oscillator,"pwm")||"pulse"===t||"pwm"===t||(this._oscillator.baseType=t)}},{key:"width",get:function(){return this._getOscType(this._oscillator,"pulse")?this._oscillator.width:void 0}},{key:"count",get:function(){return this._getOscType(this._oscillator,"fat")?this._oscillator.count:void 0},set:function(t){this._getOscType(this._oscillator,"fat")&&Wi(t)&&(this._oscillator.count=t)}},{key:"spread",get:function(){return this._getOscType(this._oscillator,"fat")?this._oscillator.spread:void 0},set:function(t){this._getOscType(this._oscillator,"fat")&&Wi(t)&&(this._oscillator.spread=t)}},{key:"modulationType",get:function(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.modulationType:void 0},set:function(t){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&Ki(t)&&(this._oscillator.modulationType=t)}},{key:"modulationIndex",get:function(){return this._getOscType(this._oscillator,"fm")?this._oscillator.modulationIndex:void 0}},{key:"harmonicity",get:function(){return this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am")?this._oscillator.harmonicity:void 0}},{key:"modulationFrequency",get:function(){return this._getOscType(this._oscillator,"pwm")?this._oscillator.modulationFrequency:void 0}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Pa(this,t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Na.getDefaults(),Va.getDefaults(),Ba.getDefaults(),Ha.getDefaults(),za.getDefaults(),qa.getDefaults())}}]),n}(Ia);function Ya(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=new WeakMap;return function(r,i){Reflect.defineProperty(r,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(r){Di(r,t,e),n.set(this,r)}})}}function Xa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=new WeakMap;return function(r,i){Reflect.defineProperty(r,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(r){Di(this.toSeconds(r),t,e),n.set(this,r)}})}}var Ka=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["url","onload"]))).name="Player",t._activeSources=new Set;var r=po(n.getDefaults(),arguments,["url","onload"]);return t._buffer=new Do({onload:t._onload.bind(Object(H.a)(t),r.onload),onerror:r.onerror,reverse:r.reverse,url:r.url}),t.autostart=r.autostart,t._loop=r.loop,t._loopStart=r.loopStart,t._loopEnd=r.loopEnd,t._playbackRate=r.playbackRate,t.fadeIn=r.fadeIn,t.fadeOut=r.fadeOut,t}return Object(I.a)(n,[{key:"load",value:function(t){return io(this,void 0,void 0,L.a.mark((function e(){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._buffer.load(t);case 2:return this._onload(),e.abrupt("return",this);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"_onload",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lo;t(),this.autostart&&this.start()}},{key:"_onSourceEnd",value:function(t){this.onstop(this),this._activeSources.delete(t),0!==this._activeSources.size||this._synced||"started"!==this._state.getValueAtTime(this.now())||
2(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}},{key:"start",value:function(t,e,r){return Object(eo.a)(Object(no.a)(n.prototype),"start",this).call(this,t,e,r),this}},{key:"_start",value:function(t,e,n){e=this._loop?vo(e,this._loopStart):vo(e,0);var r=this.toSeconds(e),i=n;n=vo(n,Math.max(this._buffer.duration-r,0));var o=this.toSeconds(n);o/=this._playbackRate,t=this.toSeconds(t);var a=new ja({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);this._loop||this._synced||(this._state.cancel(t+o),this._state.setStateAtTime("stopped",t+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&zi(i)?a.start(t,r):a.start(t,r,o-this.toSeconds(this.fadeOut))}},{key:"_stop",value:function(t){var e=this.toSeconds(t);this._activeSources.forEach((function(t){return t.stop(e)}))}},{key:"restart",value:function(t,e,r){return Object(eo.a)(Object(no.a)(n.prototype),"restart",this).call(this,t,e,r),this}},{key:"_restart",value:function(t,e,n){this._stop(t),this._start(t,e,n)}},{key:"seek",value:function(t,e){var n=this.toSeconds(e);if("started"===this._state.getValueAtTime(n)){var r=this.toSeconds(t);this._stop(n),this._start(n,r)}return this}},{key:"setLoopPoints",value:function(t,e){return this.loopStart=t,this.loopEnd=e,this}},{key:"loopStart",get:function(){return this._loopStart},set:function(t){this._loopStart=t,this.buffer.loaded&&Di(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach((function(e){e.loopStart=t}))}},{key:"loopEnd",get:function(){return this._loopEnd},set:function(t){this._loopEnd=t,this.buffer.loaded&&Di(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach((function(e){e.loopEnd=t}))}},{key:"buffer",get:function(){return this._buffer},set:function(t){this._buffer.set(t)}},{key:"loop",get:function(){return this._loop},set:function(t){if(this._loop!==t&&(this._loop=t,this._activeSources.forEach((function(e){e.loop=t})),t)){var e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){this._playbackRate=t;var e=this.now(),n=this._state.getNextState("stopped",e);n&&n.implicitEnd&&(this._state.cancel(n.time),this._activeSources.forEach((function(t){return t.cancelStop()}))),this._activeSources.forEach((function(n){n.playbackRate.setValueAtTime(t,e)}))}},{key:"reverse",get:function(){return this._buffer.reverse},set:function(t){this._buffer.reverse=t}},{key:"loaded",get:function(){return this._buffer.loaded}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._activeSources.forEach((function(t){return t.dispose()})),this._activeSources.clear(),this._buffer.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Ia.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Lo,onerror:Lo,playbackRate:1,reverse:!1})}}]),n}(Ia);ro([Xa(0)],Ka.prototype,"fadeIn",void 0),ro([Xa(0)],Ka.prototype,"fadeOut",void 0);var Qa=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["attack","decay","sustain","release"]))).name="Envelope",t._sig=new pa({context:t.context,value:0}),t.output=t._sig,t.input=void 0;var r=po(n.getDefaults(),arguments,["attack","decay","sustain","release"]);return t.attack=r.attack,t.decay=r.decay,t.sustain=r.sustain,t.release=r.release,t.attackCurve=r.attackCurve,t.releaseCurve=r.releaseCurve,t.decayCurve=r.decayCurve,t}return Object(I.a)(n,[{key:"value",get:function(){return this.getValueAtTime(this.now())}},{key:"_getCurve",value:function(t,e){if(Ki(t))return t;var n;for(n in Ja)if(Ja[n][e]===t)return n;return t}},{key:"_setCurve",value:function(t,e,n){if(Ki(n)&&Reflect.has(Ja,n)){var r=Ja[n];Gi(r)?"_decayCurve"!==t&&(this[t]=r[e]):this[t]=r}else{if(!Xi(n)||"_decayCurve"===t)throw new Error("Envelope: invalid curve: "+n);this[t]=n}}},{key:"attackCurve",get:function(){return this._getCurve(this._attackCurve,"In")},set:function(t){this._setCurve("_attackCurve","In",t)}},{key:"releaseCurve",get:function(){return this._getCurve(this._releaseCurve,"Out")},set:function(t){this._setCurve("_releaseCurve","Out",t)}},{key:"decayCurve",get:function(){return this._decayCurve},set:function(t){Li(["linear","exponential"].some((function(e){return e===t})),"Invalid envelope curve: ".concat(t)),this._decayCurve=t}},{key:"triggerAttack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.log("triggerAttack",t,e),t=this.toSeconds(t);var n=this.toSeconds(this.attack),r=n,i=this.toSeconds(this.decay),o=this.getValueAtTime(t);if(o>0){var a=1/r,s=1-o;r=s/a}if(r<this.sampleTime)this._sig.cancelScheduledValues(t),this._sig.setValueAtTime(e,t);else if("linear"===this._attackCurve)this._sig.linearRampTo(e,r,t);else if("exponential"===this._attackCurve)this._sig.targetRampTo(e,r,t);else{this._sig.cancelAndHoldAtTime(t);for(var u=this._attackCurve,c=1;c<u.length;c++)if(u[c-1]<=o&&o<=u[c]){(u=this._attackCurve.slice(c))[0]=o;break}this._sig.setValueCurveAtTime(u,t,r,e)}if(i&&this.sustain<1){var l=e*this.sustain,h=t+r;this.log("decay",h),"linear"===this._decayCurve?this._sig.linearRampToValueAtTime(l,i+h):this._sig.exponentialApproachValueAtTime(l,h,i)}return this}},{key:"triggerRelease",value:function(t){this.log("triggerRelease",t),t=this.toSeconds(t);var e=this.getValueAtTime(t);if(e>0){var n=this.toSeconds(this.release);n<this.sampleTime?this._sig.setValueAtTime(0,t):"linear"===this._releaseCurve?this._sig.linearRampTo(0,n,t):"exponential"===this._releaseCurve?this._sig.targetRampTo(0,n,t):(Li(Xi(this._releaseCurve),"releaseCurve must be either 'linear', 'exponential' or an array"),this._sig.cancelAndHoldAtTime(t),this._sig.setValueCurveAtTime(this._releaseCurve,t,n,e))}return this}},{key:"getValueAtTime",value:function(t){return this._sig.getValueAtTime(t)}},{key:"triggerAttackRelease",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return e=this.toSeconds(e),this.triggerAttack(e,n),this.triggerRelease(e+this.toSeconds(t)),this}},{key:"cancel",value:function(t){return this._sig.cancelScheduledValues(this.toSeconds(t)),this}},{key:"connect",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return va(this,t,e,n),this}},{key:"asArray",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024;return io(this,void 0,void 0,L.a.mark((function e(){var n,r,i,o,a,s,u,c;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t/this.context.sampleRate,r=new Fo(1,n,this.context.sampleRate),i=this.toSeconds(this.attack)+this.toSeconds(this.decay),o=i+this.toSeconds(this.release),s=o+(a=.1*o),(u=new this.constructor(Object.assign(this.get(),{attack:n*this.toSeconds(this.attack)/s,decay:n*this.toSeconds(this.decay)/s,release:n*this.toSeconds(this.release)/s,context:r})))._sig.toDestination(),u.triggerAttackRelease(n*(i+a)/s,0),e.next=11,r.render();case 11:return c=e.sent,e.abrupt("return",c.getChannelData(0));case 13:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),this._sig.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}}]),n}(sa);ro([Xa(0)],Qa.prototype,"attack",void 0),ro([Xa(0)],Qa.prototype,"decay",void 0),ro([Ya(0,1)],Qa.prototype,"sustain",void 0),ro([Xa(0)],Qa.prototype,"release",void 0);var Ja=function(){var t,e,n=128,r=[];for(t=0;t<n;t++)r[t]=Math.sin(t/127*(Math.PI/2));var i=[];for(t=0;t<127;t++){e=t/127;var o=Math.sin(e*(2*Math.PI)*6.4-Math.PI/2)+1;i[t]=o/10+.83*e}i[127]=1;var a=[];for(t=0;t<n;t++)a[t]=Math.ceil(t/127*5)/5;var s=[];for(t=0;t<n;t++)e=t/127,s[t]=.5*(1-Math.cos(Math.PI*e));var u,c=[];for(t=0;t<n;t++){e=t/127;var l=4*Math.pow(e,3)+.2,h=Math.cos(l*Math.PI*2*e);c[t]=Math.abs(h*(1-e))}function f(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=1-t[n];return e}return{bounce:{In:f(c),Out:c},cosine:{In:r,Out:(u=r,u.slice(0).reverse())},exponential:"exponential",linear:"linear",ripple:{In:i,Out:f(i)},sine:{In:s,Out:f(s)},step:{In:a,Out:f(a)}}}(),Za=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments)))._scheduledEvents=[],t._synced=!1,t._original_triggerAttack=t.triggerAttack,t._original_triggerRelease=t.triggerRelease;var r=po(n.getDefaults(),arguments);return t._volume=t.output=new Sa({context:t.context,volume:r.volume}),t.volume=t._volume.volume,Ro(Object(H.a)(t),"volume"),t}return Object(I.a)(n,[{key:"sync",value:function(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0)),this}},{key:"_syncState",value:function(){var t=!1;return this._synced||(this._synced=!0,t=!0),t}},{key:"_syncMethod",value:function(t,e){var n=this,r=this["_original_"+t]=this[t];this[t]=function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];var a=i[e],s=n.context.transport.schedule((function(t){i[e]=t,r.apply(n,i)}),a);n._scheduledEvents.push(s)}}},{key:"unsync",value:function(){var t=this;return this._scheduledEvents.forEach((function(e){return t.context.transport.clear(e)})),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this}},{key:"triggerAttackRelease",value:function(t,e,n,r){var i=this.toSeconds(n),o=this.toSeconds(e);return this.triggerAttack(t,i,r),this.triggerRelease(i+o),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{volume:0})}}]),n}(sa),$a=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),t=e.call(this,po(n.getDefaults(),arguments));var r=po(n.getDefaults(),arguments);return t.portamento=r.portamento,t.onsilence=r.onsilence,t}return Object(I.a)(n,[{key:"triggerAttack",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.log("triggerAttack",t,e,n);var r=this.toSeconds(e);return this._triggerEnvelopeAttack(r,n),this.setNote(t,r),this}},{key:"triggerRelease",value:function(t){this.log("triggerRelease",t);var e=this.toSeconds(t);return this._triggerEnvelopeRelease(e),this}},{key:"setNote",value:function(t,e){var n=this.toSeconds(e),r=t instanceof ta?t.toFrequency():t;if(this.portamento>0&&this.getLevelAtTime(n)>.05){var i=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(r,i,n)}else this.frequency.setValueAtTime(r,n);return this}}],[{key:"getDefaults",value:function(){return Object.assign(Za.getDefaults(),{detune:0,onsilence:Lo,portamento:0})}}]),n}(Za);ro([Xa(0)],$a.prototype,"portamento",void 0);var ts=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["attack","decay","sustain","release"]))).name="AmplitudeEnvelope",t._gainNode=new ha({context:t.context,gain:0}
2),t.output=t._gainNode,t.input=t._gainNode,t._sig.connect(t._gainNode.gain),t.output=t._gainNode,t.input=t._gainNode,t}return Object(I.a)(n,[{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._gainNode.dispose(),this}}]),n}(Qa),es=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments))).name="Synth";var r=po(n.getDefaults(),arguments);return t.oscillator=new Ga(Object.assign({context:t.context,detune:r.detune,onstop:function(){return t.onsilence(Object(H.a)(t))}},r.oscillator)),t.frequency=t.oscillator.frequency,t.detune=t.oscillator.detune,t.envelope=new ts(Object.assign({context:t.context},r.envelope)),t.oscillator.chain(t.envelope,t.output),Ro(Object(H.a)(t),["oscillator","frequency","detune","envelope"]),t}return Object(I.a)(n,[{key:"_triggerEnvelopeAttack",value:function(t,e){if(this.envelope.triggerAttack(t,e),this.oscillator.start(t),0===this.envelope.sustain){var n=this.toSeconds(this.envelope.attack),r=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+n+r)}}},{key:"_triggerEnvelopeRelease",value:function(t){this.envelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}},{key:"getLevelAtTime",value:function(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.oscillator.dispose(),this.envelope.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign($a.getDefaults(),{envelope:Object.assign(mo(Qa.getDefaults(),Object.keys(sa.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(mo(Ga.getDefaults(),[].concat(Object(X.a)(Object.keys(Ia.getDefaults())),["frequency","detune"])),{type:"triangle"})})}}]),n}($a),ns=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments))).name="MembraneSynth",t.portamento=0;var r=po(n.getDefaults(),arguments);return t.pitchDecay=r.pitchDecay,t.octaves=r.octaves,Ro(Object(H.a)(t),["oscillator","envelope"]),t}return Object(I.a)(n,[{key:"setNote",value:function(t,e){var n=this.toSeconds(e),r=this.toFrequency(t instanceof ta?t.toFrequency():t),i=r*this.octaves;return this.oscillator.frequency.setValueAtTime(i,n),this.oscillator.frequency.exponentialRampToValueAtTime(r,n+this.toSeconds(this.pitchDecay)),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this}}],[{key:"getDefaults",value:function(){return fo($a.getDefaults(),es.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}}]),n}(es);ro([Ya(0)],ns.prototype,"octaves",void 0),ro([Xa(0)],ns.prototype,"pitchDecay",void 0);var rs=new Set;function is(t){rs.add(t)}function os(t,e){var n='registerProcessor("'.concat(t,'", ').concat(e,")");rs.add(n)}is('\n\t/**\n\t * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. \n\t */\n\tclass ToneAudioWorkletProcessor extends AudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\t\n\t\t\tsuper(options);\n\t\t\t/**\n\t\t\t * If the processor was disposed or not. Keep alive until it\'s disposed.\n\t\t\t */\n\t\t\tthis.disposed = false;\n\t\t \t/** \n\t\t\t * The number of samples in the processing block\n\t\t\t */\n\t\t\tthis.blockSize = 128;\n\t\t\t/**\n\t\t\t * the sample rate\n\t\t\t */\n\t\t\tthis.sampleRate = sampleRate;\n\n\t\t\tthis.port.onmessage = (event) => {\n\t\t\t\t// when it receives a dispose \n\t\t\t\tif (event.data === "dispose") {\n\t\t\t\t\tthis.disposed = true;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n');is("\n\t/**\n\t * Abstract class for a single input/output processor. \n\t * has a 'generate' function which processes one sample at a time\n\t */\n\tclass SingleIOProcessor extends ToneAudioWorkletProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(Object.assign(options, {\n\t\t\t\tnumberOfInputs: 1,\n\t\t\t\tnumberOfOutputs: 1\n\t\t\t}));\n\t\t\t/**\n\t\t\t * Holds the name of the parameter and a single value of that\n\t\t\t * parameter at the current sample\n\t\t\t * @type { [name: string]: number }\n\t\t\t */\n\t\t\tthis.params = {}\n\t\t}\n\n\t\t/**\n\t\t * Generate an output sample from the input sample and parameters\n\t\t * @abstract\n\t\t * @param input number\n\t\t * @param channel number\n\t\t * @param parameters { [name: string]: number }\n\t\t * @returns number\n\t\t */\n\t\tgenerate(){}\n\n\t\t/**\n\t\t * Update the private params object with the \n\t\t * values of the parameters at the given index\n\t\t * @param parameters { [name: string]: Float32Array },\n\t\t * @param index number\n\t\t */\n\t\tupdateParams(parameters, index) {\n\t\t\tfor (const paramName in parameters) {\n\t\t\t\tconst param = parameters[paramName];\n\t\t\t\tif (param.length > 1) {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][index];\n\t\t\t\t} else {\n\t\t\t\t\tthis.params[paramName] = parameters[paramName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process a single frame of the audio\n\t\t * @param inputs Float32Array[][]\n\t\t * @param outputs Float32Array[][]\n\t\t */\n\t\tprocess(inputs, outputs, parameters) {\n\t\t\tconst input = inputs[0];\n\t\t\tconst output = outputs[0];\n\t\t\t// get the parameter values\n\t\t\tconst channelCount = Math.max(input && input.length || 0, output.length);\n\t\t\tfor (let sample = 0; sample < this.blockSize; sample++) {\n\t\t\t\tthis.updateParams(parameters, sample);\n\t\t\t\tfor (let channel = 0; channel < channelCount; channel++) {\n\t\t\t\t\tconst inputSample = input && input.length ? input[channel][sample] : 0;\n\t\t\t\t\toutput[channel][sample] = this.generate(inputSample, channel, this.params);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn !this.disposed;\n\t\t}\n\t};\n");is("\n\t/**\n\t * A multichannel buffer for use within an AudioWorkletProcessor as a delay line\n\t */\n\tclass DelayLine {\n\t\t\n\t\tconstructor(size, channels) {\n\t\t\tthis.buffer = [];\n\t\t\tthis.writeHead = []\n\t\t\tthis.size = size;\n\n\t\t\t// create the empty channels\n\t\t\tfor (let i = 0; i < channels;
2 i++) {\n\t\t\t\tthis.buffer[i] = new Float32Array(this.size);\n\t\t\t\tthis.writeHead[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Push a value onto the end\n\t\t * @param channel number\n\t\t * @param value number\n\t\t */\n\t\tpush(channel, value) {\n\t\t\tthis.writeHead[channel] += 1;\n\t\t\tif (this.writeHead[channel] > this.size) {\n\t\t\t\tthis.writeHead[channel] = 0;\n\t\t\t}\n\t\t\tthis.buffer[channel][this.writeHead[channel]] = value;\n\t\t}\n\n\t\t/**\n\t\t * Get the recorded value of the channel given the delay\n\t\t * @param channel number\n\t\t * @param delay number delay samples\n\t\t */\n\t\tget(channel, delay) {\n\t\t\tlet readHead = this.writeHead[channel] - Math.floor(delay);\n\t\t\tif (readHead < 0) {\n\t\t\t\treadHead += this.size;\n\t\t\t}\n\t\t\treturn this.buffer[channel][readHead];\n\t\t}\n\t}\n");var as="feedback-comb-filter";os(as,'\n\tclass FeedbackCombFilterWorklet extends SingleIOProcessor {\n\n\t\tconstructor(options) {\n\t\t\tsuper(options);\n\t\t\tthis.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2);\n\t\t}\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: "delayTime",\n\t\t\t\tdefaultValue: 0.1,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 1,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}, {\n\t\t\t\tname: "feedback",\n\t\t\t\tdefaultValue: 0.5,\n\t\t\t\tminValue: 0,\n\t\t\t\tmaxValue: 0.9999,\n\t\t\t\tautomationRate: "k-rate"\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, channel, parameters) {\n\t\t\tconst delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate);\n\t\t\tthis.delayLine.push(channel, input + delayedSample * parameters.feedback);\n\t\t\treturn delayedSample;\n\t\t}\n\t}\n');var ss=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"))).name="Sampler",t._activeSources=new Map;var r=po(n.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),i={};return Object.keys(r.urls).forEach((function(e){var n=parseInt(e,10);if(Li(Qi(e)||Wi(n)&&isFinite(n),"url key is neither a note or midi pitch: ".concat(e)),Qi(e)){var o=new ta(t.context,e).toMidi();i[o]=r.urls[e]}else Wi(n)&&isFinite(n)&&(i[n]=r.urls[n])})),t._buffers=new _a({urls:i,onload:r.onload,baseUrl:r.baseUrl,onerror:r.onerror}),t.attack=r.attack,t.release=r.release,t.curve=r.curve,t._buffers.loaded&&Promise.resolve().then(r.onload),t}return Object(I.a)(n,[{key:"_findClosest",value:function(t){for(var e=0;e<96;){if(this._buffers.has(t+e))return-e;if(this._buffers.has(t-e))return e;e++}throw new Error("No available buffers for note: ".concat(t))}},{key:"triggerAttack",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.log("triggerAttack",t,e,r),Array.isArray(t)||(t=[t]),t.forEach((function(t){var i=Jo(new ta(n.context,t).toFrequency()),o=Math.round(i),a=i-o,s=n._findClosest(o),u=o-s,c=n._buffers.get(u),l=Xo(s+a),h=new ja({url:c,context:n.context,curve:n.curve,fadeIn:n.attack,fadeOut:n.release,playbackRate:l}).connect(n.output);h.start(e,0,c.duration/l,r),Xi(n._activeSources.get(o))||n._activeSources.set(o,[]),n._activeSources.get(o).push(h),h.onended=function(){if(n._activeSources&&n._activeSources.has(o)){var t=n._activeSources.get(o),e=t.indexOf(h);-1!==e&&t.splice(e,1)}}})),this}},{key:"triggerRelease",value:function(t,e){var n=this;return this.log("triggerRelease",t,e),Array.isArray(t)||(t=[t]),t.forEach((function(t){var r=new ta(n.context,t).toMidi();if(n._activeSources.has(r)&&n._activeSources.get(r).length){var i=n._activeSources.get(r);e=n.toSeconds(e),i.forEach((function(t){t.stop(e)})),n._activeSources.set(r,[])}})),this}},{key:"releaseAll",value:function(t){var e=this.toSeconds(t);return this._activeSources.forEach((function(t){for(;t.length;){t.shift().stop(e)}})),this}},{key:"sync",value:function(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}},{key:"triggerAttackRelease",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=this.toSeconds(n);return this.triggerAttack(t,o,i),Xi(e)?(Li(Xi(t),"notes must be an array when duration is array"),t.forEach((function(t,n){var i=e[Math.min(n,e.length-1)];r.triggerRelease(t,o+r.toSeconds(i))}))):this.triggerRelease(t,o+this.toSeconds(e)),this}},{key:"add",value:function(t,e,n){if(Li(Qi(t)||isFinite(t),"note must be a pitch or midi: ".concat(t)),Qi(t)){var r=new ta(this.context,t).toMidi();this._buffers.add(r,e,n)}else this._buffers.add(t,e,n);return this}},{key:"loaded",get:function(){return this._buffers.loaded}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dis
2pose",this).call(this),this._buffers.dispose(),this._activeSources.forEach((function(t){t.forEach((function(t){return t.dispose()}))})),this._activeSources.clear(),this}}],[{key:"getDefaults",value:function(){return Object.assign(Za.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:Lo,onerror:Lo,release:.1,urls:{}})}}]),n}(Za);ro([Xa(0)],ss.prototype,"attack",void 0),ro([Xa(0)],ss.prototype,"release",void 0);var us=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,Object.assign(po(n.getDefaults(),arguments,["pan"])))).name="Panner",t._panner=t.context.createStereoPanner(),t.input=t._panner,t.output=t._panner;var r=po(n.getDefaults(),arguments,["pan"]);return t.pan=new aa({context:t.context,param:t._panner.pan,value:r.pan,minValue:-1,maxValue:1}),t._panner.channelCount=r.channelCount,t._panner.channelCountMode="explicit",Ro(Object(H.a)(t),"pan"),t}return Object(I.a)(n,[{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._panner.disconnect(),this.pan.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{pan:0,channelCount:1})}}]),n}(sa),cs="bit-crusher";os(cs,"\n\tclass BitCrusherWorklet extends SingleIOProcessor {\n\n\t\tstatic get parameterDescriptors() {\n\t\t\treturn [{\n\t\t\t\tname: \"bits\",\n\t\t\t\tdefaultValue: 12,\n\t\t\t\tminValue: 1,\n\t\t\t\tmaxValue: 16,\n\t\t\t\tautomationRate: 'k-rate'\n\t\t\t}];\n\t\t}\n\n\t\tgenerate(input, _channel, parameters) {\n\t\t\tconst step = Math.pow(0.5, parameters.bits - 1);\n\t\t\tconst val = step * Math.floor(input / step + 0.5);\n\t\t\treturn val;\n\t\t}\n\t}\n");var ls=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["solo"]))).name="Solo";var r=po(n.getDefaults(),arguments,["solo"]);return t.input=t.output=new ha({context:t.context}),n._allSolos.has(t.context)||n._allSolos.set(t.context,new Set),n._allSolos.get(t.context).add(Object(H.a)(t)),t.solo=r.solo,t}return Object(I.a)(n,[{key:"solo",get:function(){return this._isSoloed()},set:function(t){t?this._addSolo():this._removeSolo(),n._allSolos.get(this.context).forEach((function(t){return t._updateSolo()}))}},{key:"muted",get:function(){return 0===this.input.gain.value}},{key:"_addSolo",value:function(){n._soloed.has(this.context)||n._soloed.set(this.context,new Set),n._soloed.get(this.context).add(this)}},{key:"_removeSolo",value:function(){n._soloed.has(this.context)&&n._soloed.get(this.context).delete(this)}},{key:"_isSoloed",value:function(){return n._soloed.has(this.context)&&n._soloed.get(this.context).has(this)}},{key:"_noSolos",value:function(){return!n._soloed.has(this.context)||n._soloed.has(this.context)&&0===n._soloed.get(this.context).size}},{key:"_updateSolo",value:function(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),n._allSolos.get(this.context).delete(this),this._removeSolo(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{solo:!1})}}]),n}(sa);ls._allSolos=new Map,ls._soloed=new Map;var hs=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["pan","volume"]))).name="PanVol";var r=po(n.getDefaults(),arguments,["pan","volume"]);return t._panner=t.input=new us({context:t.context,pan:r.pan,channelCount:r.channelCount}),t.pan=t._panner.pan,t._volume=t.output=new Sa({context:t.context,volume:r.volume}),t.volume=t._volume.volume,t._panner.connect(t._volume),t.mute=r.mute,Ro(Object(H.a)(t),["pan","volume"]),t}return Object(I.a)(n,[{key:"mute",get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}}]),n}(sa);(function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;Object(a.a)(this,n),(t=e.call(this,po(n.getDefaults(),arguments,["volume","pan"]))).name="Channel";var r=po(n.getDefaults(),arguments,["volume","pan"]);return t._solo=t.input=new ls({solo:r.solo,context:t.context}),t._panVol=t.output=new hs({context:t.context,pan:r.pan,volume:r.volume,mute:r.mute,channelCount:r.channelCount}),t.pan=t._panVol.pan,t.volume=t._panVol.volume,t._solo.connect(t._panVol),Ro(Object(H.a)(t),["pan","volume"]),t}return Object(I.a)(n,[{key:"solo",get:function(){return this._solo.solo}
2,set:function(t){this._solo.solo=t}},{key:"muted",get:function(){return this._solo.muted||this.mute}},{key:"mute",get:function(){return this._panVol.mute},set:function(t){this._panVol.mute=t}},{key:"_getBus",value:function(t){return n.buses.has(t)||n.buses.set(t,new ha({context:this.context})),n.buses.get(t)}},{key:"send",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this._getBus(t),r=new ha({context:this.context,units:"decibels",gain:e});return this.connect(r),r.connect(n),r}},{key:"receive",value:function(t){return this._getBus(t).connect(this),this}},{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}}]),n}(sa)).buses=new Map;var fs=function(t){Object(j.a)(n,t);var e=Object(P.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.apply(this,arguments)).name="Listener",t.positionX=new aa({context:t.context,param:t.context.rawContext.listener.positionX}),t.positionY=new aa({context:t.context,param:t.context.rawContext.listener.positionY}),t.positionZ=new aa({context:t.context,param:t.context.rawContext.listener.positionZ}),t.forwardX=new aa({context:t.context,param:t.context.rawContext.listener.forwardX}),t.forwardY=new aa({context:t.context,param:t.context.rawContext.listener.forwardY}),t.forwardZ=new aa({context:t.context,param:t.context.rawContext.listener.forwardZ}),t.upX=new aa({context:t.context,param:t.context.rawContext.listener.upX}),t.upY=new aa({context:t.context,param:t.context.rawContext.listener.upY}),t.upZ=new aa({context:t.context,param:t.context.rawContext.listener.upZ}),t}return Object(I.a)(n,[{key:"dispose",value:function(){return Object(eo.a)(Object(no.a)(n.prototype),"dispose",this).call(this),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}],[{key:"getDefaults",value:function(){return Object.assign(sa.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}}]),n}(sa);Oo((function(t){t.listener=new fs({context:t})})),Co((function(t){t.listener.dispose()}));var ds=Vo().transport;Vo().destination,Vo().destination;Vo().listener;Vo().draw;Vo()},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(107);t.exports=function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(40),i=n(108),o=n(109);t.exports=function(t){var e=i();return function(){var n,i=r(t);if(e){var a=r(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return o(this,n)}}},function(t,e,n){!function(t,e,n,r){"use strict";function i(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var o=i(e),a=i(n),s=i(r),u=function(t,e,n){return{endTime:e,insertTime:n,type:"exponentialRampToValue",value:t}},c=function(t,e,n){return{endTime:e,insertTime:n,type:"linearRampToValue",value:t}},l=function(t,e){return{startTime:e,type:"setValue",value:t}},h=function(t,e,n){return{duration:n,startTime:e,type:"setValueCurve",values:t}},f=function(t,e,n){var r=n.startTime,i=n.target,o=n.timeConstant;return i+(e-i)*Math.exp((r-t)/o)},d=function(t){return"exponentialRampToValue"===t.type},p=function(t){return"linearRampToValue"===t.type},v=function(t){return d(t)||p(t)},m=function(t){return"setValue"===t.type},g=function(t){return"setValueCurve"===t.type},y=function t(e,n,r,i){var o=e[n];return void 0===o?i:v(o)||m(o)?o.value:g(o)?o.values[o.values.length-1]:f(r,t(e,n-1,o.startTime,i),o)},b=function(t,e,n,r,i){return void 0===n?[r.insertTime,i]:v(n)?[n.endTime,n.value]:m(n)?[n.startTime,n.value]:g(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,y(t,e-1,n.startTime,i)]},_=function(t){return"cancelAndHold"===t.type},w=function(t){return"cancelScheduledValues"===t.type},x=function(t){return _(t)||w(t)?t.cancelTime:d(t)||p(t)?t.endTime:t.startTime},T=function(t,e,n,r){var i=r.endTime,o=r.value;return n===o?o:0<n&&0<o||n<0&&o<0?n*Math.pow(o/n,(t-e)/(i-e)):0},E=function(t,e,n,r){return n+(t-e)/(r.endTime-e)*(r.value-n)},S=function(t,e){var n=Math.floor(e),r=Math.ceil(e);return n===r?t[n]:(1-(e-n))*t[n]+(1-(r-e))*t[r]},O=function(t,e){var n=e.duration,r=e.startTime,i=e.values,o=(t-r)/n*(i.length-1);return S(i,o)},k=function(t){return"setTarget"===t.type},C=function(){function t(e){a.default(this,t),this._automationEvents=[],this._currenTime=0,this._defaultValue=e}return s.default(t,[{key:Symbol.iterator,value:function(){return this._automationEvents[Symbol.iterator]()}},{key:"add",value:function(t){var e=x(t);if(_(t)||w(t)){var n=this._automationEvents.findIndex((function(n){return w(t)&&g(n)?n.startTime+n.duration>=e:x(n)>=e})),r=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),_(t)){var i=this._automationEvents[this._automationEvents.length-1];if(void 0!==r&&v(r)){if(k(i))throw new Error("The internal list is malformed.");var o=g(i)?i.startTime+i.duration:x(i),a=g(i)?i.values[i.values.length-1]:i.value,s=d(r)?T(e,o,a,r):E(e,o,a,r),f=d(r)?u(s,e,this._currenTime):c(s,e,this._currenTime);this._automationEvents.push(f)}void 0!==i&&k(i)&&this._automationEvents.push(l(this.getValue(e),e)),void 0!==i&&g(i)&&i.startTime+i.duration>e&&(this._automationEvents[this._automationEvents.length-1]=h(new Float32Array([6,7]),i.startTime,e-i.startTime))}}else{var m=this._automationEvents.findIndex((function(t){return x(t)>e})),y=-1===m?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[m-1];if(void 0!==y&&g(y)&&x(y)+y.duration>e)return!1;var b=d(t)?u(t.value,t.endTime,this._currenTime):p(t)?c(t.value,e,this._currenTime):t;if(-1===m)this._automationEvents.push(b);else{if(g(t)&&e+t.duration>x(this._automationEvents[m]))return!1;this._automationEvents.splice(m,0,b)}}return!0}},{key:"flush",value:function(t){var e=this._automationEvents.findIndex((function(e){return x(e)>t}));if(e>1){var n=this._automationEvents.slice(e-1),r=n[0];k(r)&&n.unshift(l(y(this._automationEvents,e-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(t){if(0===this._automationEvents.length)return this._defaultValue;var e=this._automationEvents.findIndex((function(e){return x(e)>t})),n=this._automationEvents[e],r=(-1===e?this._automationEvents.length:e)-1,i=this._automationEvents[r];if(void 0!==i&&k(i)&&(void 0===n||!v(n)||n.insertTime>t))return f(t,y(this._automationEvents,r-1,i.startTime,this._defaultValue),i);if(void 0!==i&&m(i)&&(void 0===n||!v(n)))return i.value;if(void 0!==i&&g(i)&&(void 0===n||!v(n)||i.startTime+i.duration>t))return t<i.startTime+i.duration?O(t,i):i.values[i.values.length-1];if(void 0!==i&&v(i)&&(void 0===n||!v(n)))return i.value;if(void 0!==n&&d(n)){var a=b(this._automationEvents,r,i,n,this._defaultValue),s=o.default(a,2),u=s[0],c=s[1];return T(t,u,c,n)}if(void 0!==n&&p(n)){var l=b(this._automationEvents,r,i,n,this._defaultValue),h=o.default(l,2),_=h[0],w=h[1];return E(t,_,w,n)}return this._defaultValue}}]),t}(),M=function(t){return{cancelTime:t,type:"cancelAndHold"}},A=function(t){return{cancelTime:t,type:"cancelScheduledValues"}},I=function(t,e){return{endTime:e,type:"exponentialRampToValue",value:t}},j=function(t,e){return{endTime:e,type:"linearRampToValue",value:t}},P=function(t,e,n){return{startTime:e,target:t,timeConstant:n,type:"setTarget"}};t.AutomationEventList=C,t.createCancelAndHoldAutomationEvent=M,t.createCancelScheduledValuesAutomationEvent=A,t.createExponentialRampToValueAutomationEvent=I,t.createLinearRampToValueAutomationEvent=j,t.createSetTargetAutomationEvent=P,t.createSetValueAutomationEvent=l,t.createSetValueCurveAutomationEvent=h,Object.defineProperty(t,"__esMo
2dule",{value:!0})}(e,n(133),n(139),n(140))},function(t,e,n){(function(r){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(n){}},e.load=function(){var t;try{t=e.storage.getItem("debug")}catch(n){}!t&&"undefined"!==typeof r&&"env"in r&&(t=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).DEBUG);return t},e.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=function(){var t=!1;return function(){t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||function(){},t.exports=n(101)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(54))},function(t,e,n){!function(t){"use strict";function e(t){return Array.prototype.slice.call(t)}function n(t){return new Promise((function(e,n){t.onsuccess=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function r(t,e,r){var i,o=new Promise((function(o,a){n(i=t[e].apply(t,r)).then(o,a)}));return o.request=i,o}function i(t,e,n){var i=r(t,e,n);return i.then((function(t){if(t)return new l(t,i.request)}))}function o(t,e,n){n.forEach((function(n){Object.defineProperty(t.prototype,n,{get:function(){return this[e][n]},set:function(t){this[e][n]=t}})}))}function a(t,e,n,i){i.forEach((function(i){i in n.prototype&&(t.prototype[i]=function(){return r(this[e],i,arguments)})}))}function s(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return this[e][r].apply(this[e],arguments)})}))}function u(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return i(this[e],r,arguments)})}))}function c(t){this._index=t}function l(t,e){this._cursor=t,this._request=e}function h(t){this._store=t}function f(t){this._tx=t,this.complete=new Promise((function(e,n){t.oncomplete=function(){e()},t.onerror=function(){n(t.error)},t.onabort=function(){n(t.error)}}))}function d(t,e,n){this._db=t,this.oldVersion=e,this.transaction=new f(n)}function p(t){this._db=t}function v(t,e,n){var i=r(indexedDB,"open",[t,e]),o=i.request;return o&&(o.onupgradeneeded=function(t){n&&n(new d(o.result,t.oldVersion,o.transaction))}),i.then((function(t){return new p(t)}))}function m(t){return r(indexedDB,"deleteDatabase",[t])}o(c,"_index",["name","keyPath","multiEntry","unique"]),a(c,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),u(c,"_index",IDBIndex,["openCursor","o
2penKeyCursor"]),o(l,"_cursor",["direction","key","primaryKey","value"]),a(l,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(t){t in IDBCursor.prototype&&(l.prototype[t]=function(){var e=this,r=arguments;return Promise.resolve().then((function(){return e._cursor[t].apply(e._cursor,r),n(e._request).then((function(t){if(t)return new l(t,e._request)}))}))})})),h.prototype.createIndex=function(){return new c(this._store.createIndex.apply(this._store,arguments))},h.prototype.index=function(){return new c(this._store.index.apply(this._store,arguments))},o(h,"_store",["name","keyPath","indexNames","autoIncrement"]),a(h,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),u(h,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),s(h,"_store",IDBObjectStore,["deleteIndex"]),f.prototype.objectStore=function(){return new h(this._tx.objectStore.apply(this._tx,arguments))},o(f,"_tx",["objectStoreNames","mode"]),s(f,"_tx",IDBTransaction,["abort"]),d.prototype.createObjectStore=function(){return new h(this._db.createObjectStore.apply(this._db,arguments))},o(d,"_db",["name","version","objectStoreNames"]),s(d,"_db",IDBDatabase,["deleteObjectStore","close"]),p.prototype.transaction=function(){return new f(this._db.transaction.apply(this._db,arguments))},o(p,"_db",["name","version","objectStoreNames"]),s(p,"_db",IDBDatabase,["close"]),["openCursor","o
2penKeyCursor"].forEach((function(t){[h,c].forEach((function(n){t in n.prototype&&(n.prototype[t.replace("open","iterate")]=function(){var n=e(arguments),r=n[n.length-1],i=this._store||this._index,o=i[t].apply(i,n.slice(0,-1));o.onsuccess=function(){r(o.result)}})}))})),[c,h].forEach((function(t){t.prototype.getAll||(t.prototype.getAll=function(t,e){var n=this,r=[];return new Promise((function(i){n.iterateCursor(t,(function(t){t?(r.push(t.value),void 0===e||r.length!=e?t.continue():i(r)):i(r)}))}))})})),t.openDb=v,t.deleteDb=m,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.d(e,"a",(function(){return o}));var i=n(10);function o(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?Object(i.a)(t):e}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(48);function i(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return g}));var r=n(24),i=n(28),o=n(13),a=n.n(o),s=n(29),u=(n(19),n(25)),c=n(38),l=n(27),h=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).history=Object(s.a)(e.props),e}return Object(i.a)(e,t),e.prototype.render=function(){return a.a.createElement(r.b,{history:this.history,children:this.props.children})},e}(a.a.Component);a.a.Component;var f=function(t,e){return"function"===typeof t?t(e):t},d=function(t,e){return"string"===typeof t?Object(s.c)(t,null,null,e):t},p=function(t){return t},v=a.a.forwardRef;"undefined"===typeof v&&(v=p);var m=v((function(t,e){var n=t.innerRef,r=t.navigate,i=t.onClick,o=Object(c.a)(t,["innerRef","navigate","onClick"]),s=o.target,l=Object(u.a)({},o,{onClick:function(t){try{i&&i(t)}catch(e){throw t.preventDefault(),e}t.defaultPrevented||0!==t.button||s&&"_self"!==s||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||(t.preventDefault(),r())}});return l.ref=p!==v&&e||n,a.a.createElement("a",l)}));var g=v((function(t,e){var n=t.component,i=void 0===n?m:n,o=t.replace,s=t.to,h=t.innerRef,g=Object(c.a)(t,["component","replace","to","innerRef"]);return a.a.createElement(r.d.Consumer,null,(function(t){t||Object(l.a)(!1);var n=t.history,r=d(f(s,t.location),t.location),c=r?n.createHref(r):"",m=Object(u.a)({},g,{href:c,navigate:function(){var e=f(s,t.location);(o?n.replace:n.push)(e)}});return p!==v?m.ref=e||h:m.innerRef=h,a.a.createElement(i,m)}))})),y=function(t){return t},b=a.a.forwardRef;"undefined"===typeof b&&(b=y);b((function(t,e){var n=t["aria-current"],i=void 0===n?"page":n,o=t.activeClassName,s=void 0===o?"active":o,h=t.activeStyle,p=t.className,v=t.exact,m=t.isActive,_=t.location,w=t.sensitive,x=t.strict,T=t.style,E=t.to,S=t.innerRef,O=Object(c.a)(t,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a.a.createElement(r.d.Consumer,null,(function(t){t||Object(l.a)(!1);var n=_||t.location,o=d(f(E,n),n),c=o.pathname,k=c&&c.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),C=k?Object(r.e)(n.pathname,{path:k,exact:v,sensitive:w,strict:x}):null,M=!!(m?m(C,n):C),A=M?function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter((function(t){return t})).join(" ")}(p,s):p,I=M?Object(u.a)({},T,{},h):T,j=Object(u.a)({"aria-current":M&&i||null,className:A,style:I,to:o},O);return y!==b?j.ref=e||S:j.innerRef=S,a.a.createElement(g,j)}
2))}))},function(t,e,n){"use strict";var r=n(15);n.d(e,"a",(function(){return r.a}));r.a.registerVersion("firebase","8.3.0","app")},function(t,e,n){"use strict";n.d(e,"a",(function(){return i.a}));var r,i=n(15),o=(n(62),n(148),n(80),n(21)),a=n(7),s=(n(26),n(23));(r=s.e).prototype.loadBundle=s.l,r.prototype.namedQuery=s.t;var u=n(0),c=n(22),l={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},h=function(t){function e(n,r,i){var o=t.call(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o.code=n,o.details=i,o}return Object(u.c)(e,t),e}(Error);var f=function(){function t(t,e){var n=this;this.auth=null,this.messaging=null,this.auth=t.getImmediate({optional:!0}),this.messaging=e.getImmediate({optional:!0}),this.auth||t.get().then((function(t){return n.auth=t}),(function(){})),this.messaging||e.get().then((function(t){return n.messaging=t}),(function(){}))}return t.prototype.getAuthToken=function(){return Object(u.b)(this,void 0,void 0,(function(){var t;return Object(u.d)(this,(function(e){switch(e.label){case 0:if(!this.auth)return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.auth.getToken()];case 2:return(t=e.sent())?[2,t.accessToken]:[2,void 0];case 3:return e.sent(),[2,void 0];case 4:return[2]}}
2))}))},t.prototype.getInstanceIdToken=function(){return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(t){if(!this.messaging||!("Notification"in self)||"granted"!==Notification.permission)return[2,void 0];try{return[2,this.messaging.getToken()]}catch(e){return[2,void 0]}return[2]}))}))},t.prototype.getContext=function(){return Object(u.b)(this,void 0,void 0,(function(){var t,e;return Object(u.d)(this,(function(n){switch(n.label){case 0:return[4,this.getAuthToken()];case 1:return t=n.sent(),[4,this.getInstanceIdToken()];case 2:return e=n.sent(),[2,{authToken:t,instanceIdToken:e}]}}))}))},t}();function d(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}var p=function(){function t(){}return t.prototype.encode=function(t){var e=this;if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"===typeof t&&isFinite(t))return t;if(!0===t||!1===t)return t;if("[object String]"===Object.prototype.toString.call(t))return t;if(Array.isArray(t))return t.map((function(t){return e.encode(t)}));if("function"===typeof t||"object"===typeof t)return d(t,(function(t){return e.encode(t)}));throw new Error("Data cannot be encoded in JSON: "+t)},t.prototype.decode=function(t){var e=this;if(null==t)return t;if(t["@type"])switch(t["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":var n=Number(t.value);if(isNaN(n))throw new Error("Data cannot be decoded from JSON: "+t);return n;default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map((function(t){return e.decode(t)})):"function"===typeof t||"object"===typeof t?d(t,(function(t){return e.decode(t)})):t},t}();var v=function(){function t(t,e,n,r,i){var o=this;void 0===r&&(r="us-central1"),this.app_=t,this.fetchImpl=i,this.serializer=new p,this.emulatorOrigin=null,this.INTERNAL={delete:function(){return Promise.resolve(o.deleteService())}},this.contextProvider=new f(e,n),this.cancelAllRequests=new Promise((function(t){o.deleteService=function(){return t()}}));try{var a=new URL(r);this.customDomain=a.origin,this.region="us-central1"}catch(s){this.customDomain=null,this.region=r}}return Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!1,configurable:!0}),t.prototype._url=function(t){var e=this.app_.options.projectId;return null!==this.emulatorOrigin?this.emulatorOrigin+"/"+e+"/"+this.region+"/"+t:null!==this.customDomain?this.customDomain+"/"+t:"https://"+this.region+"-"+e+".cloudfunctions.net/"+t},t.prototype.useEmulator=function(t,e){this.emulatorOrigin="http://"+t+":"+e},t.prototype.useFunctionsEmulator=function(t){this.emulatorOrigin=t},t.prototype.httpsCallable=function(t,e){var n=this;return function(r){return n.call(t,r,e||{})}},t.prototype.postJSON=function(t,e,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i;return Object(u.d)(this,(function(o){switch(o.label){case 0:n["Content-Type"]="application/json",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.fetchImpl(t,{method:"POST",body:JSON.stringify(e),headers:n})];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),[2,{status:0,json:null}];case 4:i=null,o.label=5;case 5:return o.trys.push([5,7,,8]),[4,r.json()];case 6:return i=o.sent(),[3,8];case 7:return o.sent(),[3,8];case 8:return[2,{status:r.status,json:i}]}}))}))},t.prototype.call=function(t,e,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a,s,c,f,d,p,v,g;return Object(u.d)(this,(function(u){switch(u.label){case 0:return r=this._url(t),e=this.serializer.encode(e),i={data:e},o={},[4,this.contextProvider.getContext()];case 1:return(a=u.sent()).authToken&&(o.Authorization="Bearer "+a.authToken),a.instanceIdToken&&(o["Firebase-Instance-ID-Token"]=a.instanceIdToken),s=n.timeout||7e4,c=function(t){var e,n=new Promise((function(n,r){e=setTimeout((function(){r(new h("deadline-exceeded","deadline-exceeded"))}),t)}));return{timer:e,promise:n}}(s),f=c.timer,d=c.promise,[4,Promise.race([m(f,this.postJSON(r,i,o)),d,m(f,this.cancelAllRequests)])];case 2:if(!(p=u.sent()))throw new h("cancelled","Firebase Functions instance was deleted.");
2if(v=function(t,e,n){var r=function(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(t),i=r,o=void 0;try{var a=e&&e.error;if(a){var s=a.status;if("string"===typeof s){if(!l[s])return new h("internal","internal");r=l[s],i=s}var u=a.message;"string"===typeof u&&(i=u),void 0!==(o=a.details)&&(o=n.decode(o))}}catch(c){}return"ok"===r?null:new h(r,i,o)}(p.status,p.json,this.serializer))throw v;if(!p.json)throw new h("internal","Response is not valid JSON object.");if("undefined"===typeof(g=p.json.data)&&(g=p.json.result),"undefined"===typeof g)throw new h("internal","Response is missing data field.");return[2,{data:this.serializer.decode(g)}]}}))}))},t}();function m(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return n=r.sent(),clearTimeout(t),[2,n]}}))}))}!function(t,e){var n={Functions:v};t.INTERNAL.registerComponent(new c.a("functions",(function(t,n){var r=t.getProvider("app").getImmediate(),i=t.getProvider("auth-internal"),o=t.getProvider("messaging");return new v(r,i,o,n,e)}),"PUBLIC").setServiceProps(n).setMultipleInstances(!0))}(i.a,fetch.bind(self)),i.a.registerVersion("@firebase/functions","0.6.3");var g,y=n(37),b="0.4.21",_=1e4,w="w:0.4.21",x="FIS_v2",T=36e5,E=((g={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',g["not-registered"]="Firebase Installation is not registered.",g["installation-not-found"]="Firebase Installation not found.",g["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',g["app-offline"]="Could not process request. Application offline.",g["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",g),S=new a.b("installations","Installations",E);function O(t){return t instanceof a.c&&t.code.includes("request-failed")}function k(t){return"https://firebaseinstallations.googleapis.com/v1/projects/"+t.projectId+"/installations"}function C(t){return{token:t.token,requestStatus:2,expiresIn:(e=t.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()};var e}function M(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[4,e.json()];case 1:return n=i.sent(),r=n.error,[2,S.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})]}}))}))}function A(t){var e=t.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function I(t,e){var n=e.refreshToken,r=A(t);return r.append("Authorization",function(t){return"FIS_v2 "+t}(n)),r}function j(t){return Object(u.b)(this,void 0,void 0,(function(){var e;return Object(u.d)(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return(e=n.sent()).status>=500&&e.status<600?[2,t()]:[2,e]}}))}))}function P(t,e){var n=e.fid;return Object(u.b)(this,void 0,void 0,(function(){var e,r,i,o,a,s;return Object(u.d)(this,(function(u){switch(u.label){case 0:return e=k(t),r=A(t),i={fid:n,authVersion:x,appId:t.appId,sdkVersion:w},o={method:"POST",headers:r,body:JSON.stringify(i)},[4,j((function(){return fetch(e,o)}))];case 1:return(a=u.sent()).ok?[4,a.json()]:[3,3];case 2:return s=u.sent(),[2,{fid:s.fid||n,registrationStatus:2,refreshToken:s.refreshToken,authToken:C(s.authToken)}];case 3:return[4,M("Create Installation",a)];case 4:throw u.sent()}}))}))}function R(t){return new Promise((function(e){setTimeout(e,t)}))}var N=/^[cdef][\w-]{21}$/;function L(){try{var t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;var e=function(t){return(e=t,btoa(String.fromCharCode.apply(String,Object(u.f)([],Object(u.e)(e)))).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);var e}(t);return N.test(e)?e:""}catch(n){return""}}function D(t){return t.appName+"!"+t.appId}var F=new Map;function U(t,e){var n=D(t);B(n,e),function(t,e){var n=z();n&&n.postMessage({key:t,fid:e});H()}(n,e)}function B(t,e){var n,r,i=F.get(t);if(i)try{for(var o=Object(u.g)(i),a=o.next();!a.done;a=o.next()){(0,a.value)(e)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}var V=null;function z(){return!V&&"BroadcastChannel"in self&&((V=new BroadcastChannel("[Firebase] FID Change")).onmessage=function(t){B(t.data.key,t.data.fid)}),V}function H(){0===F.size&&V&&(V.close(),V=null)}var q,W,G="firebase-installations-store",Y=null;function X(){return Y||(Y=Object(y.openDb)("firebase-installations-database",1,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(G)}}))),Y}function K(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i,o,a;return Object(u.d)(this,(function(s){switch(s.label){case 0:return n=D(t),[4,X()];case 1:return r=s.sent(),i=r.transaction(G,"readwrite"),[4,(o=i.objectStore(G)).get(n)];case 2:return a=s.sent(),[4,o.put(e,n)];case 3:return s.sent(),[4,i.complete];
2case 4:return s.sent(),a&&a.fid===e.fid||U(t,e.fid),[2,e]}}))}))}function Q(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return e=D(t),[4,X()];case 1:return n=i.sent(),[4,(r=n.transaction(G,"readwrite")).objectStore(G).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function J(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i,o,a,s;return Object(u.d)(this,(function(u){switch(u.label){case 0:return n=D(t),[4,X()];case 1:return r=u.sent(),i=r.transaction(G,"readwrite"),[4,(o=i.objectStore(G)).get(n)];case 2:return a=u.sent(),void 0!==(s=e(a))?[3,4]:[4,o.delete(n)];case 3:return u.sent(),[3,6];case 4:return[4,o.put(s,n)];case 5:u.sent(),u.label=6;case 6:return[4,i.complete];case 7:return u.sent(),!s||a&&a.fid===s.fid||U(t,s.fid),[2,s]}}))}))}function Z(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[4,J(t,(function(n){var r=function(t){return et(t||{fid:L(),registrationStatus:0})}(n),i=function(t,e){if(0===e.registrationStatus){if(!navigator.onLine)return{installationEntry:e,registrationPromise:Promise.reject(S.create("app-offline"))};var n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()};return{installationEntry:n,registrationPromise:function(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,7]),[4,P(t,e)];case 1:return n=i.sent(),[2,K(t,n)];case 2:return O(r=i.sent())&&409===r.customData.serverCode?[4,Q(t)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,K(t,{fid:e.fid,registrationStatus:0})];case 5:i.sent(),i.label=6;case 6:throw r;case 7:return[2]}}
2))}))}(t,n)}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:$(t)}:{installationEntry:e}}(t,r);return e=i.registrationPromise,i.installationEntry}))];case 1:return""!==(n=i.sent()).fid?[3,3]:(r={},[4,e]);case 2:return[2,(r.installationEntry=i.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:e}]}}))}))}function $(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r,i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return[4,tt(t)];case 1:e=o.sent(),o.label=2;case 2:return 1!==e.registrationStatus?[3,5]:[4,R(100)];case 3:return o.sent(),[4,tt(t)];case 4:return e=o.sent(),[3,2];case 5:return 0!==e.registrationStatus?[3,7]:[4,Z(t)];case 6:return n=o.sent(),r=n.installationEntry,(i=n.registrationPromise)?[2,i]:[2,r];case 7:return[2,e]}}))}))}function tt(t){return J(t,(function(t){if(!t)throw S.create("installation-not-found");return et(t)}))}function et(t){return 1===(e=t).registrationStatus&&e.registrationTime+_<Date.now()?{fid:t.fid,registrationStatus:0}:t;var e}function nt(t,e){var n=t.appConfig,r=t.platformLoggerProvider;return Object(u.b)(this,void 0,void 0,(function(){var t,i,o,a,s,c,l;return Object(u.d)(this,(function(u){switch(u.label){case 0:return t=function(t,e){var n=e.fid;return k(t)+"/"+n+"/authTokens:generate"}(n,e),i=I(n,e),(o=r.getImmediate({optional:!0}))&&i.append("x-firebase-client",o.getPlatformInfoString()),a={installation:{sdkVersion:w}},s={method:"POST",headers:i,body:JSON.stringify(a)},[4,j((function(){return fetch(t,s)}))];case 1:return(c=u.sent()).ok?[4,c.json()]:[3,3];case 2:return l=u.sent(),[2,C(l)];case 3:return[4,M("Generate Auth Token",c)];case 4:throw u.sent()}}))}))}function rt(t,e){return void 0===e&&(e=!1),Object(u.b)(this,void 0,void 0,(function(){var n,r,i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return[4,J(t.appConfig,(function(r){if(!ot(r))throw S.create("not-registered");var i=r.authToken;if(!e&&function(t){return 2===t.requestStatus&&!function(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+T}(t)}(i))return r;if(1===i.requestStatus)return n=function(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[4,it(t.appConfig)];case 1:n=i.sent(),i.label=2;case 2:return 1!==n.authToken.requestStatus?[3,5]:[4,R(100)];case 3:return i.sent(),[4,it(t.appConfig)];case 4:return n=i.sent(),[3,2];case 5:return 0===(r=n.authToken).requestStatus?[2,rt(t,e)]:[2,r]}}))}))}(t,e),r;if(!navigator.onLine)throw S.create("app-offline");var o=function(t){var e={requestStatus:1,requestTime:Date.now()};return Object(u.a)(Object(u.a)({},t),{authToken:e})}(r);return n=function(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,8]),[4,nt(t,e)];case 1:return n=o.sent(),i=Object(u.a)(Object(u.a)({},e),{authToken:n}),[4,K(t.appConfig,i)];case 2:return o.sent(),[2,n];case 3:return!O(r=o.sent())||401!==r.customData.serverCode&&404!==r.customData.serverCode?[3,5]:[4,Q(t.appConfig)];case 4:return o.sent(),[3,7];case 5:return i=Object(u.a)(Object(u.a)({},e),{authToken:{requestStatus:0}}),[4,K(t.appConfig,i)];case 6:o.sent(),o.label=7;case 7:throw r;case 8:return[2]}}
2))}))}(t,o),o}))];case 1:return r=o.sent(),n?[4,n]:[3,3];case 2:return i=o.sent(),[3,4];case 3:i=r.authToken,o.label=4;case 4:return[2,i]}}))}))}function it(t){return J(t,(function(t){if(!ot(t))throw S.create("not-registered");var e,n=t.authToken;return 1===(e=n).requestStatus&&e.requestTime+_<Date.now()?Object(u.a)(Object(u.a)({},t),{authToken:{requestStatus:0}}):t}))}function ot(t){return void 0!==t&&2===t.registrationStatus}function at(t){return Object(u.b)(this,void 0,void 0,(function(){var e;return Object(u.d)(this,(function(n){switch(n.label){case 0:return[4,Z(t)];case 1:return(e=n.sent().registrationPromise)?[4,e]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}function st(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i,o;return Object(u.d)(this,(function(a){switch(a.label){case 0:return n=function(t,e){var n=e.fid;return k(t)+"/"+n}(t,e),r=I(t,e),i={method:"DELETE",headers:r},[4,j((function(){return fetch(n,i)}))];case 1:return(o=a.sent()).ok?[3,3]:[4,M("Delete Installation",o)];case 2:throw a.sent();case 3:return[2]}}
2))}))}function ut(t,e){var n=t.appConfig;return function(t,e){z();var n=D(t),r=F.get(n);r||(r=new Set,F.set(n,r)),r.add(e)}(n,e),function(){!function(t,e){var n=D(t),r=F.get(n);r&&(r.delete(e),0===r.size&&F.delete(n),H())}(n,e)}}function ct(t){return S.create("missing-app-config-values",{valueName:t})}(q=i.a).INTERNAL.registerComponent(new c.a("installations",(function(t){var e=t.getProvider("app").getImmediate(),n={appConfig:function(t){var e,n;if(!t||!t.options)throw ct("App Configuration");if(!t.name)throw ct("App Name");try{for(var r=Object(u.g)(["projectId","apiKey","appId"]),i=r.next();!i.done;i=r.next()){var o=i.value;if(!t.options[o])throw ct(o)}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e),platformLoggerProvider:t.getProvider("platform-logger")};return{app:e,getId:function(){return function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[4,Z(t.appConfig)];case 1:return e=i.sent(),n=e.installationEntry,(r=e.registrationPromise)?r.catch(console.error):rt(t).catch(console.error),[2,n.fid]}}))}))}(n)},getToken:function(t){return function(t,e){return void 0===e&&(e=!1),Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(n){switch(n.label){case 0:return[4,at(t.appConfig)];case 1:return n.sent(),[4,rt(t,e)];case 2:return[2,n.sent().token]}}))}))}(n,t)},delete:function(){return function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,J(e=t.appConfig,(function(t){if(!t||0!==t.registrationStatus)return t}))];case 1:if(!(n=r.sent()))return[3,6];if(1!==n.registrationStatus)return[3,2];throw S.create("delete-pending-registration");case 2:if(2!==n.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw S.create("app-offline");case 3:return[4,st(e,n)];case 4:return r.sent(),[4,Q(e)];case 5:r.sent(),r.label=6;case 6:return[2]}}
2))}))}(n)},onIdChange:function(t){return ut(n,t)}}}),"PUBLIC")),q.registerVersion("@firebase/installations",b);var lt,ht=((W={})["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',W["only-available-in-window"]="This method is available in a Window context.",W["only-available-in-sw"]="This method is available in a service worker context.",W["permission-default"]="The notification permission was not granted and dismissed instead.",W["permission-blocked"]="The notification permission was not granted and blocked instead.",W["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",W["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",W["token-subscribe-failed"]="A problem occurred while subscribing the user to FCM: {$errorInfo}",W["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",W["token-unsubscribe-failed"]="A problem occurred while unsubscribing the user from FCM: {$errorInfo}",W["token-update-failed"]="A problem occurred while updating the user from FCM: {$errorInfo}",W["token-update-no-token"]="FCM returned no token when updating the user to push.",W["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",W["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",W["invalid-bg-handler"]="The input to setBackgroundMessageHandler() must be a function.",W["invalid-vapid-key"]="The public VAPID key must be a string.",W["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",W),ft=new a.b("messaging","Messaging",ht),dt="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",pt="google.c.a.c_id";function vt(t){var e=new Uint8Array(t);return btoa(String.fromCharCode.apply(String,Object(u.f)([],Object(u.e)(e)))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mt(t){for(var e=(t+"=".repeat((4-t.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(e),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}!function(t){t.PUSH_RECEIVED="push-received",t.NOTIFICATION_CLICKED="notification-clicked"}(lt||(lt={}));var gt="fcm_token_details_db",yt="fcm_token_object_Store";function bt(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r=this;return Object(u.d)(this,(function(i){switch(i.label){case 0:return"databases"in indexedDB?[4,indexedDB.databases()]:[3,2];case 1:if(e=i.sent(),!e.map((function(t){return t.name})).includes(gt))return[2,null];i.label=2;case 2:return n=null,[4,Object(y.openDb)(gt,5,(function(e){return Object(u.b)(r,void 0,void 0,(function(){var r,i,o,a;return Object(u.d)(this,(function(s){switch(s.label){case 0:return e.oldVersion<2?[2]:e.objectStoreNames.contains(yt)?[4,(r=e.transaction.objectStore(yt)).index("fcmSenderId").get(t)]:[2];case 1:return i=s.sent(),[4,r.clear()];case 2:if(s.sent(),!i)return[2];if(2===e.oldVersion){if(!(o=i).auth||!o.p256dh||!o.endpoint)return[2];n={token:o.fcmToken,createTime:null!==(a=o.createTime)&&void 0!==a?a:Date.now(),subscriptionOptions:{auth:o.auth,p256dh:o.p256dh,endpoint:o.endpoint,swScope:o.swScope,vapidKey:"string"===typeof o.vapidKey?o.vapidKey:vt(o.vapidKey)}}}else(3===e.oldVersion||4===e.oldVersion)&&(n={token:(o=i).fcmToken,createTime:o.createTime,subscriptionOptions:{auth:vt(o.auth),p256dh:vt(o.p256dh),endpoint:o.endpoint,swScope:o.swScope,vapidKey:vt(o.vapidKey)}});return[2]}}))}))}))];case 3:return i.sent().close(),[4,Object(y.deleteDb)(gt)];case 4:return i.sent(),[4,Object(y.deleteDb)("fcm_vapid_details_db")];case 5:return i.sent(),[4,Object(y.deleteDb)("undefined")];case 6:return i.sent(),[2,_t(n)?n:null]}}))}))}function _t(t){if(!t||!t.subscriptionOptions)return!1;var e=t.subscriptionOptions;return"number"===typeof t.createTime&&t.createTime>0&&"string"===typeof t.token&&t.token.length>0&&"string"===typeof e.auth&&e.auth.length>0&&"string"===typeof e.p256dh&&e.p256dh.length>0&&"string"===typeof e.endpoint&&e.endpoint.length>0&&"string"===typeof e.swScope&&e.swScope.length>0&&"string"===typeof e.vapidKey&&e.vapidKey.length>0}var wt="firebase-messaging-store",xt=null;function Tt(){return xt||(xt=Object(y.openDb)("firebase-messaging-database",1,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(wt)}}))),xt}function Et(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return e=kt(t),[4,Tt()];case 1:return[4,i.sent().transaction(wt).objectStore(wt).get(e)];case 2:return(n=i.sent())?[2,n]:[3,3];case 3:return[4,bt(t.appConfig.senderId)];case 4:return(r=i.sent())?[4,St(t,r)]:[3,6];case 5:return i.sent(),[2,r];case 6:return[2]}}
2))}))}function St(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return n=kt(t),[4,Tt()];case 1:return r=o.sent(),[4,(i=r.transaction(wt,"readwrite")).objectStore(wt).put(e,n)];case 2:return o.sent(),[4,i.complete];case 3:return o.sent(),[2,e]}}))}))}function Ot(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return e=kt(t),[4,Tt()];case 1:return n=i.sent(),[4,(r=n.transaction(wt,"readwrite")).objectStore(wt).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function kt(t){return t.appConfig.appId}function Ct(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i,o,a,s;return Object(u.d)(this,(function(u){switch(u.label){case 0:return[4,jt(t)];case 1:n=u.sent(),r=Pt(e),i={method:"POST",headers:n,body:JSON.stringify(r)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(It(t.appConfig),i)];case 3:return[4,u.sent().json()];case 4:return o=u.sent(),[3,6];case 5:throw a=u.sent(),ft.create("token-subscribe-failed",{errorInfo:a});case 6:if(o.error)throw s=o.error.message,ft.create("token-subscribe-failed",{errorInfo:s});if(!o.token)throw ft.create("token-subscribe-no-token");return[2,o.token]}}))}))}function Mt(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i,o,a,s;return Object(u.d)(this,(function(u){switch(u.label){case 0:return[4,jt(t)];case 1:n=u.sent(),r=Pt(e.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)},u.label=2;case 2:return u.trys.push([2,5,,6]),[4,fetch(It(t.appConfig)+"/"+e.token,i)];case 3:return[4,u.sent().json()];case 4:return o=u.sent(),[3,6];case 5:throw a=u.sent(),ft.create("token-update-failed",{errorInfo:a});case 6:if(o.error)throw s=o.error.message,ft.create("token-update-failed",{errorInfo:s});if(!o.token)throw ft.create("token-update-no-token");return[2,o.token]}}))}))}function At(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i,o,a;return Object(u.d)(this,(function(s){switch(s.label){case 0:return[4,jt(t)];case 1:n=s.sent(),r={method:"DELETE",headers:n},s.label=2;case 2:return s.trys.push([2,5,,6]),[4,fetch(It(t.appConfig)+"/"+e,r)];case 3:return[4,s.sent().json()];case 4:if((i=s.sent()).error)throw o=i.error.message,ft.create("token-unsubscribe-failed",{errorInfo:o});return[3,6];case 5:throw a=s.sent(),ft.create("token-unsubscribe-failed",{errorInfo:a});case 6:return[2]}}
2))}))}function It(t){return"https://fcmregistrations.googleapis.com/v1/projects/"+t.projectId+"/registrations"}function jt(t){var e=t.appConfig,n=t.installations;return Object(u.b)(this,void 0,void 0,(function(){var t;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,n.getToken()];case 1:return t=r.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":"FIS "+t})]}}))}))}function Pt(t){var e=t.p256dh,n=t.auth,r=t.endpoint,i=t.vapidKey,o={web:{endpoint:r,auth:n,p256dh:e}};return i!==dt&&(o.web.applicationPubKey=i),o}function Rt(t,e,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a;return Object(u.d)(this,(function(s){switch(s.label){case 0:if("granted"!==Notification.permission)throw ft.create("permission-blocked");return[4,Ft(e,n)];case 1:return r=s.sent(),[4,Et(t)];case 2:return i=s.sent(),o={vapidKey:n,swScope:e.scope,endpoint:r.endpoint,auth:vt(r.getKey("auth")),p256dh:vt(r.getKey("p256dh"))},i?[3,3]:[2,Dt(t,o)];case 3:if(function(t,e){var n=e.vapidKey===t.vapidKey,r=e.endpoint===t.endpoint,i=e.auth===t.auth,o=e.p256dh===t.p256dh;return n&&r&&i&&o}(i.subscriptionOptions,o))return[3,8];s.label=4;case 4:return s.trys.push([4,6,,7]),[4,At(t,i.token)];case 5:return s.sent(),[3,7];case 6:return a=s.sent(),console.warn(a),[3,7];case 7:return[2,Dt(t,o)];case 8:return Date.now()>=i.createTime+6048e5?[2,Lt({token:i.token,createTime:Date.now(),subscriptionOptions:o},t,e)]:[2,i.token];case 9:return[2]}}
2))}))}function Nt(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[4,Et(t)];case 1:return(n=i.sent())?[4,At(t,n.token)]:[3,4];case 2:return i.sent(),[4,Ot(t)];case 3:i.sent(),i.label=4;case 4:return[4,e.pushManager.getSubscription()];case 5:return(r=i.sent())?[2,r.unsubscribe()]:[2,!0]}}))}))}function Lt(t,e,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o;return Object(u.d)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,5]),[4,Mt(e,t)];case 1:return r=a.sent(),i=Object(u.a)(Object(u.a)({},t),{token:r,createTime:Date.now()}),[4,St(e,i)];case 2:return a.sent(),[2,r];case 3:return o=a.sent(),[4,Nt(e,n)];case 4:throw a.sent(),o;case 5:return[2]}}))}))}function Dt(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[4,Ct(t,e)];case 1:return n=i.sent(),r={token:n,createTime:Date.now(),subscriptionOptions:e},[4,St(t,r)];case 2:return i.sent(),[2,r.token]}}))}))}function Ft(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,t.pushManager.getSubscription()];case 1:return(n=r.sent())?[2,n]:[2,t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:mt(e)})]}}))}))}function Ut(t){return"object"===typeof t&&!!t&&pt in t}function Bt(t){return new Promise((function(e){setTimeout(e,t)}))}var Vt=function(){function t(t){var e=this;this.firebaseDependencies=t,this.isOnBackgroundMessageUsed=null,this.vapidKey=null,this.bgMessageHandler=null,self.addEventListener("push",(function(t){t.waitUntil(e.onPush(t))})),self.addEventListener("pushsubscriptionchange",(function(t){t.waitUntil(e.onSubChange(t))})),self.addEventListener("notificationclick",(function(t){t.waitUntil(e.onNotificationClick(t))}))}return Object.defineProperty(t.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),t.prototype.setBackgroundMessageHandler=function(t){if(this.isOnBackgroundMessageUsed=!1,!t||"function"!==typeof t)throw ft.create("invalid-bg-handler");this.bgMessageHandler=t},t.prototype.onBackgroundMessage=function(t){var e=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=t,function(){e.bgMessageHandler=null}},t.prototype.getToken=function(){var t,e;return Object(u.b)(this,void 0,void 0,(function(){var n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return this.vapidKey?[3,2]:[4,Et(this.firebaseDependencies)];case 1:n=r.sent(),this.vapidKey=null!==(e=null===(t=null===n||void 0===n?void 0:n.subscriptionOptions)||void 0===t?void 0:t.vapidKey)&&void 0!==e?e:dt,r.label=2;case 2:return[2,Rt(this.firebaseDependencies,self.registration,this.vapidKey)]}}))}))},t.prototype.deleteToken=function(){return Nt(this.firebaseDependencies,self.registration)},t.prototype.requestPermission=function(){throw ft.create("only-available-in-window")},t.prototype.usePublicVapidKey=function(t){if(null!==this.vapidKey)throw ft.create("use-vapid-key-after-get-token");if("string"!==typeof t||0===t.length)throw ft.create("invalid-vapid-key");this.vapidKey=t},t.prototype.useServiceWorker=function(){throw ft.create("only-available-in-window")},t.prototype.onMessage=function(){throw ft.create("only-available-in-window")},t.prototype.onTokenRefresh=function(){throw ft.create("only-available-in-window")},t.prototype.onPush=function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r,i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return(e=function(t){var e=t.data;if(!e)return null;try{return e.json()}catch(n){return null}}(t))?[4,Wt()]:(console.debug("FirebaseMessaging: failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return function(t){return t.some((function(t){return"visible"===t.visibilityState&&!t.url.startsWith("chrome-extension://")}))}(n=o.sent())?[2,qt(n,e)]:(r=!1,e.notification?[4,Gt(zt(e))]:[3,3]);case 2:o.sent(),r=!0,o.label=3;
2case 3:return!0===r&&!1===this.isOnBackgroundMessageUsed?[2]:(this.bgMessageHandler&&(i=function(t){var e={from:t.from,collapseKey:t.collapse_key};return function(t,e){if(e.notification){t.notification={};var n=e.notification.title;n&&(t.notification.title=n);var r=e.notification.body;r&&(t.notification.body=r);var i=e.notification.image;i&&(t.notification.image=i)}}(e,t),function(t,e){e.data&&(t.data=e.data)}(e,t),function(t,e){if(e.fcmOptions){t.fcmOptions={};var n=e.fcmOptions.link;n&&(t.fcmOptions.link=n);var r=e.fcmOptions.analytics_label;r&&(t.fcmOptions.analyticsLabel=r)}}(e,t),e}(e),"function"===typeof this.bgMessageHandler?this.bgMessageHandler(i):this.bgMessageHandler.next(i)),[4,Bt(1e3)]);case 4:return o.sent(),[2]}}))}))},t.prototype.onSubChange=function(t){var e,n;return Object(u.b)(this,void 0,void 0,(function(){var r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return t.newSubscription?[3,2]:[4,Nt(this.firebaseDependencies,self.registration)];case 1:return i.sent(),[2];case 2:return[4,Et(this.firebaseDependencies)];case 3:return r=i.sent(),[4,Nt(this.firebaseDependencies,self.registration)];case 4:return i.sent(),[4,Rt(this.firebaseDependencies,self.registration,null!==(n=null===(e=null===r||void 0===r?void 0:r.subscriptionOptions)||void 0===e?void 0:e.vapidKey)&&void 0!==n?n:dt)];case 5:return i.sent(),[2]}}))}))},t.prototype.onNotificationClick=function(t){var e,n;return Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a,s;return Object(u.d)(this,(function(u){switch(u.label){case 0:return(r=null===(n=null===(e=t.notification)||void 0===e?void 0:e.data)||void 0===n?void 0:n.FCM_MSG)?t.action?[2]:(t.stopImmediatePropagation(),t.notification.close(),(i=function(t){var e,n,r,i=null!==(n=null===(e=t.fcmOptions)||void 0===e?void 0:e.link)&&void 0!==n?n:null===(r=t.notification)||void 0===r?void 0:r.click_action;if(i)return i;return Ut(t.data)?self.location.origin:null}(r))?(o=new URL(i,self.location.href),a=new URL(self.location.origin),o.host!==a.host?[2]:[4,Ht(o)]):[2]):[2];case 1:return(s=u.sent())?[3,4]:[4,self.clients.openWindow(i)];case 2:return s=u.sent(),[4,Bt(3e3)];case 3:return u.sent(),[3,6];case 4:return[4,s.focus()];case 5:s=u.sent(),u.label=6;case 6:return s?(r.messageType=lt.NOTIFICATION_CLICKED,r.isFirebaseMessaging=!0,[2,s.postMessage(r)]):[2]}}))}))},t}();function zt(t){var e,n=Object(u.a)({},t.notification);return n.data=((e={}).FCM_MSG=t,e),n}function Ht(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r,i,o,a,s;return Object(u.d)(this,(function(c){switch(c.label){case 0:return[4,Wt()];case 1:e=c.sent();try{for(n=Object(u.g)(e),r=n.next();!r.done;r=n.next())if(i=r.value,o=new URL(i.url,self.location.href),t.host===o.host)return[2,i]}catch(l){a={error:l}}finally{try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}}return[2,null]}}))}))}function qt(t,e){var n,r;e.isFirebaseMessaging=!0,e.messageType=lt.PUSH_RECEIVED;try{for(var i=Object(u.g)(t),o=i.next();!o.done;o=i.next()){o.value.postMessage(e)}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function Wt(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function Gt(t){var e,n=t.actions,r=Notification.maxActions;return n&&r&&n.length>r&&console.warn("This browser only supports "+r+" actions. The remaining actions will not be displayed."),self.registration.showNotification(null!==(e=t.title)&&void 0!==e?e:"",t)}var Yt=function(){function t(t){var e=this;this.firebaseDependencies=t,this.vapidKey=null,this.onMessageCallback=null,navigator.serviceWorker.addEventListener("message",(function(t){return e.messageEventListener(t)}))}return Object.defineProperty(t.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),t.prototype.messageEventListener=function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return(e=t.data).isFirebaseMessaging?(this.onMessageCallback&&e.messageType===lt.PUSH_RECEIVED&&("function"===typeof this.onMessageCallback?this.onMessageCallback(function(t){return delete t.messageType,delete t.isFirebaseMessaging,t}(Object.assign({},e))):this.onMessageCallback.next(Object.assign({},e))),Ut(n=e.data)&&"1"===n["google.c.a.e"]?[4,this.logEvent(e.messageType,n)]:[3,2]):[2];case 1:r.sent(),r.label=2;case 2:return[2]}}
2))}))},t.prototype.getVapidKey=function(){return this.vapidKey},t.prototype.getSwReg=function(){return this.swRegistration},t.prototype.getToken=function(t){return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(e){switch(e.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:e.sent(),e.label=2;case 2:if("granted"!==Notification.permission)throw ft.create("permission-blocked");return[4,this.updateVapidKey(null===t||void 0===t?void 0:t.vapidKey)];case 3:return e.sent(),[4,this.updateSwReg(null===t||void 0===t?void 0:t.serviceWorkerRegistration)];case 4:return e.sent(),[2,Rt(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}}))}))},t.prototype.updateVapidKey=function(t){return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(e){return t?this.vapidKey=t:this.vapidKey||(this.vapidKey=dt),[2]}))}))},t.prototype.updateSwReg=function(t){return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(e){switch(e.label){case 0:return t||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:e.sent(),e.label=2;case 2:if(!t&&this.swRegistration)return[2];if(!(t instanceof ServiceWorkerRegistration))throw ft.create("invalid-sw-registration");return this.swRegistration=t,[2]}}))}))},t.prototype.registerDefaultSw=function(){return Object(u.b)(this,void 0,void 0,(function(){var t,e;return Object(u.d)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=this,[4,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"})];case 1:return t.swRegistration=n.sent(),this.swRegistration.update().catch((function(){})),[3,3];case 2:throw e=n.sent(),ft.create("failed-service-worker-registration",{browserErrorMessage:e.message});case 3:return[2]}}
2))}))},t.prototype.deleteToken=function(){return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(t){switch(t.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:t.sent(),t.label=2;case 2:return[2,Nt(this.firebaseDependencies,this.swRegistration)]}}))}))},t.prototype.requestPermission=function(){return Object(u.b)(this,void 0,void 0,(function(){var t;return Object(u.d)(this,(function(e){switch(e.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(t=e.sent()))return[2];throw"denied"===t?ft.create("permission-blocked"):ft.create("permission-default")}}))}))},t.prototype.usePublicVapidKey=function(t){if(null!==this.vapidKey)throw ft.create("use-vapid-key-after-get-token");if("string"!==typeof t||0===t.length)throw ft.create("invalid-vapid-key");this.vapidKey=t},t.prototype.useServiceWorker=function(t){if(!(t instanceof ServiceWorkerRegistration))throw ft.create("invalid-sw-registration");if(this.swRegistration)throw ft.create("use-sw-after-get-token");this.swRegistration=t},t.prototype.onMessage=function(t){var e=this;return this.onMessageCallback=t,function(){e.onMessageCallback=null}},t.prototype.setBackgroundMessageHandler=function(){throw ft.create("only-available-in-sw")},t.prototype.onBackgroundMessage=function(){throw ft.create("only-available-in-sw")},t.prototype.onTokenRefresh=function(){return function(){}},t.prototype.logEvent=function(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return n=function(t){switch(t){case lt.NOTIFICATION_CLICKED:return"notification_open";case lt.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}(t),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return r.sent().logEvent(n,{message_id:e["google.c.a.c_id"],message_name:e["google.c.a.c_l"],message_time:e["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)}),[2]}}))}))},t}();function Xt(t){return ft.create("missing-app-config-values",{valueName:t})}var Kt={isSupported:Qt};function Qt(){return self&&"ServiceWorkerGlobalScope"in self?"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}i.a.INTERNAL.registerComponent(new c.a("messaging",(function(t){var e=t.getProvider("app").getImmediate(),n={app:e,appConfig:function(t){var e,n;if(!t||!t.options)throw Xt("App Configuration Object");if(!t.name)throw Xt("App Name");var r=t.options;try{for(var i=Object(u.g)(["projectId","apiKey","appId","messagingSenderId"]),o=i.next();!o.done;o=i.next()){var a=o.value;if(!r[a])throw Xt(a)}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{appName:t.name,projectId:r.projectId,apiKey:r.apiKey,appId:r.appId,senderId:r.messagingSenderId}}(e),installations:t.getProvider("installations").getImmediate(),analyticsProvider:t.getProvider("analytics-internal")};if(!Qt())throw ft.create("unsupported-browser");return self&&"ServiceWorkerGlobalScope"in self?new Vt(n):new Yt(n)}),"PUBLIC").setServiceProps(Kt));var Jt="firebasestorage.googleapis.com",Zt=function(t){function e(n,r){var i=t.call(this,$t(n),"Firebase Storage: "+r+" ("+$t(n)+")")||this;return i.customData={serverResponse:null},Object.setPrototypeOf(i,e.prototype),i}return Object(u.c)(e,t),e.prototype._codeEquals=function(t){return $t(t)===this.code},Object.defineProperty(e.prototype,"message",{get:function(){return this.customData.serverResponse?this.message+"\n"+this.customData.serverResponse:this.message},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"serverResponse",{get:function(){return this.customData.serverResponse},set:function(t){this.customData.serverResponse=t}
2,enumerable:!1,configurable:!0}),e}(a.c);function $t(t){return"storage/"+t}function te(){return new Zt("unknown","An unknown error occurred, please check the error payload for server response.")}function ee(){return new Zt("canceled","User canceled the upload/download.")}function ne(){return new Zt("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function re(t){return new Zt("invalid-argument",t)}function ie(){return new Zt("app-deleted","The Firebase app was deleted.")}function oe(t){return new Zt("invalid-root-operation","The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function ae(t,e){return new Zt("invalid-format","String does not match format '"+t+"': "+e)}function se(t){throw new Zt("internal-error","Internal error: "+t)}var ue={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"},ce=function(t,e){this.data=t,this.contentType=e||null};function le(t,e){switch(t){case ue.RAW:return new ce(he(e));case ue.BASE64:case ue.BASE64URL:return new ce(fe(t,e));case ue.DATA_URL:return new ce(function(t){var e=new de(t);return e.base64?fe(ue.BASE64,e.rest):function(t){var e;try{e=decodeURIComponent(t)}catch(n){throw ae(ue.DATA_URL,"Malformed data URL.")}return he(e)}(e.rest)}(e),new de(e).contentType)}throw te()}function he(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|63&r);else if(55296===(64512&r))if(n<t.length-1&&56320===(64512&t.charCodeAt(n+1)))r=65536|(1023&r)<<10|1023&t.charCodeAt(++n),e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r);else e.push(239,191,189);else 56320===(64512&r)?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(e)}function fe(t,e){switch(t){case ue.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r)throw ae(t,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break;case ue.BASE64URL:var i=-1!==e.indexOf("+"),o=-1!==e.indexOf("/");if(i||o)throw ae(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/")}var a;try{a=atob(e)}catch(c){throw ae(t,"Invalid character found")}for(var s=new Uint8Array(a.length),u=0;u<a.length;u++)s[u]=a.charCodeAt(u);return s}var de=function(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw ae(ue.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n=e[1]||null;null!=n&&(this.base64=(r=n,i=";base64",r.length>=i.length&&r.substring(r.length-i.length)===i),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=t.substring(t.indexOf(",")+1);var r,i};var pe,ve={STATE_CHANGED:"state_changed"},me={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function ge(t){switch(t){case"running":case"pausing":case"canceling":return me.RUNNING;case"paused":return me.PAUSED;case"success":return me.SUCCESS;case"canceled":return me.CANCELED;case"error":default:return me.ERROR}}!function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"}(pe||(pe={}));var ye=function(){function t(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=pe.NO_ERROR,this.sendPromise_=new Promise((function(e){t.xhr_.addEventListener("abort",(function(){t.errorCode_=pe.ABORT,e(t)})),t.xhr_.addEventListener("error",(function(){t.errorCode_=pe.NETWORK_ERROR,e(t)})),t.xhr_.addEventListener("load",(function(){e(t)}))}))}return t.prototype.send=function(t,e,n,r){if(this.sent_)throw se("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(e,t,!0),void 0!==r)for(var i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_},t.prototype.getErrorCode=function(){if(!this.sent_)throw se("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw se("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw se("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(t){return this.xhr_.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",t)},t}(),be=function(){function t(){}return t.prototype.createXhrIo=function(){return new ye},t}();function _e(t){return"string"===typeof t||t instanceof String}function we(t){return xe()&&t instanceof Blob}function xe(){return"undefined"!==typeof Blob}function Te(t,e,n,r){if(r<e)throw re("Invalid value for '"+t+"'. Expected "+e+" or greater.");if(r>n)throw re("Invalid value for '"+t+"'. Expected "+n+" or less.")}function Ee(){return"undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof WebKitBlobBuilder?Web
2KitBlobBuilder:void 0}function Se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ee();if(void 0!==n){for(var r=new n,i=0;i<t.length;i++)r.append(t[i]);return r.getBlob()}if(xe())return new Blob(t);throw new Zt("unsupported-environment","This browser doesn't seem to support creating Blobs")}var Oe=function(){function t(t,e){var n=0,r="";we(t)?(this.data_=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),n=this.data_.length):t instanceof Uint8Array&&(e?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),n=t.length),this.size_=n,this.type_=r}return t.prototype.size=function(){return this.size_},t.prototype.type=function(){return this.type_},t.prototype.slice=function(e,n){if(we(this.data_)){var r=function(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}(this.data_,e,n);return null===r?null:new t(r)}return new t(new Uint8Array(this.data_.buffer,e,n-e),!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(xe()){var r=e.map((function(e){return e instanceof t?e.data_:e}));return new t(Se.apply(null,r))}var i=e.map((function(t){return _e(t)?le(ue.RAW,t).data:t.data_})),o=0;i.forEach((function(t){o+=t.byteLength}));var a=new Uint8Array(o),s=0;return i.forEach((function(t){for(var e=0;e<t.length;e++)a[s++]=t[e]})),new t(a,!0)},t.prototype.uploadData=function(){return this.data_},t}(),ke=function(){function t(t,e){this.bucket=t,this.path_=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.path_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return 0===this.path.length},enumerable:!1,configurable:!0}),t.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},t.prototype.bucketOnlyServerUrl=function(){return"/b/"+encodeURIComponent(this.bucket)+"/o"},t.makeFromBucketSpec=function(e){var n;try{n=t.makeFromUrl(e)}catch(r){return new t(e,"")}if(""===n.path)return n;throw new Zt("invalid-default-bucket","Invalid default bucket '"+e+"'.")},t.makeFromUrl=function(e){var n=null,r="([A-Za-z0-9.\\-_]+)";var i=new RegExp("^gs://"+r+"(/(.*))?$","i");function o(t){t.path_=decodeURIComponent(t.path)}for(var a=Jt.replace(/[.]/g,"\\."),s=[{regex:i,indices:{bucket:1,path:3},postModify:function(t){"/"===t.path.charAt(t.path.length-1)&&(t.path_=t.path_.slice(0,-1))}},{regex:new RegExp("^https?://"+a+"/v[A-Za-z0-9_]+/b/"+r+"/o(/([^?#]*).*)?$","i"),indices:{bucket:1,path:3},postModify:o},{regex:new RegExp("^https?://(?:storage.googleapis.com|storage.cloud.google.com)/"+r+"/([^?#]*)","i"),indices:{bucket:1,path:2},postModify:o}],u=0;u<s.length;u++){var c=s[u],l=c.regex.exec(e);if(l){var h=l[c.indices.bucket],f=l[c.indices.path];f||(f=""),n=new t(h,f),c.postModify(n);break}}if(null==n)throw function(t){return new Zt("invalid-url","Invalid URL '"+t+"'.")}(e);return n},t}();function Ce(t){var e,n;try{e=JSON.parse(t)}catch(r){return null}return"object"!==typeof(n=e)||Array.isArray(n)?null:e}function Me(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)}function Ae(t){return"https://"+Jt+"/v0"+t}function Ie(t){var e=encodeURIComponent,n="?";for(var r in t){if(t.hasOwnProperty(r))n=n+(e(r)+"="+e(t[r]))+"&"}return n=n.slice(0,-1)}function je(t,e){return e}var Pe=function(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||je},Re=null;function Ne(){if(Re)return Re;var t=[];t.push(new Pe("bucket")),t.push(new Pe("generation")),t.push(new Pe("metageneration")),t.push(new Pe("name","fullPath",!0));var e=new Pe("name");e.xform=function(t,e){return function(t){return!_e(t)||t.length<2?t:Me(t)}(e)},t.push(e);var n=new Pe("size");return n.xform=function(t,e){return void 0!==e?Number(e):e},t.push(n),t.push(new Pe("timeCreated")),t.push(new Pe("updated")),t.push(new Pe("md5Hash",null,!0)),t.push(new Pe("cacheControl",null,!0)),t.push(new Pe("contentDisposition",null,!0)),t.push(new Pe("contentEncoding",null,!0)),t.push(new Pe
2("contentLanguage",null,!0)),t.push(new Pe("contentType",null,!0)),t.push(new Pe("metadata","customMetadata",!0)),Re=t}function Le(t,e,n){for(var r={type:"file"},i=n.length,o=0;o<i;o++){var a=n[o];r[a.local]=a.xform(r,e[a.server])}return function(t,e){Object.defineProperty(t,"ref",{get:function(){var n=t.bucket,r=t.fullPath,i=new ke(n,r);return e._makeStorageReference(i)}})}(r,t),r}function De(t,e,n){var r=Ce(e);return null===r?null:Le(t,r,n)}function Fe(t,e){for(var n={},r=e.length,i=0;i<r;i++){var o=e[i];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}function Ue(t,e,n){var r=Ce(n);return null===r?null:function(t,e,n){var r={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n.prefixes)for(var i=0,o=n.prefixes;i<o.length;i++){var a=o[i].replace(/\/$/,""),s=t._makeStorageReference(new ke(e,a));r.prefixes.push(s)}if(n.items)for(var u=0,c=n.items;u<c.length;u++){var l=c[u];s=t._makeStorageReference(new ke(e,l.name)),r.items.push(s)}return r}(t,e,r)}var Be=function(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]};function Ve(t){if(!t)throw te()}function ze(t,e){return function(n,r){var i=De(t,r,e);return Ve(null!==i),i}}function He(t,e){return function(n,r){var i=De(t,r,e);return Ve(null!==i),function(t,e){var n=Ce(e);if(null===n)return null;if(!_e(n.downloadTokens))return null;var r=n.downloadTokens;if(0===r.length)return null;var i=encodeURIComponent;return r.split(",").map((function(e){var n=t.bucket,r=t.fullPath;return Ae("/b/"+i(n)+"/o/"+i(r))+Ie({alt:"media",token:e})}))[0]}(i,r)}}function qe(t){return function(e,n){var r,i,o;return 401===e.getStatus()?r=new Zt("unauthenticated","User is not authenticated, please authenticate using Firebase Authentication and try again."):402===e.getStatus()?(o=t.bucket,r=new Zt("quota-exceeded","Quota for bucket '"+o+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===e.getStatus()?(i=t.path,r=new Zt("unauthorized","User does not have permission to access '"+i+"'.")):r=n,r.serverResponse=n.serverResponse,r}}function We(t){var e=qe(t);return function(n,r){var i,o=e(n,r);return 404===n.getStatus()&&(i=t.path,o=new Zt("object-not-found","Object '"+i+"' does not exist.")),o.serverResponse=r.serverResponse,o}}function Ge(t,e,n){var r=Ae(e.fullServerUrl()),i=t.maxOperationRetryTime,o=new Be(r,"GET",ze(t,n),i);return o.errorHandler=We(e),o}function Ye(t,e,n,r,i){var o={};e.isRoot?o.prefix="":o.prefix=e.path+"/",n&&n.length>0&&(o.delimiter=n),r&&(o.pageToken=r),i&&(o.maxResults=i);var a=Ae(e.bucketOnlyServerUrl()),s=t.maxOperationRetryTime,u=new Be(a,"GET",function(t,e){return function(n,r){var i=Ue(t,e,r);return Ve(null!==i),i}}(t,e.bucket),s);return u.urlParams=o,u.errorHandler=qe(e),u}function Xe(t,e,n){var r=Object.assign({},n);return r.fullPath=t.path,r.size=e.size(),r.contentType||(r.contentType=function(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}(null,e)),r}var Ke=function(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null};function Qe(t,e){var n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(r){Ve(!1)}return Ve(!!n&&-1!==(e||["active"]).indexOf(n)),n}var Je=262144;function Ze(t,e,n,r,i,o,a,s){var u=new Ke(0,0);if(a?(u.current=a.current,u.total=a.total):(u.current=0,u.total=r.size()),r.size()!==u.total)throw new Zt("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.");var c=u.total-u.current,l=c;i>0&&(l=Math.min(l,i));var h=u.current,f=h+l,d={"X-Goog-Upload-Command":l===c?"upload, finalize":"upload","X-Goog-Upload-Offset":u.current},p=r.slice(h,f);if(null===p)throw ne();var v=e.maxUploadRetryTime,m=new Be(n,"POST",(function(t,n){var i,a=Qe(t,["active","final"]),s=u.current+l,c=r.size();return i="final"===a?ze(e,o)(t,n):null,new Ke(s,c,"final"===a,i)}),v);return m.headers=d,m.body=p.uploadData(),m.progressCallback=s||null,m.errorHandler=qe(t),m}var $e=function(t,e,n){if("function"===typeof t||null!=e||null!=n)this.next=t,this.error=e,this.complete=n;else{var r=t;this.next=r.next,this.error=r.error,this.complete=r.complete}};function tn(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Promise.resolve().then((function(){return t.apply(void 0,e)}))}}var en=function(){function t(t,e,n){var r=this;void 0===n&&(n=null),this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=t,this._blob=e,this._metadata=n,this._mappings=Ne(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=function(t){r._request=void 0,r._chunkMultiplier=1,t._codeEquals("canceled")?(r._needToFetchStatus=!0,r.completeTransitions_()):(r._error=t,r._transition("error"))},this._metadataErrorHandler=function(t){r._request=void 0,t._codeEquals("canceled")?r.completeTransitions_():(r._error=t,r._transition("error"))},this._promise=new Promise((function(t,e){r._resolve=t,r._reject=e,r._start()})),this._promise.then(null,(function(){}))}return t.prototype._makeProgressCallback=function(){var t=this,e=this._transferred;return function(n){return t._updateProgress(e+n)}},t.prototype._shouldDoResumable=function(t){return t.size()>262144},t.prototype._start=function(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())},t.prototype._resolveToken=function(t){var e=this;this._ref.storage._getAuthToken().then((function(n){switch(e._state){case"running":t(n);break;case"canceling":e._transition("canceled");break;case"pausing":e._transition("paused")}}))},t.prototype._createResumable=function(){var t=this;this._resolveToken((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a=Xe(e,r,i),s={name:a.fullPath},u=Ae(o),c={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":a.contentType,"Content-Type":"application/json; charset=utf-8"},l=Fe(a,n),h=t.maxUploadRetryTime,f=new Be(u,"POST",(function(t){var e;Qe(t);try{e=t.getResponseHeader("X-Goog-Upload-URL")}catch(n){Ve(!1)}return Ve(_e(e)),e}),h);
2return f.urlParams=s,f.headers=c,f.body=l,f.errorHandler=qe(e),f}(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),r=t._ref.storage._makeRequest(n,e);t._request=r,r.getPromise().then((function(e){t._request=void 0,t._uploadUrl=e,t._needToFetchStatus=!1,t.completeTransitions_()}),t._errorHandler)}))},t.prototype._fetchStatus=function(){var t=this,e=this._uploadUrl;this._resolveToken((function(n){var r=function(t,e,n,r){var i=t.maxUploadRetryTime,o=new Be(n,"POST",(function(t){var e=Qe(t,["active","final"]),n=null;try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(o){Ve(!1)}n||Ve(!1);var i=Number(n);return Ve(!isNaN(i)),new Ke(i,r.size(),"final"===e)}),i);return o.headers={"X-Goog-Upload-Command":"query"},o.errorHandler=qe(e),o}(t._ref.storage,t._ref._location,e,t._blob),i=t._ref.storage._makeRequest(r,n);t._request=i,i.getPromise().then((function(e){e=e,t._request=void 0,t._updateProgress(e.current),t._needToFetchStatus=!1,e.finalized&&(t._needToFetchMetadata=!0),t.completeTransitions_()}),t._errorHandler)}))},t.prototype._continueUpload=function(){var t=this,e=Je*this._chunkMultiplier,n=new Ke(this._transferred,this._blob.size()),r=this._uploadUrl;this._resolveToken((function(i){var o;try{o=Ze(t._ref._location,t._ref.storage,r,t._blob,e,t._mappings,n,t._makeProgressCallback())}catch(s){return t._error=s,void t._transition("error")}var a=t._ref.storage._makeRequest(o,i);t._request=a,a.getPromise().then((function(e){t._increaseMultiplier(),t._request=void 0,t._updateProgress(e.current),e.finalized?(t._metadata=e.metadata,t._transition("success")):t.completeTransitions_()}),t._errorHandler)}))},t.prototype._increaseMultiplier=function(){Je*this._chunkMultiplier<33554432&&(this._chunkMultiplier*=2)},t.prototype._fetchMetadata=function(){var t=this;this._resolveToken((function(e){var n=Ge(t._ref.storage,t._ref._location,t._mappings),r=t._ref.storage._makeRequest(n,e);t._request=r,r.getPromise().then((function(e){t._request=void 0,t._metadata=e,t._transition("success")}),t._metadataErrorHandler)}))},t.prototype._oneShotUpload=function(){var t=this;this._resolveToken((function(e){var n=function(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),a={"X-Goog-Upload-Protocol":"multipart"},s=function(){for(var t="",e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}();a["Content-Type"]="multipart/related; boundary="+s;var u=Xe(e,r,i),c="--"+s+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Fe(u,n)+"\r\n--"+s+"\r\nContent-Type: "+u.contentType+"\r\n\r\n",l="\r\n--"+s+"--",h=Oe.getBlob(c,r,l);if(null===h)throw ne();var f={name:u.fullPath},d=Ae(o),p=t.maxUploadRetryTime,v=new Be(d,"POST",ze(t,n),p);return v.urlParams=f,v.headers=a,v.body=h.uploadData(),v.errorHandler=qe(e),v}(t._ref.storage,t._ref._location,t._mappings,t._blob,t._metadata),r=t._ref.storage._makeRequest(n,e);t._request=r,r.getPromise().then((function(e){t._request=void 0,t._metadata=e,t._updateProgress(t._blob.size()),t._transition("success")}),t._errorHandler)}))},t.prototype._updateProgress=function(t){var e=this._transferred;this._transferred=t,this._transferred!==e&&this._notifyObservers()},t.prototype._transition=function(t){if(this._state!==t)switch(t){case"canceling":case"pausing":this._state=t,void 0!==this._request&&this._request.cancel();break;case"running":var e="paused"===this._state;this._state=t,e&&(this._notifyObservers(),this._start());break;case"paused":this._state=t,this._notifyObservers();break;case"canceled":this._error=ee(),this._state=t,this._notifyObservers();break;case"error":case"success":this._state=t,this._notifyObservers()}},t.prototype.completeTransitions_=function(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=ge(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:t,metadata:this._metadata,task:this,ref:this._ref}},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e,n,r){var i=this,o=new $e(e,n,r);return this._addObserver(o),function(){i._removeObserver(o)}},t.prototype.then=function(t,e){return this._promise.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype._addObserver=function(t){this._observers.push(t),this._notifyObserver(t)},t.prototype._removeObserver=function(t){var e=this._observers.indexOf(t);-1!==e&&this._observers.splice(e,1)},t.prototype._notifyObservers=function(){var t=this;
2this._finishPromise(),this._observers.slice().forEach((function(e){t._notifyObserver(e)}))},t.prototype._finishPromise=function(){if(void 0!==this._resolve){var t=!0;switch(ge(this._state)){case me.SUCCESS:tn(this._resolve.bind(null,this.snapshot))();break;case me.CANCELED:case me.ERROR:tn(this._reject.bind(null,this._error))();break;default:t=!1}t&&(this._resolve=void 0,this._reject=void 0)}},t.prototype._notifyObserver=function(t){switch(ge(this._state)){case me.RUNNING:case me.PAUSED:t.next&&tn(t.next.bind(t,this.snapshot))();break;case me.SUCCESS:t.complete&&tn(t.complete.bind(t))();break;case me.CANCELED:case me.ERROR:t.error&&tn(t.error.bind(t,this._error))();break;default:t.error&&tn(t.error.bind(t,this._error))()}},t.prototype.resume=function(){var t="paused"===this._state||"pausing"===this._state;return t&&this._transition("running"),t},t.prototype.pause=function(){var t="running"===this._state;return t&&this._transition("pausing"),t},t.prototype.cancel=function(){var t="running"===this._state||"pausing"===this._state;return t&&this._transition("canceling"),t},t}(),nn=function(){function t(t,e){this._service=t,this._location=e instanceof ke?e:ke.makeFromUrl(e)}return t.prototype.toString=function(){return"gs://"+this._location.bucket+"/"+this._location.path},t.prototype._newRef=function(e,n){return new t(e,n)},Object.defineProperty(t.prototype,"root",{get:function(){var t=new ke(this._location.bucket,"");return this._newRef(this._service,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._location.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return Me(this._location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this._service},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=function(t){if(0===t.length)return null;var e=t.lastIndexOf("/");return-1===e?"":t.slice(0,e)}(this._location.path);if(null===e)return null;var n=new ke(this._location.bucket,e);return new t(this._service,n)},enumerable:!1,configurable:!0}),t.prototype._throwIfRoot=function(t){if(""===this._location.path)throw oe(t)},t}();function rn(t){var e={prefixes:[],items:[]};return on(t,e).then((function(){return e}))}function on(t,e,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o;return Object(u.d)(this,(function(a){switch(a.label){case 0:return[4,an(t,{pageToken:n})];case 1:return r=a.sent(),(i=e.prefixes).push.apply(i,r.prefixes),(o=e.items).push.apply(o,r.items),null==r.nextPageToken?[3,3]:[4,on(t,e,r.nextPageToken)];case 2:a.sent(),a.label=3;case 3:return[2]}}
2))}))}function an(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r,i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return null!=e&&"number"===typeof e.maxResults&&Te("options.maxResults",1,1e3,e.maxResults),[4,t.storage._getAuthToken()];case 1:return n=o.sent(),r=e||{},i=Ye(t.storage,t._location,"/",r.pageToken,r.maxResults),[2,t.storage._makeRequest(i,n).getPromise()]}}))}))}function sn(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r;return Object(u.d)(this,(function(i){switch(i.label){case 0:return t._throwIfRoot("updateMetadata"),[4,t.storage._getAuthToken()];case 1:return n=i.sent(),r=function(t,e,n,r){var i=Ae(e.fullServerUrl()),o=Fe(n,r),a=t.maxOperationRetryTime,s=new Be(i,"PATCH",ze(t,r),a);return s.headers={"Content-Type":"application/json; charset=utf-8"},s.body=o,s.errorHandler=We(e),s}(t.storage,t._location,e,Ne()),[2,t.storage._makeRequest(r,n).getPromise()]}}))}))}function un(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return t._throwIfRoot("getDownloadURL"),[4,t.storage._getAuthToken()];case 1:return e=r.sent(),n=function(t,e,n){var r=Ae(e.fullServerUrl()),i=t.maxOperationRetryTime,o=new Be(r,"GET",He(t,n),i);return o.errorHandler=We(e),o}(t.storage,t._location,Ne()),[2,t.storage._makeRequest(n,e).getPromise().then((function(t){if(null===t)throw new Zt("no-download-url","The given file does not have any download URLs.");return t}))]}}))}))}function cn(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return t._throwIfRoot("deleteObject"),[4,t.storage._getAuthToken()];case 1:return e=r.sent(),n=function(t,e){var n=Ae(e.fullServerUrl()),r=t.maxOperationRetryTime,i=new Be(n,"DELETE",(function(t,e){}),r);return i.successCodes=[200,204],i.errorHandler=We(e),i}(t.storage,t._location),[2,t.storage._makeRequest(n,e).getPromise()]}}))}))}function ln(t,e){var n=function(t,e){var n=e.split("/").filter((function(t){return t.length>0})).join("/");return 0===t.length?n:t+"/"+n}(t._location.path,e),r=new ke(t._location.bucket,n);return new nn(t.storage,r)}var hn=function(){function t(t,e,n){this._delegate=t,this.task=e,this.ref=n}return Object.defineProperty(t.prototype,"bytesTransferred",{get:function(){return this._delegate.bytesTransferred},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._delegate.state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalBytes",{get:function(){return this._delegate.totalBytes},enumerable:!1,configurable:!0}),t}(),fn=function(){function t(t,e){this._delegate=t,this._ref=e,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}return Object.defineProperty(t.prototype,"snapshot",{get:function(){return new hn(this._delegate.snapshot,this,this._ref)},enumerable:!1,configurable:!0}),t.prototype.then=function(t,e){var n=this;return this._delegate.then((function(e){if(t)return t(new hn(e,n,n._ref))}),e)},t.prototype.on=function(t,e,n,r){var i=this,o=void 0;return e&&(o="function"===typeof e?function(t){return e(new hn(t,i,i._ref))}:{next:e.next?function(t){return e.next(new hn(t,i,i._ref))}:void 0,complete:e.complete||void 0,error:e.error||void 0}),this._delegate.on(t,o,n||void 0,r||void 0)},t}(),dn=function(){function t(t,e){this._delegate=t,this._service=e}return Object.defineProperty(t.prototype,"prefixes",{get:function(){var t=this;return this._delegate.prefixes.map((function(e){return new pn(e,t._service)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){var t=this;return this._delegate.items.map((function(e){return new pn(e,t._service)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextPageToken",{get:function(){return this._delegate.nextPageToken||null}
2,enumerable:!1,configurable:!0}),t}(),pn=function(){function t(t,e){this._delegate=t,this.storage=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this._delegate.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this._delegate.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this._delegate.fullPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this._delegate.toString()},t.prototype.child=function(e){return new t(ln(this._delegate,e),this.storage)},Object.defineProperty(t.prototype,"root",{get:function(){return new t(this._delegate.root,this.storage)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){var e=this._delegate.parent;return null==e?null:new t(e,this.storage)},enumerable:!1,configurable:!0}),t.prototype.put=function(t,e){return this._throwIfRoot("put"),new fn(function(t,e,n){return t._throwIfRoot("uploadBytesResumable"),new en(t,new Oe(e),n)}(this._delegate,t,e),this)},t.prototype.putString=function(t,e,n){void 0===e&&(e=ue.RAW),this._throwIfRoot("putString");var r=le(e,t),i=Object(u.a)({},n);return null==i.contentType&&null!=r.contentType&&(i.contentType=r.contentType),new fn(new en(this._delegate,new Oe(r.data,!0),i),this)},t.prototype.listAll=function(){var t=this;return rn(this._delegate).then((function(e){return new dn(e,t.storage)}))},t.prototype.list=function(t){var e=this;return an(this._delegate,t).then((function(t){return new dn(t,e.storage)}))},t.prototype.getMetadata=function(){return function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return t._throwIfRoot("getMetadata"),[4,t.storage._getAuthToken()];case 1:return e=r.sent(),n=Ge(t.storage,t._location,Ne()),[2,t.storage._makeRequest(n,e).getPromise()]}}))}))}(this._delegate)},t.prototype.updateMetadata=function(t){return sn(this._delegate,t)},t.prototype.getDownloadURL=function(){return un(this._delegate)},t.prototype.delete=function(){return this._throwIfRoot("delete"),cn(this._delegate)},t.prototype._throwIfRoot=function(t){if(""===this._delegate._location.path)throw oe(t)},t}(),vn=function(){function t(t){this.promise_=Promise.reject(t)}return t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){},t}();var mn=function(){function t(t,e,n,r,i,o,a,s,u,c,l){var h=this;this.pendingXhr_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=e,this.headers_=n,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=o.slice(),this.callback_=a,this.errorCallback_=s,this.progressCallback_=c,this.timeout_=u,this.pool_=l,this.promise_=new Promise((function(t,e){h.resolve_=t,h.reject_=e,h.start_()}))}return t.prototype.start_=function(){var t=this;function e(e,n){var r,i=t.resolve_,o=t.reject_,a=n.xhr;if(n.wasSuccessCode)try{var s=t.callback_(a,a.getResponseText());void 0!==s?i(s):i()}catch(u){o(u)}else null!==a?((r=te()).serverResponse=a.getResponseText(),t.errorCallback_?o(t.errorCallback_(a,r)):o(r)):n.canceled?o(r=t.appDelete_?ie():ee()):o(r=new Zt("retry-limit-exceeded","Max retry time for operation exceeded, please try again."))}this.canceled_?e(0,new gn(!1,null,!0)):this.backoffId_=function(t,e,n){var r=1,i=null,o=!1,a=0;function s(){return 2===a}var c=!1;function l(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];c||(c=!0,e.apply(null,t))}function h(e){i=setTimeout((function(){i=null,t(f,s())}),e)}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!c)if(t)l.call.apply(l,Object(u.f)([null,t],e));else{var i;s()||o?l.call.apply(l,Object(u.f)([null,t],e)):(r<64&&(r*=2),1===a?(a=2,i=0):i=1e3*(r+Math.random()),h(i))}}var d=!1;function p(t){d||(d=!0,c||(null!==i?(t||(a=2),clearTimeout(i),h(0)):t||(a=1)))}return h(0),setTimeout((function(){o=!0,p(!0)}),n),p}((function(e,n){if(n)e(!1,new gn(!1,null,!0));else{var r=t.pool_.createXhrIo();t.pendingXhr_=r,null!==t.progressCallback_&&r.addUploadProgressListener(i),r.send(t.url_,t.method_,t.body_,t.headers_).then((function(n){null!==t.progressCallback_&&n.removeUploadProgressListener(i),t.pendingXhr_=null;
2var r=(n=n).getErrorCode()===pe.NO_ERROR,o=n.getStatus();if(r&&!t.isRetryStatusCode_(o)){var a=-1!==t.successCodes_.indexOf(o);e(!0,new gn(a,n))}else{var s=n.getErrorCode()===pe.ABORT;e(!1,new gn(!1,null,s))}}))}function i(e){var n=e.loaded,r=e.lengthComputable?e.total:-1;null!==t.progressCallback_&&t.progressCallback_(n,r)}}),e,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingXhr_&&this.pendingXhr_.abort()},t.prototype.isRetryStatusCode_=function(t){var e=t>=500&&t<600,n=-1!==[408,429].indexOf(t),r=-1!==this.additionalRetryCodes_.indexOf(t);return e||n||r},t}(),gn=function(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n};function yn(t){return/^[A-Za-z]+:\/\//.test(t)}function bn(t,e){if(t instanceof wn){var n=t;if(null==n._bucket)throw new Zt("no-default-bucket","No default bucket found. Did you set the 'storageBucket' property when initializing the app?");var r=new nn(n,n._bucket);return null!=e?bn(r,e):r}if(void 0!==e){if(e.includes(".."))throw re('`path` param cannot contain ".."');return ln(t,e)}return t}function _n(t,e){if(e&&yn(e)){if(t instanceof wn)return new nn(t,e);throw re("To use ref(service, url), the first argument must be a Storage instance.")}return bn(t,e)}var wn=function(){function t(t,e,n,r,i){this.app=t,this._authProvider=e,this._pool=n,this._url=r,this._firebaseVersion=i,this._bucket=null,this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=r?ke.makeFromBucketSpec(r):function(t){var e=null===t||void 0===t?void 0:t.storageBucket;return null==e?null:ke.makeFromBucketSpec(e)}(this.app.options)}return Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._maxUploadRetryTime},set:function(t){Te("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._maxOperationRetryTime},set:function(t){Te("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t},enumerable:!1,configurable:!0}),t.prototype._getAuthToken=function(){return Object(u.b)(this,void 0,void 0,(function(){var t,e;return Object(u.d)(this,(function(n){switch(n.label){case 0:return(t=this._authProvider.getImmediate({optional:!0}))?[4,t.getToken()]:[3,2];case 1:if(null!==(e=n.sent()))return[2,e.accessToken];n.label=2;case 2:return[2,null]}}))}))},t.prototype._delete=function(){return this._deleted=!0,this._requests.forEach((function(t){return t.cancel()})),this._requests.clear(),Promise.resolve()},t.prototype._makeStorageReference=function(t){return new nn(this,t)},t.prototype._makeRequest=function(t,e){var n=this;if(this._deleted)return new vn(ie());var r=function(t,e,n,r,i){var o=Ie(t.urlParams),a=t.url+o,s=Object.assign({},t.headers);return function(t,e){e&&(t["X-Firebase-GMPID"]=e)}(s,e),function(t,e){null!==e&&e.length>0&&(t.Authorization="Firebase "+e)}(s,n),function(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(null!==e&&void 0!==e?e:"AppManager")}(s,i),new mn(a,t.method,s,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r)}(t,this._appId,e,this._pool,this._firebaseVersion);return this._requests.add(r),r.getPromise().then((function(){return n._requests.delete(r)}),(function(){return n._requests.delete(r)})),r},t}(),xn=function(){function t(t,e){var n=this;this.app=t,this._delegate=e,this.INTERNAL={delete:function(){return n._delegate._delete()}}}return Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this._delegate.maxOperationRetryTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this._delegate.maxUploadRetryTime},enumerable:!1,configurable:!0}),t.prototype.ref=function(t){if(yn(t))throw re("ref() expected a child path but got a URL, use refFromURL instead.");return new pn(_n(this._delegate,t),this)},t.prototype.refFromURL=function(t){if(!yn(t))throw re("refFromURL() expected a full URL but got a child path, use ref() instead.");try{ke.makeFromUrl(t)}catch(e){throw re("refFromUrl() expected a valid full URL but got an invali
2d one.")}return new pn(_n(this._delegate,t),this)},t.prototype.setMaxUploadRetryTime=function(t){this._delegate.maxUploadRetryTime=t},t.prototype.setMaxOperationRetryTime=function(t){this._delegate.maxOperationRetryTime=t},t}();function Tn(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return new xn(n,new wn(n,r,new be,e,i.a.SDK_VERSION))}!function(t){var e={TaskState:me,TaskEvent:ve,StringFormat:ue,Storage:wn,Reference:pn};t.INTERNAL.registerComponent(new c.a("storage",Tn,"PUBLIC").setServiceProps(e).setMultipleInstances(!0)),t.registerVersion("@firebase/storage","0.4.4")}(i.a);var En,Sn,On,kn="0.4.7",Cn=kn,Mn="FB-PERF-TRACE-MEASURE",An="_wt_",In="_fcp",jn="_fid",Pn="@firebase/performance/config",Rn="@firebase/performance/configexpire",Nn="Performance",Ln=((En={})["trace started"]="Trace {$traceName} was started before.",En["trace stopped"]="Trace {$traceName} is not running.",En["nonpositive trace startTime"]="Trace {$traceName} startTime should be positive.",En["nonpositive trace duration"]="Trace {$traceName} duration should be positive.",En["no window"]="Window is not available.",En["no app id"]="App id is not available.",En["no project id"]="Project id is not available.",En["no api key"]="Api key is not available.",En["invalid cc log"]="Attempted to queue invalid cc event",En["FB not default"]="Performance can only start when Firebase app instance is the default one.",En["RC response not ok"]="RC response is not ok",En["invalid attribute name"]="Attribute name {$attributeName} is invalid.",En["invalid attribute value"]="Attribute value {$attributeValue} is invalid.",En["invalid custom metric name"]="Custom metric name {$customMetricName} is invalid",En["invalid String merger input"]="Input for String merger is invalid, contact support team to resolve.",En),Dn=new a.b("performance",Nn,Ln),Fn=new o.b(Nn);Fn.logLevel=o.a.INFO;var Un,Bn=function(){function t(t){if(this.window=t,!t)throw Dn.create("no window");this.performance=t.performance,this.PerformanceObserver=t.PerformanceObserver,this.windowLocation=t.location,this.navigator=t.navigator,this.document=t.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=t.localStorage),t.perfMetrics&&t.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=t.perfMetrics.onFirstInputDelay)}return t.prototype.getUrl=function(){return this.windowLocation.href.split("?")[0]},t.prototype.mark=function(t){this.performance&&this.performance.mark&&this.performance.mark(t)},t.prototype.measure=function(t,e,n){this.performance&&this.performance.measure&&this.performance.measure(t,e,n)},t.prototype.getEntriesByType=function(t){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(t):[]},t.prototype.getEntriesByName=function(t){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(t):[]},t.prototype.getTimeOrigin=function(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)},t.prototype.requiredApisAvailable=function(){return fetch&&Promise&&this.navigator&&this.navigator.cookieEnabled?!!Object(a.w)()||(Fn.info("IndexedDB is not supported by current browswer"),!1):(Fn.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)},t.prototype.setupObserver=function(t,e){this.PerformanceObserver&&new this.PerformanceObserver((function(t){for(var n=0,r=t.getEntries();n<r.length;n++){var i=r[n];e(i)}})).observe({entryTypes:[t]})},t.getInstance=function(){return void 0===Sn&&(Sn=new t(On)),Sn},t}();function Vn(t,e){var n=t.length-e.length;if(n<0||n>1)throw Dn.create("invalid String merger input");for(var r=[],i=0;i<t.length;i++)r.push(t.charAt(i)),e.length>i&&r.push(e.charAt(i));return r.join("")}var zn,Hn,qn=function(){function t(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTrans
2portEndpointUrl=Vn("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=Vn("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}return t.prototype.getAppId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.appId;if(!t)throw Dn.create("no app id");return t},t.prototype.getProjectId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.projectId;if(!t)throw Dn.create("no project id");return t},t.prototype.getApiKey=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.apiKey;if(!t)throw Dn.create("no api key");return t},t.prototype.getFlTransportFullUrl=function(){return this.flTransportEndpointUrl.concat("?key=",this.transportKey)},t.getInstance=function(){return void 0===Un&&(Un=new t),Un},t}();function Wn(){return zn}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.VISIBLE=1]="VISIBLE",t[t.HIDDEN=2]="HIDDEN"}(Hn||(Hn={}));var Gn=["firebase_","google_","ga_"],Yn=new RegExp("^[a-zA-Z]\\w*$");function Xn(){var t=Bn.getInstance().navigator;return"serviceWorker"in t?t.serviceWorker.controller?2:3:1}function Kn(){switch(Bn.getInstance().document.visibilityState){case"visible":return Hn.VISIBLE;case"hidden":return Hn.HIDDEN;default:return Hn.UNKNOWN}}function Qn(){var t=Bn.getInstance().navigator.connection;switch(t&&t.effectiveType){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}var Jn="0.0.1",Zn=!0,$n="FIREBASE_INSTALLATIONS_AUTH";function tr(t){var e=function(){var t=Bn.getInstance().localStorage;if(!t)return;var e=t.getItem(Rn);if(!e||(n=e,!(Number(n)>Date.now())))return;var n;var r=t.getItem(Pn);if(!r)return;try{return JSON.parse(r)}catch(i){return}}();return e?(nr(e),Promise.resolve()):function(t){return function(){var t=qn.getInstance().installationsService.getToken();return t.then((function(t){})),t}().then((function(e){var n="https://firebaseremoteconfig.googleapis.com/v1/projects/"+qn.getInstance().getProjectId()+"/namespaces/fireperf:fetch?key="+qn.getInstance().getApiKey(),r=new Request(n,{method:"POST",headers:{Authorization:$n+" "+e},body:JSON.stringify({app_instance_id:t,app_instance_id_token:e,app_id:qn.getInstance().getAppId(),app_version:Cn,sdk_version:Jn})});return fetch(r).then((function(t){if(t.ok)return t.json();throw Dn.create("RC response not ok")}))})).catch((function(){Fn.info(er)}))}(t).then(nr).then((function(t){return function(t){var e=Bn.getInstance().localStorage;if(!t||!e)return;e.setItem(Pn,JSON.stringify(t)),e.setItem(Rn,String(Date.now()+60*qn.getInstance().configTimeToLive*60*1e3))}(t)}),(function(){}))}var er="Could not fetch config, will use default configs";function nr(t){if(!t)return t;var e=qn.getInstance(),n=t.entries||{};return void 0!==n.fpr_enabled?e.loggingEnabled="true"===String(n.fpr_enabled):e.loggingEnabled=Zn,n.fpr_log_source&&(e.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(e.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(e.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(e.tracesSamplingRate=Number(n.fpr_vc_trace_sampling_rate)),e.logTraceAfterSampling=rr(e.tracesSamplingRate),e.logNetworkAfterSampling=rr(e.networkRequestsSamplingRate),t}function rr(t){return Math.random()<=t}var ir,or=1;function ar(){return or=2,ir=ir||function(){var t=Bn.getInstance().document;return new Promise((function(e){if(t&&"complete"!==t.readyState){var n=function n(){"complete"===t.readyState&&(t.removeEventListener("readystatechange",n),e())};t.addEventListener("readystatechange",n)}else e()}))}().then((function(){return function(){var t=qn.getInstance().installationsService.getId();return t.then((function(t){zn=t})),t}()})).then((function(t){return tr(t)})).then((function(){return sr()}),(function(){return sr()}))}function sr(){or=3}var ur,cr=1e4,lr=3,hr=[],fr=!1;function dr(t){setTimeout((function(){if(0!==lr)return hr.length?void function(){var t=hr.splice(0,1e3),e=t.map((function(t){return{source_extension_json_proto3:t.message,event_time_ms:String(t.eventTime)}}));(function(t,e){return function(t){var e=qn.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}(t).then((function(t){return t.ok||Fn.info("Call to Firebase backend failed."),t.json()}
2)).then((function(t){var n=Number(t.nextRequestWaitMillis),r=cr;isNaN(n)||(r=Math.max(n,r));var i=t.logResponseDetails;Array.isArray(i)&&i.length>0&&"RETRY_REQUEST_LATER"===i[0].responseAction&&(hr=Object(u.f)(Object(u.f)([],e),hr),Fn.info("Retry transport request later.")),lr=3,dr(r)}))})({request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:qn.getInstance().logSource,log_event:e},t).catch((function(){hr=Object(u.f)(Object(u.f)([],t),hr),lr--,Fn.info("Tries left: "+lr+"."),dr(cr)}))}():dr(cr)}),t)}function pr(t){if(!t.eventTime||!t.message)throw Dn.create("invalid cc log");hr=Object(u.f)(Object(u.f)([],hr),[t])}function vr(t,e){ur||(ur=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];pr({message:t.apply(void 0,e),eventTime:Date.now()})}}(yr)),ur(t,e)}function mr(t){var e=qn.getInstance();!e.instrumentationEnabled&&t.isAuto||(e.dataCollectionEnabled||t.isAuto)&&Bn.getInstance().requiredApisAvailable()&&(t.isAuto&&Kn()!==Hn.VISIBLE||(3===or?gr(t):ar().then((function(){return gr(t)}),(function(){return gr(t)}))))}function gr(t){if(Wn()){var e=qn.getInstance();e.loggingEnabled&&e.logTraceAfterSampling&&setTimeout((function(){return vr(t,1)}),0)}}function yr(t,e){return 0===e?function(t){var e={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},n={application_info:br(),network_request_metric:e};return JSON.stringify(n)}(t):function(t){var e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};0!==Object.keys(t.counters).length&&(e.counters=t.counters);var n=t.getAttributes();0!==Object.keys(n).length&&(e.custom_attributes=n);var r={application_info:br(),trace_metric:e};return JSON.stringify(r)}(t)}function br(){return{google_app_id:qn.getInstance().getAppId(),app_instance_id:Wn(),web_app_info:{sdk_version:Cn,page_url:Bn.getInstance().getUrl(),service_worker_status:Xn(),visibility_state:Kn(),effective_connection_type:Qn()},application_process_state:0}}var _r=["_fp",In,jn];var wr=function(){function t(t,e,n){void 0===e&&(e=!1),this.name=t,this.isAuto=e,this.state=1,this.customAttributes={},this.counters={},this.api=Bn.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark="FB-PERF-TRACE-START-"+this.randomId+"-"+this.name,this.traceStopMark="FB-PERF-TRACE-STOP-"+this.randomId+"-"+this.name,this.traceMeasure=n||"FB-PERF-TRACE-MEASURE-"+this.randomId+"-"+this.name,n&&this.calculateTraceMetrics())}return t.prototype.start=function(){if(1!==this.state)throw Dn.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2},t.prototype.stop=function(){if(2!==this.state)throw Dn.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),mr(this)},t.prototype.record=function(t,e,n){if(t<=0)throw Dn.create("nonpositive trace startTime",{traceName:this.name});if(e<=0)throw Dn.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*e),this.startTimeUs=Math.floor(1e3*t),n&&n.attributes&&(this.customAttributes=Object(u.a)({},n.attributes)),n&&n.metrics)for(var r=0,i=Object.keys(n.metrics);r<i.length;r++){var o=i[r];isNaN(Number(n.metrics[o]))||(this.counters[o]=Number(Math.floor(n.metrics[o])))}mr(this)},t.prototype.incrementMetric=function(t,e){void 0===e&&(e=1),void 0===this.counters[t]?this.putMetric(t,e):this.putMetric(t,this.counters[t]+e)},t.prototype.putMetric=function(t,e){if(n=t,r=this.name,0===n.length||n.length>100||!(r&&r.startsWith(An)&&_r.indexOf(n)>-1)&&n.startsWith("_"))throw Dn.create("invalid custom metric name",{customMetricName:t});var n,r;this.counters[t]=function(t){var e=Math.floor(t);return e<t&&Fn.info("Metric value should be an Integer, setting the value as : "+e+"."),e}(e)},t.prototype.getMetric=function(t){return this.counters[t]||0},t.prototype.putAttribute=function(t,e){var n,r=!(0===(n=t).length||n.length>40)&&!Gn.some((function(t){return n.startsWith(t)}))&&!!n.match(Yn),i=function(t){return 0!==t.length&&t.length<=100}(e);if(r&&i)this.customAttributes[t]=e;else{if(!r)throw Dn.create("invalid attribute name",{attributeName:t});if(!i)throw Dn.create("invalid attribute value",{attributeValue:e})}},t.prototype.getAttribute=function(t){return this.customAttributes[t]},t.prototype.removeAttribute=function(t){void 0!==this.customAttributes[t]&&delete this.customAttributes[t]},t.prototype.getAttributes=function(){return Object(u.a)({},this.customAttributes)},t.prototype.setStartTime=function(t){this.startTimeUs=t},t.prototype.setDuration=function(t){this.durationUs=t},t.prototype.calculateTraceMetrics=function(){var t=this.api.getEntriesByName(this.traceMeasure),e=t&&t[0];e&&(this.durationUs=Math.floor(1e3*e.duration),this.startTimeUs=Math.floor(1e3*(e.startTime+this.api.getTimeOrigin())))},t.createOobTrace=function(e,n,r){var i=Bn.getInstance().getUrl();if(i){var o=new t(An+i,!0),a=Math.floor(1e3*Bn.getInstance().getTimeOrigin());o.setStartTime(a),e&&e[0]&&(o.setDuration(Math.floor(1e3*e[0].duration)),o.putMetric("domInteractive",Math.floor(1e3*e[0].domInteractive)),o.putMetric("domContentLoadedEventEnd",Math.floor(1e3*e[0].domContentLoadedEventEnd)),o.putMetric("loadEventEnd",Math.floor(1e3*e[0].loadEventEnd)));if(n){var s=n.find((function(t){return"first-paint"===t.name}));s&&s.startTime&&o.putMetric("_fp",Math.floor(1e3*s.startTime));var u=n.find((function(t){return"first-contentful-paint"===t.name}));u&&u.startTime&&o.putMetric(In,Math.floor(1e3*u.startTime)),r&&o.putMetric(jn,Math.floor(1e3*r))}mr(o)}},t.createUserTimingTrace=function(e){mr(new t(e,!1,e))},t}();function xr(t){var e=t;if(e&&void 0!==e.responseStart){var n=Bn.getInstance().getTimeOrigin(),r=Math.floor(1e3*(e.startTime+n)),i=e.responseStart?Math.floor(1e3*(e.responseStart-e.startTime)):void 0,o=Math.floor(1e3*(e.responseEnd-e.startTime));!function(t){var e=qn.getInstance();if(e.instrumentationEnabled){var n=t.url,r=e.logEndPointUrl.split("?")[0],i=e.flTransportEndpointUrl.split("?")[0];n!==r&&n!==i&&e.loggingEnabled&&e.logNetworkAfterSampling&&setTimeout((function(){return vr(t,0)}),0)}}({url:e.name&&e.name.split("?")[0],responsePayloadBytes:e.transferSize,startTimeUs:r,timeToResponseInitiatedUs:i,timeToResponseCompletedUs:o})}}function Tr(){Wn()&&(setTimeout((function(){return function(){var t=Bn.getInstance(),e=t.getEntriesByType("navigation"),n=t.getEntriesByType("paint");if(t.onFirstInputDelay){var r=setTimeout((function(){wr.createOobTrace(e,n),r=void 0}),5e3);t.onFirstInputDelay((function(t){r&&(clearTimeout(r),wr.createOobTrace(e,n,t))}))}else wr.createOobTrace(e,n)}()}),0),setTimeout((function(){return function(){for(var t=Bn.getInstance(),e=t.getEntriesByType("resource"),n=0,r=e;n<r.length;n++){xr(r[n])}t.setupObserver("resource",xr)}()}),0),setTimeout((function(){return function(){for(var t=Bn.getInstance(),e=t.getEntriesByType("measure"),n=0,r=e;n<r.length;
2n++){Er(r[n])}t.setupObserver("measure",Er)}()}),0))}function Er(t){var e=t.name;e.substring(0,Mn.length)!==Mn&&wr.createUserTimingTrace(e)}var Sr=function(){function t(t){this.app=t,Bn.getInstance().requiredApisAvailable()&&Object(a.N)().then((function(t){t&&(fr||(dr(5500),fr=!0),ar().then(Tr,Tr))})).catch((function(t){Fn.info("Environment doesn't support IndexedDB: "+t)}))}return t.prototype.trace=function(t){return new wr(t)},Object.defineProperty(t.prototype,"instrumentationEnabled",{get:function(){return qn.getInstance().instrumentationEnabled},set:function(t){qn.getInstance().instrumentationEnabled=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataCollectionEnabled",{get:function(){return qn.getInstance().dataCollectionEnabled},set:function(t){qn.getInstance().dataCollectionEnabled=t},enumerable:!1,configurable:!0}),t}();!function(t){var e=function(t,e){if("[DEFAULT]"!==t.name)throw Dn.create("FB not default");if("undefined"===typeof window)throw Dn.create("no window");return function(t){On=t}(window),qn.getInstance().firebaseAppInstance=t,qn.getInstance().installationsService=e,new Sr(t)};t.INTERNAL.registerComponent(new c.a("performance",(function(t){var n=t.getProvider("app").getImmediate(),r=t.getProvider("installations").getImmediate();return e(n,r)}),"PUBLIC")),t.registerVersion("@firebase/performance",kn)}(i.a);var Or,kr,Cr="https://www.googletagmanager.com/gtag/js";!function(t){t.EVENT="event",t.SET="set",t.CONFIG="config"}(Or||(Or={})),function(t){t.ADD_SHIPPING_INFO="add_shipping_info",t.ADD_PAYMENT_INFO="add_payment_info",t.ADD_TO_CART="add_to_cart",t.ADD_TO_WISHLIST="add_to_wishlist",t.BEGIN_CHECKOUT="begin_checkout",t.CHECKOUT_PROGRESS="checkout_progress",t.EXCEPTION="exception",t.GENERATE_LEAD="generate_lead",t.LOGIN="login",t.PAGE_VIEW="page_view",t.PURCHASE="purchase",t.REFUND="refund",t.REMOVE_FROM_CART="remove_from_cart",t.SCREEN_VIEW="screen_view",t.SEARCH="search",t.SELECT_CONTENT="select_content",t.SELECT_ITEM="select_item",t.SELECT_PROMOTION="select_promotion",t.SET_CHECKOUT_OPTION="set_checkout_option",t.SHARE="share",t.SIGN_UP="sign_up",t.TIMING_COMPLETE="timing_complete",t.VIEW_CART="view_cart",t.VIEW_ITEM="view_item",t.VIEW_ITEM_LIST="view_item_list",t.VIEW_PROMOTION="view_promotion",t.VIEW_SEARCH_RESULTS="view_search_results"}(kr||(kr={}));var Mr,Ar=new o.b("@firebase/analytics");function Ir(t,e,n,r,i,o){return Object(u.b)(this,void 0,void 0,(function(){var a,s,c,l;return Object(u.d)(this,(function(u){switch(u.label){case 0:a=r[i],u.label=1;case 1:return u.trys.push([1,7,,8]),a?[4,e[a]]:[3,3];case 2:return u.sent(),[3,6];case 3:return[4,Promise.all(n)];case 4:return s=u.sent(),(c=s.find((function(t){return t.measurementId===i})))?[4,e[c.appId]]:[3,6];case 5:u.sent(),u.label=6;case 6:return[3,8];case 7:return l=u.sent(),Ar.error(l),[3,8];case 8:return t(Or.CONFIG,i,o),[2]}}))}))}function jr(t,e,n,r,i){return Object(u.b)(this,void 0,void 0,(function(){var o,a,s,c,l,h,f,d;return Object(u.d)(this,(function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),o=[],i&&i.send_to?(a=i.send_to,Array.isArray(a)||(a=[a]),[4,Promise.all(n)]):[3,2];case 1:for(s=u.sent(),c=function(t){var n=s.find((function(e){return e.measurementId===t})),r=n&&e[n.appId];if(!r)return o=[],"break";o.push(r)},l=0,h=a;l<h.length&&(f=h[l],"break"!==c(f));l++);u.label=2;case 2:return 0===o.length&&(o=Object.values(e)),[4,Promise.all(o)];case 3:return u.sent(),t(Or.EVENT,r,i||{}),[3,5];case 4:return d=u.sent(),Ar.error(d),[3,5];case 5:return[2]}}
2))}))}function Pr(t,e,n,r,i){var o=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];window[r].push(arguments)};return window[i]&&"function"===typeof window[i]&&(o=window[i]),window[i]=function(t,e,n,r){return function(i,o,a){return Object(u.b)(this,void 0,void 0,(function(){var s;return Object(u.d)(this,(function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),i!==Or.EVENT?[3,2]:[4,jr(t,e,n,o,a)];case 1:return u.sent(),[3,5];case 2:return i!==Or.CONFIG?[3,4]:[4,Ir(t,e,n,r,o,a)];case 3:return u.sent(),[3,5];case 4:t(Or.SET,o),u.label=5;case 5:return[3,7];case 6:return s=u.sent(),Ar.error(s),[3,7];case 7:return[2]}}))}))}}(o,t,e,n),{gtagCore:o,wrappedGtag:window[i]}}var Rr=((Mr={})["already-exists"]="A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.",Mr["already-initialized"]="Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",Mr["interop-component-reg-failed"]="Firebase Analytics Interop Component failed to instantiate: {$reason}",Mr["invalid-analytics-context"]="Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",Mr["indexeddb-unavailable"]="IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",Mr["fetch-throttle"]="The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.",Mr["config-fetch-failed"]="Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}",Mr["no-api-key"]='The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',Mr["no-app-id"]='The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',Mr),Nr=new a.b("analytics","Analytics",Rr),Lr=new(function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=1e3),this.throttleMetadata=t,this.intervalMillis=e}return t.prototype.getThrottleMetadata=function(t){return this.throttleMetadata[t]},t.prototype.setThrottleMetadata=function(t,e){this.throttleMetadata[t]=e},t.prototype.deleteThrottleMetadata=function(t){delete this.throttleMetadata[t]},t}());function Dr(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}function Fr(t){var e;return Object(u.b)(this,void 0,void 0,(function(){var n,r,i,o,a,s,c;return Object(u.d)(this,(function(u){switch(u.label){case 0:return n=t.appId,r=t.apiKey,i={method:"GET",headers:Dr(r)},o="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),[4,fetch(o,i)];case 1:if(200===(a=u.sent()).status||304===a.status)return[3,6];s="",u.label=2;case 2:return u.trys.push([2,4,,5]),[4,a.json()];case 3:return c=u.sent(),(null===(e=c.error)||void 0===e?void 0:e.message)&&(s=c.error.message),[3,5];case 4:return u.sent(),[3,5];case 5:throw Nr.create("config-fetch-failed",{httpStatus:a.status,responseMessage:s});case 6:return[2,a.json()]}}))}))}function Ur(t,e,n,r){var i=e.throttleEndTimeMillis,o=e.backoffCount;return void 0===r&&(r=Lr),Object(u.b)(this,void 0,void 0,(function(){var e,s,c,l,h,f,d;return Object(u.d)(this,(function(u){switch(u.label){case 0:e=t.appId,s=t.measurementId,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Br(n,i)];case 2:return u.sent(),[3,4];case 3:if(c=u.sent(),s)return Ar.warn("Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID "+s+' provided in the "measurementId" field in the local Firebase config. ['+c.message+"]"),[2,{appId:e,measurementId:s}];throw c;case 4:return u.trys.push([4,6,,7]),[4,Fr(t)];case 5:return l=u.sent(),r.deleteThrottleMetadata(e),[2,l];case 6:if(!function(t){if(!(t instanceof a.c)||!t.customData)return!1;var e=Number(t.customData.httpStatus);return 429===e||500===e||503===e||504===e}(h=u.sent())){if(r.deleteThrottleMetadata(e),s)return Ar.warn("Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID "+s+' provided in the "measurementId" field in the local Firebase config. ['+h.message+"]"),[2,{appId:e,measurementId:s}];throw h}return f=503===Number(h.customData.httpStatus)?Object(a.j)(o,r.intervalMillis,30):Object(a.j)(o,r.intervalMillis),d={throttleEndTimeMillis:Date.now()+f,backoffCount:o+1},r.setThrottleMetadata(e,d),Ar.debug("Calling attemptFetch again in "+f+" millis"),[2,Ur(t,d,n,r)];case 7:return[2]}}
2))}))}function Br(t,e){return new Promise((function(n,r){var i=Math.max(e-Date.now(),0),o=setTimeout(n,i);t.addEventListener((function(){clearTimeout(o),r(Nr.create("fetch-throttle",{throttleEndTimeMillis:e}))}))}))}var Vr=function(){function t(){this.listeners=[]}return t.prototype.addEventListener=function(t){this.listeners.push(t)},t.prototype.abort=function(){this.listeners.forEach((function(t){return t()}))},t}();function zr(t,e,n,r,i,o){return Object(u.b)(this,void 0,void 0,(function(){var s,c,l,h,f,d,p;return Object(u.d)(this,(function(v){switch(v.label){case 0:return(s=function(t,e,n){return void 0===e&&(e=Lr),Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a,s,c,l=this;return Object(u.d)(this,(function(h){if(r=t.options,i=r.appId,o=r.apiKey,a=r.measurementId,!i)throw Nr.create("no-app-id");if(!o){if(a)return[2,{measurementId:a,appId:i}];throw Nr.create("no-api-key")}return s=e.getThrottleMetadata(i)||{backoffCount:0,throttleEndTimeMillis:Date.now()},c=new Vr,setTimeout((function(){return Object(u.b)(l,void 0,void 0,(function(){return Object(u.d)(this,(function(t){return c.abort(),[2]}))}))}),void 0!==n?n:6e4),[2,Ur({appId:i,apiKey:o,measurementId:a},s,c,e)]}))}))}(t)).then((function(e){n[e.measurementId]=e.appId,t.options.measurementId&&e.measurementId!==t.options.measurementId&&Ar.warn("The measurement ID in the local Firebase config ("+t.options.measurementId+") does not match the measurement ID fetched from the server ("+e.measurementId+"). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.")})).catch((function(t){return Ar.error(t)})),e.push(s),c=function(){return Object(u.b)(this,void 0,void 0,(function(){var t;return Object(u.d)(this,(function(e){switch(e.label){case 0:return Object(a.w)()?[3,1]:(Ar.warn(Nr.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),[2,!1]);case 1:return e.trys.push([1,3,,4]),[4,Object(a.N)()];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),Ar.warn(Nr.create("indexeddb-unavailable",{errorInfo:t}).message),[2,!1];case 4:return[2,!0]}}))}))}().then((function(t){return t?r.getId():void 0})),[4,Promise.all([s,c])];case 1:return l=v.sent(),h=l[0],f=l[1],function(){for(var t=window.document.getElementsByTagName("script"),e=0,n=Object.values(t);e<n.length;e++){var r=n[e];if(r.src&&r.src.includes(Cr))return r}return null}()||function(t,e){var n=document.createElement("script");n.src=Cr+"?l="+t+"&id="+e,n.async=!0,document.head.appendChild(n)}(o,h.measurementId),i("js",new Date),(p={}).origin="firebase",p.update=!0,d=p,null!=f&&(d.firebase_id=f),i(Or.CONFIG,h.measurementId,d),[2,h.measurementId]}}))}))}var Hr,qr,Wr={},Gr=[],Yr={},Xr="dataLayer",Kr="gtag",Qr=!1;function Jr(t){if(Qr)throw Nr.create("already-initialized");t.dataLayerName&&(Xr=t.dataLayerName),t.gtagName&&(Kr=t.gtagName)}function Zr(t,e){!function(){var t=[];if(Object(a.s)()&&t.push("This is a browser extension environment."),Object(a.e)()||t.push("Cookies are not available."),t.length>0){var e=t.map((function(t,e){return"("+(e+1)+") "+t})).join(" "),n=Nr.create("invalid-analytics-context",{errorInfo:e});Ar.warn(n.message)}}();var n=t.options.appId;if(!n)throw Nr.create("no-app-id");if(!t.options.apiKey){if(!t.options.measurementId)throw Nr.create("no-api-key");Ar.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID '+t.options.measurementId+' provided in the "measurementId" field in the local Firebase config.')}if(null!=Wr[n])throw Nr.create("already-exists",{id:n});if(!Qr){!function(t){var e=[];Array.isArray(window[t])?e=window[t]:window[t]=e}(Xr);var r=Pr(Wr,Gr,Yr,Xr,Kr),i=r.wrappedGtag,o=r.gtagCore;qr=i,Hr=o,Qr=!0}return Wr[n]=zr(t,Gr,Yr,e,Hr,Xr),{app:t,logEvent:function(t,e,r){(function(t,e,n,r,i){return Object(u.b)(this,void 0,void 0,(function(){var o,a;return Object(u.d)(this,(function(s){switch(s.label){case 0:return i&&i.global?(t(Or.EVENT,n,r),[2]):[3,1];case 1:return[4,e];case 2:o=s.sent(),a=Object(u.a)(Object(u.a)({},r),{send_to:o}),t(Or.EVENT,n,a),s.label=3;case 3:return[2]}}
2))}))})(qr,Wr[n],t,e,r).catch((function(t){return Ar.error(t)}))},setCurrentScreen:function(t,e){(function(t,e,n,r){return Object(u.b)(this,void 0,void 0,(function(){var i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return r&&r.global?(t(Or.SET,{screen_name:n}),[2,Promise.resolve()]):[3,1];case 1:return[4,e];case 2:i=o.sent(),t(Or.CONFIG,i,{update:!0,screen_name:n}),o.label=3;case 3:return[2]}}))}))})(qr,Wr[n],t,e).catch((function(t){return Ar.error(t)}))},setUserId:function(t,e){(function(t,e,n,r){return Object(u.b)(this,void 0,void 0,(function(){var i;return Object(u.d)(this,(function(o){switch(o.label){case 0:return r&&r.global?(t(Or.SET,{user_id:n}),[2,Promise.resolve()]):[3,1];case 1:return[4,e];case 2:i=o.sent(),t(Or.CONFIG,i,{update:!0,user_id:n}),o.label=3;case 3:return[2]}}))}))})(qr,Wr[n],t,e).catch((function(t){return Ar.error(t)}))},setUserProperties:function(t,e){(function(t,e,n,r){return Object(u.b)(this,void 0,void 0,(function(){var i,o,a,s,c;return Object(u.d)(this,(function(u){switch(u.label){case 0:if(!r||!r.global)return[3,1];for(i={},o=0,a=Object.keys(n);o<a.length;o++)s=a[o],i["user_properties."+s]=n[s];return t(Or.SET,i),[2,Promise.resolve()];case 1:return[4,e];case 2:c=u.sent(),t(Or.CONFIG,c,{update:!0,user_properties:n}),u.label=3;case 3:return[2]}}
2))}))})(qr,Wr[n],t,e).catch((function(t){return Ar.error(t)}))},setAnalyticsCollectionEnabled:function(t){(function(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return n=r.sent(),window["ga-disable-"+n]=!e,[2]}}))}))})(Wr[n],t).catch((function(t){return Ar.error(t)}))},INTERNAL:{delete:function(){return delete Wr[n],Promise.resolve()}}}}var $r="analytics";function ti(){return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(t){switch(t.label){case 0:if(Object(a.s)())return[2,!1];if(!Object(a.e)())return[2,!1];if(!Object(a.w)())return[2,!1];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Object(a.N)()];case 2:return[2,t.sent()];case 3:return t.sent(),[2,!1];case 4:return[2]}}))}))}!function(t){t.INTERNAL.registerComponent(new c.a($r,(function(t){return Zr(t.getProvider("app").getImmediate(),t.getProvider("installations").getImmediate())}),"PUBLIC").setServiceProps({settings:Jr,EventName:kr,isSupported:ti})),t.INTERNAL.registerComponent(new c.a("analytics-internal",(function(t){try{return{logEvent:t.getProvider($r).getImmediate().logEvent}}catch(e){throw Nr.create("interop-component-reg-failed",{reason:e})}}),"PRIVATE")),t.registerVersion("@firebase/analytics","0.6.5")}(i.a);var ei,ni=function(){function t(t,e,n,r){this.client=t,this.storage=e,this.storageCache=n,this.logger=r}return t.prototype.isCachedDataFresh=function(t,e){if(!e)return this.logger.debug("Config fetch cache check. Cache unpopulated."),!1;var n=Date.now()-e,r=n<=t;return this.logger.debug("Config fetch cache check. Cache age millis: "+n+". Cache max age millis (minimumFetchIntervalMillis setting): "+t+". Is cache hit: "+r+"."),r},t.prototype.fetch=function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r,i,o;return Object(u.d)(this,(function(a){switch(a.label){case 0:return[4,Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(),this.storage.getLastSuccessfulFetchResponse()])];case 1:return e=a.sent(),n=e[0],(r=e[1])&&this.isCachedDataFresh(t.cacheMaxAgeMillis,n)?[2,r]:(t.eTag=r&&r.eTag,[4,this.client.fetch(t)]);case 2:return i=a.sent(),o=[this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())],200===i.status&&o.push(this.storage.setLastSuccessfulFetchResponse(i)),[4,Promise.all(o)];case 3:return a.sent(),[2,i]}}))}))},t}(),ri=((ei={})["registration-window"]="Undefined window object. This SDK only supports usage in a browser environment.",ei["registration-project-id"]="Undefined project identifier. Check Firebase app initialization.",ei["registration-api-key"]="Undefined API key. Check Firebase app initialization.",ei["registration-app-id"]="Undefined app identifier. Check Firebase app initialization.",ei["storage-open"]="Error thrown when opening storage. Original error: {$originalErrorMessage}.",ei["storage-get"]="Error thrown when reading from storage. Original error: {$originalErrorMessage}.",ei["storage-set"]="Error thrown when writing to storage. Original error: {$originalErrorMessage}.",ei["storage-delete"]="Error thrown when deleting from storage. Original error: {$originalErrorMessage}.",ei["fetch-client-network"]="Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.",ei["fetch-timeout"]='The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.',ei["fetch-throttle"]='The config fetch request timed out while in an exponential backoff state. Configure timeout using "fetchTimeoutMillis" SDK setting. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',ei["fetch-client-parse"]="Fetch client could not parse response. Original error: {$originalErrorMessage}.",ei["fetch-status"]="Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.",ei),ii=new a.b("remoteconfig","Remote Config",ri);var oi=function(){function t(t,e,n,r,i,o){this.firebaseInstallations=t,this.sdkVersion=e,this.namespace=n,this.projectId=r,this.apiKey=i,this.appId=o}return t.prototype.fetch=function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n,r,i,o,a,s,c,l,h,f,d,p,v,m,g,y,b,_;return Object(u.d)(this,(function(u){switch(u.label){case 0:return[4,Promise.all([this.firebaseInstallations.getId(),this.firebaseInstallations.getToken()])];case 1:e=u.sent(),n=e[0],r=e[1],i=window.FIREBASE_REMOTE_CONFIG_URL_BASE||"https://firebaseremoteconfig.googleapis.com",o=i+"/v1/projects/"+this.projectId+"/namespaces/"+this.namespace+":fetch?ke
2y="+this.apiKey,a={"Content-Type":"application/json","Content-Encoding":"gzip","If-None-Match":t.eTag||"*"},s={sdk_version:this.sdkVersion,app_instance_id:n,app_instance_id_token:r,app_id:this.appId,language_code:(void 0===w&&(w=navigator),w.languages&&w.languages[0]||w.language)},c={method:"POST",headers:a,body:JSON.stringify(s)},l=fetch(o,c),h=new Promise((function(e,n){t.signal.addEventListener((function(){var t=new Error("The operation was aborted.");t.name="AbortError",n(t)}))})),u.label=2;case 2:return u.trys.push([2,5,,6]),[4,Promise.race([l,h])];case 3:return u.sent(),[4,l];case 4:return f=u.sent(),[3,6];case 5:throw d=u.sent(),p="fetch-client-network","AbortError"===d.name&&(p="fetch-timeout"),ii.create(p,{originalErrorMessage:d.message});case 6:if(v=f.status,m=f.headers.get("ETag")||void 0,200!==f.status)return[3,11];b=void 0,u.label=7;case 7:return u.trys.push([7,9,,10]),[4,f.json()];case 8:return b=u.sent(),[3,10];case 9:throw _=u.sent(),ii.create("fetch-client-parse",{originalErrorMessage:_.message});case 10:g=b.entries,y=b.state,u.label=11;case 11:if("INSTANCE_STATE_UNSPECIFIED"===y?v=500:"NO_CHANGE"===y?v=304:"NO_TEMPLATE"!==y&&"EMPTY_CONFIG"!==y||(g={}),304!==v&&200!==v)throw ii.create("fetch-status",{httpStatus:v});return[2,{status:v,eTag:m,config:g}]}var w}))}))},t}(),ai=function(){function t(){this.listeners=[]}return t.prototype.addEventListener=function(t){this.listeners.push(t)},t.prototype.abort=function(){this.listeners.forEach((function(t){return t()}))},t}(),si=["1","true","t","yes","y","on"],ui=function(){function t(t,e){void 0===e&&(e=""),this._source=t,this._value=e}return t.prototype.asString=function(){return this._value},t.prototype.asBoolean=function(){return"static"!==this._source&&si.indexOf(this._value.toLowerCase())>=0},t.prototype.asNumber=function(){if("static"===this._source)return 0;var t=Number(this._value);return isNaN(t)&&(t=0),t},t.prototype.getSource=function(){return this._source},t}(),ci=function(){function t(t,e,n,r,i){this.app=t,this._client=e,this._storageCache=n,this._storage=r,this._logger=i,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:6e4,minimumFetchIntervalMillis:432e5},this.defaultConfig={}}return t.prototype.setLogLevel=function(t){switch(t){case"debug":this._logger.logLevel=o.a.DEBUG;break;case"silent":this._logger.logLevel=o.a.SILENT;break;default:this._logger.logLevel=o.a.ERROR}},Object.defineProperty(t.prototype,"fetchTimeMillis",{get:function(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastFetchStatus",{get:function(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"},enumerable:!1,configurable:!0}),t.prototype.activate=function(){return Object(u.b)(this,void 0,void 0,(function(){var t,e,n;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,Promise.all([this._storage.getLastSuccessfulFetchResponse(),this._storage.getActiveConfigEtag()])];case 1:return t=r.sent(),e=t[0],n=t[1],e&&e.config&&e.eTag&&e.eTag!==n?[4,Promise.all([this._storageCache.setActiveConfig(e.config),this._storage.setActiveConfigEtag(e.eTag)])]:[2,!1];case 2:return r.sent(),[2,!0]}}))}))},t.prototype.ensureInitialized=function(){var t=this;return this._initializePromise||(this._initializePromise=this._storageCache.loadFromStorage().then((function(){t._isInitializationComplete=!0}))),this._initializePromise},t.prototype.fetch=function(){return Object(u.b)(this,void 0,void 0,(function(){var t,e,n,r=this;return Object(u.d)(this,(function(i){switch(i.label){case 0:t=new ai,setTimeout((function(){return Object(u.b)(r,void 0,void 0,(function(){return Object(u.d)(this,(function(e){return t.abort(),[2]}))}))}),this.settings.fetchTimeoutMillis),i.label=1;case 1:return i.trys.push([1,4,,6]),[4,this._client.fetch({cacheMaxAgeMillis:this.settings.minimumFetchIntervalMillis,signal:t})];case 2:return i.sent(),[4,this._storageCache.setLastFetchStatus("success")];case 3:return i.sent(),[3,6];case 4:return e=i.sent(),s="fetch-throttle",n=(o=e)instanceof a.c&&-1!==o.code.indexOf(s)?"throttle":"failure",[4,this._storageCache.setLastFetchStatus(n)];case 5:throw i.sent(),e;case 6:return[2]}var o,s}))}))},t.prototype.fetchAndActivate=function(){return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(t){switch(t.label){case 0:return[4,this.fetch()];case 1:return t.sent(),[2,this.activate()]}}))}))},t.prototype.getAll=function(){var t=this;return function(t,e){void 0===t&&(t={});void 0===e&&(e={});return Object.keys(Object(u.a)(Object(u.a)({},t),e))}(this._storageCache.getActiveConfig(),this.defaultConfig).reduce((function(e,n){return e[n]=t.getValue(n),e}),{})},t.prototype.getBoolean=function(t){return this.getValue(t).asBoolean()},t.prototype.getNumber=function(t){return this.getValue(t).asNumber()},t.prototype.getString=function(t){return this.getValue(t).asString()},t.prototype.getValue=function(t){this._isInitializationComplete||this._logger.debug('A value was requested for key "'+t+'" before SDK initialization completed. Await on ensureInitialized if the intent was to get a previously activated value.');var e=this._storageCache.getActiveConfig();return e&&void 0!==e[t]?new ui("remote",e[t]):this.defaultConfig&&void 0!==this.defaultConfig[t]?new ui("default",String(this.defaultConfig[t])):(this._logger.debug('Returning static value for key "'+t+'". Define a default or remote value if this is unintentional.'),new ui("static"))},t}();function li(t,e){var n=t.target.error||void 0;return ii.create(e,{originalErrorMessage:n&&n.message})}var hi="app_namespace_store";var fi=function(){function t(t,e,n,r){void 0===r&&(r=new Promise((function(t,e){var n=indexedDB.open("firebase_remote_config",1);n.onerror=function(t){e(li(t,"storage-open"))},n.onsuccess=function(e){t(e.target.result)},n.onupgradeneeded=function(t){var e=t.target.result;switch(t.oldVersion){case 0:e.createObjectStore(hi,{keyPath:"compositeKey"})}}}))),this.appId=t,this.appName=e,this.namespace=n,this.openDbPromise=r}return t.prototype.getLastFetchStatus=function(){return this.get("last_fetch_status")},t.prototype.setLastFetchStatus=function(t){return this.set("last_fetch_status",t)},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.get("last_successful_fetch_timestamp_millis")},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.set("last_successful_fetch_timestamp_millis",t)},t.prototype.getLastSuccessfulFetchResponse=function(){return this.get("last_successful_fetch_response")},t.prototype.setLastSuccessfulFetchResponse=function(t){return this.set("last_successful_fetch_response",t)},t.prototype.getActiveConfig=function(){return this.get("active_config")},t.prototype.setActiveConfig=function(t){return this.set("active_config",t)},t.prototype.getActiveConfigEtag=function(){return this.get("active_config_etag")},t.prototype.setActiveConfigEtag=function(t){return this.set("active_config_etag",t)},t.prototype.getThrottleMetadata=function(){return this.get("throttle_metadata")},t.prototype.setThrottleMetadata=function(t){return this.set("throttle_metadata",t)},t.prototype.deleteThrottleMetadata=function(){return this.delete("throttle_metadata")},t.prototype.get=function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n=this;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction([hi],"readonly").objectStore(hi),a=n.createCompositeKey(t);try{var s=o.get(a);
2s.onerror=function(t){i(li(t,"storage-get"))},s.onsuccess=function(t){var e=t.target.result;r(e?e.value:void 0)}}catch(u){i(ii.create("storage-get",{originalErrorMessage:u&&u.message}))}}))]}}))}))},t.prototype.set=function(t,e){return Object(u.b)(this,void 0,void 0,(function(){var n,r=this;return Object(u.d)(this,(function(i){switch(i.label){case 0:return[4,this.openDbPromise];case 1:return n=i.sent(),[2,new Promise((function(i,o){var a=n.transaction([hi],"readwrite").objectStore(hi),s=r.createCompositeKey(t);try{var u=a.put({compositeKey:s,value:e});u.onerror=function(t){o(li(t,"storage-set"))},u.onsuccess=function(){i()}}catch(c){o(ii.create("storage-set",{originalErrorMessage:c&&c.message}))}}))]}}))}))},t.prototype.delete=function(t){return Object(u.b)(this,void 0,void 0,(function(){var e,n=this;return Object(u.d)(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction([hi],"readwrite").objectStore(hi),a=n.createCompositeKey(t);try{var s=o.delete(a);s.onerror=function(t){i(li(t,"storage-delete"))},s.onsuccess=function(){r()}}catch(u){i(ii.create("storage-delete",{originalErrorMessage:u&&u.message}))}}))]}}))}))},t.prototype.createCompositeKey=function(t){return[this.appId,this.appName,this.namespace,t].join()},t}(),di=function(){function t(t){this.storage=t}return t.prototype.getLastFetchStatus=function(){return this.lastFetchStatus},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.lastSuccessfulFetchTimestampMillis},t.prototype.getActiveConfig=function(){return this.activeConfig},t.prototype.loadFromStorage=function(){return Object(u.b)(this,void 0,void 0,(function(){var t,e,n,r,i,o;return Object(u.d)(this,(function(a){switch(a.label){case 0:return t=this.storage.getLastFetchStatus(),e=this.storage.getLastSuccessfulFetchTimestampMillis(),n=this.storage.getActiveConfig(),[4,t];case 1:return(r=a.sent())&&(this.lastFetchStatus=r),[4,e];case 2:return(i=a.sent())&&(this.lastSuccessfulFetchTimestampMillis=i),[4,n];case 3:return(o=a.sent())&&(this.activeConfig=o),[2]}}))}))},t.prototype.setLastFetchStatus=function(t){return this.lastFetchStatus=t,this.storage.setLastFetchStatus(t)},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.lastSuccessfulFetchTimestampMillis=t,this.storage.setLastSuccessfulFetchTimestampMillis(t)},t.prototype.setActiveConfig=function(t){return this.activeConfig=t,this.storage.setActiveConfig(t)},t}();function pi(t,e){return new Promise((function(n,r){var i=Math.max(e-Date.now(),0),o=setTimeout(n,i);t.addEventListener((function(){clearTimeout(o),r(ii.create("fetch-throttle",{throttleEndTimeMillis:e}))}))}))}var vi,mi=function(){function t(t,e){this.client=t,this.storage=e}return t.prototype.fetch=function(t){return Object(u.b)(this,void 0,void 0,(function(){var e;return Object(u.d)(this,(function(n){switch(n.label){case 0:return[4,this.storage.getThrottleMetadata()];case 1:return e=n.sent()||{backoffCount:0,throttleEndTimeMillis:Date.now()},[2,this.attemptFetch(t,e)]}}))}))},t.prototype.attemptFetch=function(t,e){var n=e.throttleEndTimeMillis,r=e.backoffCount;return Object(u.b)(this,void 0,void 0,(function(){var e,i,o;return Object(u.d)(this,(function(s){switch(s.label){case 0:return[4,pi(t.signal,n)];case 1:s.sent(),s.label=2;case 2:return s.trys.push([2,5,,7]),[4,this.client.fetch(t)];case 3:return e=s.sent(),[4,this.storage.deleteThrottleMetadata()];case 4:return s.sent(),[2,e];case 5:if(!function(t){if(!(t instanceof a.c)||!t.customData)return!1;var e=Number(t.customData.httpStatus);return 429===e||500===e||503===e||504===e}(i=s.sent()))throw i;return o={throttleEndTimeMillis:Date.now()+Object(a.j)(r),backoffCount:r+1},[4,this.storage.setThrottleMetadata(o)];case 6:return s.sent(),[2,this.attemptFetch(t,o)];case 7:return[2]}}
2))}))},t}(),gi="@firebase/remote-config";(vi=i.a).INTERNAL.registerComponent(new c.a("remoteConfig",(function(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("installations").getImmediate();if("undefined"===typeof window)throw ii.create("registration-window");var i=n.options,a=i.projectId,s=i.apiKey,u=i.appId;if(!a)throw ii.create("registration-project-id");if(!s)throw ii.create("registration-api-key");if(!u)throw ii.create("registration-app-id");e=e||"firebase";var c=new fi(u,n.name,e),l=new di(c),h=new o.b(gi);h.logLevel=o.a.ERROR;var f=new oi(r,vi.SDK_VERSION,e,a,s,u),d=new mi(f,c),p=new ni(d,c,l,h),v=new ci(n,p,l,c,h);return v.ensureInitialized(),v}),"PUBLIC").setMultipleInstances(!0)),vi.registerVersion(gi,"0.1.32");i.a.registerVersion("firebase","8.3.0","app");console.warn("\nIt looks like you're using the development build of the Firebase JS SDK.\nWhen deploying Firebase apps to production, it is advisable to only import\nthe individual SDK components you intend to use.\n\nFor the module builds, these are available in the following manner\n(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):\n\nCommonJS Modules:\nconst firebase = require('firebase/app');\nrequire('firebase/<PACKAGE>');\n\nES Modules:\nimport firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n\nTypescript:\nimport firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n"),i.a.registerVersion("firebase","8.3.0")},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(115),i=n(116),o=String.fromCharCode(30);t.exports={protocol:4,encodePacket:r,encodePayload:function(t,e){var n=t.length,i=new Array(n),a=0;t.forEach((function(t,s){r(t,!1,(function(t){i[s]=t,++a===n&&e(i.join(o))}))}))},decodePacket:i,decodePayload:function(t,e){for(var n=t.split(o),r=[],a=0;a<n.length;a++){var s=i(n[a],e);if(r.push(s),"error"===s.type)break}return r}}},function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return r}))},function(t,e){t.exports="undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")()},function(t,e,n){var r=n(119);function i(e,n,o){return"undefined"!==typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,n){var i=r(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}},i(e,n,o||e)}t.exports=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return z})),n.d(e,"b",(function(){return L}));var r=n(13),i=n.n(r),o=n(19),a=n.n(o),s=n(82),u=n.n(s),c=n(58),l=n.n(c),h=n(83),f=n.n(h);function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function v(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)e.indexOf(n=o[r])>=0||(i[n]=t[n]);return i}var m={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},g=Object.keys(m).map((function(t){return m[t]}
2)),y={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},b=Object.keys(y).reduce((function(t,e){return t[y[e]]=e,t}),{}),_=function(t,e){for(var n=t.length-1;n>=0;n-=1){var r=t[n];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null},w=function(t){var e=_(t,m.TITLE),n=_(t,"titleTemplate");if(Array.isArray(e)&&(e=e.join("")),n&&e)return n.replace(/%s/g,(function(){return e}));var r=_(t,"defaultTitle");return e||r||void 0},x=function(t){return _(t,"onChangeClientState")||function(){}},T=function(t,e){return e.filter((function(e){return void 0!==e[t]})).map((function(e){return e[t]})).reduce((function(t,e){return d({},t,e)}),{})},E=function(t,e){return e.filter((function(t){return void 0!==t[m.BASE]})).map((function(t){return t[m.BASE]})).reverse().reduce((function(e,n){if(!e.length)for(var r=Object.keys(n),i=0;i<r.length;i+=1){var o=r[i].toLowerCase();if(-1!==t.indexOf(o)&&n[o])return e.concat(n)}return e}),[])},S=function(t,e,n){var r={};return n.filter((function(e){return!!Array.isArray(e[t])||(void 0!==e[t]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+t+' should be of type "Array". Instead found type "'+typeof e[t]+'"'),!1)})).map((function(e){return e[t]})).reverse().reduce((function(t,n){var i={};n.filter((function(t){for(var n,o=Object.keys(t),a=0;a<o.length;a+=1){var s=o[a],u=s.toLowerCase();-1===e.indexOf(u)||"rel"===n&&"canonical"===t[n].toLowerCase()||"rel"===u&&"stylesheet"===t[u].toLowerCase()||(n=u),-1===e.indexOf(s)||"innerHTML"!==s&&"cssText"!==s&&"itemprop"!==s||(n=s)}if(!n||!t[n])return!1;var c=t[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][c]&&(i[n][c]=!0,!0)})).reverse().forEach((function(e){return t.push(e)}));for(var o=Object.keys(i),a=0;a<o.length;a+=1){var s=o[a],u=d({},r[s],i[s]);r[s]=u}return t}),[]).reverse()},O=function(t){return Array.isArray(t)?t.join(""):t},k=[m.NOSCRIPT,m.SCRIPT,m.STYLE],C=function(t,e){return void 0===e&&(e=!0),!1===e?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},M=function(t){return Object.keys(t).reduce((function(e,n){var r=void 0!==t[n]?n+'="'+t[n]+'"':""+n;return e?e+" "+r:r}),"")},A=function(t,e){return void 0===e&&(e={}),Object.keys(t).reduce((function(e,n){return e[y[n]||n]=t[n],e}),e)},I=function(t,e,n){switch(t){case m.TITLE:return{toComponent:function(){return n=e.titleAttributes,(r={key:t=e.title})["data-rh"]=!0,o=A(n,r),[i.a.createElement(m.TITLE,o,t)];var t,n,r,o},toString:function(){return function(t,e,n,r){var i=M(n),o=O(e);return i?"<"+t+' data-rh="true" '+i+">"+C(o,r)+"</"+t+">":"<"+t+' data-rh="true">'+C(o,r)+"</"+t+">"}(t,e.title,e.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return A(e)},toString:function(){return M(e)}};default:return{toComponent:function(){return function(t,e){return e.map((function(e,n){var r,o=((r={key:n})["data-rh"]=!0,r);return Object.keys(e).forEach((function(t){var n=y[t]||t;"innerHTML"===n||"cssText"===n?o.dangerouslySetInnerHTML={__html:e.innerHTML||e.cssText}:o[n]=e[t]})),i.a.createElement(t,o)}))}(t,e)},toString:function(){return function(t,e,n){return e.reduce((function(e,r){var i=Object.keys(r).filter((function(t){return!("innerHTML"===t||"cssText"===t)})).reduce((function(t,e){var i=void 0===r[e]?e:e+'="'+C(r[e],n)+'"';return t?t+" "+i:i}),""),o=r.innerHTML||r.cssText||"",a=-1===k.indexOf(t);return e+"<"+t+' data-rh="true" '+i+(a?"/>":">"+o+"</"+t+">")}),"")}(t,e,n)}}}},j=function(t){var e=t.bodyAttributes,n=t.encode,r=t.htmlAttributes,i=t.linkTags,o=t.metaTags,a=t.noscriptTags,s=t.scriptTags,u=t.styleTags,c=t.title,l=void 0===c?"":c,h=t.titleAttributes;return{base:I(m.BASE,t.baseTag,n),bodyAttributes:I("bodyAttributes",e,n),htmlAttributes:I("htmlAttributes",r,n),link:I(m.LINK,i,n),meta:I(m.META,o,n),noscript:I(m.NOSCRIPT,a,n),script:I(m.SCRIPT,s,n),style:I(m.STYLE,u,n),title:I(m.TITLE,{title:l,titleAttributes:h},n)}},P=i.a.createContext({}),R=a.a.shape({setHelmet:a.a.func,helmetInstances:a.a.shape({get:a.a.func,add:a.a.func,remove:a.a.func})}),N="undefined"!=typeof document,L=function(t){function e(n){var r;return(r=t.call(this,n)||this).instances=[],r.value={setHelmet:function(t){r.props.context.helmet=t},helmetInstances:{get:function(){return r.instances},add:function(t){r.instances.push(t)},remove:function(t){var e=r.instances.indexOf(t);r.instances.splice(e,1)}}},e.canUseDOM||(n.context.helmet=j({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),r}return p(e,t),e.prototype.render=function(){return i.a.createElement(P.Provider,{value:this.value},this.props.children)},e}(r.Component);L.canUseDOM=N,L.propTypes={context:a.a.shape({helmet:a.a.shape()}),children:a.a.node.isRequired},L.defaultProps={context:{}},L.displayName="HelmetProvider";var D=function(t,e){var n,r=document.head||document.querySelector(m.HEAD),i=r.querySelectorAll(t+"[data-rh]"),o=[].slice.call(i),a=[];return e&&e.length&&e.forEach((function(e){var r=document.createElement(t);for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&("innerHTML"===i?r.innerHTML=e.innerHTML:"cssText"===i?r.styleSheet?r.styleSheet.cssText=e.cssText:r.appendChild(document.createTextNode(e.cssText)):r.setAttribute(i,void 0===e[i]?"":e[i]));r.setAttribute("data-rh","true"),o.some((function(t,e){return n=e,r.isEqualNode(t)}))?o.splice(n,1):a.push(r)})),o.forEach((function(t){return t.parentNode.removeChild(t)})),a.forEach((function(t){return r.appendChild(t)})),{oldTags:o,newTags:a}},F=function(t,e){var n=document.getElementsByTagName(t)[0];if(n){for(var r=n.getAttribute("data-rh"),i=r?r.split(","):[],o=[].concat(i),a=Object.keys(e),s=0;s<a.length;s+=1){var u=a[s],c=e[u]||"";n.getAttribute(u)!==c&&n.setAttribute(u,c),-1===i.indexOf(u)&&i.push(u);var l=o.indexOf(u);-1!==l&&o.splice(l,1)}for(var h=o.length-1;h>=0;h-=1)n.removeAttribute(o[h]);i.length===o.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==a.join(",")&&n.setAttribute("data-rh",a.join(","))}},U=function(t,e){var n=t.baseTag,r=t.htmlAttributes,i=t.linkTags,o=t.metaTags,a=t.noscriptTags,s=t.onChangeClientState,u=t.scriptTags,c=t.styleTags,l=t.title,h=t.titleAttributes;F(m.BODY,t.bodyAttributes),F(m.HTML,r),function(t,e){void 0!==t&&document.title!==t&&(document.title=O(t)),F(m.TIT
vendor: 2,913 bytes, line 2
2LE,e)}(l,h);var f={baseTag:D(m.BASE,n),linkTags:D(m.LINK,i),metaTags:D(m.META,o),noscriptTags:D(m.NOSCRIPT,a),scriptTags:D(m.SCRIPT,u),styleTags:D(m.STYLE,c)},d={},p={};Object.keys(f).forEach((function(t){var e=f[t],n=e.newTags,r=e.oldTags;n.length&&(d[t]=n),r.length&&(p[t]=f[t].oldTags)})),e&&e(),s(t,d,p)},B=null,V=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).rendered=!1,e}p(e,t);var n=e.prototype;return n.shouldComponentUpdate=function(t){return!f()(t,this.props)},n.componentDidUpdate=function(){this.emitChange()},n.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},n.emitChange=function(){var t,e,n=this.props.context,r=n.setHelmet,i=null,o=(t=n.helmetInstances.get().map((function(t){var e=d({},t.props);return delete e.context,e})),{baseTag:E(["href"],t),bodyAttributes:T("bodyAttributes",t),defer:_(t,"defer"),encode:_(t,"encodeSpecialCharacters"),htmlAttributes:T("htmlAttributes",t),linkTags:S(m.LINK,["rel","href"],t),metaTags:S(m.META,["name","charset","http-equiv","property","itemprop"],t),noscriptTags:S(m.NOSCRIPT,["innerHTML"],t),onChangeClientState:x(t),scriptTags:S(m.SCRIPT,["src","innerHTML"],t),styleTags:S(m.STYLE,["cssText"],t),title:w(t),titleAttributes:T("titleAttributes",t)});L.canUseDOM?(e=o,B&&cancelAnimationFrame(B),e.defer?B=requestAnimationFrame((function(){U(e,(function(){B=null}))})):(U(e),B=null)):j&&(i=j(o)),r(i)},n.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},n.render=function(){return this.init(),null},e}(r.Component);V.propTypes={context:R.isRequired},V.displayName="HelmetDispatcher";var z=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var n=e.prototype;return n.shouldComponentUpdate=function(t){return!u()(this.props,t)},n.mapNestedChildrenToProps=function(t,e){if(!e)return null;switch(t.type){case m.SCRIPT:case m.NOSCRIPT:return{innerHTML:e};case m.STYLE:return{cssText:e};default:throw new Error("<"+t.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(t){var e,n=t.child,r=t.arrayTypeChildren;return d({},r,((e={})[n.type]=[].concat(r[n.type]||[],[d({},t.newChildProps,this.mapNestedChildrenToProps(n,t.nestedChildren))]),e))},n.mapObjectTypeChildren=function(t){var e,n,r=t.child,i=t.newProps,o=t.newChildProps,a=t.nestedChildren;switch(r.type){case m.TITLE:return d({},i,((e={})[r.type]=a,e.titleAttributes=d({},o),e));case m.BODY:return d({},i,{bodyAttributes:d({},o)});case m.HTML:return d({},i,{htmlAttributes:d({},o)});default:return d({},i,((n={})[r.type]=d({},o),n))}},n.mapArrayTypeChildrenToProps=function(t,e){var n=d({},e);return Object.keys(t).forEach((function(e){var r;n=d({},n,((r={})[e]=t[e],r))})),n}
2,n.warnOnInvalidChildren=function(t,e){return l()(g.some((function(e){return t.type===e})),"function"==typeof t.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+g.join(", ")+" are allowed. Helmet does not support rendering <"+t.type+"> elements. Refer to our API for more information."),l()(!e||"string"==typeof e||Array.isArray(e)&&!e.some((function(t){return"string"!=typeof t})),"Helmet expects a string as a child of <"+t.type+">. Did you forget to wrap your children in braces? ( <"+t.type+">{``}</"+t.type+"> ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(t,e){var n=this,r={};return i.a.Children.forEach(t,(function(t){if(t&&t.props){var i=t.props,o=i.children,a=v(i,["children"]),s=Object.keys(a).reduce((function(t,e){return t[b[e]||e]=a[e],t}),{}),u=t.type;switch("symbol"==typeof u?u=u.toString():n.warnOnInvalidChildren(t,o),u){case m.FRAGMENT:e=n.mapChildrenToProps(o,e);break;case m.LINK:case m.META:case m.NOSCRIPT:case m.SCRIPT:case m.STYLE:r=n.flattenArrayTypeChildren({child:t,arrayTypeChildren:r,newChildProps:s,nestedChildren:o});break;default:e=n.mapObjectTypeChildren({child:t,newProps:e,newChildProps:s,nestedChildren:o})}}})),this.mapArrayTypeChildrenToProps(r,e)},n.render=function(){var t=this.props,e=t.children,n=d({},v(t,["children"]));return e&&(n=this.mapChildrenToProps(e,n)),i.a.createElement(P.Consumer,null,(function(t){return i.a.createElement(V,d({},n,{context:t}))}))},e}(r.Component);z.propTypes={base:a.a.object,bodyAttributes:a.a.object,children:a.a.oneOfType([a.a.arrayOf(a.a.node),a.a.node]),defaultTitle:a.a.string,defer:a.a.bool,encodeSpecialCharacters:a.a.bool,htmlAttributes:a.a.object,link:a.a.arrayOf(a.a.object),meta:a.a.arrayOf(a.a.object),noscript:a.a.arrayOf(a.a.object),onChangeClientState:a.a.func,script:a.a.arrayOf(a.a.object),style:a.a.arrayOf(a.a.object),title:a.a.string,titleAttributes:a.a.object,titleTemplate:a.a.string},z.defaultProps={defer:!0,encodeSpecialCharacters:!0},z.displayName="Helmet"},,function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(t,e){for(var n,s,u=a(t),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))i.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var h=0;h<s.length;h++)o.call(n,s[h])&&(u[s[h]]=n[s[h]])}}return u}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){var r=n(31),i=n(32),o=n(33),a=n(34),s=n(46),u=function(t){"use strict";o(n,t);var e=a(n);function n(t){var i;return r(this,n),(i=e.call(this)).opts=t,i.query=t.query,i.readyState="",i.socket=t.socket,i}return i(n,[{key:"onError",value:function(t,e){var n=new Error(t);
2return n.type="TransportError",n.description=e,this.emit("error",n),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,this.emit("open")}},{key:"onData",value:function(t){var e=s.decodePacket(t,this.socket.binaryType);this.onPacket(e)}},{key:"onPacket",value:function(t){this.emit("packet",t)}},{key:"onClose",value:function(){this.readyState="closed",this.emit("close")}}]),n}(n(47));t.exports=u},function(t,e){e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),r=0,i=n.length;r<i;r++){var o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}},function(t,e,n){"use strict";var r=n(50),i=n(40),o=n(33),a=n(34),s=n(31),u=n(32);Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;var c,l=n(47),h=n(127),f=n(75),d=n(36)("socket.io-parser");e.protocol=5,function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(c=e.PacketType||(e.PacketType={}));var p=function(){function t(){s(this,t)}return u(t,[{key:"encode",value:function(t){return d("encoding packet %j",t),t.type!==c.EVENT&&t.type!==c.ACK||!f.hasBinary(t)?[this.encodeAsString(t)]:(t.type=t.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,this.encodeAsBinary(t))}},{key:"encodeAsString",value:function(t){var e=""+t.type;return t.type!==c.BINARY_EVENT&&t.type!==c.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data)),d("encoded %j as %s",t,e),e}},{key:"encodeAsBinary",value:function(t){var e=h.deconstructPacket(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}}]),t}();e.Encoder=p;var v=function(t){o(n,t);var e=a(n);function n(){return s(this,n),e.call(this)}return u(n,[{key:"add",value:function(t){var e;if("string"===typeof t)(e=this.decodeString(t)).type===c.BINARY_EVENT||e.type===c.BINARY_ACK?(this.reconstructor=new m(e),0===e.attachments&&r(i(n.prototype),"emit",this).call(this,"decoded",e)):r(i(n.prototype),"emit",this).call(this,"decoded",e);else{if(!f.isBinary(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,r(i(n.prototype),"emit",this).call(this,"decoded",e))}}},{key:"decodeString",value:function(t){var e=0,r={type:Number(t.charAt(0))};if(void 0===c[r.type])throw new Error("unknown packet type "+r.type);if(r.type===c.BINARY_EVENT||r.type===c.BINARY_ACK){for(var i=e+1;"-"!==t.charAt(++e)&&e!=t.length;);var o=t.substring(i,e);if(o!=Number(o)||"-"!==t.charAt(e))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===t.charAt(e+1)){for(var a=e+1;++e;){if(","===t.charAt(e))break;if(e===t.length)break}r.nsp=t.substring(a,e)}else r.nsp="/";var s=t.charAt(e+1);if(""!==s&&Number(s)==s){for(var u=e+1;++e;){var l=t.charAt(e);if(null==l||Number(l)!=l){--e;break}if(e===t.length)break}r.id=Number(t.substring(u,e+1))}if(t.charAt(++e)){var h=function(t){try{return JSON.parse(t)}catch(e){return!1}}(t.substr(e));if(!n.isPayloadValid(r.type,h))throw new Error("invalid payload");r.data=h}return d("decoded %s as %j",t,r),r}},{key:"destroy",value:function(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}],[{key:"isPayloadValid",value:function(t,e){switch(t){case c.CONNECT:return"object"===typeof e;case c.DISCONNECT:return void 0===e;case c.CONNECT_ERROR:return"string"===typeof e||"object"===typeof e;case c.EVENT:case c.BINARY_EVENT:return Array.isArray(e)&&e.length>0;case c.ACK:case c.BINARY_ACK:return Array.isArray(e)}}}]),n}(l);e.Decoder=v;var m=function(){function t(e){s(this,t),this.packet=e,this.buffers=[],this.reconPack=e}return u(t,[{key:"takeBinaryData",value:function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=h.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),t}()},function(t,e,n){"use strict";
2t.exports=function(t,e,n,r,i,o,a,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],l=0;(u=new Error(e.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){"use strict";(function(t){var r=n(13),i=n.n(r),o=n(28),a=n(19),s=n.n(a),u=1073741823,c="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:{};function l(t){var e=[];return{on:function(t){e.push(t)},off:function(t){e=e.filter((function(e){return e!==t}))},get:function(){return t},set:function(n,r){t=n,e.forEach((function(e){return e(t,r)}))}}}var h=i.a.createContext||function(t,e){var n,i,a="__create-react-context-"+function(){var t="__global_unique_id__";return c[t]=(c[t]||0)+1}()+"__",h=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).emitter=l(e.props.value),e}Object(o.a)(n,t);var r=n.prototype;return r.getChildContext=function(){var t;return(t={})[a]=this.emitter,t},r.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var n,r=this.props.value,i=t.value;((o=r)===(a=i)?0!==o||1/o===1/a:o!==o&&a!==a)?n=0:(n="function"===typeof e?e(r,i):u,0!==(n|=0)&&this.emitter.set(t.value,n))}var o,a},r.render=function(){return this.props.children},n}(r.Component);h.childContextTypes=((n={})[a]=s.a.object.isRequired,n);var f=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).state={value:t.getValue()},t.onUpdate=function(e,n){0!==((0|t.observedBits)&n)&&t.setState({value:t.getValue()})},t}Object(o.a)(n,e);var r=n.prototype;return r.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=void 0===e||null===e?u:e},r.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=void 0===t||null===t?u:t},r.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},r.getValue=function(){return this.context[a]?this.context[a].get():t},r.render=function(){return(t=this.props.children,Array.isArray(t)?t[0]:t)(this.state.value);var t},n}(r.Component);return f.contextTypes=((i={})[a]=s.a.object,i),{Provider:h,Consumer:f}};e.a=h}).call(this,n(45))},function(t,e,n){var r=n(129);t.exports=d,t.exports.parse=o,t.exports.compile=function(t,e){return s(o(t,e),e)},t.exports.tokensToFunction=s,t.exports.tokensToRegExp=f;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(t,e){for(var n,r=[],o=0,a=0,s="",l=e&&e.delimiter||"/";null!=(n=i.exec(t));){var h=n[0],f=n[1],d=n.index;if(s+=t.slice(a,d),a=d+h.length,f)s+=f[1];else{var p=t[a],v=n[2],m=n[3],g=n[4],y=n[5],b=n[6],_=n[7];s&&(r.push(s),s="");var w=null!=v&&null!=p&&p!==v,x="+"===b||"*"===b,T="?"===b||"*"===b,E=n[2]||l,S=g||y;r.push({name:m||o++,prefix:v||"",delimiter:E,optional:T,repeat:x,partial:w,asterisk:!!_,pattern:S?c(S):_?".*":"[^"+u(E)+"]+?"})}}return a<t.length&&(s+=t.substr(a)),s&&r.push(s),r}function a(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function s(t,e){for(var n=new Array(t.length),i=0;i<t.length;i++)"object"===typeof t[i]&&(n[i]=new RegExp("^(?:"+t[i].pattern+")$",h(e)));return function(e,i){for(var o="",s=e||{},u=(i||{}).pretty?a:encodeURIComponent,c=0;c<t.length;c++){var l=t[c];if("string"!==typeof l){var h,f=s[l.name];if(null==f){if(l.optional){l.partial&&(o+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(r(f)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var d=0;d<f.length;d++){if(h=u(f[d]),!n[c].test(h))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(h)+"`");o+=(0===d?l.prefix:l.delimiter)+h}}else{if(h=l.asterisk?encodeURI(f).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):u(f),!n[c].test(h))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+h+'"');o+=l.prefix+h}}else o+=l}return o}}function u(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function l(t,e){return t.keys=e,t}function h(t){return t&&t.sensitive?"":"i"}function f(t,e,n){r(e)||(n=e||n,e=[]);for(var i=(n=n||{}).strict,o=!1!==n.end,a="",s=0;s<t.length;s++){var c=t[s];if("string"===typeof c)a+=u(c);else{var f=u(c.prefix),d="(?:"+c.pattern+")";e.push(c),c.repeat&&(d+="(?:"+f+d+")*"),a+=d=c.optional?c.partial?f+"("+d+")?":"(?:"+f+"("+d+"))?":f+"("+d+")"}}var p=u(n.delimiter||"/"),v=a.slice(-p.length)===p;
2return i||(a=(v?a.slice(0,-p.length):a)+"(?:"+p+"(?=$))?"),a+=o?"$":i&&v?"":"(?="+p+"|$)",l(new RegExp("^"+a,h(n)),e)}function d(t,e,n){return r(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return l(t,e)}(t,e):r(t)?function(t,e,n){for(var r=[],i=0;i<t.length;i++)r.push(d(t[i],e,n).source);return l(new RegExp("(?:"+r.join("|")+")",h(n)),e)}(t,e,n):function(t,e,n){return f(o(t,n),e,n)}(t,e,n)}},,function(t,e,n){"use strict";(function(t){var e=n(15);(function(){var n,r="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};var i=function(e){e=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t,e];for(var n=0;n<e.length;++n){var r=e[n];if(r&&r.Math==Math)return r}return globalThis}(this);function o(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function a(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:o(t)}}!function(t,e){if(e){var n=i;t=t.split(".");for(var o=0;o<t.length-1;o++){var a=t[o];a in n||(n[a]={}),n=n[a]}(e=e(o=n[t=t[t.length-1]]))!=o&&null!=e&&r(n,t,{configurable:!0,writable:!0,value:e})}}("Promise",(function(t){function e(t){this.b=0,this.c=void 0,this.a=[];var e=this.f();try{t(e.resolve,e.reject)}catch(n){e.reject(n)}}function n(){this.a=null}function r(t){return t instanceof e?t:new e((function(e){e(t)}))}if(t)return t;n.prototype.b=function(t){if(null==this.a){this.a=[];var e=this;this.c((function(){e.g()}))}this.a.push(t)};var o=i.setTimeout;n.prototype.c=function(t){o(t,0)},n.prototype.g=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(r){this.f(r)}}}this.a=null},n.prototype.f=function(t){this.c((function(){throw t}))},e.prototype.f=function(){function t(t){return function(r){n||(n=!0,t.call(e,r))}}var e=this,n=!1;return{resolve:t(this.m),reject:t(this.g)}},e.prototype.m=function(t){if(t===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.s(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.v(t):this.h(t)}},e.prototype.v=function(t){var e=void 0;try{e=t.then}catch(n){return void this.g(n)}"function"==typeof e?this.u(e,t):this.h(t)},e.prototype.g=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.c=e,this.l()},e.prototype.l=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)s.b(this.a[t]);this.a=null}};var s=new n;return e.prototype.s=function(t){var e=this.f();t.Qa(e.resolve,e.reject)},e.prototype.u=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(r){n.reject(r)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(n){o(n)}}:e}var i,o,a=new e((function(t,e){i=t,o=e}));return this.Qa(r(t,i),r(n,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Qa=function(t,e){function n(){switch(r.b){case 1:t(r.c);break;case 2:e(r.c);break;default:throw Error("Unexpected state: "+r.b)}}var r=this;null==this.a?s.b(n):this.a.push(n)}
2,e.resolve=r,e.reject=function(t){return new e((function(e,n){n(t)}))},e.race=function(t){return new e((function(e,n){for(var i=a(t),o=i.next();!o.done;o=i.next())r(o.value).Qa(e,n)}))},e.all=function(t){var n=a(t),i=n.next();return i.done?r([]):new e((function(t,e){function o(e){return function(n){a[e]=n,0==--s&&t(a)}}var a=[],s=0;do{a.push(void 0),s++,r(i.value).Qa(o(a.length-1),e),i=n.next()}while(!i.done)}))},e}));var s=s||{},u=this||self,c=/^[\w+/_-]+[=]{0,2}$/,l=null;function h(t){return(t=t.querySelector&&t.querySelector("script[nonce]"))&&(t=t.nonce||t.getAttribute("nonce"))&&c.test(t)?t:""}function f(){}function d(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function p(t){var e=d(t);return"array"==e||"object"==e&&"number"==typeof t.length}function v(t){return"function"==d(t)}function m(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function g(t){return Object.prototype.hasOwnProperty.call(t,y)&&t[y]||(t[y]=++b)}var y="closure_uid_"+(1e9*Math.random()>>>0),b=0;function _(t,e,n){return t.call.apply(t.bind,arguments)}function w(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function x(t,e,n){return(x=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?_:w).apply(null,arguments)}function T(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var E=Date.now;function S(t,e){function n(){}n.prototype=e.prototype,t.ab=e.prototype,t.prototype=new n,t.prototype.constructor=t}function O(t){return t}
2function k(t,e,n){this.code=A+t,this.message=e||I[t]||"",this.a=n||null}function C(t){var e=t&&t.code;return e?new k(e.substring(A.length),t.message,t.serverResponse):null}S(k,Error),k.prototype.w=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},k.prototype.toJSON=function(){return this.w()};var M,A="auth/",I={"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must al
2ways have a verified email.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invali
2d-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},j={ld:{Ta:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},sd:{Ta:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://securetoken.googleapis.com/v1/token",Wa:"https://identitytoolkit.googleapis.com/v2/",id:"p"},ud:{Ta:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Za:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},vd:{Ta:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",Za:"https://test-securetoken.sandbox.googleapis.com/v1/token",Wa:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};function P(t){for(var e in j)if(j[e].id===t)return{firebaseEndpoint:(t=j[e]).Ta,secureTokenEndpoint:t.Za,identityPlatformEndpoint:t.Wa};return null}function R(t){if(!t)return!1;
2try{return!!t.$goog_Thenable}catch(e){return!1}}function N(t){if(Error.captureStackTrace)Error.captureStackTrace(this,N);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function L(t,e){for(var n="",r=(t=t.split("%s")).length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");N.call(this,n+t[r])}function D(t,e){throw new L("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function F(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function U(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function B(){this.b=this.a=null}M=P("__EID__")?"__EID__":void 0,S(N,Error),N.prototype.name="CustomError",S(L,N),L.prototype.name="AssertionError",F.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var V=new F((function(){return new H}),(function(t){t.reset()}));function z(){var t=_e,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function H(){this.next=this.b=this.a=null}B.prototype.add=function(t,e){var n=V.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},H.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},H.prototype.reset=function(){this.next=this.b=this.a=null};var q=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"===typeof t)return"string"!==typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},W=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"===typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};var G=Array.prototype.filter?function(t,e){return Array.prototype.filter.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=[],i=0,o="string"===typeof t?t.split(""):t,a=0;a<n;a++)if(a in o){var s=o[a];e.call(void 0,s,a,t)&&(r[i++]=s)}return r},Y=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=Array(n),i="string"===typeof t?t.split(""):t,o=0;o<n;o++)o in i&&(r[o]=e.call(void 0,i[o],o,t));return r},X=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r="string"===typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t))return!0;return!1};function K(t,e){return 0<=q(t,e)}function Q(t,e){var n;return(n=0<=(e=q(t,e)))&&Array.prototype.splice.call(t,e,1),n}function J(t,e){!function(t,e){for(var n="string"===typeof t?t.split(""):t,r=t.length-1;0<=r;--r)r in n&&e.call(void 0,n[r],r,t)}(t,(function(n,r){e.call(void 0,n,r,t)&&1==Array.prototype.splice.call(t,r,1).length&&0}))}function Z(t){return Array.prototype.concat.apply([],arguments)}function $(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}var tt,et=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]},nt=/&/g,rt=/</g,it=/>/g,ot=/"/g,at=/'/g,st=/\x00/g,ut=/[\x00&<>"']/;function ct(t,e){return-1!=t.indexOf(e)}function lt(t,e){return t<e?-1:t>e?1:0}t:{var ht=u.navigator;if(ht){var ft=ht.userAgent;if(ft){tt=ft;break t}}tt=""}function dt(t){return ct(tt,t)}function pt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function vt(t){for(var e in t)return!1;return!0}function mt(t){var e,n={};for(e in t)n[e]=t[e];return n}var gt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function yt(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<gt.length;o++)n=gt[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function bt(t,e){t:{try{var n=t&&t.ownerDocument,r=n&&(n.defaultView||n.parentWindow);if((r=r||u).Element&&r.Location){var i=r;break t}}catch(a){}i=null}if(i&&"undefined"!=typeof i[e]&&(!t||!(t instanceof i[e])&&(t instanceof i.Location||t instanceof i.Element))){if(m(t))try{var o=t.constructor.displayName||t.constructor.name||Object.prototype.toString.call(t)}catch(a){o="<object could not be stringified>"}else o=void 0===t?"undefined":null===t?"null":typeof t;D("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function _t(t,e){this.a=t===Et&&e||"",this.b=Tt}function wt(t){return t instanceof _t&&t.constructor===_t&&t.b===Tt?t.a:(D("expected object of type Const, got '"+t+"'"),"type_error:Const")}_t.prototype.sa=!0,_t.prototype.ra=function(){return this.a},_t.prototype.toString=function(){return"Const{"+this.a+"}"};var xt,Tt={},Et={};function St(){if(void 0===xt){var t=null,e=u.trustedTypes;if(e&&e.createPolicy){try{t=e.createPolicy("goog#html",{createHTML:O,createScript:O,createScriptURL:O})}catch(n){u.console&&u.console.error(n.message)}xt=t}else xt=t}return xt}function Ot(t,e){this.a=e===It?t:""}function kt(t){return t instanceof Ot&&t.constructor===Ot?t.a:(D("expected object of type TrustedResourceUrl, got '"+t+"' of type "+d(t)),"type_error:TrustedResourceUrl")}function Ct(t,e){var n=wt(t);if(!At.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(t){var e=St();return new Ot(t=e?e.createScriptURL(t):t,It)}(t=n.replace(Mt,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format str
2ing, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[r])instanceof _t?wt(t):encodeURIComponent(String(t))})))}Ot.prototype.sa=!0,Ot.prototype.ra=function(){return this.a.toString()},Ot.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var Mt=/%{(\w+)}/g,At=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,It={};function jt(t,e){this.a=e===Ut?t:""}function Pt(t){return t instanceof jt&&t.constructor===jt?t.a:(D("expected object of type SafeUrl, got '"+t+"' of type "+d(t)),"type_error:SafeUrl")}jt.prototype.sa=!0,jt.prototype.ra=function(){return this.a.toString()},jt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Rt=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font\/\w+|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i,Nt=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,Lt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Dt(t){if(t instanceof jt)return t;if(t="object"==typeof t&&t.sa?t.ra():String(t),Lt.test(t))t=new jt(t,Ut);else{var e=(t=(t=String(t)).replace(/(%0A|%0D)/g,"")).match(Nt);t=e&&Rt.test(e[1])?new jt(t,Ut):null}return t}function Ft(t){return t instanceof jt?t:(t="object"==typeof t&&t.sa?t.ra():String(t),Lt.test(t)||(t="about:invalid#zClosurez"),new jt(t,Ut))}var Ut={},Bt=new jt("about:invalid#zClosurez",Ut);function Vt(t,e,n){this.a=n===zt?t:""}Vt.prototype.sa=!0,Vt.prototype.ra=function(){return this.a.toString()},Vt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var zt={};function Ht(t,e,n,r){return t=t instanceof jt?t:Ft(t),e=e||u,n=n instanceof _t?wt(n):n||"",e.open(Pt(t),n,r,void 0)}function qt(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}function Wt(t){return ut.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(nt,"&")),-1!=t.indexOf("<")&&(t=t.replace(rt,"<")),-1!=t.indexOf(">")&&(t=t.replace(it,">")),-1!=t.indexOf('"')&&(t=t.replace(ot,""")),-1!=t.indexOf("'")&&(t=t.replace(at,"'")),-1!=t.indexOf("\0")&&(t=t.replace(st,"�"))),t}function Gt(t){return Gt[" "](t),t}Gt[" "]=f;var Yt,Xt=dt("Opera"),Kt=dt("Trident")||dt("MSIE"),Qt=dt("Edge"),Jt=Qt||Kt,Zt=dt("Gecko")&&!(ct(tt.toLowerCase(),"webkit")&&!dt("Edge"))&&!(dt("Trident")||dt("MSIE"))&&!dt("Edge"),$t=ct(tt.toLowerCase(),"webkit")&&!dt("Edge");function te(){var t=u.document;return t?t.documentMode:void 0}t:{var ee="",ne=function(){var t=tt;return Zt?/rv:([^\);]+)(\)|;)/.exec(t):Qt?/Edge\/([\d\.]+)/.exec(t):Kt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):$t?/WebKit\/(\S+)/.exec(t):Xt?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(ne&&(ee=ne?ne[1]:""),Kt){var re=te();if(null!=re&&re>parseFloat(ee)){Yt=String(re);break t}}Yt=ee}var ie,oe={};function ae(t){return function(t,e){var n=oe;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,(function(){for(var e=0,n=et(String(Yt)).split("."),r=et(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=lt(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||lt(0==a[2].length,0==s[2].length)||lt(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e}))}if(u.document&&Kt){var se=te();ie=se||(parseInt(Yt,10)||void 0)}else ie=void 0;var ue=ie;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(fa){}var ce=!Kt||9<=Number(ue);function le(t){var e=document;return"string"===typeof t?e.getElementById(t):t}function he(t,e){pt(e,(function(e,n){e&&"object"==typeof e&&e.sa&&(e=e.ra()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:pe.hasOwnProperty(n)?t.setAttribute(pe[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}var fe,de,pe={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",
2nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function ve(t,e,n){function r(n){n&&e.appendChild("string"===typeof n?t.createTextNode(n):n)}for(var i=2;i<n.length;i++){var o=n[i];if(!p(o)||m(o)&&0<o.nodeType)r(o);else{t:{if(o&&"number"==typeof o.length){if(m(o)){var a="function"==typeof o.item||"string"==typeof o.item;break t}if(v(o)){a="function"==typeof o.item;break t}}a=!1}W(a?$(o):o,r)}}}function me(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function ge(t){u.setTimeout((function(){throw t}),0)}function ye(t,e){de||function(){if(u.Promise&&u.Promise.resolve){var t=u.Promise.resolve(void 0);de=function(){t.then(we)}}else de=function(){var t=we;!v(u.setImmediate)||u.Window&&u.Window.prototype&&!dt("Edge")&&u.Window.prototype.setImmediate==u.setImmediate?(fe||(fe=function(){var t=u.MessageChannel;if("undefined"===typeof t&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!dt("Presto")&&(t=function(){var t=me(document,"IFRAME");t.style.display="none",document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=x((function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()}),this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),"undefined"!==typeof t&&!dt("Trident")&&!dt("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).Gb;n.Gb=null,t()}},function(t){r.next={Gb:t},r=r.next,e.port2.postMessage(0)}}return function(t){u.setTimeout(t,0)}}()),fe(t)):u.setImmediate(t)}}(),be||(de(),be=!0),_e.add(t,e)}var be=!1,_e=new B;function we(){for(var t;t=z();){try{t.a.call(t.b)}catch(e){ge(e)}U(V,t)}be=!1}function xe(t,e){if(this.a=Te,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=f)try{var n=this;t.call(e,(function(t){Le(n,Ee,t)}),(function(t){if(!(t instanceof He))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}Le(n,Se,t)}))}catch(r){Le(this,Se,r)}}var Te=0,Ee=2,Se=3;function Oe(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}Oe.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var ke=new F((function(){return new Oe}),(function(t){t.reset()}));function Ce(t,e,n){var r=ke.get();return r.g=t,r.b=e,r.f=n,r}function Me(t){if(t instanceof xe)return t;var e=new xe(f);return Le(e,Ee,t),e}
2function Ae(t){return new xe((function(e,n){n(t)}))}function Ie(t,e,n){De(t,e,n,null)||ye(T(e,t))}function je(t){return new xe((function(e){var n=t.length,r=[];if(n)for(var i=function(t,i,o){n--,r[t]=i?{Pb:!0,value:o}:{Pb:!1,reason:o},0==n&&e(r)},o=0;o<t.length;o++)Ie(t[o],T(i,o,!0),T(i,o,!1));else e(r)}))}function Pe(t,e){if(t.a==Te)if(t.c){var n=t.c;if(n.b){for(var r=0,i=null,o=null,a=n.b;a&&(a.c||(r++,a.a==t&&(i=a),!(i&&1<r)));a=a.next)i||(o=a);i&&(n.a==Te&&1==r?Pe(n,e):(o?((r=o).next==n.f&&(n.f=r),r.next=r.next.next):Ue(n),Be(n,i,Se,e)))}t.c=null}else Le(t,Se,e)}function Re(t,e){t.b||t.a!=Ee&&t.a!=Se||Fe(t),t.f?t.f.next=e:t.b=e,t.f=e}function Ne(t,e,n,r){var i=Ce(null,null,null);return i.a=new xe((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(a){o(a)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof He?o(e):t(i)}catch(a){o(a)}}:o})),i.a.c=t,Re(t,i),i.a}function Le(t,e,n){t.a==Te&&(t===n&&(e=Se,n=new TypeError("Promise cannot resolve to itself")),t.a=1,De(n,t.$c,t.ad,t)||(t.i=n,t.a=e,t.c=null,Fe(t),e!=Se||n instanceof He||function(t,e){t.g=!0,ye((function(){t.g&&ze.call(null,e)}))}(t,n)))}function De(t,e,n,r){if(t instanceof xe)return Re(t,Ce(e||f,n||null,r)),!0;if(R(t))return t.then(e,n,r),!0;if(m(t))try{var i=t.then;if(v(i))return function(t,e,n,r,i){function o(t){s||(s=!0,r.call(i,t))}function a(t){s||(s=!0,n.call(i,t))}var s=!1;try{e.call(t,a,o)}catch(u){o(u)}}(t,i,e,n,r),!0}catch(o){return n.call(r,o),!0}return!1}function Fe(t){t.h||(t.h=!0,ye(t.gc,t))}function Ue(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Be(t,e,n,r){if(n==Se&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,Ve(e,n,r);else try{e.c?e.g.call(e.f):Ve(e,n,r)}catch(i){ze.call(null,i)}U(ke,e)}function Ve(t,e,n){e==Ee?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}xe.prototype.then=function(t,e,n){return Ne(this,v(t)?t:null,v(e)?e:null,n)},xe.prototype.$goog_Thenable=!0,(n=xe.prototype).oa=function(t,e){return(t=Ce(t,t,e)).c=!0,Re(this,t),this},n.o=function(t,e){return Ne(this,null,t,e)},n.cancel=function(t){if(this.a==Te){var e=new He(t);ye((function(){Pe(this,e)}),this)}},n.$c=function(t){this.a=Te,Le(this,Ee,t)},n.ad=function(t){this.a=Te,Le(this,Se,t)},n.gc=function(){for(var t;t=Ue(this);)Be(this,t,this.a,this.i);this.h=!1};var ze=ge;function He(t){N.call(this,t)}function qe(){0!=We&&(Ge[g(this)]=this),this.xa=this.xa,this.pa=this.pa}S(He,N),He.prototype.name="cancel";var We=0,Ge={};function Ye(t){if(!t.xa&&(t.xa=!0,t.Da(),0!=We)){var e=g(t);if(0!=We&&t.pa&&0<t.pa.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete Ge[e]}}qe.prototype.xa=!1,qe.prototype.Da=function(){if(this.pa)for(;this.pa.length;)this.pa.shift()()};var Xe=Object.freeze||function(t){return t},Ke=!Kt||9<=Number(ue),Qe=Kt&&!ae("9"),Je=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{u.addEventListener("test",f,e),u.removeEventListener("test",f,e)}catch(n){}return t}();function Ze(t,e){this.type=t,this.b=this.target=e,this.defaultPrevented=!1}function $e(t,e){if(Ze.call(this,t?t.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if(Zt){t:{try{Gt(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"===typeof t.pointerType?t.pointerType:tn[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}Ze.prototype.preventDefault=function(){this.defaultPrevented=!0},S($e,Ze);var tn=Xe({2:"touch",3:"pen",4:"mouse"});$e.prototype.preventDefault=function(){$e.ab.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,Qe)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},$e.prototype.g=function(){return this.a};var en="closure_listenable_"+(1e6*Math.random()|0),nn=0;function rn(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Va=i,this.key=++nn,this.va=this.Pa=!1}function on(t){t.va=!0,t.listener=null,t.proxy=null,t.src=null,t.Va=null}function an(t){this.src=t,this.a={},this.b=0}function sn(t,e){var n=e.type;n in t.a&&Q(t.a[n],e)&&(on(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function un(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.va&&o.listener==e&&o.capture==!!n&&o.Va==r)return i}return-1}an.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=un(t,e,r,i);return-1<a?(e=t[a],n||(e.Pa=!1)):((e=new rn(e,this.src,o,!!r,i)).Pa=n,t.push(e)),e};var cn="closure_lm_"+(1e6*Math.random()|0),ln={};function hn(t,e,n,r,i){if(r&&r.once)dn(t,e,n,r,i);else if(Array.isArray(e))for(var o=0;o<e.length;o++)hn(t,e[o],n,r,i);else n=xn(n),t&&t[en]?En(t,e,n,m(r)?!!r.capture:!!r,i):fn(t,e,n,!1,r,i)}function fn(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=m(i)?!!i.capture:!!i,s=_n(t);if(s||(t[cn]=s=new an(t)),!(n=s.add(e,n,r,a,o)).proxy){if(r=function(){var t=bn,e=Ke?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)Je||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(mn(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}0}}function dn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)dn(t,e[o],n,r,i);else n=xn(n),t&&t[en]?Sn(t,e,n,m(r)?!!r.capture:!!r,i):fn(t,e,n,!0,r,i)}function pn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)pn(t,e[o],n,r,i);else r=m(r)?!!r.capture:!!r,n=xn(n),t&&t[en]?(t=t.v,(e=String(e).toString())in t.a&&(-1<(n=un(o=t.a[e],n,r,i))&&(on(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=_n(t))&&(e=t.a[e.toString()],t=-1,e&&(t=un(e,n,r,i)),(n=-1<t?e[t]:null)&&vn(n))}function vn(t){if("number"!==typeof t&&t&&!t.va){var e=t.src;if(e&&e[en])sn(e.v,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(mn(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=_n(e))?(sn(n,t),0==n.b&&(n.src=null,e[cn]=null)):on(t)}}}function mn(t){return t in ln?ln[t]:ln[t]="on"+t}function gn(t,e,n,r){var i=!0;if((t=_n(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.va&&(o=yn(o,r),i=i&&!1!==o)}return i}function yn(t,e){var n=t.listener,r=t.Va||t.src;return t.Pa&&vn(t),n.call(r,e)}function bn(t,e){if(t.va)return!0;
2if(!Ke){if(!e)t:{e=["window","event"];for(var n=u,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}if(e=new $e(r=e,this),n=!0,!(0>r.keyCode||void 0!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(a){i=!0}(i||void 0==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=e.b;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){e.b=r[i];var o=gn(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.b=r[i],o=gn(r[i],t,!1,e),n=n&&o}return n}return yn(t,new $e(e,this))}function _n(t){return(t=t[cn])instanceof an?t:null}var wn="__closure_events_fn_"+(1e9*Math.random()>>>0);function xn(t){return v(t)?t:(t[wn]||(t[wn]=function(e){return t.handleEvent(e)}),t[wn])}function Tn(){qe.call(this),this.v=new an(this),this.ac=this,this.gb=null}function En(t,e,n,r,i){t.v.add(String(e),n,!1,r,i)}function Sn(t,e,n,r,i){t.v.add(String(e),n,!0,r,i)}function On(t,e,n,r){if(!(e=t.v.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.va&&a.capture==n){var s=a.listener,u=a.Va||a.src;a.Pa&&sn(t.v,a),i=!1!==s.call(u,r)&&i}}return i&&!r.defaultPrevented}function kn(t,e,n){if(v(t))n&&(t=x(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=x(t.handleEvent,t)}return 2147483647<Number(e)?-1:u.setTimeout(t,e||0)}function Cn(t){var e=null;return new xe((function(n,r){-1==(e=kn((function(){n(void 0)}),t))&&r(Error("Failed to schedule timer."))})).o((function(t){throw u.clearTimeout(e),t}))}function Mn(t){if(t.W&&"function"==typeof t.W)return t.W();if("string"===typeof t)return t.split("");if(p(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}function An(t){if(t.Y&&"function"==typeof t.Y)return t.Y();if(!t.W||"function"!=typeof t.W){if(p(t)||"string"===typeof t){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var r in e=[],n=0,t)e[n++]=r;return e}}function In(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof In)for(n=t.Y(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function jn(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Pn(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)Pn(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Pn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}S(Tn,qe),Tn.prototype[en]=!0,Tn.prototype.addEventListener=function(t,e,n,r){hn(this,t,e,n,r)},Tn.prototype.removeEventListener=function(t,e,n,r){pn(this,t,e,n,r)},Tn.prototype.dispatchEvent=function(t){var e,n=this.gb;if(n)for(e=[];n;n=n.gb)e.push(n);n=this.ac;var r=t.type||t;if("string"===typeof t)t=new Ze(t,n);else if(t instanceof Ze)t.target=t.target||n;else{var i=t;yt(t=new Ze(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var a=t.b=e[o];i=On(a,r,!0,t)&&i}if(i=On(a=t.b=n,r,!0,t)&&i,i=On(a,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=On(a=t.b=e[o],r,!1,t)&&i;return i},Tn.prototype.Da=function(){if(Tn.ab.Da.call(this),this.v){var t,e=this.v;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)on(n[r]);delete e.a[t],e.b--}}this.gb=null},(n=In.prototype).W=function(){jn(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},n.Y=function(){return jn(this),this.a.concat()},n.clear=function(){this.b={},this.c=this.a.length=0},n.get=function(t,e){return Pn(this.b,t)?this.b[t]:e},n.set=function(t,e){Pn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},n.forEach=function(t,e){for(var n=this.Y(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Rn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Nn(t,e){var n;this.a=this.l=this.c="",this.g=null,this.h=this.f="",this.i=!1,t instanceof Nn?(this.i=void 0!==e?e:t.i,Ln(this,t.c),this.l=t.l,this.a=t.a,Dn(this,t.g),this.f=t.f,Fn(this,rr(t.b)),this.h=t.h):t&&(n=String(t).match(Rn))?(this.i=!!e,Ln(this,n[1]||"",!0),this.l=Hn(n[2]||""),this.a=Hn(n[3]||"",!0),Dn(this,n[4]),this.f=Hn(n[5]||"",!0),Fn(this,n[6]||"",!0),this.h=Hn(n[7]||"")):(this.i=!!e,this.b=new Jn(null,this.i))}function Ln(t,e,n){t.c=n?Hn(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function Dn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.g=e}else t.g=null}function Fn(t,e,n){e instanceof Jn?(t.b=e,function(t,e){e&&!t.f&&(Zn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(tr(this,e),nr(this,n,t))}),t)),t.f=e}(t.b,t.i)):(n||(e=qn(e,Kn)),t.b=new Jn(e,t.i))}function Un(t,e,n){t.b.set(e,n)}function Bn(t,e){return t.b.get(e)}function Vn(t){return t instanceof Nn?new Nn(t):new Nn(t,void 0)}function zn(t,e,n,r){var i=new Nn(null,void 0);return t&&Ln(i,t),e&&(i.a=e),n&&Dn(i,n),r&&(i.f=r),i}function Hn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function qn(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,Wn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Wn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Nn.prototype.toString=function(){var t=[],e=this.c;e&&t.push(qn(e,Gn,!0),":");var n=this.a;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(qn(e,Gn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.g)&&t.push(":",String(n))),(n=this.f)&&(this.a&&"/"!=n.charAt(0)&&t.push("/"),t.push(qn(n,"/"==n.charAt(0)?Xn:Yn,!0))),(n=this.b.toString())&&t.pu
2sh("?",n),(n=this.h)&&t.push("#",qn(n,Qn)),t.join("")},Nn.prototype.resolve=function(t){var e=new Nn(this),n=!!t.c;n?Ln(e,t.c):n=!!t.l,n?e.l=t.l:n=!!t.a,n?e.a=t.a:n=null!=t.g;var r=t.f;if(n)Dn(e,t.g);else if(n=!!t.f){if("/"!=r.charAt(0))if(this.a&&!this.f)r="/"+r;else{var i=e.f.lastIndexOf("/");-1!=i&&(r=e.f.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(ct(i,"./")||ct(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],a=0;a<i.length;){var s=i[a++];"."==s?r&&a==i.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&a==i.length&&o.push("")):(o.push(s),r=!0)}r=o.join("/")}else r=i}return n?e.f=r:n=""!==t.b.toString(),n?Fn(e,rr(t.b)):n=!!t.h,n&&(e.h=t.h),e};var Gn=/[#\/\?@]/g,Yn=/[#\?:]/g,Xn=/[#\?]/g,Kn=/[#\?@]/g,Qn=/#/g;function Jn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Zn(t){t.a||(t.a=new In,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function $n(t){var e=An(t);if("undefined"==typeof e)throw Error("Keys are undefined");var n=new Jn(null,void 0);t=Mn(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];Array.isArray(o)?nr(n,i,o):n.add(i,o)}return n}function tr(t,e){Zn(t),e=ir(t,e),Pn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,Pn((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&jn(t)))}function er(t,e){return Zn(t),e=ir(t,e),Pn(t.a.b,e)}function nr(t,e,n){tr(t,e),0<n.length&&(t.c=null,t.a.set(ir(t,e),$(n)),t.b+=n.length)}function rr(t){var e=new Jn;return e.c=t.c,t.a&&(e.a=new In(t.a),e.b=t.b),e}function ir(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function or(t){var e=[];return sr(new ar,t,e),e.join("")}function ar(){}function sr(t,e,n){if(null==e)n.push("null");else{if("object"==typeof e){if(Array.isArray(e)){var r=e;e=r.length,n.push("[");for(var i="",o=0;o<e;o++)n.push(i),sr(t,r[o],n),i=",";return void n.push("]")}if(!(e instanceof String||e instanceof Number||e instanceof Boolean)){for(r in n.push("{"),i="",e)Object.prototype.hasOwnProperty.call(e,r)&&("function"!=typeof(o=e[r])&&(n.push(i),lr(r,n),n.push(":"),sr(t,o,n),i=","));return void n.push("}")}e=e.valueOf()}switch(typeof e){case"string":lr(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?String(e):"null");break;case"boolean":n.push(String(e));break;case"function":n.push("null");break;default:throw Error("Unknown type: "+typeof e)}}}(n=Jn.prototype).add=function(t,e){Zn(this),this.c=null,t=ir(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},n.clear=function(){this.a=this.c=null,this.b=0},n.forEach=function(t,e){Zn(this),this.a.forEach((function(n,r){W(n,(function(n){t.call(e,n,r,this)}),this)}),this)},n.Y=function(){Zn(this);for(var t=this.a.W(),e=this.a.Y(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},n.W=function(t){Zn(this);var e=[];if("string"===typeof t)er(this,t)&&(e=Z(e,this.a.get(ir(this,t))));else{t=this.a.W();for(var n=0;n<t.length;n++)e=Z(e,t[n])}return e},n.set=function(t,e){return Zn(this),this.c=null,er(this,t=ir(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},n.get=function(t,e){return t&&0<(t=this.W(t)).length?String(t[0]):e},n.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.Y(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.W(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var ur={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},cr=/\uffff/.test("\uffff")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function lr(t,e){e.push('"',t.replace(cr,(function(t){var e=ur[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),ur[t]=e),e})),'"')}function hr(){var t=Ir();return Kt&&!!ue&&11==ue||/Edge\/\d+/.test(t)}function fr(){return u.window&&u.window.location.href||self&&self.location&&self.location.href||""}function dr(t,e){e=e||u.window;var n="about:blank";t&&(n=Pt(Dt(t)||Bt)),e.location.href=n}function pr(t,e){var n,r=[];
2for(n in t)n in e?typeof t[n]!=typeof e[n]?r.push(n):"object"==typeof t[n]&&null!=t[n]&&null!=e[n]?0<pr(t[n],e[n]).length&&r.push(n):t[n]!==e[n]&&r.push(n):r.push(n);for(n in e)n in t||r.push(n);return r}function vr(t){return!!((t=(t||Ir()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function mr(t){t=t||u.window;try{t.close()}catch(e){}}function gr(t,e,n){var r=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(a in e={width:e,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=Ir().toLowerCase(),r&&(e.target=r,ct(n,"crios/")&&(e.target="_blank")),Cr(Ir())==Or&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof jt?n:Dt("undefined"!=typeof n.href?n.href:String(n))||Bt,n=t.target||n.target,i=[],t)switch(a){case"width":case"height":case"top":case"left":i.push(a+"="+t[a]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(a+"="+(t[a]?1:0))}var a=i.join(",");if((dt("iPhone")&&!dt("iPod")&&!dt("iPad")||dt("iPad")||dt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(bt(a=me(document,"A"),"HTMLAnchorElement"),e=e instanceof jt?e:Ft(e),a.href=Pt(e),a.setAttribute("target",n),t.noreferrer&&a.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,r,1),a.dispatchEvent(t),a={}):t.noreferrer?(a=Ht("",r,n,a),t=Pt(e),a&&(Jt&&ct(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+Wt(t)+'">',t=new Vt(t=(r=St())?r.createHTML(t):t,null,zt),r=a.document)&&(r.write(function(t){return t instanceof Vt&&t.constructor===Vt?t.a:(D("expected object of type SafeHtml, got '"+t+"' of type "+d(t)),"type_error:SafeHtml")}(t)),r.close())):(a=Ht(e,r,n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(s){}return a}var yr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,br=/^[^@]+@[^@]+$/;function _r(){var t=null;return new xe((function(e){"complete"==u.document.readyState?e():(t=function(){e()},dn(window,"load",t))})).o((function(e){throw pn(window,"load",t),e}))}function wr(t){return t=t||Ir(),!("file:"!==Lr()&&"ionic:"!==Lr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function xr(){var t=u.window;try{return!(!t||t==t.top)}catch(e){return!1}}function Tr(){return"undefined"!==typeof u.WorkerGlobalScope&&"function"===typeof u.importScripts}function Er(){return e.a.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":e.a.INTERNAL.hasOwnProperty("node")?"Node":Tr()?"Worker":"Browser"}function Sr(){var t=Er();return"ReactNative"===t||"Node"===t}var Or="Firefox",kr="Chrome";function Cr(t){var e=t.toLowerCase();return ct(e,"opera/")||ct(e,"opr/")||ct(e,"opios/")?"Opera":ct(e,"iemobile")?"IEMobile":ct(e,"msie")||ct(e,"trident/")?"IE":ct(e,"edge/")?"Edge":ct(e,"firefox/")?Or:ct(e,"silk/")?"Silk":ct(e,"blackberry")?"Blackberry":ct(e,"webos")?"Webos":!ct(e,"safari/")||ct(e,"chrome/")||ct(e,"crios/")||ct(e,"android")?!ct(e,"chrome/")&&!ct(e,"crios/")||ct(e,"edge/")?ct(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":kr:"Safari"}var Mr={md:"FirebaseCore-web",od:"FirebaseUI-web"};function Ar(t,e){e=e||[];var n,r=[],i={};for(n in Mr)i[Mr[n]]=!0;for(n=0;n<e.length;n++)"undefined"!==typeof i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=Er())?r=Cr(i=Ir()):"Worker"===r&&(r=Cr(i=Ir())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function Ir(){return u.navigator&&u.navigator.userAgent||""}function jr(t,e){t=t.split("."),e=e||u;for(var n=0;n<t.length&&"object"==typeof e&&null!=e;n++)e=e[t[n]];return n!=t.length&&(e=void 0),e}function Pr(){try{var t=u.localStorage,e=Vr();if(t)return t.setItem(e,"1"),t.removeItem(e),!hr()||!!u.indexedDB}catch(n){return Tr()&&!!u.indexedDB}return!1}function Rr(){return(Nr()||"chrome-extension:"===Lr()||wr())&&!Sr()&&Pr()&&!Tr()}function Nr(){return"http:"===Lr()||"https:"===Lr()}function Lr(){return u.location&&u.location.protocol||null}function Dr(t){return!vr(t=t||Ir())&&Cr(t)!=Or}function Fr(t){return"undefined"===typeof t?null:or(t)}function Ur(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!==t[e]&&void 0!==t[e]&&(n[e]=t[e]);return n}function Br(t){if(null!==t)return JSON.parse(t)}function Vr(t){return t||Math.floor(1e9*Math.random()).toString()}function zr(t){return"Safari"!=Cr(t=t||Ir())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function Hr(){var t=u.___jsl;if(t&&t.H)for(var e in t.H)if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=t.H[e].L.concat(),t.CP)for(var n=0;n<t.CP.length;n++)t.CP[n]=null}function qr(t,e){if(t>
2e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Ir(),e=Er(),this.b=vr(t)||"ReactNative"===e}function Wr(){var t=u.document;return!t||"undefined"===typeof t.visibilityState||"visible"==t.visibilityState}function Gr(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(n){}return null}function Yr(){return!(!jr("fireauth.oauthhelper",u)&&!jr("fireauth.iframe",u))}qr.prototype.get=function(){var t=u.navigator;return!t||"boolean"!==typeof t.onLine||!Nr()&&"chrome-extension:"!==Lr()&&"undefined"===typeof t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Xr,Kr={};function Qr(t){Kr[t]||(Kr[t]=!0,"undefined"!==typeof console&&"function"===typeof console.warn&&console.warn(t))}try{var Jr={};Object.defineProperty(Jr,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Jr,"abcd",{configurable:!0,enumerable:!0,value:2}),Xr=2==Jr.abcd}catch(fa){Xr=!1}function Zr(t,e,n){Xr?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function $r(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Zr(t,n,e[n])}function ti(t){var e={};return $r(e,t),e}function ei(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Zr(e,n,ei(t[n]));return e}function ni(t){var e=t&&(t[si]?"phone":null);if(!(e&&t&&t[ai]))throw new k("internal-error","Internal assert: invalid MultiFactorInfo object");Zr(this,"uid",t[ai]),Zr(this,"displayName",t[ii]||null);var n=null;t[oi]&&(n=new Date(t[oi]).toUTCString()),Zr(this,"enrollmentTime",n),Zr(this,"factorId",e)}function ri(t){try{var e=new ui(t)}catch(n){e=null}return e}ni.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var ii="displayName",oi="enrolledAt",ai="mfaEnrollmentId",si="phoneInfo";
2function ui(t){ni.call(this,t),Zr(this,"phoneNumber",t[si])}function ci(t){var e={},n=t[di],r=t[vi],i=t[mi];if(t=ri(t[pi]),!i||i!=hi&&i!=fi&&!n||i==fi&&!r||i==li&&!t)throw Error("Invalid checkActionCode response!");i==fi?(e[yi]=n||null,e[_i]=n||null,e[gi]=r):(e[yi]=r||null,e[_i]=r||null,e[gi]=n||null),e[bi]=t||null,Zr(this,xi,i),Zr(this,wi,ei(e))}S(ui,ni),ui.prototype.w=function(){var t=ui.ab.w.call(this);return t.phoneNumber=this.phoneNumber,t};var li="REVERT_SECOND_FACTOR_ADDITION",hi="EMAIL_SIGNIN",fi="VERIFY_AND_CHANGE_EMAIL",di="email",pi="mfaInfo",vi="newEmail",mi="requestType",gi="email",yi="fromEmail",bi="multiFactorInfo",_i="previousEmail",wi="data",xi="operation";function Ti(t){var e=Bn(t=Vn(t),Ei)||null,n=Bn(t,Si)||null,r=Bn(t,Ci)||null;if(r=r&&Ai[r]||null,!e||!n||!r)throw new k("argument-error",Ei+", "+Si+"and "+Ci+" are required in a valid action code URL.");$r(this,{apiKey:e,operation:r,code:n,continueUrl:Bn(t,Oi)||null,languageCode:Bn(t,ki)||null,tenantId:Bn(t,Mi)||null})}var Ei="apiKey",Si="oobCode",Oi="continueUrl",ki="languageCode",Ci="mode",Mi="tenantId",Ai={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:li,signIn:hi,verifyAndChangeEmail:fi,verifyEmail:"VERIFY_EMAIL"};function Ii(t){try{return new Ti(t)}catch(e){return null}}function ji(t){var e=t[Di];if("undefined"===typeof e)throw new k("missing-continue-uri");if("string"!==typeof e||"string"===typeof e&&!e.length)throw new k("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[Pi];if(n&&"object"===typeof n){e=n[Bi];var r=n[Fi];if(n=n[Ui],"string"===typeof e&&e.length){if(this.a=e,"undefined"!==typeof r&&"boolean"!==typeof r)throw new k("argument-error",Fi+" property must be a boolean when specified.");if(this.g=!!r,"undefined"!==typeof n&&("string"!==typeof n||"string"===typeof n&&!n.length))throw new k("argument-error",Ui+" property must be a non empty string when specified.");this.b=n||null}else{if("undefined"!==typeof e)throw new k("argument-error",Bi+" property must be a non empty string when specified.");if("undefined"!==typeof r||"undefined"!==typeof n)throw new k("missing-android-pkg-name")}}else if("undefined"!==typeof n)throw new k("argument-error",Pi+" property must be a non null object when specified.");if(this.f=null,(e=t[Li])&&"object"===typeof e){if("string"===typeof(e=e[Vi])&&e.length)this.f=e;else if("undefined"!==typeof e)throw new k("argument-error",Vi+" property must be a non empty string when specified.")}else if("undefined"!==typeof e)throw new k("argument-error",Li+" property must be a non null object when specified.");if("undefined"!==typeof(e=t[Ni])&&"boolean"!==typeof e)throw new k("argument-error",Ni+" property must be a boolean when specified.");if(this.c=!!e,"undefined"!==typeof(t=t[Ri])&&("string"!==typeof t||"string"===typeof t&&!t.length))throw new k("argument-error",Ri+" property must be a non empty string when specified.");this.i=t||null}var Pi="android",Ri="dynamicLinkDomain",Ni="handleCodeInApp",Li="iOS",Di="url",Fi="installApp",Ui="minimumVersion",Bi="packageName",Vi="bundleId";function zi(t){var e={};for(var n in e.continueUrl=t.h,e.canHandleCodeInApp=t.c,(e.androidPackageName=t.a)&&(e.androidMinimumVersion=t.b,e.androidInstallApp=t.g),e.iOSBundleId=t.f,e.dynamicLinkDomain=t.i,e)null===e[n]&&delete e[n];return e}var Hi=null;function qi(t){var e=[];return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=Hi[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!Hi){Hi={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++)for(var r=t.concat(e[n].split("")),i=0;i<r.length;i++){var o=r[i];void 0===Hi[o]&&(Hi[o]=i)}}}();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;e(i<<2|o>>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,(function(t){e.push(t)})),e}function Wi(t){var e=Yi(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.h=t,this.a=e.exp,this.i=e.sub,t=Date.now()/1e3,this.g=e.iat||(t>this.a?this.a:t),this.b=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.c=!!e.is_anonymous||"anonymous"==this.b}function Gi(t){try{return new Wi(t)}catch(e){return null}}function Yi(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n<e;n++)t+=".";try{var r=qi(t);for(t=[],n=e=0;e<r.length;){var i=r[e++];if(128>i)t[n++]=String.fromCharCode(i);else if(191<i&&224>i){var o=r[e++];t[n++]=String.fromCharCode((31&i)<<6|63&o)}else if(239<i&&365>
2i){o=r[e++];var a=r[e++],s=((7&i)<<18|(63&o)<<12|(63&a)<<6|63&r[e++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else o=r[e++],a=r[e++],t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}return JSON.parse(t.join(""))}catch(u){}return null}Wi.prototype.T=function(){return this.f},Wi.prototype.l=function(){return this.c},Wi.prototype.toString=function(){return this.h};var Xi="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Ki=["client_id","response_type","scope","redirect_uri","state"],Qi={nd:{Ja:"locale",ua:700,ta:600,fa:"facebook.com",Xa:Ki},pd:{Ja:null,ua:500,ta:750,fa:"github.com",Xa:Ki},qd:{Ja:"hl",ua:515,ta:680,fa:"google.com",Xa:Ki},wd:{Ja:"lang",ua:485,ta:705,fa:"twitter.com",Xa:Xi},kd:{Ja:"locale",ua:640,ta:600,fa:"apple.com",Xa:[]}};function Ji(t){for(var e in Qi)if(Qi[e].fa==t)return Qi[e];return null}function Zi(t){var e={};e["facebook.com"]=ro,e["google.com"]=oo,e["github.com"]=io,e["twitter.com"]=ao;var n=t&&t[to];try{if(n)return e[n]?new e[n](t):new no(t);if("undefined"!==typeof t[$i])return new eo(t)}catch(r){}return null}var $i="idToken",to="providerId";function eo(t){var e=t[to];if(!e&&t[$i]){var n=Gi(t[$i]);n&&n.b&&(e=n.b)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,"undefined"!==typeof t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Zr(this,"providerId",e),Zr(this,"isNewUser",n)}
2function no(t){eo.call(this,t),Zr(this,"profile",ei((t=Br(t.rawUserInfo||"{}"))||{}))}function ro(t){if(no.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function io(t){if(no.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Zr(this,"username",this.profile&&this.profile.login||null)}function oo(t){if(no.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function ao(t){if(no.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Zr(this,"username",t.screenName||null)}function so(t){var e=Vn(t),n=Bn(e,"link"),r=Bn(Vn(n),"link");return e=Bn(e,"deep_link_id"),Bn(Vn(e),"link")||e||r||n||t}function uo(t,e){if(!t&&!e)throw new k("internal-error","Internal assert: no raw session string available");if(t&&e)throw new k("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?co:lo}S(no,eo),S(ro,no),S(io,no),S(oo,no),S(ao,no);var co="enroll",lo="signin";function ho(){}function fo(t,e){return t.then((function(t){if(t[ns]){var n=Gi(t[ns]);if(!n||e!=n.i)throw new k("user-mismatch");return t}throw new k("user-mismatch")})).o((function(t){throw t&&t.code&&t.code==A+"user-not-found"?new k("user-mismatch"):t}))}function po(t,e){if(!e)throw new k("internal-error","failed to construct a credential");this.a=e,Zr(this,"providerId",t),Zr(this,"signInMethod",t)}function vo(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function mo(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new po(t.providerId,t.pendingToken)}catch(e){}return null}function go(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Zr(this,"idToken",e.idToken),e.accessToken&&Zr(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Zr(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new k("internal-error","failed to construct a credential");Zr(this,"accessToken",e.oauthToken),Zr(this,"secret",e.oauthTokenSecret)}Zr(this,"providerId",t),Zr(this,"signInMethod",n)}function yo(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:$n(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function bo(t){if(t&&t.providerId&&t.signInMethod){var e={idToken:t.oauthIdToken,accessToken:t.oauthTokenSecret?null:t.oauthAccessToken,oauthTokenSecret:t.oauthTokenSecret,oauthToken:t.oauthTokenSecret&&t.oauthAccessToken,nonce:t.nonce,pendingToken:t.pendingToken};try{return new go(t.providerId,e,t.signInMethod)}catch(n){}}return null}function _o(t,e){this.Qc=e||[],$r(this,{providerId:t,isOAuthProvider:!0}),this.Ib={},this.pb=(Ji(t)||{}).Ja||null,this.ob=null}function wo(t){if("string"!==typeof t||0!=t.indexOf("saml."))throw new k("argument-error",'SAML provider IDs must be prefixed with "saml."');_o.call(this,t,[])}function xo(t){_o.call(this,t,Ki),this.a=[]}function To(){xo.call(this,"facebook.com")}function Eo(t){if(!t)throw new k("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new To).credential({accessToken:e})}function So(){xo.call(this,"github.com")}function Oo(t){if(!t)throw new k("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new So).credential({accessToken:e})}function ko(){xo.call(this,"google.com"),this.Ca("profile")}function Co(t,e){var n=t;return m(t)&&(n=t.idToken,e=t.accessToken),(new ko).credential({idToken:n,accessToken:e})}function Mo(){_o.call(this,"twitter.com",Xi)}function Ao(t,e){var n=t;if(m(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new k("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new go("twitter.com",n,"twitter.com")}function Io(t,e,n){this.a=t,this.f=e,Zr(this,"providerId","password"),Zr(this,"signInMethod",n===Po.EMAIL_LINK_SIGN_IN_METHOD?Po.EMAIL_LINK_SIGN_IN_METHOD:Po.EMAIL_PASSWORD_SIGN_IN_METHOD)}function jo(t){return t&&t.email&&t.password?new Io(t.email,t.password,t.signInMethod):null}function Po(){$r(this,{providerId:"password",isOAuthProvider:!1})}function Ro(t,e){if(!(e=No(e)))throw new k("argument-error","Invalid email link!");return new Io(t,e.code,Po.EMAIL_LINK_SIGN_IN_METHOD)}function No(t){return(t=Ii(t=so(t)))&&t.operation===hi?t:null}function Lo(t){if(!(t.eb&&t.cb||t.La&&t.ea))throw new k("internal-error");this.a=t,Zr(this,"providerId","phone"),this.fa="phone",Zr(this,"signInMethod","phone")}function Do(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return W(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(n){t[n]&&(e[n]=t[n])})),new Lo(e)}return null}function Fo(t){return t.a.La&&t.a.ea?{temporaryProof:t.a.La,phoneNumber:t.a.ea}:{sessionInfo:t.a.eb,code:t.a.cb}}function Uo(t){try{this.a=t||e.a.auth()}catch(n){throw new k("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}$r(this,{providerId:"phone",isOAuthProvider:!1})}function Bo(t,e){if(!t)throw new k("missing-verification-id");if(!e)throw new k("missing-verification-code");return new Lo({eb:t,cb:e})}function Vo(t){if(t.temporaryProof&&t.phoneNumber)return new Lo({La:t.temporaryProof,ea:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,r=t&&t.oauthTokenSecret,i=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return Co(o,n);case"facebook.com":return Eo(n);case"github.com":return Oo(n);case"twitter.com":return Ao(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new po(e,a):new go(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new xo(e).credential({idToken:o,accessToken:n,rawNonce:i}):null}}catch(s){return null}}function zo(t){if(!t.isOAuthProvider)throw new k("invalid-oauth-provider")}function Ho(t,e,n,r,i,o,a){if(this.c=t,this.b=e||null,this.g=n||null,this.f=r||null,this.i=o||null,this.h=a||null,this.a=i||null,!this.g&&!this.a)throw new k("invalid-auth-event");
2if(this.g&&this.a)throw new k("invalid-auth-event");if(this.g&&!this.f)throw new k("invalid-auth-event")}function qo(t){return(t=t||{}).type?new Ho(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&C(t.error),t.postBody,t.tenantId):null}function Wo(){this.b=null,this.a=[]}uo.prototype.Ha=function(){return this.a?Me(this.a):Me(this.b)},uo.prototype.w=function(){return this.type==co?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},ho.prototype.ka=function(){},ho.prototype.b=function(){},ho.prototype.c=function(){},ho.prototype.w=function(){},po.prototype.ka=function(t){return Es(t,vo(this))},po.prototype.b=function(t,e){var n=vo(this);return n.idToken=e,Ss(t,n)},po.prototype.c=function(t,e){return fo(Os(t,vo(this)),e)},po.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},go.prototype.ka=function(t){return Es(t,yo(this))},go.prototype.b=function(t,e){var n=yo(this);return n.idToken=e,Ss(t,n)},go.prototype.c=function(t,e){return fo(Os(t,yo(this)),e)},go.prototype.w=function(){var t={providerId:this.providerId,sign
2InMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},_o.prototype.Ka=function(t){return this.Ib=mt(t),this},S(wo,_o),S(xo,_o),xo.prototype.Ca=function(t){return K(this.a,t)||this.a.push(t),this},xo.prototype.Qb=function(){return $(this.a)},xo.prototype.credential=function(t,e){var n;if(!(n=m(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null}).idToken&&!n.accessToken)throw new k("argument-error","credential failed: must provide the ID token and/or the access token.");return new go(this.providerId,n,this.providerId)},S(To,xo),Zr(To,"PROVIDER_ID","facebook.com"),Zr(To,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),S(So,xo),Zr(So,"PROVIDER_ID","github.com"),Zr(So,"GITHUB_SIGN_IN_METHOD","github.com"),S(ko,xo),Zr(ko,"PROVIDER_ID","google.com"),Zr(ko,"GOOGLE_SIGN_IN_METHOD","google.com"),S(Mo,_o),Zr(Mo,"PROVIDER_ID","twitter.com"),Zr(Mo,"TWITTER_SIGN_IN_METHOD","twitter.com"),Io.prototype.ka=function(t){return this.signInMethod==Po.EMAIL_LINK_SIGN_IN_METHOD?su(t,Rs,{email:this.a,oobCode:this.f}):su(t,nu,{email:this.a,password:this.f})},Io.prototype.b=function(t,e){return this.signInMethod==Po.EMAIL_LINK_SIGN_IN_METHOD?su(t,Ns,{idToken:e,email:this.a,oobCode:this.f}):su(t,Xs,{idToken:e,email:this.a,password:this.f})},Io.prototype.c=function(t,e){return fo(this.ka(t),e)},Io.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},$r(Po,{PROVIDER_ID:"password"}),$r(Po,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),$r(Po,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Lo.prototype.ka=function(t){return t.fb(Fo(this))},Lo.prototype.b=function(t,e){var n=Fo(this);return n.idToken=e,su(t,iu,n)},Lo.prototype.c=function(t,e){var n=Fo(this);return n.operation="REAUTH",fo(t=su(t,ou,n),e)},Lo.prototype.w=function(){var t={providerId:"phone"};return this.a.eb&&(t.verificationId=this.a.eb),this.a.cb&&(t.verificationCode=this.a.cb),this.a.La&&(t.temporaryProof=this.a.La),this.a.ea&&(t.phoneNumber=this.a.ea),t},Uo.prototype.fb=function(t,e){var n=this.a.a;return Me(e.verify()).then((function(r){if("string"!==typeof r)throw new k("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(e.type){case"recaptcha":var i=m(t)?t.session:null,o=m(t)?t.phoneNumber:t;return(i&&i.type==co?i.Ha().then((function(t){return function(t,e){return su(t,Qs,e).then((function(t){return t.phoneSessionInfo.sessionInfo}))}(n,{idToken:t,phoneEnrollmentInfo:{phoneNumber:o,recaptchaToken:r}})})):i&&i.type==lo?i.Ha().then((function(e){return function(t,e){return su(t,Js,e).then((function(t){return t.phoneResponseInfo.sessionInfo}))}(n,{mfaPendingCredential:e,mfaEnrollmentId:t.multiFactorHint&&t.multiFactorHint.uid||t.multiFactorUid,phoneSignInInfo:{recaptchaToken:r}})})):function(t,e){return su(t,Gs,e)}(n,{phoneNumber:o,recaptchaToken:r})).then((function(t){return"function"===typeof e.reset&&e.reset(),t}),(function(t){throw"function"===typeof e.reset&&e.reset(),t}));default:throw new k("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},$r(Uo,{PROVIDER_ID:"phone"}),$r(Uo,{PHONE_SIGN_IN_METHOD:"phone"}),Ho.prototype.getUid=function(){var t=[];return t.push(this.c),this.b&&t.push(this.b),this.f&&t.push(this.f),this.h&&t.push(this.h),t.join("-")},Ho.prototype.T=function(){return this.h},Ho.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};var Go,Yo=null;function Xo(t){var e="unauthorized-domain",n=void 0,r=Vn(t);t=r.a,"chrome-extension"==(r=r.c)?n=qt("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):"http"==r||"https"==r?n=qt("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):e="operation-not-supported-in-this-environment",k.call(this,e,n)}function Ko(t,e,n){k.call(this,t,n),(t=e||{}).Jb&&Zr(this,"email",t.Jb),t.ea&&Zr(this,"phoneNumber",t.ea),t.credential&&Zr(this,"credential",t.credential),t.Zb&&Zr(this,"tenantId",t.Zb)}function Qo(t){if(t.code){var e=t.code||"";0==e.indexOf(A)&&(e=e.substring(A.length));var n={credential:Vo(t),Zb:t.tenantId};if(t.email)n.Jb=t.email;else if(t.phoneNumber)n.ea=t.phoneNumber;else if(!n.credential)return new k(e,t.message||void 0);return new Ko(e,n,t.message)}return null}function Jo(){}function Zo(t){return t.c||(t.c=t.b())}function $o(){}function ta(t){if(!t.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.f=r}catch(i){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function ea(){}function na(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=x(this.qc,this),this.a.onerror=x(this.Sb,this),this.a.onprogress=x(this.rc,this),this.a.ontimeout=x(this.vc,this)}function ra(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function ia(t,e,n){this.reset(t,e,n,void 0,void 0)}S(Xo,k),S(Ko,k),Ko.prototype.w=function(){var t={code:this.code,message:this.message};this.email&&(t.email=this.email),this.phoneNumber&&(t.phoneNumber=this.phoneNumber),this.tenantId&&(t.tenantId=this.tenantId);var e=this.credential&&this.credential.w();return e&&yt(t,e),t},Ko.prototype.toJSON=function(){return this.w()},Jo.prototype.c=null,S($o,Jo),$o.prototype.a=function(){var t=ta(this);return t?new ActiveXObject(t):new XMLHttpRequest},$o.prototype.b=function(){var t={};return ta(this)&&(t[0]=!0,t[1]=!0),t},Go=new $o,S(ea,Jo),ea.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new na;throw Error("Unsupported browser")},ea.prototype.b=function(){return{}},(n=na.prototype).open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},n.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},n.abort=function(){this.a.abort()},n.setRequestHeader=function(){},n.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},n.qc=function(){this.status=200,this.response=this.responseText=this.a.responseText,ra(this,4)},n.Sb=function(){this.status=500,this.response=this.responseText="",ra(this,4)},n.vc=function(){this.Sb()},n.rc=function(){this.status=200,ra(this,1)},n.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},ia.prototype.a=null;function oa(t){this.f=t,this.b=this.c=this.a=null}function aa(t,e){this.name=t,this.value=e}ia.prototype.reset=function(t,e,n,r,i){"number"==typeof i||0,r||E(),delete this.a},aa.prototype.toString=function(){return this.name};var sa=new aa("SEVERE",1e3),ua=new aa("WARNING",900),ca=new aa("CONFIG",700),la=new aa("FINE",500);function ha(t){return t.c?t.c:t.a?ha(t.a):(D("Root logger has no level set."),null)}oa.prototype.log=function(t,e,n){if(t.value>=ha(this).value)for(v(e)&&(e=e()),t=new ia(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var fa,da={},pa=null;function va(t){var e;if(pa||(pa=new oa(""),da[""]=pa,pa.c=ca),!(e=da[t])){e=new oa(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=va(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,da[t]=e}return e}function ma(t,e){t&&t.log(la,e,void 0)}function ga(t){this.f=t}function ya(t){Tn.call(this),this.u=t,this.h=void 0,this.readyState=ba,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.l=new Headers,this.b=null,this.s="GET",this.f="",this.a=!1,this.i=va("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}S(ga,Jo),ga.prototype.a=function(){return new ya(this.f)},ga.prototype.b=(fa={},function(){return fa}),S(ya,Tn);var ba=0;function _a(t){t.c.read().then(t.pc.bind(t)).catch(t.Ua.bind(t))}function wa(t){t.readyState=4,t.g=null,t.c=null,t.m=null,xa(t)}function xa(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function Ta(t){Tn.call(this),this.headers=new In,this.D=t||null,this.c=!1,this.C=this.a=null,this.h=this.R=this.l="",this.f=this.O=this.i=this.J=!1,this.g=0,this.s=null,this.m=Ea,this.u=this.S=!1}(n=ya.prototype).open=function(t,e){if(this.readyState!=ba)throw this.abort(),Error("Error reopening a connection");this.s=t,this.f=e,this.readyState=1,xa(this)},n.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.l,method:this.s,credentials:this.h,cache:void 0};
2t&&(e.body=t),this.u.fetch(new Request(this.f,e)).then(this.uc.bind(this),this.Ua.bind(this))},n.abort=function(){this.response=this.responseText="",this.l=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,wa(this)),this.readyState=ba},n.uc=function(t){this.a&&(this.g=t,this.b||(this.status=this.g.status,this.statusText=this.g.statusText,this.b=t.headers,this.readyState=2,xa(this)),this.a&&(this.readyState=3,xa(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.sc.bind(this),this.Ua.bind(this)):"undefined"!==typeof u.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.m=new TextDecoder,_a(this)):t.text().then(this.tc.bind(this),this.Ua.bind(this)))))},n.pc=function(t){if(this.a){var e=this.m.decode(t.value?t.value:new Uint8Array(0),{stream:!t.done});e&&(this.response=this.responseText+=e),t.done?wa(this):xa(this),3==this.readyState&&_a(this)}},n.tc=function(t){this.a&&(this.response=this.responseText=t,wa(this))},n.sc=function(t){this.a&&(this.response=t,wa(this))},n.Ua=function(t){var e=this.i;e&&e.log(ua,"Failed to fetch url "+this.f,t instanceof Error?t:Error(t)),this.a&&wa(this)},n.setRequestHeader=function(t,e){this.l.append(t,e)},n.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.i)&&t.log(ua,"Attempting to get response header but no headers have been received for url: "+this.f,void 0),"")},n.getAllResponseHeaders=function(){if(!this.b){var t=this.i;return t&&t.log(ua,"Attempting to get all response headers but no headers have been received for url: "+this.f,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(ya.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(t){this.h=t?"include":"same-origin"}}),S(Ta,Tn);var Ea="";Ta.prototype.b=va("goog.net.XhrIo");var Sa=/^https?$/i,Oa=["POST","PUT"];function ka(t,e,n,r,i){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.l+"; newUri="+e);n=n?n.toUpperCase():"GET",t.l=e,t.h="",t.R=n,t.J=!1,t.c=!0,t.a=t.D?t.D.a():Go.a(),t.C=t.D?Zo(t.D):Zo(Go),t.a.onreadystatechange=x(t.Vb,t);try{ma(t.b,La(t,"Opening Xhr")),t.O=!0,t.a.open(n,String(e),!0),t.O=!1}catch(a){return ma(t.b,La(t,"Error opening Xhr: "+a.message)),void Ma(t,a)}e=r||"";var o=new In(t.headers);i&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(p(t)||"string"===typeof t)W(t,e,void 0);else for(var n=An(t),r=Mn(t),i=r.length,o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}(i,(function(t,e){o.set(e,t)})),i=function(t){t:{for(var e=Ca,n=t.length,r="string"===typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"===typeof t?t.charAt(e):t[e]}(o.Y()),r=u.FormData&&e instanceof u.FormData,!K(Oa,n)||i||r||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach((function(t,e){this.a.setRequestHeader(e,t)}),t),t.m&&(t.a.responseType=t.m),"withCredentials"in t.a&&t.a.withCredentials!==t.S&&(t.a.withCredentials=t.S);try{Pa(t),0<t.g&&(t.u=function(t){return Kt&&ae(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}(t.a),ma(t.b,La(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.u)),t.u?(t.a.timeout=t.g,t.a.ontimeout=x(t.Ma,t)):t.s=kn(t.Ma,t.g,t)),ma(t.b,La(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(a){ma(t.b,La(t,"Send error: "+a.message)),Ma(t,a)}}function Ca(t){return"content-type"==t.toLowerCase()}function Ma(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,Aa(t),ja(t)}function Aa(t){t.J||(t.J=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function Ia(t){if(t.c&&"undefined"!=typeof s)if(t.C[1]&&4==Ra(t)&&2==Na(t))ma(t.b,La(t,"Local request error detected and ignored"));else if(t.i&&4==Ra(t))kn(t.Vb,0,t);
2else if(t.dispatchEvent("readystatechange"),4==Ra(t)){ma(t.b,La(t,"Request complete")),t.c=!1;try{var e,n=Na(t);t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.l).match(Rn)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}i=!Sa.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<Ra(t)?t.a.statusText:""}catch(l){ma(t.b,"Can not get status: "+l.message),c=""}t.h=c+" ["+Na(t)+"]",Aa(t)}}finally{ja(t)}}}function ja(t,e){if(t.a){Pa(t);var n=t.a,r=t.C[0]?f:null;t.a=null,t.C=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){(t=t.b)&&t.log(sa,"Problem encountered resetting onreadystatechange: "+i.message,void 0)}}}function Pa(t){t.a&&t.u&&(t.a.ontimeout=null),t.s&&(u.clearTimeout(t.s),t.s=null)}function Ra(t){return t.a?t.a.readyState:0}function Na(t){try{return 2<Ra(t)?t.a.status:-1}catch(e){return-1}}function La(t,e){return e+" ["+t.R+" "+t.l+" "+Na(t)+"]"}function Da(t){var e=Xa;this.g=[],this.u=e,this.s=t||null,this.f=this.a=!1,this.c=void 0,this.v=this.C=this.i=!1,this.h=0,this.b=null,this.l=0}function Fa(t,e,n){t.a=!0,t.c=n,t.f=!e,za(t)}function Ua(t){if(t.a){if(!t.v)throw new Ha(t);t.v=!1}}function Ba(t,e,n,r){t.g.push([e,n,r]),t.a&&za(t)}function Va(t){return X(t.g,(function(t){return v(t[1])}))}function za(t){if(t.h&&t.a&&Va(t)){var e=t.h,n=Ga[e];n&&(u.clearTimeout(n.a),delete Ga[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var r=n=!1;t.g.length&&!t.i;){var i=t.g.shift(),o=i[0],a=i[1];if(i=i[2],o=t.f?a:o)try{var s=o.call(i||t.s,e);void 0!==s&&(t.f=t.f&&(s==e||s instanceof Error),t.c=e=s),(R(e)||"function"===typeof u.Promise&&e instanceof u.Promise)&&(r=!0,t.i=!0)}catch(c){e=c,t.f=!0,Va(t)||(n=!0)}}t.c=e,r&&(s=x(t.m,t,!0),r=x(t.m,t,!1),e instanceof Da?(Ba(e,s,r),e.C=!0):e.then(s,r)),n&&(e=new Wa(e),Ga[e.a]=e,t.h=e.a)}function Ha(){N.call(this)}function qa(){N.call(this)}function Wa(t){this.a=u.setTimeout(x(this.c,this),0),this.b=t}(n=Ta.prototype).Ma=function(){"undefined"!=typeof s&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",ma(this.b,La(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},n.abort=function(){this.a&&this.c&&(ma(this.b,La(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),ja(this))},n.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),ja(this,!0)),Ta.ab.Da.call(this)},n.Vb=function(){this.xa||(this.O||this.i||this.f?Ia(this):this.Jc())},n.Jc=function(){Ia(this)},n.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case Ea:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var t=this.b;return t&&t.log(sa,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(e){return ma(this.b,"Can not get response: "+e.message),null}},Da.prototype.cancel=function(t){if(this.a)this.c instanceof Da&&this.c.cancel();else{if(this.b){var e=this.b;delete this.b,t?e.cancel(t):(e.l--,0>=e.l&&e.cancel())}this.u?this.u.call(this.s,this):this.v=!0,this.a||(t=new qa(this),Ua(this),Fa(this,!1,t))}},Da.prototype.m=function(t,e){this.i=!1,Fa(this,t,e)},Da.prototype.then=function(t,e,n){var r,i,o=new xe((function(t,e){r=t,i=e}));return Ba(this,r,(function(t){t instanceof qa?o.cancel():i(t)})),o.then(t,e,n)},Da.prototype.$goog_Thenable=!0,S(Ha,N),Ha.prototype.message="Deferred has already fired",Ha.prototype.name="AlreadyCalledError",S(qa,N),qa.prototype.message="Deferred was canceled",qa.prototype.name="CanceledError",Wa.prototype.c=function(){throw delete Ga[this.a],this.b};var Ga={};function Ya(t){var e={},n=e.document||document,r=kt(t).toString(),i=me(document,"SCRIPT"),o={Wb:i,Ma:void 0},a=new Da(o),s=null,c=null!=e.timeout?e.timeout:5e3;return 0<c&&(s=window.setTimeout((function(){Ka(i,!0);var t=new Za(Ja,"Timeout reached for loading script "+r);Ua(a),Fa(a,!1,t)}),c),o.Ma=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Ka(i,e.xd||!1,s),Ua(a),Fa(a,!0,null))},i.onerror=function(){Ka(i,!0,s);var t=new Za(Qa,"Error while loading script "+r);Ua(a),Fa(a,!1,t)},yt(o=e.attributes||{}
2,{type:"text/javascript",charset:"UTF-8"}),he(i,o),function(t,e){bt(t,"HTMLScriptElement"),t.src=kt(e),(e=t.ownerDocument&&t.ownerDocument.defaultView)&&e!=u?e=h(e.document):(null===l&&(l=h(u.document)),e=l),e&&t.setAttribute("nonce",e)}(i,t),function(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}(n).appendChild(i),a}function Xa(){if(this&&this.Wb){var t=this.Wb;t&&"SCRIPT"==t.tagName&&Ka(t,!0,this.Ma)}}function Ka(t,e,n){null!=n&&u.clearTimeout(n),t.onload=f,t.onerror=f,t.onreadystatechange=f,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var Qa=0,Ja=1;function Za(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),N.call(this,n),this.code=t}function $a(t){this.f=t}function ts(t,n,r){if(this.c=t,t=n||{},this.l=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||rs,this.g=mt(t.secureTokenHeaders||is),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.v=t.firebaseTimeout||os,this.a=mt(t.firebaseHeaders||as),r&&(this.a["X-Client-Version"]=r,this.g["X-Client-Version"]=r),r="Node"==Er(),!(r=u.XMLHttpRequest||r&&e.a.INTERNAL.node&&e.a.INTERNAL.node.XMLHttpRequest)&&!Tr())throw new k("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,Tr()?this.f=new ga(self):Sr()?this.f=new $a(r):this.f=new ea,this.b=null}S(Za,N),S($a,Jo),$a.prototype.a=function(){return new this.f},$a.prototype.b=function(){return{}};var es,ns="idToken",rs=new qr(3e4,6e4),is={"Content-Type":"application/x-www-form-urlencoded"},os=new qr(3e4,6e4),as={"Content-Type":"application/json"};function ss(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function us(t,e){e&&(t.l=cs("https://securetoken.googleapis.com/v1/token",e),t.h=cs("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",e),t.i=cs("https://identitytoolkit.googleapis.com/v2/",e))}function cs(t,e){return t=Vn(t),e=Vn(e.url),t.f=t.a+t.f,Ln(t,e.c),t.a=e.a,Dn(t,e.g),t.toString()}function ls(t,e){e?(t.a["X-Client-Version"]=e,t.g["X-Client-Version"]=e):(delete t.a["X-Client-Version"],delete t.g["X-Client-Version"])}function hs(t,e,n,r,i,o,a){(function(){var t=Ir();return!((t=Cr(t)!=kr?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t)&&(!Kt||!ue||9<ue)})()||Tr()?t=x(t.u,t):(es||(es=new xe((function(t,e){!function(t,e){if(((window.gapi||{}).client||{}).request)t();else{u[ds]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))},function(t,e){Ba(t,null,e,void 0)}(Ya(Ct(fs,{onload:ds})),(function(){e(Error("CORS_UNSUPPORTED"))}))}}(t,e)}))),t=x(t.s,t)),t(e,n,r,i,o,a)}ts.prototype.T=function(){return this.b},ts.prototype.u=function(t,e,n,r,i,o){if(Tr()&&("undefined"===typeof u.fetch||"undefined"===typeof u.Headers||"undefined"===typeof u.Request))throw new k("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var a=new Ta(this.f);if(o){a.g=Math.max(0,o);var s=setTimeout((function(){a.dispatchEvent("timeout")}),o)}En(a,"complete",(function(){s&&clearTimeout(s);var t=null;try{t=JSON.parse(function(t){try{return t.a?t.a.responseText:""}catch(e){return ma(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(n){t=null}e&&e(t)})),Sn(a,"ready",(function(){s&&clearTimeout(s),Ye(this)})),Sn(a,"timeout",(function(){s&&clearTimeout(s),Ye(this),e&&e(null)})),ka(a,t,n,r,i)};var fs=new _t(Et,"https://apis.google.com/js/client.js?onload=%{onload}"),ds="__fcb"+Math.floor(1e6*Math.random()).toString();function ps(t,e,n,r,i,o,a){var s=Vn(e+n);Un(s,"key",t.c),a&&Un(s,"cb",E().toString());var u="GET"==r;if(u)for(var c in i)i.hasOwnProperty(c)&&Un(s,c,i[c]);return new xe((function(e,n){hs(t,s.toString(),(function(t){t?t.error?n(cu(t,o||{})):e(t):n(new k("network-request-failed"))}),r,u?void 0:or(Ur(i)),t.a,t.v.get())}))}function vs(t){if("string"!==typeof(t=t.email)||!br.test(t))throw new k("invalid-email")}function ms(t){"email"in t&&vs(t)}function gs(t){if(!t[ns]){if(t.mfaPendingCredential)throw new k("multi-factor-auth-required",null,mt(t));throw new k("internal-error")}}function ys(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new k("internal-error")}else{if(!t.sessionInfo)throw new k("missing-verification-id");if(!t.code)throw new k("missing-verification-code")}}ts.prototype.s=function(t,e,n,r,i){var o=this;es.then((function(){window.gapi.client.setApiKey(o.c);var a=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:n,body:r,headers:i,authType:"none",callback:function(t){window.gapi.auth.setToken(a),e&&e(t)}})})).o((function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})}))},ts.prototype.zb=function(){return su(this,Ks,{})},ts.prototype.Bb=function(t,e){return su(this,Ys,{idToken:t,email:e})},ts.prototype.Cb=function(t,e){return su(this,Xs,{idToken:t,password:e})};
2var bs={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function _s(t){if(!t.phoneVerificationInfo)throw new k("internal-error");if(!t.phoneVerificationInfo.sessionInfo)throw new k("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new k("missing-verification-code")}function ws(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new k("internal-error")}function xs(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&(er(t=new Jn(t.postBody),"nonce")&&(e.nonce=t.get("nonce")))),e}function Ts(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=Qo(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=Qo(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=Qo(t)):t.errorMessage&&(e=uu(t.errorMessage)),e)throw e;gs(t)}function Es(t,e){return e.returnIdpCredential=!0,su(t,Zs,e)}function Ss(t,e){return e.returnIdpCredential=!0,su(t,tu,e)}function Os(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,su(t,$s,e)}function ks(t){if(!t.oobCode)throw new k("invalid-action-code")}(n=ts.prototype).Db=function(t,e){var n={idToken:t},r=[];return pt(bs,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),su(this,Ys,n)},n.vb=function(t,e){return yt(t={requestType:"PASSWORD_RESET",email:t},e),su(this,zs,t)},n.wb=function(t,e){return yt(t={requestType:"EMAIL_SIGNIN",email:t},e),su(this,Us,t)},n.ub=function(t,e){return yt(t={requestType:"VERIFY_EMAIL",idToken:t},e),su(this,Bs,t)},n.Eb=function(t,e,n){return yt(t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},n),su(this,Vs,t)},n.fb=function(t){return su(this,ru,t)},n.nb=function(t,e){return su(this,Ws,{oobCode:t,newPassword:e})},n.Ra=function(t){return su(this,Ms,{oobCode:t})},n.jb=function(t){return su(this,Cs,{oobCode:t})};var Cs={endpoint:"setAccountInfo",A:ks,Z:"email",B:!0},Ms={endpoint:"resetPassword",A:ks,G:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new k("internal-error")},B:!0},As={endpoint:"signupNewUser",A:function(t){if(vs(t),!t.password)throw new k("weak-password")},G:gs,V:!0,B:!0},Is={endpoint:"createAuthUri",B:!0},js={endpoint:"deleteAccount",N:["idToken"]},Ps={endpoint:"setAccountInfo",N:["idToken","deleteProvider"],A:function(t){if(!Array.isArray(t.deleteProvider))throw new k("internal-error")}},Rs={endpoint:"emailLinkSignin",N:["email","oobCode"],A:vs,G:gs,V:!0,B:!0},Ns={endpoint:"emailLinkSignin",N:["idToken","email","oobCode"],A:vs,G:gs,V:!0},Ls={endpoint:"accounts/mfaEnrollment:finalize",N:["idToken","phoneVerificationInfo"],A:_s,G:gs,B:!0,Na:!0},Ds={endpoint:"accounts/mfaSignIn:finalize",N:["mfaPendingCredential","phoneVerificationInfo"],A:_s,G:gs,B:!0,Na:!0},Fs={endpoint:"getAccountInfo"},Us={endpoint:"getOobConfirmationCode",N:["requestType"],A:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new k("internal-error");vs(t)},Z:"email",B:!0},Bs={endpoint:"getOobConfirmationCode",N:["idToken","requestType"],A:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new k("internal-error")},Z:"email",B:!0},Vs={endpoint:"getOobConfirmationCode",N:["idToken","newEmail","requestType"],A:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new k("internal-error")},Z:"email",B:!0},zs={endpoint:"getOobConfirmationCode",N:["requestType"],A:function(t){if("PASSWORD_RESET"!=t.requestType)throw new k("internal-error");vs(t)},Z:"email",B:!0},Hs={lb:!0,endpoint:"getProjectConfig",Ub:"GET"},qs={lb:!0,endpoint:"getRecaptchaParam",Ub:"GET",G:function(t){if(!t.recaptchaSiteKey)throw new k("internal-error")}},Ws={endpoint:"resetPassword",A:ks,Z:"email",B:!0},Gs={endpoint:"sendVerificationCode",N:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},Ys={endpoint:"setAccountInfo",N:["idToken"],A:ms,V:!0},Xs={endpoint:"setAccountInfo",N:["idToken"],A:function(t){if(ms(t),!t.password)throw new k("weak-password")},G:gs,V:!0},Ks={endpoint:"signupNewUser",G:gs,V:!0,B:!0},Qs={endpoint:"accounts/mfaEnrollment:start",N:["idToken","phoneEnrollmentInfo"],A:function(t){if(!t.phone
2EnrollmentInfo)throw new k("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new k("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new k("missing-app-credential")},G:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new k("internal-error")},B:!0,Na:!0},Js={endpoint:"accounts/mfaSignIn:start",N:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new k("missing-app-credential")},G:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new k("internal-error")},B:!0,Na:!0},Zs={endpoint:"verifyAssertion",A:ws,Ya:xs,G:Ts,V:!0,B:!0},$s={endpoint:"verifyAssertion",A:ws,Ya:xs,G:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new k("user-not-found");if(t.errorMessage)throw uu(t.errorMessage);gs(t)},V:!0,B:!0},tu={endpoint:"verifyAssertion",A:function(t){if(ws(t),!t.idToken)throw new k("internal-error")},Ya:xs,G:Ts,V:!0},eu={endpoint:"verifyCustomToken",A:function(t){if(!t.token)throw new k("invalid-custom-token")},G:gs,V:!0,B:!0},nu={endpoint:"verifyPassword",A:function(t){if(vs(t),!t.password)throw new k("wrong-password")},G:gs,V:!0,B:!0},ru={endpoint:"verifyPhoneNumber",A:ys,G:gs,B:!0},iu={endpoint:"verifyPhoneNumber",A:function(t){if(!t.idToken)throw new k("internal-error");ys(t)},G:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",Qo(t);gs(t)}},ou={Hb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:ys,G:gs,B:!0},au={endpoint:"accounts/mfaEnrollment:withdraw",N:["idToken","mfaEnrollmentId"],G:function(t){if(!!t[ns]^!!t.refreshToken)throw new k("internal-error")},B:!0,Na:!0};function su(t,e,n){if(!function(t,e){if(!e||!e.length)return!0;if(!t)return!1;for(var n=0;n<e.length;n++){var r=t[e[n]];if(void 0===r||null===r||""===r)return!1}return!0}(n,e.N))return Ae(new k("internal-error"));var r,i=!!e.Na,o=e.Ub||"POST";return Me(n).then(e.A).then((function(){return e.V&&(n.returnSecureToken=!0),e.B&&t.b&&"undefined"===typeof n.tenantId&&(n.tenantId=t.b),ps(t,i?t.i:t.h,e.endpoint,o,n,e.Hb,e.lb||!1)})).then((function(t){return r=t,e.Ya?e.Ya(n,r):r})).then(e.G).then((function(){if(!e.Z)return r;if(!(e.Z in r))throw new k("internal-error");return r[e.Z]}))}function uu(t){return cu({error:{errors:[{message:t}],code:400,message:t}})}function cu(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new k(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",yt(r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_
2NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},e||{}),e=(e=n.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<e.length?e[1]:void 0,r)if(0===n.indexOf(i))return new k(r[i],e);return!e&&t&&(e=Fr(t)),new k("internal-error",e)}function lu(t){this.b=t,this.a=null,this.rb=function(t){return(pu||(pu=new xe((function(t,e){function n(){Hr(),jr("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){Hr(),e(Error("Network Error"))},timeout:fu.get()})}if(jr("gapi.iframes.Iframe"))t();else if(jr("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();u[r]=function(){jr("gapi.load")?n():e(Error("Network Error"))},Me(Ya(r=Ct(hu,{onload:r}))).o((function(){e(Error("Network Error"))}))}})).o((function(t){throw pu=null,t})))).then((function(){return new xe((function(e,n){jr("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:jr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},(function(r){function i(){clearTimeout(o),e()}t.a=r,t.a.restyle({setHideOnLeave:!1});var o=setTimeout((function(){n(Error("Network Error"))}),du.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}(this)}var hu=new _t(Et,"https://apis.google.com/js/api.js?onload=%{onload}"),fu=new qr(3e4,6e4),du=new qr(5e3,15e3),pu=null;function vu(t,e,n,r){this.l=t,this.h=e,this.i=n,this.g=r,this.f=null,this.g?t=zn((t=Vn(this.g.url)).c,t.a,t.g,"/emulator/auth/iframe"):t=zn("https",this.l,null,"/__/auth/iframe"),this.a=t,Un(this.a,"apiKey",this.h),Un(this.a,"appName",this.i),this.b=null,this.c=[]}function mu(t,e,n,r,i,o){this.u=t,this.s=e,this.c=n,this.m=r,this.v=o,this.i=this.g=this.l=null,this.a=i,this.h=this.f=null}function gu(t){try{return e.a.app(t).auth().Ga()}catch(n){return[]}}function yu(t,e,n,r,i,o){this.s=t,this.g=e,this.b=n,this.f=o,this.c=r||null,this.i=i||null,this.l=this.u=this.C=null,this.h=[],this.m=this.a=null}function bu(t){var e=fr();return function(t){return su(t,Hs,{}).then((function(t){return t.authorizedDomains||[]}))}(t).then((function(t){t:{var n=Vn(e),r=n.c;n=n.a;for(var i=0;i<t.length;i++){var o=t[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=Vn(o).a==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:yr.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){t=!0;break t}}t=!1}
2if(!t)throw new Xo(fr())}))}function _u(t){return t.m||(t.m=_r().then((function(){if(!t.u){var e=t.c,n=t.i,r=gu(t.b),i=new vu(t.s,t.g,t.b,t.f);i.f=e,i.b=n,i.c=$(r||[]),t.u=i.toString()}t.v=new lu(t.u),function(t){if(!t.v)throw Error("IfcHandler must be initialized!");!function(t,e){t.rb.then((function(){t.a.register("authEvent",e,jr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}(t.v,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=qo(e.authEvent),n=0;n<t.h.length;n++)r=t.h[n](e)||r;return(n={}).status=r?"ACK":"ERROR",Me(n)}return n.status="ERROR",Me(n)}))}(t)}))),t.m}function wu(t){return t.l||(t.C=t.c?Ar(t.c,gu(t.b)):null,t.l=new ts(t.g,P(t.i),t.C),t.f&&us(t.l,t.f)),t.l}function xu(t,e,n,r,i,o,a,s,u,c,l,h){return(t=new mu(t,e,n,r,i,h)).l=o,t.g=a,t.i=s,t.b=mt(u||null),t.f=c,t.yb(l).toString()}function Tu(t){if(this.a=t||e.a.INTERNAL.reactNative&&e.a.INTERNAL.reactNative.AsyncStorage,!this.a)throw new k("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function Eu(t){this.b=t,this.a={},this.f=x(this.c,this)}vu.prototype.toString=function(){return this.f?Un(this.a,"v",this.f):tr(this.a.b,"v"),this.b?Un(this.a,"eid",this.b):tr(this.a.b,"eid"),this.c.length?Un(this.a,"fw",this.c.join(",")):tr(this.a.b,"fw"),this.a.toString()},mu.prototype.yb=function(t){return this.h=t,this},mu.prototype.toString=function(){if(this.v){var t=Vn(this.v.url);t=zn(t.c,t.a,t.g,"/emulator/auth/handler")}else t=zn("https",this.u,null,"/__/auth/handler");if(Un(t,"apiKey",this.s),Un(t,"appName",this.c),Un(t,"authType",this.m),this.a.isOAuthProvider){var n=this.a;try{var r=e.a.app(this.c).auth().la()}catch(u){r=null}for(var i in n.ob=r,Un(t,"providerId",this.a.providerId),n=Ur((r=this.a).Ib))n[i]=n[i].toString();i=r.Qc,n=mt(n);for(var o=0;o<i.length;o++){var a=i[o];a in n&&delete n[a]}r.pb&&r.ob&&!n[r.pb]&&(n[r.pb]=r.ob),vt(n)||Un(t,"customParameters",Fr(n))}if("function"===typeof this.a.Qb&&((r=this.a.Qb()).length&&Un(t,"scopes",r.join(","))),this.l?Un(t,"redirectUrl",this.l):tr(t.b,"redirectUrl"),this.g?Un(t,"eventId",this.g):tr(t.b,"eventId"),this.i?Un(t,"v",this.i):tr(t.b,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Bn(t,s)&&Un(t,s,this.b[s]);return this.h?Un(t,"tid",this.h):tr(t.b,"tid"),this.f?Un(t,"eid",this.f):tr(t.b,"eid"),(s=gu(this.c)).length&&Un(t,"fw",s.join(",")),t.toString()},(n=yu.prototype).Ob=function(t,e,n){var r=new k("popup-closed-by-user"),i=new k("web-storage-unsupported"),o=this,a=!1;return this.ma().then((function(){(function(t){var e={type:"webStorageSupport"};return _u(t).then((function(){return function(t,e){return t.rb.then((function(){return new xe((function(n){t.a.send(e.type,e,n,jr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}(t.v,e)})).then((function(t){if(t&&t.length&&"undefined"!==typeof t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))})(o).then((function(n){n||(t&&mr(t),e(i),a=!0)}))})).o((function(){})).then((function(){if(!a)return function(t){return new xe((function(e){return function n(){Cn(2e3).then((function(){if(t&&!t.closed)return n();e()}))}()}))}(t)})).then((function(){if(!a)return Cn(n).then((function(){e(r)}))}))},n.Xb=function(){var t=Ir();return!Dr(t)&&!zr(t)},n.Tb=function(){return!1}
2,n.Mb=function(t,e,n,r,i,o,a,s){if(!t)return Ae(new k("popup-blocked"));if(a&&!Dr())return this.ma().o((function(e){mr(t),i(e)})),r(),Me();this.a||(this.a=bu(wu(this)));var u=this;return this.a.then((function(){var e=u.ma().o((function(e){throw mr(t),i(e),e}));return r(),e})).then((function(){(zo(n),a)||dr(xu(u.s,u.g,u.b,e,n,null,o,u.c,void 0,u.i,s,u.f),t)})).o((function(t){throw"auth/network-request-failed"==t.code&&(u.a=null),t}))},n.Nb=function(t,e,n,r){this.a||(this.a=bu(wu(this)));var i=this;return this.a.then((function(){zo(e),dr(xu(i.s,i.g,i.b,t,e,fr(),n,i.c,void 0,i.i,r,i.f))})).o((function(t){throw"auth/network-request-failed"==t.code&&(i.a=null),t}))},n.ma=function(){var t=this;return _u(this).then((function(){return t.v.rb})).o((function(){throw t.a=null,new k("network-request-failed")}))},n.$b=function(){return!0},n.Ea=function(t){this.h.push(t)},n.Sa=function(t){J(this.h,(function(e){return e==t}))},(n=Tu.prototype).get=function(t){return Me(this.a.getItem(t)).then((function(t){return t&&Br(t)}))},n.set=function(t,e){return Me(this.a.setItem(t,Fr(e)))},n.U=function(t){return Me(this.a.removeItem(t))},n.ca=function(){},n.ia=function(){};var Su,Ou=[];function ku(t,e,n){vt(t.a)&&t.b.addEventListener("message",t.f),"undefined"===typeof t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function Cu(t){this.a=t}function Mu(t){this.c=t,this.b=!1,this.a=[]}function Au(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return Ae(Error("connection_unavailable"));var l=r?800:50,h="undefined"!==typeof MessageChannel?new MessageChannel:null;return new xe((function(n,r){h?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),h.port1.start(),a=setTimeout((function(){r(Error("unsupported_event"))}),l),c={messageChannel:h,onMessage:o=function(t){t.data.eventId===i&&("ack"===t.data.status?(clearTimeout(a),s=setTimeout((function(){r(Error("timeout"))}),3e3)):"done"===t.data.status?(clearTimeout(s),"undefined"!==typeof t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))}},t.a.push(c),h.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[h.port2])):r(Error("connection_unavailable"))})).then((function(e){return Iu(t,c),e})).o((function(e){throw Iu(t,c),e}))}function Iu(t,e){if(e){var n=e.messageChannel,r=e.onMessage;n&&(n.port1.removeEventListener("message",r),n.port1.close()),J(t.a,(function(t){return t==e}))}}function ju(){if(!Lu())throw new k("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=u.indexedDB,this.type="indexedDB",this.g=this.v=this.f=this.l=null,this.s=!1,this.h=null;var t=this;Tr()&&self?(this.v=function(){var t=Tr()?self:null;if(W(Ou,(function(n){n.b==t&&(e=n)})),!e){var e=new Eu(t);Ou.push(e)}return e}(),ku(this.v,"keyChanged",(function(e,n){return Vu(t).then((function(e){return 0<e.length&&W(t.a,(function(t){t(e)})),{keyProcessed:K(e,n.key)}}))})),ku(this.v,"ping",(function(){return Me(["keyChanged"])}))):function(){var t=u.navigator;return t&&t.serviceWorker?Me().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).o((function(){return null})):Me(null)}().then((function(e){(t.h=e)&&(t.g=new Mu(new Cu(e)),Au(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&K(e[0].value,"keyChanged")&&(t.s=!0)})).o((function(){})))}))}function Pu(t){return new xe((function(e,n){var r=t.m.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(e){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},r.onsuccess=function(r){(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?e(r):function(t){return new xe((function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}(t).then((function(){return Pu(t)})).then((function(t){e(t)})).o((function(t){n(t)}))}}))}function Ru(t){return t.i||(t.i=Pu(t)),t.i}function Nu(t,e){var n=0;return new xe((function r(i,o){Ru(t).then(e).then(i).o((function(e){if(!(3<++n))return Ru(t).then((function(e){return e.close(),t.i=void 0,r(i,o)})).o((function(t){o(t)}));o(e)}))}))}function Lu(){try{return!!u.indexedDB}catch(fa){return!1}}function Du(t){return t.objectStore("firebaseLocalStorage")}function Fu(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function Uu(t){return new xe((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function Bu(t,e){return t.g&&t.h&&function(){var t=u.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?Au(t.g,"keyChanged",{key:e},t.s).then((function(){})).o((function(){})):Me()}function Vu(t){return Ru(t).then((function(t){var e=Du(Fu(t,!1));return e.getAll?Uu(e.getAll()):new xe((function(t,n){var r=[],i=e.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e.continue()):t(r)},i.onerror=function(t){n(t.target.error)}}))})).then((function(e){var n={},r=[];if(0==t.b){for(r=0;r<e.length;r++)n[e[r].fbase_key]=e[r].value;r=pr(t.c,n),t.c=n}return r}))}function zu(t){t.l&&t.l.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Hu(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=Me().then((function(){if(Lu()
2){var t=Vr(),r="__sak"+t;return Su||(Su=new ju),(n=Su).set(r,t).then((function(){return n.get(r)})).then((function(e){if(e!==t)throw Error("indexedDB not supported!");return n.U(r)})).then((function(){return n})).o((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.ca((function(t){W(e.a,(function(e){e(t)}))})),t}))}function qu(){this.a={},this.type="inMemory"}function Wu(){if(!function(){var t="Node"==Er();if(!(t=Gu()||t&&e.a.INTERNAL.node&&e.a.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(n){return!1}}()){if("Node"==Er())throw new k("internal-error","The LocalStorage compatibility library was not found.");throw new k("web-storage-unsupported")}this.a=Gu()||e.a.INTERNAL.node.localStorage,this.type="localStorage"}function Gu(){try{var t=u.localStorage,e=Vr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Yu(){this.type="nullStorage"}function Xu(){if(!function(){var t="Node"==Er();if(!(t=Ku()||t&&e.a.INTERNAL.node&&e.a.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(n){return!1}}()){if("Node"==Er())throw new k("internal-error","The SessionStorage compatibility library was not found.");throw new k("web-storage-unsupported")}this.a=Ku()||e.a.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Ku(){try{var t=u.sessionStorage,e=Vr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Qu(){var t={};t.Browser=$u,t.Node=tc,t.ReactNative=ec,t.Worker=nc,this.a=t[Er()]}Eu.prototype.c=function(t){var e=t.data.eventType,n=t.data.eventId,r=this.a[e];if(r&&0<r.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var i=[];W(r,(function(e){i.push(Me().then((function(){return e(t.origin,t.data.data)})))})),je(i).then((function(r){var i=[];W(r,(function(t){i.push({fulfilled:t.Pb,value:t.value,reason:t.reason?t.reason.message:void 0})})),W(i,(function(t){for(var e in t)"undefined"===typeof t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},Cu.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},Mu.prototype.close=function(){for(;0<this.a.length;)Iu(this,this.a[0]);this.b=!0},(n=ju.prototype).set=function(t,e){var n=this,r=!1;return Nu(this,(function(e){return Uu((e=Du(Fu(e,!0))).get(t))})).then((function(i){return Nu(n,(function(o){if(o=Du(Fu(o,!0)),i)return i.value=e,Uu(o.put(i));n.b++,r=!0;var a={};return a.fbase_key=t,a.value=e,Uu(o.add(a))}))})).then((function(){return n.c[t]=e,Bu(n,t)})).oa((function(){r&&n.b--}))},n.get=function(t){return Nu(this,(function(e){return Uu(Du(Fu(e,!1)).get(t))})).then((function(t){return t&&t.value}))},n.U=function(t){var e=this,n=!1;return Nu(this,(function(r){return n=!0,e.b++,Uu(Du(Fu(r,!0)).delete(t))})).then((function(){return delete e.c[t],Bu(e,t)})).oa((function(){n&&e.b--}))},n.ca=function(t){0==this.a.length&&function(t){function e(){t.f=setTimeout((function(){t.l=Vu(t).then((function(e){0<e.length&&W(t.a,(function(t){t(e)}))})).then((function(){e()})).o((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}zu(t),e()}(this),this.a.push(t)},n.ia=function(t){J(this.a,(function(e){return e==t})),0==this.a.length&&zu(this)},(n=Hu.prototype).get=function(t){return this.b.then((function(e){return e.get(t)}))},n.set=function(t,e){return this.b.then((function(n){return n.set(t,e)}))},n.U=function(t){return this.b.then((function(e){return e.U(t)}))},n.ca=function(t){this.a.push(t)},n.ia=function(t){J(this.a,(function(e){return e==t}))},(n=qu.prototype).get=function(t){return Me(this.a[t])},n.set=function(t,e){return this.a[t]=e,Me()},n.U=function(t){return delete this.a[t],Me()},n.ca=function(){},n.ia=function(){},(n=Wu.prototype).get=function(t){var e=this;return Me().then((function(){return Br(e.a.getItem(t))}))},n.set=function(t,e){var n=this;return Me().then((function(){var r=Fr(e);null===r?n.U(t):n.a.setItem(t,r)}))},n.U=function(t){var e=this;return Me().then((function(){e.a.removeItem(t)}))},n.ca=function(t){u.window&&hn(u.window,"storage",t)},n.ia=function(t){u.window&&pn(u.window,"storage",t)},(n=Yu.prototype).get=function(){return Me(null)},n.set=function(){return Me()},n.U=function(){return Me()},n.ca=function(){},n.ia=function(){},(n=Xu.prototype).get=function(t){var e=this;return Me().then((function(){return Br(e.a.getItem(t))}))},n.set=function(t,e){var n=this;return Me().then((function(){var r=Fr(e);null===r?n.U(t):n.a.setItem(t,r)}))},n.U=function(t){var e=this;return Me().then((function(){e.a.removeItem(t)}))},n.ca=function(){},n.ia=function(){};var Ju,Zu,$u={F:Wu,bb:Xu},tc={F:Wu,bb:Xu},ec={F:Tu,bb:Yu},nc={F:Wu,bb:Yu},rc={rd:"local",NONE:"none",td:"session"};function ic(){var t=!(zr(Ir())||!xr()),e=Dr(),n=Pr();this.m=t,this.h=e,this.l=n,this.a={},Ju||(Ju=new Qu),t=Ju;try{this.g=!hr()&&Yr()||!u.indexedDB?new t.a.F:new Hu(Tr()?new qu:new t.a.F)}catch(r){this.g=new qu,this.h=!0}try{this.i=new t.a.bb}catch(r){this.i=new qu}this.v=new qu,this.f=x(this.Yb,this),this.b={}}function oc(){return Zu||(Zu=new ic),Zu}function ac(t,e){switch(e){case"session":return t.i;case"none":return t.v;default:return t.g}}function sc(t,e){return"firebase:"+t.name+(e?":"+e:"")}function uc(t,e,n){return n=sc(e,n),"local"==e.F&&(t.b[n]=null),ac(t,e.F).U(n)}function cc(t){t.c&&(clearInterval(t.c),t.c=null)}function lc(t){this.a=t,this.b=oc()}(n=ic.prototype).get=function(t,e){return ac(this,t.F).get(sc(t,e))},n.set=function(t,e,n){var r=sc(t,n),i=this,o=ac(this,t.F);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.F&&(i.b[r]=e)}))},n.addListener=function(t,e,n){t=sc(t,e),this.l&&(this.b[t]=u.localStorage.getItem(t)),vt(this.a)&&(ac(this,"local").ca(this.f),this.h||(hr()||!Yr())&&u.indexedDB||!this.l||function(t){cc(t),t.c=setInterval((function(){for(var e in t.a){var n=u.localStorage.getItem(e),r=t.b[e];n!=r&&(t.b[e]=n,n=new $e({type:"storage",key:e,target:window,oldValue:r,newValue:n,a:!0}),t.Yb(n))}}),1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},n.removeListener=function(t,e,n){t=sc(t,e),this.a[t]&&(J(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),vt(this.a)&&(ac(this,"local").ia(this.f),cc(this))},n.Yb=function(t){if(t&&t.g){var e=t.a.key;if(null==e)for(var n in this.a){var r=this.b[n];"undefined"===typeof r&&(r=null);var i=u.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.mb(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if("undefined"!==typeof t.a.a?ac(this,"local").ia(this.f):cc(this),this.m)if(n=u.localStorage.getItem(e),(r=t.a.newValue)!==n)null!==r?u.localStorage.setItem(e,r):u.localStorage.removeItem(e);else if(this.b[e]===r&&"undefined"===typeof t.a.a)return;var o=this;n=function(){"undefined"===typeof t.a.a&&o.b[e]===u.localStorage.getItem(e)||(o.b[e]=u.localStorage.getItem(e),o.mb(e))},Kt&&ue&&10==ue&&u.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}else W(t,x(this.mb,this))},n.mb=function(t){this.a[t]&&W(this.a[t],(function(t){t()}))};var hc,fc={name:"authEvent",F:"local"};function dc(){this.a=oc()}function pc(t,e){this.b=vc,this.f=u.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=u.Int32Array?new Int32Array(64):Array(64),void 0===hc&&(hc=u.Int32Array?new Int32Array(xc):xc),this.reset()}S(pc,(function(){this.b=-1}));for(var vc=64,mc=vc-1,gc=[],yc=0;yc<mc;
2yc++)gc[yc]=0;var bc=Z(128,gc);function _c(t){for(var e=t.f,n=t.l,r=0,i=0;i<e.length;)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i=4*r;for(e=16;64>e;e++){i=0|n[e-15],r=0|n[e-2];var o=(0|n[e-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[e-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)|0;n[e]=o+a|0}r=0|t.a[0],i=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],l=0|t.a[5],h=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&l^~c&h)+(0|hc[e])|0)+(0|n[e])|0)|0,o=h,h=l,l=c,c=u+a|0,u=s,s=i,i=r,r=a+f|0}t.a[0]=t.a[0]+r|0,t.a[1]=t.a[1]+i|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+l|0,t.a[6]=t.a[6]+h|0,t.a[7]=t.a[7]+o|0}function wc(t,e,n){void 0===n&&(n=e.length);var r=0,i=t.c;if("string"===typeof e)for(;r<n;)t.f[i++]=e.charCodeAt(r++),i==t.b&&(_c(t),i=0);else{if(!p(e))throw Error("message must be string or array");for(;r<n;){var o=e[r++];if(!("number"==typeof o&&0<=o&&255>=o&&o==(0|o)))throw Error("message must be a byte array");t.f[i++]=o,i==t.b&&(_c(t),i=0)}}t.c=i,t.g+=n}pc.prototype.reset=function(){this.g=this.c=0,this.a=u.Int32Array?new Int32Array(this.h):$(this.h)};var xc=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Tc(){pc.call(this,8,Ec)}S(Tc,pc);var Ec=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function Sc(t,e,n,r,i,o){this.v=t,this.i=e,this.l=n,this.m=r||null,this.u=i||null,this.s=o,this.h=e+":"+n,this.C=new dc,this.g=new lc(this.h),this.f=null,this.b=[],this.a=this.c=null}function Oc(t){return new k("invalid-cordova-configuration",t)}function kc(t){var e=new Tc;wc(e,t),t=[];var n=8*e.g;56>e.c?wc(e,bc,56-e.c):wc(e,bc,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(_c(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return function(t){return Y(t,(function(t){return 1<(t=t.toString(16)).length?t:"0"+t})).join("")}(t)}function Cc(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(r){}}function Mc(t){return t.f||(t.f=t.ma().then((function(){return new xe((function(e){t.Ea((function n(r){return e(r),t.Sa(n),!1})),function(t){function e(e){r=!0,i&&i.cancel(),Ac(t).then((function(r){var i=n;if(r&&e&&e.url){var o=null;-1!=(i=so(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"===typeof(o=Br(Bn(o=Vn(i),"firebaseError")||null))?C(o):null)?new Ho(r.c,r.b,null,null,o,null,r.T()):new Ho(r.c,r.b,i,r.f,null,null,r.T())),i=o||n}Cc(t,i)}))}var n=new Ho("unknown",null,null,null,new k("no-auth-event")),r=!1,i=Cn(500).then((function(){return Ac(t).then((function(){r||Cc(t,n)}))})),o=u.handleOpenURL;u.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(jr("BuildInfo.packageName",u).toLowerCase()+"://")&&e({url:t}),"function"===typeof o)try{o(t)}catch(n){console.error(n)}},Yo||(Yo=new Wo),function(t){var e=Yo;e.a.push(t),e.b||(e.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},"function"===typeof(t=jr("universalLinks.subscribe",u))&&t(null,e.b))}(e)}(t)}))}))),t.f}function Ac(t){var e=null;return function(t){return t.b.get(fc,t.a).then((function(t){return qo(t)}))}(t.g).then((function(n){return e=n,uc((n=t.g).b,fc,n.a)})).then((function(){return e}))}function Ic(t){this.a=t,this.b=oc()}(n=Sc.prototype).ma=function(){return this.Ia?this.Ia:this.Ia=(wr(void 0)?_r().then((function(){return new xe((function(t,e){var n=u.document,r=setTimeout((function(){e(Error("Cordova framework is not ready."))}),1e3);n.addEventListener("deviceready",(function(){clearTimeout(r),t()}),!1)}))})):Ae(Error("Cordova must run in an Android or iOS file scheme."))).then((function(){if("function"!==typeof jr("universalLinks.subscribe",u))throw Oc("cordova-universal-links-plugin-fix is not installed");if("undefined"===typeof jr("BuildInfo.packageName",u))throw Oc("cordova-plugin-buildinfo is not installed");if("function"!==typeof jr("cordova.plugins.browsertab.openUrl",u))throw Oc("cordova-plugin-browsertab is not installed");if("function"!==typeof jr("cordova.InAppBrowser.open",u))throw Oc("cordova-plugin-inappbrowser is not installed")}),(function(){throw new k("cordova-not-ready")}))}
2,n.Ob=function(t,e){return e(new k("operation-not-supported-in-this-environment")),Me()},n.Mb=function(){return Ae(new k("operation-not-supported-in-this-environment"))},n.$b=function(){return!1},n.Xb=function(){return!0},n.Tb=function(){return!0},n.Nb=function(t,e,n,r){if(this.c)return Ae(new k("redirect-operation-pending"));var i=this,o=u.document,a=null,s=null,c=null,l=null;return this.c=Me().then((function(){return zo(e),Mc(i)})).then((function(){return function(t,e,n,r,i){var o=function(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}(),a=new Ho(e,r,null,o,new k("no-auth-event"),null,i),s=jr("BuildInfo.packageName",u);if("string"!==typeof s)throw new k("invalid-cordova-configuration");var c=jr("BuildInfo.displayName",u),l={};if(Ir().toLowerCase().match(/iphone|ipad|ipod/))l.ibi=s;else{if(!Ir().toLowerCase().match(/android/))return Ae(new k("operation-not-supported-in-this-environment"));l.apn=s}c&&(l.appDisplayName=c),o=kc(o),l.sessionId=o;var h=xu(t.v,t.i,t.l,e,n,null,r,t.m,l,t.u,i,t.s);return t.ma().then((function(){var e=t.h;return t.C.a.set(fc,a.w(),e)})).then((function(){var e=jr("cordova.plugins.browsertab.isAvailable",u);if("function"!==typeof e)throw new k("invalid-cordova-configuration");var n=null;e((function(e){if(e){if("function"!==typeof(n=jr("cordova.plugins.browsertab.openUrl",u)))throw new k("invalid-cordova-configuration");n(h)}else{if("function"!==typeof(n=jr("cordova.InAppBrowser.open",u)))throw new k("invalid-cordova-configuration");e=Ir(),t.a=n(h,e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}}))}))}(i,t,e,n,r)})).then((function(){return new xe((function(t,e){s=function(){var e=jr("cordova.plugins.browsertab.close",u);return t(),"function"===typeof e&&e(),i.a&&"function"===typeof i.a.close&&(i.a.close(),i.a=null),!1},i.Ea(s),c=function(){a||(a=Cn(2e3).then((function(){e(new k("redirect-cancelled-by-user"))})))},l=function(){Wr()&&c()},o.addEventListener("resume",c,!1),Ir().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",l,!1)})).o((function(t){return Ac(i).then((function(){throw t}))}))})).oa((function(){c&&o.removeEventListener("resume",c,!1),l&&o.removeEventListener("visibilitychange",l,!1),a&&a.cancel(),s&&i.Sa(s),i.c=null}))},n.Ea=function(t){this.b.push(t),Mc(this).o((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new Ho("unknown",null,null,null,new k("no-auth-event")),t(e))}))},n.Sa=function(t){J(this.b,(function(e){return e==t}))};var jc={name:"pendingRedirect",F:"session"};function Pc(t){return uc(t.b,jc,t.a)}function Rc(t,e,n,r){this.i={},this.u=0,this.D=t,this.v=e,this.m=n,this.J=r,this.h=[],this.f=!1,this.l=x(this.s,this),this.b=new Kc,this.C=new tl,this.g=new Ic(Yc(this.v,this.m)),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.C,this.c.linkViaPopup=this.C,this.c.reauthViaPopup=this.C,this.a=Nc(this.D,this.v,this.m,M,this.J)}function Nc(t,n,r,i,o){var a=e.a.SDK_VERSION||null;return wr()?new Sc(t,n,r,a,i,o):new yu(t,n,r,a,i,o)}function Lc(t){t.f||(t.f=!0,t.a.Ea(t.l));var e=t.a;return t.a.ma().o((function(n){throw t.a==e&&t.reset(),n}))}function Dc(t){t.a.Xb()&&Lc(t).o((function(e){var n=new Ho("unknown",null,null,null,new k("operation-not-supported-in-this-environment"));Hc(e)&&t.s(n)})),t.a.Tb()||Qc(t.b)}function Fc(t,e){K(t.h,e)||t.h.push(e),t.f||function(t){return t.b.get(jc,t.a).then((function(t){return"pending"==t}))}(t.g).then((function(e){e?Pc(t.g).then((function(){Lc(t).o((function(e){var n=new Ho("unknown",null,null,null,new k("operation-not-supported-in-this-environment"));Hc(e)&&t.s(n)}))})):Dc(t)})).o((function(){Dc(t)}))}function Uc(t,e){J(t.h,(function(t){return t==e}))}Rc.prototype.reset=function(){this.f=!1,this.a.Sa(this.l),this.a=Nc(this.D,this.v,this.m,null,this.J),this.i={}},Rc.prototype.s=function(t){if(!t)throw new k("invalid-auth-event");if(6e5<=E()-this.u&&(this.i={},this.u=0),t&&t.getUid()&&this.i.hasOwnProperty(t.getUid()))return!1;for(var e=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.Fb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,r),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.u=E())),e=!0;break}}return Qc(this.b),e};var Bc=new qr(2e3,1e4),Vc=new qr(3e4,6e4);function zc(t,e,n,r,i,o,a){return t.a.Mb(e,n,r,(function(){t.f||(t.f
2=!0,t.a.Ea(t.l))}),(function(){t.reset()}),i,o,a)}function Hc(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function qc(t,e,n,r,i){var o;return function(t){return t.b.set(jc,"pending",t.a)}(t.g).then((function(){return t.a.Nb(e,n,r,i).o((function(e){if(Hc(e))throw new k("operation-not-supported-in-this-environment");return o=e,Pc(t.g).then((function(){throw o}))})).then((function(){return t.a.$b()?new xe((function(){})):Pc(t.g).then((function(){return t.qa()})).then((function(){})).o((function(){}))}))}))}function Wc(t,e,n,r,i){return t.a.Ob(r,(function(t){e.na(n,null,t,i)}),Bc.get())}Rc.prototype.qa=function(){return this.b.qa()};var Gc={};function Yc(t,e,n){return t=t+":"+e,n&&(t=t+":"+n.url),t}function Xc(t,e,n,r){var i=Yc(e,n,r);return Gc[i]||(Gc[i]=new Rc(t,e,n,r)),Gc[i]}function Kc(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Qc(t){t.g||(t.g=!0,$c(t,!1,null,null))}function Jc(t){t.g&&!t.i&&$c(t,!1,null,null)}function Zc(t,e){if(t.b=function(){return Me(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function $c(t,e,n,r){e?r?function(t,e){if(t.b=function(){return Ae(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):Zc(t,n):Zc(t,{user:null}),t.f=[],t.c=[]}function tl(){}function el(){this.ib=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.ib},set:function(t){this.ib=t},enumerable:!1})}function nl(t,e){this.a=e,Zr(this,"verificationId",t)}function rl(t,e,n,r){return new Uo(t).fb(e,n).then((function(t){return new nl(t,r)}))}function il(t){var e=Yi(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new k("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");$r(this,{token:t,expirationTime:Gr(1e3*e.exp),authTime:Gr(1e3*e.auth_time),issuedAtTime:Gr(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,signInSecondFactor:e.firebase&&e.firebase.sign_in_second_factor?e.firebase.sign_in_second_factor:null,claims:e})}function ol(t,e,n){var r=e&&e[sl];if(!r)throw new k("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=mt(e),this.g=n,this.c=new uo(null,r),this.b=[];var i=this;W(e[al]||[],(function(t){(t=ri(t))&&i.b.push(t)})),Zr(this,"auth",this.a),Zr(this,"session",this.c),Zr(this,"hints",this.b)}Kc.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Kc.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.c,r=t.b,i=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!i&&!o),"unknown"!=n||i||o?t.a?($c(this,!0,null,t.a),Me()):e.Fa(n,r)?function(t,e,n){n=n.Fa(e.c,e.b);var r=e.g,i=e.f,o=e.i,a=e.T(),s=!!e.c.match(/Redirect$/);n(r,i,a,o).then((function(e){$c(t,s,e,null)})).o((function(e){$c(t,s,null,e)}))}(this,t,e):Ae(new k("invalid-auth-event")):($c(this,!1,null,null),Me())}else Ae(new k("invalid-auth-event"))},Kc.prototype.qa=function(){var t=this;return new xe((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new k("timeout");t.a&&t.a.cancel(),t.a=Cn(Vc.get()).then((function(){t.b||(t.g=!0,$c(t,!0,null,e))}))}(t))}))},tl.prototype.h=function(t,e){if(t){var n=t.c,r=t.b;t.a?(e.na(t.c,null,t.a,t.b),Me()):e.Fa(n,r)?function(t,e){var n=t.b,r=t.c;e.Fa(r,n)(t.g,t.f,t.T(),t.i).then((function(t){e.na(r,t,null,n)})).o((function(t){e.na(r,null,t,n)}))}(t,e):Ae(new k("invalid-auth-event"))}else Ae(new k("invalid-auth-event"))},nl.prototype.confirm=function(t){return t=Bo(this.verificationId,t),this.a(t)};var al="mfaInfo",sl="mfaPendingCredential";function ul(t,e,n,r){k.call(this,"multi-factor-auth-required",r,e),this.b=new ol(t,e,n),Zr(this,"resolver",this.b)}function cl(t,e,n){if(t&&m(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new ul(e,t.serverResponse,n,t.message)}catch(r){}return null}function ll(){}function hl(t){Zr(this,"factorId",t.fa),this.a=t}function fl(t){if(hl.call(this,t),this.a.fa!=Uo.PROVIDER_ID)throw new k("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function dl(t,e){for(var n in Ze.call(this,t),e)this[n]=e[n]}function pl(t,e){this.a=t,this.b=[],this.c=x(this.yc,this),hn(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&W(e.multiFactor.enrolledFactors,(function(t){var e=null,r={};
2if(t){t.uid&&(r[ai]=t.uid),t.displayName&&(r[ii]=t.displayName),t.enrollmentTime&&(r[oi]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(r[si]=t.phoneNumber);try{e=new ui(r)}catch(i){}t=e}else t=null;t&&n.push(t)})),vl(this,n)}function vl(t,e){t.b=e,Zr(t,"enrolledFactors",e)}function ml(t,e,n){if(this.h=t,this.i=e,this.g=n,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function gl(t,e){t.stop(),t.b=Cn(function(t,e){return e?(t.a=t.c,t.g()):(e=t.a,t.a*=2,t.a>t.f&&(t.a=t.f),e)}(t,e)).then((function(){return function(){var t=u.document,e=null;return Wr()||!t?Me():new xe((function(n){e=function(){Wr()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).o((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}()})).then((function(){return t.h()})).then((function(){gl(t,!0)})).o((function(e){t.i(e)&&gl(t,!1)}))}function yl(t){this.f=t,this.b=this.a=null,this.c=Date.now()}function bl(t,e){"undefined"===typeof e&&(t.b?e=(e=t.b).a-e.g:e=0),t.c=Date.now()+1e3*e}function _l(t,e){t.b=Gi(e[ns]||""),t.a=e.refreshToken,bl(t,"undefined"!==typeof(e=e.expiresIn)?Number(e):void 0)}function wl(t,e){return function(t,e){return new xe((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?hs(t,t.l+"?key="+encodeURIComponent(t.c),(function(t){t?t.error?r(cu(t)):t.access_token&&t.refresh_token?n(t):r(new k("internal-error")):r(new k("network-request-failed"))}),"POST",$n(e).toString(),t.g,t.m.get()):r(new k("internal-error"))}))}(t.f,e).then((function(e){return t.b=Gi(e.access_token),t.a=e.refresh_token,bl(t,e.expires_in),{accessToken:t.b.toString(),refreshToken:t.a}})).o((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}function xl(t,e){this.a=t||null,this.b=e||null,$r(this,{lastSignInTime:Gr(e||null),creationTime:Gr(t||null)})}function Tl(t,e,n,r,i,o){$r(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function El(t,n,r){this.J=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null;var i=e.a.SDK_VERSION?Ar(e.a.SDK_VERSION):null;this.a=new ts(this.l,P(M),i),t.emulatorConfig&&us(this.a,t.emulatorConfig),this.b=new yl(this.a),jl(this,n[ns]),_l(this.b,n),Zr(this,"refreshToken",this.b.a),Nl(this,r||{}),Tn.call(this),this.R=!1,this.s&&Rr()&&(this.i=Xc(this.s,this.l,this.m)),this.S=[],this.h=null,this.u=function(t){return new ml((function(){return t.I(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=t.b.c-Date.now()-3e5;return 0<e?e:0}))}(this),this.aa=x(this.hb,this);var o=this;this.ya=null,this.Oa=function(t){o.wa(t.h)},this.ja=null,this.Aa=function(t){us(o.a,t.c)},this.X=null,this.$=[],this.Ba=function(t){kl(o,t.f)},this.ba=null,this.O=new pl(this,r),Zr(this,"multiFactor",this.O)}function Sl(t,e){t.ja&&pn(t.ja,"languageCodeChanged",t.Oa),(t.ja=e)&&hn(e,"languageCodeChanged",t.Oa)}function Ol(t,e){t.X&&pn(t.X,"emulatorConfigChanged",t.Aa),(t.X=e)&&hn(e,"emulatorConfigChanged",t.Aa)}function kl(t,n){t.$=n,ls(t.a,e.a.SDK_VERSION?Ar(e.a.SDK_VERSION,t.$):null)}function Cl(t,e){t.ba&&pn(t.ba,"frameworkChanged",t.Ba),(t.ba=e)&&hn(e,"frameworkChanged",t.Ba)}function Ml(t){try{return e.a.app(t.m).auth()}catch(n){throw new k("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function Al(t){t.D||t.u.b||(t.u.start(),pn(t,"tokenChanged",t.aa),hn(t,"tokenChanged",t.aa))}function Il(t){pn(t,"tokenChanged",t.aa),t.u.stop()}function jl(t,e){t.za=e,Zr(t,"_lat",e)}function Pl(t){for(var e=[],n=0;n<t.S.length;n++)e.push(t.S[n](t));return je(e).then((function(){return t}))}function Rl(t){t.i&&!t.R&&(t.R=!0,Fc(t.i,t))}function Nl(t,e){$r(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.photoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,tenantId:e.tenantId||null,metadata:new xl(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function Ll(){}function Dl(t){return Me().then((function(){if(t.D)throw new k("app-deleted")}))}function Fl(t){return Y(t.providerData,(function(t){return t.providerId}))}function Ul(t,e){e&&(Bl(t,e.providerId),t.providerData.push(e))}function Bl(t,e){J(t.providerData,(function(t){return t.providerId==e}))}function Vl(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Zr(t,e,n)}function zl(t,e){t!=e&&($r(t,{uid:e.uid,displayName:e.displayName,photoURL:e.ph
2otoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,tenantId:e.tenantId,providerData:[]}),e.metadata?Zr(t,"metadata",function(t){return new xl(t.a,t.b)}(e.metadata)):Zr(t,"metadata",new xl),W(e.providerData,(function(e){Ul(t,e)})),function(t,e){t.b=e.b,t.a=e.a,t.c=e.c}(t.b,e.b),Zr(t,"refreshToken",t.b.a),vl(t.O,e.O.b))}function Hl(t){return t.I().then((function(e){var n=t.isAnonymous;return function(t,e){return su(t.a,Fs,{idToken:e}).then(x(t.Kc,t))}(t,e).then((function(){return n||Vl(t,"isAnonymous",!1),e}))}))}function ql(t,e){e[ns]&&t.za!=e[ns]&&(_l(t.b,e),t.dispatchEvent(new dl("tokenChanged")),jl(t,e[ns]),Vl(t,"refreshToken",t.b.a))}function Wl(t,e){return Hl(t).then((function(){if(K(Fl(t),e))return Pl(t).then((function(){throw new k("provider-already-linked")}))}))}function Gl(t,e,n){return ti({user:t,credential:Vo(e),additionalUserInfo:e=Zi(e),operationType:n})}function Yl(t,e){return ql(t,e),t.reload().then((function(){return t}))}function Xl(t,n,r,i,o){if(!Rr())return Ae(new k("operation-not-supported-in-this-environment"));if(t.h&&!o)return Ae(t.h);var a=Ji(r.providerId),s=Vr(t.uid+":::"),u=null;(!Dr()||xr())&&t.s&&r.isOAuthProvider&&(u=xu(t.s,t.l,t.m,n,r,null,s,e.a.SDK_VERSION||null,null,null,t.tenantId));var c=gr(u,a&&a.ua,a&&a.ta);return i=i().then((function(){if(Ql(t),!o)return t.I().then((function(){}))})).then((function(){return zc(t.i,c,n,r,s,!!u,t.tenantId)})).then((function(){return new xe((function(e,r){t.na(n,null,new k("cancelled-popup-request"),t.g||null),t.f=e,t.C=r,t.g=s,t.c=Wc(t.i,t,n,c,s)}))})).then((function(t){return c&&mr(c),t?ti(t):null})).o((function(t){throw c&&mr(c),t})),Jl(t,i,o)}function Kl(t,e,n,r,i){if(!Rr())return Ae(new k("operation-not-supported-in-this-environment"));if(t.h&&!i)return Ae(t.h);var o=null,a=Vr(t.uid+":::");return r=r().then((function(){if(Ql(t),!i)return t.I().then((function(){}))})).then((function(){return t.ga=a,Pl(t)})).then((function(e){return t.ha&&(e=(e=t.ha).b.set(th,t.w(),e.a)),e})).then((function(){return qc(t.i,e,n,a,t.tenantId)})).o((function(e){if(o=e,t.ha)return eh(t.ha);throw o})).then((function(){if(o)throw o})),Jl(t,r,i)}function Ql(t){if(!t.i||!t.R){if(t.i&&!t.R)throw new k("internal-error");throw new k("auth-domain-config-required")}}function Jl(t,e,n){var r=function(t,e,n){return t.h&&!n?(e.cancel(),Ae(t.h)):e.o((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.h||t.dispatchEvent(new dl("userInvalidated")),t.h=e),e}))}(t,e,n);return t.J.push(r),r.oa((function(){Q(t.J,r)})),r.o((function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=cl(e.w(),Ml(t),x(t.jc,t))),n||e}))}function Zl(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName,emulatorConfig:t.emulatorConfig},n={};if(!t.stsTokenManager||!t.stsTokenManager.accessToken)return null;n[ns]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var r=t.stsTokenManager.expirationTime;r&&(n.expiresIn=(r-Date.now())/1e3);var i=new El(e,n,t);return t.providerData&&W(t.providerData,(function(t){t&&Ul(i,ti(t))})),t.redirectEventId&&(i.ga=t.redirectEventId),i}function $l(t){this.a=t,this.b=oc()}ol.prototype.Rc=function(t){var e=this;return t.sb(this.a.a,this.c).then((function(t){var n=mt(e.f);return delete n[al],delete n[sl],yt(n,t),e.g(n)}))},S(ul,k),ll.prototype.sb=function(t,e,n){return e.type==co?function(t,e,n,r){return n.Ha().then((function(n){return n={idToken:n},"undefined"!==typeof r&&(n.displayName=r),yt(n,{phoneVerificationInfo:Fo(t.a)}),su(e,Ls,n)}))}(this,t,e,n):function(t,e,n){return n.Ha().then((function(n){return yt(n={mfaPendingCredential:n},{phoneVerificationInfo:Fo(t.a)}),su(e,Ds,n)}))}(this,t,e)},S(hl,ll),S(fl,hl),S(dl,Ze),(n=pl.prototype).yc=function(t){vl(this,function(t){var e=[];return W(t.mfaInfo||[],(function(t){(t=ri(t))&&e.push(t)})),e}(t.hd))},n.Rb=function(){return this.a.I().then((function(t){return new uo(t,null)}))},n.fc=function(t,e){var n=this,r=this.a.a;return this.Rb().then((function(n){return t.sb(r,n,e)})).then((function(t){return ql(n.a,t),n.a.reload()}))},n.bd=function(t){var e=this,n="string"===typeof t?t:t.uid,r=this.a.a;return this.a.I().then((function(t){return su(r,au,{idToken:t,mfaEnrollmentId:n})})).then((function(t){var r=G(e.b,(function(t){return t.uid!=n}));return vl(e,r),ql(e.a,t),e.a.reload().o((function(t){if("auth/user-token-expired"!=t.code)throw t}))}))},n.w=function(){return{multiFactor:{enrolledFactors:Y(this.b,(function(t){return t.w()}))}}},ml.prototype.start=function(){this.a=this.c,gl(this,!0)},ml.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},yl.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}},yl.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Ae(new k("user-token-expired")):t||!this.b||Date.now()>this.c-3e4?this.a?wl(this,{grant_type:"refresh_token",refresh_token:this.a}):Me(null):Me({accessToken:this.b.toString(),refreshToken:this.a})},xl.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},S(El,Tn),El.prototype.wa=function(t){this.ya=t,ss(this.a,t)},El.prototype.la=function(){return this.ya},El.prototype.Ga=function(){return $(this.$)},El.prototype.hb=function(){this.u.b&&(this.u.stop(),this.u.start())},Zr(El.prototype,"providerId","firebase"),(n=El.prototype).reload=function(){var t=this;return Jl(this,Dl(this).then((function(){return Hl(t).then((function(){return Pl(t)})).then(Ll)})))},n.oc=function(t){return this.I(t).then((function(t){return new il(t)}))},n.I=function(t){var e=this;return Jl(this,Dl(this).then((function(){return e.b.getToken(t)})).then((function(t){if(!t)throw new k("internal-error");return t.accessToken!=e.za&&(jl(e,t.accessToken),e.dispatchEvent(new dl("tokenChanged"))),Vl(e,"refreshToken",t.refreshToken),t.accessToken})))},n.Kc=function(t){if(!(t=t.users)||!t.length)throw new k("internal-error");Nl(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt,tenantId:t.tenantId});for(var e=function(t){return(t=t.providerUserInfo)&&t.length?Y(t,(function(t){return new Tl(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}(t),n=0;n<e.length;n++)Ul(this,e[n]);Vl(this,"isAnonymous",!(this.email&&t.passwordHash)&&!(this.providerData&&this.providerData.length)),this.dispatchEvent(new dl("userReloaded",{hd:t}))},n.Lc=function(t){return Qr("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.tb(t)},n.tb=function(t){var e=this,n=null;return Jl(this,t.c(this.a,this.uid).then((function(t){return ql(e,t),n=Gl(e,t,"reauthenticate"),e.h=null,e.reload()})).then((function(){return n})),!0)}
2,n.Cc=function(t){return Qr("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.qb(t)},n.qb=function(t){var e=this,n=null;return Jl(this,Wl(this,t.providerId).then((function(){return e.I()})).then((function(n){return t.b(e.a,n)})).then((function(t){return n=Gl(e,t,"link"),Yl(e,t)})).then((function(){return n})))},n.Dc=function(t,e){var n=this;return Jl(this,Wl(this,"phone").then((function(){return rl(Ml(n),t,e,x(n.qb,n))})))},n.Mc=function(t,e){var n=this;return Jl(this,Me().then((function(){return rl(Ml(n),t,e,x(n.tb,n))})),!0)},n.Bb=function(t){var e=this;return Jl(this,this.I().then((function(n){return e.a.Bb(n,t)})).then((function(t){return ql(e,t),e.reload()})))},n.ed=function(t){var e=this;return Jl(this,this.I().then((function(n){return t.b(e.a,n)})).then((function(t){return ql(e,t),e.reload()})))},n.Cb=function(t){var e=this;return Jl(this,this.I().then((function(n){return e.a.Cb(n,t)})).then((function(t){return ql(e,t),e.reload()})))},n.Db=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return Dl(this);var e=this;return Jl(this,this.I().then((function(n){return e.a.Db(n,{displayName:t.displayName,photoUrl:t.photoURL})})).then((function(t){return ql(e,t),Vl(e,"displayName",t.displayName||null),Vl(e,"photoURL",t.photoUrl||null),W(e.providerData,(function(t){"password"===t.providerId&&(Zr(t,"displayName",e.displayName),Zr(t,"photoURL",e.photoURL))})),Pl(e)})).then(Ll))},n.cd=function(t){var e=this;return Jl(this,Hl(this).then((function(n){return K(Fl(e),t)?function(t,e,n){return su(t,Ps,{idToken:e,deleteProvider:n})}(e.a,n,[t]).then((function(t){var n={};return W(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),W(Fl(e),(function(t){n[t]||Bl(e,t)})),n[Uo.PROVIDER_ID]||Zr(e,"phoneNumber",null),Pl(e)})):Pl(e).then((function(){throw new k("no-such-provider")}))})))},n.delete=function(){var t=this;return Jl(this,this.I().then((function(e){return su(t.a,js,{idToken:e})})).then((function(){t.dispatchEvent(new dl("userDeleted"))}))).then((function(){for(var e=0;e<t.J.length;e++)t.J[e].cancel("app-deleted");Sl(t,null),Ol(t,null),Cl(t,null),t.J=[],t.D=!0,Il(t),Zr(t,"refreshToken",null),t.i&&Uc(t.i,t)}))},n.Fb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.ga||null)==e||"reauthViaRedirect"==t&&(this.ga||null)==e)},n.na=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},n.Fa=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?x(this.Kb,this):"reauthViaPopup"==t&&e==(this.g||null)?x(this.Lb,this):"linkViaRedirect"==t&&(this.ga||null)==e?x(this.Kb,this):"reauthViaRedirect"==t&&(this.ga||null)==e?x(this.Lb,this):null},n.Ec=function(t){var e=this;return Xl(this,"linkViaPopup",t,(function(){return Wl(e,t.providerId).then((function(){return Pl(e)}))}),!1)},n.Nc=function(t){return Xl(this,"reauthViaPopup",t,(function(){return Me()}),!0)},n.Fc=function(t){var e=this;return Kl(this,"linkViaRedirect",t,(function(){return Wl(e,t.providerId)}),!1)},n.Oc=function(t){return Kl(this,"reauthViaRedirect",t,(function(){return Me()}),!0)},n.Kb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Jl(this,this.I().then((function(n){return Ss(i.a,{requestUri:t,postBody:r,sessionId:e,idToken:n})})).then((function(t){return o=Gl(i,t,"link"),Yl(i,t)})).then((function(){return o})))},n.Lb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Jl(this,Me().then((function(){return fo(Os(i.a,{requestUri:t,sessionId:e,postBody:r,tenantId:n}),i.uid)})).then((function(t){return o=Gl(i,t,"reauthenticate"),ql(i,t),i.h=null,i.reload()})).then((function(){return o})),!0)},n.ub=function(t){var e=this,n=null;return Jl(this,this.I().then((function(e){return n=e,"undefined"===typeof t||vt(t)?{}:zi(new ji(t))})).then((function(t){return e.a.ub(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},n.Eb=function(t,e){var n=this,r=null;return Jl(this,this.I().then((function(t){return r=t,"undefined"===typeof e||vt(e)?{}:zi(new ji(e))})).then((function(e){return n.a.Eb(r,t,e)})).then((function(t){if(n.email!=t)return n.reload()})).then((function(){})))},n.jc=function(t){var e=null,n=this;return Jl(this,t=fo(Me(t),n.uid).then((function(t){return e=Gl(n,t,"reauthenticate"),ql(n,t),n.h=null,n.reload()})).then((function(){return e})),!0)},n.toJSON=function(){return this.w()},n.w=function(){var t={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.s,stsTokenManager:this.b.w(),redirectEventId:this.ga||null};
2return this.metadata&&yt(t,this.metadata.w()),W(this.providerData,(function(e){t.providerData.push(function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}(e))})),yt(t,this.O.w()),t};var th={name:"redirectUser",F:"session"};function eh(t){return uc(t.b,th,t.a)}function nh(t){this.a=t,this.b=oc(),this.c=null,this.f=function(t){var e=oh("local"),n=oh("session"),r=oh("none");return function(t,e,n){var r=sc(e,n),i=ac(t,e.F);return t.get(e,n).then((function(o){var a=null;try{a=Br(u.localStorage.getItem(r))}catch(s){}if(a&&!o)return u.localStorage.removeItem(r),t.set(e,a,n);a&&o&&"localStorage"!=i.type&&u.localStorage.removeItem(r)}))}(t.b,e,t.a).then((function(){return t.b.get(n,t.a)})).then((function(i){return i?n:t.b.get(r,t.a).then((function(n){return n?r:t.b.get(e,t.a).then((function(n){return n?e:t.b.get(ih,t.a).then((function(t){return t?oh(t):e}))}))}))})).then((function(e){return t.c=e,rh(t,e.F)})).o((function(){t.c||(t.c=e)}))}(this),this.b.addListener(oh("local"),this.a,x(this.g,this))}function rh(t,e){var n,r=[];for(n in rc)rc[n]!==e&&r.push(uc(t.b,oh(rc[n]),t.a));return r.push(uc(t.b,ih,t.a)),function(t){return new xe((function(e,n){var r=t.length,i=[];if(r)for(var o=function(t,n){r--,i[t]=n,0==r&&e(i)},a=function(t){n(t)},s=0;s<t.length;s++)Ie(t[s],T(o,s),a);else e(i)}))}(r)}nh.prototype.g=function(){var t=this,e=oh("local");ch(this,(function(){return Me().then((function(){return t.c&&"local"!=t.c.F?t.b.get(e,t.a):null})).then((function(n){if(n)return rh(t,"local").then((function(){t.c=e}))}))}))};var ih={name:"persistence",F:"session"};function oh(t){return{name:"authUser",F:t}}function ah(t,e){return ch(t,(function(){return t.b.set(t.c,e.w(),t.a)}))}function sh(t){return ch(t,(function(){return uc(t.b,t.c,t.a)}))}function uh(t,e,n){return ch(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),t&&n&&(t.emulatorConfig=n),Zl(t||{})}))}))}function ch(t,e){return t.f=t.f.then(e,e),t.f}function lh(t){if(this.l=!1,Zr(this,"settings",new el),Zr(this,"app",t),!bh(this).options||!bh(this).options.apiKey)throw new k("invalid-api-key");t=e.a.SDK_VERSION?Ar(e.a.SDK_VERSION):null,this.a=new ts(bh(this).options&&bh(this).options.apiKey,P(M),t),this.R=[],this.s=[],this.O=[],this.hb=e.a.INTERNAL.createSubscribe(x(this.zc,this)),this.X=void 0,this.bc=e.a.INTERNAL.createSubscribe(x(this.Ac,this)),gh(this,null),this.i=new nh(bh(this).options.apiKey+":"+bh(this).name),this.D=new $l(bh(this).options.apiKey+":"+bh(this).name),this.$=Th(this,function(t){var e=bh(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(th,t.a).then((function(t){return t&&e&&(t.authDomain=e),Zl(t||{})}))}(t.D,bh(t).options.authDomain).then((function(e){return(t.m=e)&&(e.ha=t.D),eh(t.D)}));return Th(t,e)}(t).then((function(){return uh(t.i,e,t.P)})).then((function(e){return e?(e.ha=t.D,t.m&&(t.m.ga||null)==(e.ga||null)?e:e.reload().then((function(){return ah(t.i,e).then((function(){return e}))})).o((function(n){return"auth/network-request-failed"==n.code?e:sh(t.i)}))):null})).then((function(e){gh(t,e||null)}));return Th(t,n)}(this)),this.h=Th(this,function(t){return t.$.then((function(){return vh(t)})).o((function(){})).then((function(){if(!t.l)return t.ja()})).o((function(){})).then((function(){if(!t.l){t.ba=!0;var e=t.i;e.b.addListener(oh("local"),e.a,t.ja)}}))}(this)),this.ba=!1,this.ja=x(this.Zc,this),this.Ba=x(this.da,this),this.ya=x(this.mc,this),this.za=x(this.wc,this),this.Aa=x(this.xc,this),this.b=null,function(t){var e=bh(t).options.authDomain,n=bh(t).options.apiKey;e&&Rr()&&(t.Oa=t.$.then((function(){if(!t.l){if(t.b=Xc(e,n,bh(t).name,t.P),Fc(t.b,t),_h(t)&&Rl(_h(t)),t.m){Rl(t.m);var r=t.m;r.wa(t.la()),Sl(r,t),kl(r=t.m,t.J),Cl(r,t),us((r=t.m).a,t.P),Ol(r,t),t.m=null}return t.b}})))}(this),this.INTERNAL={},this.INTERNAL.delete=x(this.delete,this),this.INTERNAL.logFramework=x(this.Gc,this),this.u=0,Tn.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.la()},set:function(t){this.wa(t)},enumerable:!1}),t.aa=null,Object.defineProperty(t,"ti",{get:function(){return this.T()},set:function(t){this.yb(t)},enumerable:!1}),t.S=null,Object.defineProperty(t,"emulatorConfig",{get:function(){if(this.P){var t=Vn(this.P.url);t=ti({protocol:t.c,host:t.a,port:t.g,options:ti({disableWarnings:this.P.ec})})}else t=null;return t},enumerable:!1})}(this),this.J=[],this.P=null}function hh(t){Ze.call(this,"languageCodeChanged"),this.h=t}function fh(t){Ze.call(this,"emulatorConfigChanged"),this.c=t}function dh(t){Ze.call(this,"frameworkChanged"),this.f=t}function ph(t){return t.Oa||Ae(new k("auth-domain-config-required"))}function vh(t){if(!Rr())return Ae(new k("operation-not-supported-in-this-environment"));var e=ph(t).then((function(){return t.b.qa()})).then((function(t){return t?ti(t):null}));return Th(t,e)}function mh(t,e){var n={};return n.apiKey=bh(t).options.apiKey,n.authDomain=bh(t).options.authDomain,n.appName=bh(t).name,t.P&&(n.emulatorConfig=t.P),t.$.then((function(){return function(t,e,n,r){var i=new El(t,e);return n&&(i.ha=n),r&&kl(i,r),i.reload().then((function(){return i}))}(n,e,t.D,t.Ga())})).then((function(e){return _h(t)&&e.uid==_h(t).uid?(zl(_h(t),e),t.da(e)):(gh(t,e),Rl(e),t.da(e))})).then((function(){xh(t)}))}function gh(t,e){_h(t)&&(function(t,e){J(t.S,(function(t){return t==e}))}(_h(t),t.Ba),pn(_h(t),"tokenChanged",t.ya),pn(_h(t),"userDeleted",t.za),pn(_h(t),"userInvalidated",t.Aa),Il(_h(t))),e&&(e.S.push(t.Ba),hn(e,"tokenChanged",t.ya),hn(e,"userDeleted",t.za),hn(e,"userInvalidated",t.Aa),0<t.u&&Al(e)),Zr(t,"currentUser",e),e&&(e.wa(t.la()),Sl(e,t),kl(e,t.J),Cl(e,t),us(e.a,t.P),Ol(e,t))}function yh(t,e){var n=null,r=null;return Th(t,e.then((function(e){return n=Vo(e),r=Zi(e),mh(t,e)}),(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=cl(e.w(),t,x(t.kc,t))),n||e})).then((function(){return ti({user:_h(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function bh(t){return t.app}function _h(t){return t.currentUser}function wh(t){return _h(t)&&_h(t)._lat||null}function xh(t){if(t.ba){for(var e=0;e<t.s.length;e++)t.s[e]&&t.s[e](wh(t));if(t.X!==t.getUid()&&t.O.length)for(t.X=t.getUid(),e=0;e<t.O.length;e++)t.O[e]&&t.O[e](wh(t))}}function Th(t,e){return t.R.push(e),e.oa((function(){Q(t.R,e)})),e}function Eh(){}function Sh(){this.a={},this.b=1e12}nh.prototype.xb=function(t){var e=null,n=this;return function(t){var e=new k("invalid-persistence-type"),n=new k("unsupported-persistence-type");t:{for(r in rc)if(rc[r]==t){var r=!0;break t}r=!1}if(!r||"string"!==typeof t)throw e;switch(Er()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Lu()&&"none"!==t)throw n;break;default:if(!Pr()&&"none"!==t)throw n}}(t),ch(this,(function(){return t!=n.c.F?n.b.get(n.c,n.a).then((function(r){return e=r,rh(n,t)})).then((function(){if(n.c=oh(t),e)return n.b.set(n.c,e,n.a)})):Me()}))},S(lh,Tn),S(hh,Ze),S(fh,Ze),S(dh,Ze),(n=lh.prototype).xb=function(t){return Th(this,t=this.i.xb(t))},n.wa=function(t){this.aa===t||this.l||(this.aa=t,ss(this.a,this.aa),this.dispatchEvent(new hh(this.la())))},n.la=function(){return this.aa},n.fd=function(){var t=u.navigator;this.wa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},n.gd=function(t,e){if(!this.P){if(!/^https?:\/\//.test(t))throw new k("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");(function(t){"undefined"!==typeof console&&"function"===typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),u.document&&!t&&_r().then((function(){var t=u.document.createElement("div");t.innerText="Running in emulator mode. Do not use with production credentials.",t.style.position="fixed",t.style.width="100%",t.style.backgroundColor="#ffffff",t.style.border=".1em solid #000000",t.style.color="#ff0000",t.style.bottom="0px",t.style.left="0px",t.style.margin="0px",t.style.zIndex=1e4,t.style.textAlign="center",t.classList.add("firebase-emulator-warning"),u.document.body.appendChild(t)}))})(e=!!e&&!!e.disableWarnings),this.P={url:t,ec:e},this.settings.ib=!0,us(this.a,this.P),this.dispatchEvent(new fh(this.P))}},n.Gc=function(t){this.J.push(t),ls(this.a,e.a.SDK_VERSION?Ar(e.a.SDK_VERSION,this.J):null),this.dispatchEvent(new dh(this.J))},n.Ga=function(){return $(this.J)},n.yb=function(t){this.S===t||this.l||(this.S=t,this.a.b=this.S)},n.T=function(){return this.S},n.toJSON=function(){return{apiKey:bh(this).options.apiKey,authDomain:bh(this).options.authDomain,appName:bh(this).name,currentUser:_h(this)&&_h(this).w()}},n.Fb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},n.na=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.C?this.C(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.C)},n.Fa=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?x(this.ic,this):null},n.ic=function(t,e,n,r){var i=this,o={requestUri:t,postBody:r,sessionId:e,tenantId:n};return this.c&&(this.c.cancel(),this.c=null),i.$.then((function(){return yh(i,Es(i.a,o))}))},n.Xc=function(t){if(!Rr())return Ae(new k("operation-not-supported-in-this-environment"));var n=this,r=Ji(t.providerId),i=Vr(),o=null;(!Dr()||xr())&&bh(this).options.authDomain&&t.isOAuthProvider&&(o=xu(bh(this).options.authDomain,bh(this).options.apiKey,bh(this).name,"signInViaPopup",t,null,i,e.a.SDK_VERSION||null,null,null,this.T(),this.P));var a=gr(o,r&&r.ua,r&&r.ta);return Th(this,r=ph(this).then((function(e){return zc(e,a,"signInViaPopup",t,i,!!o,n.T())})).then((function(){return new xe((function(t,e){n.na("signInViaPopup",null,new k("cancelled-popup-request"),n.g),n.f=t,n.C=e,n.g=i,n.c=Wc(n.b,n,"signInViaPopup",a,i)}))}
2)).then((function(t){return a&&mr(a),t?ti(t):null})).o((function(t){throw a&&mr(a),t})))},n.Yc=function(t){if(!Rr())return Ae(new k("operation-not-supported-in-this-environment"));var e=this;return Th(this,ph(this).then((function(){return function(t){return ch(t,(function(){return t.b.set(ih,t.c.F,t.a)}))}(e.i)})).then((function(){return qc(e.b,"signInViaRedirect",t,void 0,e.T())})))},n.qa=function(){var t=this;return vh(this).then((function(e){return t.b&&Jc(t.b.b),e})).o((function(e){throw t.b&&Jc(t.b.b),e}))},n.dd=function(t){if(!t)return Ae(new k("null-user"));if(this.S!=t.tenantId)return Ae(new k("tenant-id-mismatch"));var e=this,n={};n.apiKey=bh(this).options.apiKey,n.authDomain=bh(this).options.authDomain,n.appName=bh(this).name;var r=function(t,e,n,r){var i=t.b,o={};return o[ns]=i.b&&i.b.toString(),o.refreshToken=i.a,e=new El(e||{apiKey:t.l,authDomain:t.s,appName:t.m},o),n&&(e.ha=n),r&&kl(e,r),zl(e,t),e}(t,n,e.D,e.Ga());return Th(this,this.h.then((function(){if(bh(e).options.apiKey!=t.l)return r.reload()})).then((function(){return _h(e)&&t.uid==_h(e).uid?(zl(_h(e),t),e.da(t)):(gh(e,r),Rl(r),e.da(r))})).then((function(){xh(e)})))},n.Ab=function(){var t=this;return Th(this,this.h.then((function(){return t.b&&Jc(t.b.b),_h(t)?(gh(t,null),sh(t.i).then((function(){xh(t)}))):Me()})))},n.Zc=function(){var t=this;return uh(this.i,bh(this).options.authDomain).then((function(e){if(!t.l){var n;if(n=_h(t)&&e){n=_h(t).uid;var r=e.uid;n=void 0!==n&&null!==n&&""!==n&&void 0!==r&&null!==r&&""!==r&&n==r}if(n)return zl(_h(t),e),_h(t).I();(_h(t)||e)&&(gh(t,e),e&&(Rl(e),e.ha=t.D),t.b&&Fc(t.b,t),xh(t))}}))},n.da=function(t){return ah(this.i,t)},n.mc=function(){xh(this),this.da(_h(this))},n.wc=function(){this.Ab()},n.xc=function(){this.Ab()},n.kc=function(t){var e=this;return this.h.then((function(){return yh(e,Me(t))}))},n.zc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(_h(e))}))},n.Ac=function(t){var e=this;!function(t,e){t.O.push(e),Th(t,t.h.then((function(){!t.l&&K(t.O,e)&&t.X!==t.getUid()&&(t.X=t.getUid(),e(wh(t)))})))}(this,(function(){t.next(_h(e))}))},n.Ic=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){"function"===typeof t?t(_h(r)):"function"===typeof t.next&&t.next(_h(r))})),this.hb(t,e,n)},n.Hc=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){r.X=r.getUid(),"function"===typeof t?t(_h(r)):"function"===typeof t.next&&t.next(_h(r))})),this.bc(t,e,n)},n.nc=function(t){var e=this;return Th(this,this.h.then((function(){return _h(e)?_h(e).I(t).then((function(t){return{accessToken:t}})):null})))},n.Tc=function(t){var e=this;return this.h.then((function(){return yh(e,su(e.a,eu,{token:t}))})).then((function(t){var n=t.user;return Vl(n,"isAnonymous",!1),e.da(n),t}))},n.Uc=function(t,e){var n=this;return this.h.then((function(){return yh(n,su(n.a,nu,{email:t,password:e}))}))},n.dc=function(t,e){var n=this;return this.h.then((function(){return yh(n,su(n.a,As,{email:t,password:e}))}))},n.$a=function(t){var e=this;return this.h.then((function(){return yh(e,t.ka(e.a))}))},n.Sc=function(t){return Qr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.$a(t)},n.zb=function(){var t=this;return this.h.then((function(){var e=_h(t);if(e&&e.isAnonymous){var n=ti({providerId:null,isNewUser:!1});return ti({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return yh(t,t.a.zb()).then((function(e){var n=e.user;return Vl(n,"isAnonymous",!0),t.da(n),e}))}))},n.getUid=function(){return _h(this)&&_h(this).uid||null},n.cc=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&_h(this)&&Al(_h(this))},n.Pc=function(t){var e=this;W(this.s,(function(n){n==t&&e.u--})),0>this.u&&(this.u=0),0==this.u&&_h(this)&&Il(_h(this)),this.removeAuthTokenListener(t)},n.addAuthTokenListener=function(t){var e=this;this.s.push(t),Th(this,this.h.then((function(){e.l||K(e.s,t)&&t(wh(e))})))},n.removeAuthTokenListener=function(t){J(this.s,(function(e){return e==t}))},n.delete=function(){this.l=!0;for(var t=0;t<this.R.length;t++)this.R[t].cancel("app-deleted");return this.R=[],this.i&&(t=this.i).b.removeListener(oh("local"),t.a,this.ja),this.b&&(Uc(this.b,this),Jc(this.b.b)),Promise.resolve()},n.hc=function(t){return Th(this,function(t,e){return su(t,Is,{identifier:e,continueUri:Nr()?fr():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}(this.a,t))},n.Bc=function(t){return!!No(t)},n.wb=function(t,e){var n=this;return Th(this,Me().then((function(){var t=new ji(e);if(!t.c)throw new k("argument-error",Ni+" must be true when sending sign in link to email");return zi(t)})).then((function(e){return n.a.wb(t,e)})).then((function(){})))},n.jd=function(t){return this.Ra(t).then((function(t){return t.data.email}))},n.nb=function(t,e){return Th(this,this.a.nb(t,e).then((function(){})))},n.Ra=function(t){return Th(this,this.a.Ra(t).then((function(t){return new ci(t)})))},n.jb=function(t){return Th(this,this.a.jb(t).then((function(){})))},n.vb=function(t,e){var n=this;return Th(this,Me().then((function(){return"undefined"===typeof e||vt(e)?{}:zi(new ji(e))})).then((function(e){return n.a.vb(t,e)})).then((function(){})))},n.Wc=function(t,e){return Th(this,rl(this,t,e,x(this.$a,this)))},n.Vc=function(t,e){var n=this;return Th(this,Me().then((function(){var r=e||fr(),i=Ro(t,r);if(!(r=No(r)))throw new k("argument-error","Invalid email link!");if(r.tenantId!==n.T())throw new k("tenant-id-mismatch");return n.$a(i)})))},Eh.prototype.render=function(){},Eh.prototype.reset=function(){},Eh.prototype.getResponse=function(){},Eh.prototype.execute=function(){};var Oh=null;function kh(t,e){return(e=Ch(e))&&t.a[e]||null}function Ch(t){return(t="undefined"===typeof t?1e12:t)?t.toString():null}function Mh(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=le(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():hn(this.f,"click",this.i)}function Ah(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function Ih(){}function jh(){}Sh.prototype.render=function(t,e){return this.a[this.b.toString()]=new Mh(t,e),this.b++},Sh.prototype.reset=function(t){var e=kh(this,t);t=Ch(t),e&&t&&(e.delete(),delete this.a[t])},Sh.prototype.getResponse=function(t){return(t=kh(this,t))?t.getResponse():null},Sh.prototype.execute=function(t){(t=kh(this,t))&&t.execute()},Mh.prototype.getResponse=function(){return Ah(this),this.b},Mh.prototype.execute=function(){Ah(this);var t=this;this.a||(this.a=setTimeout((function(){t.b=function(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(r){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(r){}t.h&&t.execute()}),6e4)}),500))},Mh.prototype.delete=function(){Ah(this),this.g=!0,clearTimeout(this.a),this.a=null,pn(this.f,"click",this.i)},Zr(Ih,"FACTOR_ID","phone"),jh.prototype.g=function(){return Oh||(Oh=new Sh),Me(Oh)},jh.prototype.c=function(){};var Ph=null;function Rh(){this.b=u.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var Nh=new _t(Et,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Lh=new qr(3e4,6e4);Rh.prototype.g=function(t){var e=this;return new xe((function(n,r){var i=setTimeout((function(){r(new k("network-request-failed"))}),Lh.get());!u.grecaptcha||t!==e.f&&!e.b?(u[e.a]=function(){if(u.grecaptcha){e.f=t;var o=u.grecaptcha.render;u.grecaptcha.render=function(t,n){return t=o(t,n),e.b++,t},clearTimeout(i),n(u.grecaptcha)}else clearTimeout(i),r(new k("internal-error"));delete u[e.a]},Me(Ya(Ct(Nh,{onload:e.a,hl:t||""}))).o((function(){clearTimeout(i),r(new k("internal-error","Unable to load external reCAPTCHA dependencies!"))}))):(clearTimeout(i),n(u.grecaptcha))}))},Rh.prototype.c=function(){this.b--};var Dh=null;function Fh(t,e,n,r,i,o,a){if(Zr(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.v=e,this.g=null,a?(Ph||(Ph=new jh),a=Ph):(Dh||(Dh=new Rh),a=Dh),this.m=a,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[Vh])throw new k("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[zh],!u.document)throw new k("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!le(e)||!this.i&&le(e).hasChildNodes())throw new k("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new ts(t,o||null,i||null),this.u=r||function(){return null};var s=this;this.l=[];var c=this.a[Uh];this.a[Uh]=function(t){if(Hh(s,t),"function"===typeof c)c(t);else if("string"===typeof c){var e=jr(c,u);"function"===typeof e&&e(t)}};var l=this.a[Bh];this.a[Bh]=function(){if(Hh(s,null),"function"===typeof l)l();else if("string"===typeof l){var t=jr(l,u);"function"===typeof t&&t()}}}var Uh="callback",Bh="expired-callback",Vh="sitekey",zh="size";function Hh(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(r){}}function qh(t,e){return t.h.push(e),e.oa((function(){Q(t.h,e)})),e}function Wh(t){if(t.D)throw new k("internal-error","RecaptchaVerifier instance has been destroyed.")}function Gh(t,n,r){var i=!1;try{this.b=r||e.a.app()}catch(s){throw new k("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new k("invalid-api-key");r=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().Ga()}catch(s){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(s){}a=e.a.SDK_VERSION?Ar(e.a.SDK_VERSION,a):null,Fh.call(this,r,t,n,(function(){try{var t=o.b.auth().la()}catch(e){t=null}return t}),a,P(M),i)}function Yh(t,e,n,r){t:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,a=0;a<e.length;a++)if(e[a].optional)o=!0;else{if(o)throw new k("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=e.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=e[i].optional&&void 0===n[i],!e[i].M(n[i])&&!o){if(e=e[i],0>i||i>=Xh.length)throw new k("internal-error","Argument validator received an unsupported number of arguments.");
2n=Xh[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}r=null}}if(r)throw new k("argument-error",t+" failed: "+r)}(n=Fh.prototype).Ia=function(){var t=this;return this.f?this.f:this.f=qh(this,Me().then((function(){if(Nr()&&!Tr())return _r();throw new k("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.m.g(t.u())})).then((function(e){return t.g=e,su(t.s,qs,{})})).then((function(e){t.a[Vh]=e.recaptchaSiteKey})).o((function(e){throw t.f=null,e})))},n.render=function(){Wh(this);var t=this;return qh(this,this.Ia().then((function(){if(null===t.c){var e=t.v;if(!t.i){var n=le(e);e=function(t,e,n){var r=arguments,i=document,o=String(r[0]),a=r[1];if(!ce&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',Wt(a.name),'"'),a.type){o.push(' type="',Wt(a.type),'"');var s={};yt(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=me(i,o),a&&("string"===typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):he(o,a)),2<r.length&&ve(i,o,r),o}("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},n.verify=function(){Wh(this);var t=this;return qh(this,this.render().then((function(e){return new xe((function(n){var r=t.g.getResponse(e);if(r)n(r);else{t.l.push((function e(r){r&&(function(t,e){J(t.l,(function(t){return t==e}))}(t,e),n(r))})),t.i&&t.g.execute(t.c)}}))})))},n.reset=function(){Wh(this),null!==this.c&&this.g.reset(this.c)},n.clear=function(){Wh(this),this.D=!0,this.m.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=le(this.v);for(var e;e=t.firstChild;)t.removeChild(e)}},S(Gh,Fh);var Xh="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Kh(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:function(t){return"string"===typeof t}}}function Qh(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:function(t){return"boolean"===typeof t}}}function Jh(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:m}}function Zh(t,e){return{name:t||"",K:"a function",optional:!!e,M:function(t){return"function"===typeof t}}}function $h(t,e){return{name:t||"",K:"null",optional:!!e,M:function(t){return null===t}}}function tf(t){return{name:t?t+"Credential":"credential",K:t?"a valid "+t+" credential":"a valid credential",optional:!1,M:function(e){if(!e)return!1;var n=!t||e.providerId===t;return!(!e.ka||!n)}}}function ef(t,e){return m(t)&&"string"===typeof t.type&&t.type===e&&"function"===typeof t.Ha}function nf(t){return m(t)&&"string"===typeof t.uid}function rf(t,e,n,r){return{name:n||"",K:t.K+" or "+e.K,optional:!!r,M:function(n){return t.M(n)||e.M(n)}}}function of(t,e){for(var n in e){var r=e[n].name;t[r]=uf(r,t[n],e[n].j)}}function af(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:T((function(t){return this[t]}),n),set:T((function(t,e,n,r){Yh(t,[n],[r],!0),this[e]=r}),r,n,e[n].kb),enumerable:!0})}}function sf(t,e,n,r){t[e]=uf(e,n,r)}function uf(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return Yh(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=function(t){return(t=t.split("."))[t.length-1]}(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}of(lh.prototype,{jb:{name:"applyActionCode",j:[Kh("code")]},Ra:{name:"checkActionCode",j:[Kh("code")]},nb:{name:"confirmPasswordReset",j:[Kh("code"),Kh("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[Kh("email"),Kh("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[Kh("email")]},qa:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[Kh("emailLink")]},Hc:{name:"onAuthStateChanged",j:[rf(Jh(),Zh(),"nextOrObserver"),Zh("opt_error",!0),Zh("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[rf(Jh(),Zh(),"nextOrObserver"),Zh("opt_error",!0),Zh("opt_completed",!0)]},vb:{name:"sendPasswordResetEmail",j:[Kh("email"),rf(Jh("opt_actionCodeSettings",!0),$h(null,!0),"opt_actionCodeSettings",!0)]},wb:{name:"sendSignInLinkToEmail",j:[Kh("email"),Jh("actionCodeSettings")]},xb:{name:"setPersistence",j:[Kh("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[tf()]},zb:{name:"signInAnonymously",j:[]},$a:{name:"signInWithCredential",j:[tf()]},Tc:{name:"signInWithCustomToken",j:[Kh("token")]},Uc:{name:"signInWithEmailAndPassword",j:[Kh("email"),Kh("password")]},Vc:{name:"signInWithEmailLink",j:[Kh("email"),Kh("emailLink",!0)]}
2,Wc:{name:"signInWithPhoneNumber",j:[Kh("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!==typeof t.type||"function"!==typeof t.verify)}}]},Xc:{name:"signInWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Yc:{name:"signInWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},dd:{name:"updateCurrentUser",j:[rf({name:"user",K:"an instance of Firebase User",optional:!1,M:function(t){return!!(t&&t instanceof El)}},$h(),"user")]},Ab:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Kh(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[Kh("url"),Jh("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[Kh("code")]}}),af(lh.prototype,{lc:{name:"languageCode",kb:rf(Kh(),$h(),"languageCode")},ti:{name:"tenantId",kb:rf(Kh(),$h(),"tenantId")}}),lh.Persistence=rc,lh.Persistence.LOCAL="local",lh.Persistence.SESSION="session",lh.Persistence.NONE="none",of(El.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[Qh("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Qh("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[tf()]},qb:{name:"linkWithCredential",j:[tf()]},Dc:{name:"linkWithPhoneNumber",j:[Kh("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!==typeof t.type||"function"!==typeof t.verify)}}]},Ec:{name:"linkWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Fc:{name:"linkWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Lc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[tf()]},tb:{name:"reauthenticateWithCredential",j:[tf()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[Kh("phoneNumber"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!==typeof t.type||"function"!==typeof t.verify)}}]},Nc:{name:"reauthenticateWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Oc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},ub:{name:"sendEmailVerification",j:[rf(Jh("opt_actionCodeSettings",!0),$h(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Kh(null,!0)]},cd:{name:"unlink",j:[Kh("provider")]},Bb:{name:"updateEmail",j:[Kh("email")]},Cb:{name:"updatePassword",j:[Kh("password")]},ed:{name:"updatePhoneNumber",j:[tf("phone")]},Db:{name:"updateProfile",j:[Jh("profile")]},Eb:{name:"verifyBeforeUpdateEmail",j:[Kh("email"),rf(Jh("opt_actionCodeSettings",!0),$h(null,!0),"opt_actionCodeSettings",!0)]}}),of(Sh.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),of(Eh.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),of(xe.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),af(el.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",kb:Qh("appVerificationDisabledForTesting")}}),of(nl.prototype,{confirm:{name:"confirm",j:[Kh("verificationCode")]}}),sf(ho,"fromJSON",(function(t){t="string"===typeof t?JSON.parse(t):t;for(var e,n=[bo,jo,Do,mo],r=0;r<n.length;r++)if(e=n[r](t))return e;return null}),[rf(Kh(),Jh(),"json")]),sf(Po,"credential",(function(t,e){return new Io(t,e)}),[Kh("email"),Kh("password")]),of(Io.prototype,{w:{name:"toJSON",j:[Kh(null,!0)]}}),of(To.prototype,{Ca:{name:"addScope",j:[Kh("scope")]},Ka:{name:"setCustomParameters",j:[Jh("customOAuthParameters")]}}),sf(To,"credential",Eo,[rf(Kh(),Jh(),"token")]),sf(Po,"credentialWithLink",Ro,[Kh("email"),Kh("emailLink")]),of(So.prototype,{Ca:{name:"addScope",j:[Kh("scope")]},Ka:{name:"setCustomParameters",j:[Jh("customOAuthParameters")]}}),sf(So,"credential",Oo,[rf(Kh(),Jh(),"token")]),of(ko.prototype,{Ca:{name:"addScope",j:[Kh("scope")]},Ka:{name:"setCustomParameters",j:[Jh("customOAuthParameters")]}}),sf(ko,"credential",Co,[rf(Kh(),rf(Jh(),$h()),"idToken"),rf(Kh(),$h(),"accessToken",!0)]),of(Mo.prototype,{Ka:{name:"setCustomParameters",j:[Jh("customOAuthParameters")]}}),sf(Mo,"credential",Ao,[rf(Kh(),Jh(),"token"),Kh("secret",!0)]),of(xo.prototype,{Ca:{name:"addScope",j:[Kh("scope")]},credential:{name:"credential",j:[rf(Kh(),rf(Jh(),$h()),"optionsOrIdToken"),rf(Kh(),$h(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[Jh("customOAuthParameters")]}}),of(go.prototype,{w:{name:"toJSON",j:[Kh(null,!0)]}}),of(po.prototype,{w:{name:"toJSON",j:[Kh(null,!0)]}}),sf(Uo,"credential",Bo,[Kh("verificationId"),Kh("verificationCode")]),of(Uo.prototype,{fb:{name:"verifyPhoneNumber",j:[rf(Kh(),{name:"phoneInfoOptions",K:"valid phone info o
2ptions",optional:!1,M:function(t){return!!t&&(t.session&&t.phoneNumber?ef(t.session,co)&&"string"===typeof t.phoneNumber:t.session&&t.multiFactorHint?ef(t.session,lo)&&nf(t.multiFactorHint):t.session&&t.multiFactorUid?ef(t.session,lo)&&"string"===typeof t.multiFactorUid:!!t.phoneNumber&&"string"===typeof t.phoneNumber)}},"phoneInfoOptions"),{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!(!t||"string"!==typeof t.type||"function"!==typeof t.verify)}}]}}),of(Lo.prototype,{w:{name:"toJSON",j:[Kh(null,!0)]}}),of(k.prototype,{toJSON:{name:"toJSON",j:[Kh(null,!0)]}}),of(Ko.prototype,{toJSON:{name:"toJSON",j:[Kh(null,!0)]}}),of(Xo.prototype,{toJSON:{name:"toJSON",j:[Kh(null,!0)]}}),of(ul.prototype,{toJSON:{name:"toJSON",j:[Kh(null,!0)]}}),of(ol.prototype,{Rc:{name:"resolveSignIn",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.sb}}]}}),of(pl.prototype,{Rb:{name:"getSession",j:[]},fc:{name:"enroll",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.sb}},Kh("displayName",!0)]},bd:{name:"unenroll",j:[rf({name:"multiFactorInfo",K:"a valid multiFactorInfo",optional:!1,M:nf},Kh(),"multiFactorInfoIdentifier")]}}),of(Gh.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),sf(Ti,"parseLink",Ii,[Kh("link")]),sf(Ih,"assertion",(function(t){return new fl(t)}),[tf("phone")]),function(){if("undefined"===typeof e.a||!e.a.INTERNAL||!e.a.INTERNAL.registerComponent)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:hi,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:li,VERIFY_AND_CHANGE_EMAIL:fi,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:lh,AuthCredential:ho,Error:k};sf(t,"EmailAuthProvider",Po,[]),sf(t,"FacebookAuthProvider",To,[]),sf(t,"GithubAuthProvider",So,[]),sf(t,"GoogleAuthProvider",ko,[]),sf(t,"TwitterAuthProvider",Mo,[]),sf(t,"OAuthProvider",xo,[Kh("providerId")]),sf(t,"SAMLAuthProvider",wo,[Kh("providerId")]),sf(t,"PhoneAuthProvider",Uo,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof lh)}}]),sf(t,"RecaptchaVerifier",Gh,[rf(Kh(),{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),Jh("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof e.a.app.App)}}]),sf(t,"ActionCodeURL",Ti,[]),sf(t,"PhoneMultiFactorGenerator",Ih,[]),e.a.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return new lh(t=t.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC"}),e.a.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return{getUid:x((t=t.getProvider("auth").getImmediate()).getUid,t),getToken:x(t.nc,t),addAuthTokenListener:x(t.cc,t),removeAuthTokenListener:x(t.Pc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),e.a.registerVersion("@firebase/auth","0.16.4"),e.a.INTERNAL.extendNamespace({User:El})}()}).apply("undefined"!==typeof t?t:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})}).call(this,n(45))},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,i=t.indexOf("["),o=t.indexOf("]");-1!=i&&-1!=o&&(t=t.substring(0,i)+t.substring(i,o).replace(/:/g,";")+t.substring(o,t.length));for(var a=n.exec(t||""),s={},u=14;u--;)s[r[u]]=a[u]||"";return-1!=i&&-1!=o&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=function(t,e){var n=/\/{2,9}/g,r=e.replace(n,"/").split("/");"/"!=e.substr(0,1)&&0!==e.length||r.splice(0,1);"/"==e.substr(e.length-1,1)&&r.splice(r.length-1,1);return r}(0,s.path),s.queryKey=function(t,e){var n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,r){e&&(n[e]=r)})),n}(0,s.query),s}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){var r=n(64);t.exports=function(t,e){if(t){if("string"===typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e,n){"use strict";var r=n(31),i=n(32),o=n(33),a=n(34);
2Object.defineProperty(e,"__esModule",{value:!0}),e.Manager=void 0;var s=n(111),u=n(74),c=n(57),l=n(76),h=n(128),f=n(77),d=n(36)("socket.io-client:manager"),p=function(t){o(n,t);var e=a(n);function n(t,i){var o;r(this,n),(o=e.call(this)).nsps={},o.subs=[],t&&"object"===typeof t&&(i=t,t=void 0),(i=i||{}).path=i.path||"/socket.io",o.opts=i,o.reconnection(!1!==i.reconnection),o.reconnectionAttempts(i.reconnectionAttempts||1/0),o.reconnectionDelay(i.reconnectionDelay||1e3),o.reconnectionDelayMax(i.reconnectionDelayMax||5e3),o.randomizationFactor(i.randomizationFactor||.5),o.backoff=new h({min:o.reconnectionDelay(),max:o.reconnectionDelayMax(),jitter:o.randomizationFactor()}),o.timeout(null==i.timeout?2e4:i.timeout),o._readyState="closed",o.uri=t;var a=i.parser||c;return o.encoder=new a.Encoder,o.decoder=new a.Decoder,o._autoConnect=!1!==i.autoConnect,o._autoConnect&&o.open(),o}return i(n,[{key:"reconnection",value:function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}},{key:"reconnectionAttempts",value:function(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}},{key:"reconnectionDelay",value:function(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}},{key:"randomizationFactor",value:function(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}},{key:"reconnectionDelayMax",value:function(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}},{key:"timeout",value:function(t){return arguments.length?(this._timeout=t,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(t){var e=this;if(d("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;d("opening %s",this.uri),this.engine=s(this.uri,this.opts);var n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;var i=l.on(n,"open",(function(){r.onopen(),t&&t()})),o=l.on(n,"error",(function(n){d("error"),r.cleanup(),r._readyState="closed",e.emitReserved("error",n),t?t(n):r.maybeReconnectOnOpen()}));if(!1!==this._timeout){var a=this._timeout;d("connect attempt will timeout after %d",a),0===a&&i();var u=setTimeout((function(){d("connect attempt timed out after %d",a),i(),n.close(),n.emit("error",new Error("timeout"))}),a);this.opts.autoUnref&&u.unref(),this.subs.push((function(){clearTimeout(u)}))}return this.subs.push(i),this.subs.push(o),this}},{key:"connect",value:function(t){return this.open(t)}},{key:"onopen",value:function(){d("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");var t=this.engine;this.subs.push(l.on(t,"ping",this.onping.bind(this)),l.on(t,"data",this.ondata.bind(this)),l.on(t,"error",this.onerror.bind(this)),l.on(t,"close",this.onclose.bind(this)),l.on(this.decoder,"decoded",this.ondecoded.bind(this)))}},{key:"onping",value:function(){this.emitReserved("ping")}},{key:"ondata",value:function(t){this.decoder.add(t)}},{key:"ondecoded",value:function(t){this.emitReserved("packet",t)}},{key:"onerror",value:function(t){d("error",t),this.emitReserved("error",t)}},{key:"socket",value:function(t,e){var n=this.nsps[t];return n||(n=new u.Socket(this,t,e),this.nsps[t]=n),n}},{key:"_destroy",value:function(t){for(var e=0,n=Object.keys(this.nsps);e<n.length;e++){var r=n[e];if(this.nsps[r].active)return void d("socket %s is still active, skipping close",r)}this._close()}},{key:"_packet",value:function(t){d("writing packet %j",t);for(var e=this.encoder.encode(t),n=0;n<e.length;n++)this.engine.write(e[n],t.options)}},{key:"cleanup",value:function(){d("cleanup"),this.subs.forEach((function(t){return t()})),this.subs.length=0,this.decoder.destroy()}},{key:"_close",value:function(){d("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,"opening"===this._readyState&&this.cleanup(),this.backoff.reset(),this._readyState="closed",this.engine&&this.engine.close()}},{key:"disconnect",value:function(){return this._close()}},{key:"onclose",value:function(t){d("onclose"),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()}},{key:"reconnect",value:function(){var t=this;if(this._reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)d("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var n=this.backoff.duration();d("will wait %dms before reconnect attempt",n),this._reconnecting=!0;var r=setTimeout((function(){e.skipReconnect||(d("attempting reconnect"),t.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((function(n){n?(d("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),t.emitReserved("reconnect_error",n)):(d("reconnect success"),e.onreconnect())}
2)))}),n);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}},{key:"onreconnect",value:function(){var t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}]),n}(f.StrictEventEmitter);e.Manager=p},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){var r=n(69),i=n(114),o=n(118),a=n(120);e.polling=function(t){var e=!1,n=!1,a=!1!==t.jsonp;if("undefined"!==typeof location){var s="https:"===location.protocol,u=location.port;u||(u=s?443:80),e=t.hostname!==location.hostname||u!==t.port,n=t.secure!==s}if(t.xdomain=e,t.xscheme=n,"open"in new r(t)&&!t.forceJSONP)return new i(t);if(!a)throw new Error("JSONP disabled");return new o(t)},e.websocket=a},function(t,e,n){var r=n(113),i=n(49);t.exports=function(t){var e=t.xdomain,n=t.xscheme,o=t.enablesXDR;try{if("undefined"!==typeof XMLHttpRequest&&(!e||r))return new XMLHttpRequest}catch(a){}try{if("undefined"!==typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(a){}if(!e)try{return new(i[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(a){}}},function(t,e,n){var r=n(31),i=n(32),o=n(33),a=n(34),s=n(55),u=n(56),c=n(46),l=n(72),h=n(36)("engine.io-client:polling"),f=function(t){"use strict";o(n,t);var e=a(n);function n(){return r(this,n),e.apply(this,arguments)}return i(n,[{key:"name",get:function(){return"polling"}},{key:"doOpen",value:function(){this.poll()}},{key:"pause",value:function(t){var e=this;function n(){h("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(h("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){h("pre-pause polling complete"),--r||n()}))),this.writable||(h("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){h("pre-pause writing complete"),--r||n()})))}else n()}},{key:"poll",value:function(){h("polling"),this.polling=!0,this.doPoll(),this.emit("poll")}},{key:"onData",value:function(t){var e=this;h("polling got data %s",t);c.decodePayload(t,this.socket.binaryType).forEach((function(t,n,r){if("opening"===e.readyState&&"open"===t.type&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():h('ignoring poll - transport state "%s"',this.readyState))}},{key:"doClose",value:function(){var t=this;function e(){h("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(h("transport open - closing"),e()):(h("transport not open - deferring close"),this.once("open",e))}},{key:"write",value:function(t){var e=this;this.writable=!1,c.encodePayload(t,(function(t){e.doWrite(t,(function(){e.writable=!0,e.emit("drain")}))}))}},{key:"uri",value:function(){var t=this.query||{},e=this.opts.secure?"https":"http",n="";return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=l()),this.supportsBinary||t.sid||(t.b64=1),t=u.encode(t),this.opts.port&&("https"===e&&443!==Number(this.opts.port)||"http"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),t.length&&(t="?"+t),e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+t}}]),n}(s);t.exports=f},function(t,e){var n=Object.create(null);n.open="0",n.close="1",n.ping="2",n.pong="3",n.message="4",n.upgrade="5",n.noop="6";var r=Object.create(null);Object.keys(n).forEach((function(t){r[n[t]]=t}));t.exports={PACKET_TYPES:n,PACKET_TYPES_REVERSE:r,ERROR_PACKET:{type:"error",data:"parser error"}}},function(t,e,n){"use strict";var r,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),o={},a=0,s=0;function u(t){var e="";do{e=i[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function c(){var t=u(+new Date);return t!==r?(a=0,r=t):t+"."+u(a++)}for(;s<64;s++)o[i[s]]=s;c.encode=u,c.decode=function(t){var e=0;for(s=0;s<t.length;s++)e=64*e+o[t.charAt(s)];return e},t.exports=c},function(t,e){t.exports.pick=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.reduce((function(e,n){return t.hasOwnProperty(n)&&(e[n]=t[n]),e}),{})}},function(t,e,n){"use strict";var r=n(126),i=n(31),o=n(32),a=n(50),s=n(40),u=n(33),c=n(34);
2Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=void 0;var l=n(57),h=n(76),f=n(77),d=n(36)("socket.io-client:socket"),p=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),v=function(t){u(n,t);var e=c(n);function n(t,r,o){var a;return i(this,n),(a=e.call(this)).receiveBuffer=[],a.sendBuffer=[],a.ids=0,a.acks={},a.flags={},a.io=t,a.nsp=r,a.ids=0,a.acks={},a.receiveBuffer=[],a.sendBuffer=[],a.connected=!1,a.disconnected=!0,a.flags={},o&&o.auth&&(a.auth=o.auth),a.io._autoConnect&&a.open(),a}return o(n,[{key:"subEvents",value:function(){if(!this.subs){var t=this.io;this.subs=[h.on(t,"open",this.onopen.bind(this)),h.on(t,"packet",this.onpacket.bind(this)),h.on(t,"error",this.onerror.bind(this)),h.on(t,"close",this.onclose.bind(this))]}}},{key:"active",get:function(){return!!this.subs}},{key:"connect",value:function(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}},{key:"open",value:function(){return this.connect()}},{key:"send",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.unshift("message"),this.emit.apply(this,e),this}},{key:"emit",value:function(t){if(p.hasOwnProperty(t))throw new Error('"'+t+'" is a reserved event name');for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];n.unshift(t);var i={type:l.PacketType.EVENT,data:n,options:{}};i.options.compress=!1!==this.flags.compress,"function"===typeof n[n.length-1]&&(d("emitting packet with ack id %d",this.ids),this.acks[this.ids]=n.pop(),i.id=this.ids++);var o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,a=this.flags.volatile&&(!o||!this.connected);return a?d("discard packet as the transport is not currently writable"):this.connected?this.packet(i):this.sendBuffer.push(i),this.flags={},this}},{key:"packet",value:function(t){t.nsp=this.nsp,this.io._packet(t)}},{key:"onopen",value:function(){var t=this;d("transport is open - connecting"),"function"==typeof this.auth?this.auth((function(e){t.packet({type:l.PacketType.CONNECT,data:e})})):this.packet({type:l.PacketType.CONNECT,data:this.auth})}},{key:"onerror",value:function(t){this.connected||this.emitReserved("connect_error",t)}},{key:"onclose",value:function(t){d("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",t)}},{key:"onpacket",value:function(t){if(t.nsp===this.nsp)switch(t.type){case l.PacketType.CONNECT:if(t.data&&t.data.sid){var e=t.data.sid;this.onconnect(e)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case l.PacketType.EVENT:case l.PacketType.BINARY_EVENT:this.onevent(t);break;case l.PacketType.ACK:case l.PacketType.BINARY_ACK:this.onack(t);break;case l.PacketType.DISCONNECT:this.ondisconnect();break;case l.PacketType.CONNECT_ERROR:var n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n)}}},{key:"onevent",value:function(t){var e=t.data||[];d("emitting event %j",e),null!=t.id&&(d("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}},{key:"emitEvent",value:function(t){if(this._anyListeners&&this._anyListeners.length){var e,i=this._anyListeners.slice(),o=r(i);try{for(o.s();!(e=o.n()).done;){e.value.apply(this,t)}}catch(u){o.e(u)}finally{o.f()}}a(s(n.prototype),"emit",this).apply(this,t)}},{key:"ack",value:function(t){var e=this,n=!1;return function(){if(!n){n=!0;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];d("sending ack %j",i),e.packet({type:l.PacketType.ACK,id:t,data:i})}}}},{key:"onack",value:function(t){var e=this.acks[t.id];"function"===typeof e?(d("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):d("bad ack %s",t.id)}},{key:"onconnect",value:function(t){d("socket connected with id %s",t),this.id=t,this.connected=!0,this.disconnected=!1,this.emitReserved("connect"),this.emitBuffered()}},{key:"emitBuffered",value:function(){var t=this;this.receiveBuffer.forEach((function(e){return t.emitEvent(e)})),this.receiveBuffer=[],this.sendBuffer.forEach((function(e){return t.packet(e)})),this.sendBuffer=[]}},{key:"ondisconnect",value:function(){d("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}}
2,{key:"destroy",value:function(){this.subs&&(this.subs.forEach((function(t){return t()})),this.subs=void 0),this.io._destroy(this)}},{key:"disconnect",value:function(){return this.connected&&(d("performing disconnect (%s)",this.nsp),this.packet({type:l.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{key:"close",value:function(){return this.disconnect()}},{key:"compress",value:function(t){return this.flags.compress=t,this}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}},{key:"onAny",value:function(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}},{key:"prependAny",value:function(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}},{key:"offAny",value:function(t){if(!this._anyListeners)return this;if(t){for(var e=this._anyListeners,n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}},{key:"listenersAny",value:function(){return this._anyListeners||[]}}]),n}(f.StrictEventEmitter);e.Socket=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasBinary=e.isBinary=void 0;var r="function"===typeof ArrayBuffer,i=Object.prototype.toString,o="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===i.call(Blob),a="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===i.call(File);function s(t){return r&&(t instanceof ArrayBuffer||function(t){return"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer}(t))||o&&t instanceof Blob||a&&t instanceof File}e.isBinary=s,e.hasBinary=function t(e,n){if(!e||"object"!==typeof e)return!1;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)if(t(e[r]))return!0;return!1}if(s(e))return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return t(e.toJSON(),!0);for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return!0;return!1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.on=void 0,e.on=function(t,e,n){return t.on(e,n),function(){t.off(e,n)}}},function(t,e,n){"use strict";var r=n(31),i=n(32),o=n(50),a=n(40),s=n(33),u=n(34);Object.defineProperty(e,"__esModule",{value:!0}),e.StrictEventEmitter=void 0;var c=function(t){s(n,t);var e=u(n);function n(){return r(this,n),e.apply(this,arguments)}return i(n,[{key:"on",value:function(t,e){return o(a(n.prototype),"on",this).call(this,t,e),this}},{key:"once",value:function(t,e){return o(a(n.prototype),"once",this).call(this,t,e),this}},{key:"emit",value:function(t){for(var e,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return(e=o(a(n.prototype),"emit",this)).call.apply(e,[this,t].concat(i)),this}},{key:"emitReserved",value:function(t){for(var e,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return(e=o(a(n.prototype),"emit",this)).call.apply(e,[this,t].concat(i)),this}},{key:"listeners",value:function(t){return o(a(n.prototype),"listeners",this).call(this,t)}}]),n}(n(47));e.StrictEventEmitter=c},function(t,e,n){"use strict";t.exports=n(130)},,function(t,e,n){"use strict";var r,i=n(15),o=(n(21),n(7),n(26),n(23)),a=n(22),s={Firestore:o.e,GeoPoint:o.j,Timestamp:o.c,Blob:o.d,Transaction:o.p,WriteBatch:o.a,DocumentReference:o.b,DocumentSnapshot:o.k,Query:o.n,QueryDocumentSnapshot:o.s,QuerySnapshot:o.r,CollectionReference:o.o,FieldPath:o.q,FieldValue:o.m,setLogLevel:o.g,CACHE_SIZE_UNLIMITED:o.i};(function(t,e){t.INTERNAL.registerComponent(new a.a("firestore",(function(t){return function(t,e){return new o.e(t,new o.h(t,e),new o.f)}(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},s)))})(r=i.a),r.registerVersion("@firebase/firestore","2.2.0")},function(t,e,n){"use strict";!function t(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}(),t.exports=n(87)},function(t,e){var n="undefined"!==typeof Element,r="function"===typeof Map,i="function"===typeof Set,o="function"===typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(t,e){if(t===e)return!0;
2if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var s,u,c,l;if(Array.isArray(t)){if((s=t.length)!=e.length)return!1;for(u=s;0!==u--;)if(!a(t[u],e[u]))return!1;return!0}if(r&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!e.has(u.value[0]))return!1;for(l=t.entries();!(u=l.next()).done;)if(!a(u.value[1],e.get(u.value[0])))return!1;return!0}if(i&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!e.has(u.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if((s=t.length)!=e.length)return!1;for(u=s;0!==u--;)if(t[u]!==e[u])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if((s=(c=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(u=s;0!==u--;)if(!Object.prototype.hasOwnProperty.call(e,c[u]))return!1;if(n&&t instanceof Element)return!1;for(u=s;0!==u--;)if(("_owner"!==c[u]&&"__v"!==c[u]&&"__o"!==c[u]||!t.$$typeof)&&!a(t[c[u]],e[c[u]]))return!1;return!0}return t!==t&&e!==e}t.exports=function(t,e){try{return a(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},function(t,e){t.exports=function(t,e,n,r){var i=n?n.call(r,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!==typeof t||!t||"object"!==typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!s(c))return!1;var l=t[c],h=e[c];if(!1===(i=n?n.call(r,l,h,c):void 0)||void 0===i&&l!==h)return!1}return!0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=e.io=e.Manager=e.protocol=void 0;var r=n(100),i=n(66),o=n(74);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return o.Socket}});var a=n(36)("socket.io-client");t.exports=e=u;var s=e.managers={};function u(t,e){"object"===typeof t&&(e=t,t=void 0),e=e||{};var n,o=r.url(t,e.path),u=o.source,c=o.id,l=o.path,h=s[c]&&l in s[c].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||h?(a("ignoring socket cache for %s",u),n=new i.Manager(u,e)):(s[c]||(a("new io instance for %s",u),s[c]=new i.Manager(u,e)),n=s[c]),o.query&&!e.query&&(e.query=o.queryKey),n.socket(o.path,e)}e.io=u;var c=n(57);Object.defineProperty(e,"protocol",{enumerable:!0,get:function(){return c.protocol}}),e.connect=u;var l=n(66);Object.defineProperty(e,"Manager",{enumerable:!0,get:function(){return l.Manager}})},function(t,e,n){"use strict";var r=n(78),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(t){return r.isMemo(t)?a:s[t.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,r){if("string"!==typeof n){if(p){var i=d(n);i&&i!==p&&t(e,i,r)}var a=l(n);h&&(a=a.concat(h(n)));for(var s=u(e),v=u(n),m=0;m<a.length;++m){var g=a[m];if(!o[g]&&(!r||!r[g])&&(!v||!v[g])&&(!s||!s[g])){var y=f(n,g);try{c(e,g,y)}catch(b){}}}}return e}},function(t,e,n){"use strict";var r=n(53),i=60103,o=60106;e.Fragment=60107,e.StrictMode=60108,e.Profiler=60114;var a=60109,s=60110,u=60112;e.Suspense=60113;var c=60115,l=60116;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;i=h("react.element"),o=h("react.portal"),e.Fragment=h("react.fragment"),e.StrictMode=h("react.strict_mode"),e.Profiler=h("react.profiler"),a=h("react.provider"),s=h("react.context"),u=h("react.forward_ref"),e.Suspense=h("react.suspense"),c=h("react.memo"),l=h("react.lazy")}var f="function"===typeof Symbol&&Symbol.iterator;function d(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function m(t,e,n){this.props=t,this.context=e,this.refs=v,this.updater=n||p}function g(){}function y(t,e,n){this.props=t,this.context=e,this.refs=v,this.updater=n||p}m.prototype.isReactComponent={},m.prototype.setState=function(t,e){if("object"!==typeof t&&"function"!==typeof t&&null!=t)throw Error(d(85));this.updater.enqueueSetState(this,t,e,"setState")},m.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},g.prototype=m.prototype;var b=y.prototype=new g;b.constructor=y,r(b,m.prototype),b.isPureReactComponent=!0;var _={current:null},w=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function T(t,e,n){var r,o={},a=null,s=null;
vendor: 12,577 bytes, line 2
2if(null!=e)for(r in void 0!==e.ref&&(s=e.ref),void 0!==e.key&&(a=""+e.key),e)w.call(e,r)&&!x.hasOwnProperty(r)&&(o[r]=e[r]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];o.children=c}if(t&&t.defaultProps)for(r in u=t.defaultProps)void 0===o[r]&&(o[r]=u[r]);return{$$typeof:i,type:t,key:a,ref:s,props:o,_owner:_.current}}function E(t){return"object"===typeof t&&null!==t&&t.$$typeof===i}var S=/\/+/g;function O(t,e){return"object"===typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function k(t,e,n,r,a){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case i:case o:u=!0}}if(u)return a=a(u=t),t=""===r?"."+O(u,0):r,Array.isArray(a)?(n="",null!=t&&(n=t.replace(S,"$&/")+"/"),k(a,e,n,"",(function(t){return t}))):null!=a&&(E(a)&&(a=function(t,e){return{$$typeof:i,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(a,n+(!a.key||u&&u.key===a.key?"":(""+a.key).replace(S,"$&/")+"/")+t)),e.push(a)),1;if(u=0,r=""===r?".":r+":",Array.isArray(t))for(var c=0;c<t.length;c++){var l=r+O(s=t[c],c);u+=k(s,e,n,l,a)}else if("function"===typeof(l=function(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=f&&t[f]||t["@@iterator"])?t:null}(t)))for(t=l.call(t),c=0;!(s=t.next()).done;)u+=k(s=s.value,e,n,l=r+O(s,c++),a);else if("object"===s)throw e=""+t,Error(d(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e));return u}function C(t,e,n){if(null==t)return t;var r=[],i=0;return k(t,r,"","",(function(t){return e.call(n,t,i++)})),r}function M(t){if(-1===t._status){var e=t._result;e=e(),t._status=0,t._result=e,e.then((function(e){0===t._status&&(e=e.default,t._status=1,t._result=e)}),(function(e){0===t._status&&(t._status=2,t._result=e)}))}if(1===t._status)return t._result;throw t._result}var A={current:null};function I(){var t=A.current;if(null===t)throw Error(d(321));return t}var j={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:_,IsSomeRendererActing:{current:!1},assign:r};e.Children={map:C,forEach:function(t,e,n){C(t,(function(){e.apply(this,arguments)}),n)},count:function(t){var e=0;return C(t,(function(){e++})),e},toArray:function(t){return C(t,(function(t){return t}))||[]},only:function(t){if(!E(t))throw Error(d(143));return t}},e.Component=m,e.PureComponent=y,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=j,e.cloneElement=function(t,e,n){if(null===t||void 0===t)throw Error(d(267,t));var o=r({},t.props),a=t.key,s=t.ref,u=t._owner;if(null!=e){if(void 0!==e.ref&&(s=e.ref,u=_.current),void 0!==e.key&&(a=""+e.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(l in e)w.call(e,l)&&!x.hasOwnProperty(l)&&(o[l]=void 0===e[l]&&void 0!==c?c[l]:e[l])}var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){c=Array(l);for(var h=0;h<l;h++)c[h]=arguments[h+2];o.children=c}return{$$typeof:i,type:t.type,key:a,ref:s,props:o,_owner:u}},e.createContext=function(t,e){return void 0===e&&(e=null),(t={$$typeof:s,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:t},t.Consumer=t},e.createElement=T,e.createFactory=function(t){var e=T.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:u,render:t}},e.isValidElement=E,e.lazy=function(t){return{$$typeof:l,_payload:{_status:-1,_result:t},_init:M}},e.memo=function(t,e){return{$$typeof:c,type:t,compare:void 0===e?null:e}},e.useCallback=function(t,e){return I().useCallback(t,e)},e.useContext=function(t,e){return I().useContext(t,e)},e.useDebugValue=function(){},e.useEffect=function(t,e){return I().useEffect(t,e)},e.useImperativeHandle=function(t,e,n){return I().useImperativeHandle(t,e,n)},e.useLayoutEffect=function(t,e){return I().useLayoutEffect(t,e)},e.useMemo=function(t,e){return I().useMemo(t,e)},e.useReducer=function(t,e,n){return I().useReducer(t,e,n)},e.useRef=function(t){return I().useRef(t)},e.useState=function(t){return I().useState(t)},e.version="17.0.1"},function(t,e,n){"use strict";var r=n(13),i=n(53),o=n(88);function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));var s=new Set,u={};function c(t,e){l(t,e),l(t+"Capture",e)}function l(t,e){for(u[t]=e,t=0;t<e.length;t++)s.add(e[t])}var h=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d=Object.prototype.hasOwnProperty,p={},v={};function m(t,e,n,r,i,o,a){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(t){g[t]=new m(t,0,!1,t,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(t){var e=t[0];g[e]=new m(e,1,!1,t[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(t){g[t]=new m(t,2,!1,t.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(t){g[t]=new m(t,2,!1,t,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(t){g[t]=new m(t,3,!1,t.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(t){g[t]=new m(t,3,!0,t,null,!1,!1)})),["capture","download"].forEach((function(t){g[t]=new m(t,4,!1,t,null,!1,!1)})),["cols","rows","size","span"].forEach((function(t){g[t]=new m(t,6,!1,t,null,!1,!1)})),["rowSpan","start"].forEach((function(t){g[t]=new m(t,5,!1,t.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function b(t){return t[1].toUpperCase()}function _(t,e,n,r){var i=g.hasOwnProperty(e)?g[e]:null;(null!==i?0===i.type:!r&&(2<e.length&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1])))||(function(t,e,n,r){if(null===e||"undefined"===typeof e||function(t,e,n,r){if(null!==n&&0===n.type)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(t=t.toLowerCase().slice(0,5))&&"aria-"!==t);default:return!1}}(t,e,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!e;case 4:return!1===e;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}(e,n,i,r)&&(n=null),r||null===i?function(t){return!!d.call(v,t)||!d.call(p,t)&&(f.test(t)?v[t]=!0:(p[t]=!0,!1))}(e)&&(null===n?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=null===n?3!==i.type&&"":n:(e=i.attributeName,r=i.attributeNamespace,null===n?t.removeAttribute(e):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(t){var e=t.replace(y,b);g[e]=new m(e,1,!1,t,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(t){var e=t.replace(y,b);g[e]=new m(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(t){var e=t.replace(y,b);g[e]=new m(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(t){g[t]=new m(t,1,!1,t.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(t){g[t]=new m(t,1,!1,t.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=60103,T=60106,E=60107,S=60108,O=60114,k=60109,C=60110,M=60112,A=60113,I=60120,j=60115,P=60116,R=60121,N=60128,L=60129,D=60130,F=60131;if("function"===typeof Symbol&&Symbol.for){var U=Symbol.for;x=U("react.element"),T=U("react.portal"),E=U("react.fragment"),S=U("react.strict_mode"),O=U("react.profiler"),k=U("react.provider"),C=U("react.context"),M=U("react.forward_ref"),A=U("react.suspense"),I=U("react.suspense_list"),j=U("react.memo"),P=U("react.lazy"),R=U("react.block"),U("react.scope"),N=U("react.opaque.id"),L=U("react.debug_trace_mode"),D=U("react.offscreen"),F=U("react.legacy_hidden")}var B,V="function"===typeof Symbol&&Symbol.iterator;function z(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=V&&t[V]||t["@@iterator"])?t:null}function H(t){if(void 0===B)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);B=e&&e[1]||""}return"\n"+B+t}var q=!1;function W(t,e){if(!t||q)return"";q=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&"string"===typeof u.stack){for(var i=u.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{q=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?H(t):""}function G(t){switch(t.tag){case 5:return H(t.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return t=W(t.type,!1);case 11:return t=W(t.type.render,!1);case 22:return t=W(t.type._render,!1);case 1:return t=W(t.type,!0);default:return""}}function Y(t){if(null==t)return null;if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t;switch(t){case E:return"Fragment";case T:return"Portal";case O:return"Profiler";case S:return"StrictMode";case A:return"Suspense";case I:return"SuspenseList"}if("object"===typeof t)switch(t.$$typeof){case C:return(t.displayName||"Context")+".Consumer";case k:return(t._context.displayName||"Context")+".Provider";case M:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case j:return Y(t.type);case R:return Y(t._render);case P:e=t._payload,t=t._init;try{return Y(t(e))}catch(n){}}return null}function X(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function K(t){var e=t.type;
vendor: 5,699 bytes, line 2
2return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function Q(t){t._valueTracker||(t._valueTracker=function(t){var e=K(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){r=""+t,o.call(this,t)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(t){r=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function J(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=K(t)?t.checked?"true":"false":t.value),(t=r)!==n&&(e.setValue(t),!0)}function Z(t){if("undefined"===typeof(t=t||("undefined"!==typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}function $(t,e){var n=e.checked;return i({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:t._wrapperState.initialChecked})}function tt(t,e){var n=null==e.defaultValue?"":e.defaultValue,r=null!=e.checked?e.checked:e.defaultChecked;n=X(null!=e.value?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}}function et(t,e){null!=(e=e.checked)&&_(t,"checked",e,!1)}function nt(t,e){et(t,e);var n=X(e.value),r=e.type;if(null!=n)"number"===r?(0===n&&""===t.value||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if("submit"===r||"reset"===r)return void t.removeAttribute("value");e.hasOwnProperty("value")?it(t,e.type,n):e.hasOwnProperty("defaultValue")&&it(t,e.type,X(e.defaultValue)),null==e.checked&&null!=e.defaultChecked&&(t.defaultChecked=!!e.defaultChecked)}function rt(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!("submit"!==r&&"reset"!==r||void 0!==e.value&&null!==e.value))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}""!==(n=t.name)&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,""!==n&&(t.name=n)}function it(t,e,n){"number"===e&&Z(t.ownerDocument)===t||(null==n?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function ot(t,e){return t=i({children:void 0},e),(e=function(t){var e="";return r.Children.forEach(t,(function(t){null!=t&&(e+=t)})),e}(e.children))&&(t.children=e),t}function at(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+X(n),e=null,i=0;i<t.length;i++){if(t[i].value===n)return t[i].selected=!0,void(r&&(t[i].defaultSelected=!0));null!==e||t[i].disabled||(e=t[i])}null!==e&&(e.selected=!0)}}function st(t,e){if(null!=e.dangerouslySetInnerHTML)throw Error(a(91));return i({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ut(t,e){var n=e.value;if(null==n){if(n=e.children,e=e.defaultValue,null!=n){if(null!=e)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}e=n}null==e&&(e=""),n=e}t._wrapperState={initialValue:X(n)}}function ct(t,e){var n=X(e.value),r=X(e.defaultValue);null!=n&&((n=""+n)!==t.value&&(t.value=n),null==e.defaultValue&&t.defaultValue!==n&&(t.defaultValue=n)),null!=r&&(t.defaultValue=""+r)}function lt(t){var e=t.textContent;e===t._wrapperState.initialValue&&""!==e&&null!==e&&(t.value=e)}var ht="http://www.w3.org/1999/xhtml",ft="http://www.w3.org/2000/svg";function dt(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pt(t,e){return null==t||"http://www.w3.org/1999/xhtml"===t?dt(e):"http://www.w3.org/2000/svg"===t&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":t}var vt,mt,gt=(mt=function(t,e){if(t.namespaceURI!==ft||"innerHTML"in t)t.innerHTML=e;else{for((vt=vt||document.createElement("div")).innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=vt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,e,n,r){MSApp.execUnsafeLocalFunction((function(){return mt(t,e)}))}:mt);function yt(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&3===n.nodeType)return void(n.nodeValue=e)}t.textContent=e}var bt={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_t=["Webkit","ms","Moz","O"];function wt(t,e,n){return null==e||"boolean"===typeof e||""===e?"":n||"number"!==typeof e||0===e||bt.hasOwnProperty(t)&&bt[t]?(""+e).trim():e+"px"}function xt(t,e){for(var n in t=t.style,e)if(e.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=wt(n,e[n],r);"float"===n&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}Object.keys(bt).forEach((function(t){_t.forEach((function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),bt[e]=bt[t]}))}
vendor: 2,652 bytes, line 2
2));var Tt=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Et(t,e){if(e){if(Tt[t]&&(null!=e.children||null!=e.dangerouslySetInnerHTML))throw Error(a(137,t));if(null!=e.dangerouslySetInnerHTML){if(null!=e.children)throw Error(a(60));if("object"!==typeof e.dangerouslySetInnerHTML||!("__html"in e.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=e.style&&"object"!==typeof e.style)throw Error(a(62))}}function St(t,e){if(-1===t.indexOf("-"))return"string"===typeof e.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Ot(t){return(t=t.target||t.srcElement||window).correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}var kt=null,Ct=null,Mt=null;function At(t){if(t=ti(t)){if("function"!==typeof kt)throw Error(a(280));var e=t.stateNode;e&&(e=ni(e),kt(t.stateNode,t.type,e))}}function It(t){Ct?Mt?Mt.push(t):Mt=[t]:Ct=t}function jt(){if(Ct){var t=Ct,e=Mt;if(Mt=Ct=null,At(t),e)for(t=0;t<e.length;t++)At(e[t])}}function Pt(t,e){return t(e)}function Rt(t,e,n,r,i){return t(e,n,r,i)}function Nt(){}var Lt=Pt,Dt=!1,Ft=!1;function Ut(){null===Ct&&null===Mt||(Nt(),jt())}function Bt(t,e){var n=t.stateNode;if(null===n)return null;var r=ni(n);if(null===r)return null;n=r[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(t=t.type)||"input"===t||"select"===t||"textarea"===t)),t=!r;break t;default:t=!1}if(t)return null;if(n&&"function"!==typeof n)throw Error(a(231,e,typeof n));return n}var Vt=!1;if(h)try{var zt={};Object.defineProperty(zt,"passive",{get:function(){Vt=!0}}),window.addEventListener("test",zt,zt),window.removeEventListener("test",zt,zt)}catch(mt){Vt=!1}function Ht(t,e,n,r,i,o,a,s,u){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(l){this.onError(l)}}var qt=!1,Wt=null,Gt=!1,Yt=null,Xt={onError:function(t){qt=!0,Wt=t}};function Kt(t,e,n,r,i,o,a,s,u){qt=!1,Wt=null,Ht.apply(Xt,arguments)}function Qt(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!==(1026&(e=t).flags)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function Jt(t){if(13===t.tag){var e=t.memoizedState;if(null===e&&(null!==(t=t.alternate)&&(e=t.memoizedState)),null!==e)return e.dehydrated}return null}
vendor: 11,127 bytes, line 2
2function Zt(t){if(Qt(t)!==t)throw Error(a(188))}function $t(t){if(!(t=function(t){var e=t.alternate;if(!e){if(null===(e=Qt(t)))throw Error(a(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Zt(i),t;if(o===r)return Zt(i),e;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,u=i.child;u;){if(u===n){s=!0,n=i,r=o;break}if(u===r){s=!0,r=i,n=o;break}u=u.sibling}if(!s){for(u=o.child;u;){if(u===n){s=!0,n=o,r=i;break}if(u===r){s=!0,r=o,n=i;break}u=u.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?t:e}(t)))return null;for(var e=t;;){if(5===e.tag||6===e.tag)return e;if(e.child)e.child.return=e,e=e.child;else{if(e===t)break;for(;!e.sibling;){if(!e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}}return null}function te(t,e){for(var n=t.alternate;null!==e;){if(e===t||e===n)return!0;e=e.return}return!1}var ee,ne,re,ie,oe=!1,ae=[],se=null,ue=null,ce=null,le=new Map,he=new Map,fe=[],de="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pe(t,e,n,r,i){return{blockedOn:t,domEventName:e,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function ve(t,e){switch(t){case"focusin":case"focusout":se=null;break;case"dragenter":case"dragleave":ue=null;break;case"mouseover":case"mouseout":ce=null;break;case"pointerover":case"pointerout":le.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":he.delete(e.pointerId)}}function me(t,e,n,r,i,o){return null===t||t.nativeEvent!==o?(t=pe(e,n,r,i,o),null!==e&&(null!==(e=ti(e))&&ne(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,null!==i&&-1===e.indexOf(i)&&e.push(i),t)}function ge(t){var e=$r(t.target);if(null!==e){var n=Qt(e);if(null!==n)if(13===(e=n.tag)){if(null!==(e=Jt(n)))return t.blockedOn=e,void ie(t.lanePriority,(function(){o.unstable_runWithPriority(t.priority,(function(){re(n)}))}))}else if(3===e&&n.stateNode.hydrate)return void(t.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}t.blockedOn=null}function ye(t){if(null!==t.blockedOn)return!1;for(var e=t.targetContainers;0<e.length;){var n=$e(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(null!==n)return null!==(e=ti(n))&&ne(e),t.blockedOn=n,!1;e.shift()}return!0}function be(t,e,n){ye(t)&&n.delete(e)}function _e(){for(oe=!1;0<ae.length;){var t=ae[0];if(null!==t.blockedOn){null!==(t=ti(t.blockedOn))&&ee(t);break}for(var e=t.targetContainers;0<e.length;){var n=$e(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(null!==n){t.blockedOn=n;break}e.shift()}null===t.blockedOn&&ae.shift()}null!==se&&ye(se)&&(se=null),null!==ue&&ye(ue)&&(ue=null),null!==ce&&ye(ce)&&(ce=null),le.forEach(be),he.forEach(be)}function we(t,e){t.blockedOn===e&&(t.blockedOn=null,oe||(oe=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,_e)))}function xe(t){function e(e){return we(e,t)}if(0<ae.length){we(ae[0],t);for(var n=1;n<ae.length;n++){var r=ae[n];r.blockedOn===t&&(r.blockedOn=null)}}for(null!==se&&we(se,t),null!==ue&&we(ue,t),null!==ce&&we(ce,t),le.forEach(e),he.forEach(e),n=0;n<fe.length;n++)(r=fe[n]).blockedOn===t&&(r.blockedOn=null);for(;0<fe.length&&null===(n=fe[0]).blockedOn;)ge(n),null===n.blockedOn&&fe.shift()}function Te(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Ee={animationend:Te("Animation","AnimationEnd"),animationiteration:Te("Animation","AnimationIteration"),animationstart:Te("Animation","AnimationStart"),transitionend:Te("Transition","TransitionEnd")},Se={},Oe={};function ke(t){if(Se[t])return Se[t];if(!Ee[t])return t;var e,n=Ee[t];for(e in n)if(n.hasOwnProperty(e)&&e in Oe)return Se[t]=n[e];return t}h&&(Oe=document.createElement("div").style,"AnimationEvent"in window||(delete Ee.animationend.animation,delete Ee.animationiteration.animation,delete Ee.animationstart.animation),"TransitionEvent"in window||delete Ee.transitionend.transition);var Ce=ke("animationend"),Me=ke("animationiteration"),Ae=ke("animationstart"),Ie=ke("transitionend"),je=new Map,Pe=new Map,Re=["abort","abort",Ce,"animationEnd",Me,"animationIteration",Ae,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ie,"transitionEnd","waiting","waiting"];function Ne(t,e){for(var n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Pe.set(r,e),je.set(r,i),c(i,[r])}}(0,o.unstable_now)();var Le=8;function De(t){if(0!==(1&t))return Le=15,1;if(0!==(2&t))return Le=14,2;if(0!==(4&t))return Le=13,4;var e=24&t;return 0!==e?(Le=12,e):0!==(32&t)?(Le=11,32):0!==(e=192&t)?(Le=10,e):0!==(256&t)?(Le=9,256):0!==(e=3584&t)?(Le=8,e):0!==(4096&t)?(Le=7,4096):0!==(e=4186112&t)?(Le=6,e):0!==(e=62914560&t)?(Le=5,e):67108864&t?(Le=4,67108864):0!==(134217728&t)?(Le=3,134217728):0!==(e=805306368&t)?(Le=2,e):0!==(1073741824&t)?(Le=1,1073741824):(Le=8,t)}function Fe(t,e){var n=t.pendingLanes;if(0===n)return Le=0;var r=0,i=0,o=t.expiredLanes,a=t.suspendedLanes,s=t.pingedLanes;if(0!==o)r=o,i=Le=15;else if(0!==(o=134217727&n)){var u=o&~a;0!==u?(r=De(u),i=Le):0!==(s&=o)&&(r=De(s),i=Le)}else 0!==(o=n&~a)?(r=De(o),i=Le):0!==s&&(r=De(s),i=Le);if(0===r)return 0;if(r=n&((0>(r=31-qe(r))?0:1<<r)<<1)-1,0!==e&&e!==r&&0===(e&a)){if(De(e),i<=Le)return e;Le=i}if(0!==(e=t.entangledLanes))for(t=t.entanglements,e&=r;0<e;)i=1<<(n=31-qe(e)),r|=t[n],e&=~i;return r}function Ue(t){return 0!==(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function Be(t,e){switch(t){case 15:return 1;case 14:return 2;case 12:return 0===(t=Ve(24&~e))?Be(10,e):t;case 10:return 0===(t=Ve(192&~e))?Be(8,e):t;case 8:return 0===(t=Ve(3584&~e))&&(0===(t=Ve(4186112&~e))&&(t=512)),t;case 2:return 0===(e=Ve(805306368&~e))&&(e=268435456),e}throw Error(a(358,t))}function Ve(t){return t&-t}function ze(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function He(t,e,n){t.pendingLanes|=e;var r=e-1;t.suspendedLanes&=r,t.pingedLanes&=r,(t=t.eventTimes)[e=31-qe(e)]=n}var qe=Math.clz32?Math.clz32:function(t){return 0===t?32:31-(We(t)/Ge|0)|0},We=Math.log,Ge=Math.LN2;var Ye=o.unstable_UserBlockingPriority,Xe=o.unstable_runWithPriority,Ke=!0;function Qe(t,e,n,r){Dt||Nt();var i=Ze,o=Dt;Dt=!0;try{Rt(i,t,e,n,r)}finally{(Dt=o)||Ut()}}function Je(t,e,n,r){Xe(Ye,Ze.bind(null,t,e,n,r))}function Ze(t,e,n,r){var i;if(Ke)if((i=0===(4&e))&&0<ae.length&&-1<de.indexOf(t))t=pe(null,t,e,n,r),ae.push(t);else{var o=$e(t,e,n,r);if(null===o)i&&ve(t,r);else{if(i){if(-1<de.indexOf(t))return t=pe(o,t,e,n,r),void ae.push(t);if(function(t,e,n,r,i){switch(e){case"focusin":return se=me(se,t,e,n,r,i),!0;case"dragenter":return ue=me(ue,t,e,n,r,i),!0;case"mouseover":return ce=me(ce,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return le.set(o,me(le.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,he.set(o,me(he.get(o)||null,t,e,n,r,i)),!0}return!1}(o,t,e,n,r))return;ve(t,r)}jr(t,e,r,null,n)}}}function $e(t,e,n,r){var i=Ot(r);if(null!==(i=$r(i))){var o=Qt(i);if(null===o)i=null;else{var a=o.tag;if(13===a){if(null!==(i=Jt(o)))return i;i=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return jr(t,e,r,i,n),null}var tn=null,en=null,nn=null;function rn(){if(nn)return nn;var t,e,n=en,r=n.length,i="value"in tn?tn.value:tn.textContent,o=i.length;for(t=0;t<r&&n[t]===i[t];t++);var a=r-t;for(e=1;e<=a&&n[r-e]===i[o-e];e++);return nn=i.slice(t,1<e?1-e:void 0)}function on(t){var e=t.keyCode;return"charCode"in t?0===(t=t.charCode)&&13===e&&(t=13):t=e,10===t&&(t=13),32<=t||13===t?t:0}function an(){return!0}function sn(){return!1}function un(t){function e(e,n,r,i,o){for(var a in this._reactName=e,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,t)t.hasOwnProperty(a)&&(e=t[a],this[a]=e?e(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?an:sn,this.isPropagationStopped=sn,this}return i(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():"unknown"!==typeof t.returnValue&&(t.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():"unknown"!==typeof t.cancelBubble&&(t.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),e}var cn,ln,hn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=un(fn),pn=i({},fn,{view:0,detail:0}),vn=un(pn),mn=i({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,button:0,buttons:0,relatedTarget:function(t){return void 0===t.relatedTarget?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==hn&&(hn&&"mousemove"===t.type?(cn=t.screenX-hn.screenX,ln=t.screenY-hn.screenY):ln=cn=0,hn=t),cn)},movementY:function(t){return"movementY"in t?t.movementY:ln}}),gn=un(mn),yn=un(i({},mn,{dataTransfer:0})),bn=un(i({},pn,{relatedTarget:0})),_n=un(i({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=un(i({},fn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),xn=un(i({},fn,{data:0})),Tn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},En={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function On(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):!!(t=Sn[t])&&!!e[t]}function kn(){return On}var Cn=un(i({},pn,{key:function(t){if(t.key){var e=Tn[t.key]||t.key;if("Unidentified"!==e)return e}return"keypress"===t.type?13===(t=on(t))?"Enter":String.fromCharCode(t):"keydown"===t.type||"ke
2yup"===t.type?En[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(t){return"keypress"===t.type?on(t):0},keyCode:function(t){return"keydown"===t.type||"keyup"===t.type?t.keyCode:0},which:function(t){return"keypress"===t.type?on(t):"keydown"===t.type||"keyup"===t.type?t.keyCode:0}})),Mn=un(i({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),An=un(i({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),In=un(i({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),jn=un(i({},mn,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0})),Pn=[9,13,27,32],Rn=h&&"CompositionEvent"in window,Nn=null;h&&"documentMode"in document&&(Nn=document.documentMode);var Ln=h&&"TextEvent"in window&&!Nn,Dn=h&&(!Rn||Nn&&8<Nn&&11>=Nn),Fn=String.fromCharCode(32),Un=!1;function Bn(t,e){switch(t){case"keyup":return-1!==Pn.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vn(t){return"object"===typeof(t=t.detail)&&"data"in t?t.data:null}var zn=!1;var Hn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qn(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!Hn[t.type]:"textarea"===e}function Wn(t,e,n,r){It(r),0<(e=Rr(e,"onChange")).length&&(n=new dn("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Gn=null,Yn=null;function Xn(t){Or(t,0)}function Kn(t){if(J(ei(t)))return t}function Qn(t,e){if("change"===t)return e}var Jn=!1;if(h){var Zn;if(h){var $n="oninput"in document;if(!$n){var tr=document.createElement("div");tr.setAttribute("oninput","return;"),$n="function"===typeof tr.oninput}Zn=$n}else Zn=!1;Jn=Zn&&(!document.documentMode||9<document.documentMode)}function er(){Gn&&(Gn.detachEvent("onpropertychange",nr),Yn=Gn=null)}function nr(t){if("value"===t.propertyName&&Kn(Yn)){var e=[];if(Wn(e,Yn,t,Ot(t)),t=Xn,Dt)t(e);else{Dt=!0;try{Pt(t,e)}finally{Dt=!1,Ut()}}}}function rr(t,e,n){"focusin"===t?(er(),Yn=n,(Gn=e).attachEvent("onpropertychange",nr)):"focusout"===t&&er()}function ir(t){if("selectionchange"===t||"keyup"===t||"keydown"===t)return Kn(Yn)}function or(t,e){if("click"===t)return Kn(e)}function ar(t,e){if("input"===t||"change"===t)return Kn(e)}var sr="function"===typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t===1/e)||t!==t&&e!==e},ur=Object.prototype.hasOwnProperty;function cr(t,e){if(sr(t,e))return!0;if("object"!==typeof t||null===t||"object"!==typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!ur.call(e,n[r])||!sr(t[n[r]],e[n[r]]))return!1;return!0}function lr(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function hr(t,e){var n,r=lr(t);for(t=0;r;){if(3===r.nodeType){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=lr(r)}}function fr(t,e){return!(!t||!e)&&(t===e||(!t||3!==t.nodeType)&&(e&&3===e.nodeType?fr(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}function dr(){for(var t=window,e=Z();e instanceof t.HTMLIFrameElement;){try{var n="string"===typeof e.contentWindow.location.href}catch(r){n=!1}if(!n)break;e=Z((t=e.contentWindow).document)}return e}function pr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}var vr=h&&"documentMode"in document&&11>=document.documentMode,mr=null,gr=null,yr=null,br=!1;function _r(t,e,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==mr||mr!==Z(r)||("selectionStart"in(r=mr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 12,834 bytes, line 2
2sNode:r.focusNode,focusOffset:r.focusOffset},yr&&cr(yr,r)||(yr=r,0<(r=Rr(gr,"onSelect")).length&&(e=new dn("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=mr)))}Ne("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Ne("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Ne(Re,2);for(var wr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),xr=0;xr<wr.length;xr++)Pe.set(wr[xr],0);l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Er=new Set("cancel close invalid load scroll toggle".split(" ").concat(Tr));function Sr(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,function(t,e,n,r,i,o,s,u,c){if(Kt.apply(this,arguments),qt){if(!qt)throw Error(a(198));var l=Wt;qt=!1,Wt=null,Gt||(Gt=!0,Yt=l)}}(r,e,void 0,t),t.currentTarget=null}function Or(t,e){e=0!==(4&e);for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;t:{var o=void 0;if(e)for(var a=r.length-1;0<=a;a--){var s=r[a],u=s.instance,c=s.currentTarget;if(s=s.listener,u!==o&&i.isPropagationStopped())break t;Sr(i,s,c),o=u}else for(a=0;a<r.length;a++){if(u=(s=r[a]).instance,c=s.currentTarget,s=s.listener,u!==o&&i.isPropagationStopped())break t;Sr(i,s,c),o=u}}}if(Gt)throw t=Yt,Gt=!1,Yt=null,t}function kr(t,e){var n=ri(e),r=t+"__bubble";n.has(r)||(Ir(e,t,2,!1),n.add(r))}var Cr="_reactListening"+Math.random().toString(36).slice(2);function Mr(t){t[Cr]||(t[Cr]=!0,s.forEach((function(e){Er.has(e)||Ar(e,!1,t,null),Ar(e,!0,t,null)})))}function Ar(t,e,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===t&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!e&&Er.has(t)){if("scroll"!==t)return;i|=2,o=r}var a=ri(o),s=t+"__"+(e?"capture":"bubble");a.has(s)||(e&&(i|=4),Ir(o,t,i,e),a.add(s))}function Ir(t,e,n,r){var i=Pe.get(e);switch(void 0===i?2:i){case 0:i=Qe;break;case 1:i=Je;break;default:i=Ze}n=i.bind(null,e,n,t),i=void 0,!Vt||"touchstart"!==e&&"touchmove"!==e&&"wheel"!==e||(i=!0),r?void 0!==i?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):void 0!==i?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function jr(t,e,n,r,i){var o=r;if(0===(1&e)&&0===(2&e)&&null!==r)t:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var u=a.tag;if((3===u||4===u)&&((u=a.stateNode.containerInfo)===i||8===u.nodeType&&u.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=$r(s)))return;if(5===(u=a.tag)||6===u){r=o=a;continue t}s=s.parentNode}}r=r.return}!function(t,e,n){if(Ft)return t(e,n);Ft=!0;try{Lt(t,e,n)}finally{Ft=!1,Ut()}}((function(){var r=o,i=Ot(n),a=[];t:{var s=je.get(t);if(void 0!==s){var u=dn,c=t;switch(t){case"keypress":if(0===on(n))break t;case"keydown":case"keyup":u=Cn;break;case"focusin":c="focus",u=bn;break;case"focusout":c="blur",u=bn;break;case"beforeblur":case"afterblur":u=bn;break;case"click":if(2===n.button)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=An;break;case Ce:case Me:case Ae:u=_n;break;case Ie:u=In;break;case"scroll":u=vn;break;case"wheel":u=jn;break;case"copy":case"cut":case"paste":u=wn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=Mn}var l=0!==(4&e),h=!l&&"scroll"===t,f=l?null!==s?s+"Capture":null:s;l=[];for(var d,p=r;null!==p;){var v=(d=p).stateNode;if(5===d.tag&&null!==v&&(d=v,null!==f&&(null!=(v=Bt(p,f))&&l.push(Pr(p,v,d)))),h)break;p=p.return}0<l.length&&(s=new u(s,c,null,n,i),a.push({event:s,listeners:l}))}}if(0===(7&e)){if(u="mouseout"===t||"pointerout"===t,(!(s="mouseover"===t||"pointerover"===t)||0!==(16&e)||!(c=n.relatedTarget||n.fromElement)||!$r(c)&&!c[Jr])&&(u||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,u?(u=r,null!==(c=(c=n.relatedTarget||n.toElement)?$r(c):null)&&(c!==(h=Qt(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(u=null,c=r),u!==c)){if(l=gn,v="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==t&&"pointerover"!==t||(l=Mn,v="onPointerLeave",f="onPointerEnter",p="pointer"),h=null==u?s:ei(u),d=null==c?s:ei(c),(s=new l(v,p+"leave",u,n,i)).target=h,s.relatedTarget=d,v=null,$r(i)===r&&((l=new l(f,p+"enter",c,n,i)).target=d,l.relatedTarget=h,v=l),h=v,u&&c)t:{for(f=c,p=0,d=l=u;d;d=Nr(d))p++;for(d=0,v=f;v;v=Nr(v))d++;for(;0<p-d;)l=Nr(l),p--;for(;0<d-p;)f=Nr(f),d--;for(;p--;){if(l===f||null!==f&&l===f.alternate)break t;l=Nr(l),f=Nr(f)}l=null}else l=null;null!==u&&Lr(a,s,u,l,!1),null!==c&&null!==h&&Lr(a,h,c,l,!0)}if("select"===(u=(s=r?ei(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type)var m=Qn;else if(qn(s))if(Jn)m=ar;else{m=ir;var g=rr}else(u=s.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=or);switch(m&&(m=m(t,r))?Wn(a,m,n,i):(g&&g(t,s,r),"focusout"===t&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&it(s,"number",s.value)),g=r?ei(r):window,t){case"focusin":(qn(g)||"true"===g.contentEditable)&&(mr=g,gr=r,yr=null);break;case"focusout":yr=gr=mr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,_r(a,n,i);break;case"selectionchange":if(vr)break;case"keydown":case"keyup":_r(a,n,i)}var y;if(Rn)t:{switch(t){case"compositionstart":var b="onCompositionStart";break t;case"compositionend":b="onCompositionEnd";break t;case"compositionupdate":b="onCompositionUpdate";break t}b=void 0}else zn?Bn(t,n)&&(b="onCompositionEnd"):"keydown"===t&&229===n.keyCode&&(b="onCompositionStart");b&&(Dn&&"ko"!==n.locale&&(zn||"onCompositionStart"!==b?"onCompositionEnd"===b&&zn&&(y=rn()):(en="value"in(tn=i)?tn.value:tn.textContent,zn=!0)),0<(g=Rr(r,b)).length&&(b=new xn(b,t,null,n,i),a.push({event:b,listeners:g}),y?b.data=y:null!==(y=Vn(n))&&(b.data=y))),(y=Ln?function(t,e){switch(t){case"compositionend":return Vn(e);case"keypress":return 32!==e.which?null:(Un=!0,Fn);case"textInput":return(t=e.data)===Fn&&Un?null:t;default:return null}}(t,n):function(t,e){if(zn)return"compositionend"===t||!Rn&&Bn(t,e)?(t=rn(),nn=en=tn=null,zn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Dn&&"ko"!==e.locale?null:e.data;default:return null}}(t,n))&&(0<(r=Rr(r,"onBeforeInput")).length&&(i=new xn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=y))}Or(a,e)}))}function Pr(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Rr(t,e){for(var n=e+"Capture",r=[];null!==t;){var i=t,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Bt(t,n))&&r.unshift(Pr(t,o,i)),null!=(o=Bt(t,e))&&r.push(Pr(t,o,i))),t=t.return}return r}function Nr(t){if(null===t)return null;do{t=t.return}while(t&&5!==t.tag);return t||null}function Lr(t,e,n,r,i){for(var o=e._reactName,a=[];null!==n&&n!==r;){var s=n,u=s.alternate,c=s.stateNode;if(null!==u&&u===r)break;5===s.tag&&null!==c&&(s=c,i?null!=(u=Bt(n,o))&&a.unshift(Pr(n,u,s)):i||null!=(u=Bt(n,o))&&a.push(Pr(n,u,s))),n=n.return}0!==a.length&&t.push({event:e,listeners:a})}function Dr(){}var Fr=null,Ur=null;function Br(t,e){switch(t){case"button":case"input":case"select":case"textarea":return!!e.autoFocus}return!1}function Vr(t,e){return"textarea"===t||"option"===t||"noscript"===t||"string"===typeof e.children||"number"===typeof e.children||"object"===typeof e.dangerouslySetInnerHTML&&null!==e.dangerouslySetInnerHTML&&null!=e.dangerouslySetInnerHTML.__html}var zr="function"===typeof setTimeout?setTimeout:void 0,Hr="function"===typeof clearTimeout?clearTimeout:void 0;function qr(t){1===t.nodeType?t.textContent="":9===t.nodeType&&(null!=(t=t.body)&&(t.textContent=""))}function Wr(t){for(;null!=t;t=t.nextSibling){var e=t.nodeType;if(1===e||3===e)break}return t}function Gr(t){t=t.previousSibling;for(var e=0;t;){if(8===t.nodeType){var n=t.data;if("$"===n||"$!"===n||"$?"===n){if(0===e)return t;e--}else"/$"===n&&e++}t=t.previousSibling}return null}var Yr=0;var Xr=Math.random().toString(36).slice(2),Kr="__reactFiber$"+Xr,Qr="__reactProps$"+Xr,Jr="__reactContainer$"+Xr,Zr="__reactEvents$"+Xr;function $r(t){var e=t[Kr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Jr]||n[Kr]){if(n=e.alternate,null!==e.child||null!==n&&null!==n.child)for(t=Gr(t);null!==t;){if(n=t[Kr])return n;t=Gr(t)}return e}n=(t=n).parentNode}return null}function ti(t){return!(t=t[Kr]||t[Jr])||5!==t.tag&&6!==t.tag&&13!==t.tag&&3!==t.tag?null:t}function ei(t){if(5===t.tag||6===t.tag)return t.stateNode;throw Error(a(33))}function ni(t){return t[Qr]||null}function ri(t){var e=t[Zr];return void 0===e&&(e=t[Zr]=new Set),e}var ii=[],oi=-1;function ai(t){return{current:t}}function si(t){0>oi||(t.current=ii[oi],ii[oi]=null,oi--)}function ui(t,e){oi++,ii[oi]=t.current,t.current=e}var ci={},li=ai(ci),hi=ai(!1),fi=ci;function di(t,e){var n=t.type.contextTypes;if(!n)return ci;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=e[i];return r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function pi(t){return null!==(t=t.childContextTypes)&&void 0!==t}function vi(){si(hi),si(li)}function mi(t,e,n){if(li.current!==ci)throw Error(a(168));ui(li,e),ui(hi,n)}function gi(t,e,n){var r=t.stateNode;if(t=e.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(a(108,Y(e)||"Unknown",o));return i({},n,r)}function yi(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ci,fi=li.current,ui(li,t),ui(hi,hi.current),!0}function bi(t,e,n){var r=t.stateNode;if(!r)throw Error(a(169));n?(t=gi(t,e,fi),r.__reactInternalMemoizedMergedChildContext=t,si(hi),si(li),ui(li,t)):si(hi),ui(hi,n)}var _i=null,wi=null,xi=o.unstable_runWithPriority,Ti=o.unstable_scheduleCallback,Ei=o.unstable_cancelCallback,Si=o.unstable_shouldYield,Oi=o.unstable_requestPaint,ki=o.unstable_now,Ci=o.unstable_getCurrentPriorityLevel,Mi=o.unstable_ImmediatePriority,Ai=o.unstable_UserBlockingPriority,Ii=o.unstable_NormalPriority,ji=o.unstable_LowPriority,Pi=o.unstable_IdlePriority,Ri={},Ni=void 0!==Oi?Oi:function(){},Li=null,Di=null,Fi=!1,Ui=ki(),Bi=1e4>Ui?ki:function(){return ki()-Ui};function Vi(){switch(Ci()){case Mi:return 99;case Ai:return 98;case Ii:return 97;case ji:return 96;case Pi:return 95;default:throw Error(a(332))}}function zi(t){switch(t){case 99:return Mi;case 98:return Ai;case 97:return Ii;case 96:return ji;case 95:return Pi;default:throw Error(a(332))}}function Hi(t,e){return t=zi(t),xi(t,e)}function qi(t,e,n){return t=zi(t),Ti(t,e,n)}function Wi(){if(null!==Di){var t=Di;Di=null,Ei(t)}Gi()}
2function Gi(){if(!Fi&&null!==Li){Fi=!0;var t=0;try{var e=Li;Hi(99,(function(){for(;t<e.length;t++){var n=e[t];do{n=n(!0)}while(null!==n)}})),Li=null}catch(n){throw null!==Li&&(Li=Li.slice(t+1)),Ti(Mi,Wi),n}finally{Fi=!1}}}var Yi=w.ReactCurrentBatchConfig;function Xi(t,e){if(t&&t.defaultProps){for(var n in e=i({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}return e}var Ki=ai(null),Qi=null,Ji=null,Zi=null;function $i(){Zi=Ji=Qi=null}function to(t){var e=Ki.current;si(Ki),t.type._context._currentValue=e}function eo(t,e){for(;null!==t;){var n=t.alternate;if((t.childLanes&e)===e){if(null===n||(n.childLanes&e)===e)break;n.childLanes|=e}else t.childLanes|=e,null!==n&&(n.childLanes|=e);t=t.return}}function no(t,e){Qi=t,Zi=Ji=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(0!==(t.lanes&e)&&(Ra=!0),t.firstContext=null)}function ro(t,e){if(Zi!==t&&!1!==e&&0!==e)if("number"===typeof e&&1073741823!==e||(Zi=t,e=1073741823),e={context:t,observedBits:e,next:null},null===Ji){if(null===Qi)throw Error(a(308));Ji=e,Qi.dependencies={lanes:0,firstContext:e,responders:null}}else Ji=Ji.next=e;return t._currentValue}var io=!1;function oo(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ao(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function so(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function uo(t,e){if(null!==(t=t.updateQueue)){var n=(t=t.shared).pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}}function co(t,e){var n=t.updateQueue,r=t.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=e:o=o.next=e}else i=o=e;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(t.updateQueue=n)}null===(t=n.lastBaseUpdate)?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function lo(t,e,n,r){var o=t.updateQueue;io=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,u=o.shared.pending;if(null!==u){o.shared.pending=null;var c=u,l=c.next;c.next=null,null===s?a=l:s.next=l,s=c;var h=t.alternate;if(null!==h){var f=(h=h.updateQueue).lastBaseUpdate;f!==s&&(null===f?h.firstBaseUpdate=l:f.next=l,h.lastBaseUpdate=c)}}if(null!==a){for(f=o.baseState,s=0,h=l=c=null;;){u=a.lane;var d=a.eventTime;if((r&u)===u){null!==h&&(h=h.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});t:{var p=t,v=a;switch(u=e,d=n,v.tag){case 1:if("function"===typeof(p=v.payload)){f=p.call(d,f,u);break t}f=p;break t;case 3:p.flags=-4097&p.flags|64;case 0:if(null===(u="function"===typeof(p=v.payload)?p.call(d,f,u):p)||void 0===u)break t;f=i({},f,u);break t;case 2:io=!0}}null!==a.callback&&(t.flags|=32,null===(u=o.effects)?o.effects=[a]:u.push(a))}else d={eventTime:d,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===h?(l=h=d,c=f):h=h.next=d,s|=u;if(null===(a=a.next)){if(null===(u=o.shared.pending))break;a=u.next,u.next=null,o.lastBaseUpdate=u,o.shared.pending=null}}null===h&&(c=f),o.baseState=c,o.firstBaseUpdate=l,o.lastBaseUpdate=h,Fs|=s,t.lanes=s,t.memoizedState=f}}function ho(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!==typeof i)throw Error(a(191,i));i.call(r)}}}var fo=(new r.Component).refs;function po(t,e,n,r){n=null===(n=n(r,e=t.memoizedState))||void 0===n?e:i({},e,n),t.memoizedState=n,0===t.lanes&&(t.updateQueue.baseState=n)}var vo={isMounted:function(t){return!!(t=t._reactInternals)&&Qt(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=cu(),i=lu(t),o=so(r,i);o.payload=e,void 0!==n&&null!==n&&(o.callback=n),uo(t,o),hu(t,i,r)},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=cu(),i=lu(t),o=so(r,i);o.tag=1,o.payload=e,void 0!==n&&null!==n&&(o.callback=n),uo(t,o),hu(t,i,r)},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=cu(),r=lu(t),i=so(n,r);i.tag=2,void 0!==e&&null!==e&&(i.callback=e),uo(t,i),hu(t,r,n)}};function mo(t,e,n,r,i,o,a){return"function"===typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(r,o,a):!e.prototype||!e.prototype.isPureReactComponent||(!cr(n,r)||!cr(i,o))}function go(t,e,n){var r=!1,i=ci,o=e.contextType;return"object"===typeof o&&null!==o?o=ro(o):(i=pi(e)?fi:li.current,o=(r=null!==(r=e.contextTypes)&&void 0!==r)?di(t,i):ci),e=new e(n,o),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=vo,t.stateNode=e,e._reactInternals=t,r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function yo(t,e,n,r){t=e.state,"function"===typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,r),"function"===typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&vo.enqueueReplaceState(e,e.state,null)}function bo(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=fo,oo(t);var o=e.contextType;"object"===typeof o&&null!==o?i.context=ro(o):(o=pi(e)?fi:li.current,i.context=di(t,o)),lo(t,n,i,r),i.state=t.memoizedState,"function"===typeof(o=e.getDerivedStateFromProps)&&(po(t,e,o,n),i.state=t.memoizedState),"function"===typeof e.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(e=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),e!==i.state&&vo.enqueueReplaceState(i,i.state,null),lo(t,n,i,r),i.state=t.memoizedState),"function"===typeof i.componentDidMount&&(t.flags|=4)}var _o=Array.isArray;function wo(t,e,n){if(null!==(t=n.ref)&&"function"!==typeof t&&"object"!==typeof t){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,t));var i=""+t;return null!==e&&null!==e.ref&&"function"===typeof e.ref&&e.ref._stringRef===i?e.ref:((e=function(t){var e=r.refs;e===fo&&(e=r.refs={}),null===t?delete e[i]:e[i]=t})._stringRef=i,e)}if("string"!==typeof t)throw Error(a(284));if(!n._owner)throw Error(a(290,t))}return t}function xo(t,e){if("textarea"!==t.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(e)?"object with keys {"+Object.keys(e).join(", ")+"}":e))}function To(t){function e(e,n){if(t){var r=e.lastEffect;null!==r?(r.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!t)return null;for(;null!==r;)e(n,r),r=r.sibling;return null}function r(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(t,e){return(t=Hu(t,e)).index=0,t.sibling=null,t}function o(e,n,r){return e.index=r,t?null!==(r=e.alternate)?(r=r.index)<n?(e.flags=2,n):r:(e.flags=2,n):n}function s(e){return t&&null===e.alternate&&(e.flags=2),e}function u(t,e,n,r){return null===e||6!==e.tag?((e=Yu(n,t.mode,r)).return=t,e):((e=i(e,n)).return=t,e)}function c(t,e,n,r){return null!==e&&e.elementType===n.type?((r=i(e,n.props)).ref=wo(t,e,n),r.return=t,r):((r=qu(n.type,n.key,n.props,null,t.mode,r)).ref=wo(t,e,n),r.return=t,r)}function l(t,e,n,r){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?((e=Xu(n,t.mode,r)).return=t,e):((e=i(e,n.children||[])).return=t,e)}function h(t,e,n,r,o){return null===e||7!==e.tag?((e=Wu(n,t.mode,r,o)).return=t,e):((e=i(e,n)).return=t,e)}function f(t,e,n){if("string"===typeof e||"number"===typeof e)return(e=Yu(""+e,t.mode,n)).return=t,e;if("object"===typeof e&&null!==e){switch(e.$$typeof){case x:return(n=qu(e.type,e.key,e.props,null,t.mode,n)).ref=wo(t,null,e),n.return=t,n;case T:return(e=Xu(e,t.mode,n)).return=t,e}if(_o(e)||z(e))return(e=Wu(e,t.mode,n,null)).return=t,e;xo(t,e)}return null}function d(t,e,n,r){var i=null!==e?e.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:u(t,e,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case x:return n.key===i?n.type===E?h(t,e,n.props.children,r,i):c(t,e,n,r):null;case T:return n.key===i?l(t,e,n,r):null}if(_o(n)||z(n))return null!==i?null:h(t,e,n,r,null);xo(t,n)}return null}function p(t,e,n,r,i){if("string"===typeof r||"number"===typeof r)return u(e,t=t.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case x:return t=t.get(null===r.key?n:r.key)||null,r.type===E?h(e,t,r.props.children,i,r.key):c(e,t,r,i);case T:return l(e,t=t.get(null===r.key?n:r.key)||null,r,i)}if(_o(r)||z(r))return h(e,t=t.get(n)||null,r,i,null);xo(e,r)}return null}function v(i,a,s,u){for(var c=null,l=null,h=a,v=a=0,m=null;null!==h&&v<s.length;v++){h.index>v?(m=h,h=null):m=h.sibling;var g=d(i,h,s[v],u);
vendor: 4,746 bytes, line 2
2if(null===g){null===h&&(h=m);break}t&&h&&null===g.alternate&&e(i,h),a=o(g,a,v),null===l?c=g:l.sibling=g,l=g,h=m}if(v===s.length)return n(i,h),c;if(null===h){for(;v<s.length;v++)null!==(h=f(i,s[v],u))&&(a=o(h,a,v),null===l?c=h:l.sibling=h,l=h);return c}for(h=r(i,h);v<s.length;v++)null!==(m=p(h,i,v,s[v],u))&&(t&&null!==m.alternate&&h.delete(null===m.key?v:m.key),a=o(m,a,v),null===l?c=m:l.sibling=m,l=m);return t&&h.forEach((function(t){return e(i,t)})),c}function m(i,s,u,c){var l=z(u);if("function"!==typeof l)throw Error(a(150));if(null==(u=l.call(u)))throw Error(a(151));for(var h=l=null,v=s,m=s=0,g=null,y=u.next();null!==v&&!y.done;m++,y=u.next()){v.index>m?(g=v,v=null):g=v.sibling;var b=d(i,v,y.value,c);if(null===b){null===v&&(v=g);break}t&&v&&null===b.alternate&&e(i,v),s=o(b,s,m),null===h?l=b:h.sibling=b,h=b,v=g}if(y.done)return n(i,v),l;if(null===v){for(;!y.done;m++,y=u.next())null!==(y=f(i,y.value,c))&&(s=o(y,s,m),null===h?l=y:h.sibling=y,h=y);return l}for(v=r(i,v);!y.done;m++,y=u.next())null!==(y=p(v,i,m,y.value,c))&&(t&&null!==y.alternate&&v.delete(null===y.key?m:y.key),s=o(y,s,m),null===h?l=y:h.sibling=y,h=y);return t&&v.forEach((function(t){return e(i,t)})),l}return function(t,r,o,u){var c="object"===typeof o&&null!==o&&o.type===E&&null===o.key;c&&(o=o.props.children);var l="object"===typeof o&&null!==o;if(l)switch(o.$$typeof){case x:t:{for(l=o.key,c=r;null!==c;){if(c.key===l){switch(c.tag){case 7:if(o.type===E){n(t,c.sibling),(r=i(c,o.props.children)).return=t,t=r;break t}break;default:if(c.elementType===o.type){n(t,c.sibling),(r=i(c,o.props)).ref=wo(t,c,o),r.return=t,t=r;break t}}n(t,c);break}e(t,c),c=c.sibling}o.type===E?((r=Wu(o.props.children,t.mode,u,o.key)).return=t,t=r):((u=qu(o.type,o.key,o.props,null,t.mode,u)).ref=wo(t,r,o),u.return=t,t=u)}return s(t);case T:t:{for(c=o.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(t,r.sibling),(r=i(r,o.children||[])).return=t,t=r;break t}n(t,r);break}e(t,r),r=r.sibling}(r=Xu(o,t.mode,u)).return=t,t=r}return s(t)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(t,r.sibling),(r=i(r,o)).return=t,t=r):(n(t,r),(r=Yu(o,t.mode,u)).return=t,t=r),s(t);if(_o(o))return v(t,r,o,u);if(z(o))return m(t,r,o,u);if(l&&xo(t,o),"undefined"===typeof o&&!c)switch(t.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,Y(t.type)||"Component"))}return n(t,r)}}var Eo=To(!0),So=To(!1),Oo={},ko=ai(Oo),Co=ai(Oo),Mo=ai(Oo);function Ao(t){if(t===Oo)throw Error(a(174));return t}function Io(t,e){switch(ui(Mo,e),ui(Co,t),ui(ko,Oo),t=e.nodeType){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:pt(null,"");break;default:e=pt(e=(t=8===t?e.parentNode:e).namespaceURI||null,t=t.tagName)}si(ko),ui(ko,e)}function jo(){si(ko),si(Co),si(Mo)}function Po(t){Ao(Mo.current);var e=Ao(ko.current),n=pt(e,t.type);e!==n&&(ui(Co,t),ui(ko,n))}function Ro(t){Co.current===t&&(si(ko),si(Co))}var No=ai(0);function Lo(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!==(64&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Do=null,Fo=null,Uo=!1;function Bo(t,e){var n=Vu(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=e,n.return=t,n.flags=8,null!==t.lastEffect?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function Vo(t,e){switch(t.tag){case 5:var n=t.type;return null!==(e=1!==e.nodeType||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e)&&(t.stateNode=e,!0);case 6:return null!==(e=""===t.pendingProps||3!==e.nodeType?null:e)&&(t.stateNode=e,!0);case 13:default:return!1}}function zo(t){if(Uo){var e=Fo;if(e){var n=e;if(!Vo(t,e)){if(!(e=Wr(n.nextSibling))||!Vo(t,e))return t.flags=-1025&t.flags|2,Uo=!1,void(Do=t);Bo(Do,n)}Do=t,Fo=Wr(e.firstChild)}else t.flags=-1025&t.flags|2,Uo=!1,Do=t}}function Ho(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;Do=t}function qo(t){if(t!==Do)return!1;if(!Uo)return Ho(t),Uo=!0,!1;var e=t.type;if(5!==t.tag||"head"!==e&&"body"!==e&&!Vr(e,t.memoizedProps))for(e=Fo;e;)Bo(t,e),e=Wr(e.nextSibling);if(Ho(t),13===t.tag){if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(a(317));t:{for(t=t.nextSibling,e=0;t;){if(8===t.nodeType){var n=t.data;if("/$"===n){if(0===e){Fo=Wr(t.nextSibling);break t}e--}else"$"!==n&&"$!"!==n&&"$?"!==n||e++}t=t.nextSibling}Fo=null}}else Fo=Do?Wr(t.stateNode.nextSibling):null;return!0}
vendor: 8,172 bytes, line 2
2function Wo(){Fo=Do=null,Uo=!1}var Go=[];function Yo(){for(var t=0;t<Go.length;t++)Go[t]._workInProgressVersionPrimary=null;Go.length=0}var Xo=w.ReactCurrentDispatcher,Ko=w.ReactCurrentBatchConfig,Qo=0,Jo=null,Zo=null,$o=null,ta=!1,ea=!1;function na(){throw Error(a(321))}function ra(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!sr(t[n],e[n]))return!1;return!0}function ia(t,e,n,r,i,o){if(Qo=o,Jo=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Xo.current=null===t||null===t.memoizedState?Aa:Ia,t=n(r,i),ea){o=0;do{if(ea=!1,!(25>o))throw Error(a(301));o+=1,$o=Zo=null,e.updateQueue=null,Xo.current=ja,t=n(r,i)}while(ea)}if(Xo.current=Ma,e=null!==Zo&&null!==Zo.next,Qo=0,$o=Zo=Jo=null,ta=!1,e)throw Error(a(300));return t}function oa(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===$o?Jo.memoizedState=$o=t:$o=$o.next=t,$o}function aa(){if(null===Zo){var t=Jo.alternate;t=null!==t?t.memoizedState:null}else t=Zo.next;var e=null===$o?Jo.memoizedState:$o.next;if(null!==e)$o=e,Zo=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Zo=t).memoizedState,baseState:Zo.baseState,baseQueue:Zo.baseQueue,queue:Zo.queue,next:null},null===$o?Jo.memoizedState=$o=t:$o=$o.next=t}return $o}function sa(t,e){return"function"===typeof e?e(t):e}function ua(t){var e=aa(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var r=Zo,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var u=s=o=null,c=i;do{var l=c.lane;if((Qo&l)===l)null!==u&&(u=u.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===t?c.eagerState:t(r,c.action);else{var h={lane:l,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(s=u=h,o=r):u=u.next=h,Jo.lanes|=l,Fs|=l}c=c.next}while(null!==c&&c!==i);null===u?o=r:u.next=s,sr(r,e.memoizedState)||(Ra=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=u,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function ca(t){var e=aa(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=t(o,s.action),s=s.next}while(s!==i);sr(o,e.memoizedState)||(Ra=!0),e.memoizedState=o,null===e.baseQueue&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function la(t,e,n){var r=e._getVersion;r=r(e._source);var i=e._workInProgressVersionPrimary;if(null!==i?t=i===r:(t=t.mutableReadLanes,(t=(Qo&t)===t)&&(e._workInProgressVersionPrimary=r,Go.push(e))),t)return n(e._source);throw Go.push(e),Error(a(350))}function ha(t,e,n,r){var i=As;if(null===i)throw Error(a(349));var o=e._getVersion,s=o(e._source),u=Xo.current,c=u.useState((function(){return la(i,e,n)})),l=c[1],h=c[0];c=$o;var f=t.memoizedState,d=f.refs,p=d.getSnapshot,v=f.source;f=f.subscribe;var m=Jo;return t.memoizedState={refs:d,source:e,subscribe:r},u.useEffect((function(){d.getSnapshot=n,d.setSnapshot=l;var t=o(e._source);if(!sr(s,t)){t=n(e._source),sr(h,t)||(l(t),t=lu(m),i.mutableReadLanes|=t&i.pendingLanes),t=i.mutableReadLanes,i.entangledLanes|=t;for(var r=i.entanglements,a=t;0<a;){var u=31-qe(a),c=1<<u;r[u]|=t,a&=~c}}}),[n,e,r]),u.useEffect((function(){return r(e._source,(function(){var t=d.getSnapshot,n=d.setSnapshot;try{n(t(e._source));var r=lu(m);i.mutableReadLanes|=r&i.pendingLanes}catch(o){n((function(){throw o}))}}))}),[e,r]),sr(p,n)&&sr(v,e)&&sr(f,r)||((t={pending:null,dispatch:null,lastRenderedReducer:sa,lastRenderedState:h}).dispatch=l=Ca.bind(null,Jo,t),c.queue=t,c.baseQueue=null,h=la(i,e,n),c.memoizedState=c.baseState=h),h}function fa(t,e,n){return ha(aa(),t,e,n)}function da(t){var e=oa();return"function"===typeof t&&(t=t()),e.memoizedState=e.baseState=t,t=(t=e.queue={pending:null,dispatch:null,lastRenderedReducer:sa,lastRenderedState:t}).dispatch=Ca.bind(null,Jo,t),[e.memoizedState,t]}function pa(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},null===(e=Jo.updateQueue)?(e={lastEffect:null},Jo.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function va(t){return t={current:t},oa().memoizedState=t}function ma(){return aa().memoizedState}function ga(t,e,n,r){var i=oa();Jo.flags|=t,i.memoizedState=pa(1|e,n,void 0,void 0===r?null:r)}function ya(t,e,n,r){var i=aa();r=void 0===r?null:r;var o=void 0;if(null!==Zo){var a=Zo.memoizedState;if(o=a.destroy,null!==r&&ra(r,a.deps))return void pa(e,n,o,r)}Jo.flags|=t,i.memoizedState=pa(1|e,n,o,r)}function ba(t,e){return ga(516,4,t,e)}function _a(t,e){return ya(516,4,t,e)}function wa(t,e){return ya(4,2,t,e)}function xa(t,e){return"function"===typeof e?(t=t(),e(t),function(){e(null)}):null!==e&&void 0!==e?(t=t(),e.current=t,function(){e.current=null}):void 0}function Ta(t,e,n){return n=null!==n&&void 0!==n?n.concat([t]):null,ya(4,2,xa.bind(null,e,t),n)}function Ea(){}function Sa(t,e){var n=aa();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&ra(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Oa(t,e){var n=aa();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&ra(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function ka(t,e){var n=Vi();Hi(98>n?98:n,(function(){t(!0)})),Hi(97<n?97:n,(function(){var n=Ko.transition;Ko.transition=1;try{t(!1),e()}finally{Ko.transition=n}}))}function Ca(t,e,n){var r=cu(),i=lu(t),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=e.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),e.pending=o,a=t.alternate,t===Jo||null!==a&&a===Jo)ea=ta=!0;else{if(0===t.lanes&&(null===a||0===a.lanes)&&null!==(a=e.lastRenderedReducer))try{var s=e.lastRenderedState,u=a(s,n);if(o.eagerReducer=a,o.eagerState=u,sr(u,s))return}catch(c){}hu(t,i,r)}}var Ma={readContext:ro,useCallback:na,useContext:na,useEffect:na,useImperativeHandle:na,useLayoutEffect:na,useMemo:na,useReducer:na,useRef:na,useState:na,useDebugValue:na,useDeferredValue:na,useTransition:na,useMutableSource:na,useOpaqueIdentifier:na,unstable_isNewReconciler:!1},Aa={readContext:ro,useCallback:function(t,e){return oa().memoizedState=[t,void 0===e?null:e],t},useContext:ro,useEffect:ba,useImperativeHandle:function(t,e,n){return n=null!==n&&void 0!==n?n.concat([t]):null,ga(4,2,xa.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ga(4,2,t,e)},useMemo:function(t,e){var n=oa();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=oa();return e=void 0!==n?n(e):e,r.memoizedState=r.baseState=e,t=(t=r.queue={pending:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:e}).dispatch=Ca.bind(null,Jo,t),[r.memoizedState,t]},useRef:va,useState:da,useDebugValue:Ea,useDeferredValue:function(t){var e=da(t),n=e[0],r=e[1];return ba((function(){var e=Ko.transition;Ko.transition=1;try{r(t)}finally{Ko.transition=e}}),[t]),n},useTransition:function(){var t=da(!1),e=t[0];return va(t=ka.bind(null,t[1])),[t,e]},useMutableSource:function(t,e,n){var r=oa();return r.memoizedState={refs:{getSnapshot:e,setSnapshot:null},source:t,subscribe:n},ha(r,t,e,n)},useOpaqueIdentifier:function(){if(Uo){var t=!1,e=function(t){return{$$typeof:N,toString:t,valueOf:t}}((function(){throw t||(t=!0,n("r:"+(Yr++).toString(36))),Error(a(355))})),n=da(e)[1];return 0===(2&Jo.mode)&&(Jo.flags|=516,pa(5,(function(){n("r:"+(Yr++).toString(36))}),void 0,null)),e}return da(e="r:"+(Yr++).toString(36)),e},unstable_isNewReconciler:!1},Ia={readContext:ro,useCallback:Sa,useContext:ro,useEffect:_a,useImperativeHandle:Ta,useLayoutEffect:wa,useMemo:Oa,useReducer:ua,useRef:ma,useState:function(){return ua(sa)},useDebugValue:Ea,useDeferredValue:function(t){var e=ua(sa),n=e[0],r=e[1];return _a((function(){var e=Ko.transition;Ko.transition=1;try{r(t)}finally{Ko.transition=e}}),[t]),n},useTransition:function(){var t=ua(sa)[0];return[ma().current,t]},useMutableSource:fa,useOpaqueIdentifier:function(){return ua(sa)[0]},unstable_isNewReconciler:!1},ja={readContext:ro,useCallback:Sa,useContext:ro,useEffect:_a,useImperativeHandle:Ta,useLayoutEffect:wa,useMemo:Oa,useReducer:ca,useRef
2:ma,useState:function(){return ca(sa)},useDebugValue:Ea,useDeferredValue:function(t){var e=ca(sa),n=e[0],r=e[1];return _a((function(){var e=Ko.transition;Ko.transition=1;try{r(t)}finally{Ko.transition=e}}),[t]),n},useTransition:function(){var t=ca(sa)[0];return[ma().current,t]},useMutableSource:fa,useOpaqueIdentifier:function(){return ca(sa)[0]},unstable_isNewReconciler:!1},Pa=w.ReactCurrentOwner,Ra=!1;function Na(t,e,n,r){e.child=null===t?So(e,null,n,r):Eo(e,t.child,n,r)}function La(t,e,n,r,i){n=n.render;var o=e.ref;return no(e,i),r=ia(t,e,n,r,o,i),null===t||Ra?(e.flags|=1,Na(t,e,r,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,ns(t,e,i))}function Da(t,e,n,r,i,o){if(null===t){var a=n.type;return"function"!==typeof a||zu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=qu(n.type,null,r,e,e.mode,o)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=a,Fa(t,e,a,r,i,o))}return a=t.child,0===(i&o)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:cr)(i,r)&&t.ref===e.ref)?ns(t,e,o):(e.flags|=1,(t=Hu(a,r)).ref=e.ref,t.return=e,e.child=t)}function Fa(t,e,n,r,i,o){if(null!==t&&cr(t.memoizedProps,r)&&t.ref===e.ref){if(Ra=!1,0===(o&i))return e.lanes=t.lanes,ns(t,e,o);0!==(16384&t.flags)&&(Ra=!0)}return Va(t,e,n,r,o)}function Ua(t,e,n){var r=e.pendingProps,i=r.children,o=null!==t?t.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0===(4&e.mode))e.memoizedState={baseLanes:0},bu(e,n);else{if(0===(1073741824&n))return t=null!==o?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t},bu(e,t),null;e.memoizedState={baseLanes:0},bu(e,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,e.memoizedState=null):r=n,bu(e,r);return Na(t,e,i,n),e.child}function Ba(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=128)}function Va(t,e,n,r,i){var o=pi(n)?fi:li.current;return o=di(e,o),no(e,i),n=ia(t,e,n,r,o,i),null===t||Ra?(e.flags|=1,Na(t,e,n,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,ns(t,e,i))}function za(t,e,n,r,i){if(pi(n)){var o=!0;yi(e)}else o=!1;if(no(e,i),null===e.stateNode)null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),go(e,n,r),bo(e,n,r,i),r=!0;else if(null===t){var a=e.stateNode,s=e.memoizedProps;a.props=s;var u=a.context,c=n.contextType;"object"===typeof c&&null!==c?c=ro(c):c=di(e,c=pi(n)?fi:li.current);var l=n.getDerivedStateFromProps,h="function"===typeof l||"function"===typeof a.getSnapshotBeforeUpdate;h||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==c)&&yo(e,a,r,c),io=!1;var f=e.memoizedState;a.state=f,lo(e,r,a,i),u=e.memoizedState,s!==r||f!==u||hi.current||io?("function"===typeof l&&(po(e,n,l,r),u=e.memoizedState),(s=io||mo(e,n,s,r,f,u,c))?(h||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(e.flags|=4)):("function"===typeof a.componentDidMount&&(e.flags|=4),e.memoizedProps=r,e.memoizedState=u),a.props=r,a.state=u,a.context=c,r=s):("function"===typeof a.componentDidMount&&(e.flags|=4),r=!1)}else{a=e.stateNode,ao(t,e),s=e.memoizedProps,c=e.type===e.elementType?s:Xi(e.type,s),a.props=c,h=e.pendingProps,f=a.context,"object"===typeof(u=n.contextType)&&null!==u?u=ro(u):u=di(e,u=pi(n)?fi:li.current);var d=n.getDerivedStateFromProps;(l="function"===typeof d||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==h||f!==u)&&yo(e,a,r,u),io=!1,f=e.memoizedState,a.state=f,lo(e,r,a,i);var p=e.memoizedState;s!==h||f!==p||hi.current||io?("function"===typeof d&&(po(e,n,d,r),p=e.memoizedState),(c=io||mo(e,n,c,r,f,p,u))?(l||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,u),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,u)),"function"===typeof a.componentDidUpdate&&(e.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(e.flags|=256)):("function"!==typeof a.componentDidUpdate||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=256),e.memoizedProps=r,e.memoizedState=p),a.props=r,a.state=p,a.context=u,r=c):("function"!==typeof a.componentDidUpdate||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=256),r=!1)}return Ha(t,e,n,r,o,i)}function Ha(t,e,n,r,i,o){Ba(t,e);var a=0!==(64&e.flags);if(!r&&!a)return i&&bi(e,n,!1),ns(t,e,o);r=e.stateNode,Pa.current=e;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return e.flags|=1,null!==t&&a?(e.child=Eo(e,t.child,null,o),e.child=Eo(e,null,s,o)):Na(t,e,s,o),e.memoizedState=r.state,i&&bi(e,n,!0),e.child}function qa(t){var e=t.stateNode;e.pendingContext?mi(0,e.pendingContext,e.pendingContext!==e.context):e.context&&mi(0,e.context,!1),Io(t,e.containerInfo)}var Wa,Ga,Ya,Xa={dehydrated:null,retryLane:0};function Ka(t,e,n){var r,i=e.pendingProps,o=No.current,a=!1;return(r=0!==(64&e.flags))||(r=(null===t||null!==t.memoizedState)&&0!==(2&o)),r?
vendor: 4,711 bytes, line 2
2(a=!0,e.flags&=-65):null!==t&&null===t.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),ui(No,1&o),null===t?(void 0!==i.fallback&&zo(e),t=i.children,o=i.fallback,a?(t=Qa(e,t,o,n),e.child.memoizedState={baseLanes:n},e.memoizedState=Xa,t):"number"===typeof i.unstable_expectedLoadTime?(t=Qa(e,t,o,n),e.child.memoizedState={baseLanes:n},e.memoizedState=Xa,e.lanes=33554432,t):((n=Gu({mode:"visible",children:t},e.mode,n,null)).return=e,e.child=n)):(t.memoizedState,a?(i=Za(t,e,i.children,i.fallback,n),a=e.child,o=t.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=t.childLanes&~n,e.memoizedState=Xa,i):(n=Ja(t,e,i.children,n),e.memoizedState=null,n))}function Qa(t,e,n,r){var i=t.mode,o=t.child;return e={mode:"hidden",children:e},0===(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=e):o=Gu(e,i,0,null),n=Wu(n,i,r,null),o.return=t,n.return=t,o.sibling=n,t.child=o,n}function Ja(t,e,n,r){var i=t.child;return t=i.sibling,n=Hu(i,{mode:"visible",children:n}),0===(2&e.mode)&&(n.lanes=r),n.return=e,n.sibling=null,null!==t&&(t.nextEffect=null,t.flags=8,e.firstEffect=e.lastEffect=t),e.child=n}function Za(t,e,n,r,i){var o=e.mode,a=t.child;t=a.sibling;var s={mode:"hidden",children:n};return 0===(2&o)&&e.child!==a?((n=e.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(e.firstEffect=n.firstEffect,e.lastEffect=a,a.nextEffect=null):e.firstEffect=e.lastEffect=null):n=Hu(a,s),null!==t?r=Hu(t,r):(r=Wu(r,o,i,null)).flags|=2,r.return=e,n.return=e,n.sibling=r,e.child=n,r}function $a(t,e){t.lanes|=e;var n=t.alternate;null!==n&&(n.lanes|=e),eo(t.return,e)}function ts(t,e,n,r,i,o){var a=t.memoizedState;null===a?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function es(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(Na(t,e,r.children,n),0!==(2&(r=No.current)))r=1&r|2,e.flags|=64;else{if(null!==t&&0!==(64&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&$a(t,n);else if(19===t.tag)$a(t,n);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(ui(No,r),0===(2&e.mode))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;null!==n;)null!==(t=n.alternate)&&null===Lo(t)&&(i=n),n=n.sibling;null===(n=i)?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),ts(e,!1,i,n,o,e.lastEffect);break;case"backwards":for(n=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===Lo(t)){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}ts(e,!0,n,null,o,e.lastEffect);break;case"together":ts(e,!1,null,null,void 0,e.lastEffect);break;default:e.memoizedState=null}return e.child}function ns(t,e,n){if(null!==t&&(e.dependencies=t.dependencies),Fs|=e.lanes,0!==(n&e.childLanes)){if(null!==t&&e.child!==t.child)throw Error(a(153));if(null!==e.child){for(n=Hu(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=Hu(t,t.pendingProps)).return=e;n.sibling=null}return e.child}return null}function rs(t,e){if(!Uo)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e||null===t.tail?t.tail=null:t.tail.sibling=null:r.sibling=null}}function is(t,e,n){var r=e.pendingProps;switch(e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return pi(e.type)&&vi(),null;case 3:return jo(),si(hi),si(li),Yo(),(r=e.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==t&&null!==t.child||(qo(e)?e.flags|=4:r.hydrate||(e.flags|=256)),null;case 5:Ro(e);var o=Ao(Mo.current);if(n=e.type,null!==t&&null!=e.stateNode)Ga(t,e,n,r),t.ref!==e.ref&&(e.flags|=128);else{if(!r){if(null===e.stateNode)throw Error(a(166));return null}if(t=Ao(ko.current),qo(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Kr]=e,r[Qr]=s,n){case"dialog":kr("cancel",r),kr("close",r);break;case"iframe":case"object":case"embed":kr("load",r);break;case"video":case"audio":for(t=0;t<Tr.length;t++)kr(Tr[t],r);break;case"source":kr("error",r);break;case"img":case"image":case"link":kr("error",r),kr("load",r);break;case"details":kr("toggle",r);break;case"input":tt(r,s),kr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},kr("invalid",r);break;case"textarea":ut(r,s),kr("invalid",r)}
2for(var c in Et(n,s),t=null,s)s.hasOwnProperty(c)&&(o=s[c],"children"===c?"string"===typeof o?r.textContent!==o&&(t=["children",o]):"number"===typeof o&&r.textContent!==""+o&&(t=["children",""+o]):u.hasOwnProperty(c)&&null!=o&&"onScroll"===c&&kr("scroll",r));switch(n){case"input":Q(r),rt(r,s,!0);break;case"textarea":Q(r),lt(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=Dr)}r=t,e.updateQueue=r,null!==r&&(e.flags|=4)}else{switch(c=9===o.nodeType?o:o.ownerDocument,t===ht&&(t=dt(n)),t===ht?"script"===n?((t=c.createElement("div")).innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):"string"===typeof r.is?t=c.createElement(n,{is:r.is}):(t=c.createElement(n),"select"===n&&(c=t,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):t=c.createElementNS(t,n),t[Kr]=e,t[Qr]=r,Wa(t,e),e.stateNode=t,c=St(n,r),n){case"dialog":kr("cancel",t),kr("close",t),o=r;break;case"iframe":case"object":case"embed":kr("load",t),o=r;break;case"video":case"audio":for(o=0;o<Tr.length;o++)kr(Tr[o],t);o=r;break;case"source":kr("error",t),o=r;break;case"img":case"image":case"link":kr("error",t),kr("load",t),o=r;break;case"details":kr("toggle",t),o=r;break;case"input":tt(t,r),o=$(t,r),kr("invalid",t);break;case"option":o=ot(t,r);break;case"select":t._wrapperState={wasMultiple:!!r.multiple},o=i({},r,{value:void 0}),kr("invalid",t);break;case"textarea":ut(t,r),o=st(t,r),kr("invalid",t);break;default:o=r}Et(n,o);var l=o;for(s in l)if(l.hasOwnProperty(s)){var h=l[s];"style"===s?xt(t,h):"dangerouslySetInnerHTML"===s?null!=(h=h?h.__html:void 0)&>(t,h):"children"===s?"string"===typeof h?("textarea"!==n||""!==h)&&yt(t,h):"number"===typeof h&&yt(t,""+h):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(u.hasOwnProperty(s)?null!=h&&"onScroll"===s&&kr("scroll",t):null!=h&&_(t,s,h,c))}switch(n){case"input":Q(t),rt(t,r,!1);break;case"textarea":Q(t),lt(t);break;case"option":null!=r.value&&t.setAttribute("value",""+X(r.value));break;case"select":t.multiple=!!r.multiple,null!=(s=r.value)?at(t,!!r.multiple,s,!1):null!=r.defaultValue&&at(t,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof o.onClick&&(t.onclick=Dr)}Br(n,r)&&(e.flags|=4)}null!==e.ref&&(e.flags|=128)}return null;case 6:if(t&&null!=e.stateNode)Ya(0,e,t.memoizedProps,r);else{if("string"!==typeof r&&null===e.stateNode)throw Error(a(166));n=Ao(Mo.current),Ao(ko.current),qo(e)?(r=e.stateNode,n=e.memoizedProps,r[Kr]=e,r.nodeValue!==n&&(e.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Kr]=e,e.stateNode=r)}return null;case 13:return si(No),r=e.memoizedState,0!==(64&e.flags)?(e.lanes=n,e):(r=null!==r,n=!1,null===t?void 0!==e.memoizedProps.fallback&&qo(e):n=null!==t.memoizedState,r&&!n&&0!==(2&e.mode)&&(null===t&&!0!==e.memoizedProps.unstable_avoidThisFallback||0!==(1&No.current)?0===Ns&&(Ns=3):(0!==Ns&&3!==Ns||(Ns=4),null===As||0===(134217727&Fs)&&0===(134217727&Us)||vu(As,js))),(r||n)&&(e.flags|=4),null);case 4:return jo(),null===t&&Mr(e.stateNode.containerInfo),null;case 10:return to(e),null;case 17:return pi(e.type)&&vi(),null;case 19:if(si(No),null===(r=e.memoizedState))return null;if(s=0!==(64&e.flags),null===(c=r.rendering))if(s)rs(r,!1);else{if(0!==Ns||null!==t&&0!==(64&t.flags))for(t=e.child;null!==t;){if(null!==(c=Lo(t))){for(e.flags|=64,rs(r,!1),null!==(s=c.updateQueue)&&(e.updateQueue=s,e.flags|=4),null===r.lastEffect&&(e.firstEffect=null),e.lastEffect=r.lastEffect,r=n,n=e.child;null!==n;)t=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(c=s.alternate)?(s.childLanes=0,s.lanes=t,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,t=c.dependencies,s.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return ui(No,1&No.current|2),e.child}t=t.sibling}null!==r.tail&&Bi()>Hs&&(e.flags|=64,s=!0,rs(r,!1),e.lanes=33554432)}else{if(!s)if(null!==(t=Lo(c))){if(e.flags|=64,s=!0,null!==(n=t.updateQueue)&&(e.updateQueue=n,e.flags|=4),rs(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!Uo)return null!==(e=e.lastEffect=r.lastEffect)&&(e.nextEffect=null),null}else 2*Bi()-r.renderingStartTime>
vendor: 4,164 bytes, line 2
2Hs&&1073741824!==n&&(e.flags|=64,s=!0,rs(r,!1),e.lanes=33554432);r.isBackwards?(c.sibling=e.child,e.child=c):(null!==(n=r.last)?n.sibling=c:e.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=e.lastEffect,r.renderingStartTime=Bi(),n.sibling=null,e=No.current,ui(No,s?1&e|2:1&e),n):null;case 23:case 24:return _u(),null!==t&&null!==t.memoizedState!==(null!==e.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(e.flags|=4),null}throw Error(a(156,e.tag))}function os(t){switch(t.tag){case 1:pi(t.type)&&vi();var e=t.flags;return 4096&e?(t.flags=-4097&e|64,t):null;case 3:if(jo(),si(hi),si(li),Yo(),0!==(64&(e=t.flags)))throw Error(a(285));return t.flags=-4097&e|64,t;case 5:return Ro(t),null;case 13:return si(No),4096&(e=t.flags)?(t.flags=-4097&e|64,t):null;case 19:return si(No),null;case 4:return jo(),null;case 10:return to(t),null;case 23:case 24:return _u(),null;default:return null}}function as(t,e){try{var n="",r=e;do{n+=G(r),r=r.return}while(r);var i=n}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:t,source:e,stack:i}}function ss(t,e){try{console.error(e.value)}catch(n){setTimeout((function(){throw n}))}}Wa=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)t.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ga=function(t,e,n,r){var o=t.memoizedProps;if(o!==r){t=e.stateNode,Ao(ko.current);var a,s=null;switch(n){case"input":o=$(t,o),r=$(t,r),s=[];break;case"option":o=ot(t,o),r=ot(t,r),s=[];break;case"select":o=i({},o,{value:void 0}),r=i({},r,{value:void 0}),s=[];break;case"textarea":o=st(t,o),r=st(t,r),s=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(t.onclick=Dr)}for(h in Et(n,r),n=null,o)if(!r.hasOwnProperty(h)&&o.hasOwnProperty(h)&&null!=o[h])if("style"===h){var c=o[h];for(a in c)c.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==h&&"children"!==h&&"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(u.hasOwnProperty(h)?s||(s=[]):(s=s||[]).push(h,null));for(h in r){var l=r[h];if(c=null!=o?o[h]:void 0,r.hasOwnProperty(h)&&l!==c&&(null!=l||null!=c))if("style"===h)if(c){for(a in c)!c.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&c[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(h,n)),n=l;else"dangerouslySetInnerHTML"===h?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(s=s||[]).push(h,l)):"children"===h?"string"!==typeof l&&"number"!==typeof l||(s=s||[]).push(h,""+l):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&(u.hasOwnProperty(h)?(null!=l&&"onScroll"===h&&kr("scroll",t),s||c===l||(s=[])):"object"===typeof l&&null!==l&&l.$$typeof===N?l.toString():(s=s||[]).push(h,l))}n&&(s=s||[]).push("style",n);var h=s;(e.updateQueue=h)&&(e.flags|=4)}},Ya=function(t,e,n,r){n!==r&&(e.flags|=4)};var us="function"===typeof WeakMap?WeakMap:Map;function cs(t,e,n){(n=so(-1,n)).tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Ys||(Ys=!0,Xs=r),ss(0,e)},n}function ls(t,e,n){(n=so(-1,n)).tag=3;var r=t.type.getDerivedStateFromError;if("function"===typeof r){var i=e.value;n.payload=function(){return ss(0,e),r(i)}}var o=t.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Ks?Ks=new Set([this]):Ks.add(this),ss(0,e));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),n}var hs="function"===typeof WeakSet?WeakSet:Set;function fs(t){var e=t.ref;if(null!==e)if("function"===typeof e)try{e(null)}catch(n){Du(t,n)}else e.current=null}function ds(t,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&e.flags&&null!==t){var n=t.memoizedProps,r=t.memoizedState;e=(t=e.stateNode).getSnapshotBeforeUpdate(e.elementType===e.type?n:Xi(e.type,n),r),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:return void(256&e.flags&&qr(e.stateNode.containerInfo));
vendor: 4,942 bytes, line 2
2case 5:case 6:case 4:case 17:return}throw Error(a(163))}function ps(t,e,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(e=null!==(e=n.updateQueue)?e.lastEffect:null)){t=e=e.next;do{if(3===(3&t.tag)){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}if(null!==(e=null!==(e=n.updateQueue)?e.lastEffect:null)){t=e=e.next;do{var i=t;r=i.next,0!==(4&(i=i.tag))&&0!==(1&i)&&(Ru(n,t),Pu(n,t)),t=r}while(t!==e)}return;case 1:return t=n.stateNode,4&n.flags&&(null===e?t.componentDidMount():(r=n.elementType===n.type?e.memoizedProps:Xi(n.type,e.memoizedProps),t.componentDidUpdate(r,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),void(null!==(e=n.updateQueue)&&ho(n,e,t));case 3:if(null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}ho(n,e,t)}return;case 5:return t=n.stateNode,void(null===e&&4&n.flags&&Br(n.type,n.memoizedProps)&&t.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&xe(n)))));case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(a(163))}function vs(t,e){for(var n=t;;){if(5===n.tag){var r=n.stateNode;if(e)"function"===typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=void 0!==i&&null!==i&&i.hasOwnProperty("display")?i.display:null,r.style.display=wt("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=e?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===t)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function ms(t,e){if(wi&&"function"===typeof wi.onCommitFiberUnmount)try{wi.onCommitFiberUnmount(_i,e)}catch(o){}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(t=e.updateQueue)&&null!==(t=t.lastEffect)){var n=t=t.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!==(4&r))Ru(e,n);else{r=e;try{i()}catch(o){Du(r,o)}}n=n.next}while(n!==t)}break;case 1:if(fs(e),"function"===typeof(t=e.stateNode).componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(o){Du(e,o)}break;case 5:fs(e);break;case 4:xs(t,e)}}function gs(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function ys(t){return 5===t.tag||3===t.tag||4===t.tag}function bs(t){t:{for(var e=t.return;null!==e;){if(ys(e))break t;e=e.return}throw Error(a(160))}var n=e;switch(e=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:e=e.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.flags&&(yt(e,""),n.flags&=-17);t:e:for(n=t;;){for(;null===n.sibling;){if(null===n.return||ys(n.return)){n=null;break t}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue e;if(null===n.child||4===n.tag)continue e;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break t}}r?_s(t,n,e):ws(t,n,e)}function _s(t,e,n){var r=t.tag,i=5===r||6===r;if(i)t=i?t.stateNode:t.stateNode.instance,e?8===n.nodeType?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(8===n.nodeType?(e=n.parentNode).insertBefore(t,n):(e=n).appendChild(t),null!==(n=n._reactRootContainer)&&void 0!==n||null!==e.onclick||(e.onclick=Dr));else if(4!==r&&null!==(t=t.child))for(_s(t,e,n),t=t.sibling;null!==t;)_s(t,e,n),t=t.sibling}function ws(t,e,n){var r=t.tag,i=5===r||6===r;if(i)t=i?t.stateNode:t.stateNode.instance,e?n.insertBefore(t,e):n.appendChild(t);else if(4!==r&&null!==(t=t.child))for(ws(t,e,n),t=t.sibling;null!==t;)ws(t,e,n),t=t.sibling}function xs(t,e){for(var n,r,i=e,o=!1;;){if(!o){o=i.return;t:for(;;){if(null===o)throw Error(a(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break t;case 3:case 4:n=n.containerInfo,r=!0;break t}o=o.return}o=!0}if(5===i.tag||6===i.tag){t:for(var s=t,u=i,c=u;;)if(ms(s,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===u)break t;for(;null===c.sibling;){if(null===c.return||c.return===u)break t;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(s=n,u=i.stateNode,8===s.nodeType?s.parentNode.removeChild(u):s.removeChild(u)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(ms(t,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;4===(i=i.return).tag&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function Ts(t,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:var n=e.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3===(3&r.tag)&&(t=r.destroy,r.destroy=void 0,void 0!==t&&t()),r=r.next}
vendor: 6,573 bytes, line 2
2while(r!==n)}return;case 1:return;case 5:if(null!=(n=e.stateNode)){r=e.memoizedProps;var i=null!==t?t.memoizedProps:r;t=e.type;var o=e.updateQueue;if(e.updateQueue=null,null!==o){for(n[Qr]=r,"input"===t&&"radio"===r.type&&null!=r.name&&et(n,r),St(t,i),e=St(t,r),i=0;i<o.length;i+=2){var s=o[i],u=o[i+1];"style"===s?xt(n,u):"dangerouslySetInnerHTML"===s?gt(n,u):"children"===s?yt(n,u):_(n,s,u,e)}switch(t){case"input":nt(n,r);break;case"textarea":ct(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(o=r.value)?at(n,!!r.multiple,o,!1):t!==!!r.multiple&&(null!=r.defaultValue?at(n,!!r.multiple,r.defaultValue,!0):at(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===e.stateNode)throw Error(a(162));return void(e.stateNode.nodeValue=e.memoizedProps);case 3:return void((n=e.stateNode).hydrate&&(n.hydrate=!1,xe(n.containerInfo)));case 12:return;case 13:return null!==e.memoizedState&&(zs=Bi(),vs(e.child,!0)),void Es(e);case 19:return void Es(e);case 17:return;case 23:case 24:return void vs(e,null!==e.memoizedState)}throw Error(a(163))}function Es(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new hs),e.forEach((function(e){var r=Uu.bind(null,t,e);n.has(e)||(n.add(e),e.then(r,r))}))}}function Ss(t,e){return null!==t&&(null===(t=t.memoizedState)||null!==t.dehydrated)&&(null!==(e=e.memoizedState)&&null===e.dehydrated)}var Os=Math.ceil,ks=w.ReactCurrentDispatcher,Cs=w.ReactCurrentOwner,Ms=0,As=null,Is=null,js=0,Ps=0,Rs=ai(0),Ns=0,Ls=null,Ds=0,Fs=0,Us=0,Bs=0,Vs=null,zs=0,Hs=1/0;function qs(){Hs=Bi()+500}var Ws,Gs=null,Ys=!1,Xs=null,Ks=null,Qs=!1,Js=null,Zs=90,$s=[],tu=[],eu=null,nu=0,ru=null,iu=-1,ou=0,au=0,su=null,uu=!1;function cu(){return 0!==(48&Ms)?Bi():-1!==iu?iu:iu=Bi()}function lu(t){if(0===(2&(t=t.mode)))return 1;if(0===(4&t))return 99===Vi()?1:2;if(0===ou&&(ou=Ds),0!==Yi.transition){0!==au&&(au=null!==Vs?Vs.pendingLanes:0),t=ou;var e=4186112&~au;return 0===(e&=-e)&&(0===(e=(t=4186112&~t)&-t)&&(e=8192)),e}return t=Vi(),0!==(4&Ms)&&98===t?t=Be(12,ou):t=Be(t=function(t){switch(t){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(t),ou),t}function hu(t,e,n){if(50<nu)throw nu=0,ru=null,Error(a(185));if(null===(t=fu(t,e)))return null;He(t,e,n),t===As&&(Us|=e,4===Ns&&vu(t,js));var r=Vi();1===e?0!==(8&Ms)&&0===(48&Ms)?mu(t):(du(t,n),0===Ms&&(qs(),Wi())):(0===(4&Ms)||98!==r&&99!==r||(null===eu?eu=new Set([t]):eu.add(t)),du(t,n)),Vs=t}function fu(t,e){t.lanes|=e;var n=t.alternate;for(null!==n&&(n.lanes|=e),n=t,t=t.return;null!==t;)t.childLanes|=e,null!==(n=t.alternate)&&(n.childLanes|=e),n=t,t=t.return;return 3===n.tag?n.stateNode:null}function du(t,e){for(var n=t.callbackNode,r=t.suspendedLanes,i=t.pingedLanes,o=t.expirationTimes,s=t.pendingLanes;0<s;){var u=31-qe(s),c=1<<u,l=o[u];if(-1===l){if(0===(c&r)||0!==(c&i)){l=e,De(c);var h=Le;o[u]=10<=h?l+250:6<=h?l+5e3:-1}}else l<=e&&(t.expiredLanes|=c);s&=~c}if(r=Fe(t,t===As?js:0),e=Le,0===r)null!==n&&(n!==Ri&&Ei(n),t.callbackNode=null,t.callbackPriority=0);else{if(null!==n){if(t.callbackPriority===e)return;n!==Ri&&Ei(n)}15===e?(n=mu.bind(null,t),null===Li?(Li=[n],Di=Ti(Mi,Gi)):Li.push(n),n=Ri):14===e?n=qi(99,mu.bind(null,t)):n=qi(n=function(t){switch(t){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,t))}}(e),pu.bind(null,t)),t.callbackPriority=e,t.callbackNode=n}}function pu(t){if(iu=-1,au=ou=0,0!==(48&Ms))throw Error(a(327));var e=t.callbackNode;if(ju()&&t.callbackNode!==e)return null;var n=Fe(t,t===As?js:0);if(0===n)return null;var r=n,i=Ms;Ms|=16;var o=Tu();for(As===t&&js===r||(qs(),wu(t,r));;)try{Ou();break}catch(u){xu(t,u)}if($i(),ks.current=o,Ms=i,null!==Is?r=0:(As=null,js=0,r=Ns),0!==(Ds&Us))wu(t,0);else if(0!==r){if(2===r&&(Ms|=64,t.hydrate&&(t.hydrate=!1,qr(t.containerInfo)),0!==(n=Ue(t))&&(r=Eu(t,n))),1===r)throw e=Ls,wu(t,0),vu(t,n),du(t,Bi()),e;switch(t.finishedWork=t.current.alternate,t.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:Mu(t);break;case 3:if(vu(t,n),(62914560&n)===n&&10<(r=zs+500-Bi())){if(0!==Fe(t,0))break;if(((i=t.suspendedLanes)&n)!==n){cu(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=zr(Mu.bind(null,t),r);break}Mu(t);break;case 4:if(vu(t,n),(4186112&n)===n)break;for(r=t.eventTimes,i=-1;0<n;){var s=31-qe(n);o=1<<s,(s=r[s])>i&&(i=s),n&=~o}if(n=i,10<(n=(120>(n=Bi()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Os(n/1960))-n)){t.timeoutHandle=zr(Mu.bind(null,t),n);break}Mu(t);break;case 5:Mu(t);break;default:throw Error(a(329))}}return du(t,Bi()),t.callbackNode===e?pu.bind(null,t):null}function vu(t,e){for(e&=~Bs,e&=~Us,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-qe(e),r=1<<n;t[n]=-1,e&=~r}}function mu(t){if(0!==(48&Ms))throw Error(a(327));if(ju(),t===As&&0!==(t.expiredLanes&js)){var e=js,n=Eu(t,e);0!==(Ds&Us)&&(n=Eu(t,e=Fe(t,e)))}else n=Eu(t,e=Fe(t,0));if(0!==t.tag&&2===n&&(Ms|=64,t.hydrate&&(t.hydrate=!1,qr(t.containerInfo)),0!==(e=Ue(t))&&(n=Eu(t,e))),1===n)throw n=Ls,wu(t,0),vu(t,e),du(t,Bi()),n;return t.finishedWork=t.current.alternate,t.finishedLanes=e,Mu(t),du(t,Bi()),null}function gu(t,e){var n=Ms;Ms|=1;try{return t(e)}finally{0===(Ms=n)&&(qs(),Wi())}}function yu(t,e){var n=Ms;Ms&=-2,Ms|=8;try{return t(e)}finally{0===(Ms=n)&&(qs(),Wi())}}function bu(t,e){ui(Rs,Ps),Ps|=e,Ds|=e}function _u(){Ps=Rs.current,si(Rs)}function wu(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(-1!==n&&(t.timeoutHandle=-1,Hr(n)),null!==Is)for(n=Is.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&vi();break;case 3:jo(),si(hi),si(li),Yo();break;case 5:Ro(r);break;case 4:jo();break;case 13:case 19:si(No);break;case 10:to(r);break;case 23:case 24:_u()}n=n.return}As=t,Is=Hu(t.current,null),js=Ps=Ds=e,Ns=0,Ls=null,Bs=Us=Fs=0}function xu(t,e){for(;;){var n=Is;try{if($i(),Xo.current=Ma,ta){for(var r=Jo.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}ta=!1}if(Qo=0,$o=Zo=Jo=null,ea=!1,Cs.current=null,null===n||null===n.return){Ns=1,Ls=e,Is=null;break}t:{var o=t,a=n.return,s=n,u=e;if(e=js,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==u&&"object"===typeof u&&"function"===typeof u.then){var c=u;if(0===(2&s.mode)){var l=s.alternate;l?(s.updateQueue=l.updateQueue,s.memoizedState=l.memoizedState,s.lanes=l.lanes):(s.updateQueue=null,s.memoizedState=null)}
vendor: 5,683 bytes, line 2
2var h=0!==(1&No.current),f=a;do{var d;if(d=13===f.tag){var p=f.memoizedState;if(null!==p)d=null!==p.dehydrated;else{var v=f.memoizedProps;d=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!h)}}if(d){var m=f.updateQueue;if(null===m){var g=new Set;g.add(c),f.updateQueue=g}else m.add(c);if(0===(2&f.mode)){if(f.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var y=so(-1,1);y.tag=2,uo(s,y)}s.lanes|=1;break t}u=void 0,s=e;var b=o.pingCache;if(null===b?(b=o.pingCache=new us,u=new Set,b.set(c,u)):void 0===(u=b.get(c))&&(u=new Set,b.set(c,u)),!u.has(s)){u.add(s);var _=Fu.bind(null,o,c,s);c.then(_,_)}f.flags|=4096,f.lanes=e;break t}f=f.return}while(null!==f);u=Error((Y(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Ns&&(Ns=2),u=as(u,s),f=a;do{switch(f.tag){case 3:o=u,f.flags|=4096,e&=-e,f.lanes|=e,co(f,cs(0,o,e));break t;case 1:o=u;var w=f.type,x=f.stateNode;if(0===(64&f.flags)&&("function"===typeof w.getDerivedStateFromError||null!==x&&"function"===typeof x.componentDidCatch&&(null===Ks||!Ks.has(x)))){f.flags|=4096,e&=-e,f.lanes|=e,co(f,ls(f,o,e));break t}}f=f.return}while(null!==f)}Cu(n)}catch(T){e=T,Is===n&&null!==n&&(Is=n=n.return);continue}break}}function Tu(){var t=ks.current;return ks.current=Ma,null===t?Ma:t}function Eu(t,e){var n=Ms;Ms|=16;var r=Tu();for(As===t&&js===e||wu(t,e);;)try{Su();break}catch(i){xu(t,i)}if($i(),Ms=n,ks.current=r,null!==Is)throw Error(a(261));return As=null,js=0,Ns}function Su(){for(;null!==Is;)ku(Is)}function Ou(){for(;null!==Is&&!Si();)ku(Is)}function ku(t){var e=Ws(t.alternate,t,Ps);t.memoizedProps=t.pendingProps,null===e?Cu(t):Is=e,Cs.current=null}function Cu(t){var e=t;do{var n=e.alternate;if(t=e.return,0===(2048&e.flags)){if(null!==(n=is(n,e,Ps)))return void(Is=n);if(24!==(n=e).tag&&23!==n.tag||null===n.memoizedState||0!==(1073741824&Ps)||0===(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==t&&0===(2048&t.flags)&&(null===t.firstEffect&&(t.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==t.lastEffect&&(t.lastEffect.nextEffect=e.firstEffect),t.lastEffect=e.lastEffect),1<e.flags&&(null!==t.lastEffect?t.lastEffect.nextEffect=e:t.firstEffect=e,t.lastEffect=e))}else{if(null!==(n=os(e)))return n.flags&=2047,void(Is=n);null!==t&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}if(null!==(e=e.sibling))return void(Is=e);Is=e=t}while(null!==e);0===Ns&&(Ns=5)}function Mu(t){var e=Vi();return Hi(99,Au.bind(null,t,e)),null}function Au(t,e){do{ju()}while(null!==Js);if(0!==(48&Ms))throw Error(a(327));var n=t.finishedWork;if(null===n)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(a(177));t.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=t.pendingLanes&~i;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=i,t.mutableReadLanes&=i,t.entangledLanes&=i,i=t.entanglements;for(var s=t.eventTimes,u=t.expirationTimes;0<o;){var c=31-qe(o),l=1<<c;i[c]=0,s[c]=-1,u[c]=-1,o&=~l}if(null!==eu&&0===(24&r)&&eu.has(t)&&eu.delete(t),t===As&&(Is=As=null,js=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Ms,Ms|=32,Cs.current=null,Fr=Ke,pr(s=dr())){if("selectionStart"in s)u={start:s.selectionStart,end:s.selectionEnd};else t:if(u=(u=s.ownerDocument)&&u.defaultView||window,(l=u.getSelection&&u.getSelection())&&0!==l.rangeCount){u=l.anchorNode,o=l.anchorOffset,c=l.focusNode,l=l.focusOffset;try{u.nodeType,c.nodeType}catch(O){u=null;break t}var h=0,f=-1,d=-1,p=0,v=0,m=s,g=null;e:for(;;){for(var y;m!==u||0!==o&&3!==m.nodeType||(f=h+o),m!==c||0!==l&&3!==m.nodeType||(d=h+l),3===m.nodeType&&(h+=m.nodeValue.length),null!==(y=m.firstChild);)g=m,m=y;for(;;){if(m===s)break e;if(g===u&&++p===o&&(f=h),g===c&&++v===l&&(d=h),null!==(y=m.nextSibling))break;g=(m=g).parentNode}m=y}u=-1===f||-1===d?null:{start:f,end:d}}else u=null;u=u||{start:0,end:0}}else u=null;Ur={focusedElem:s,selectionRange:u},Ke=!1,su=null,uu=!1,Gs=r;do{try{Iu()}catch(O){if(null===Gs)throw Error(a(330));Du(Gs,O),Gs=Gs.nextEffect}}while(null!==Gs);su=null,Gs=r;do{try{for(s=t;null!==Gs;){var b=Gs.flags;if(16&b&&yt(Gs.stateNode,""),128&b){var _=Gs.alternate;if(null!==_){var w=_.ref;null!==w&&("function"===typeof w?w(null):w.current=null)}}switch(1038&b){case 2:bs(Gs),Gs.flags&=-3;break;case 6:bs(Gs),Gs.flags&=-3,Ts(Gs.alternate,Gs);break;case 1024:Gs.flags&=-1025;break;case 1028:Gs.flags&=-1025,Ts(Gs.alternate,Gs);break;case 4:Ts(Gs.alternate,Gs);break;case 8:xs(s,u=Gs);var x=u.alternate;gs(u),null!==x&&gs(x)}Gs=Gs.nextEffect}}catch(O){if(null===Gs)throw Error(a(330));Du(Gs,O),Gs=Gs.nextEffect}}while(null!==Gs);if(w=Ur,_=dr(),b=w.focusedElem,s=w.selectionRange,_!==b&&b&&b.ownerDocument&&fr(b.ownerDocument.documentElement,b)){null!==s&&pr(b)&&(_=s.start,void 0===(w=s.end)&&(w=_),"selectionStart"in b?(b.selectionStart=_,b.selectionEnd=Math.min(w,b.value.length)):(w=(_=b.ownerDocument||document)&&_.defaultView||window).getSelection&&(w=w.getSelection(),u=b.textContent.length,x=Math.min(s.start,u),s=void 0===s.end?x:Math.min(s.end,u),!w.extend&&x>s&&(u=s,s=x,x=u),u=hr(b,x),o=hr(b,s),u&&o&&(1!==w.rangeCount||w.anchorNode!==u.node||w.anchorOffset!==u.offset||w.focusNode!==o.node||w.focusOffset!==o.offset)&&((_=_.createRange()).setStart(u.node,u.offset),w.removeAllRanges(),x>s?(w.addRange(_),w.extend(o.node,o.offset)):(_.setEnd(o.node,o.offset),w.addRange(_))))),_=[];for(w=b;w=w.parentNode;)1===w.nodeType&&_.push({element:w,left:w.scrollLeft,top:w.scrollTop});
2for("function"===typeof b.focus&&b.focus(),b=0;b<_.length;b++)(w=_[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Ke=!!Fr,Ur=Fr=null,t.current=n,Gs=r;do{try{for(b=t;null!==Gs;){var T=Gs.flags;if(36&T&&ps(b,Gs.alternate,Gs),128&T){_=void 0;var E=Gs.ref;if(null!==E){var S=Gs.stateNode;switch(Gs.tag){case 5:_=S;break;default:_=S}"function"===typeof E?E(_):E.current=_}}Gs=Gs.nextEffect}}catch(O){if(null===Gs)throw Error(a(330));Du(Gs,O),Gs=Gs.nextEffect}}while(null!==Gs);Gs=null,Ni(),Ms=i}else t.current=n;if(Qs)Qs=!1,Js=t,Zs=e;else for(Gs=r;null!==Gs;)e=Gs.nextEffect,Gs.nextEffect=null,8&Gs.flags&&((T=Gs).sibling=null,T.stateNode=null),Gs=e;if(0===(r=t.pendingLanes)&&(Ks=null),1===r?t===ru?nu++:(nu=0,ru=t):nu=0,n=n.stateNode,wi&&"function"===typeof wi.onCommitFiberRoot)try{wi.onCommitFiberRoot(_i,n,void 0,64===(64&n.current.flags))}catch(O){}if(du(t,Bi()),Ys)throw Ys=!1,t=Xs,Xs=null,t;return 0!==(8&Ms)||Wi(),null}function Iu(){for(;null!==Gs;){var t=Gs.alternate;uu||null===su||(0!==(8&Gs.flags)?te(Gs,su)&&(uu=!0):13===Gs.tag&&Ss(t,Gs)&&te(Gs,su)&&(uu=!0));var e=Gs.flags;0!==(256&e)&&ds(t,Gs),0===(512&e)||Qs||(Qs=!0,qi(97,(function(){return ju(),null}))),Gs=Gs.nextEffect}}function ju(){if(90!==Zs){var t=97<Zs?97:Zs;return Zs=90,Hi(t,Nu)}return!1}function Pu(t,e){$s.push(e,t),Qs||(Qs=!0,qi(97,(function(){return ju(),null})))}function Ru(t,e){tu.push(e,t),Qs||(Qs=!0,qi(97,(function(){return ju(),null})))}function Nu(){if(null===Js)return!1;var t=Js;if(Js=null,0!==(48&Ms))throw Error(a(331));var e=Ms;Ms|=32;var n=tu;tu=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"===typeof s)try{s()}catch(c){if(null===o)throw Error(a(330));Du(o,c)}}for(n=$s,$s=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var u=i.create;i.destroy=u()}catch(c){if(null===o)throw Error(a(330));Du(o,c)}}for(u=t.current.firstEffect;null!==u;)t=u.nextEffect,u.nextEffect=null,8&u.flags&&(u.sibling=null,u.stateNode=null),u=t;return Ms=e,Wi(),!0}function Lu(t,e,n){uo(t,e=cs(0,e=as(n,e),1)),e=cu(),null!==(t=fu(t,1))&&(He(t,1,e),du(t,e))}function Du(t,e){if(3===t.tag)Lu(t,t,e);else for(var n=t.return;null!==n;){if(3===n.tag){Lu(n,t,e);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Ks||!Ks.has(r))){var i=ls(n,t=as(e,t),1);if(uo(n,i),i=cu(),null!==(n=fu(n,1)))He(n,1,i),du(n,i);else if("function"===typeof r.componentDidCatch&&(null===Ks||!Ks.has(r)))try{r.componentDidCatch(e,t)}catch(o){}break}}n=n.return}}function Fu(t,e,n){var r=t.pingCache;null!==r&&r.delete(e),e=cu(),t.pingedLanes|=t.suspendedLanes&n,As===t&&(js&n)===n&&(4===Ns||3===Ns&&(62914560&js)===js&&500>Bi()-zs?wu(t,0):Bs|=n),du(t,e)}function Uu(t,e){var n=t.stateNode;null!==n&&n.delete(e),0===(e=0)&&(0===(2&(e=t.mode))?e=1:0===(4&e)?e=99===Vi()?1:2:(0===ou&&(ou=Ds),0===(e=Ve(62914560&~ou))&&(e=4194304))),n=cu(),null!==(t=fu(t,e))&&(He(t,e,n),du(t,n))}function Bu(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Vu(t,e,n,r){return new Bu(t,e,n,r)}function zu(t){return!(!(t=t.prototype)||!t.isReactComponent)}function Hu(t,e){var n=t.alternate;return null===n?((n=Vu(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function qu(t,e,n,r,i,o){var s=2;if(r=t,"function"===typeof t)zu(t)&&(s=1);else if("string"===typeof t)s=5;else t:switch(t){case E:return Wu(n.children,i,o,e);case L:s=8,i|=16;break;case S:s=8,i|=1;break;case O:return(t=Vu(12,n,e,8|i)).elementType=O,t.type=O,t.lanes=o,t;
vendor: 6,809 bytes, line 2
2case A:return(t=Vu(13,n,e,i)).type=A,t.elementType=A,t.lanes=o,t;case I:return(t=Vu(19,n,e,i)).elementType=I,t.lanes=o,t;case D:return Gu(n,i,o,e);case F:return(t=Vu(24,n,e,i)).elementType=F,t.lanes=o,t;default:if("object"===typeof t&&null!==t)switch(t.$$typeof){case k:s=10;break t;case C:s=9;break t;case M:s=11;break t;case j:s=14;break t;case P:s=16,r=null;break t;case R:s=22;break t}throw Error(a(130,null==t?t:typeof t,""))}return(e=Vu(s,n,e,i)).elementType=t,e.type=r,e.lanes=o,e}function Wu(t,e,n,r){return(t=Vu(7,t,r,e)).lanes=n,t}function Gu(t,e,n,r){return(t=Vu(23,t,r,e)).elementType=D,t.lanes=n,t}function Yu(t,e,n){return(t=Vu(6,t,null,e)).lanes=n,t}function Xu(t,e,n){return(e=Vu(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Ku(t,e,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=ze(0),this.expirationTimes=ze(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ze(0),this.mutableSourceEagerHydrationData=null}function Qu(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:T,key:null==r?null:""+r,children:t,containerInfo:e,implementation:n}}function Ju(t,e,n,r){var i=e.current,o=cu(),s=lu(i);t:if(n){e:{if(Qt(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(pi(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(null!==u);throw Error(a(171))}if(1===n.tag){var c=n.type;if(pi(c)){n=gi(n,c,u);break t}}n=u}else n=ci;return null===e.context?e.context=n:e.pendingContext=n,(e=so(o,s)).payload={element:t},null!==(r=void 0===r?null:r)&&(e.callback=r),uo(i,e),hu(i,s,o),s}function Zu(t){if(!(t=t.current).child)return null;switch(t.child.tag){case 5:default:return t.child.stateNode}}function $u(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n<e?n:e}}function tc(t,e){$u(t,e),(t=t.alternate)&&$u(t,e)}function ec(t,e,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Ku(t,e,null!=n&&!0===n.hydrate),e=Vu(3,null,null,2===e?7:1===e?3:0),n.current=e,e.stateNode=n,oo(e),t[Jr]=n.current,Mr(8===t.nodeType?t.parentNode:t),r)for(t=0;t<r.length;t++){var i=(e=r[t])._getVersion;i=i(e._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[e,i]:n.mutableSourceEagerHydrationData.push(e,i)}this._internalRoot=n}function nc(t){return!(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType&&(8!==t.nodeType||" react-mount-point-unstable "!==t.nodeValue))}function rc(t,e,n,r,i){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if("function"===typeof i){var s=i;i=function(){var t=Zu(a);s.call(t)}}Ju(e,a,t,i)}else{if(o=n._reactRootContainer=function(t,e){if(e||(e=!(!(e=t?9===t.nodeType?t.documentElement:t.firstChild:null)||1!==e.nodeType||!e.hasAttribute("data-reactroot"))),!e)for(var n;n=t.lastChild;)t.removeChild(n);return new ec(t,0,e?{hydrate:!0}:void 0)}(n,r),a=o._internalRoot,"function"===typeof i){var u=i;i=function(){var t=Zu(a);u.call(t)}}yu((function(){Ju(e,a,t,i)}))}return Zu(a)}function ic(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nc(e))throw Error(a(200));return Qu(t,e,null,n)}Ws=function(t,e,n){var r=e.lanes;if(null!==t)if(t.memoizedProps!==e.pendingProps||hi.current)Ra=!0;else{if(0===(n&r)){switch(Ra=!1,e.tag){case 3:qa(e),Wo();break;case 5:Po(e);break;case 1:pi(e.type)&&yi(e);break;case 4:Io(e,e.stateNode.containerInfo);break;case 10:r=e.memoizedProps.value;var i=e.type._context;ui(Ki,i._currentValue),i._currentValue=r;break;case 13:if(null!==e.memoizedState)return 0!==(n&e.child.childLanes)?Ka(t,e,n):(ui(No,1&No.current),null!==(e=ns(t,e,n))?e.sibling:null);ui(No,1&No.current);break;case 19:if(r=0!==(n&e.childLanes),0!==(64&t.flags)){if(r)return es(t,e,n);e.flags|=64}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),ui(No,No.current),r)break;return null;case 23:case 24:return e.lanes=0,Ua(t,e,n)}return ns(t,e,n)}Ra=0!==(16384&t.flags)}else Ra=!1;switch(e.lanes=0,e.tag){case 2:if(r=e.type,null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=di(e,li.current),no(e,n),i=ia(null,e,r,t,i,n),e.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,pi(r)){var o=!0;yi(e)}else o=!1;e.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,oo(e);var s=r.getDerivedStateFromProps;"function"===typeof s&&po(e,r,s,t),i.updater=vo,e.stateNode=i,i._reactInternals=e,bo(e,r,t,n),e=Ha(null,e,r,!0,o,n)}else e.tag=0,Na(null,e,i,n),e=e.child;return e;case 16:i=e.elementType;t:{switch(null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=(o=i._init)(i._payload),e.type=i,o=e.tag=function(t){if("function"===typeof t)return zu(t)?1:0;if(void 0!==t&&null!==t){if((t=t.$$typeof)===M)return 11;if(t===j)return 14}return 2}(i),t=Xi(i,t),o){case 0:e=Va(null,e,i,t,n);break t;case 1:e=za(null,e,i,t,n);break t;case 11:e=La(null,e,i,t,n);break t;case 14:e=Da(null,e,i,Xi(i.type,t),r,n);break t}throw Error(a(306,i,""))}return e;case 0:return r=e.type,i=e.pendingProps,Va(t,e,r,i=e.elementType===r?i:Xi(r,i),n);case 1:return r=e.type,i=e.pendingProps,za(t,e,r,i=e.elementType===r?i:Xi(r,i),n);case 3:if(qa(e),r=e.updateQueue,null===t||null===r)throw Error(a(282));if(r=e.pendingProps,i=null!==(i=e.memoizedState)?i.element:null,ao(t,e),lo(e,r,null,n),(r=e.memoizedState.element)===i)Wo(),e=ns(t,e,n);else{if((o=(i=e.stateNode).hydrate)&&(Fo=Wr(e.stateNode.containerInfo.firstChild),Do=e,o=Uo=!0),o){if(null!=(t=i.mutableSourceEagerHydrationData))for(i=0;i<t.length;i+=2)(o=t[i])._workInProgressVersionPrimary=t[i+1],Go.push(o);for(n=So(e,null,r,n),e.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Na(t,e,r,n),Wo();e=e.child}return e;case 5:return Po(e),null===t&&zo(e),r=e.type,i=e.pendingProps,o=null!==t?t.memoizedProps:null,s=i.children,Vr(r,i)?s=null:null!==o&&Vr(r,o)&&(e.flags|=16),Ba(t,e),Na(t,e,s,n),e.child;case 6:return null===t&&zo(e),null;case 13:return Ka(t,e,n);case 4:return Io(e,e.stateNode.containerInfo),r=e.pendingProps,null===t?e.child=Eo(e,null,r,n):Na(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,La(t,e,r,i=e.elementType===r?i:Xi(r,i),n);case 7:return Na(t,e,e.pendingProps,n),e.child;case 8:case 12:return Na(t,e,e.pendingProps.children,n),e.child;
vendor: 4,695 bytes, line 2
2case 10:t:{r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value;var u=e.type._context;if(ui(Ki,u._currentValue),u._currentValue=o,null!==s)if(u=s.value,0===(o=sr(u,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,o):1073741823))){if(s.children===i.children&&!hi.current){e=ns(t,e,n);break t}}else for(null!==(u=e.child)&&(u.return=e);null!==u;){var c=u.dependencies;if(null!==c){s=u.child;for(var l=c.firstContext;null!==l;){if(l.context===r&&0!==(l.observedBits&o)){1===u.tag&&((l=so(-1,n&-n)).tag=2,uo(u,l)),u.lanes|=n,null!==(l=u.alternate)&&(l.lanes|=n),eo(u.return,n),c.lanes|=n;break}l=l.next}}else s=10===u.tag&&u.type===e.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===e){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}Na(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=(o=e.pendingProps).children,no(e,n),r=r(i=ro(i,o.unstable_observedBits)),e.flags|=1,Na(t,e,r,n),e.child;case 14:return o=Xi(i=e.type,e.pendingProps),Da(t,e,i,o=Xi(i.type,o),r,n);case 15:return Fa(t,e,e.type,e.pendingProps,r,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Xi(r,i),null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),e.tag=1,pi(r)?(t=!0,yi(e)):t=!1,no(e,n),go(e,r,i),bo(e,r,i,n),Ha(null,e,r,!0,t,n);case 19:return es(t,e,n);case 23:case 24:return Ua(t,e,n)}throw Error(a(156,e.tag))},ec.prototype.render=function(t){Ju(t,this._internalRoot,null,null)},ec.prototype.unmount=function(){var t=this._internalRoot,e=t.containerInfo;Ju(null,t,null,(function(){e[Jr]=null}))},ee=function(t){13===t.tag&&(hu(t,4,cu()),tc(t,4))},ne=function(t){13===t.tag&&(hu(t,67108864,cu()),tc(t,67108864))},re=function(t){if(13===t.tag){var e=cu(),n=lu(t);hu(t,n,e),tc(t,n)}},ie=function(t,e){return e()},kt=function(t,e,n){switch(e){case"input":if(nt(t,n),e=n.name,"radio"===n.type&&null!=e){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=ni(r);if(!i)throw Error(a(90));J(r),nt(r,i)}}}break;case"textarea":ct(t,n);break;case"select":null!=(e=n.value)&&at(t,!!n.multiple,e,!1)}},Pt=gu,Rt=function(t,e,n,r,i){var o=Ms;Ms|=4;try{return Hi(98,t.bind(null,e,n,r,i))}finally{0===(Ms=o)&&(qs(),Wi())}},Nt=function(){0===(49&Ms)&&(function(){if(null!==eu){var t=eu;eu=null,t.forEach((function(t){t.expiredLanes|=24&t.pendingLanes,du(t,Bi())}))}Wi()}(),ju())},Lt=function(t,e){var n=Ms;Ms|=2;try{return t(e)}finally{0===(Ms=n)&&(qs(),Wi())}};var oc={Events:[ti,ei,ni,It,jt,ju,{current:!1}]},ac={findFiberByHostInstance:$r,bundleType:0,version:"17.0.1",rendererPackageName:"react-dom"},sc={bundleType:ac.bundleType,version:ac.version,rendererPackageName:ac.rendererPackageName,rendererConfig:ac.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return null===(t=$t(t))?null:t.stateNode},findFiberByHostInstance:ac.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uc.isDisabled&&uc.supportsFiber)try{_i=uc.inject(sc),wi=uc}catch(mt){}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oc,e.createPortal=ic,e.findDOMNode=function(t){if(null==t)return null;if(1===t.nodeType)return t;var e=t._reactInternals;if(void 0===e){if("function"===typeof t.render)throw Error(a(188));throw Error(a(268,Object.keys(t)))}return t=null===(t=$t(e))?null:t.stateNode},e.flushSync=function(t,e){var n=Ms;if(0!==(48&n))return t(e);Ms|=1;try{if(t)return Hi(99,t.bind(null,e))}finally{Ms=n,Wi()}},e.hydrate=function(t,e,n){if(!nc(e))throw Error(a(200));return rc(null,t,e,!0,n)},e.render=function(t,e,n){if(!nc(e))throw Error(a(200));return rc(null,t,e,!1,n)},e.unmountComponentAtNode=function(t){if(!nc(t))throw Error(a(40));return!!t._reactRootContainer&&(yu((function(){rc(null,null,t,!1,(function(){t._reactRootContainer=null,t[Jr]=null}))})),!0)},e.unstable_batchedUpdates=gu,e.unstable_createPortal=function(t,e){return ic(t,e,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},e.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!nc(n))throw Error(a(200));if(null==t||void 0===t._reactInternals)throw Error(a(38));return rc(t,e,n,!1,r)},e.version="17.0.1"},function(t,e,n){"use strict";
vendor: 4,165 bytes, line 2
2t.exports=n(89)},function(t,e,n){"use strict";var r,i,o,a;if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var l=null,h=null,f=function t(){if(null!==l)try{var n=e.unstable_now();l(!0,n),l=null}catch(r){throw setTimeout(t,0),r}};r=function(t){null!==l?setTimeout(r,0,t):(l=t,setTimeout(f,0))},i=function(t,e){h=setTimeout(t,e)},o=function(){clearTimeout(h)},e.unstable_shouldYield=function(){return!1},a=e.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,p=window.clearTimeout;if("undefined"!==typeof console){var v=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var m=!1,g=null,y=-1,b=5,_=0;e.unstable_shouldYield=function(){return e.unstable_now()>=_},a=function(){},e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<t?Math.floor(1e3/t):5};var w=new MessageChannel,x=w.port2;w.port1.onmessage=function(){if(null!==g){var t=e.unstable_now();_=t+b;try{g(!0,t)?x.postMessage(null):(m=!1,g=null)}catch(n){throw x.postMessage(null),n}}else m=!1},r=function(t){g=t,m||(m=!0,x.postMessage(null))},i=function(t,n){y=d((function(){t(e.unstable_now())}),n)},o=function(){p(y),y=-1}}function T(t,e){var n=t.length;t.push(e);t:for(;;){var r=n-1>>>1,i=t[r];if(!(void 0!==i&&0<O(i,e)))break t;t[r]=e,t[n]=i,n=r}}function E(t){return void 0===(t=t[0])?null:t}function S(t){var e=t[0];if(void 0!==e){var n=t.pop();if(n!==e){t[0]=n;t:for(var r=0,i=t.length;r<i;){var o=2*(r+1)-1,a=t[o],s=o+1,u=t[s];if(void 0!==a&&0>O(a,n))void 0!==u&&0>O(u,a)?(t[r]=u,t[s]=n,r=s):(t[r]=a,t[o]=n,r=o);else{if(!(void 0!==u&&0>O(u,n)))break t;t[r]=u,t[s]=n,r=s}}}return e}return null}function O(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}var k=[],C=[],M=1,A=null,I=3,j=!1,P=!1,R=!1;function N(t){for(var e=E(C);null!==e;){if(null===e.callback)S(C);else{if(!(e.startTime<=t))break;S(C),e.sortIndex=e.expirationTime,T(k,e)}e=E(C)}}function L(t){if(R=!1,N(t),!P)if(null!==E(k))P=!0,r(D);else{var e=E(C);null!==e&&i(L,e.startTime-t)}}function D(t,n){P=!1,R&&(R=!1,o()),j=!0;var r=I;try{for(N(n),A=E(k);null!==A&&(!(A.expirationTime>n)||t&&!e.unstable_shouldYield());){var a=A.callback;if("function"===typeof a){A.callback=null,I=A.priorityLevel;var s=a(A.expirationTime<=n);n=e.unstable_now(),"function"===typeof s?A.callback=s:A===E(k)&&S(k),N(n)}else S(k);A=E(k)}if(null!==A)var u=!0;else{var c=E(C);null!==c&&i(L,c.startTime-n),u=!1}return u}finally{A=null,I=r,j=!1}}var F=a;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(t){t.callback=null},e.unstable_continueExecution=function(){P||j||(P=!0,r(D))},e.unstable_getCurrentPriorityLevel=function(){return I},e.unstable_getFirstCallbackNode=function(){return E(k)},e.unstable_next=function(t){switch(I){case 1:case 2:case 3:var e=3;break;default:e=I}var n=I;I=e;try{return t()}finally{I=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=F,e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=I;I=t;try{return e()}finally{I=n}},e.unstable_scheduleCallback=function(t,n,a){var s=e.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?s+a:s:a=s,t){case 1:var u=-1;break;case 2:u=250;break;case 5:u=1073741823;break;case 4:u=1e4;break;default:u=5e3}return t={id:M++,callback:n,priorityLevel:t,startTime:a,expirationTime:u=
2a+u,sortIndex:-1},a>s?(t.sortIndex=a,T(C,t),null===E(k)&&t===E(C)&&(R?o():R=!0,i(L,a-s))):(t.sortIndex=u,T(k,t),P||j||(P=!0,r(D))),t},e.unstable_wrapCallback=function(t){var e=I;return function(){var n=I;I=e;try{return t.apply(this,arguments)}finally{I=n}}}},,function(t,e,n){"use strict";var r=n(92);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,,,function(t,e,n){"use strict";n(53);var r=n(13),i=60103;if(e.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),e.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var r,o={},c=null,l=null;
vendor: 4,704 bytes, line 2
2for(r in void 0!==n&&(c=""+n),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(l=e.ref),e)s.call(e,r)&&!u.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===o[r]&&(o[r]=e[r]);return{$$typeof:i,type:t,key:c,ref:l,props:o,_owner:a.current}}e.jsx=c,e.jsxs=c},function(t,e,n){"use strict";n(62)},,function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(I){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(t,e,n){var r=h;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=l(t,e,n);if("normal"===u.type){if(r=n.done?p:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(I){return{type:"throw",arg:I}}}t.wrap=c;var h="suspendedStart",f="suspendedYield",d="executing",p="completed",v={};function m(){}function g(){}function y(){}var b={};b[o]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(M([])));w&&w!==n&&r.call(w,o)&&(b=w);var x=y.prototype=m.prototype=Object.create(b);function T(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,a,s){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"===typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=l(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(t){if(t){var n=t[o];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:A}}function A(){return{value:e,done:!0}}return g.prototype=x.constructor=y,y.constructor=g,g.displayName=u(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,s,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},T(E.prototype),E.prototype[a]=function(){return this},t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(x),u(x,s,"Generator"),x[o]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEac
2h(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.url=void 0;var r=n(63),i=n(36)("socket.io-client:url");e.url=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,o=t;n=n||"undefined"!==typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"===typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(i("protocol-less url %s",t),t="undefined"!==typeof n?n.protocol+"//"+t:"https://"+t),i("parse %s",t),o=r(t)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";var a=-1!==o.host.indexOf(":"),s=a?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+s+":"+o.port+e,o.href=o.protocol+"://"+s+(n&&n.port===o.port?"":":"+o.port),o}},function(t,e,n){var r=n(102);t.exports=function(t){function e(t){var n,r=null;function o(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];if(o.enabled){var a=o,s=Number(new Date),u=s-(n||s);a.diff=u,a.prev=n,a.curr=s,n=s,r[0]=e.coerce(r[0]),"string"!==typeof r[0]&&r.unshift("%O");var c=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(t,n){if("%%"===t)return"%";c++;var i=e.formatters[n];if("function"===typeof i){var o=r[c];t=i.call(a,o),r.splice(c,1),c--}return t})),e.formatArgs.call(a,r);var l=a.log||e.log;l.apply(a,r)}}return o.namespace=t,o.useColors=e.useColors(),o.color=e.selectColor(t),o.extend=i,o.destroy=e.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:function(){return null===r?e.enabled(t):r},set:function(t){r=t}}),"function"===typeof e.init&&e.init(o),o}function i(t,n){var r=e(this.namespace+("undefined"===typeof n?":":n)+t);return r.log=this.log,r}function o(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){var t=[].concat(r(e.names.map(o)),r(e.skips.map(o).map((function(t){return"-"+t})))).join(",");return e.enable(""),t},e.enable=function(t){var n;e.save(t),e.names=[],e.skips=[];var r=("string"===typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(106),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((function(n){e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},function(t,e,n){var r=n(103),i=n(104),o=n(65),a=n(105);t.exports=function(t){return r(t)||i(t)||o(t)||a()}},function(t,e,n){var r=n(64);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e){var n=1e3,r=60*n,i=60*r,o=24*i,a=7*o,s=365.25*o;function u(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,e){e=e||{};var c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var u=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*a;case"days":case"day":case"d":return u*o;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(t);if("number"===c&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=o)return u(t,e,o,"day");if(e>=i)return u(t,e,i,"hour");if(e>=r)return u(t,e,r,"minute");
2if(e>=n)return u(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=o)return Math.round(t/o)+"d";if(e>=i)return Math.round(t/i)+"h";if(e>=r)return Math.round(t/r)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e){t.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},function(t,e,n){var r=n(110),i=n(67);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?i(t):e}},function(t,e){function n(e){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){var r=n(112);t.exports=function(t,e){return new r(t,e)},t.exports.Socket=r,t.exports.protocol=r.protocol,t.exports.Transport=n(55),t.exports.transports=n(68),t.exports.parser=n(46)},function(t,e,n){var r=n(31),i=n(32),o=n(33),a=n(34),s=n(68),u=n(47),c=n(36)("engine.io-client:socket"),l=n(46),h=n(63),f=n(56),d=function(t){"use strict";o(n,t);var e=a(n);function n(t){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(this,n),i=e.call(this),t&&"object"===typeof t&&(o=t,t=null),t?(t=h(t),o.hostname=t.host,o.secure="https"===t.protocol||"wss"===t.protocol,o.port=t.port,t.query&&(o.query=t.query)):o.host&&(o.hostname=h(o.host).host),i.secure=null!=o.secure?o.secure:"undefined"!==typeof location&&"https:"===location.protocol,o.hostname&&!o.port&&(o.port=i.secure?"443":"80"),i.hostname=o.hostname||("undefined"!==typeof location?location.hostname:"localhost"),i.port=o.port||("undefined"!==typeof location&&location.port?location.port:i.secure?443:80),i.transports=o.transports||["polling","websocket"],i.readyState="",i.writeBuffer=[],i.prevBufferLen=0,i.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,jsonp:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{}},o),i.opts.path=i.opts.path.replace(/\/$/,"")+"/","string"===typeof i.opts.query&&(i.opts.query=f.decode(i.opts.query)),i.id=null,i.upgrades=null,i.pingInterval=null,i.pingTimeout=null,i.pingTimeoutTimer=null,"function"===typeof addEventListener&&(addEventListener("beforeunload",(function(){i.transport&&(i.transport.removeAllListeners(),i.transport.close())}),!1),"localhost"!==i.hostname&&(i.offlineEventListener=function(){i.onClose("transport close")},addEventListener("offline",i.offlineEventListener,!1))),i.open(),i}return i(n,[{key:"createTransport",value:function(t){c('creating transport "%s"',t);var e=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(this.opts.query);e.EIO=l.protocol,e.transport=t,this.id&&(e.sid=this.id);var n=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return c("options: %j",n),new s[t](n)}},{key:"open",value:function(){var t;if(this.opts.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout((function(){e.emit("error","No transports available")}),0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(r){return c("error while creating transport: %s",r),this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}},{key:"setTransport",value:function(t){c("setting transport %s",t.name);var e=this;this.transport&&(c("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",(function(){e.onDrain()})).on("packet",(function(t){e.onPacket(t)})).on("error",(function(t){e.onError(t)})).on("close",(function(){e.onClose("transport close")}))}},{key:"probe",value:function(t){c('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,i=this;function o(){if(i.onlyBinaryUpgrades){var o=!this.supportsBinary&&i.transport.supportsBinary;r=r||o}r||(c('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}
2]),e.once("packet",(function(o){if(!r)if("pong"===o.type&&"probe"===o.data){if(c('probe transport "%s" pong',t),i.upgrading=!0,i.emit("upgrading",e),!e)return;n.priorWebsocketSuccess="websocket"===e.name,c('pausing current transport "%s"',i.transport.name),i.transport.pause((function(){r||"closed"!==i.readyState&&(c("changing transport and sending upgrade packet"),f(),i.setTransport(e),e.send([{type:"upgrade"}]),i.emit("upgrade",e),e=null,i.upgrading=!1,i.flush())}))}else{c('probe transport "%s" failed',t);var a=new Error("probe error");a.transport=e.name,i.emit("upgradeError",a)}})))}function a(){r||(r=!0,f(),e.close(),e=null)}function s(n){var r=new Error("probe error: "+n);r.transport=e.name,a(),c('probe transport "%s" failed because of error: %s',t,n),i.emit("upgradeError",r)}function u(){s("transport closed")}function l(){s("socket closed")}function h(t){e&&t.name!==e.name&&(c('"%s" works - aborting "%s"',t.name,e.name),a())}function f(){e.removeListener("open",o),e.removeListener("error",s),e.removeListener("close",u),i.removeListener("close",l),i.removeListener("upgrading",h)}n.priorWebsocketSuccess=!1,e.once("open",o),e.once("error",s),e.once("close",u),this.once("close",l),this.once("upgrading",h),e.open()}},{key:"onOpen",value:function(){if(c("socket open"),this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){c("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}}},{key:"onPacket",value:function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(c('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;
2case"message":this.emit("data",t.data),this.emit("message",t.data)}else c('packet received with socket readyState "%s"',this.readyState)}},{key:"onHandshake",value:function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}},{key:"resetPingTimeout",value:function(){var t=this;clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=setTimeout((function(){t.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}},{key:"onDrain",value:function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()}},{key:"flush",value:function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(c("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))}},{key:"write",value:function(t,e,n){return this.sendPacket("message",t,e,n),this}},{key:"send",value:function(t,e,n){return this.sendPacket("message",t,e,n),this}},{key:"sendPacket",value:function(t,e,n,r){if("function"===typeof e&&(r=e,e=void 0),"function"===typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var i={type:t,data:e,options:n};this.emit("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}}},{key:"close",value:function(){var t=this;function e(){t.onClose("forced close"),c("socket closing - telling transport to close"),t.transport.close()}function n(){t.removeListener("upgrade",n),t.removeListener("upgradeError",n),e()}function r(){t.once("upgrade",n),t.once("upgradeError",n)}return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){this.upgrading?r():e()})):this.upgrading?r():e()),this}},{key:"onError",value:function(t){c("socket error %j",t),n.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)}},{key:"onClose",value:function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){c('socket close with reason: "%s"',t);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"===typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emit("close",t,e),this.writeBuffer=[],this.prevBufferLen=0}}},{key:"filterUpgrades",value:function(t){for(var e=[],n=0,r=t.length;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}]),n}(u);d.priorWebsocketSuccess=!1,d.protocol=l.protocol,t.exports=d},function(t,e){try{t.exports="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(n){t.exports=!1}},function(t,e,n){var r=n(31),i=n(32),o=n(33),a=n(34),s=n(69),u=n(70),c=n(47),l=n(73).pick,h=n(49),f=n(36)("engine.io-client:polling-xhr");function d(){}var p=null!=new s({xdomain:!1}).responseType,v=function(t){"use strict";o(n,t);var e=a(n);function n(t){var i;if(r(this,n),i=e.call(this,t),"undefined"!==typeof location){var o="https:"===location.protocol,a=location.port;a||(a=o?443:80),i.xd="undefined"!==typeof location&&t.hostname!==location.hostname||a!==t.port,i.xs=t.secure!==o}var s=t&&t.forceBase64;return i.supportsBinary=p&&!s,i}return i(n,[{key:"request",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new m(this.uri(),t)}},{key:"doWrite",value:function(t,e){var n=this.request({method:"POST",data:t}),r=this;n.on("success",e),n.on("error",(function(t){r.onError("xhr post error",t)}))}},{key:"doPoll",value:function(){f("xhr poll");var t=this.request(),e=this;t.on("data",(function(t){e.onData(t)})),t.on("error",(function(t){e.onError("xhr poll error",t)})),this.pollXhr=t}}]),n}(u),m=function(t){"use strict";o(n,t);var e=a(n);function n(t,i){var o;return r(this,n),(o=e.call(this)).opts=i,o.method=i.method||"GET",o.uri=t,o.async=!1!==i.async,o.data=void 0!==i.data?i.data:null,o.create(),o}return i(n,[{key:"create",value:function(){var t=l(this.opts,"agent","enablesXDR","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;var e=this.xhr=new s(t),r=this;try{f("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var i in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&e.setRequestHeader(i,this.opts.extraHeaders[i])}catch(o){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(o){}try{e.setRequestHeader("Accept","*/*")}catch(o){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),this.hasXDR()?(e.onload=function(){r.onLoad()},e.onerror=function(){r.onError(e.responseText)}):e.onreadystatechange=function(){4===e.readyState&&(200===e.status||1223===e.status?r.onLoad():setTimeout((function(){r.onError("number"===typeof e.status?e.status:0)}),0))},f("xhr data %s",this.data),e.send(this.data)}catch(o){return void setTimeout((function(){r.onError(o)}),0)}"undefined"!==typeof document&&(this.index=n.requestsCount++,n.requests[this.index]=this)}}
2,{key:"onSuccess",value:function(){this.emit("success"),this.cleanup()}},{key:"onData",value:function(t){this.emit("data",t),this.onSuccess()}},{key:"onError",value:function(t){this.emit("error",t),this.cleanup(!0)}},{key:"cleanup",value:function(t){if("undefined"!==typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=d:this.xhr.onreadystatechange=d,t)try{this.xhr.abort()}catch(e){}"undefined"!==typeof document&&delete n.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var t=this.xhr.responseText;null!==t&&this.onData(t)}},{key:"hasXDR",value:function(){return"undefined"!==typeof XDomainRequest&&!this.xs&&this.enablesXDR}},{key:"abort",value:function(){this.cleanup()}}]),n}(c);if(m.requestsCount=0,m.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",g);else if("function"===typeof addEventListener){addEventListener("onpagehide"in h?"pagehide":"unload",g,!1)}function g(){for(var t in m.requests)m.requests.hasOwnProperty(t)&&m.requests[t].abort()}t.exports=v,t.exports.Request=m},function(t,e,n){var r=n(71).PACKET_TYPES,i="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),o="function"===typeof ArrayBuffer,a=function(t,e){var n=new FileReader;return n.onload=function(){var t=n.result.split(",")[1];e("b"+t)},n.readAsDataURL(t)};t.exports=function(t,e,n){var s,u=t.type,c=t.data;return i&&c instanceof Blob?e?n(c):a(c,n):o&&(c instanceof ArrayBuffer||(s=c,"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer))?e?n(c instanceof ArrayBuffer?c:c.buffer):a(new Blob([c]),n):n(r[u]+(c||""))}},function(t,e,n){var r,i=n(71),o=i.PACKET_TYPES_REVERSE,a=i.ERROR_PACKET;"function"===typeof ArrayBuffer&&(r=n(117));var s=function(t,e){if(r){var n=r.decode(t);return u(n,e)}return{base64:!0,data:t}},u=function(t,e){switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}};t.exports=function(t,e){if("string"!==typeof t)return{type:"message",data:u(t,e)};var n=t.charAt(0);return"b"===n?{type:"message",data:s(t.substring(1),e)}:o[n]?t.length>1?{type:o[n],data:t.substring(1)}:{type:o[n]}:a}},function(t,e){!function(t){"use strict";e.encode=function(e){var n,r=new Uint8Array(e),i=r.length,o="";for(n=0;n<i;n+=3)o+=t[r[n]>>2],o+=t[(3&r[n])<<4|r[n+1]>>4],o+=t[(15&r[n+1])<<2|r[n+2]>>6],o+=t[63&r[n+2]];return i%3===2?o=o.substring(0,o.length-1)+"=":i%3===1&&(o=o.substring(0,o.length-2)+"=="),o},e.decode=function(e){var n,r,i,o,a,s=.75*e.length,u=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l=new ArrayBuffer(s),h=new Uint8Array(l);for(n=0;n<u;n+=4)r=t.indexOf(e[n]),i=t.indexOf(e[n+1]),o=t.indexOf(e[n+2]),a=t.indexOf(e[n+3]),h[c++]=r<<2|i>>4,h[c++]=(15&i)<<4|o>>2,h[c++]=(3&o)<<6|63&a;return l}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},function(t,e,n){var r,i=n(31),o=n(32),a=n(67),s=n(50),u=n(40),c=n(33),l=n(34),h=n(70),f=n(49),d=/\n/g,p=/\\n/g,v=function(t){"use strict";c(n,t);var e=l(n);function n(t){var o;i(this,n),(o=e.call(this,t)).query=o.query||{},r||(r=f.___eio=f.___eio||[]),o.index=r.length;var s=a(o);return r.push((function(t){s.onData(t)})),o.query.j=o.index,o}return o(n,[{key:"supportsBinary",get:function(){return!1}},{key:"doClose",value:function(){this.script&&(this.script.onerror=function(){},this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),s(u(n.prototype),"doClose",this).call(this)}},{key:"doPoll",value:function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e,"undefined"!==typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)}),100)}},{key:"doWrite",value:function(t,e){var n,r=this;if(!this.form){var i=document.createElement("form"),o=document.createElement("textarea"),a=this.iframeId="eio_iframe_"+this.index;
2i.className="socketio",i.style.position="absolute",i.style.top="-1000px",i.style.left="-1000px",i.target=a,i.method="POST",i.setAttribute("accept-charset","utf-8"),o.name="d",i.appendChild(o),document.body.appendChild(i),this.form=i,this.area=o}function s(){u(),e()}function u(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(e){r.onError("jsonp polling iframe removal error",e)}try{var t='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(t)}catch(e){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),u(),t=t.replace(p,"\\\n"),this.area.value=t.replace(d,"\\n");try{this.form.submit()}catch(c){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&s()}:this.iframe.onload=s}}]),n}(h);t.exports=v},function(t,e,n){var r=n(40);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},function(t,e,n){(function(e){var r=n(31),i=n(32),o=n(33),a=n(34),s=n(55),u=n(46),c=n(56),l=n(72),h=n(73).pick,f=n(125),d=f.WebSocket,p=f.usingBrowserWebSocket,v=f.defaultBinaryType,m=n(36)("engine.io-client:websocket"),g="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),y=function(t){"use strict";o(f,t);var n=a(f);function f(t){var e;return r(this,f),(e=n.call(this,t)).supportsBinary=!t.forceBase64,e}return i(f,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){var t=this.uri(),e=this.opts.protocols,n=g?{}:h(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=p&&!g?e?new d(t,e):new d(t):new d(t,e,n)}catch(r){return this.emit("error",r)}this.ws.binaryType=this.socket.binaryType||v,this.addEventListeners()}}},{key:"addEventListeners",value:function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws._socket.unref(),t.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=function(e){return t.onData(e.data)},this.ws.onerror=function(e){return t.onError("websocket error",e)}}},{key:"write",value:function(t){var n=this;this.writable=!1;for(var r=t.length,i=0,o=r;i<o;i++)!function(t){u.encodePacket(t,n.supportsBinary,(function(i){var o={};p||(t.options&&(o.compress=t.options.compress),n.opts.perMessageDeflate&&("string"===typeof i?e.byteLength(i):i.length)<n.opts.perMessageDeflate.threshold&&(o.compress=!1));try{p?n.ws.send(i):n.ws.send(i,o)}catch(s){m("websocket closed before onclose event")}--r||a()}))}(t[i]);function a(){n.emit("flush"),setTimeout((function(){n.writable=!0,n.emit("drain")}),0)}}},{key:"onClose",value:function(){s.prototype.onClose.call(this)}},{key:"doClose",value:function(){"undefined"!==typeof this.ws&&(this.ws.close(),this.ws=null)}},{key:"uri",value:function(){var t=this.query||{},e=this.opts.secure?"wss":"ws",n="";return this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=l()),this.supportsBinary||(t.b64=1),(t=c.encode(t)).length&&(t="?"+t),e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+t}},{key:"check",value:function(){return!!d&&!("__initialize"in d&&this.name===f.prototype.name)}
2}]),f}(s);t.exports=y}).call(this,n(121).Buffer)},function(t,e,n){"use strict";(function(t){var r=n(122),i=n(123),o=n(124);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,e,n);if("number"===typeof t){if("string"===typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"===typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"===typeof e?function(t,e,n){"string"===typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|d(e.length);return 0===(t=s(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!==typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!==typeof e.length||(r=e.length)!==r?s(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!==typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=s(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|d(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return V(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return C(this,e,n);case"latin1":case"binary":return M(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"===typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;
vendor: 10,906 bytes, line 2
2o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(c(t,o+f)!==c(e,f)){h=!1;break}if(h)return o}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function _(t,e,n,r){return H(V(e,t.length-n),t,n,r)}function w(t,e,n,r){return H(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return w(t,e,n,r)}function T(t,e,n,r){return H(z(e),t,n,r)}function E(t,e,n,r){return H(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(n=t.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128===(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=k));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?s(t,e):void 0!==n?"string"===typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?O(this,0,t):v.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=t.slice(e,n),h=0;h<s;++h)if(c[h]!==l[h]){o=c[h],a=l[h];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"===typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return x(this,t,e,n);case"base64":return T(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function C(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function M(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function A(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=B(t[o]);return i}function I(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function j(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function R(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function L(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(t,e,n,r,o){return o||L(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function F(t,e,n,r,o){return o||L(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||j(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||j(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||j(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||j(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||j(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||j(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||j(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||j(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>
vendor: 4,717 bytes, line 2
28,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return D(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return D(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},u.prototype.fill=function(t,e,n,r){if("string"===typeof t){if("string"===typeof e?(r=e,e=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"===typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=u.isBuffer(t)?t:V(new u(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function H(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(45))},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],s=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),l=0,h=s>
20?a-4:a;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(l(t,s,s+a>u?u:s+a));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+d]=255&a,d+=p,a/=256,c-=8);t[n+d-p]|=128*v}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){var r=n(49);t.exports={WebSocket:r.WebSocket||r.MozWebSocket,usingBrowserWebSocket:!0,defaultBinaryType:"arraybuffer"}},function(t,e,n){var r=n(65);t.exports=function(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=r(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reconstructPacket=e.deconstructPacket=void 0;var r=n(75);function i(t,e){if(!t)return t;if(r.isBinary(t)){var n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){for(var o=new Array(t.length),a=0;a<t.length;a++)o[a]=i(t[a],e);return o}if("object"===typeof t&&!(t instanceof Date)){var s={};for(var u in t)t.hasOwnProperty(u)&&(s[u]=i(t[u],e));return s}return t}function o(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]=o(t[n],e);else if("object"===typeof t)for(var r in t)t.hasOwnProperty(r)&&(t[r]=o(t[r],e));return t}e.deconstructPacket=function(t){var e=[],n=t.data,r=t;return r.data=i(n,e),r.attachments=e.length,{packet:r,buffers:e}},e.reconstructPacket=function(t,e){return t.data=o(t.data,e),t.attachments=void 0,t}},function(t,e){function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,h=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function x(t){if("object"===typeof t&&null!==t){var e=t.$$typeof;switch(e){case i:switch(t=t.type){case h:case f:case a:case u:case s:case p:return t;default:switch(t=t&&t.$$typeof){case l:case d:case g:case m:case c:return t;default:return e}}case o:return e}}}function T(t){return x(t)===f}e.AsyncMode=h,e.ConcurrentMode=f,e.ContextConsumer=l,e.ContextProvider=c,e.Element=i,e.ForwardRef=d,e.Fragment=a,e.Lazy=g,e.Memo=m,e.Portal=o,e.Profiler=u,e.StrictMode=s,e.Suspense=p,e.isAsyncMode=function(t){return T(t)||x(t)===h},e.isConcurrentMode=T,e.isContextConsumer=function(t){return x(t)===l},e.isContextProvider=function(t){return x(t)===c},e.isElement=function(t){return"object"===typeof t&&null!==t&&t.$$typeof===i},e.isForwardRef=function(t){return x(t)===d},e.isFragment=function(t){return x(t)===a},e.isLazy=function(t){return x(t)===g},e.isMemo=function(t){return x(t)===m},e.isPortal=function(t){return x(t)===o},e.isProfiler=function(t){return x(t)===u},e.isStrictMode=function(t){return x(t)===s},e.isSuspense=function(t){return x(t)===p},e.isValidElementType=function(t){return"string"===typeof t||"function"===typeof t||t===a||t===f||t===u||t===s||t===p||t===v||"object"===typeof t&&null!==t&&(t.$$typeof===g||t.$$typeof===m||t.$$typeof===c||t.$$typeof===l||t.$$typeof===d||t.$$typeof===b||t.$$typeof===_||t.$$typeof===w||t.$$typeof===y)},e.typeOf=x},,,function(t,e,n){var r=n(134),i=n(135),o=n(136),a=n(138);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}
2,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(137);t.exports=function(t,e){if(t){if("string"===typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}
2,t.exports.default=t.exports,t.exports.__esModule=!0},,,,,,,,function(t,e,n){"use strict";(function(t,e){var r=n(15),i=n(0),o=n(7),a=n(21),s=n(22),u=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),Object(o.J)(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:Object(o.D)(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),c=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return Object(o.k)(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),l=function(t){try{if("undefined"!==typeof window&&"undefined"!==typeof window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new u(e)}}catch(n){}return new c},h=l("localStorage"),f=l("sessionStorage"),d=new a.b("@firebase/database"),p=function(){var t=1;return function(){return t++}}(),v=function(t){var e=Object(o.I)(t),n=new o.d;n.update(e);var r=n.digest();return o.h.encodeByteArray(r)},m=function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r="",i=0;i<e.length;i++){var a=e[i];Array.isArray(a)||a&&"object"===typeof a&&"number"===typeof a.length?r+=t.apply(null,a):r+="object"===typeof a?Object(o.J)(a):a,r+=" "}return r},g=null,y=!0,b=function(t,e){Object(o.f)(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(d.logLevel=a.a.VERBOSE,g=d.log.bind(d),e&&f.set("logging_enabled",!0)):"function"===typeof t?g=t:(g=null,f.remove("logging_enabled"))},_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===y&&(y=!1,null===g&&!0===f.get("logging_enabled")&&b(!0)),g){var n=m.apply(null,t);g(n)}},w=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];_.apply(void 0,Object(i.f)([t],Object(i.e)(e)))}},x=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE INTERNAL ERROR: "+m.apply(void 0,Object(i.f)([],Object(i.e)(t)));d.error(n)},T=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE FATAL ERROR: "+m.apply(void 0,Object(i.f)([],Object(i.e)(t)));throw d.error(n),new Error(n)},E=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE WARNING: "+m.apply(void 0,Object(i.f)([],Object(i.e)(t)));d.warn(n)},S=function(t){return"number"===typeof t&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},O="[MIN_NAME]",k="[MAX_NAME]",C=function(t,e){if(t===e)return 0;if(t===O||e===k)return-1;if(e===O||t===k)return 1;var n=F(t),r=F(e);return null!==n?null!==r?n-r===0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},M=function(t,e){return t===e?0:t<e?-1:1},A=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+Object(o.J)(e))},I=function t(e){if("object"!==typeof e||null===e)return Object(o.J)(e);var n=[];for(var r in e)n.push(r);n.sort();for(var i="{",a=0;a<n.length;a++)0!==a&&(i+=","),i+=Object(o.J)(n[a]),i+=":",i+=t(e[n[a]]);return i+="}"},j=function(t,e){var n=t.length;if(n<=e)return[t];for(var r=[],i=0;i<n;i+=e)i+e>n?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r};function P(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var R=function(t){Object(o.f)(!S(t),"Invalid JSON number");var e,n,r,i,a,s=1023;0===t?(n=0,r=0,e=1/t===-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),s))+s,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074))));var u=[];for(a=52;a;a-=1)u.push(r%2?1:0),r=Math.floor(r/2);for(a=11;a;a-=1)u.push(n%2?1:0),n=Math.floor(n/2);u.push(e?1:0),u.reverse();var c=u.join(""),l="";for(a=0;a<64;a+=8){var h=parseInt(c.substr(a,8),2).toString(16);1===h.length&&(h="0"+h),l+=h}return l.toLowerCase()},N=new RegExp("^-?(0*)\\d{1,10}$"),L=-2147483648,D=2147483647,F=function(t){if(N.test(t)){var e=Number(t);if(e>=L&&e<=D)return e}return null},U=function(t){try{t()}catch(e){setTimeout((function(){var t=e.stack||"";throw E("Exception was thrown by user callback.",t),e}),Math.floor(0))}},B=function(t,e){var n=setTimeout(t,e);return"object"===typeof n&&n.unref&&n.unref(),n},V=function(){function t(t,e){if(void 0===e){this.pieces_=t.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}return t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"},t}();function z(){return new V("")}function H(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function q(t){return t.pieces_.length-t.pieceNum_}function W(t){var e=t.pieceNum_;return e<t.pieces_.length&&e++,new V(t.pieces_,e)}function G(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function Y(t){for(var e="",n=t.pieceNum_;n<t.pieces_.length;n++)""!==t.pieces_[n]&&(e+="/"+encodeURIComponent(String(t.pieces_[n])));return e||"/"}function X(t,e){return void 0===e&&(e=0),t.pieces_.slice(t.pieceNum_+e)}function K(t){if(t.pieceNum_>=t.pieces_.length)return null;for(var e=[],n=t.pieceNum_;n<t.pieces_.length-1;n++)e.push(t.pieces_[n]);return new V(e,0)}function Q(t,e){for(var n=[],r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);if(e instanceof V)for(r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{var i=e.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new V(n,0)}function J(t){return t.pieceNum_>=t.pieces_.length}function Z(t,e){var n=H(t),r=H(e);if(null===n)return e;if(n===r)return Z(W(t),W(e));
2throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function $(t,e){for(var n=X(t,0),r=X(e,0),i=0;i<n.length&&i<r.length;i++){var o=C(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1}function tt(t,e){if(q(t)!==q(e))return!1;for(var n=t.pieceNum_,r=e.pieceNum_;n<=t.pieces_.length;n++,r++)if(t.pieces_[n]!==e.pieces_[r])return!1;return!0}function et(t,e){var n=t.pieceNum_,r=e.pieceNum_;if(q(t)>q(e))return!1;for(;n<t.pieces_.length;){if(t.pieces_[n]!==e.pieces_[r])return!1;++n,++r}return!0}var nt=function(t,e){this.errorPrefix_=e,this.parts_=X(t,0),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=Object(o.H)(this.parts_[n]);rt(this)};function rt(t){if(t.byteLength_>768)throw new Error(t.errorPrefix_+"has a key path longer than 768 bytes ("+t.byteLength_+").");if(t.parts_.length>32)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+it(t))}function it(t){return 0===t.parts_.length?"":"in property '"+t.parts_.join(".")+"'"}var ot="5",at=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,st="websocket",ut="long_polling",ct=function(){function t(t,e,n,r,i,o,a){void 0===i&&(i=!1),void 0===o&&(o=""),void 0===a&&(a=!1),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this._host=t.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=h.get("host:"+t)||this._host}return t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain},Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&h.set("host:"+this._host,this.internalHost))},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){var t=this.secure?"https://":"http://",e=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return""+t+this.host+"/"+e},t}();function lt(t,e,n){var r;if(Object(o.f)("string"===typeof e,"typeof type must == string"),Object(o.f)("object"===typeof n,"typeof params must == object"),e===st)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else{if(e!==ut)throw new Error("Unknown connection type: "+e);r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?"}(function(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams})(t)&&(n.ns=t.namespace);var i=[];return P(n,(function(t,e){i.push(t+"="+e)})),r+i.join("&")}var ht,ft=function(t,e){var n=dt(t),r=n.namespace;"firebase.com"===n.domain&&T(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||T("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&E("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new ct(n.host,n.secure,r,e,i,"",r!==n.subdomain),path:new V(n.pathString)}},dt=function(t){var e="",n="",r="",o="",a="",s=!0,u="https",c=443;if("string"===typeof t){var l=t.indexOf("//");l>=0&&(u=t.substring(0,l-1),t=t.substring(l+2));var h=t.indexOf("/");-1===h&&(h=t.length);var f=t.indexOf("?");-1===f&&(f=t.length),e=t.substring(0,Math.min(h,f)),h<f&&(o=function(t){for(var e="",n=t.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}e+="/"+i}return e}(t.substring(h,f)));var d=function(t){var e,n,r={};"?"===t.charAt(0)&&(t=t.substring(1));try{for(var o=Object(i.g)(t.split("&")),a=o.next();!a.done;a=o.next()){var s=a.value;if(0!==s.length){var u=s.split("=");
22===u.length?r[decodeURIComponent(u[0])]=decodeURIComponent(u[1]):E("Invalid query segment '"+s+"' in query '"+t+"'")}}}catch(c){e={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}(t.substring(Math.min(t.length,f)));(l=e.indexOf(":"))>=0?(s="https"===u||"wss"===u,c=parseInt(e.substring(l+1),10)):l=e.length;var p=e.slice(0,l);if("localhost"===p.toLowerCase())n="localhost";else if(p.split(".").length<=2)n=p;else{var v=e.indexOf(".");r=e.substring(0,v).toLowerCase(),n=e.substring(v+1),a=r}"ns"in d&&(a=d.ns)}return{host:e,port:c,domain:n,subdomain:r,secure:s,scheme:u,pathString:o,namespace:a}},pt=/[\[\].#$\/\u0000-\u001F\u007F]/,vt=/[\[\].#$\u0000-\u001F\u007F]/,mt=10485760,gt=function(t){return"string"===typeof t&&0!==t.length&&!pt.test(t)},yt=function(t){return"string"===typeof t&&0!==t.length&&!vt.test(t)},bt=function(t){return null===t||"string"===typeof t||"number"===typeof t&&!S(t)||t&&"object"===typeof t&&Object(o.k)(t,".sv")},_t=function(t,e,n,r,i){i&&void 0===n||wt(Object(o.o)(t,e,i),n,r)},wt=function t(e,n,r){var i=r instanceof V?new nt(r,e):r;if(void 0===n)throw new Error(e+"contains undefined "+it(i));if("function"===typeof n)throw new Error(e+"contains a function "+it(i)+" with contents = "+n.toString());if(S(n))throw new Error(e+"contains "+n.toString()+" "+it(i));if("string"===typeof n&&n.length>mt/3&&Object(o.H)(n)>mt)throw new Error(e+"contains a string greater than "+"10485760 utf8 bytes "+it(i)+" ('"+n.substring(0,50)+"...')");if(n&&"object"===typeof n){var a=!1,s=!1;if(P(n,(function(n,r){if(".value"===n)a=!0;else if(".priority"!==n&&".sv"!==n&&(s=!0,!gt(n)))throw new Error(e+" contains an invalid key ("+n+") "+it(i)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');var u,c;c=n,(u=i).parts_.length>0&&(u.byteLength_+=1),u.parts_.push(c),u.byteLength_+=Object(o.H)(c),rt(u),t(e,r,i),function(t){var e=t.parts_.pop();t.byteLength_-=Object(o.H)(e),t.parts_.length>0&&(t.byteLength_-=1)}(i)})),a&&s)throw new Error(e+' contains ".value" child '+it(i)+" in addition to actual children.")}},xt=function(t,e,n,r,i){if(!i||void 0!==n){var a=Object(o.o)(t,e,i);if(!n||"object"!==typeof n||Array.isArray(n))throw new Error(a+" must be an object containing the children to replace.");var s=[];P(n,(function(t,e){var n=new V(t);if(wt(a,e,Q(r,n)),".priority"===G(n)&&!bt(e))throw new Error(a+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");s.push(n)})),function(t,e){var n,r;for(n=0;n<e.length;n++)for(var i=X(r=e[n]),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!gt(i[o]))throw new Error(t+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');e.sort($);var a=null;for(n=0;n<e.length;n++){if(r=e[n],null!==a&&et(a,r))throw new Error(t+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}}(a,s)}},Tt=function(t,e,n,r){if(!r||void 0!==n){if(S(n))throw new Error(Object(o.o)(t,e,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!bt(n))throw new Error(Object(o.o)(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},Et=function(t,e,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(Object(o.o)(t,e,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},St=function(t,e,n,r){if((!r||void 0!==n)&&!gt(n))throw new Error(Object(o.o)(t,e,r)+'was an invalid key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},Ot=function(t,e,n,r){if((!r||void 0!==n)&&!yt(n))throw new Error(Object(o.o)(t,e,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},kt=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),Ot(t,e,n,r)},Ct=function(t,e){if(".info"===H(e))throw new Error(t+" failed = Can't modify data under /.info/")},Mt=function(t,e,n){var r=n.path.toString();if("string"!==typeof n.repoInfo.host||0===n.repoInfo.host.length||!gt(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),yt(t)}(r))throw new Error(Object(o.o)(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},At=function(t,e,n,r){if((!r||void 0!==n)&&"boolean"!==typeof n)throw new Error(Object(o.o)(t,e,r)+"must be a boolean.")};var It,jt,Pt,Rt=function(t){return"number"===typeof t?"number:"+R(t):"string:"+t},Nt=function(t){if(t.isLeafNode()){var e=t.val();Object(o.f)("string"===typeof e||"number"===typeof e||"object"===typeof e&&Object(o.k)(e,".sv"),"Priority must be a string or number.")}else Object(o.f)(t===ht||t.isEmpty(),"priority of unexpected type.");
2Object(o.f)(t===ht||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Lt=function(){function t(e,n){void 0===n&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,Object(o.f)(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Nt(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return It},set:function(t){It=t},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return J(e)?this:".priority"===H(e)?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var r=H(e);return null===r?n:n.isEmpty()&&".priority"!==r?this:(Object(o.f)(".priority"!==r||1===q(e),".priority must be the last token in a path"),this.updateImmediateChild(r,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(W(e),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+Rt(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?R(this.value_):this.value_,this.lazyHash_=v(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(Object(o.f)(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=typeof e.value_,r=typeof this.value_,i=t.VALUE_TYPE_ORDER.indexOf(n),a=t.VALUE_TYPE_ORDER.indexOf(r);return Object(o.f)(i>=0,"Unknown leaf type: "+n),Object(o.f)(a>=0,"Unknown leaf type: "+r),i===a?"object"===r?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:a-i},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode()){var e=t;return this.value_===e.value_&&this.priorityNode_.equals(e.priorityNode_)}return!1},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}(),Dt=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?n(t.key,e):1,r&&(o*=-1),o<0)t=this.isReverse_?t.left:t.right;else{if(0===o){this.nodeStack_.push(t);break}this.nodeStack_.push(t),t=this.isReverse_?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var t,e=this.nodeStack_.pop();if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t},t.prototype.hasNext=function(){return this.nodeStack_.length>0},t.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),Ft=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:Bt.EMPTY_NODE,this.right=null!=o?o:Bt.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,
2null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return Bt.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var n,r;if(e(t,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return Bt.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t},t.prototype.moveRedLeft_=function(){var t=this.colorFlip_();return t.right.left.isRed_()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight_())).rotateLeft_()).colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=(t=t.rotateRight_()).colorFlip_()),t},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth_=function(){var t=this.check_();return Math.pow(2,t)<=this.count()+1},t.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");
2if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),Ut=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new Ft(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),Bt=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,Ft.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Ft.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.root_;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.root_,r=null;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(t){return this.root_.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new Dt(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new Dt(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new Dt(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new Dt(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new Ut,t}(),Vt=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),zt=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new Vt(O,t),r=new Vt(O,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return Vt.MIN},t}();var Ht,qt,Wt,Gt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.compare=function(t,e){var n=t.node.getPriority(),r=e.node.getPriority(),i=n.compareTo(r);return 0===i?C(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return Vt.MIN},e.prototype.maxPost=function(){return new Vt(k,new Lt("[PRIORITY-POST]",Pt))},e.prototype.makePost=function(t,e){var n=jt(t);return new Vt(e,new Lt("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(zt)),Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return Ht},set:function(t){Ht=t},enumerable:!1,configurable:!0}),e.prototype.compare=function(t,e){return C(t.name,e.name)},e.prototype.isDefinedOn=function(t){throw Object(o.g)("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return Vt.MIN},e.prototype.maxPost=function(){return new Vt(k,Ht)},e.prototype.makePost=function(t,e){return Object(o.f)("string"===typeof t,"KeyIndex indexValue must always be a string."),new Vt(t,Ht)},e.prototype.toString=function(){return".key"},e}(zt),Xt=new Yt,Kt=Math.log(2),Qt=function(){function t(t){var e;this.count=(e=t+1,parseInt(Math.log(e)/Kt,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=t+1&r}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}
2(),Jt=function(t,e,n,r){t.sort(e);var i=function e(r,i){var o,a,s=i-r;if(0===s)return null;if(1===s)return o=t[r],a=n?n(o):o,new Ft(a,o.node,Ft.BLACK,null,null);var u=parseInt(s/2,10)+r,c=e(r,u),l=e(u+1,i);return o=t[u],a=n?n(o):o,new Ft(a,o.node,Ft.BLACK,c,l)},o=function(e){for(var r=null,o=null,a=t.length,s=function(e,r){var o=a-e,s=a;a-=e;var c=i(o+1,s),l=t[o],h=n?n(l):l;u(new Ft(h,l.node,r,null,c))},u=function(t){r?(r.left=t,r=t):(o=t,r=t)},c=0;c<e.count;++c){var l=e.nextBitIsOne(),h=Math.pow(2,e.count-(c+1));l?s(h,Ft.BLACK):(s(h,Ft.BLACK),s(h,Ft.RED))}return o}(new Qt(t.length));return new Bt(r||e,o)},Zt={},$t=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return Object(o.f)(Zt&&Gt,"ChildrenNode.ts has not been loaded"),qt=qt||new t({".priority":Zt},{".priority":Gt})},enumerable:!1,configurable:!0}),t.prototype.get=function(t){var e=Object(o.G)(this.indexes_,t);if(!e)throw new Error("No index defined for "+t);return e instanceof Bt?e:null},t.prototype.hasIndex=function(t){return Object(o.k)(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,n){Object(o.f)(e!==Xt,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,a=[],s=!1,u=n.getIterator(Vt.Wrap),c=u.getNext();c;)s=s||e.isDefinedOn(c.node),a.push(c),c=u.getNext();r=s?Jt(a,e.getCompare()):Zt;var l=e.toString(),h=Object(i.a)({},this.indexSet_);h[l]=e;var f=Object(i.a)({},this.indexes_);return f[l]=r,new t(f,h)},t.prototype.addToIndexes=function(e,n){var r=this;return new t(Object(o.E)(this.indexes_,(function(t,i){var a=Object(o.G)(r.indexSet_,i);if(Object(o.f)(a,"Missing index implementation for "+i),t===Zt){if(a.isDefinedOn(e.node)){for(var s=[],u=n.getIterator(Vt.Wrap),c=u.getNext();c;)c.name!==e.name&&s.push(c),c=u.getNext();return s.push(e),Jt(s,a.getCompare())}return Zt}var l=n.get(e.name),h=t;return l&&(h=h.remove(new Vt(e.name,l))),h.insert(e,e.node)})),this.indexSet_)},t.prototype.removeFromIndexes=function(e,n){return new t(Object(o.E)(this.indexes_,(function(t){if(t===Zt)return t;var r=n.get(e.name);return r?t.remove(new Vt(e.name,r)):t})),this.indexSet_)},t}();function te(t,e){return C(t.name,e.name)}function ee(t,e){return C(t,e)}var ne=function(){function t(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Nt(this.priorityNode_),this.children_.isEmpty()&&Object(o.f)(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return Wt||(Wt=new t(new Bt(ee),null,$t.Default))},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||Wt},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.children_.get(t);return null===e?Wt:e},t.prototype.getChild=function(t){var e=H(t);return null===e?this:this.getImmediateChild(e).getChild(W(t))},t.prototype.hasChild=function(t){return null!==this.children_.get(t)},t.prototype.updateImmediateChild=function(e,n){if(Object(o.f)(n,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(n);var r=new Vt(e,n),i=void 0,a=void 0;n.isEmpty()?(i=this.children_.remove(e),a=this.indexMap_.removeFromIndexes(r,this.children_)):(i=this.children_.insert(e,n),a=this.indexMap_.addToIndexes(r,this.children_));var s=i.isEmpty()?Wt:this.priorityNode_;return new t(i,s,a)},t.prototype.updateChild=function(t,e){var n=H(t);if(null===n)return e;Object(o.f)(".priority"!==H(t)||1===q(t),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(W(t),e);return this.updateImmediateChild(n,r)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(Gt,(function(a,s){n[a]=s.val(e),r++,o&&t.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1})),!e&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}
2return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.getPriority().isEmpty()||(t+="priority:"+Rt(this.getPriority().val())+":"),this.forEachChild(Gt,(function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)})),this.lazyHash_=""===t?"":v(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new Vt(t,e));return i?i.name:null}return this.children_.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.minKey();return n&&n.name}return this.children_.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new Vt(e,this.children_.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.maxKey();return n&&n.name}return this.children_.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new Vt(e,this.children_.get(e)):null},t.prototype.forEachChild=function(t,e){var n=this.resolveIndex_(t);return n?n.inorderTraversal((function(t){return e(t.name,t.node)})):this.children_.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},t.prototype.getIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getIteratorFrom(t.name,Vt.Wrap),i=r.peek();null!=i&&e.compare(i,t)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getReverseIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getReverseIteratorFrom(t.name,Vt.Wrap),i=r.peek();null!=i&&e.compare(i,t)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===re?-1:0},t.prototype.withIndex=function(e){if(e===Xt||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(t){return t===Xt||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var n=this.getIterator(Gt),r=e.getIterator(Gt),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},t.prototype.resolveIndex_=function(t){return t===Xt?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),re=new(function(t){function e(){return t.call(this,new Bt(ee),ne.EMPTY_NODE,$t.Default)||this}return Object(i.c)(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return ne.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(ne));Object.defineProperties(Vt,{MIN:{value:new Vt(O,ne.EMPTY_NODE)},MAX:{value:new Vt(k,re)}}),Yt.__EMPTY_NODE=ne.EMPTY_NODE,Lt.__childrenNodeConstructor=ne,ht=re,function(t){Pt=t}(re);var ie;function oe(t,e){if(void 0===e&&(e=null),null===t)return ne.EMPTY_NODE;if("object"===typeof t&&".priority"in t&&(e=t[".priority"]),Object(o.f)(null===e||"string"===typeof e||"number"===typeof e||"object"===typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"===typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!==typeof t||".sv"in t)return new Lt(t,oe(e));if(t instanceof Array){var n=ne.EMPTY_NODE;return P(t,(function(e,r){if(Object(o.k)(t,e)&&"."!==e.substring(0,1)){var i=oe(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(e,i))}})),n.updatePriority(oe(e))}var r=[],i=!1;if(P(t,(function(t,e){if("."!==t.substring(0,1)){var n=oe(e);
2n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new Vt(t,n)))}})),0===r.length)return ne.EMPTY_NODE;var a=Jt(r,te,(function(t){return t.name}),ee);if(i){var s=Jt(r,Gt.getCompare());return new ne(a,oe(e),new $t({".priority":s},{".priority":Gt}))}return new ne(a,oe(e),$t.Default)}function ae(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}!function(t){jt=t}(oe),function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(ie||(ie={}));var se,ue=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=ie.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}return t.prototype.operationForChild=function(e){if(J(this.path)){if(null!=this.affectedTree.value)return Object(o.f)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new V(e));return new t(z(),n,this.revert)}return Object(o.f)(H(this.path)===e,"operationForChild called for unrelated child."),new t(W(this.path),this.affectedTree,this.revert)},t}(),ce=function(){function t(t,e){void 0===e&&(se||(se=new Bt(M)),e=se),this.value=t,this.children=e}return t.fromObject=function(e){var n=new t(null);return P(e,(function(t,e){n=n.set(new V(t),e)})),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:z(),value:this.value};if(J(t))return null;var n=H(t),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(W(t),e);return null!=i?{path:Q(new V(n),i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,(function(){return!0}))},t.prototype.subtree=function(e){if(J(e))return this;var n=H(e),r=this.children.get(n);return null!==r?r.subtree(W(e)):new t(null)},t.prototype.set=function(e,n){if(J(e))return new t(n,this.children);var r=H(e),i=(this.children.get(r)||new t(null)).set(W(e),n),o=this.children.insert(r,i);return new t(this.value,o)},t.prototype.remove=function(e){if(J(e))return this.children.isEmpty()?new t(null):new t(null,this.children);var n=H(e),r=this.children.get(n);if(r){var i=r.remove(W(e)),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?new t(null):new t(this.value,o)}return this},t.prototype.get=function(t){if(J(t))return this.value;var e=H(t),n=this.children.get(e);return n?n.get(W(t)):null},t.prototype.setTree=function(e,n){if(J(e))return n;var r=H(e),i=(this.children.get(r)||new t(null)).setTree(W(e),n),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new t(this.value,o)},t.prototype.fold=function(t){return this.fold_(z(),t)},t.prototype.fold_=function(t,e){var n={};return this.children.inorderTraversal((function(r,i){n[r]=i.fold_(Q(t,r),e)})),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,z(),e)},t.prototype.findOnPath_=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(J(t))return null;var i=H(t),o=this.children.get(i);return o?o.findOnPath_(W(t),Q(e,i),n):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,z(),e)},t.prototype.foreachOnPath_=function(e,n,r){if(J(e))return this;this.value&&r(n,this.value);var i=H(e),o=this.children.get(i);return o?o.foreachOnPath_(W(e),Q(n,i),r):new t(null)},t.prototype.foreach=function(t){this.foreach_(z(),t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal((function(n,r){r.foreach_(Q(t,n),e)})),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal((function(e,n){
2n.value&&t(e,n.value)}))},t}(),le=function(){function t(t,e){this.source=t,this.path=e,this.type=ie.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return J(this.path)?new t(this.source,z()):new t(this.source,W(this.path))},t}(),he=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=ie.OVERWRITE}return t.prototype.operationForChild=function(e){return J(this.path)?new t(this.source,z(),this.snap.getImmediateChild(e)):new t(this.source,W(this.path),this.snap)},t}(),fe=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=ie.MERGE}return t.prototype.operationForChild=function(e){if(J(this.path)){var n=this.children.subtree(new V(e));return n.isEmpty()?null:n.value?new he(this.source,z(),n.value):new t(this.source,z(),n)}return Object(o.f)(H(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,W(this.path),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),de=function(){function t(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(J(t))return this.isFullyInitialized()&&!this.filtered_;var e=H(t);return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),pe=function(){function t(t,e){this.eventCache_=t,this.serverCache_=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new de(e,n,r),this.serverCache_)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.eventCache_,new de(e,n,r))},t.prototype.getEventCache=function(){return this.eventCache_},t.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},t.prototype.getServerCache=function(){return this.serverCache_},t.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},t}();function ve(t){return{type:"value",snapshotNode:t}}function me(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function ge(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function ye(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}var be=function(){function t(t){this.index_=t}return t.prototype.updateChild=function(t,e,n,r,i,a){Object(o.f)(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");var s=t.getImmediateChild(e);return s.getChild(r).equals(n.getChild(r))&&s.isEmpty()===n.isEmpty()?t:(null!=a&&(n.isEmpty()?t.hasChild(e)?a.trackChildChange(ge(e,s)):Object(o.f)(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):s.isEmpty()?a.trackChildChange(me(e,n)):a.trackChildChange(ye(e,n,s))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.index_))},t.prototype.updateFullNode=function(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(Gt,(function(t,r){e.hasChild(t)||n.trackChildChange(ge(t,r))})),e.isLeafNode()||e.forEachChild(Gt,(function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(ye(e,r,i))}else n.trackChildChange(me(e,r))}))),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?ne.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.index_},t}(),_e=function(){function t(){this.changeMap=new Map}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;Object(o.f)("child_added"===e||"child_changed"===e||"child_removed"===e,"Only child changes supported for tracking"),Object(o.f)(".priority"!==n,"Only non-priority child changes can be tracked.");var r=this.changeMap.get(n);if(r){var i=r.type;if("child_added"===e&&"child_removed"===i)this.changeMap.set(n,ye(n,t.snapshotNode,r.snapshotNode));else if("child_removed"===e&&"child_added"===i)this.changeMap.delete(n);else if("child_removed"===e&&"child_changed"===i)this.changeMap.set(n,ge(n,r.oldSnap));else if("child_changed"===e&&"child_added"===i)this.changeMap.set(n,me(n,t.snapshotNode));else{if("child_changed"!==e||"child_changed"!==i)throw Object(o.g)("Illegal combination of changes: "+t+" occurred after "+r);this.changeMap.set(n,ye(n,t.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,t)},t.prototype.getChanges=function(){return Array.from(this.changeMap.values())},t}(),we=new(function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}()),xe=function(){function t(t,e,n){void 0===n&&(n=null),this.writes_=t,this.viewCache_=e,this.optCompleteServerCache_=n}return t.prototype.getCompleteChild=function(t){var e=this.viewCache_.getEventCache();if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var n=null!=this.optCompleteServerCache_?new de(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(t,n)},t.prototype.getChildAfterChild=function(t,e,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,e,1,n,t);return 0===i.length?null:i[0]},t}(),Te=function(t,e){this.viewCache=t,this.changes=e},Ee=function(){function t(t){this.filter_=t}return t.prototype.assertIndexed=function(t){Object(o.f)(t.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),Object(o.f)(t.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},t.prototype.applyOperation=function(e,n,r,i){var a,s,u=new _e;if(n.type===ie.OVERWRITE){var c=n;c.source.fromUser?a=this.applyUserOverwrite_(e,c.path,c.snap,r,i,u):(Object(o.f)(c.source.fromServer,"Unknown source."),s=c.source.tagged||e.getServerCache().isFiltered()&&!J(c.path),a=this.applyServerOverwrite_(e,c.path,c.snap,r,i,s,u))}else if(n.type===ie.MERGE){var l=n;l.source.fromUser?a=this.applyUserMerge_(e,l.path,l.children,r,i,u):(Object(o.f)(l.source.fromServer,"Unknown source."),s=l.source.tagged||e.getServerCache().isFiltered(),a=this.applyServerMerge_(e,l.path,l.children,r,i,s,u))}else if(n.type===ie.ACK_USER_WRITE){var h=n;
2a=h.revert?this.revertUserWrite_(e,h.path,r,i,u):this.ackUserWrite_(e,h.path,h.affectedTree,r,i,u)}else{if(n.type!==ie.LISTEN_COMPLETE)throw Object(o.g)("Unknown operation type: "+n.type);a=this.listenComplete_(e,n.path,r,u)}var f=u.getChanges();return t.maybeAddValueEvent_(e,a,f),new Te(a,f)},t.maybeAddValueEvent_=function(t,e,n){var r=e.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=t.getCompleteEventSnap();(n.length>0||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(ve(e.getCompleteEventSnap()))}},t.prototype.generateEventCacheAfterServerEvent_=function(t,e,n,r,i){var a=t.getEventCache();if(null!=n.shadowingWrite(e))return t;var s=void 0,u=void 0;if(J(e))if(Object(o.f)(t.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),t.getServerCache().isFiltered()){var c=t.getCompleteServerSnap(),l=c instanceof ne?c:ne.EMPTY_NODE,h=n.calcCompleteEventChildren(l);s=this.filter_.updateFullNode(t.getEventCache().getNode(),h,i)}else{var f=n.calcCompleteEventCache(t.getCompleteServerSnap());s=this.filter_.updateFullNode(t.getEventCache().getNode(),f,i)}else{var d=H(e);if(".priority"===d){Object(o.f)(1===q(e),"Can't have a priority with additional path components");var p=a.getNode();u=t.getServerCache().getNode();var v=n.calcEventCacheAfterServerOverwrite(e,p,u);s=null!=v?this.filter_.updatePriority(p,v):a.getNode()}else{var m=W(e),g=void 0;if(a.isCompleteForChild(d)){u=t.getServerCache().getNode();var y=n.calcEventCacheAfterServerOverwrite(e,a.getNode(),u);g=null!=y?a.getNode().getImmediateChild(d).updateChild(m,y):a.getNode().getImmediateChild(d)}else g=n.calcCompleteChild(d,t.getServerCache());s=null!=g?this.filter_.updateChild(a.getNode(),d,g,m,r,i):a.getNode()}}return t.updateEventSnap(s,a.isFullyInitialized()||J(e),this.filter_.filtersNodes())},t.prototype.applyServerOverwrite_=function(t,e,n,r,i,o,a){var s,u=t.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(J(e))s=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var l=u.getNode().updateChild(e,n);s=c.updateFullNode(u.getNode(),l,null)}else{var h=H(e);if(!u.isCompleteForPath(e)&&q(e)>1)return t;var f=W(e),d=u.getNode().getImmediateChild(h).updateChild(f,n);s=".priority"===h?c.updatePriority(u.getNode(),d):c.updateChild(u.getNode(),h,d,f,we,null)}var p=t.updateServerSnap(s,u.isFullyInitialized()||J(e),c.filtersNodes()),v=new xe(r,p,i);return this.generateEventCacheAfterServerEvent_(p,e,r,v,a)},t.prototype.applyUserOverwrite_=function(t,e,n,r,i,o){var a,s,u=t.getEventCache(),c=new xe(r,t,i);if(J(e))s=this.filter_.updateFullNode(t.getEventCache().getNode(),n,o),a=t.updateEventSnap(s,!0,this.filter_.filtersNodes());else{var l=H(e);if(".priority"===l)s=this.filter_.updatePriority(t.getEventCache().getNode(),n),a=t.updateEventSnap(s,u.isFullyInitialized(),u.isFiltered());else{var h=W(e),f=u.getNode().getImmediateChild(l),d=void 0;if(J(h))d=n;else{var p=c.getCompleteChild(l);d=null!=p?".priority"===G(h)&&p.getChild(K(h)).isEmpty()?p:p.updateChild(h,n):ne.EMPTY_NODE}if(f.equals(d))a=t;else{var v=this.filter_.updateChild(u.getNode(),l,d,h,c,o);a=t.updateEventSnap(v,u.isFullyInitialized(),this.filter_.filtersNodes())}}}return a},t.cacheHasChild_=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.applyUserMerge_=function(e,n,r,i,o,a){var s=this,u=e;return r.foreach((function(r,c){var l=Q(n,r);t.cacheHasChild_(e,H(l))&&(u=s.applyUserOverwrite_(u,l,c,i,o,a))})),r.foreach((function(r,c){var l=Q(n,r);t.cacheHasChild_(e,H(l))||(u=s.applyUserOverwrite_(u,l,c,i,o,a))})),u},t.prototype.applyMerge_=function(t,e){return e.foreach((function(e,n){t=t.updateChild(e,n)})),t},t.prototype.applyServerMerge_=function(t,e,n,r,i,o,a){var s=this;if(t.getServerCache().getNode().isEmpty()&&!t.getServerCache().isFullyInitialized())return t;var u,c=t;u=J(e)?n:new ce(null).setTree(e,n);var l=t.getServerCache().getNode();return u.children.inorderTraversal((function(e,n){if(l.hasChild(e)){var u=t.getServerCache().getNode().getImmediateChild(e),h=s.applyMerge_(u,n);c=s.applyServerOverwrite_(c,new V(e),h,r,i,o,a)}})),u.children.inorderTraversal((function(e,n){var u=!t.getServerCache().isCompleteForChild(e)&&void 0===n.value;if(!l.hasChild(e)&&!u){var h=t.getServerCache().getNode().getImmediateChild(e),f=s.applyMerge_(h,n);c=s.applyServerOverwrite_(c,new V(e),f,r,i,o,a)}})),c},t.prototype.ackUserWrite_=function(t,e,n,r,i,o){if(null!=r.shadowingWrite(e))return t;var a=t.getServerCache().isFiltered(),s=t.getServerCache();if(null!=n.value){if(J(e)&&s.isFullyInitialized()||s.isCompleteForPath(e))return this.applyServerOverwrite_(t,e,s.getNode().getChild(e),r,i,a,o);if(J(e)){var u=new ce(null);
2return s.getNode().forEachChild(Xt,(function(t,e){u=u.set(new V(t),e)})),this.applyServerMerge_(t,e,u,r,i,a,o)}return t}var c=new ce(null);return n.foreach((function(t,n){var r=Q(e,t);s.isCompleteForPath(r)&&(c=c.set(t,s.getNode().getChild(r)))})),this.applyServerMerge_(t,e,c,r,i,a,o)},t.prototype.listenComplete_=function(t,e,n,r){var i=t.getServerCache(),o=t.updateServerSnap(i.getNode(),i.isFullyInitialized()||J(e),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,e,n,we,r)},t.prototype.revertUserWrite_=function(t,e,n,r,i){var a;if(null!=n.shadowingWrite(e))return t;var s=new xe(n,t,r),u=t.getEventCache().getNode(),c=void 0;if(J(e)||".priority"===H(e)){var l=void 0;if(t.getServerCache().isFullyInitialized())l=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var h=t.getServerCache().getNode();Object(o.f)(h instanceof ne,"serverChildren would be complete if leaf node"),l=n.calcCompleteEventChildren(h)}l=l,c=this.filter_.updateFullNode(u,l,i)}else{var f=H(e),d=n.calcCompleteChild(f,t.getServerCache());null==d&&t.getServerCache().isCompleteForChild(f)&&(d=u.getImmediateChild(f)),(c=null!=d?this.filter_.updateChild(u,f,d,W(e),s,i):t.getEventCache().getNode().hasChild(f)?this.filter_.updateChild(u,f,ne.EMPTY_NODE,W(e),s,i):u).isEmpty()&&t.getServerCache().isFullyInitialized()&&(a=n.calcCompleteEventCache(t.getCompleteServerSnap())).isLeafNode()&&(c=this.filter_.updateFullNode(c,a,i))}return a=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(z()),t.updateEventSnap(c,a,this.filter_.filtersNodes())},t}(),Se=function(t){this.query_=t,this.index_=this.query_.getQueryParams().getIndex()};function Oe(t,e,n,r,i,a){var s=r.filter((function(t){return t.type===n}));s.sort((function(e,n){return function(t,e,n){if(null==e.childName||null==n.childName)throw Object(o.g)("Should only compare child_ events.");var r=new Vt(e.childName,e.snapshotNode),i=new Vt(n.childName,n.snapshotNode);return t.index_.compare(r,i)}(t,e,n)})),s.forEach((function(n){var r=function(t,e,n){return"value"===e.type||"child_removed"===e.type||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}(t,n,a);i.forEach((function(i){i.respondsTo(n.type)&&e.push(i.createEvent(r,t.query_))}))}))}var ke="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",Ce=function(){var t=0,e=[];return function(n){var r,i=n===t;t=n;var a=new Array(8);for(r=7;r>=0;r--)a[r]=ke.charAt(n%64),n=Math.floor(n/64);Object(o.f)(0===n,"Cannot push at time == 0");var s=a.join("");if(i){for(r=11;r>=0&&63===e[r];r--)e[r]=0;e[r]++}else for(r=0;r<12;r++)e[r]=Math.floor(64*Math.random());for(r=0;r<12;r++)s+=ke.charAt(e[r]);return Object(o.f)(20===s.length,"nextPushId: Length should be 20."),s}}(),Me=function(t){if("2147483647"===t)return"-";var e=F(t);if(null!=e)return""+(e+1);for(var n=new Array(t.length),r=0;r<n.length;r++)n[r]=t.charAt(r);if(n.length<786)return n.push("-"),n.join("");for(var i=n.length-1;i>=0&&"z"===n[i];)i--;if(-1===i)return k;var o=n[i],a=ke.charAt(ke.indexOf(o)+1);return n[i]=a,n.slice(0,i+1).join("")},Ae=function(t){if("-2147483648"===t)return O;var e=F(t);if(null!=e)return""+(e-1);for(var n=new Array(t.length),r=0;r<n.length;r++)n[r]=t.charAt(r);return"-"===n[n.length-1]?1===n.length?"2147483647":(delete n[n.length-1],n.join("")):(n[n.length-1]=ke.charAt(ke.indexOf(n[n.length-1])-1),n.join("")+"z".repeat(786-n.length))},Ie=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?C(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return Vt.MIN},e.prototype.maxPost=function(){return Vt.MAX},e.prototype.makePost=function(t,e){var n=oe(t);return new Vt(e,n)},e.prototype.toString=function(){return".value"},e}(zt)),je=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,Object(o.f)(!J(e)&&".priority"!==H(e),"Can't create PathIndex with empty path or .priority key"),n}return Object(i.c)(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?C(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=oe(t),r=ne.EMPTY_NODE.updateChild(this.indexPath_,n);return new Vt(e,r)},e.prototype.maxPost=function(){var t=ne.EMPTY_NODE.updateChild(this.indexPath_,re);return new Vt(k,t)},e.prototype.toString=function(){return X(this.indexPath_,0).join("/")},e}
2(zt),Pe=function(){function t(e){this.indexedFilter_=new be(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e)}return t.prototype.getStartPost=function(){return this.startPost_},t.prototype.getEndPost=function(){return this.endPost_},t.prototype.matches=function(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,n,r,i,o){return this.matches(new Vt(e,n))||(n=ne.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=ne.EMPTY_NODE);var r=e.withIndex(this.index_);r=r.updatePriority(ne.EMPTY_NODE);var i=this;return e.forEachChild(Gt,(function(t,e){i.matches(new Vt(t,e))||(r=r.updateImmediateChild(t,ne.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.indexedFilter_},t.prototype.getIndex=function(){return this.index_},t.getStartPost_=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.getEndPost_=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}(),Re=function(){function t(t){this.rangedFilter_=new Pe(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,n,r,i,o){return this.rangedFilter_.matches(new Vt(e,n))||(n=ne.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,e,n,r,i,o):this.fullLimitUpdateChild_(t,e,n,i,o)},t.prototype.updateFullNode=function(t,e,n){var r;if(e.isLeafNode()||e.isEmpty())r=ne.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){r=ne.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):e.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var a=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(a.name,a.node),o++}}else{r=(r=e.withIndex(this.index_)).updatePriority(ne.EMPTY_NODE);var s=void 0,u=void 0,c=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),u=this.rangedFilter_.getStartPost();var l=this.index_.getCompare();c=function(t,e){return l(e,t)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),u=this.rangedFilter_.getEndPost(),c=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();){a=i.getNext();!h&&c(s,a)<=0&&(h=!0),h&&o<this.limit_&&c(a,u)<=0?o++:r=r.updateImmediateChild(a.name,ne.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},t.prototype.getIndex=function(){return this.index_},t.prototype.fullLimitUpdateChild_=function(t,e,n,r,i){var a;if(this.reverse_){var s=this.index_.getCompare();a=function(t,e){return s(e,t)}}else a=this.index_.getCompare();var u=t;Object(o.f)(u.numChildren()===this.limit_,"");var c=new Vt(e,n),l=this.reverse_?u.getFirstChild(this.index_):u.getLastChild(this.index_),h=this.rangedFilter_.matches(c);if(u.hasChild(e)){for(var f=u.getImmediateChild(e),d=r.getChildAfterChild(this.index_,l,this.reverse_);null!=d&&(d.name===e||u.hasChild(d.name));)d=r.getChildAfterChild(this.index_,d,this.reverse_);var p=null==d?1:a(d,c);if(h&&!n.isEmpty()&&p>=0)return null!=i&&i.trackChildChange(ye(e,n,f)),u.updateImmediateChild(e,n);null!=i&&i.trackChildChange(ge(e,f));var v=u.updateImmediateChild(e,ne.EMPTY_NODE);return null!=d&&this.rangedFilter_.matches(d)?(null!=i&&i.trackChildChange(me(d.name,d.node)),v.updateImmediateChild(d.name,d.node)):v}return n.isEmpty()?t:h&&a(l,c)>=0?(null!=i&&(i.trackChildChange(ge(l.name,l.node)),i.trackChildChange(me(e,n))),u.updateImmediateChild(e,n).updateImmediateChild(l.name,ne.EMPTY_NODE)):t},t}(),Ne=function(){function t(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Gt}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.hasStartAfter=function(){return this.startAfterSet_},t.prototype.hasEndBefore=function(){return this.endBeforeSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_},t.prototype.getIndexStartValue=function(){return Object(o.f)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return Object(o.f)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:O},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return Object(o.f)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return Object(o.f)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:k},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return Object(o.f)(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===Gt},t.prototype.copy=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t}();function Le(t,e){var n=t.copy();return n.limitSet_=!0,n.limit_=e,n.viewFrom_="l",n}function De(t,e){var n=t.copy();return n.limitSet_=!0,n.limit_=e,n.viewFrom_="r",n}function Fe(t,e,n){var r=t.copy();return r.startSet_=!0,void 0===e&&(e=null),r.indexStartValue_=e,null!=n?(r.startNameSet_=!0,r.indexStartName_=n):(r.startNameSet_=!1,r.indexStartName_=""),r}function Ue(t,e,n){var r;if(t.index_===Xt)"string"===typeof e&&(e=Me(e)),r=Fe(t,e,n);else{r=Fe(t,e,null==n?k:Me(n))}return r.startAfterSet_=!0,r}function Be(t,e,n){var r=t.copy();return r.endSet_=!0,void 0===e&&(e=null),r.indexEndValue_=e,void 0!==n?(r.endNameSet_=!0,r.indexEndName_=n):(r.endNameSet_=!1,r.indexEndName_=""),r}function Ve(t,e,n){var r;
2return t.index_===Xt?("string"===typeof e&&(e=Ae(e)),r=Be(t,e,n)):r=Be(t,e,null==n?O:Ae(n)),r.endBeforeSet_=!0,r}function ze(t,e){var n=t.copy();return n.index_=e,n}function He(t){var e,n={};return t.isDefault()||(t.index_===Gt?e="$priority":t.index_===Ie?e="$value":t.index_===Xt?e="$key":(Object(o.f)(t.index_ instanceof je,"Unrecognized index type!"),e=t.index_.toString()),n.orderBy=Object(o.J)(e),t.startSet_&&(n.startAt=Object(o.J)(t.indexStartValue_),t.startNameSet_&&(n.startAt+=","+Object(o.J)(t.indexStartName_))),t.endSet_&&(n.endAt=Object(o.J)(t.indexEndValue_),t.endNameSet_&&(n.endAt+=","+Object(o.J)(t.indexEndName_))),t.limitSet_&&(t.isViewFromLeft()?n.limitToFirst=t.limit_:n.limitToLast=t.limit_)),n}var qe,We=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n,r=this.query_.getQueryParams(),i=new be(r.getIndex()),o=(n=r).loadsAllData()?new be(n.getIndex()):n.hasLimit()?new Re(n):new Pe(n);this.processor_=new Ee(o);var a=e.getServerCache(),s=e.getEventCache(),u=i.updateFullNode(ne.EMPTY_NODE,a.getNode(),null),c=o.updateFullNode(ne.EMPTY_NODE,s.getNode(),null),l=new de(u,a.isFullyInitialized(),i.filtersNodes()),h=new de(c,s.isFullyInitialized(),o.filtersNodes());this.viewCache_=new pe(h,l),this.eventGenerator_=new Se(this.query_)}return t.prototype.getQuery=function(){return this.query_},t.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},t.prototype.getCompleteNode=function(){return this.viewCache_.getCompleteEventSnap()},t.prototype.getCompleteServerCache=function(t){var e=this.viewCache_.getCompleteServerSnap();return e&&(this.query_.getQueryParams().loadsAllData()||!J(t)&&!e.getImmediateChild(H(t)).isEmpty())?e.getChild(t):null},t.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},t.prototype.addEventRegistration=function(t){this.eventRegistrations_.push(t)},t.prototype.removeEventRegistration=function(t,e){var n=[];if(e){Object(o.f)(null==t,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach((function(t){var i=t.createCancelEvent(e,r);i&&n.push(i)}))}if(t){for(var i=[],a=0;a<this.eventRegistrations_.length;++a){var s=this.eventRegistrations_[a];if(s.matches(t)){if(t.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(a+1));break}}else i.push(s)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},t.prototype.applyOperation=function(t,e,n){t.type===ie.MERGE&&null!==t.source.queryId&&(Object(o.f)(this.viewCache_.getCompleteServerSnap(),"We should always have a full cache before handling merges"),Object(o.f)(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.viewCache_,i=this.processor_.applyOperation(r,t,e,n);return this.processor_.assertIndexed(i.viewCache),Object(o.f)(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=i.viewCache,this.generateEventsForChanges_(i.changes,i.viewCache.getEventCache().getNode(),null)},t.prototype.getInitialEvents=function(t){var e=this.viewCache_.getEventCache(),n=[];e.getNode().isLeafNode()||e.getNode().forEachChild(Gt,(function(t,e){n.push(me(t,e))}));return e.isFullyInitialized()&&n.push(ve(e.getNode())),this.generateEventsForChanges_(n,e.getNode(),t)},t.prototype.generateEventsForChanges_=function(t,e,n){var r=n?[n]:this.eventRegistrations_;return function(t,e,n,r){var i=[],o=[];return e.forEach((function(e){var n;"child_changed"===e.type&&t.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&o.push((n=e.childName,{type:"child_moved",snapshotNode:e.snapshotNode,childName:n}))})),Oe(t,i,"child_removed",e,r,n),Oe(t,i,"child_added",e,r,n),Oe(t,i,"child_moved",o,r,n),Oe(t,i,"child_changed",e,r,n),Oe(t,i,"value",e,r,n),i}(this.eventGenerator_,t,e,r)},t}(),Ge=function(){this.views=new Map};function Ye(t,e,n,r){var a,s,u=e.source.queryId;if(null!==u){var c=t.views.get(u);return Object(o.f)(null!=c,"SyncTree gave us an op for an invalid query."),c.applyOperation(e,n,r)}var l=[];try{for(var h=Object(i.g)(t.views.values()),f=h.next();!f.done;f=h.next()){c=f.value;l=l.concat(c.applyOperation(e,n,r))}}catch(d){a={error:d}}finally{try{f&&!f.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}return l}function Xe(t,e,n,r,i){var o=e.queryIdentifier(),a=t.views.get(o);if(!a){var s=n.calcCompleteEventCache(i?r:null),u=!1;s?u=!0:r instanceof ne?(s=n.calcCompleteEventChildren(r),u=!1):(s=ne.EMPTY_NODE,u=!1);var c=new pe(new de(s,u,!1),new de(r,i,!1));return new We(e,c)}return a}function Ke(t,e,n,r){var a,s,u=e.queryIdentifier(),c=[],l=[],h=tn(t);if("default"===u)try{for(var f=Object(i.g)(t.views.entries()),d=f.next();!d.done;d=f.next()){var p=Object(i.e)(d.value,2),v=p[0],m=p[1];l=l.concat(m.removeEventRegistration(n,r)),m.isEmpty()&&(t.views.delete(v),m.getQuery().getQueryParams().loadsAllData()||c.push(m.getQuery()))}}catch(g){a={error:g}}finally{try{d&&!d.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}else(m=t.views.get(u))&&(l=l.concat(m.removeEventRegistration(n,r)),m.isEmpty()&&(t.views.delete(u),m.getQuery().getQueryParams().loadsAllData()||c.push(m.getQuery())));return h&&!tn(t)&&c.push(new(Object(o.f)(qe,"Reference.ts has not been loaded"),qe)(e.repo,e.path)),{removed:c,events:l}}function Qe(t){var e,n,r=[];try{for(var o=Object(i.g)(t.views.values()),a=o.next();!a.done;a=o.next()){var s=a.value;s.getQuery().getQueryParams().loadsAllData()||r.push(s)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}function Je(t,e){var n,r,o=null;try{for(var a=Object(i.g)(t.views.values()),s=a.next();!s.done;s=a.next()){var u=s.value;o=o||u.getCompleteServerCache(e)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}function Ze(t,e){if(e.getQueryParams().loadsAllData())return en(t);var n=e.queryIdentifier();return t.views.get(n)}function $e(t,e){return null!=Ze(t,e)}function tn(t){return null!=en(t)}function en(t){var e,n;
2try{for(var r=Object(i.g)(t.views.values()),o=r.next();!o.done;o=r.next()){var a=o.value;if(a.getQuery().getQueryParams().loadsAllData())return a}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null}var nn=function(){function t(t){this.writeTree_=t}return t.empty=function(){return new t(new ce(null))},t}();function rn(t,e,n){if(J(e))return new nn(new ce(n));var r=t.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,a=Z(i,e);return o=o.updateChild(a,n),new nn(t.writeTree_.set(i,o))}var s=new ce(n),u=t.writeTree_.setTree(e,s);return new nn(u)}function on(t,e,n){var r=t;return P(n,(function(t,n){r=rn(r,Q(e,t),n)})),r}function an(t,e){if(J(e))return nn.empty();var n=t.writeTree_.setTree(e,new ce(null));return new nn(n)}function sn(t,e){return null!=un(t,e)}function un(t,e){var n=t.writeTree_.findRootMostValueAndPath(e);return null!=n?t.writeTree_.get(n.path).getChild(Z(n.path,e)):null}function cn(t){var e=[],n=t.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(Gt,(function(t,n){e.push(new Vt(t,n))})):t.writeTree_.children.inorderTraversal((function(t,n){null!=n.value&&e.push(new Vt(t,n.value))})),e}function ln(t,e){if(J(e))return t;var n=un(t,e);return new nn(null!=n?new ce(n):t.writeTree_.subtree(e))}function hn(t){return t.writeTree_.isEmpty()}function fn(t,e){return dn(z(),t.writeTree_,e)}function dn(t,e,n){if(null!=e.value)return n.updateChild(t,e.value);var r=null;return e.children.inorderTraversal((function(e,i){".priority"===e?(Object(o.f)(null!==i.value,"Priority writes must always be leaf nodes"),r=i.value):n=dn(Q(t,e),i,n)})),n.getChild(t).isEmpty()||null===r||(n=n.updateChild(Q(t,".priority"),r)),n}var pn=function(){function t(){this.visibleWrites_=nn.empty(),this.allWrites_=[],this.lastWriteId_=-1}return t.prototype.childWrites=function(t){return new vn(t,this)},t.prototype.addOverwrite=function(t,e,n,r){Object(o.f)(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:t,snap:e,writeId:n,visible:r}),r&&(this.visibleWrites_=rn(this.visibleWrites_,t,e)),this.lastWriteId_=n},t.prototype.addMerge=function(t,e,n){Object(o.f)(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:t,children:e,writeId:n,visible:!0}),this.visibleWrites_=on(this.visibleWrites_,t,e),this.lastWriteId_=n},t.prototype.getWrite=function(t){for(var e=0;e<this.allWrites_.length;e++){var n=this.allWrites_[e];if(n.writeId===t)return n}return null},t.prototype.removeWrite=function(t){var e=this,n=this.allWrites_.findIndex((function(e){return e.writeId===t}));Object(o.f)(n>=0,"removeWrite called with nonexistent writeId.");var r=this.allWrites_[n];this.allWrites_.splice(n,1);for(var i=r.visible,a=!1,s=this.allWrites_.length-1;i&&s>=0;){var u=this.allWrites_[s];u.visible&&(s>=n&&this.recordContainsPath_(u,r.path)?i=!1:et(r.path,u.path)&&(a=!0)),s--}if(i){if(a)return this.resetTree_(),!0;r.snap?this.visibleWrites_=an(this.visibleWrites_,r.path):P(r.children,(function(t){e.visibleWrites_=an(e.visibleWrites_,Q(r.path,t))}));return!0}return!1},t.prototype.getCompleteWriteData=function(t){return un(this.visibleWrites_,t)},t.prototype.calcCompleteEventCache=function(e,n,r,i){if(r||i){var o=ln(this.visibleWrites_,e);if(!i&&hn(o))return n;if(i||null!=n||sn(o,z())){return fn(t.layerTree_(this.allWrites_,(function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(et(t.path,e)||et(e,t.path))}),e),n||ne.EMPTY_NODE)}return null}var a=un(this.visibleWrites_,e);if(null!=a)return a;var s=ln(this.visibleWrites_,e);return hn(s)?n:null!=n||sn(s,z())?fn(s,n||ne.EMPTY_NODE):null},t.prototype.calcCompleteEventChildren=function(t,e){var n=ne.EMPTY_NODE,r=un(this.visibleWrites_,t);if(r)return r.isLeafNode()||r.forEachChild(Gt,(function(t,e){n=n.updateImmediateChild(t,e)})),n;if(e){var i=ln(this.visibleWrites_,t);return e.forEachChild(Gt,(function(t,e){var r=fn(ln(i,new V(t)),e);n=n.updateImmediateChild(t,r)}
2)),cn(i).forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}return cn(ln(this.visibleWrites_,t)).forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n,r){Object(o.f)(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=Q(t,e);if(sn(this.visibleWrites_,i))return null;var a=ln(this.visibleWrites_,i);return hn(a)?r.getChild(e):fn(a,r.getChild(e))},t.prototype.calcCompleteChild=function(t,e,n){var r=Q(t,e),i=un(this.visibleWrites_,r);return null!=i?i:n.isCompleteForChild(e)?fn(ln(this.visibleWrites_,r),n.getNode().getImmediateChild(e)):null},t.prototype.shadowingWrite=function(t){return un(this.visibleWrites_,t)},t.prototype.calcIndexedSlice=function(t,e,n,r,i,o){var a,s=ln(this.visibleWrites_,t),u=un(s,z());if(null!=u)a=u;else{if(null==e)return[];a=fn(s,e)}if((a=a.withIndex(o)).isEmpty()||a.isLeafNode())return[];for(var c=[],l=o.getCompare(),h=i?a.getReverseIteratorFrom(n,o):a.getIteratorFrom(n,o),f=h.getNext();f&&c.length<r;)0!==l(f,n)&&c.push(f),f=h.getNext();return c},t.prototype.recordContainsPath_=function(t,e){if(t.snap)return et(t.path,e);for(var n in t.children)if(t.children.hasOwnProperty(n)&&et(Q(t.path,n),e))return!0;return!1},t.prototype.resetTree_=function(){this.visibleWrites_=t.layerTree_(this.allWrites_,t.DefaultFilter_,z()),this.allWrites_.length>0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},t.DefaultFilter_=function(t){return t.visible},t.layerTree_=function(t,e,n){for(var r=nn.empty(),i=0;i<t.length;++i){var a=t[i];if(e(a)){var s=a.path,u=void 0;if(a.snap)et(n,s)?r=rn(r,u=Z(n,s),a.snap):et(s,n)&&(u=Z(s,n),r=rn(r,z(),a.snap.getChild(u)));else{if(!a.children)throw Object(o.g)("WriteRecord should have .snap or .children");if(et(n,s))r=on(r,u=Z(n,s),a.children);else if(et(s,n))if(J(u=Z(s,n)))r=on(r,z(),a.children);else{var c=Object(o.G)(a.children,H(u));if(c){var l=c.getChild(W(u));r=rn(r,z(),l)}}}}}return r},t}(),vn=function(){function t(t,e){this.treePath_=t,this.writeTree_=e}return t.prototype.calcCompleteEventCache=function(t,e,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,t,e,n)},t.prototype.calcCompleteEventChildren=function(t){return this.writeTree_.calcCompleteEventChildren(this.treePath_,t)},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,t,e,n)},t.prototype.shadowingWrite=function(t){return this.writeTree_.shadowingWrite(Q(this.treePath_,t))},t.prototype.calcIndexedSlice=function(t,e,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,t,e,n,r,i)},t.prototype.calcCompleteChild=function(t,e){return this.writeTree_.calcCompleteChild(this.treePath_,t,e)},t.prototype.child=function(e){return new t(Q(this.treePath_,e),this.writeTree_)},t}(),mn=1,gn=function(t){this.listenProvider_=t,this.syncPointTree_=new ce(null),this.pendingWriteTree_=new pn,this.tagToQueryMap=new Map,this.queryToTagMap=new Map};function yn(t,e,n,r,i){return t.pendingWriteTree_.addOverwrite(e,n,r,i),i?En(t,new he({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,n)):[]}function bn(t,e,n){void 0===n&&(n=!1);var r=t.pendingWriteTree_.getWrite(e);if(t.pendingWriteTree_.removeWrite(e)){var i=new ce(null);return null!=r.snap?i=i.set(z(),!0):P(r.children,(function(t){i=i.set(new V(t),!0)})),En(t,new ue(r.path,i,n))}return[]}function _n(t,e,n){return En(t,new he({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e,n))}function wn(t,e,n,r){var i=e.path,o=t.syncPointTree_.get(i),a=[];if(o&&("default"===e.queryIdentifier()||$e(o,e))){var s=Ke(o,e,n,r);0===o.views.size&&(t.syncPointTree_=t.syncPointTree_.remove(i));var u=s.removed;a=s.events;var c=-1!==u.findIndex((function(t){return t.getQueryParams().loadsAllData()})),l=t.syncPointTree_.findOnPath(i,(function(t,e){return tn(e)}));if(c&&!l){var h=t.syncPointTree_.subtree(i);if(!h.isEmpty())for(var f=function(t){return t.fold((function(t,e,n){if(e&&tn(e))return[en(e)];var r=[];return e&&(r=Qe(e)),P(n,(function(t,e){r=r.concat(e)})),r}))}(h),d=0;d<f.length;++d){var p=f[d],v=p.getQuery(),m=kn(t,p);
2t.listenProvider_.startListening(Pn(v),Cn(t,v),m.hashFn,m.onComplete)}}if(!l&&u.length>0&&!r)if(c){t.listenProvider_.stopListening(Pn(e),null)}else u.forEach((function(e){var n=t.queryToTagMap.get(Mn(e));t.listenProvider_.stopListening(Pn(e),n)}));!function(t,e){for(var n=0;n<e.length;++n){var r=e[n];if(!r.getQueryParams().loadsAllData()){var i=Mn(r),o=t.queryToTagMap.get(i);t.queryToTagMap.delete(i),t.tagToQueryMap.delete(o)}}}(t,u)}return a}function xn(t,e,n){var r=e.path,i=null,a=!1;t.syncPointTree_.foreachOnPath(r,(function(t,e){var n=Z(t,r);i=i||Je(e,n),a=a||tn(e)}));var s,u=t.syncPointTree_.get(r);(u?(a=a||tn(u),i=i||Je(u,z())):(u=new Ge,t.syncPointTree_=t.syncPointTree_.set(r,u)),null!=i)?s=!0:(s=!1,i=ne.EMPTY_NODE,t.syncPointTree_.subtree(r).foreachChild((function(t,e){var n=Je(e,z());n&&(i=i.updateImmediateChild(t,n))})));var c=$e(u,e);if(!c&&!e.getQueryParams().loadsAllData()){var l=Mn(e);Object(o.f)(!t.queryToTagMap.has(l),"View does not exist, but we have a tag");var h=mn++;t.queryToTagMap.set(l,h),t.tagToQueryMap.set(h,l)}var f=function(t,e,n,r,i,o){var a=Xe(t,e,r,i,o);return t.views.has(e.queryIdentifier())||t.views.set(e.queryIdentifier(),a),a.addEventRegistration(n),a.getInitialEvents(n)}(u,e,n,t.pendingWriteTree_.childWrites(r),i,s);if(!c&&!a){var d=Ze(u,e);f=f.concat(function(t,e,n){var r=e.path,i=Cn(t,e),a=kn(t,n),s=t.listenProvider_.startListening(Pn(e),i,a.hashFn,a.onComplete),u=t.syncPointTree_.subtree(r);if(i)Object(o.f)(!tn(u.value),"If we're adding a query, it shouldn't be shadowed");else for(var c=u.fold((function(t,e,n){if(!J(t)&&e&&tn(e))return[en(e).getQuery()];var r=[];return e&&(r=r.concat(Qe(e).map((function(t){return t.getQuery()})))),P(n,(function(t,e){r=r.concat(e)})),r})),l=0;l<c.length;++l){var h=c[l];t.listenProvider_.stopListening(Pn(h),Cn(t,h))}return s}(t,e,d))}return f}function Tn(t,e,n){var r=t.pendingWriteTree_,i=t.syncPointTree_.findOnPath(e,(function(t,n){var r=Je(n,Z(t,e));if(r)return r}));return r.calcCompleteEventCache(e,i,n,!0)}function En(t,e){return Sn(e,t.syncPointTree_,null,t.pendingWriteTree_.childWrites(z()))}function Sn(t,e,n,r){if(J(t.path))return On(t,e,n,r);var i=e.get(z());null==n&&null!=i&&(n=Je(i,z()));var o=[],a=H(t.path),s=t.operationForChild(a),u=e.children.get(a);if(u&&s){var c=n?n.getImmediateChild(a):null,l=r.child(a);o=o.concat(Sn(s,u,c,l))}return i&&(o=o.concat(Ye(i,t,r,n))),o}function On(t,e,n,r){var i=e.get(z());null==n&&null!=i&&(n=Je(i,z()));var o=[];return e.children.inorderTraversal((function(e,i){var a=n?n.getImmediateChild(e):null,s=r.child(e),u=t.operationForChild(e);u&&(o=o.concat(On(u,i,a,s)))})),i&&(o=o.concat(Ye(i,t,r,n))),o}function kn(t,e){var n=e.getQuery(),r=Cn(t,n);return{hashFn:function(){return(e.getServerCache()||ne.EMPTY_NODE).hash()},onComplete:function(e){if("ok"===e)return r?function(t,e,n){var r=An(t,n);if(r){var i=In(r),o=i.path,a=i.queryId,s=Z(o,e);return jn(t,o,new le(ae(a),s))}return[]}(t,n.path,r):function(t,e){return En(t,new le({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e))}(t,n.path);var i=function(t,e){var n="Unknown Error";"too_big"===t?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===t?n="Client doesn't have permission to access the desired data.":"unavailable"===t&&(n="The service is unavailable");var r=new Error(t+" at "+e.path.toString()+": "+n);return r.code=t.toUpperCase(),r}(e,n);return wn(t,n,null,i)}}}function Cn(t,e){var n=Mn(e);return t.queryToTagMap.get(n)}function Mn(t){return t.path.toString()+"$"+t.queryIdentifier()}function An(t,e){return t.tagToQueryMap.get(e)}function In(t){var e=t.indexOf("$");return Object(o.f)(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new V(t.substr(0,e))}}function jn(t,e,n){var r=t.syncPointTree_.get(e);return Object(o.f)(r,"Missing sync point for query tag that we're tracking"),Ye(r,n,t.pendingWriteTree_.childWrites(e),null)}
2function Pn(t){return t.getQueryParams().loadsAllData()&&!t.getQueryParams().isDefault()?t.getRef():t}var Rn=function(){function t(t){this.node_=t}return t.prototype.getImmediateChild=function(e){return new t(this.node_.getImmediateChild(e))},t.prototype.node=function(){return this.node_},t}(),Nn=function(){function t(t,e){this.syncTree_=t,this.path_=e}return t.prototype.getImmediateChild=function(e){var n=Q(this.path_,e);return new t(this.syncTree_,n)},t.prototype.node=function(){return Tn(this.syncTree_,this.path_)},t}(),Ln=function(t,e,n){return t&&"object"===typeof t?(Object(o.f)(".sv"in t,"Unexpected leaf node or priority contents"),"string"===typeof t[".sv"]?Dn(t[".sv"],e,n):"object"===typeof t[".sv"]?Fn(t[".sv"],e):void Object(o.f)(!1,"Unexpected server value: "+JSON.stringify(t,null,2))):t},Dn=function(t,e,n){switch(t){case"timestamp":return n.timestamp;default:Object(o.f)(!1,"Unexpected server value: "+t)}},Fn=function(t,e,n){t.hasOwnProperty("increment")||Object(o.f)(!1,"Unexpected server value: "+JSON.stringify(t,null,2));var r=t.increment;"number"!==typeof r&&Object(o.f)(!1,"Unexpected increment value: "+r);var i=e.node();if(Object(o.f)(null!==i&&"undefined"!==typeof i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var a=i.getValue();return"number"!==typeof a?r:a+r},Un=function(t,e,n,r){return Vn(e,new Nn(n,t),r)},Bn=function(t,e,n){return Vn(t,new Rn(e),n)};function Vn(t,e,n){var r,i=t.getPriority().val(),o=Ln(i,e.getImmediateChild(".priority"),n);if(t.isLeafNode()){var a=t,s=Ln(a.getValue(),e,n);return s!==a.getValue()||o!==a.getPriority().val()?new Lt(s,oe(o)):t}var u=t;return r=u,o!==u.getPriority().val()&&(r=r.updatePriority(new Lt(o))),u.forEachChild(Gt,(function(t,i){var o=Vn(i,e.getImmediateChild(t),n);o!==i&&(r=r.updateImmediateChild(t,o))})),r}function zn(){return{value:null,children:new Map}}function Hn(t,e,n){if(J(e))t.value=n,t.children.clear();else if(null!==t.value)t.value=t.value.updateChild(e,n);else{var r=H(e);t.children.has(r)||t.children.set(r,zn()),Hn(t.children.get(r),e=W(e),n)}}function qn(t,e){if(J(e))return t.value=null,t.children.clear(),!0;if(null!==t.value){if(t.value.isLeafNode())return!1;var n=t.value;return t.value=null,n.forEachChild(Gt,(function(e,n){Hn(t,new V(e),n)})),qn(t,e)}if(t.children.size>0){var r=H(e);if(e=W(e),t.children.has(r))qn(t.children.get(r),e)&&t.children.delete(r);return 0===t.children.size}return!0}function Wn(t,e,n){null!==t.value?n(e,t.value):function(t,e){t.children.forEach((function(t,n){e(n,t)}))}(t,(function(t,r){Wn(r,new V(e.toString()+"/"+t),n)}))}var Gn=function(){function t(){this.rootNode_=ne.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}(),Yn=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),Object(o.k)(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return Object(o.m)(this.counters_)},t}(),Xn={},Kn={};function Qn(t){var e=t.toString();return Xn[e]||(Xn[e]=new Yn),Xn[e]}var Jn=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=Object(i.a)({},t);return this.last_&&P(this.last_,(function(t,n){e[t]=e[t]-n})),this.last_=t,e},t}(),Zn=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Jn(t);var n=1e4+2e4*Math.random();B(this.reportStats_.bind(this),Math.floor(n))}return t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),n={},r=!1;P(e,(function(e,i){i>0&&Object(o.k)(t.statsToReport_,e)&&(n[e]=i,r=!0)})),r&&this.server_.reportStats(n),B(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}();var $n=function(){this.eventLists_=[],this.recursionDepth_=0};function tr(t,e){for(var n=null,r=0;r<e.length;r++){var i=e[r],o=i.getPath();null===n||tt(o,n.path)||(t.eventLists_.push(n),n=null),null===n&&(n={events:[],path:o}),n.events.push(i)}n&&t.eventLists_.push(n)}function er(t,e,n){tr(t,n),rr(t,(function(t){return tt(t,e)}))}function nr(t,e,n){tr(t,n),rr(t,(function(t){return et(t,e)||et(e,t)}))}function rr(t,e){t.recursionDepth_++;for(var n=!0,r=0;r<t.eventLists_.length;r++){var i=t.eventLists_[r];if(i)e(i.path)?(ir(t.eventLists_[r]),t.eventLists_[r]=null):n=!1}n&&(t.eventLists_=[]),t.recursionDepth_--}function ir(t){for(var e=0;e<t.events.length;e++){var n=t.events[e];if(null!==n){t.events[e]=null;var r=n.getEventRunner();g&&_("event: "+n.toString()),U(r)}}}var or=function(){function t(t){this.allowedEvents_=t,this.listeners_={},Object(o.f)(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Array.isArray(this.listeners_[t]))for(var r=Object(i.f)([],Object(i.e)(this.listeners_[t])),o=0;o<r.length;o++)r[o].callback.apply(r[o].context,e)},t.prototype.on=function(t,e,n){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:e,context:n});var r=this.getInitialEvent(t);r&&e.apply(n,r)},t.prototype.off=function(t,e,n){this.validateEventType_(t);for(var r=this.listeners_[t]||[],i=0;i<r.length;i++)if(r[i].callback===e&&(!n||n===r[i].context))return void r.splice(i,1)},t.prototype.validateEventType_=function(t){Object(o.f)(this.allowedEvents_.find((function(e){return e===t})),"Unknown event: "+t)},t}(),ar=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document.hidden?(n="visibilitychange",e="hidden"):"undefined"!==typeof document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):"undefined"!==typeof document.msHidden?(n="msvisibilitychange",e="msHidden"):"undefined"!==typeof document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,(function(){var t=!document[e];t!==r.visible_&&(r.visible_=t,r.trigger("visible",t))}),!1),r}return Object(i.c)(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(o.f)("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(or),sr=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"===typeof window||"undefined"===typeof window.addEventListener||Object(o.x)()||(window.addEventListener("online",(function(){e.online_||(e.online_=!0,e.trigger("online",!0))}),!1),window.addEventListener("offline",(function(){e.online_&&(e.online_=!1,e.trigger("online",!1))}),!1)),e}return Object(i.c)(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(o.f)("online"===t,"Unknown event type: "+t),[this.online_]},e.prototype.currentlyOnline=function(){return this.online_},e}(or),ur=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var n=this;this.pendingResponses[t]=e;for(var r=function(){var t=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var e=function(e){t[e]&&U((function(){n.onMessage_(t[e])}))},r=0;r<t.length;++r)e(r);
2if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++},i=this;this.pendingResponses[this.currentResponseNum];){if("break"===r())break}},t}(),cr="start",lr="close",hr=function(){function t(t,e,n,r,i){this.connId=t,this.repoInfo=e,this.applicationId=n,this.transportSessionId=r,this.lastSessionId=i,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=w(t),this.stats_=Qn(e),this.urlFn=function(t){return lt(e,ut,t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new ur(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null}),Math.floor(3e4)),function(t){if(Object(o.z)()||"complete"===document.readyState)t();else{var e=!1,n=function n(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((function(){if(!n.isClosed_){n.scriptTagHolder=new fr((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object(i.e)(t,5),o=r[0],a=r[1],s=r[2];r[3],r[4];if(n.incrementIncomingBytes_(t),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,o===cr)n.id=a,n.password=s;else{if(o!==lr)throw new Error("Unrecognized command received: "+o);a?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(a,(function(){n.onClosed_()}))):n.onClosed_()}}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object(i.e)(t,2),o=r[0],a=r[1];n.incrementIncomingBytes_(t),n.myPacketOrderer.handleResponse(o,a)}),(function(){n.onClosed_()}),n.urlFn);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=n.scriptTagHolder.uniqueCallbackIdentifier),t.v=ot,n.transportSessionId&&(t.s=n.transportSessionId),n.lastSessionId&&(t.ls=n.lastSessionId),n.applicationId&&(t.p=n.applicationId),"undefined"!==typeof location&&location.hostname&&at.test(location.hostname)&&(t.r="f");var e=n.urlFn(t);n.log_("Connecting via long-poll to "+e),n.scriptTagHolder.addTag(e,(function(){}))}}))},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.forceAllow_=!0},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){return!Object(o.z)()&&(!!t.forceAllow_||!t.forceDisallow_&&"undefined"!==typeof document&&null!=document.createElement&&!("object"===typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"===typeof Windows&&"object"===typeof Windows.UI))},t.prototype.markConnectionHealthy=function(){},t.prototype.shutdown_=function(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},t.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},t.prototype.send=function(t){var e=Object(o.J)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);for(var n=Object(o.i)(e),r=j(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!Object(o.z)()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.incrementIncomingBytes_=function(t){var e=Object(o.J)(t).length;this.bytesReceived+=e,this.stats_.incrementCounter("bytes_received",e)},t}(),fr=function(){function t(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,Object(o.z)())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=p(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createI
2Frame_();var a="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length))a='<script>document.domain="'+document.domain+'";<\/script>';var s="<html><body>"+a+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(u){_("frame writing exception"),u.stack&&_(u.stack),_(u)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||_("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var t=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==t.myIFrame&&(document.body.removeChild(t.myIFrame),t.myIFrame=null)}),Math.floor(0)));var e=this.onDisconnect;e&&(this.onDisconnect=null,e())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),n="",r=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return e+=n,this.addLongPollTag_(e,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var n=this;this.outstandingRequests.add(e);var r=function(){n.outstandingRequests.delete(e),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(t,(function(){clearTimeout(i),r()}))},t.prototype.addTag=function(t,e){var n=this;Object(o.z)()?this.doNodeLongPoll(t,e):setTimeout((function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){_("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}}),Math.floor(1))},t}(),dr="";function pr(t){dr=t}var vr=null;"undefined"!==typeof MozWebSocket?vr=MozWebSocket:"undefined"!==typeof WebSocket&&(vr=WebSocket);var mr=function(){function e(t,n,r,i,o){this.connId=t,this.applicationId=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=w(this.connId),this.stats_=Qn(n),this.connURL=e.connectionURL_(n,i,o),this.nodeAdmin=n.nodeAdmin}return e.connectionURL_=function(t,e,n){var r={};return r.v=ot,!Object(o.z)()&&"undefined"!==typeof location&&location.hostname&&at.test(location.hostname)&&(r.r="f"),e&&(r.s=e),n&&(r.ls=n),lt(t,st,r)},e.prototype.open=function(e,n){var r=this;this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,h.set("previous_websocket_failure",!0);try{if(Object(o.z)()){var i=this.nodeAdmin?"AdminNode":"Node",a={headers:{"User-Agent":"Firebase/5/"+dr+"/"+t.platform+"/"+i,"X-Firebase-GMPID":this.applicationId||""}},s=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}),u=0===this.connURL.indexOf("wss://")?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;u&&(a.proxy={origin:u}),this.mySock=new vr(this.connURL,[],a)}else{a={headers:{"X-Firebase-GMPID":this.applicationId||""}};this.mySock=new vr(this.connURL,[],a)}}catch(l){this.log_("Error instantiating WebSocket.");var c=l.message||l.data;return c&&this.log_(c),void this.onClosed_()}this.mySock.onopen=function(){r.log_("Websocket connected."),r.everConnected_=!0}
2,this.mySock.onclose=function(){r.log_("Websocket connection was disconnected."),r.mySock=null,r.onClosed_()},this.mySock.onmessage=function(t){r.handleIncomingFrame(t)},this.mySock.onerror=function(t){r.log_("WebSocket error. Closing connection.");var e=t.message||t.data;e&&r.log_(e),r.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!==typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&null!==vr&&!e.forceDisallow_},e.previouslyFailed=function(){return h.isInMemoryStorage||!0===h.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){h.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length===this.totalFrames){var e=this.frames.join("");this.frames=null;var n=Object(o.D)(e);this.onMessage(n)}},e.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},e.prototype.extractFrameCount_=function(t){if(Object(o.f)(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},e.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var n=this.extractFrameCount_(e);null!==n&&this.appendFrame_(n)}}},e.prototype.send=function(t){this.resetKeepAlive();var e=Object(o.J)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var n=j(e,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},e.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},e.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},e.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){t.mySock&&t.sendString_("0"),t.resetKeepAlive()}),Math.floor(45e3))},e.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},e.responsesRequiredToBeHealthy=2,e.healthyTimeout=3e4,e}(),gr=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[hr,mr]},enumerable:!1,configurable:!0}),t.prototype.initTransports_=function(e){var n,r,o=mr&&mr.isAvailable(),a=o&&!mr.previouslyFailed();if(e.webSocketOnly&&(o||E("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),a=!0),a)this.transports_=[mr];else{var s=this.transports_=[];try{for(var u=Object(i.g)(t.ALL_TRANSPORTS),c=u.next();!c.done;c=u.next()){var l=c.value;l&&l.isAvailable()&&s.push(l)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),yr=function(){function t(t,e,n,r,i,o,a,s){this.id=t,this.repoInfo_=e,this.applicationId_=n,this.onMessage_=r,this.onReady_=i,this.onDisconnect_=o,this.onKill_=a,this.lastSessionId=s,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=w("c:"+this.id+":"),this.transportManager_=new gr(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,void 0,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){t.conn_&&t.conn_.open(n,r)}),Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=B((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>
2102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes. Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes. Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))}),Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(n){t===e.conn_?e.onConnectionLost_(n):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(n){2!==e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(n):t===e.secondaryConn_?e.onSecondaryMessageReceived_(n):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){var e={t:"d",d:t};this.sendData_(e)},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=A("t",t),n=A("d",t);if("c"===e)this.onSecondaryControl_(n);else{if("d"!==e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=A("t",t),n=A("d",t);"c"===e?this.onControl_(n):"d"===e&&this.onDataMessage_(n)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=A("t",t);if("d"in t){var n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===e?this.onConnectionShutdown_(n):"r"===e?this.onReset_(n):"e"===e?x("Server Error: "+n):"o"===e?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):x("Unknown control packet command: "+e)}},t.prototype.onHandshake_=function(t){var e=t.ts,n=t.v,r=t.h;this.sessionId=t.s,this.repoInfo_.host=r,0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,e),ot!==n&&E("Protocol version mismatch detected"),this.tryStartUpgrade_())},t.prototype.tryStartUpgrade_=function(){var t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)},t.prototype.startUpgrade_=function(t){var e=this;this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),B((function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())}),Math.floor(6e4))},t.prototype.onReset_=function(t){this.log_("Reset packet received. New host: "+t),this.repoInfo_.host=t,1===this.state_?this.close():(this.closeConnections_(),this.start_())},t.prototype.onConnectionEstablished_=function(t,e){var n=this;this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):B((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},t.prototype.onSecondaryConnectionLost_=function(){var t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()},t.prototype.onConnectionLost_=function(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(h.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},t.prototype.onConnectionShutdown_=function(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()},t.prototype.sendData_=function(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)},t.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},t.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},t}(),br=function(){function t(){}return t.prototype.put=function(t,e,n,r){},t.prototype.merge=function(t,e,n,r){},t.prototype.refreshAuthToken=function(t){},t.prototype.onDisconnectPut=function(t,e,n){},t.prototype.onDisconnectMerge=function(t,e,n){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),_r=1e3,wr=function(t){function e(n,r,i,a,s,u,c){var l=t.call(this)||this;if(l.repoInfo_=n,l.applicationId_=r,l.onDataUpdate_=i,l.onConnectStatus_=a,l.onServerInfoUpdate_=s,l.authTokenProvider_=u,l.authOverride_=c,l.id=e.nextPersistentConnectionId_++,l.log_=w("p:"+l.id+":"),l.interruptReasons_={},l.listens=new Map,l.outstandingPuts_=[],l.outstandingGets_=[],l.outstandingPutCount_=0,l.outstandingGetCount_=0,l.onDisconnectRequestQueue_=[],l.connected_=!1,l.reconnectDelay_=_r,l.maxReconnectDelay_=3e5,l.securityDebugCallback_=null,l.lastSessionId=null,l.establishConnectionTimer_=null,l.visible_=!1,l.requestCBHash_={},l.requestNumber_=0,l.realtime_=null,l.authToken_=null,l.forceTokenRefresh_=!1,l.invali
2dAuthTokenCount_=0,l.firstConnection_=!0,l.lastConnectionAttemptTime_=null,l.lastConnectionEstablishedTime_=null,c&&!Object(o.z)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return l.scheduleConnect_(0),ar.getInstance().on("visible",l.onVisible_,l),-1===n.host.indexOf("fblocal")&&sr.getInstance().on("online",l.onOnline_,l),l}return Object(i.c)(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.requestNumber_,i={r:r,a:t,b:e};this.log_(Object(o.J)(i)),Object(o.f)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},e.prototype.get=function(t){var e=this,n=new o.a,r={p:t.path.toString(),q:t.queryObject()},i={action:"g",request:r,onComplete:function(t){var i=t.d;"ok"===t.s?(e.onDataUpdate_(r.p,i,!1,null),n.resolve(i)):n.reject(i)}};this.outstandingGets_.push(i),this.outstandingGetCount_++;var a=this.outstandingGets_.length-1;return this.connected_||setTimeout((function(){var t=e.outstandingGets_[a];void 0!==t&&i===t&&(delete e.outstandingGets_[a],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),e.log_("get "+a+" timed out on connection"),n.reject(new Error("Client is offline.")))}),3e3),this.connected_&&this.sendGet_(a),n.promise},e.prototype.listen=function(t,e,n,r){var i=t.queryIdentifier(),a=t.path.toString();this.log_("Listen called for "+a+" "+i),this.listens.has(a)||this.listens.set(a,new Map),Object(o.f)(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),Object(o.f)(!this.listens.get(a).has(i),"listen() called twice for same path/queryId.");var s={onComplete:r,hashFn:e,query:t,tag:n};this.listens.get(a).set(i,s),this.connected_&&this.sendListen_(s)},e.prototype.sendGet_=function(t){var e=this,n=this.outstandingGets_[t];this.sendRequest("g",n.request,(function(r){delete e.outstandingGets_[t],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),n.onComplete&&n.onComplete(r)}))},e.prototype.sendListen_=function(t){var n=this,r=t.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};t.tag&&(a.q=r.queryObject(),a.t=t.tag),a.h=t.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,u=a.s;e.warnOnListenWarnings_(s,r),(n.listens.get(i)&&n.listens.get(i).get(o))===t&&(n.log_("listen response",a),"ok"!==u&&n.removeListen_(i,o),t.onComplete&&t.onComplete(u,s))}))},e.warnOnListenWarnings_=function(t,e){if(t&&"object"===typeof t&&Object(o.k)(t,"w")){var n=Object(o.G)(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e.getQueryParams().getIndex().toString()+'"',i=e.path.toString();E("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||Object(o.q)(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,n=Object(o.C)(e)?"auth":"gauth",r={cred:e};null===this.authOverride_?r.noauth=!0:"object"===typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,(function(n){var r=n.s,i=n.d||"error";t.authToken_===e&&("ok"===r?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(r,i))}))}},e.prototype.unlisten=function(t,e){var n=t.path.toString(),r=t.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),Object(o.f)(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t.queryObject(),e)},e.prototype.sendUnlisten_=function(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,n,r){var i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,(function(t){r&&setTimeout((function(){r(t.s,t.d)}),Math.floor(0))}))},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){var o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,n=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,i=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(n,r,(function(r){e.log_(n+" response",r),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),i&&i(r.s,r.d)}))},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var n={c:t};this.log_("reportStats",n),this.sendRequest("s",n,(function(t){if("ok"!==t.s){var n=t.d;e.log_("reportStats","Error sending stats: "+n)}}))}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+Object(o.J)(t));var e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):x("Unrecognized action received from server: "+Object(o.J)(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;Object(o.f)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){e.establishConnectionTimer_=null,e.establishConnection_()}),Math.floor(t))},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=_r,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=_r,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=_r),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);
2e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){var t=this;if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var n=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),a=this.id+":"+e.nextConnectionId_++,s=this,u=this.lastSessionId,c=!1,l=null,h=function(){l?l.close():(c=!0,i())};this.realtime_={close:h,sendRequest:function(t){Object(o.f)(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(t)}};var f=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(f).then((function(t){c?_("getToken() completed but was canceled"):(_("getToken() completed. Creating connection."),s.authToken_=t&&t.accessToken,l=new yr(a,s.repoInfo_,s.applicationId_,n,r,i,(function(t){E(t+" ("+s.repoInfo_.toString()+")"),s.interrupt("server_kill")}),u))})).then(null,(function(e){s.log_("Failed to get token: "+e),c||(t.repoInfo_.nodeAdmin&&E(e),h())}))}},e.prototype.interrupt=function(t){_("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(t){_("Resuming connection for reason: "+t),delete this.interruptReasons_[t],Object(o.u)(this.interruptReasons_)&&(this.reconnectDelay_=_r,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t<this.outstandingPuts_.length;t++){var e=this.outstandingPuts_[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},e.prototype.onListenRevoked_=function(t,e){var n;n=e?e.map((function(t){return I(t)})).join("$"):"default";var r=this.removeListen_(t,n);r&&r.onComplete&&r.onComplete("permission_denied")},e.prototype.removeListen_=function(t,e){var n,r=new V(t).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(e),i.delete(e),0===i.size&&this.listens.delete(r)}else n=void 0;return n},e.prototype.onAuthRevoked_=function(t,e){_("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.restoreState_=function(){var t,e,n,r;this.tryAuth();try{for(var o=Object(i.g)(this.listens.values()),a=o.next();!a.done;a=o.next()){var s=a.value;try{for(var u=(n=void 0,Object(i.g)(s.values())),c=u.next();!c.done;c=u.next()){var l=c.value;this.sendListen_(l)}}catch(d){n={error:d}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(p){t={error:p}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}for(var h=0;h<this.outstandingPuts_.length;h++)this.outstandingPuts_[h]&&this.sendPut_(h);for(;this.onDisconnectRequestQueue_.length;){var f=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(f.action,f.pathString,f.data,f.onComplete)}for(h=0;h<this.outstandingGets_.length;h++)this.outstandingGets_[h]&&this.sendGet_(h)},e.prototype.sendConnectStats_=function(){var t={},e="js";Object(o.z)()&&(e=this.repoInfo_.nodeAdmin?"admin_node":"node"),t["sdk."+e+"."+dr.replace(/\./g,"-")]=1,Object(o.x)()?t["framework.cordova"]=1:Object(o.A)()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=sr.getInstance().currentlyOnline();return Object(o.u)(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(br),xr=function(t){function e(e,n,r){var i=t.call(this)||this;return i.repoInfo_=e,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=w("p:rest:"),i.listens_={},i}return Object(i.c)(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:(Object(o.f)(t.getQueryParams().isDefault(),"should have a tag if it's not a default query."),t.path.toString())},e.prototype.listen=function(t,n,r,i){var a=this,s=t.path.toString();this.log_("Listen called for "+s+" "+t.queryIdentifier());var u=e.getListenId_(t,r),c={};this.listens_[u]=c;var l=He(t.getQueryParams());this.restRequest_(s+".json",l,(function(t,e){var n=e;(404===t&&(n=null,t=null),null===t&&a.onDataUpdate_(s,n,!1,r),Object(o.G)(a.listens_,u)===c)&&i(t?401===t?"permission_denied":"rest_error:"+t:"ok",null)}))},e.prototype.unlisten=function(t,n){var r=e.getListenId_(t,n);delete this.listens_[r]},e.prototype.get=function(t){var e=this,n=He(t.getQueryParams()),r=t.path.toString(),i=new o.a;return this.restRequest_(r+".json",n,(function(t,n){var o=n;404===t&&(o=null,t=null),null===t?(e.onDataUpdate_(r,o,!1,null),i.resolve(o)):i.reject(new Error(o))})),i.promise},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,n){var r=this;void 0===e&&(e={}),e.format="export",this.authTokenProvider_.getToken(!1).then((function(i){var a=i&&i.accessToken;a&&(e.auth=a);var s=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+t+"?ns="+r.repoInfo_.namespace+Object(o.F)(e);r.log_("Sending REST request for "+s);var u=new XMLHttpRequest;u.onreadystatechange=function(){if(n&&4===u.readyState){r.log_("REST Response for "+s+" received. status:",u.status,"response:",u.responseText);var t=null;if(u.status>=200&&u.status<300){try{t=Object(o.D)(u.responseText)}catch(e){E("Failed to parse JSON response for "+s+": "+u.responseText)}n(null,t)}else 401!==u.status&&404!==u.status&&E("Got unsuccessful REST response for "+s+" Status: "+u.status),n(u.status);n=null}},u.open("GET",s,!0),u.send()}))},e}(br),Tr=function(){function t(t,e,n){this.node_=t,this.ref_=e,this.index_=n}return t.prototype.val=function(){return Object(o.K)("DataSnapshot.val",0,0,arguments.length),this.node_.val()}
2,t.prototype.exportVal=function(){return Object(o.K)("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},t.prototype.toJSON=function(){return Object(o.K)("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},t.prototype.exists=function(){return Object(o.K)("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},t.prototype.child=function(e){Object(o.K)("DataSnapshot.child",0,1,arguments.length),e=String(e),Ot("DataSnapshot.child",1,e,!1);var n=new V(e),r=this.ref_.child(n);return new t(this.node_.getChild(n),r,Gt)},t.prototype.hasChild=function(t){Object(o.K)("DataSnapshot.hasChild",1,1,arguments.length),Ot("DataSnapshot.hasChild",1,t,!1);var e=new V(t);return!this.node_.getChild(e).isEmpty()},t.prototype.getPriority=function(){return Object(o.K)("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},t.prototype.forEach=function(e){var n=this;if(Object(o.K)("DataSnapshot.forEach",1,1,arguments.length),Object(o.L)("DataSnapshot.forEach",1,e,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return e(new t(i,n.ref_.child(r),Gt))}))},t.prototype.hasChildren=function(){return Object(o.K)("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(t.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!1,configurable:!0}),t.prototype.numChildren=function(){return Object(o.K)("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},t.prototype.getRef=function(){return Object(o.K)("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),t}(),Er=function(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n={children:{},childCount:0}),this.name=t,this.parent=e,this.node=n};function Sr(t,e){for(var n=e instanceof V?e:new V(e),r=t,i=H(n);null!==i;){var a=Object(o.G)(r.node.children,i)||{children:{},childCount:0};r=new Er(i,r,a),i=H(n=W(n))}return r}function Or(t){return t.node.value}function kr(t,e){t.node.value=e,jr(t)}function Cr(t){return t.node.childCount>0}function Mr(t,e){P(t.node.children,(function(n,r){e(new Er(n,t,r))}))}function Ar(t,e,n,r){n&&!r&&e(t),Mr(t,(function(t){Ar(t,e,!0,r)})),n&&r&&e(t)}function Ir(t){return new V(null===t.parent?t.name:Ir(t.parent)+"/"+t.name)}function jr(t){null!==t.parent&&function(t,e,n){var r=function(t){return void 0===Or(t)&&!Cr(t)}(n),i=Object(o.k)(t.node.children,e);r&&i?(delete t.node.children[e],t.node.childCount--,jr(t)):r||i||(t.node.children[e]=n.node,t.node.childCount++,jr(t))}(t.parent,t.name,t)}var Pr="repo_interrupt",Rr=function(){function t(t,e,n,r){this.repoInfo_=t,this.forceRestClient_=e,this.app=n,this.authTokenProvider_=r,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new $n,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=zn(),this.transactionQueueTree_=new Er,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}return t.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},t}();function Nr(t){if(t.stats_=Qn(t.repoInfo_),t.forceRestClient_||("object"===typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)t.server_=new xr(t.repoInfo_,(function(e,n,r,i){Fr(t,e,n,r,i)}),t.authTokenProvider_),setTimeout((function(){return Ur(t,!0)}),0);else{var e=t.app.options.databaseAuthVariableOverride;if("undefined"!==typeof e&&null!==e){if("object"!==typeof e)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Object(o.J)(e)}catch(n){throw new Error("Invalid authOverride provided: "+n)}}t.persistentConnection_=new wr(t.repoInfo_,t.app.options.appId,(function(e,n,r,i){Fr(t,e,n,r,i)}),(function(e){Ur(t,e)}),(function(e){!function(t,e){P(e,(function(e,n){Br(t,e,n)}))}(t,e)}),t.authTokenProvider_,e),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener((function(e){t.server_.refreshAuthToken(e)})),t.statsReporter_=function(t,e){var n=t.toString();return Kn[n]||(Kn[n]=e()),Kn[n]}(t.repoInfo_,(function(){return new Zn(t.stats_,t.server_)})),t.infoData_=new Gn,t.infoSyncTree_=new gn({startListening:function(e,n,r,i){var o=[],a=t.infoData_.getNode(e.path);return a.isEmpty()||(o=_n(t.infoSyncTree_,e.path,a),setTimeout((function(){i("ok")}),0)),o},stopListening:function(){}}),Br(t,"connected",!1),t.serverSyncTree_=new gn({startListening:function(e,n,r,i){return t.server_.listen(e,r,n,(function(n,r){var o=i(n,r);nr(t.eventQueue_,e.path,o)})),[]},stopListening:function(e,n){t.server_.unlisten(e,n)}})}function Lr(t){var e=t.infoData_.getNode(new V(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e}
2function Dr(t){return(e=(e={timestamp:Lr(t)})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e}function Fr(t,e,n,r,i){t.dataUpdateCount++;var a=new V(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;var s=[];if(i)if(r){var u=Object(o.E)(n,(function(t){return oe(t)}));s=function(t,e,n,r){var i=An(t,r);if(i){var o=In(i),a=o.path,s=o.queryId,u=Z(a,e),c=ce.fromObject(n);return jn(t,a,new fe(ae(s),u,c))}return[]}(t.serverSyncTree_,a,u,i)}else{var c=oe(n);s=function(t,e,n,r){var i=An(t,r);if(null!=i){var o=In(i),a=o.path,s=o.queryId,u=Z(a,e);return jn(t,a,new he(ae(s),u,n))}return[]}(t.serverSyncTree_,a,c,i)}else if(r){var l=Object(o.E)(n,(function(t){return oe(t)}));s=function(t,e,n){var r=ce.fromObject(n);return En(t,new fe({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e,r))}(t.serverSyncTree_,a,l)}else{var h=oe(n);s=_n(t.serverSyncTree_,a,h)}var f=a;s.length>0&&(f=oi(t,a)),nr(t.eventQueue_,f,s)}function Ur(t,e){Br(t,"connected",e),!1===e&&function(t){$r(t,"onDisconnectEvents");var e=Dr(t),n=zn();Wn(t.onDisconnect_,z(),(function(r,i){var o=Un(r,i,t.serverSyncTree_,e);Hn(n,r,o)}));var r=[];Wn(n,z(),(function(e,n){r=r.concat(_n(t.serverSyncTree_,e,n));var i=li(t,e);oi(t,i)})),t.onDisconnect_=zn(),nr(t.eventQueue_,z(),r)}(t)}function Br(t,e,n){var r=new V("/.info/"+e),i=oe(n);t.infoData_.updateSnapshot(r,i);var o=_n(t.infoSyncTree_,r,i);nr(t.eventQueue_,r,o)}function Vr(t){return t.nextWriteId_++}function zr(t,e){var n=function(t,e){var n=e.path,r=null;t.syncPointTree_.foreachOnPath(n,(function(t,e){var i=Z(t,n);r=r||Je(e,i)}));var i=t.syncPointTree_.get(n);i?r=r||Je(i,z()):(i=new Ge,t.syncPointTree_=t.syncPointTree_.set(n,i));var o=null!=r,a=o?new de(r,!0,!1):null;return Xe(i,e,t.pendingWriteTree_.childWrites(e.path),o?a.getNode():ne.EMPTY_NODE,o).getCompleteNode()}(t.serverSyncTree_,e);return null!=n?Promise.resolve(new Tr(n,e.getRef(),e.getQueryParams().getIndex())):t.server_.get(e).then((function(n){var r=oe(n),i=_n(t.serverSyncTree_,e.path,r);return er(t.eventQueue_,e.path,i),Promise.resolve(new Tr(r,e.getRef(),e.getQueryParams().getIndex()))}),(function(n){return $r(t,"get for query "+Object(o.J)(e)+" failed: "+n),Promise.reject(new Error(n))}))}function Hr(t,e,n,r,i){$r(t,"set",{path:e.toString(),value:n,priority:r});var o=Dr(t),a=oe(n,r),s=Tn(t.serverSyncTree_,e),u=Bn(a,s,o),c=Vr(t),l=yn(t.serverSyncTree_,e,u,c,!0);tr(t.eventQueue_,l),t.server_.put(e.toString(),a.val(!0),(function(n,r){var o="ok"===n;o||E("set at "+e+" failed: "+n);var a=bn(t.serverSyncTree_,c,!o);nr(t.eventQueue_,e,a),ti(t,i,n,r)}));var h=li(t,e);oi(t,h),nr(t.eventQueue_,h,[])}function qr(t,e,n,r){$r(t,"update",{path:e.toString(),value:n});var i=!0,o=Dr(t),a={};if(P(n,(function(n,r){i=!1,a[n]=Un(Q(e,n),oe(r),t.serverSyncTree_,o)})),i)_("update() called with empty data. Don't do anything."),ti(t,r,"ok",void 0);else{var s=Vr(t),u=function(t,e,n,r){t.pendingWriteTree_.addMerge(e,n,r);var i=ce.fromObject(n);return En(t,new fe({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,i))}(t.serverSyncTree_,e,a,s);tr(t.eventQueue_,u),t.server_.merge(e.toString(),n,(function(n,i){var o="ok"===n;o||E("update at "+e+" failed: "+n);var a=bn(t.serverSyncTree_,s,!o),u=a.length>0?oi(t,e):e;nr(t.eventQueue_,u,a),ti(t,r,n,i)})),P(n,(function(n){var r=li(t,Q(e,n));oi(t,r)})),nr(t.eventQueue_,e,[])}}function Wr(t,e,n){t.server_.onDisconnectCancel(e.toString(),(function(r,i){"ok"===r&&qn(t.onDisconnect_,e),ti(t,n,r,i)}))}function Gr(t,e,n,r){var i=oe(n);t.server_.onDisconnectPut(e.toString(),i.val(!0),(function(n,o){"ok"===n&&Hn(t.onDisconnect_,e,i),ti(t,r,n,o)}))}function Yr(t,e,n,r,i){var o=oe(n,r);t.server_.onDisconnectPut(e.toString(),o.val(!0),(function(n,r){"ok"===n&&Hn(t.onDisconnect_,e,o),ti(t,i,n,r)}))}function Xr(t,e,n,r){if(Object(o.u)(n))return _("onDisconnect().update() called with empty data. Don't do anything."),void ti(t,r,"ok",void 0);t.server_.onDisconnectMerge(e.toString(),n,(function(i,o){"ok"===i&&P(n,(function(n,r){var i=oe(r);Hn(t.onDisconnect_,Q(e,n),i)})),ti(t,r,i,o)}))}function Kr(t,e,n){var r;r=".info"===H(e.path)?xn(t.infoSyncTree_,e,n):xn(t.serverSyncTree_,e,n),er(t.eventQueue_,e.path,r)}function Qr(t,e,n){var r;r=".info"===H(e.path)?wn(t.infoSyncTree_,e,n):wn(t.serverSyncTree_,e,n),er(t.eventQueue_,e.path,r)}function Jr(t){t.persistentConnection_&&t.persistentConnection_.interrupt(Pr)}function Zr(t){t.persistentConnection_&&t.persistentConnection_.resume(Pr)}function $r(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r="";t.persistentConnection_&&(r=t.persistentConnection_.id+":"),_.apply(void 0,Object(i.f)([r],Object(i.e)(e)))}function ti(t,e,n,r){e&&U((function(){if("ok"===n)e(null);else{var t=(n||"error").toUpperCase(),i=t;r&&(i+=": "+r);var o=new Error(i);o.code=t,e(o)}}))}function ei(t){return t.__database||(t.__database=new Oi(t))}function ni(t,e,n,r,i){$r(t,"transaction on "+e);var a=function(){},s=new _i(t,e);s.on("value",a);var u={path:e,update:n,onComplete:r,status:null,order:p(),applyLocally:i,retryCount:0,unwatcher:function(){s.off("value",a)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},c=ri(t,e,void 0);u.currentInputSnapshot=c;var l=u.update(c.val());if(void 0===l){if(u.unwatcher(),u.currentOutputSnapshotRaw=null,u.currentOutputSnapshotResolved=null,u.onComplete){var h=new Tr(u.currentInputSnapshot,new _i(t,u.path),Gt);u.onComplete(null,!1,h)}}else{wt("transaction failed: Data returned ",l,u.path),u.status=0;var f=Sr(t.transactionQueueTree_,e),d=Or(f)||[];d.push(u),kr(f,d);var v=void 0;if("object"===typeof l&&null!==l&&Object(o.k)(l,".priority"))v=Object(o.G)(l,".priority"),Object(o.f)(bt(v),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else v=(Tn(t.serverSyncTree_,e)||ne.EMPTY_NODE).getPriority().val();var m=Dr(t),g=oe(l,v),y=Bn(g,c,m);u.currentOutputSnapshotRaw=g,u.currentOutputSnapshotResolved=y,u.currentWriteId=Vr(t);var b=yn(t.serverSyncTree_,e,y,u.currentWriteId,u.applyLocally);nr(t.eventQueue_,e,b),ii(t,t.transactionQueueTree_)}}function ri(t,e,n){return Tn(t.serverSyncTree_,e,n)||ne.EMPTY_NODE}function ii(t,e){if(void 0===e&&(e=t.transactionQueueTree_),e||ci(t,e),Or(e)){var n=si(t,e);Object(o.f)(n.length>0,"Sending zero length transaction queue"),n.every((function(t){return 0===t.status}))&&function(t,e,n){for(var r=n.map((function(t){return t.currentWriteId})),i=ri(t,e,r),a=i,s=i.hash(),u=0;u<n.length;u++){var c=n[u];Object(o.f)(0===c.status,"tryToSendTransactionQueue_: items in queue should all be run."),c.status=1,c.retryCount++;var l=Z(e,c.path);a=a.updateChild(l,c.currentOutputSnapshotRaw)}var h=a.val(!0),f=e;t.server_.put(f.toString(),h,(function(r){$r(t,"transaction put response",{path:f.toString(),status:r});var i=[];if("ok"===r){for(var o=[],a=0;a<n.length;a++){if(n[a].status=2,i=i.concat(bn(t.serverSyncTree_,n[a].currentWriteId)),n[a].onComplete){var s=n[a].currentOutputSnapshotResolved,u=new _i(t,n[a].path),c=new Tr(s,u,Gt);o.push(n[a].onComplete.bind(null,null,!0,c))}n[a].unwatcher()}ci(t,Sr(t.transactionQueueTree_,e)),ii(t,t.transactionQueueTree_),nr(t.eventQueue_,e,i);for(a=0;a<o.length;a++)U(o[a])}else{if("datastale"===r)for(a=0;a<n.length;a++)3===n[a].status?n[a].status=4:n[a].status=0;else{E("transaction at "+f.toString()+" failed: "+r);for(a=0;a<n.length;a++)n[a].status=4,n[a].abortReason=r}oi(t,e)}}),s)}(t,Ir(e),n)}else Cr(e)&&Mr(e,(function(e){ii(t,e)}))}function oi(t,e){var n=ai(t,e),r=Ir(n);return function(t,e,n){if(0===e.length)return;for(var r=[],i=[],a=e.filter((function(t){return 0===t.status})).map((function(t){return t.currentWriteId})),s=0;s<e.length;s++){var u=e[s],c=Z(n,u.path),l=!1,h=void 0;if(Object(o.f)(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),4===u.status)l=!0,h=u.abortReason,i=i.concat(bn(t.serverSyncTree_,u.currentWriteId,!0));else if(0===u.status)if(u.retryCount>=25)l=!0,h="maxretry",i=i.concat(bn(t.serverSyncTree_,u.currentWriteId,!0));else{var f=ri(t,u.path,a);u.currentInputSnapshot=f;var d=e[s].update(f.val());if(void 0!==d){wt("transaction failed: Data returned ",d,u.path);var p=oe(d);"object"===typeof d&&null!=d&&Object(o.k)(d,".priority")||(p=p.updatePriority(f.getPriority()));var v=u.currentWriteId,m=Dr(t),g=Bn(p,f,m);u.currentOutputSnapshotRaw=p,u.currentOutputSnapshotResolved=g,u.currentWriteId=Vr(t),a.splice(a.indexOf(v),1),i=(i=i.concat(yn(t.serverSyncTree_,u.path,g,u.currentWriteId,u.applyLocally))).concat(bn(t.serverSyncTree_,v,!0))}else l=!0,h="nodata",i=i.concat(bn(t.serverSyncTree_,u.currentWriteId,!0))}if(nr(t.eventQueue_,n,i),i=[],l&&(e[s].status=2,w=e[s].unwatcher,setTimeout(w,Math.floor(0)),e[s].onComplete))if("nodata"===h){var y=new _i(t,e[s].path),b=e[s].currentInputSnapshot,_=new Tr(b,y,Gt);r.push(e[s].onComplete.bind(null,null,!1,_))}else r.push(e[s].onComplete.bind(null,new Error(h),!1,null))}var w;ci(t,t.transactionQueueTree_);for(s=0;s<r.length;s++)U(r[s]);ii(t,t.transactionQueueTree_)}
2(t,si(t,n),r),r}function ai(t,e){var n,r=t.transactionQueueTree_;for(n=H(e);null!==n&&void 0===Or(r);)r=Sr(r,n),n=H(e=W(e));return r}function si(t,e){var n=[];return ui(t,e,n),n.sort((function(t,e){return t.order-e.order})),n}function ui(t,e,n){var r=Or(e);if(r)for(var i=0;i<r.length;i++)n.push(r[i]);Mr(e,(function(e){ui(t,e,n)}))}function ci(t,e){var n=Or(e);if(n){for(var r=0,i=0;i<n.length;i++)2!==n[i].status&&(n[r]=n[i],r++);n.length=r,kr(e,n.length>0?n:void 0)}Mr(e,(function(e){ci(t,e)}))}function li(t,e){var n=Ir(ai(t,e)),r=Sr(t.transactionQueueTree_,e);return function(t,e,n){for(var r=n?t:t.parent;null!==r;){if(e(r))return!0;r=r.parent}}(r,(function(e){hi(t,e)})),hi(t,r),Ar(r,(function(e){hi(t,e)})),n}function hi(t,e){var n=Or(e);if(n){for(var r=[],i=[],a=-1,s=0;s<n.length;s++)if(3===n[s].status);else if(1===n[s].status)Object(o.f)(a===s-1,"All SENT items should be at beginning of queue."),a=s,n[s].status=3,n[s].abortReason="set";else if(Object(o.f)(0===n[s].status,"Unexpected transaction status in abort"),n[s].unwatcher(),i=i.concat(bn(t.serverSyncTree_,n[s].currentWriteId,!0)),n[s].onComplete){r.push(n[s].onComplete.bind(null,new Error("set"),!1,null))}-1===a?kr(e,void 0):n.length=a+1,nr(t.eventQueue_,Ir(e),i);for(s=0;s<r.length;s++)U(r[s])}}var fi,di=function(){function t(t,e){this.repo_=t,this.path_=e}return t.prototype.cancel=function(t){Object(o.K)("OnDisconnect.cancel",0,1,arguments.length),Object(o.L)("OnDisconnect.cancel",1,t,!0);var e=new o.a;return Wr(this.repo_,this.path_,e.wrapCallback(t)),e.promise},t.prototype.remove=function(t){Object(o.K)("OnDisconnect.remove",0,1,arguments.length),Ct("OnDisconnect.remove",this.path_),Object(o.L)("OnDisconnect.remove",1,t,!0);var e=new o.a;return Gr(this.repo_,this.path_,null,e.wrapCallback(t)),e.promise},t.prototype.set=function(t,e){Object(o.K)("OnDisconnect.set",1,2,arguments.length),Ct("OnDisconnect.set",this.path_),_t("OnDisconnect.set",1,t,this.path_,!1),Object(o.L)("OnDisconnect.set",2,e,!0);var n=new o.a;return Gr(this.repo_,this.path_,t,n.wrapCallback(e)),n.promise},t.prototype.setWithPriority=function(t,e,n){Object(o.K)("OnDisconnect.setWithPriority",2,3,arguments.length),Ct("OnDisconnect.setWithPriority",this.path_),_t("OnDisconnect.setWithPriority",1,t,this.path_,!1),Tt("OnDisconnect.setWithPriority",2,e,!1),Object(o.L)("OnDisconnect.setWithPriority",3,n,!0);var r=new o.a;return Yr(this.repo_,this.path_,t,e,r.wrapCallback(n)),r.promise},t.prototype.update=function(t,e){if(Object(o.K)("OnDisconnect.update",1,2,arguments.length),Ct("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,E("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}xt("OnDisconnect.update",1,t,this.path_,!1),Object(o.L)("OnDisconnect.update",2,e,!0);var i=new o.a;return Xr(this.repo_,this.path_,t,i.wrapCallback(e)),i.promise},t}(),pi=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return Object(o.K)("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),vi=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+Object(o.J)(this.snapshot.exportVal())},t}(),mi=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),gi=function(){function t(t,e,n){this.callback_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e.getQueryParams().getIndex();return new vi("value",this,new Tr(t.snapshotNode,e.getRef(),n))},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){Object(o.f)(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callback_;return function(){r.call(e,t.snapshot)}},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new mi(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callback_||!this.callback_||e.callback_===this.callback_&&e.context_===this.context_)},t.prototype.hasAnyCallback=function(){return null!==this.callback_},t}(),yi=function(){function t(t,e,n){this.callbacks_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,Object(o.k)(this.callbacks_,e)},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new mi(this,t,e):null},t.prototype.createEvent=function(t,e){Object(o.f)(null!=t.childName,"Child events should have a childName.");var n=e.getRef().child(t.childName),r=e.getQueryParams().getIndex();return new vi(t.type,this,new Tr(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){Object(o.f)(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callbacks_[t.eventType];return function(){r.call(e,t.snapshot,t.prevName)}},t.prototype.matches=function(e){var n=this;if(e instanceof t){if(!this.callbacks_||!e.callbacks_)return!0;
2if(this.context_===e.context_){var r=Object.keys(e.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var a=r[0],s=i[0];return s===a&&(!e.callbacks_[a]||!this.callbacks_[s]||e.callbacks_[a]===this.callbacks_[s])}return i.every((function(t){return e.callbacks_[t]===n.callbacks_[t]}))}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.callbacks_},t}(),bi=function(){function t(t,e,n,r){this.repo=t,this.path=e,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return Object(o.f)(fi,"Reference.ts has not been loaded"),fi},set:function(t){fi=t},enumerable:!1,configurable:!0}),t.validateQueryEndpoints_=function(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===Xt){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==O)throw new Error(r);if("string"!==typeof e)throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!==k)throw new Error(r);if("string"!==typeof n)throw new Error(i)}}else if(t.getIndex()===Gt){if(null!=e&&!bt(e)||null!=n&&!bt(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(Object(o.f)(t.getIndex()instanceof je||t.getIndex()===Ie,"unknown index type."),null!=e&&"object"===typeof e||null!=n&&"object"===typeof n)throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")},t.validateLimit_=function(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")},t.prototype.validateNoPreviousOrderByCall_=function(t){if(!0===this.orderByCalled_)throw new Error(t+": You can't combine multiple orderBy calls.")},t.prototype.getQueryParams=function(){return this.queryParams_},t.prototype.getRef=function(){return Object(o.K)("Query.ref",0,0,arguments.length),new t.__referenceConstructor(this.repo,this.path)},t.prototype.on=function(e,n,r,i){Object(o.K)("Query.on",2,4,arguments.length),Et("Query.on",1,e,!1),Object(o.L)("Query.on",2,n,!1);var a=t.getCancelAndContextArgs_("Query.on",r,i);if("value"===e)this.onValueEvent(n,a.cancel,a.context);else{var s={};s[e]=n,this.onChildEvent(s,a.cancel,a.context)}return n},t.prototype.onValueEvent=function(t,e,n){var r=new gi(t,e||null,n||null);Kr(this.repo,this,r)},t.prototype.onChildEvent=function(t,e,n){var r=new yi(t,e,n);Kr(this.repo,this,r)},t.prototype.off=function(t,e,n){Object(o.K)("Query.off",0,3,arguments.length),Et("Query.off",1,t,!0),Object(o.L)("Query.off",2,e,!0),Object(o.M)("Query.off",3,n,!0);var r=null,i=null;if("value"===t){var a=e||null;r=new gi(a,null,n||null)}else t&&(e&&((i={})[t]=e),r=new yi(i,null,n||null));Qr(this.repo,this,r)},t.prototype.get=function(){return zr(this.repo,this)},t.prototype.once=function(e,n,r,i){var a=this;Object(o.K)("Query.once",1,4,arguments.length),Et("Query.once",1,e,!1),Object(o.L)("Query.once",2,n,!0);var s=t.getCancelAndContextArgs_("Query.once",r,i),u=!0,c=new o.a;c.promise.catch((function(){}));var l=function t(r){u&&(u=!1,a.off(e,t),n&&n.bind(s.context)(r),c.resolve(r))};return this.on(e,l,(function(t){a.off(e,l),s.cancel&&s.cancel.bind(s.context)(t),c.reject(t)})),c.promise},t.prototype.limitToFirst=function(e){if(Object(o.K)("Query.limitToFirst",1,1,arguments.length),"number"!==typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,Le(this.queryParams_,e),this.orderByCalled_)},t.prototype.limitToLast=function(e){if(Object(o.K)("Query.limitToLast",1,1,arguments.length),"number"!==typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set
2(by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,De(this.queryParams_,e),this.orderByCalled_)},t.prototype.orderByChild=function(e){if(Object(o.K)("Query.orderByChild",1,1,arguments.length),"$key"===e)throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===e)throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===e)throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');Ot("Query.orderByChild",1,e,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new V(e);if(J(n))throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new je(n),i=ze(this.queryParams_,r);return t.validateQueryEndpoints_(i),new t(this.repo,this.path,i,!0)},t.prototype.orderByKey=function(){Object(o.K)("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var e=ze(this.queryParams_,Xt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByPriority=function(){Object(o.K)("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var e=ze(this.queryParams_,Gt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByValue=function(){Object(o.K)("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var e=ze(this.queryParams_,Ie);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.startAt=function(e,n){void 0===e&&(e=null),Object(o.K)("Query.startAt",0,2,arguments.length),_t("Query.startAt",1,e,this.path,!0),St("Query.startAt",2,n,!0);var r=Fe(this.queryParams_,e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,n=null),new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.startAfter=function(e,n){void 0===e&&(e=null),Object(o.K)("Query.startAfter",0,2,arguments.length),_t("Query.startAfter",1,e,this.path,!1),St("Query.startAfter",2,n,!0);var r=Ue(this.queryParams_,e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAfter: Starting point was already set (by another call to startAt, startAfter or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.endAt=function(e,n){void 0===e&&(e=null),Object(o.K)("Query.endAt",0,2,arguments.length),_t("Query.endAt",1,e,this.path,!0),St("Query.endAt",2,n,!0);var r=Be(this.queryParams_,e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt, endBefore, or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.endBefore=function(e,n){void 0===e&&(e=null),Object(o.K)("Query.endBefore",0,2,arguments.length),_t("Query.endBefore",1,e,this.path,!1),St("Query.endBefore",2,n,!0);var r=Ve(this.queryParams_,e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endBefore: Ending point was already set (by another call to endAt, endBefore, or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.equalTo=function(t,e){if(Object(o.K)("Query.equalTo",1,2,arguments.length),_t("Query.equalTo",1,t,this.path,!1),St("Query.equalTo",2,e,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return this.startAt(t,e).endAt(t,e)},t.prototype.toString=function(){return Object(o.K)("Query.toString",0,0,arguments.length),this.repo.toString()+Y(this.path)},t.prototype.toJSON=function(){return Object(o.K)("Query.toJSON",0,1,arguments.length),this.toString()},t.prototype.queryObject=function(){return function(t){var e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_)),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_)),t.limitSet_){e.l=t.limit_;var n=t.viewFrom_;""===n&&(n=t.isViewFromLeft()?"l":"r"),e.vf=n}return t.index_!==Gt&&(e.i=t.index_.toString()),e}(this.queryParams_)},t.prototype.queryIdentifier=function(){var t=this.queryObject(),e=I(t);return"{}"===e?"default":e},t.prototype.isEqual=function(e){if(Object(o.K)("Query.isEqual",1,1,arguments.length),!(e instanceof t)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}
2var r=this.repo===e.repo,i=tt(this.path,e.path),a=this.queryIdentifier()===e.queryIdentifier();return r&&i&&a},t.getCancelAndContextArgs_=function(t,e,n){var r={cancel:null,context:null};if(e&&n)r.cancel=e,Object(o.L)(t,3,r.cancel,!0),r.context=n,Object(o.M)(t,4,r.context,!0);else if(e)if("object"===typeof e&&null!==e)r.context=e;else{if("function"!==typeof e)throw new Error(Object(o.o)(t,3,!0)+" must either be a cancel callback or a context object.");r.cancel=e}return r},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),t}(),_i=function(t){function e(e,n){if(!(e instanceof Rr))throw new Error("new Reference() no longer supported - use app.database().");return t.call(this,e,n,new Ne,!1)||this}return Object(i.c)(e,t),e.prototype.getKey=function(){return Object(o.K)("Reference.key",0,0,arguments.length),J(this.path)?null:G(this.path)},e.prototype.child=function(t){return Object(o.K)("Reference.child",1,1,arguments.length),"number"===typeof t?t=String(t):t instanceof V||(null===H(this.path)?kt("Reference.child",1,t,!1):Ot("Reference.child",1,t,!1)),new e(this.repo,Q(this.path,t))},e.prototype.getParent=function(){Object(o.K)("Reference.parent",0,0,arguments.length);var t=K(this.path);return null===t?null:new e(this.repo,t)},e.prototype.getRoot=function(){Object(o.K)("Reference.root",0,0,arguments.length);for(var t=this;null!==t.getParent();)t=t.getParent();return t},e.prototype.databaseProp=function(){return ei(this.repo)},e.prototype.set=function(t,e){Object(o.K)("Reference.set",1,2,arguments.length),Ct("Reference.set",this.path),_t("Reference.set",1,t,this.path,!1),Object(o.L)("Reference.set",2,e,!0);var n=new o.a;return Hr(this.repo,this.path,t,null,n.wrapCallback(e)),n.promise},e.prototype.update=function(t,e){if(Object(o.K)("Reference.update",1,2,arguments.length),Ct("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,E("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}xt("Reference.update",1,t,this.path,!1),Object(o.L)("Reference.update",2,e,!0);var i=new o.a;return qr(this.repo,this.path,t,i.wrapCallback(e)),i.promise},e.prototype.setWithPriority=function(t,e,n){if(Object(o.K)("Reference.setWithPriority",2,3,arguments.length),Ct("Reference.setWithPriority",this.path),_t("Reference.setWithPriority",1,t,this.path,!1),Tt("Reference.setWithPriority",2,e,!1),Object(o.L)("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new o.a;return Hr(this.repo,this.path,t,e,r.wrapCallback(n)),r.promise},e.prototype.remove=function(t){return Object(o.K)("Reference.remove",0,1,arguments.length),Ct("Reference.remove",this.path),Object(o.L)("Reference.remove",1,t,!0),this.set(null,t)},e.prototype.transaction=function(t,e,n){if(Object(o.K)("Reference.transaction",1,3,arguments.length),Ct("Reference.transaction",this.path),Object(o.L)("Reference.transaction",1,t,!1),Object(o.L)("Reference.transaction",2,e,!0),At("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new o.a;"function"===typeof e&&r.promise.catch((function(){}));var i=function(t,n,i){t?r.reject(t):r.resolve(new pi(n,i)),"function"===typeof e&&e(t,n,i)};return ni(this.repo,this.path,t,i,n),r.promise},e.prototype.setPriority=function(t,e){Object(o.K)("Reference.setPriority",1,2,arguments.length),Ct("Reference.setPriority",this.path),Tt("Reference.setPriority",1,t,!1),Object(o.L)("Reference.setPriority",2,e,!0);var n=new o.a;return Hr(this.repo,Q(this.path,".priority"),t,null,n.wrapCallback(e)),n.promise},e.prototype.push=function(t,e){Object(o.K)("Reference.push",0,2,arguments.length),Ct("Reference.push",this.path),_t("Reference.push",1,t,this.path,!0),Object(o.L)("Reference.push",2,e,!0);var n,r=Lr(this.repo),i=Ce(r),a=this.child(i),s=this.child(i);return n=null!=t?a.set(t,e).then((function(){return s})):Promise.resolve(s),a.then=n.then.bind(n),a.catch=n.then.bind(n,void 0),"function"===typeof e&&n.catch((function(){})),a},e.prototype.onDisconnect=function(){return Ct("Reference.onDisconnect",this.path),new di(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()}
2,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!1,configurable:!0}),e}(bi);bi.__referenceConstructor=_i,function(t){Object(o.f)(!qe,"__referenceConstructor has already been defined"),qe=t}(_i);var wi=function(){function t(t,e){var n=this;this.app_=t,this.authProvider_=e,this.auth_=null,this.auth_=e.getImmediate({optional:!0}),this.auth_||e.get().then((function(t){return n.auth_=t}))}return t.prototype.getToken=function(t){return this.auth_?this.auth_.getToken(t).catch((function(t){return t&&"auth/token-not-initialized"===t.code?(_("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)})):Promise.resolve(null)},t.prototype.addTokenChangeListener=function(t){this.auth_?this.auth_.addAuthTokenListener(t):(setTimeout((function(){return t(null)}),0),this.authProvider_.get().then((function(e){return e.addAuthTokenListener(t)})))},t.prototype.removeTokenChangeListener=function(t){this.authProvider_.get().then((function(e){return e.removeAuthTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?t+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',E(t)},t}(),xi=function(){function t(){}return t.prototype.getToken=function(e){return Promise.resolve({accessToken:t.EMULATOR_AUTH_TOKEN})},t.prototype.addTokenChangeListener=function(e){e(t.EMULATOR_AUTH_TOKEN)},t.prototype.removeTokenChangeListener=function(t){},t.prototype.notifyForInvalidToken=function(){},t.EMULATOR_AUTH_TOKEN="owner",t}(),Ti={},Ei=!1;function Si(e,n,r,i){var a=r||e.options.databaseURL;void 0===a&&(e.options.projectId||T("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),_("Using default host for project ",e.options.projectId),a=e.options.projectId+"-default-rtdb.firebaseio.com");var s,u=ft(a,i),c=u.repoInfo,l=void 0;"undefined"!==typeof t&&(l=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).FIREBASE_DATABASE_EMULATOR_HOST),l?(s=!0,a="http://"+l+"?ns="+c.namespace,c=(u=ft(a,i)).repoInfo):s=!u.repoInfo.secure;var h=i&&s?new xi:new wi(e,n);return Mt("Invalid Firebase Database URL",1,u),J(u.path)||T("Database URL must point to the root of a Firebase Database (not including a child path)."),ei(function(t,e,n){var r=Object(o.G)(Ti,e.name);r||(r={},Ti[e.name]=r);var i=Object(o.G)(r,t.toURLString());i&&T("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return i=new Rr(t,Ei,e,n),r[t.toURLString()]=i,i}(c,e,h))}var Oi=function(){function t(t){var e=this;this.repoInternal_=t,this.instanceStarted_=!1,this.INTERNAL={delete:function(){return Object(i.b)(e,void 0,void 0,(function(){return Object(i.d)(this,(function(t){return this.checkDeleted_("delete"),function(t){var e=Object(o.G)(Ti,t.app.name);e&&Object(o.G)(e,t.key)===t||T("Database "+t.app.name+"("+t.repoInfo_+") has already been deleted."),Jr(t),delete e[t.key]}(this.repo_),this.repoInternal_=null,this.rootInternal_=null,[2]}))}))}},t instanceof Rr||T("Don't call new Database() directly - please use firebase.database().")}return Object.defineProperty(t.prototype,"repo_",{get:function(){return this.instanceStarted_||(Nr(this.repoInternal_),this.instanceStarted_=!0),this.repoInternal_}
2,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root_",{get:function(){return this.rootInternal_||(this.rootInternal_=new _i(this.repo_,z())),this.rootInternal_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"app",{get:function(){return this.repo_.app},enumerable:!1,configurable:!0}),t.prototype.useEmulator=function(t,e){this.checkDeleted_("useEmulator"),this.instanceStarted_?T("Cannot call useEmulator() after instance has already been initialized."):function(t,e,n){t.repoInfo_=new ct(e+":"+n,!1,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams),t.repoInfo_.nodeAdmin&&(t.authTokenProvider_=new xi)}(this.repoInternal_,t,e)},t.prototype.ref=function(t){return this.checkDeleted_("ref"),Object(o.K)("database.ref",0,1,arguments.length),t instanceof _i?this.refFromURL(t.toString()):void 0!==t?this.root_.child(t):this.root_},t.prototype.refFromURL=function(t){var e="database.refFromURL";this.checkDeleted_(e),Object(o.K)(e,1,1,arguments.length);var n=ft(t,this.repo_.repoInfo_.nodeAdmin);Mt(e,1,n);var r=n.repoInfo;return this.repo_.repoInfo_.isCustomHost()||r.host===this.repo_.repoInfo_.host||T(e+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},t.prototype.checkDeleted_=function(t){null===this.repoInternal_&&T("Cannot call "+t+" on a deleted database.")},t.prototype.goOffline=function(){Object(o.K)("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),Jr(this.repo_)},t.prototype.goOnline=function(){Object(o.K)("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),Zr(this.repo_)},t.ServerValue={TIMESTAMP:{".sv":"timestamp"},increment:function(t){return{".sv":{increment:t}}}},t}();var ki=Object.freeze({__proto__:null,forceLongPolling:function(){mr.forceDisallow(),hr.forceAllow()},forceWebSockets:function(){hr.forceDisallow()},isWebSocketsAvailable:function(){return mr.isAvailable()},setSecurityDebugCallback:function(t,e){t.repo.persistentConnection_.securityDebugCallback_=e},stats:function(t,e){!function(t,e){if(void 0===e&&(e=!1),"undefined"!==typeof console){var n;e?(t.statsListener_||(t.statsListener_=new Jn(t.stats_)),n=t.statsListener_.get()):n=t.stats_.get();var r=Object.keys(n).reduce((function(t,e){return Math.max(e.length,t)}),0);P(n,(function(t,e){for(var n=t,i=t.length;i<r+2;i++)n+=" ";console.log(n+e)}))}}(t.repo,e)},statsIncrementCounter:function(t,e){!function(t,e){var n,r;t.stats_.incrementCounter(e),n=t.statsReporter_,r=e,n.statsToReport_[r]=!0}(t.repo,e)},dataUpdateCount:function(t){return t.repo.dataUpdateCount},interceptServerData:function(t,e){return function(t,e){t.interceptServerDataCallback_=e}(t.repo,e)},initStandalone:function(t){var e=t.app,n=t.url,r=t.version,i=t.customAuthImpl,o=t.namespace,a=t.nodeAdmin,u=void 0!==a&&a;pr(r);var c=new s.c("auth-internal",new s.b("database-standalone"));return c.setComponent(new s.a("auth-internal",(function(){return i}),"PRIVATE")),{instance:Si(e,c,n,u),namespace:o}}}),Ci=wr;wr.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},wr.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var Mi=yr,Ai=ct,Ii=Object.freeze({__proto__:null,DataConnection:Ci,RealTimeConnection:Mi,hijackHash:function(t){var e=wr.prototype.put;return wr.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){wr.prototype.put=e}},ConnectionTarget:Ai,queryIdentifier:function(t){return t.queryIdentifier()},forceRestClient:function(t){!function(t){Ei=t}(t)}}),ji=Oi.ServerValue;!function(t){pr(t.SDK_VERSION);var n=t.INTERNAL.registerComponent(new s.a("database",(function(t,e){return Si(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"),e,void 0)}),"PUBLIC").setServiceProps({Reference:_i,Query:bi,Database:Oi,DataSnapshot:Tr,enableLogging:b,INTERNAL:ki,ServerValue:ji,TEST_ACCESS:Ii}).setMultipleInstances(!0));t.registerVersion("@firebase/database","0.9.5"),Object(o.z)()&&(e.exports=n)}(r.a)}).call(this,n(54),n(149)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){"use strict";n(80)}]]); 3//# sourceMappingURL=2.da820321.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.