@neurosity/sdk 6.2.1-next.2 → 6.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/neurosity.iife.js +48717 -0
- package/dist/browser/neurosity.js +666 -0
- package/dist/browser/neurosity.js.map +1 -0
- package/dist/{Neurosity.d.ts → cjs/Neurosity.d.ts} +2 -116
- package/dist/cjs/Neurosity.js +1244 -0
- package/dist/{api → cjs/api}/bluetooth/BluetoothClient.d.ts +6 -6
- package/dist/cjs/api/bluetooth/BluetoothClient.js +310 -0
- package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +33 -0
- package/dist/cjs/api/bluetooth/BluetoothTransport.js +2 -0
- package/dist/{api → cjs/api}/bluetooth/constants.d.ts +0 -0
- package/dist/cjs/api/bluetooth/constants.js +9 -0
- package/dist/{api → cjs/api}/bluetooth/index.d.ts +0 -0
- package/dist/cjs/api/bluetooth/index.js +21 -0
- package/dist/{api → cjs/api}/bluetooth/react-native/ReactNativeTransport.d.ts +4 -4
- package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.js +411 -0
- package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.d.ts +63 -0
- package/dist/cjs/api/bluetooth/react-native/types/BleManagerTypes.js +11 -0
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +180 -0
- package/dist/cjs/api/bluetooth/react-native/types/ReactNativeTypes.js +10 -0
- package/dist/{api → cjs/api}/bluetooth/types/index.d.ts +2 -2
- package/dist/cjs/api/bluetooth/types/index.js +22 -0
- package/dist/{api → cjs/api}/bluetooth/utils/create6DigitPin.d.ts +0 -0
- package/dist/cjs/api/bluetooth/utils/create6DigitPin.js +8 -0
- package/dist/{api → cjs/api}/bluetooth/utils/csvBufferToEpoch.d.ts +0 -0
- package/dist/cjs/api/bluetooth/utils/csvBufferToEpoch.js +36 -0
- package/dist/{api → cjs/api}/bluetooth/utils/encoding.d.ts +0 -0
- package/dist/cjs/api/bluetooth/utils/encoding.js +22 -0
- package/dist/{api → cjs/api}/bluetooth/utils/osHasBluetoothSupport.d.ts +0 -0
- package/dist/cjs/api/bluetooth/utils/osHasBluetoothSupport.js +23 -0
- package/dist/{api → cjs/api}/bluetooth/utils/stitch.d.ts +1 -1
- package/dist/cjs/api/bluetooth/utils/stitch.js +22 -0
- package/dist/{api → cjs/api}/bluetooth/web/WebBluetoothTransport.d.ts +1 -1
- package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.js +430 -0
- package/dist/{api → cjs/api}/bluetooth/web/isMaybeWebWorkerContext.d.ts +0 -0
- package/dist/cjs/api/bluetooth/web/isMaybeWebWorkerContext.js +8 -0
- package/dist/{api → cjs/api}/bluetooth/web/isWebBluetoothSupported.d.ts +0 -0
- package/dist/cjs/api/bluetooth/web/isWebBluetoothSupported.js +11 -0
- package/dist/{api → cjs/api}/firebase/FirebaseApp.d.ts +0 -0
- package/dist/cjs/api/firebase/FirebaseApp.js +70 -0
- package/dist/{api → cjs/api}/firebase/FirebaseDevice.d.ts +1 -1
- package/dist/cjs/api/firebase/FirebaseDevice.js +146 -0
- package/dist/{api → cjs/api}/firebase/FirebaseUser.d.ts +0 -0
- package/dist/cjs/api/firebase/FirebaseUser.js +434 -0
- package/dist/{api → cjs/api}/firebase/config.d.ts +0 -0
- package/dist/cjs/api/firebase/config.js +11 -0
- package/dist/{api → cjs/api}/firebase/deviceStore.d.ts +0 -0
- package/dist/cjs/api/firebase/deviceStore.js +191 -0
- package/dist/{api → cjs/api}/firebase/index.d.ts +0 -0
- package/dist/cjs/api/firebase/index.js +19 -0
- package/dist/{api → cjs/api}/https/config.d.ts +0 -0
- package/dist/cjs/api/https/config.js +4 -0
- package/dist/{api → cjs/api}/https/createOAuthURL.d.ts +0 -0
- package/dist/cjs/api/https/createOAuthURL.js +18 -0
- package/dist/{api → cjs/api}/https/getOAuthToken.d.ts +0 -0
- package/dist/cjs/api/https/getOAuthToken.js +34 -0
- package/dist/{api → cjs/api}/https/utils.d.ts +0 -0
- package/dist/cjs/api/https/utils.js +13 -0
- package/dist/{api → cjs/api}/index.d.ts +0 -8
- package/dist/cjs/api/index.js +307 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- package/dist/cjs/index.js +18 -0
- package/dist/{subscriptions → cjs/subscriptions}/SubscriptionManager.d.ts +0 -0
- package/dist/cjs/subscriptions/SubscriptionManager.js +27 -0
- package/dist/{timesync → cjs/timesync}/Timesync.d.ts +1 -1
- package/dist/cjs/timesync/Timesync.js +78 -0
- package/dist/{timesync → cjs/timesync}/index.d.ts +0 -0
- package/dist/cjs/timesync/index.js +17 -0
- package/dist/cjs/types/accelerometer.d.ts +10 -0
- package/dist/cjs/types/accelerometer.js +2 -0
- package/dist/cjs/types/actions.d.ts +16 -0
- package/dist/cjs/types/actions.js +2 -0
- package/dist/cjs/types/awareness.d.ts +1 -0
- package/dist/cjs/types/awareness.js +2 -0
- package/dist/cjs/types/brainwaves.d.ts +26 -0
- package/dist/cjs/types/brainwaves.js +2 -0
- package/dist/cjs/types/calm.d.ts +6 -0
- package/dist/cjs/types/calm.js +2 -0
- package/dist/cjs/types/client.d.ts +22 -0
- package/dist/cjs/types/client.js +2 -0
- package/dist/cjs/types/credentials.d.ts +12 -0
- package/dist/cjs/types/credentials.js +2 -0
- package/dist/cjs/types/deviceInfo.d.ts +18 -0
- package/dist/cjs/types/deviceInfo.js +2 -0
- package/dist/cjs/types/epoch.d.ts +12 -0
- package/dist/cjs/types/epoch.js +2 -0
- package/dist/cjs/types/experiment.d.ts +9 -0
- package/dist/cjs/types/experiment.js +2 -0
- package/dist/cjs/types/focus.d.ts +6 -0
- package/dist/cjs/types/focus.js +2 -0
- package/dist/cjs/types/hapticEffects.d.ts +125 -0
- package/dist/cjs/types/hapticEffects.js +2 -0
- package/dist/cjs/types/kinesis.d.ts +6 -0
- package/dist/cjs/types/kinesis.js +2 -0
- package/dist/cjs/types/marker.d.ts +7 -0
- package/dist/cjs/types/marker.js +2 -0
- package/dist/cjs/types/metrics.d.ts +21 -0
- package/dist/cjs/types/metrics.js +2 -0
- package/dist/cjs/types/oauth.d.ts +20 -0
- package/dist/cjs/types/oauth.js +2 -0
- package/dist/cjs/types/options.d.ts +51 -0
- package/dist/cjs/types/options.js +2 -0
- package/dist/cjs/types/sample.d.ts +15 -0
- package/dist/cjs/types/sample.js +2 -0
- package/dist/cjs/types/settings.d.ts +13 -0
- package/dist/cjs/types/settings.js +2 -0
- package/dist/cjs/types/signalQuality.d.ts +13 -0
- package/dist/cjs/types/signalQuality.js +2 -0
- package/dist/cjs/types/skill.d.ts +68 -0
- package/dist/cjs/types/skill.js +2 -0
- package/dist/{types → cjs/types}/status.d.ts +0 -0
- package/dist/cjs/types/status.js +22 -0
- package/dist/{types → cjs/types}/streaming.d.ts +0 -0
- package/dist/cjs/types/streaming.js +20 -0
- package/dist/cjs/types/subscriptions.d.ts +23 -0
- package/dist/cjs/types/subscriptions.js +2 -0
- package/dist/cjs/types/training.d.ts +19 -0
- package/dist/cjs/types/training.js +2 -0
- package/dist/cjs/types/user.d.ts +12 -0
- package/dist/cjs/types/user.js +2 -0
- package/dist/{utils → cjs/utils}/errors.d.ts +0 -0
- package/dist/cjs/utils/errors.js +17 -0
- package/dist/{utils → cjs/utils}/filterInternalKeys.d.ts +0 -0
- package/dist/cjs/utils/filterInternalKeys.js +21 -0
- package/dist/{utils → cjs/utils}/hapticEffects.d.ts +0 -0
- package/dist/cjs/utils/hapticEffects.js +130 -0
- package/dist/{utils → cjs/utils}/heartbeat.d.ts +0 -0
- package/dist/cjs/utils/heartbeat.js +41 -0
- package/dist/{utils → cjs/utils}/is-node.d.ts +0 -0
- package/dist/cjs/utils/is-node.js +9 -0
- package/dist/cjs/utils/metrics.d.ts +1 -0
- package/dist/cjs/utils/metrics.js +56 -0
- package/dist/{utils → cjs/utils}/oauth.d.ts +1 -1
- package/dist/cjs/utils/oauth.js +92 -0
- package/dist/cjs/utils/pick.d.ts +1 -0
- package/dist/cjs/utils/pick.js +5 -0
- package/dist/{utils → cjs/utils}/pipes.d.ts +0 -0
- package/dist/cjs/utils/pipes.js +71 -0
- package/dist/{utils → cjs/utils}/platform.d.ts +0 -0
- package/dist/cjs/utils/platform.js +47 -0
- package/dist/{utils → cjs/utils}/subscription.d.ts +0 -0
- package/dist/cjs/utils/subscription.js +55 -0
- package/dist/cjs/utils/transferDevice.d.ts +9 -0
- package/dist/cjs/utils/transferDevice.js +2 -0
- package/dist/{utils → cjs/utils}/whileOnline.d.ts +1 -1
- package/dist/cjs/utils/whileOnline.js +15 -0
- package/dist/electron/index.js +86 -0
- package/dist/electron/index.js.map +1 -0
- package/dist/esm/Neurosity.d.ts +619 -0
- package/dist/esm/Neurosity.js +1213 -0
- package/dist/esm/api/bluetooth/BluetoothClient.d.ts +72 -0
- package/dist/esm/api/bluetooth/BluetoothClient.js +306 -0
- package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +33 -0
- package/dist/esm/api/bluetooth/BluetoothTransport.js +1 -0
- package/dist/esm/api/bluetooth/constants.d.ts +4 -0
- package/dist/esm/api/bluetooth/constants.js +6 -0
- package/dist/esm/api/bluetooth/index.d.ts +5 -0
- package/dist/esm/api/bluetooth/index.js +5 -0
- package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +70 -0
- package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.js +407 -0
- package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.d.ts +63 -0
- package/dist/esm/api/bluetooth/react-native/types/BleManagerTypes.js +8 -0
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.d.ts +180 -0
- package/dist/esm/api/bluetooth/react-native/types/ReactNativeTypes.js +9 -0
- package/dist/esm/api/bluetooth/types/index.d.ts +31 -0
- package/dist/esm/api/bluetooth/types/index.js +19 -0
- package/dist/esm/api/bluetooth/utils/create6DigitPin.d.ts +1 -0
- package/dist/esm/api/bluetooth/utils/create6DigitPin.js +4 -0
- package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.d.ts +11 -0
- package/dist/esm/api/bluetooth/utils/csvBufferToEpoch.js +31 -0
- package/dist/esm/api/bluetooth/utils/encoding.d.ts +3 -0
- package/dist/esm/api/bluetooth/utils/encoding.js +17 -0
- package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.d.ts +2 -0
- package/dist/esm/api/bluetooth/utils/osHasBluetoothSupport.js +16 -0
- package/dist/esm/api/bluetooth/utils/stitch.d.ts +5 -0
- package/dist/esm/api/bluetooth/utils/stitch.js +18 -0
- package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +54 -0
- package/dist/esm/api/bluetooth/web/WebBluetoothTransport.js +426 -0
- package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.d.ts +1 -0
- package/dist/esm/api/bluetooth/web/isMaybeWebWorkerContext.js +4 -0
- package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.d.ts +1 -0
- package/dist/esm/api/bluetooth/web/isWebBluetoothSupported.js +7 -0
- package/dist/esm/api/firebase/FirebaseApp.d.ts +20 -0
- package/dist/esm/api/firebase/FirebaseApp.js +63 -0
- package/dist/esm/api/firebase/FirebaseDevice.d.ts +68 -0
- package/dist/esm/api/firebase/FirebaseDevice.js +139 -0
- package/dist/esm/api/firebase/FirebaseUser.d.ts +53 -0
- package/dist/esm/api/firebase/FirebaseUser.js +426 -0
- package/dist/esm/api/firebase/config.d.ts +8 -0
- package/dist/esm/api/firebase/config.js +8 -0
- package/dist/esm/api/firebase/deviceStore.d.ts +26 -0
- package/dist/esm/api/firebase/deviceStore.js +184 -0
- package/dist/esm/api/firebase/index.d.ts +3 -0
- package/dist/esm/api/firebase/index.js +3 -0
- package/dist/esm/api/https/config.d.ts +1 -0
- package/dist/esm/api/https/config.js +1 -0
- package/dist/esm/api/https/createOAuthURL.d.ts +3 -0
- package/dist/esm/api/https/createOAuthURL.js +11 -0
- package/dist/esm/api/https/getOAuthToken.d.ts +3 -0
- package/dist/esm/api/https/getOAuthToken.js +27 -0
- package/dist/esm/api/https/utils.d.ts +2 -0
- package/dist/esm/api/https/utils.js +9 -0
- package/dist/esm/api/index.d.ts +109 -0
- package/dist/esm/api/index.js +300 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/neurosity.mjs +48705 -0
- package/dist/esm/subscriptions/SubscriptionManager.d.ts +11 -0
- package/dist/esm/subscriptions/SubscriptionManager.js +23 -0
- package/dist/esm/timesync/Timesync.d.ts +20 -0
- package/dist/esm/timesync/Timesync.js +71 -0
- package/dist/esm/timesync/index.d.ts +1 -0
- package/dist/esm/timesync/index.js +1 -0
- package/dist/esm/types/accelerometer.d.ts +10 -0
- package/dist/esm/types/accelerometer.js +1 -0
- package/dist/esm/types/actions.d.ts +16 -0
- package/dist/esm/types/actions.js +1 -0
- package/dist/esm/types/awareness.d.ts +1 -0
- package/dist/esm/types/awareness.js +1 -0
- package/dist/esm/types/brainwaves.d.ts +26 -0
- package/dist/esm/types/brainwaves.js +1 -0
- package/dist/esm/types/calm.d.ts +6 -0
- package/dist/esm/types/calm.js +1 -0
- package/dist/esm/types/client.d.ts +22 -0
- package/dist/esm/types/client.js +1 -0
- package/dist/esm/types/credentials.d.ts +12 -0
- package/dist/esm/types/credentials.js +1 -0
- package/dist/esm/types/deviceInfo.d.ts +18 -0
- package/dist/esm/types/deviceInfo.js +1 -0
- package/dist/esm/types/epoch.d.ts +12 -0
- package/dist/esm/types/epoch.js +1 -0
- package/dist/esm/types/experiment.d.ts +9 -0
- package/dist/esm/types/experiment.js +1 -0
- package/dist/esm/types/focus.d.ts +6 -0
- package/dist/esm/types/focus.js +1 -0
- package/dist/esm/types/hapticEffects.d.ts +125 -0
- package/dist/esm/types/hapticEffects.js +1 -0
- package/dist/esm/types/kinesis.d.ts +6 -0
- package/dist/esm/types/kinesis.js +1 -0
- package/dist/esm/types/marker.d.ts +7 -0
- package/dist/esm/types/marker.js +1 -0
- package/dist/esm/types/metrics.d.ts +21 -0
- package/dist/esm/types/metrics.js +1 -0
- package/dist/esm/types/oauth.d.ts +20 -0
- package/dist/esm/types/oauth.js +1 -0
- package/dist/esm/types/options.d.ts +51 -0
- package/dist/esm/types/options.js +1 -0
- package/dist/esm/types/sample.d.ts +15 -0
- package/dist/esm/types/sample.js +1 -0
- package/dist/esm/types/settings.d.ts +13 -0
- package/dist/esm/types/settings.js +1 -0
- package/dist/esm/types/signalQuality.d.ts +13 -0
- package/dist/esm/types/signalQuality.js +1 -0
- package/dist/esm/types/skill.d.ts +68 -0
- package/dist/esm/types/skill.js +1 -0
- package/dist/esm/types/status.d.ts +26 -0
- package/dist/esm/types/status.js +19 -0
- package/dist/esm/types/streaming.d.ts +15 -0
- package/dist/esm/types/streaming.js +17 -0
- package/dist/esm/types/subscriptions.d.ts +23 -0
- package/dist/esm/types/subscriptions.js +1 -0
- package/dist/esm/types/training.d.ts +19 -0
- package/dist/esm/types/training.js +1 -0
- package/dist/esm/types/user.d.ts +12 -0
- package/dist/esm/types/user.js +1 -0
- package/dist/esm/utils/errors.d.ts +5 -0
- package/dist/esm/utils/errors.js +11 -0
- package/dist/esm/utils/filterInternalKeys.d.ts +3 -0
- package/dist/esm/utils/filterInternalKeys.js +17 -0
- package/dist/esm/utils/hapticEffects.d.ts +123 -0
- package/dist/esm/utils/hapticEffects.js +125 -0
- package/dist/esm/utils/heartbeat.d.ts +4 -0
- package/dist/esm/utils/heartbeat.js +33 -0
- package/dist/esm/utils/is-node.d.ts +1 -0
- package/dist/esm/utils/is-node.js +5 -0
- package/dist/esm/utils/metrics.d.ts +1 -0
- package/dist/esm/utils/metrics.js +52 -0
- package/dist/esm/utils/oauth.d.ts +9 -0
- package/dist/esm/utils/oauth.js +64 -0
- package/dist/esm/utils/pick.d.ts +1 -0
- package/dist/esm/utils/pick.js +1 -0
- package/dist/esm/utils/pipes.d.ts +46 -0
- package/dist/esm/utils/pipes.js +65 -0
- package/dist/esm/utils/platform.d.ts +30 -0
- package/dist/esm/utils/platform.js +41 -0
- package/dist/esm/utils/subscription.d.ts +6 -0
- package/dist/esm/utils/subscription.js +24 -0
- package/dist/esm/utils/transferDevice.d.ts +9 -0
- package/dist/esm/utils/transferDevice.js +1 -0
- package/dist/esm/utils/whileOnline.d.ts +8 -0
- package/dist/esm/utils/whileOnline.js +11 -0
- package/dist/examples/auth.html +32 -0
- package/dist/examples/cloud.html +17 -0
- package/dist/examples/index.html +1 -0
- package/dist/examples/neurosity.iife.js +48717 -0
- package/dist/examples/neurosity.js +666 -0
- package/dist/examples/neurosity.mjs +48705 -0
- package/dist/examples/training.html +49 -0
- package/package.json +23 -18
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.m.js +0 -2
- package/dist/index.m.js.map +0 -1
- package/dist/index.umd.js +0 -2
- package/dist/index.umd.js.map +0 -1
- package/dist/utils/metrics.d.ts +0 -6
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"B5W1":[function(require,module,exports) {
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__extends=e,exports.__rest=n,exports.__decorate=o,exports.__param=a,exports.__metadata=i,exports.__awaiter=c,exports.__generator=u,exports.__exportStar=l,exports.__values=s,exports.__read=p,exports.__spread=y,exports.__spreadArrays=h,exports.__spreadArray=_,exports.__await=d,exports.__asyncGenerator=b,exports.__asyncDelegator=v,exports.__asyncValues=w,exports.__makeTemplateObject=x,exports.__importStar=O,exports.__importDefault=g,exports.__classPrivateFieldGet=j,exports.__classPrivateFieldSet=P,exports.__classPrivateFieldIn=S,exports.__createBinding=exports.__assign=void 0;var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};function e(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return exports.__assign=r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function n(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function o(t,e,r,n){var o,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(i=(a<3?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i}function a(t,e){return function(r,n){e(r,n,t)}}function i(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,r,n){return new(r||(r=Promise))(function(o,a){function i(t){try{u(n.next(t))}catch(e){a(e)}}function c(t){try{u(n.throw(t))}catch(e){a(e)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(i,c)}u((n=n.apply(t,e||[])).next())})}function u(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(c){a=[6,c],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}exports.__assign=r;var f=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&("get"in o?e.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]};function l(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||f(e,t,r)}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,a=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function h(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var a=arguments[e],i=0,c=a.length;i<c;i++,o++)n[o]=a[i];return n}function _(t,e,r){if(r||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function d(t){return this instanceof d?(this.v=t,this):new d(t)}function b(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(t){o[t]&&(n[t]=function(e){return new Promise(function(r,n){a.push([t,e,r,n])>1||c(t,e)})})}function c(t,e){try{(r=o[t](e)).value instanceof d?Promise.resolve(r.value.v).then(u,f):l(a[0][2],r)}catch(n){l(a[0][3],n)}var r}function u(t){c("next",t)}function f(t){c("throw",t)}function l(t,e){t(e),a.shift(),a.length&&c(a[0][0],a[0][1])}}function v(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:d(t[n](e)),done:"return"===n}:o?o(e):e}:o}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof s?s(t):t[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,o){(function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)})(n,o,(e=t[r](e)).done,e.value)})}}}function x(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}exports.__createBinding=f;var m=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function O(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&f(e,t,r);return m(e,t),e}function g(t){return t&&t.__esModule?t:{default:t}}function j(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function P(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}function S(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}
|
|
3
|
+
},{}],"IMGL":[function(require,module,exports) {
|
|
4
|
+
"use strict";function e(e){return"function"==typeof e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isFunction=e;
|
|
5
|
+
},{}],"Le7P":[function(require,module,exports) {
|
|
6
|
+
"use strict";function r(r){var t=r(function(r){Error.call(r),r.stack=(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.createErrorClass=r;
|
|
7
|
+
},{}],"Ns3F":[function(require,module,exports) {
|
|
8
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UnsubscriptionError=void 0;var r=require("./createErrorClass"),e=(0,r.createErrorClass)(function(r){return function(e){r(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(r,e){return e+1+") "+r.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}});exports.UnsubscriptionError=e;
|
|
9
|
+
},{"./createErrorClass":"Le7P"}],"h9cX":[function(require,module,exports) {
|
|
10
|
+
"use strict";function e(e,r){if(e){var t=e.indexOf(r);0<=t&&e.splice(t,1)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.arrRemove=e;
|
|
11
|
+
},{}],"Atlq":[function(require,module,exports) {
|
|
12
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isSubscription=a,exports.EMPTY_SUBSCRIPTION=exports.Subscription=void 0;var r=require("tslib"),e=require("./util/isFunction"),i=require("./util/UnsubscriptionError"),t=require("./util/arrRemove"),n=function(){function n(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}var s;return n.prototype.unsubscribe=function(){var t,n,s,a,u;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var c=(0,r.__values)(l),f=c.next();!f.done;f=c.next()){f.value.remove(this)}}catch(y){t={error:y}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}else l.remove(this);var p=this.initialTeardown;if((0,e.isFunction)(p))try{p()}catch(b){u=b instanceof i.UnsubscriptionError?b.errors:[b]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var _=(0,r.__values)(h),v=_.next();!v.done;v=_.next()){var d=v.value;try{o(d)}catch(P){u=null!=u?u:[],P instanceof i.UnsubscriptionError?u=(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(u)),(0,r.__read)(P.errors)):u.push(P)}}}catch(x){s={error:x}}finally{try{v&&!v.done&&(a=_.return)&&a.call(_)}finally{if(s)throw s.error}}}if(u)throw new i.UnsubscriptionError(u)}},n.prototype.add=function(r){var e;if(r&&r!==this)if(this.closed)o(r);else{if(r instanceof n){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=null!==(e=this._finalizers)&&void 0!==e?e:[]).push(r)}},n.prototype._hasParent=function(r){var e=this._parentage;return e===r||Array.isArray(e)&&e.includes(r)},n.prototype._addParent=function(r){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(r),e):e?[e,r]:r},n.prototype._removeParent=function(r){var e=this._parentage;e===r?this._parentage=null:Array.isArray(e)&&(0,t.arrRemove)(e,r)},n.prototype.remove=function(r){var e=this._finalizers;e&&(0,t.arrRemove)(e,r),r instanceof n&&r._removeParent(this)},n.EMPTY=((s=new n).closed=!0,s),n}();exports.Subscription=n;var s=n.EMPTY;function a(r){return r instanceof n||r&&"closed"in r&&(0,e.isFunction)(r.remove)&&(0,e.isFunction)(r.add)&&(0,e.isFunction)(r.unsubscribe)}function o(r){(0,e.isFunction)(r)?r():r.unsubscribe()}exports.EMPTY_SUBSCRIPTION=s;
|
|
13
|
+
},{"tslib":"B5W1","./util/isFunction":"IMGL","./util/UnsubscriptionError":"Ns3F","./util/arrRemove":"h9cX"}],"nBrU":[function(require,module,exports) {
|
|
14
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.config=void 0;var e={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};exports.config=e;
|
|
15
|
+
},{}],"a7wS":[function(require,module,exports) {
|
|
16
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeoutProvider=void 0;var e=require("tslib"),r={setTimeout:function(t,o){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u=r.delegate;return(null==u?void 0:u.setTimeout)?u.setTimeout.apply(u,(0,e.__spreadArray)([t,o],(0,e.__read)(i))):setTimeout.apply(void 0,(0,e.__spreadArray)([t,o],(0,e.__read)(i)))},clearTimeout:function(e){var t=r.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};exports.timeoutProvider=r;
|
|
17
|
+
},{"tslib":"B5W1"}],"qGAn":[function(require,module,exports) {
|
|
18
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reportUnhandledError=o;var e=require("../config"),r=require("../scheduler/timeoutProvider");function o(o){r.timeoutProvider.setTimeout(function(){var r=e.config.onUnhandledError;if(!r)throw o;r(o)})}
|
|
19
|
+
},{"../config":"nBrU","../scheduler/timeoutProvider":"a7wS"}],"hNvY":[function(require,module,exports) {
|
|
20
|
+
"use strict";function e(){}Object.defineProperty(exports,"__esModule",{value:!0}),exports.noop=e;
|
|
21
|
+
},{}],"g9eN":[function(require,module,exports) {
|
|
22
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.errorNotification=t,exports.nextNotification=e,exports.createNotification=r,exports.COMPLETE_NOTIFICATION=void 0;var o=r("C",void 0,void 0);function t(o){return r("E",void 0,o)}function e(o){return r("N",o,void 0)}function r(o,t,e){return{kind:o,value:t,error:e}}exports.COMPLETE_NOTIFICATION=o;
|
|
23
|
+
},{}],"X9Ul":[function(require,module,exports) {
|
|
24
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.errorContext=o,exports.captureError=n;var r=require("../config"),e=null;function o(o){if(r.config.useDeprecatedSynchronousErrorHandling){var n=!e;if(n&&(e={errorThrown:!1,error:null}),o(),n){var t=e,u=t.errorThrown,i=t.error;if(e=null,u)throw i}}else o()}function n(o){r.config.useDeprecatedSynchronousErrorHandling&&e&&(e.errorThrown=!0,e.error=o)}
|
|
25
|
+
},{"../config":"nBrU"}],"j5Gi":[function(require,module,exports) {
|
|
26
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EMPTY_OBSERVER=exports.SafeSubscriber=exports.Subscriber=void 0;var t=require("tslib"),e=require("./util/isFunction"),r=require("./Subscription"),i=require("./config"),o=require("./util/reportUnhandledError"),n=require("./util/noop"),s=require("./NotificationFactories"),c=require("./scheduler/timeoutProvider"),u=require("./util/errorContext"),p=function(e){function i(t){var i=e.call(this)||this;return i.isStopped=!1,t?(i.destination=t,(0,r.isSubscription)(t)&&t.add(i)):i.destination=v,i}return(0,t.__extends)(i,e),i.create=function(t,e,r){return new d(t,e,r)},i.prototype.next=function(t){this.isStopped?x((0,s.nextNotification)(t),this):this._next(t)},i.prototype.error=function(t){this.isStopped?x((0,s.errorNotification)(t),this):(this.isStopped=!0,this._error(t))},i.prototype.complete=function(){this.isStopped?x(s.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},i.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},i.prototype._next=function(t){this.destination.next(t)},i.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},i.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},i}(r.Subscription);exports.Subscriber=p;var a=Function.prototype.bind;function l(t,e){return a.call(t,e)}var f=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(r){h(r)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(r){h(r)}else h(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){h(e)}},t}(),d=function(r){function o(t,o,n){var s,c,u=r.call(this)||this;(0,e.isFunction)(t)||!t?s={next:null!=t?t:void 0,error:null!=o?o:void 0,complete:null!=n?n:void 0}:u&&i.config.useDeprecatedNextContext?((c=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},s={next:t.next&&l(t.next,c),error:t.error&&l(t.error,c),complete:t.complete&&l(t.complete,c)}):s=t;return u.destination=new f(s),u}return(0,t.__extends)(o,r),o}(p);function h(t){i.config.useDeprecatedSynchronousErrorHandling?(0,u.captureError)(t):(0,o.reportUnhandledError)(t)}function b(t){throw t}function x(t,e){var r=i.config.onStoppedNotification;r&&c.timeoutProvider.setTimeout(function(){return r(t,e)})}exports.SafeSubscriber=d;var v={closed:!0,next:n.noop,error:b,complete:n.noop};exports.EMPTY_OBSERVER=v;
|
|
27
|
+
},{"tslib":"B5W1","./util/isFunction":"IMGL","./Subscription":"Atlq","./config":"nBrU","./util/reportUnhandledError":"qGAn","./util/noop":"hNvY","./NotificationFactories":"g9eN","./scheduler/timeoutProvider":"a7wS","./util/errorContext":"X9Ul"}],"ubx8":[function(require,module,exports) {
|
|
28
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.observable=void 0;var e="function"==typeof Symbol&&Symbol.observable||"@@observable";exports.observable=e;
|
|
29
|
+
},{}],"FeLp":[function(require,module,exports) {
|
|
30
|
+
"use strict";function e(e){return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.identity=e;
|
|
31
|
+
},{}],"eq9W":[function(require,module,exports) {
|
|
32
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pipe=r,exports.pipeFromArray=t;var e=require("./identity");function r(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(e)}function t(r){return 0===r.length?e.identity:1===r.length?r[0]:function(e){return r.reduce(function(e,r){return r(e)},e)}}
|
|
33
|
+
},{"./identity":"FeLp"}],"EkNV":[function(require,module,exports) {
|
|
34
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Observable=void 0;var r=require("./Subscriber"),e=require("./Subscription"),t=require("./symbol/observable"),n=require("./util/pipe"),i=require("./config"),o=require("./util/isFunction"),u=require("./util/errorContext"),c=function(){function e(r){r&&(this._subscribe=r)}return e.prototype.lift=function(r){var t=new e;return t.source=this,t.operator=r,t},e.prototype.subscribe=function(e,t,n){var i=this,o=p(e)?e:new r.SafeSubscriber(e,t,n);return(0,u.errorContext)(function(){var r=i,e=r.operator,t=r.source;o.add(e?e.call(o,t):t?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(e){r.error(e)}},e.prototype.forEach=function(e,t){var n=this;return new(t=s(t))(function(t,i){var o=new r.SafeSubscriber({next:function(r){try{e(r)}catch(t){i(t),o.unsubscribe()}},error:i,complete:t});n.subscribe(o)})},e.prototype._subscribe=function(r){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(r)},e.prototype[t.observable]=function(){return this},e.prototype.pipe=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return(0,n.pipeFromArray)(r)(this)},e.prototype.toPromise=function(r){var e=this;return new(r=s(r))(function(r,t){var n;e.subscribe(function(r){return n=r},function(r){return t(r)},function(){return r(n)})})},e.create=function(r){return new e(r)},e}();function s(r){var e;return null!==(e=null!=r?r:i.config.Promise)&&void 0!==e?e:Promise}function b(r){return r&&(0,o.isFunction)(r.next)&&(0,o.isFunction)(r.error)&&(0,o.isFunction)(r.complete)}function p(t){return t&&t instanceof r.Subscriber||b(t)&&(0,e.isSubscription)(t)}exports.Observable=c;
|
|
35
|
+
},{"./Subscriber":"j5Gi","./Subscription":"Atlq","./symbol/observable":"ubx8","./util/pipe":"eq9W","./config":"nBrU","./util/isFunction":"IMGL","./util/errorContext":"X9Ul"}],"gwDu":[function(require,module,exports) {
|
|
36
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasLift=r,exports.operate=e;var t=require("./isFunction");function r(r){return(0,t.isFunction)(null==r?void 0:r.lift)}function e(t){return function(e){if(r(e))return e.lift(function(r){try{return t(r,this)}catch(e){this.error(e)}});throw new TypeError("Unable to lift unknown Observable type")}}
|
|
37
|
+
},{"./isFunction":"IMGL"}],"qno3":[function(require,module,exports) {
|
|
38
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createOperatorSubscriber=t,exports.OperatorSubscriber=void 0;var r=require("tslib"),e=require("../Subscriber");function t(r,e,t,s,o){return new i(r,e,t,s,o)}var i=function(e){function t(r,t,i,s,o,n){var u=e.call(this,r)||this;return u.onFinalize=o,u.shouldUnsubscribe=n,u._next=t?function(e){try{t(e)}catch(i){r.error(i)}}:e.prototype._next,u._error=s?function(e){try{s(e)}catch(e){r.error(e)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=i?function(){try{i()}catch(e){r.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,u}return(0,r.__extends)(t,e),t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var t=this.closed;e.prototype.unsubscribe.call(this),!t&&(null===(r=this.onFinalize)||void 0===r||r.call(this))}},t}(e.Subscriber);exports.OperatorSubscriber=i;
|
|
39
|
+
},{"tslib":"B5W1","../Subscriber":"j5Gi"}],"WUVS":[function(require,module,exports) {
|
|
40
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.refCount=u;var e=require("../util/lift"),r=require("./OperatorSubscriber");function u(){return(0,e.operate)(function(e,u){var n=null;e._refCount++;var t=(0,r.createOperatorSubscriber)(u,void 0,void 0,void 0,function(){if(!e||e._refCount<=0||0<--e._refCount)n=null;else{var r=e._connection,t=n;n=null,!r||t&&r!==t||r.unsubscribe(),u.unsubscribe()}});e.subscribe(t),t.closed||(n=e.connect())})}
|
|
41
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"MckT":[function(require,module,exports) {
|
|
42
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectableObservable=void 0;var t=require("tslib"),e=require("../Observable"),r=require("../Subscription"),n=require("../operators/refCount"),o=require("../operators/OperatorSubscriber"),i=require("../util/lift"),u=function(e){function u(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,(0,i.hasLift)(t)&&(n.lift=t.lift),n}return(0,t.__extends)(u,e),u.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},u.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},u.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},u.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new r.Subscription;var n=this.getSubject();e.add(this.source.subscribe((0,o.createOperatorSubscriber)(n,void 0,function(){t._teardown(),n.complete()},function(e){t._teardown(),n.error(e)},function(){return t._teardown()}))),e.closed&&(this._connection=null,e=r.Subscription.EMPTY)}return e},u.prototype.refCount=function(){return(0,n.refCount)()(this)},u}(e.Observable);exports.ConnectableObservable=u;
|
|
43
|
+
},{"tslib":"B5W1","../Observable":"EkNV","../Subscription":"Atlq","../operators/refCount":"WUVS","../operators/OperatorSubscriber":"qno3","../util/lift":"gwDu"}],"ao8B":[function(require,module,exports) {
|
|
44
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.performanceTimestampProvider=void 0;var e={now:function(){return(e.delegate||performance).now()},delegate:void 0};exports.performanceTimestampProvider=e;
|
|
45
|
+
},{}],"CtkU":[function(require,module,exports) {
|
|
46
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.animationFrameProvider=void 0;var e=require("tslib"),r=require("../Subscription"),n={schedule:function(e){var a=requestAnimationFrame,i=cancelAnimationFrame,t=n.delegate;t&&(a=t.requestAnimationFrame,i=t.cancelAnimationFrame);var o=a(function(r){i=void 0,e(r)});return new r.Subscription(function(){return null==i?void 0:i(o)})},requestAnimationFrame:function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];var i=n.delegate;return((null==i?void 0:i.requestAnimationFrame)||requestAnimationFrame).apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(r)))},cancelAnimationFrame:function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];var i=n.delegate;return((null==i?void 0:i.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(r)))},delegate:void 0};exports.animationFrameProvider=n;
|
|
47
|
+
},{"tslib":"B5W1","../Subscription":"Atlq"}],"toCh":[function(require,module,exports) {
|
|
48
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.animationFrames=i;var e=require("../../Observable"),r=require("../../scheduler/performanceTimestampProvider"),n=require("../../scheduler/animationFrameProvider");function i(e){return e?a(e):t}function a(i){return new e.Observable(function(e){var a=i||r.performanceTimestampProvider,t=a.now(),o=0,m=function(){e.closed||(o=n.animationFrameProvider.requestAnimationFrame(function(r){o=0;var n=a.now();e.next({timestamp:i?n:r,elapsed:n-t}),m()}))};return m(),function(){o&&n.animationFrameProvider.cancelAnimationFrame(o)}})}var t=a();
|
|
49
|
+
},{"../../Observable":"EkNV","../../scheduler/performanceTimestampProvider":"ao8B","../../scheduler/animationFrameProvider":"CtkU"}],"gdWq":[function(require,module,exports) {
|
|
50
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ObjectUnsubscribedError=void 0;var r=require("./createErrorClass"),e=(0,r.createErrorClass)(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});exports.ObjectUnsubscribedError=e;
|
|
51
|
+
},{"./createErrorClass":"Le7P"}],"BDW7":[function(require,module,exports) {
|
|
52
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnonymousSubject=exports.Subject=void 0;var r=require("tslib"),e=require("./Observable"),t=require("./Subscription"),o=require("./util/ObjectUnsubscribedError"),n=require("./util/arrRemove"),s=require("./util/errorContext"),i=function(i){function l(){var r=i.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return(0,r.__extends)(l,i),l.prototype.lift=function(r){var e=new u(this,this);return e.operator=r,e},l.prototype._throwIfClosed=function(){if(this.closed)throw new o.ObjectUnsubscribedError},l.prototype.next=function(e){var t=this;(0,s.errorContext)(function(){var o,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=(0,r.__values)(t.currentObservers),i=s.next();!i.done;i=s.next()){i.value.next(e)}}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}}})},l.prototype.error=function(r){var e=this;(0,s.errorContext)(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=r;for(var t=e.observers;t.length;)t.shift().error(r)}})},l.prototype.complete=function(){var r=this;(0,s.errorContext)(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var e=r.observers;e.length;)e.shift().complete()}})},l.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(l.prototype,"observed",{get:function(){var r;return(null===(r=this.observers)||void 0===r?void 0:r.length)>0},enumerable:!1,configurable:!0}),l.prototype._trySubscribe=function(r){return this._throwIfClosed(),i.prototype._trySubscribe.call(this,r)},l.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},l.prototype._innerSubscribe=function(r){var e=this,o=this.hasError,s=this.isStopped,i=this.observers;return o||s?t.EMPTY_SUBSCRIPTION:(this.currentObservers=null,i.push(r),new t.Subscription(function(){e.currentObservers=null,(0,n.arrRemove)(i,r)}))},l.prototype._checkFinalizedStatuses=function(r){var e=this.hasError,t=this.thrownError,o=this.isStopped;e?r.error(t):o&&r.complete()},l.prototype.asObservable=function(){var r=new e.Observable;return r.source=this,r},l.create=function(r,e){return new u(r,e)},l}(e.Observable);exports.Subject=i;var u=function(e){function o(r,t){var o=e.call(this)||this;return o.destination=r,o.source=t,o}return(0,r.__extends)(o,e),o.prototype.next=function(r){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===t||t.call(e,r)},o.prototype.error=function(r){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===t||t.call(e,r)},o.prototype.complete=function(){var r,e;null===(e=null===(r=this.destination)||void 0===r?void 0:r.complete)||void 0===e||e.call(r)},o.prototype._subscribe=function(r){var e,o;return null!==(o=null===(e=this.source)||void 0===e?void 0:e.subscribe(r))&&void 0!==o?o:t.EMPTY_SUBSCRIPTION},o}(i);exports.AnonymousSubject=u;
|
|
53
|
+
},{"tslib":"B5W1","./Observable":"EkNV","./Subscription":"Atlq","./util/ObjectUnsubscribedError":"gdWq","./util/arrRemove":"h9cX","./util/errorContext":"X9Ul"}],"dUFA":[function(require,module,exports) {
|
|
54
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BehaviorSubject=void 0;var e=require("tslib"),t=require("./Subject"),r=function(t){function r(e){var r=t.call(this)||this;return r._value=e,r}return(0,e.__extends)(r,t),Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return!r.closed&&e.next(this._value),r},r.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},r.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},r}(t.Subject);exports.BehaviorSubject=r;
|
|
55
|
+
},{"tslib":"B5W1","./Subject":"BDW7"}],"x2eE":[function(require,module,exports) {
|
|
56
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.dateTimestampProvider=void 0;var e={now:function(){return(e.delegate||Date).now()},delegate:void 0};exports.dateTimestampProvider=e;
|
|
57
|
+
},{}],"dbtS":[function(require,module,exports) {
|
|
58
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReplaySubject=void 0;var e=require("tslib"),i=require("./Subject"),t=require("./scheduler/dateTimestampProvider"),r=function(i){function r(e,r,n){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===n&&(n=t.dateTimestampProvider);var o=i.call(this)||this;return o._bufferSize=e,o._windowTime=r,o._timestampProvider=n,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,e),o._windowTime=Math.max(1,r),o}return(0,e.__extends)(r,i),r.prototype.next=function(e){var t=this,r=t.isStopped,n=t._buffer,o=t._infiniteTimeWindow,s=t._timestampProvider,f=t._windowTime;r||(n.push(e),!o&&n.push(s.now()+f)),this._trimBuffer(),i.prototype.next.call(this,e)},r.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var i=this._innerSubscribe(e),t=this._infiniteTimeWindow,r=this._buffer.slice(),n=0;n<r.length&&!e.closed;n+=t?1:2)e.next(r[n]);return this._checkFinalizedStatuses(e),i},r.prototype._trimBuffer=function(){var e=this._bufferSize,i=this._timestampProvider,t=this._buffer,r=this._infiniteTimeWindow,n=(r?1:2)*e;if(e<1/0&&n<t.length&&t.splice(0,t.length-n),!r){for(var o=i.now(),s=0,f=1;f<t.length&&t[f]<=o;f+=2)s=f;s&&t.splice(0,s+1)}},r}(i.Subject);exports.ReplaySubject=r;
|
|
59
|
+
},{"tslib":"B5W1","./Subject":"BDW7","./scheduler/dateTimestampProvider":"x2eE"}],"sDwD":[function(require,module,exports) {
|
|
60
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsyncSubject=void 0;var e=require("tslib"),t=require("./Subject"),s=function(t){function s(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}return(0,e.__extends)(s,t),s.prototype._checkFinalizedStatuses=function(e){var t=this,s=t.hasError,o=t._hasValue,r=t._value,i=t.thrownError,l=t.isStopped,p=t._isComplete;s?e.error(i):(l||p)&&(o&&e.next(r),e.complete())},s.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},s.prototype.complete=function(){var e=this._hasValue,s=this._value;this._isComplete||(this._isComplete=!0,e&&t.prototype.next.call(this,s),t.prototype.complete.call(this))},s}(t.Subject);exports.AsyncSubject=s;
|
|
61
|
+
},{"tslib":"B5W1","./Subject":"BDW7"}],"sxnZ":[function(require,module,exports) {
|
|
62
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Action=void 0;var t=require("tslib"),e=require("../Subscription"),r=function(e){function r(t,r){return e.call(this)||this}return(0,t.__extends)(r,e),r.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},r}(e.Subscription);exports.Action=r;
|
|
63
|
+
},{"tslib":"B5W1","../Subscription":"Atlq"}],"puBE":[function(require,module,exports) {
|
|
64
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.intervalProvider=void 0;var e=require("tslib"),r={setInterval:function(t,a){for(var l=[],v=2;v<arguments.length;v++)l[v-2]=arguments[v];var n=r.delegate;return(null==n?void 0:n.setInterval)?n.setInterval.apply(n,(0,e.__spreadArray)([t,a],(0,e.__read)(l))):setInterval.apply(void 0,(0,e.__spreadArray)([t,a],(0,e.__read)(l)))},clearInterval:function(e){var t=r.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0};exports.intervalProvider=r;
|
|
65
|
+
},{"tslib":"B5W1"}],"bN66":[function(require,module,exports) {
|
|
66
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsyncAction=void 0;var e=require("tslib"),t=require("./Action"),i=require("./intervalProvider"),r=require("../util/arrRemove"),s=function(t){function s(e,i){var r=t.call(this,e,i)||this;return r.scheduler=e,r.work=i,r.pending=!1,r}return(0,e.__extends)(s,t),s.prototype.schedule=function(e,t){var i;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,s=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(s,r,t)),this.pending=!0,this.delay=t,this.id=null!==(i=this.id)&&void 0!==i?i:this.requestAsyncId(s,this.id,t),this},s.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),i.intervalProvider.setInterval(e.flush.bind(e,this),r)},s.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&i.intervalProvider.clearInterval(t)},s.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,t);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},s.prototype._execute=function(e,t){var i,r=!1;try{this.work(e)}catch(s){r=!0,i=s||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i},s.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,i=this.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,r.arrRemove)(s,this),null!=e&&(this.id=this.recycleAsyncId(i,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},s}(t.Action);exports.AsyncAction=s;
|
|
67
|
+
},{"tslib":"B5W1","./Action":"sxnZ","./intervalProvider":"puBE","../util/arrRemove":"h9cX"}],"TaLK":[function(require,module,exports) {
|
|
68
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TestTools=exports.Immediate=void 0;var e,t=1,r={};function n(e){return e in r&&(delete r[e],!0)}var o={setImmediate:function(o){var s=t++;return r[s]=!0,e||(e=Promise.resolve()),e.then(function(){return n(s)&&o()}),s},clearImmediate:function(e){n(e)}};exports.Immediate=o;var s={pending:function(){return Object.keys(r).length}};exports.TestTools=s;
|
|
69
|
+
},{}],"CDhB":[function(require,module,exports) {
|
|
70
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.immediateProvider=void 0;var e=require("tslib"),t=require("../util/Immediate"),r=t.Immediate.setImmediate,i=t.Immediate.clearImmediate,a={setImmediate:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var d=a.delegate;return((null==d?void 0:d.setImmediate)||r).apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(t)))},clearImmediate:function(e){var t=a.delegate;return((null==t?void 0:t.clearImmediate)||i)(e)},delegate:void 0};exports.immediateProvider=a;
|
|
71
|
+
},{"tslib":"B5W1","../util/Immediate":"TaLK"}],"zI1V":[function(require,module,exports) {
|
|
72
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsapAction=void 0;var e=require("tslib"),t=require("./AsyncAction"),i=require("./immediateProvider"),r=function(t){function r(e,i){var r=t.call(this,e,i)||this;return r.scheduler=e,r.work=i,r}return(0,e.__extends)(r,t),r.prototype.requestAsyncId=function(e,r,o){return void 0===o&&(o=0),null!==o&&o>0?t.prototype.requestAsyncId.call(this,e,r,o):(e.actions.push(this),e._scheduled||(e._scheduled=i.immediateProvider.setImmediate(e.flush.bind(e,void 0))))},r.prototype.recycleAsyncId=function(e,r,o){var s;if(void 0===o&&(o=0),null!=o?o>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,o);var d=e.actions;null!=r&&(null===(s=d[d.length-1])||void 0===s?void 0:s.id)!==r&&(i.immediateProvider.clearImmediate(r),e._scheduled=void 0)},r}(t.AsyncAction);exports.AsapAction=r;
|
|
73
|
+
},{"tslib":"B5W1","./AsyncAction":"bN66","./immediateProvider":"CDhB"}],"bUPD":[function(require,module,exports) {
|
|
74
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Scheduler=void 0;var e=require("./scheduler/dateTimestampProvider"),t=function(){function t(e,r){void 0===r&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},t.now=e.dateTimestampProvider.now,t}();exports.Scheduler=t;
|
|
75
|
+
},{"./scheduler/dateTimestampProvider":"x2eE"}],"XfcJ":[function(require,module,exports) {
|
|
76
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsyncScheduler=void 0;var e=require("tslib"),t=require("../Scheduler"),i=function(i){function r(e,r){void 0===r&&(r=t.Scheduler.now);var s=i.call(this,e,r)||this;return s.actions=[],s._active=!1,s}return(0,e.__extends)(r,i),r.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var i;this._active=!0;do{if(i=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,i){for(;e=t.shift();)e.unsubscribe();throw i}}},r}(t.Scheduler);exports.AsyncScheduler=i;
|
|
77
|
+
},{"tslib":"B5W1","../Scheduler":"bUPD"}],"UZ9W":[function(require,module,exports) {
|
|
78
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AsapScheduler=void 0;var e=require("tslib"),t=require("./AsyncScheduler"),i=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(i,t),i.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var i,s=this.actions;e=e||s.shift();do{if(i=e.execute(e.state,e.delay))break}while((e=s[0])&&e.id===t&&s.shift());if(this._active=!1,i){for(;(e=s[0])&&e.id===t&&s.shift();)e.unsubscribe();throw i}},i}(t.AsyncScheduler);exports.AsapScheduler=i;
|
|
79
|
+
},{"tslib":"B5W1","./AsyncScheduler":"XfcJ"}],"XpND":[function(require,module,exports) {
|
|
80
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.asap=exports.asapScheduler=void 0;var e=require("./AsapAction"),r=require("./AsapScheduler"),s=new r.AsapScheduler(e.AsapAction);exports.asapScheduler=s;var a=s;exports.asap=a;
|
|
81
|
+
},{"./AsapAction":"zI1V","./AsapScheduler":"UZ9W"}],"WQPT":[function(require,module,exports) {
|
|
82
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.async=exports.asyncScheduler=void 0;var e=require("./AsyncAction"),r=require("./AsyncScheduler"),c=new r.AsyncScheduler(e.AsyncAction);exports.asyncScheduler=c;var s=c;exports.async=s;
|
|
83
|
+
},{"./AsyncAction":"bN66","./AsyncScheduler":"XfcJ"}],"FPao":[function(require,module,exports) {
|
|
84
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueueAction=void 0;var e=require("tslib"),t=require("./AsyncAction"),s=function(t){function s(e,s){var r=t.call(this,e,s)||this;return r.scheduler=e,r.work=s,r}return(0,e.__extends)(s,t),s.prototype.schedule=function(e,s){return void 0===s&&(s=0),s>0?t.prototype.schedule.call(this,e,s):(this.delay=s,this.state=e,this.scheduler.flush(this),this)},s.prototype.execute=function(e,s){return s>0||this.closed?t.prototype.execute.call(this,e,s):this._execute(e,s)},s.prototype.requestAsyncId=function(e,s,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,s,r):(e.flush(this),0)},s}(t.AsyncAction);exports.QueueAction=s;
|
|
85
|
+
},{"tslib":"B5W1","./AsyncAction":"bN66"}],"HDHt":[function(require,module,exports) {
|
|
86
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueueScheduler=void 0;var e=require("tslib"),r=require("./AsyncScheduler"),u=function(r){function u(){return null!==r&&r.apply(this,arguments)||this}return(0,e.__extends)(u,r),u}(r.AsyncScheduler);exports.QueueScheduler=u;
|
|
87
|
+
},{"tslib":"B5W1","./AsyncScheduler":"XfcJ"}],"QfBT":[function(require,module,exports) {
|
|
88
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.queue=exports.queueScheduler=void 0;var e=require("./QueueAction"),u=require("./QueueScheduler"),r=new u.QueueScheduler(e.QueueAction);exports.queueScheduler=r;var t=r;exports.queue=t;
|
|
89
|
+
},{"./QueueAction":"FPao","./QueueScheduler":"HDHt"}],"FePd":[function(require,module,exports) {
|
|
90
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnimationFrameAction=void 0;var e=require("tslib"),r=require("./AsyncAction"),t=require("./animationFrameProvider"),i=function(r){function i(e,t){var i=r.call(this,e,t)||this;return i.scheduler=e,i.work=t,i}return(0,e.__extends)(i,r),i.prototype.requestAsyncId=function(e,i,n){return void 0===n&&(n=0),null!==n&&n>0?r.prototype.requestAsyncId.call(this,e,i,n):(e.actions.push(this),e._scheduled||(e._scheduled=t.animationFrameProvider.requestAnimationFrame(function(){return e.flush(void 0)})))},i.prototype.recycleAsyncId=function(e,i,n){var o;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,e,i,n);var c=e.actions;null!=i&&(null===(o=c[c.length-1])||void 0===o?void 0:o.id)!==i&&(t.animationFrameProvider.cancelAnimationFrame(i),e._scheduled=void 0)},i}(r.AsyncAction);exports.AnimationFrameAction=i;
|
|
91
|
+
},{"tslib":"B5W1","./AsyncAction":"bN66","./animationFrameProvider":"CtkU"}],"W7kg":[function(require,module,exports) {
|
|
92
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnimationFrameScheduler=void 0;var e=require("tslib"),t=require("./AsyncScheduler"),i=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(i,t),i.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var i,r=this.actions;e=e||r.shift();do{if(i=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw i}},i}(t.AsyncScheduler);exports.AnimationFrameScheduler=i;
|
|
93
|
+
},{"tslib":"B5W1","./AsyncScheduler":"XfcJ"}],"lAIc":[function(require,module,exports) {
|
|
94
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.animationFrame=exports.animationFrameScheduler=void 0;var e=require("./AnimationFrameAction"),r=require("./AnimationFrameScheduler"),a=new r.AnimationFrameScheduler(e.AnimationFrameAction);exports.animationFrameScheduler=a;var i=a;exports.animationFrame=i;
|
|
95
|
+
},{"./AnimationFrameAction":"FePd","./AnimationFrameScheduler":"W7kg"}],"dFvp":[function(require,module,exports) {
|
|
96
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VirtualAction=exports.VirtualTimeScheduler=void 0;var e=require("tslib"),t=require("./AsyncAction"),i=require("../Subscription"),r=require("./AsyncScheduler"),n=function(t){function i(e,i){void 0===e&&(e=s),void 0===i&&(i=1/0);var r=t.call(this,e,function(){return r.frame})||this;return r.maxFrames=i,r.frame=0,r.index=-1,r}return(0,e.__extends)(i,t),i.prototype.flush=function(){for(var e,t,i=this.actions,r=this.maxFrames;(t=i[0])&&t.delay<=r&&(i.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=i.shift();)t.unsubscribe();throw e}},i.frameTimeFactor=10,i}(r.AsyncScheduler);exports.VirtualTimeScheduler=n;var s=function(t){function r(e,i,r){void 0===r&&(r=e.index+=1);var n=t.call(this,e,i)||this;return n.scheduler=e,n.work=i,n.index=r,n.active=!0,n.index=e.index=r,n}return(0,e.__extends)(r,t),r.prototype.schedule=function(e,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return t.prototype.schedule.call(this,e,n);this.active=!1;var s=new r(this.scheduler,this.work);return this.add(s),s.schedule(e,n)}return i.Subscription.EMPTY},r.prototype.requestAsyncId=function(e,t,i){void 0===i&&(i=0),this.delay=e.frame+i;var n=e.actions;return n.push(this),n.sort(r.sortActions),1},r.prototype.recycleAsyncId=function(e,t,i){void 0===i&&(i=0)},r.prototype._execute=function(e,i){if(!0===this.active)return t.prototype._execute.call(this,e,i)},r.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},r}(t.AsyncAction);exports.VirtualAction=s;
|
|
97
|
+
},{"tslib":"B5W1","./AsyncAction":"bN66","../Subscription":"Atlq","./AsyncScheduler":"XfcJ"}],"qOvc":[function(require,module,exports) {
|
|
98
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.empty=t,exports.EMPTY=void 0;var e=require("../Observable"),r=new e.Observable(function(e){return e.complete()});function t(e){return e?n(e):r}function n(r){return new e.Observable(function(e){return r.schedule(function(){return e.complete()})})}exports.EMPTY=r;
|
|
99
|
+
},{"../Observable":"EkNV"}],"HI7M":[function(require,module,exports) {
|
|
100
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isScheduler=r;var e=require("./isFunction");function r(r){return r&&(0,e.isFunction)(r.schedule)}
|
|
101
|
+
},{"./isFunction":"IMGL"}],"cFBb":[function(require,module,exports) {
|
|
102
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.popResultSelector=t,exports.popScheduler=u,exports.popNumber=n;var e=require("./isFunction"),r=require("./isScheduler");function o(e){return e[e.length-1]}function t(r){return(0,e.isFunction)(o(r))?r.pop():void 0}function u(e){return(0,r.isScheduler)(o(e))?e.pop():void 0}function n(e,r){return"number"==typeof o(e)?e.pop():r}
|
|
103
|
+
},{"./isFunction":"IMGL","./isScheduler":"HI7M"}],"ztpI":[function(require,module,exports) {
|
|
104
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isArrayLike=void 0;var e=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};exports.isArrayLike=e;
|
|
105
|
+
},{}],"fAfA":[function(require,module,exports) {
|
|
106
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPromise=i;var e=require("./isFunction");function i(i){return(0,e.isFunction)(null==i?void 0:i.then)}
|
|
107
|
+
},{"./isFunction":"IMGL"}],"Q2vg":[function(require,module,exports) {
|
|
108
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isInteropObservable=s;var e=require("../symbol/observable"),r=require("./isFunction");function s(s){return(0,r.isFunction)(s[e.observable])}
|
|
109
|
+
},{"../symbol/observable":"ubx8","./isFunction":"IMGL"}],"YLLt":[function(require,module,exports) {
|
|
110
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isAsyncIterable=r;var e=require("./isFunction");function r(r){return Symbol.asyncIterator&&(0,e.isFunction)(null==r?void 0:r[Symbol.asyncIterator])}
|
|
111
|
+
},{"./isFunction":"IMGL"}],"R9ez":[function(require,module,exports) {
|
|
112
|
+
"use strict";function e(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.createInvalidObservableTypeError=e;
|
|
113
|
+
},{}],"fyC7":[function(require,module,exports) {
|
|
114
|
+
"use strict";function t(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSymbolIterator=t,exports.iterator=void 0;var r=t();exports.iterator=r;
|
|
115
|
+
},{}],"MKUL":[function(require,module,exports) {
|
|
116
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isIterable=t;var e=require("../symbol/iterator"),r=require("./isFunction");function t(t){return(0,r.isFunction)(null==t?void 0:t[e.iterator])}
|
|
117
|
+
},{"../symbol/iterator":"fyC7","./isFunction":"IMGL"}],"xfoE":[function(require,module,exports) {
|
|
118
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.readableStreamLikeToAsyncGenerator=t,exports.isReadableStreamLike=a;var e=require("tslib"),r=require("./isFunction");function t(r){return(0,e.__asyncGenerator)(this,arguments,function(){var t,a,n;return(0,e.__generator)(this,function(s){switch(s.label){case 0:t=r.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,(0,e.__await)(t.read())];case 3:return a=s.sent(),n=a.value,a.done?[4,(0,e.__await)(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,(0,e.__await)(n)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function a(e){return(0,r.isFunction)(null==e?void 0:e.getReader)}
|
|
119
|
+
},{"tslib":"B5W1","./isFunction":"IMGL"}],"pBGv":[function(require,module,exports) {
|
|
120
|
+
|
|
121
|
+
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.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];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
|
|
122
|
+
},{}],"pOze":[function(require,module,exports) {
|
|
123
|
+
|
|
124
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.innerFrom=f,exports.fromInteropObservable=v,exports.fromArrayLike=d,exports.fromPromise=p,exports.fromIterable=m,exports.fromAsyncIterable=y,exports.fromReadableStreamLike=h;var e=require("tslib"),r=require("../util/isArrayLike"),t=require("../util/isPromise"),n=require("../Observable"),i=require("../util/isInteropObservable"),o=require("../util/isAsyncIterable"),u=require("../util/throwUnobservableError"),s=require("../util/isIterable"),a=require("../util/isReadableStreamLike"),l=require("../util/isFunction"),c=require("../util/reportUnhandledError"),b=require("../symbol/observable");function f(e){if(e instanceof n.Observable)return e;if(null!=e){if((0,i.isInteropObservable)(e))return v(e);if((0,r.isArrayLike)(e))return d(e);if((0,t.isPromise)(e))return p(e);if((0,o.isAsyncIterable)(e))return y(e);if((0,s.isIterable)(e))return m(e);if((0,a.isReadableStreamLike)(e))return h(e)}throw(0,u.createInvalidObservableTypeError)(e)}function v(e){return new n.Observable(function(r){var t=e[b.observable]();if((0,l.isFunction)(t.subscribe))return t.subscribe(r);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function d(e){return new n.Observable(function(r){for(var t=0;t<e.length&&!r.closed;t++)r.next(e[t]);r.complete()})}function p(e){return new n.Observable(function(r){e.then(function(e){r.closed||(r.next(e),r.complete())},function(e){return r.error(e)}).then(null,c.reportUnhandledError)})}function m(r){return new n.Observable(function(t){var n,i;try{for(var o=(0,e.__values)(r),u=o.next();!u.done;u=o.next()){var s=u.value;if(t.next(s),t.closed)return}}catch(a){n={error:a}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}t.complete()})}function y(e){return new n.Observable(function(r){x(e,r).catch(function(e){return r.error(e)})})}function h(e){return y((0,a.readableStreamLikeToAsyncGenerator)(e))}function x(r,t){var n,i,o,u;return(0,e.__awaiter)(this,void 0,void 0,function(){var s,a;return(0,e.__generator)(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=(0,e.__asyncValues)(r),l.label=1;case 1:return[4,n.next()];case 2:if((i=l.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),o={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),i&&!i.done&&(u=n.return)?[4,u.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}
|
|
125
|
+
},{"tslib":"B5W1","../util/isArrayLike":"ztpI","../util/isPromise":"fAfA","../Observable":"EkNV","../util/isInteropObservable":"Q2vg","../util/isAsyncIterable":"YLLt","../util/throwUnobservableError":"R9ez","../util/isIterable":"MKUL","../util/isReadableStreamLike":"xfoE","../util/isFunction":"IMGL","../util/reportUnhandledError":"qGAn","../symbol/observable":"ubx8","process":"pBGv"}],"WVgR":[function(require,module,exports) {
|
|
126
|
+
"use strict";function e(e,u,t,d,s){void 0===d&&(d=0),void 0===s&&(s=!1);var i=u.schedule(function(){t(),s?e.add(this.schedule(null,d)):this.unsubscribe()},d);if(e.add(i),!s)return i}Object.defineProperty(exports,"__esModule",{value:!0}),exports.executeSchedule=e;
|
|
127
|
+
},{}],"kKa0":[function(require,module,exports) {
|
|
128
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.observeOn=u;var e=require("../util/executeSchedule"),r=require("../util/lift"),t=require("./OperatorSubscriber");function u(u,n){return void 0===n&&(n=0),(0,r.operate)(function(r,c){r.subscribe((0,t.createOperatorSubscriber)(c,function(r){return(0,e.executeSchedule)(c,u,function(){return c.next(r)},n)},function(){return(0,e.executeSchedule)(c,u,function(){return c.complete()},n)},function(r){return(0,e.executeSchedule)(c,u,function(){return c.error(r)},n)}))})}
|
|
129
|
+
},{"../util/executeSchedule":"WVgR","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"cqCB":[function(require,module,exports) {
|
|
130
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribeOn=r;var e=require("../util/lift");function r(r,t){return void 0===t&&(t=0),(0,e.operate)(function(e,u){u.add(r.schedule(function(){return e.subscribe(u)},t))})}
|
|
131
|
+
},{"../util/lift":"gwDu"}],"IiZa":[function(require,module,exports) {
|
|
132
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleObservable=o;var e=require("../observable/innerFrom"),r=require("../operators/observeOn"),s=require("../operators/subscribeOn");function o(o,n){return(0,e.innerFrom)(o).pipe((0,s.subscribeOn)(n),(0,r.observeOn)(n))}
|
|
133
|
+
},{"../observable/innerFrom":"pOze","../operators/observeOn":"kKa0","../operators/subscribeOn":"cqCB"}],"yB3J":[function(require,module,exports) {
|
|
134
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.schedulePromise=o;var e=require("../observable/innerFrom"),r=require("../operators/observeOn"),s=require("../operators/subscribeOn");function o(o,i){return(0,e.innerFrom)(o).pipe((0,s.subscribeOn)(i),(0,r.observeOn)(i))}
|
|
135
|
+
},{"../observable/innerFrom":"pOze","../operators/observeOn":"kKa0","../operators/subscribeOn":"cqCB"}],"Sy7W":[function(require,module,exports) {
|
|
136
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleArray=r;var e=require("../Observable");function r(r,t){return new e.Observable(function(e){var n=0;return t.schedule(function(){n===r.length?e.complete():(e.next(r[n++]),e.closed||this.schedule())})})}
|
|
137
|
+
},{"../Observable":"EkNV"}],"VZGJ":[function(require,module,exports) {
|
|
138
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleIterable=n;var e=require("../Observable"),r=require("../symbol/iterator"),t=require("../util/isFunction"),u=require("../util/executeSchedule");function n(n,i){return new e.Observable(function(e){var c;return(0,u.executeSchedule)(e,i,function(){c=n[r.iterator](),(0,u.executeSchedule)(e,i,function(){var r,t,u;try{t=(r=c.next()).value,u=r.done}catch(n){return void e.error(n)}u?e.complete():e.next(t)},0,!0)}),function(){return(0,t.isFunction)(null==c?void 0:c.return)&&c.return()}})}
|
|
139
|
+
},{"../Observable":"EkNV","../symbol/iterator":"fyC7","../util/isFunction":"IMGL","../util/executeSchedule":"WVgR"}],"xDHD":[function(require,module,exports) {
|
|
140
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleAsyncIterable=n;var e=require("../Observable"),t=require("../util/executeSchedule");function n(n,r){if(!n)throw new Error("Iterable cannot be null");return new e.Observable(function(e){(0,t.executeSchedule)(e,r,function(){var u=n[Symbol.asyncIterator]();(0,t.executeSchedule)(e,r,function(){u.next().then(function(t){t.done?e.complete():e.next(t.value)})},0,!0)})})}
|
|
141
|
+
},{"../Observable":"EkNV","../util/executeSchedule":"WVgR"}],"Uko9":[function(require,module,exports) {
|
|
142
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduleReadableStreamLike=t;var e=require("./scheduleAsyncIterable"),r=require("../util/isReadableStreamLike");function t(t,a){return(0,e.scheduleAsyncIterable)((0,r.readableStreamLikeToAsyncGenerator)(t),a)}
|
|
143
|
+
},{"./scheduleAsyncIterable":"xDHD","../util/isReadableStreamLike":"xfoE"}],"jMut":[function(require,module,exports) {
|
|
144
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scheduled=h;var e=require("./scheduleObservable"),r=require("./schedulePromise"),i=require("./scheduleArray"),s=require("./scheduleIterable"),u=require("./scheduleAsyncIterable"),l=require("../util/isInteropObservable"),t=require("../util/isPromise"),a=require("../util/isArrayLike"),b=require("../util/isIterable"),c=require("../util/isAsyncIterable"),d=require("../util/throwUnobservableError"),n=require("../util/isReadableStreamLike"),o=require("./scheduleReadableStreamLike");function h(h,q){if(null!=h){if((0,l.isInteropObservable)(h))return(0,e.scheduleObservable)(h,q);if((0,a.isArrayLike)(h))return(0,i.scheduleArray)(h,q);if((0,t.isPromise)(h))return(0,r.schedulePromise)(h,q);if((0,c.isAsyncIterable)(h))return(0,u.scheduleAsyncIterable)(h,q);if((0,b.isIterable)(h))return(0,s.scheduleIterable)(h,q);if((0,n.isReadableStreamLike)(h))return(0,o.scheduleReadableStreamLike)(h,q)}throw(0,d.createInvalidObservableTypeError)(h)}
|
|
145
|
+
},{"./scheduleObservable":"IiZa","./schedulePromise":"yB3J","./scheduleArray":"Sy7W","./scheduleIterable":"VZGJ","./scheduleAsyncIterable":"xDHD","../util/isInteropObservable":"Q2vg","../util/isPromise":"fAfA","../util/isArrayLike":"ztpI","../util/isIterable":"MKUL","../util/isAsyncIterable":"YLLt","../util/throwUnobservableError":"R9ez","../util/isReadableStreamLike":"xfoE","./scheduleReadableStreamLike":"Uko9"}],"xTp9":[function(require,module,exports) {
|
|
146
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.from=u;var e=require("../scheduled/scheduled"),r=require("./innerFrom");function u(u,d){return d?(0,e.scheduled)(u,d):(0,r.innerFrom)(u)}
|
|
147
|
+
},{"../scheduled/scheduled":"jMut","./innerFrom":"pOze"}],"lcaN":[function(require,module,exports) {
|
|
148
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.of=o;var r=require("../util/args"),e=require("./from");function o(){for(var o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];var u=(0,r.popScheduler)(o);return(0,e.from)(o,u)}
|
|
149
|
+
},{"../util/args":"cFBb","./from":"xTp9"}],"wu76":[function(require,module,exports) {
|
|
150
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throwError=n;var r=require("../Observable"),e=require("../util/isFunction");function n(n,t){var u=(0,e.isFunction)(n)?n:function(){return n},i=function(r){return r.error(u())};return new r.Observable(t?function(r){return t.schedule(i,0,r)}:i)}
|
|
151
|
+
},{"../Observable":"EkNV","../util/isFunction":"IMGL"}],"swlq":[function(require,module,exports) {
|
|
152
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.observeNotification=u,exports.Notification=exports.NotificationKind=void 0;var t,i=require("./observable/empty"),o=require("./observable/of"),r=require("./observable/throwError"),e=require("./util/isFunction");exports.NotificationKind=t,function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(t||(exports.NotificationKind=t={}));var n=function(){function t(t,i,o){this.kind=t,this.value=i,this.error=o,this.hasValue="N"===t}return t.prototype.observe=function(t){return u(this,t)},t.prototype.do=function(t,i,o){var r=this.kind,e=this.value,n=this.error;return"N"===r?null==t?void 0:t(e):"E"===r?null==i?void 0:i(n):null==o?void 0:o()},t.prototype.accept=function(t,i,o){var r;return(0,e.isFunction)(null===(r=t)||void 0===r?void 0:r.next)?this.observe(t):this.do(t,i,o)},t.prototype.toObservable=function(){var t=this.kind,e=this.value,n=this.error,u="N"===t?(0,o.of)(e):"E"===t?(0,r.throwError)(function(){return n}):"C"===t?i.EMPTY:0;if(!u)throw new TypeError("Unexpected notification kind "+t);return u},t.createNext=function(i){return new t("N",i)},t.createError=function(i){return new t("E",void 0,i)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t}();function u(t,i){var o,r,e,n=t,u=n.kind,c=n.value,l=n.error;if("string"!=typeof u)throw new TypeError('Invalid notification, missing "kind"');"N"===u?null===(o=i.next)||void 0===o||o.call(i,c):"E"===u?null===(r=i.error)||void 0===r||r.call(i,l):null===(e=i.complete)||void 0===e||e.call(i)}exports.Notification=n;
|
|
153
|
+
},{"./observable/empty":"qOvc","./observable/of":"lcaN","./observable/throwError":"wu76","./util/isFunction":"IMGL"}],"DTig":[function(require,module,exports) {
|
|
154
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isObservable=i;var e=require("../Observable"),r=require("./isFunction");function i(i){return!!i&&(i instanceof e.Observable||(0,r.isFunction)(i.lift)&&(0,r.isFunction)(i.subscribe))}
|
|
155
|
+
},{"../Observable":"EkNV","./isFunction":"IMGL"}],"wRNN":[function(require,module,exports) {
|
|
156
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmptyError=void 0;var r=require("./createErrorClass"),e=(0,r.createErrorClass)(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});exports.EmptyError=e;
|
|
157
|
+
},{"./createErrorClass":"Le7P"}],"CqFZ":[function(require,module,exports) {
|
|
158
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.lastValueFrom=r;var e=require("./util/EmptyError");function r(r,t){var o="object"==typeof t;return new Promise(function(u,n){var i,c=!1;r.subscribe({next:function(e){i=e,c=!0},error:n,complete:function(){c?u(i):o?u(t.defaultValue):n(new e.EmptyError)}})})}
|
|
159
|
+
},{"./util/EmptyError":"wRNN"}],"k2uW":[function(require,module,exports) {
|
|
160
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.firstValueFrom=t;var e=require("./util/EmptyError"),r=require("./Subscriber");function t(t,u){var o="object"==typeof u;return new Promise(function(i,n){var s=new r.SafeSubscriber({next:function(e){i(e),s.unsubscribe()},error:n,complete:function(){o?i(u.defaultValue):n(new e.EmptyError)}});t.subscribe(s)})}
|
|
161
|
+
},{"./util/EmptyError":"wRNN","./Subscriber":"j5Gi"}],"wL5X":[function(require,module,exports) {
|
|
162
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ArgumentOutOfRangeError=void 0;var r=require("./createErrorClass"),e=(0,r.createErrorClass)(function(r){return function(){r(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}});exports.ArgumentOutOfRangeError=e;
|
|
163
|
+
},{"./createErrorClass":"Le7P"}],"kj9h":[function(require,module,exports) {
|
|
164
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NotFoundError=void 0;var r=require("./createErrorClass"),e=(0,r.createErrorClass)(function(r){return function(e){r(this),this.name="NotFoundError",this.message=e}});exports.NotFoundError=e;
|
|
165
|
+
},{"./createErrorClass":"Le7P"}],"g1u8":[function(require,module,exports) {
|
|
166
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SequenceError=void 0;var e=require("./createErrorClass"),r=(0,e.createErrorClass)(function(e){return function(r){e(this),this.name="SequenceError",this.message=r}});exports.SequenceError=r;
|
|
167
|
+
},{"./createErrorClass":"Le7P"}],"NBBr":[function(require,module,exports) {
|
|
168
|
+
"use strict";function e(e){return e instanceof Date&&!isNaN(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isValidDate=e;
|
|
169
|
+
},{}],"jt1g":[function(require,module,exports) {
|
|
170
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeout=l,exports.TimeoutError=void 0;var e=require("../scheduler/async"),r=require("../util/isDate"),u=require("../util/lift"),i=require("../observable/innerFrom"),t=require("../util/createErrorClass"),o=require("./OperatorSubscriber"),n=require("../util/executeSchedule"),s=(0,t.createErrorClass)(function(e){return function(r){void 0===r&&(r=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r}});function l(t,s){var l=(0,r.isValidDate)(t)?{first:t}:"number"==typeof t?{each:t}:t,a=l.first,d=l.each,b=l.with,f=void 0===b?c:b,h=l.scheduler,m=void 0===h?null!=s?s:e.asyncScheduler:h,v=l.meta,p=void 0===v?null:v;if(null==a&&null==d)throw new TypeError("No timeout provided.");return(0,u.operate)(function(e,r){var u,t,s=null,l=0,c=function(e){t=(0,n.executeSchedule)(r,m,function(){try{u.unsubscribe(),(0,i.innerFrom)(f({meta:p,lastValue:s,seen:l})).subscribe(r)}catch(e){r.error(e)}},e)};u=e.subscribe((0,o.createOperatorSubscriber)(r,function(e){null==t||t.unsubscribe(),l++,r.next(s=e),d>0&&c(d)},void 0,void 0,function(){(null==t?void 0:t.closed)||null==t||t.unsubscribe(),s=null})),!l&&c(null!=a?"number"==typeof a?a:+a-m.now():d)})}function c(e){throw new s(e)}exports.TimeoutError=s;
|
|
171
|
+
},{"../scheduler/async":"WQPT","../util/isDate":"NBBr","../util/lift":"gwDu","../observable/innerFrom":"pOze","../util/createErrorClass":"Le7P","./OperatorSubscriber":"qno3","../util/executeSchedule":"WVgR"}],"N8Yl":[function(require,module,exports) {
|
|
172
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.map=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(t,u){return(0,e.operate)(function(e,i){var c=0;e.subscribe((0,r.createOperatorSubscriber)(i,function(e){i.next(t.call(u,e,c++))}))})}
|
|
173
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"An60":[function(require,module,exports) {
|
|
174
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mapOneOrManyArgs=n;var r=require("tslib"),e=require("../operators/map"),t=Array.isArray;function a(e,a){return t(a)?e.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(a))):e(a)}function n(r){return(0,e.map)(function(e){return a(r,e)})}
|
|
175
|
+
},{"tslib":"B5W1","../operators/map":"N8Yl"}],"fHIw":[function(require,module,exports) {
|
|
176
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bindCallbackInternals=a;var r=require("tslib"),e=require("../util/isScheduler"),n=require("../Observable"),t=require("../operators/subscribeOn"),i=require("../util/mapOneOrManyArgs"),u=require("../operators/observeOn"),s=require("../AsyncSubject");function a(l,o,p,c){if(p){if(!(0,e.isScheduler)(p))return function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return a(l,o,c).apply(this,r).pipe((0,i.mapOneOrManyArgs)(p))};c=p}return c?function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return a(l,o).apply(this,r).pipe((0,t.subscribeOn)(c),(0,u.observeOn)(c))}:function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var u=new s.AsyncSubject,a=!0;return new n.Observable(function(n){var i=u.subscribe(n);if(a){a=!1;var s=!1,p=!1;o.apply(e,(0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(t)),[function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];if(l){var n=r.shift();if(null!=n)return void u.error(n)}u.next(1<r.length?r:r[0]),p=!0,s&&u.complete()}])),p&&u.complete(),s=!0}return i})}}
|
|
177
|
+
},{"tslib":"B5W1","../util/isScheduler":"HI7M","../Observable":"EkNV","../operators/subscribeOn":"cqCB","../util/mapOneOrManyArgs":"An60","../operators/observeOn":"kKa0","../AsyncSubject":"sDwD"}],"yxvc":[function(require,module,exports) {
|
|
178
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bindCallback=r;var e=require("./bindCallbackInternals");function r(r,n,a){return(0,e.bindCallbackInternals)(!1,r,n,a)}
|
|
179
|
+
},{"./bindCallbackInternals":"fHIw"}],"kO2q":[function(require,module,exports) {
|
|
180
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bindNodeCallback=r;var e=require("./bindCallbackInternals");function r(r,n,a){return(0,e.bindCallbackInternals)(!0,r,n,a)}
|
|
181
|
+
},{"./bindCallbackInternals":"fHIw"}],"iiKX":[function(require,module,exports) {
|
|
182
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.argsArgArrayOrObject=s;var r=Array.isArray,e=Object.getPrototypeOf,t=Object.prototype,n=Object.keys;function s(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if(o(t)){var s=n(t);return{args:s.map(function(r){return t[r]}),keys:s}}}return{args:e,keys:null}}function o(r){return r&&"object"==typeof r&&e(r)===t}
|
|
183
|
+
},{}],"tc9h":[function(require,module,exports) {
|
|
184
|
+
"use strict";function e(e,t){return e.reduce(function(e,r,u){return e[r]=t[u],e},{})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.createObject=e;
|
|
185
|
+
},{}],"kXaL":[function(require,module,exports) {
|
|
186
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineLatest=s,exports.combineLatestInit=l;var e=require("../Observable"),r=require("../util/argsArgArrayOrObject"),t=require("./from"),i=require("../util/identity"),n=require("../util/mapOneOrManyArgs"),u=require("../util/args"),c=require("../util/createObject"),o=require("../operators/OperatorSubscriber"),a=require("../util/executeSchedule");function s(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=(0,u.popScheduler)(o),b=(0,u.popResultSelector)(o),f=(0,r.argsArgArrayOrObject)(o),p=f.args,O=f.keys;if(0===p.length)return(0,t.from)([],s);var g=new e.Observable(l(p,s,O?function(e){return(0,c.createObject)(O,e)}:i.identity));return b?g.pipe((0,n.mapOneOrManyArgs)(b)):g}function l(e,r,n){return void 0===n&&(n=i.identity),function(i){b(r,function(){for(var u=e.length,c=new Array(u),a=u,s=u,l=function(u){b(r,function(){var l=(0,t.from)(e[u],r),b=!1;l.subscribe((0,o.createOperatorSubscriber)(i,function(e){c[u]=e,b||(b=!0,s--),s||i.next(n(c.slice()))},function(){--a||i.complete()}))},i)},f=0;f<u;f++)l(f)},i)}}function b(e,r,t){e?(0,a.executeSchedule)(t,e,r):r()}
|
|
187
|
+
},{"../Observable":"EkNV","../util/argsArgArrayOrObject":"iiKX","./from":"xTp9","../util/identity":"FeLp","../util/mapOneOrManyArgs":"An60","../util/args":"cFBb","../util/createObject":"tc9h","../operators/OperatorSubscriber":"qno3","../util/executeSchedule":"WVgR"}],"EAff":[function(require,module,exports) {
|
|
188
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeInternals=t;var e=require("../observable/innerFrom"),r=require("../util/executeSchedule"),n=require("./OperatorSubscriber");function t(t,u,c,i,o,s,f,a){var l=[],b=0,p=0,v=!1,h=function(){!v||l.length||b||u.complete()},x=function(e){return b<i?d(e):l.push(e)},d=function(t){s&&u.next(t),b++;var a=!1;(0,e.innerFrom)(c(t,p++)).subscribe((0,n.createOperatorSubscriber)(u,function(e){null==o||o(e),s?x(e):u.next(e)},function(){a=!0},void 0,function(){if(a)try{b--;for(var e=function(){var e=l.shift();f?(0,r.executeSchedule)(u,f,function(){return d(e)}):d(e)};l.length&&b<i;)e();h()}catch(n){u.error(n)}}))};return t.subscribe((0,n.createOperatorSubscriber)(u,x,function(){v=!0,h()})),function(){null==a||a()}}
|
|
189
|
+
},{"../observable/innerFrom":"pOze","../util/executeSchedule":"WVgR","./OperatorSubscriber":"qno3"}],"mGWE":[function(require,module,exports) {
|
|
190
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeMap=u;var e=require("./map"),r=require("../observable/innerFrom"),n=require("../util/lift"),t=require("./mergeInternals"),i=require("../util/isFunction");function u(o,s,a){return void 0===a&&(a=1/0),(0,i.isFunction)(s)?u(function(n,t){return(0,e.map)(function(e,r){return s(n,e,t,r)})((0,r.innerFrom)(o(n,t)))},a):("number"==typeof s&&(a=s),(0,n.operate)(function(e,r){return(0,t.mergeInternals)(e,r,o,a)}))}
|
|
191
|
+
},{"./map":"N8Yl","../observable/innerFrom":"pOze","../util/lift":"gwDu","./mergeInternals":"EAff","../util/isFunction":"IMGL"}],"leLE":[function(require,module,exports) {
|
|
192
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeAll=t;var e=require("./mergeMap"),r=require("../util/identity");function t(t){return void 0===t&&(t=1/0),(0,e.mergeMap)(r.identity,t)}
|
|
193
|
+
},{"./mergeMap":"mGWE","../util/identity":"FeLp"}],"SHNp":[function(require,module,exports) {
|
|
194
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatAll=r;var e=require("./mergeAll");function r(){return(0,e.mergeAll)(1)}
|
|
195
|
+
},{"./mergeAll":"leLE"}],"nSjD":[function(require,module,exports) {
|
|
196
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concat=t;var r=require("../operators/concatAll"),e=require("../util/args"),o=require("./from");function t(){for(var t=[],c=0;c<arguments.length;c++)t[c]=arguments[c];return(0,r.concatAll)()((0,o.from)(t,(0,e.popScheduler)(t)))}
|
|
197
|
+
},{"../operators/concatAll":"SHNp","../util/args":"cFBb","./from":"xTp9"}],"gpse":[function(require,module,exports) {
|
|
198
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defer=n;var e=require("../Observable"),r=require("./innerFrom");function n(n){return new e.Observable(function(e){(0,r.innerFrom)(n()).subscribe(e)})}
|
|
199
|
+
},{"../Observable":"EkNV","./innerFrom":"pOze"}],"aKIY":[function(require,module,exports) {
|
|
200
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.connectable=c;var e=require("../Subject"),n=require("../Observable"),r=require("./defer"),t={connector:function(){return new e.Subject},resetOnDisconnect:!0};function c(e,c){void 0===c&&(c=t);var u=null,o=c.connector,i=c.resetOnDisconnect,s=void 0===i||i,b=o(),d=new n.Observable(function(e){return b.subscribe(e)});return d.connect=function(){return u&&!u.closed||(u=(0,r.defer)(function(){return e}).subscribe(b),s&&u.add(function(){return b=o()})),u},d}
|
|
201
|
+
},{"../Subject":"BDW7","../Observable":"EkNV","./defer":"gpse"}],"bQiY":[function(require,module,exports) {
|
|
202
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.forkJoin=o;var r=require("../Observable"),e=require("../util/argsArgArrayOrObject"),t=require("./innerFrom"),n=require("../util/args"),i=require("../operators/OperatorSubscriber"),a=require("../util/mapOneOrManyArgs"),u=require("../util/createObject");function o(){for(var o=[],c=0;c<arguments.length;c++)o[c]=arguments[c];var s=(0,n.popResultSelector)(o),b=(0,e.argsArgArrayOrObject)(o),l=b.args,O=b.keys,p=new r.Observable(function(r){var e=l.length;if(e)for(var n=new Array(e),a=e,o=e,c=function(e){var c=!1;(0,t.innerFrom)(l[e]).subscribe((0,i.createOperatorSubscriber)(r,function(r){c||(c=!0,o--),n[e]=r},function(){return a--},void 0,function(){a&&c||(o||r.next(O?(0,u.createObject)(O,n):n),r.complete())}))},s=0;s<e;s++)c(s);else r.complete()});return s?p.pipe((0,a.mapOneOrManyArgs)(s)):p}
|
|
203
|
+
},{"../Observable":"EkNV","../util/argsArgArrayOrObject":"iiKX","./innerFrom":"pOze","../util/args":"cFBb","../operators/OperatorSubscriber":"qno3","../util/mapOneOrManyArgs":"An60","../util/createObject":"tc9h"}],"IUMb":[function(require,module,exports) {
|
|
204
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromEvent=f;var e=require("tslib"),r=require("../observable/innerFrom"),n=require("../Observable"),t=require("../operators/mergeMap"),i=require("../util/isArrayLike"),u=require("../util/isFunction"),o=require("../util/mapOneOrManyArgs"),s=["addListener","removeListener"],a=["addEventListener","removeEventListener"],c=["on","off"];function f(l,F,L,b){if((0,u.isFunction)(L)&&(b=L,L=void 0),b)return f(l,F,L).pipe((0,o.mapOneOrManyArgs)(b));var g=(0,e.__read)(d(l)?a.map(function(e){return function(r){return l[e](F,r,L)}}):m(l)?s.map(v(l,F)):p(l)?c.map(v(l,F)):[],2),q=g[0],O=g[1];if(!q&&(0,i.isArrayLike)(l))return(0,t.mergeMap)(function(e){return f(e,F,L)})((0,r.innerFrom)(l));if(!q)throw new TypeError("Invalid event target");return new n.Observable(function(e){var r=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.next(1<r.length?r:r[0])};return q(r),function(){return O(r)}})}function v(e,r){return function(n){return function(t){return e[n](r,t)}}}function m(e){return(0,u.isFunction)(e.addListener)&&(0,u.isFunction)(e.removeListener)}function p(e){return(0,u.isFunction)(e.on)&&(0,u.isFunction)(e.off)}function d(e){return(0,u.isFunction)(e.addEventListener)&&(0,u.isFunction)(e.removeEventListener)}
|
|
205
|
+
},{"tslib":"B5W1","../observable/innerFrom":"pOze","../Observable":"EkNV","../operators/mergeMap":"mGWE","../util/isArrayLike":"ztpI","../util/isFunction":"IMGL","../util/mapOneOrManyArgs":"An60"}],"Svx6":[function(require,module,exports) {
|
|
206
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromEventPattern=t;var e=require("../Observable"),r=require("../util/isFunction"),n=require("../util/mapOneOrManyArgs");function t(u,i,o){return o?t(u,i).pipe((0,n.mapOneOrManyArgs)(o)):new e.Observable(function(e){var n=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.next(1===r.length?r[0]:r)},t=u(n);return(0,r.isFunction)(i)?function(){return i(n,t)}:void 0})}
|
|
207
|
+
},{"../Observable":"EkNV","../util/isFunction":"IMGL","../util/mapOneOrManyArgs":"An60"}],"qMuK":[function(require,module,exports) {
|
|
208
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generate=n;var e=require("tslib"),r=require("../util/identity"),t=require("../util/isScheduler"),i=require("./defer"),u=require("../scheduled/scheduleIterable");function n(n,l,s,c,a){var d,o,h,b;function f(){var r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:r=b,e.label=1;case 1:return l&&!l(r)?[3,4]:[4,h(r)];case 2:e.sent(),e.label=3;case 3:return r=s(r),[3,1];case 4:return[2]}})}return 1===arguments.length?(b=(d=n).initialState,l=d.condition,s=d.iterate,o=d.resultSelector,h=void 0===o?r.identity:o,a=d.scheduler):(b=n,!c||(0,t.isScheduler)(c)?(h=r.identity,a=c):h=c),(0,i.defer)(a?function(){return(0,u.scheduleIterable)(f(),a)}:f)}
|
|
209
|
+
},{"tslib":"B5W1","../util/identity":"FeLp","../util/isScheduler":"HI7M","./defer":"gpse","../scheduled/scheduleIterable":"VZGJ"}],"XjKV":[function(require,module,exports) {
|
|
210
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.iif=r;var e=require("./defer");function r(r,t,u){return(0,e.defer)(function(){return r()?t:u})}
|
|
211
|
+
},{"./defer":"gpse"}],"x2FQ":[function(require,module,exports) {
|
|
212
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timer=t;var e=require("../Observable"),r=require("../scheduler/async"),i=require("../util/isScheduler"),u=require("../util/isDate");function t(t,s,l){void 0===t&&(t=0),void 0===l&&(l=r.async);var n=-1;return null!=s&&((0,i.isScheduler)(s)?l=s:n=s),new e.Observable(function(e){var r=(0,u.isValidDate)(t)?+t-l.now():t;r<0&&(r=0);var i=0;return l.schedule(function(){e.closed||(e.next(i++),0<=n?this.schedule(void 0,n):e.complete())},r)})}
|
|
213
|
+
},{"../Observable":"EkNV","../scheduler/async":"WQPT","../util/isScheduler":"HI7M","../util/isDate":"NBBr"}],"bNP6":[function(require,module,exports) {
|
|
214
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.interval=t;var e=require("../scheduler/async"),r=require("./timer");function t(t,i){return void 0===t&&(t=0),void 0===i&&(i=e.asyncScheduler),t<0&&(t=0),(0,r.timer)(t,t,i)}
|
|
215
|
+
},{"../scheduler/async":"WQPT","./timer":"x2FQ"}],"rerh":[function(require,module,exports) {
|
|
216
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.merge=i;var e=require("../operators/mergeAll"),r=require("./innerFrom"),o=require("./empty"),t=require("../util/args"),u=require("./from");function i(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];var n=(0,t.popScheduler)(i),m=(0,t.popNumber)(i,1/0),p=i;return p.length?1===p.length?(0,r.innerFrom)(p[0]):(0,e.mergeAll)(m)((0,u.from)(p,n)):o.EMPTY}
|
|
217
|
+
},{"../operators/mergeAll":"leLE","./innerFrom":"pOze","./empty":"qOvc","../util/args":"cFBb","./from":"xTp9"}],"dyCL":[function(require,module,exports) {
|
|
218
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.never=t,exports.NEVER=void 0;var e=require("../Observable"),r=require("../util/noop"),o=new e.Observable(r.noop);function t(){return o}exports.NEVER=o;
|
|
219
|
+
},{"../Observable":"EkNV","../util/noop":"hNvY"}],"h72L":[function(require,module,exports) {
|
|
220
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.argsOrArgArray=e;var r=Array.isArray;function e(e){return 1===e.length&&r(e[0])?e[0]:e}
|
|
221
|
+
},{}],"i85H":[function(require,module,exports) {
|
|
222
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.onErrorResumeNext=u;var r=require("tslib"),e=require("../util/lift"),i=require("../observable/innerFrom"),o=require("../util/argsOrArgArray"),t=require("./OperatorSubscriber"),a=require("../util/noop");function u(){for(var u=[],n=0;n<arguments.length;n++)u[n]=arguments[n];var s=(0,o.argsOrArgArray)(u);return(0,e.operate)(function(e,o){var u=(0,r.__spreadArray)([e],(0,r.__read)(s)),n=function(){if(!o.closed)if(u.length>0){var r=void 0;try{r=(0,i.innerFrom)(u.shift())}catch(s){return void n()}var e=(0,t.createOperatorSubscriber)(o,void 0,a.noop,a.noop);r.subscribe(e),e.add(n)}else o.complete()};n()})}
|
|
223
|
+
},{"tslib":"B5W1","../util/lift":"gwDu","../observable/innerFrom":"pOze","../util/argsOrArgArray":"h72L","./OperatorSubscriber":"qno3","../util/noop":"hNvY"}],"C1Ne":[function(require,module,exports) {
|
|
224
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.onErrorResumeNext=o;var r=require("./empty"),e=require("../operators/onErrorResumeNext"),t=require("../util/argsOrArgArray");function o(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return(0,e.onErrorResumeNext)((0,t.argsOrArgArray)(o))(r.EMPTY)}
|
|
225
|
+
},{"./empty":"qOvc","../operators/onErrorResumeNext":"i85H","../util/argsOrArgArray":"h72L"}],"XoYb":[function(require,module,exports) {
|
|
226
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pairs=r;var e=require("./from");function r(r,t){return(0,e.from)(Object.entries(r),t)}
|
|
227
|
+
},{"./from":"xTp9"}],"VLqq":[function(require,module,exports) {
|
|
228
|
+
"use strict";function e(e,t){return function(r,n){return!e.call(t,r,n)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.not=e;
|
|
229
|
+
},{}],"IFp1":[function(require,module,exports) {
|
|
230
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.filter=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(t,u){return(0,e.operate)(function(e,i){var c=0;e.subscribe((0,r.createOperatorSubscriber)(i,function(e){return t.call(u,e,c++)&&i.next(e)}))})}
|
|
231
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"kc1W":[function(require,module,exports) {
|
|
232
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.partition=i;var r=require("../util/not"),e=require("../operators/filter"),t=require("./innerFrom");function i(i,n,o){return[(0,e.filter)(n,o)((0,t.innerFrom)(i)),(0,e.filter)((0,r.not)(n,o))((0,t.innerFrom)(i))]}
|
|
233
|
+
},{"../util/not":"VLqq","../operators/filter":"IFp1","./innerFrom":"pOze"}],"IUwa":[function(require,module,exports) {
|
|
234
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.race=u,exports.raceInit=i;var r=require("../Observable"),e=require("./innerFrom"),n=require("../util/argsOrArgArray"),t=require("../operators/OperatorSubscriber");function u(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return 1===(t=(0,n.argsOrArgArray)(t)).length?(0,e.innerFrom)(t[0]):new r.Observable(i(t))}function i(r){return function(n){for(var u=[],i=function(i){u.push((0,e.innerFrom)(r[i]).subscribe((0,t.createOperatorSubscriber)(n,function(r){if(u){for(var e=0;e<u.length;e++)e!==i&&u[e].unsubscribe();u=null}n.next(r)})))},o=0;u&&!n.closed&&o<r.length;o++)i(o)}}
|
|
235
|
+
},{"../Observable":"EkNV","./innerFrom":"pOze","../util/argsOrArgArray":"h72L","../operators/OperatorSubscriber":"qno3"}],"hGVv":[function(require,module,exports) {
|
|
236
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.range=t;var e=require("../Observable"),r=require("./empty");function t(t,n,u){if(null==n&&(n=t,t=0),n<=0)return r.EMPTY;var o=n+t;return new e.Observable(u?function(e){var r=t;return u.schedule(function(){r<o?(e.next(r++),this.schedule()):e.complete()})}:function(e){for(var r=t;r<o&&!e.closed;)e.next(r++);e.complete()})}
|
|
237
|
+
},{"../Observable":"EkNV","./empty":"qOvc"}],"aIsN":[function(require,module,exports) {
|
|
238
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.using=u;var e=require("../Observable"),r=require("./innerFrom"),n=require("./empty");function u(u,i){return new e.Observable(function(e){var s=u(),t=i(s);return(t?(0,r.innerFrom)(t):n.EMPTY).subscribe(e),function(){s&&s.unsubscribe()}})}
|
|
239
|
+
},{"../Observable":"EkNV","./innerFrom":"pOze","./empty":"qOvc"}],"T2xt":[function(require,module,exports) {
|
|
240
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.zip=a;var r=require("tslib"),e=require("../Observable"),n=require("./innerFrom"),t=require("../util/argsOrArgArray"),u=require("./empty"),i=require("../operators/OperatorSubscriber"),o=require("../util/args");function a(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var c=(0,o.popResultSelector)(a),s=(0,t.argsOrArgArray)(a);return s.length?new e.Observable(function(e){var t=s.map(function(){return[]}),u=s.map(function(){return!1});e.add(function(){t=u=null});for(var o=function(o){(0,n.innerFrom)(s[o]).subscribe((0,i.createOperatorSubscriber)(e,function(n){if(t[o].push(n),t.every(function(r){return r.length})){var i=t.map(function(r){return r.shift()});e.next(c?c.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(i))):i),t.some(function(r,e){return!r.length&&u[e]})&&e.complete()}},function(){u[o]=!0,!t[o].length&&e.complete()}))},a=0;!e.closed&&a<s.length;a++)o(a);return function(){t=u=null}}):u.EMPTY}
|
|
241
|
+
},{"tslib":"B5W1","../Observable":"EkNV","./innerFrom":"pOze","../util/argsOrArgArray":"h72L","./empty":"qOvc","../operators/OperatorSubscriber":"qno3","../util/args":"cFBb"}],"zTZU":[function(require,module,exports) {
|
|
242
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
243
|
+
},{}],"OSTs":[function(require,module,exports) {
|
|
244
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.audit=n;var e=require("../util/lift"),r=require("../observable/innerFrom"),u=require("./OperatorSubscriber");function n(n){return(0,e.operate)(function(e,t){var i=!1,l=null,o=null,c=!1,s=function(){if(null==o||o.unsubscribe(),o=null,i){i=!1;var e=l;l=null,t.next(e)}c&&t.complete()},b=function(){o=null,c&&t.complete()};e.subscribe((0,u.createOperatorSubscriber)(t,function(e){i=!0,l=e,o||(0,r.innerFrom)(n(e)).subscribe(o=(0,u.createOperatorSubscriber)(t,s,b))},function(){c=!0,(!i||!o||o.closed)&&t.complete()}))})}
|
|
245
|
+
},{"../util/lift":"gwDu","../observable/innerFrom":"pOze","./OperatorSubscriber":"qno3"}],"qRa1":[function(require,module,exports) {
|
|
246
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.auditTime=u;var e=require("../scheduler/async"),r=require("./audit"),t=require("../observable/timer");function u(u,i){return void 0===i&&(i=e.asyncScheduler),(0,r.audit)(function(){return(0,t.timer)(u,i)})}
|
|
247
|
+
},{"../scheduler/async":"WQPT","./audit":"OSTs","../observable/timer":"x2FQ"}],"dt28":[function(require,module,exports) {
|
|
248
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.buffer=u;var e=require("../util/lift"),r=require("../util/noop"),t=require("./OperatorSubscriber");function u(u){return(0,e.operate)(function(e,n){var i=[];return e.subscribe((0,t.createOperatorSubscriber)(n,function(e){return i.push(e)},function(){n.next(i),n.complete()})),u.subscribe((0,t.createOperatorSubscriber)(n,function(){var e=i;i=[],n.next(e)},r.noop)),function(){i=null}})}
|
|
249
|
+
},{"../util/lift":"gwDu","../util/noop":"hNvY","./OperatorSubscriber":"qno3"}],"j5Mb":[function(require,module,exports) {
|
|
250
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferCount=n;var r=require("tslib"),e=require("../util/lift"),t=require("./OperatorSubscriber"),l=require("../util/arrRemove");function n(n,u){return void 0===u&&(u=null),u=null!=u?u:n,(0,e.operate)(function(e,o){var a=[],i=0;e.subscribe((0,t.createOperatorSubscriber)(o,function(e){var t,f,c,v,s=null;i++%u==0&&a.push([]);try{for(var y=(0,r.__values)(a),d=y.next();!d.done;d=y.next()){(x=d.value).push(e),n<=x.length&&(s=null!=s?s:[]).push(x)}}catch(b){t={error:b}}finally{try{d&&!d.done&&(f=y.return)&&f.call(y)}finally{if(t)throw t.error}}if(s)try{for(var h=(0,r.__values)(s),p=h.next();!p.done;p=h.next()){var x=p.value;(0,l.arrRemove)(a,x),o.next(x)}}catch(_){c={error:_}}finally{try{p&&!p.done&&(v=h.return)&&v.call(h)}finally{if(c)throw c.error}}},function(){var e,t;try{for(var l=(0,r.__values)(a),n=l.next();!n.done;n=l.next()){var u=n.value;o.next(u)}}catch(i){e={error:i}}finally{try{n&&!n.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}o.complete()},void 0,function(){a=null}))})}
|
|
251
|
+
},{"tslib":"B5W1","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/arrRemove":"h9cX"}],"ZXjh":[function(require,module,exports) {
|
|
252
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferTime=o;var e=require("tslib"),r=require("../Subscription"),u=require("../util/lift"),n=require("./OperatorSubscriber"),t=require("../util/arrRemove"),i=require("../scheduler/async"),l=require("../util/args"),c=require("../util/executeSchedule");function o(o){for(var s,a,f=[],b=1;b<arguments.length;b++)f[b-1]=arguments[b];var v=null!==(s=(0,l.popScheduler)(f))&&void 0!==s?s:i.asyncScheduler,d=null!==(a=f[0])&&void 0!==a?a:null,h=f[1]||1/0;return(0,u.operate)(function(u,i){var l=[],s=!1,a=function(e){var r=e.buffer;e.subs.unsubscribe(),(0,t.arrRemove)(l,e),i.next(r),s&&f()},f=function(){if(l){var e=new r.Subscription;i.add(e);var u={buffer:[],subs:e};l.push(u),(0,c.executeSchedule)(e,v,function(){return a(u)},o)}};null!==d&&d>=0?(0,c.executeSchedule)(i,v,f,d,!0):s=!0,f();var b=(0,n.createOperatorSubscriber)(i,function(r){var u,n,t=l.slice();try{for(var i=(0,e.__values)(t),c=i.next();!c.done;c=i.next()){var o=c.value,s=o.buffer;s.push(r),h<=s.length&&a(o)}}catch(f){u={error:f}}finally{try{c&&!c.done&&(n=i.return)&&n.call(i)}finally{if(u)throw u.error}}},function(){for(;null==l?void 0:l.length;)i.next(l.shift().buffer);null==b||b.unsubscribe(),i.complete(),i.unsubscribe()},void 0,function(){return l=null});u.subscribe(b)})}
|
|
253
|
+
},{"tslib":"B5W1","../Subscription":"Atlq","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/arrRemove":"h9cX","../scheduler/async":"WQPT","../util/args":"cFBb","../util/executeSchedule":"WVgR"}],"sEzB":[function(require,module,exports) {
|
|
254
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferToggle=a;var r=require("tslib"),e=require("../Subscription"),t=require("../util/lift"),i=require("../observable/innerFrom"),o=require("./OperatorSubscriber"),n=require("../util/noop"),u=require("../util/arrRemove");function a(a,c){return(0,t.operate)(function(t,s){var b=[];(0,i.innerFrom)(a).subscribe((0,o.createOperatorSubscriber)(s,function(r){var t=[];b.push(t);var a=new e.Subscription;a.add((0,i.innerFrom)(c(r)).subscribe((0,o.createOperatorSubscriber)(s,function(){(0,u.arrRemove)(b,t),s.next(t),a.unsubscribe()},n.noop)))},n.noop)),t.subscribe((0,o.createOperatorSubscriber)(s,function(e){var t,i;try{for(var o=(0,r.__values)(b),n=o.next();!n.done;n=o.next()){n.value.push(e)}}catch(u){t={error:u}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}},function(){for(;b.length>0;)s.next(b.shift());s.complete()}))})}
|
|
255
|
+
},{"tslib":"B5W1","../Subscription":"Atlq","../util/lift":"gwDu","../observable/innerFrom":"pOze","./OperatorSubscriber":"qno3","../util/noop":"hNvY","../util/arrRemove":"h9cX"}],"DhIa":[function(require,module,exports) {
|
|
256
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bufferWhen=t;var e=require("../util/lift"),r=require("../util/noop"),u=require("./OperatorSubscriber"),n=require("../observable/innerFrom");function t(t){return(0,e.operate)(function(e,i){var o=null,c=null,l=function(){null==c||c.unsubscribe();var e=o;o=[],e&&i.next(e),(0,n.innerFrom)(t()).subscribe(c=(0,u.createOperatorSubscriber)(i,l,r.noop))};l(),e.subscribe((0,u.createOperatorSubscriber)(i,function(e){return null==o?void 0:o.push(e)},function(){o&&i.next(o),i.complete()},void 0,function(){return o=c=null}))})}
|
|
257
|
+
},{"../util/lift":"gwDu","../util/noop":"hNvY","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze"}],"ZY8e":[function(require,module,exports) {
|
|
258
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.catchError=i;var r=require("../observable/innerFrom"),e=require("./OperatorSubscriber"),u=require("../util/lift");function i(s){return(0,u.operate)(function(u,b){var n,t=null,o=!1;t=u.subscribe((0,e.createOperatorSubscriber)(b,void 0,void 0,function(e){n=(0,r.innerFrom)(s(e,i(s)(u))),t?(t.unsubscribe(),t=null,n.subscribe(b)):o=!0})),o&&(t.unsubscribe(),t=null,n.subscribe(b))})}
|
|
259
|
+
},{"../observable/innerFrom":"pOze","./OperatorSubscriber":"qno3","../util/lift":"gwDu"}],"oeFh":[function(require,module,exports) {
|
|
260
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scanInternals=r;var e=require("./OperatorSubscriber");function r(r,t,n,c,u){return function(o,s){var i=n,a=t,b=0;o.subscribe((0,e.createOperatorSubscriber)(s,function(e){var t=b++;a=i?r(a,e,t):(i=!0,e),c&&s.next(a)},u&&function(){i&&s.next(a),s.complete()}))}}
|
|
261
|
+
},{"./OperatorSubscriber":"qno3"}],"gTgQ":[function(require,module,exports) {
|
|
262
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reduce=t;var e=require("./scanInternals"),r=require("../util/lift");function t(t,n){return(0,r.operate)((0,e.scanInternals)(t,n,arguments.length>=2,!1,!0))}
|
|
263
|
+
},{"./scanInternals":"oeFh","../util/lift":"gwDu"}],"Dse9":[function(require,module,exports) {
|
|
264
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toArray=u;var e=require("./reduce"),r=require("../util/lift"),t=function(e,r){return e.push(r),e};function u(){return(0,r.operate)(function(r,u){(0,e.reduce)(t,[])(r).subscribe(u)})}
|
|
265
|
+
},{"./reduce":"gTgQ","../util/lift":"gwDu"}],"oubL":[function(require,module,exports) {
|
|
266
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.joinAllInternals=u;var e=require("../util/identity"),r=require("../util/mapOneOrManyArgs"),t=require("../util/pipe"),i=require("./mergeMap"),n=require("./toArray");function u(u,a){return(0,t.pipe)((0,n.toArray)(),(0,i.mergeMap)(function(e){return u(e)}),a?(0,r.mapOneOrManyArgs)(a):e.identity)}
|
|
267
|
+
},{"../util/identity":"FeLp","../util/mapOneOrManyArgs":"An60","../util/pipe":"eq9W","./mergeMap":"mGWE","./toArray":"Dse9"}],"KhWj":[function(require,module,exports) {
|
|
268
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineLatestAll=r;var e=require("../observable/combineLatest"),t=require("./joinAllInternals");function r(r){return(0,t.joinAllInternals)(e.combineLatest,r)}
|
|
269
|
+
},{"../observable/combineLatest":"kXaL","./joinAllInternals":"oubL"}],"bYSN":[function(require,module,exports) {
|
|
270
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineAll=void 0;var e=require("./combineLatestAll"),t=e.combineLatestAll;exports.combineAll=t;
|
|
271
|
+
},{"./combineLatestAll":"KhWj"}],"xTmU":[function(require,module,exports) {
|
|
272
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineLatest=p;var r=require("tslib"),e=require("../observable/combineLatest"),t=require("../util/lift"),a=require("../util/argsOrArgArray"),i=require("../util/mapOneOrManyArgs"),u=require("../util/pipe"),s=require("../util/args");function p(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var l=(0,s.popResultSelector)(n);return l?(0,u.pipe)(p.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(n))),(0,i.mapOneOrManyArgs)(l)):(0,t.operate)(function(t,i){(0,e.combineLatestInit)((0,r.__spreadArray)([t],(0,r.__read)((0,a.argsOrArgArray)(n))))(i)})}
|
|
273
|
+
},{"tslib":"B5W1","../observable/combineLatest":"kXaL","../util/lift":"gwDu","../util/argsOrArgArray":"h72L","../util/mapOneOrManyArgs":"An60","../util/pipe":"eq9W","../util/args":"cFBb"}],"X904":[function(require,module,exports) {
|
|
274
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.combineLatestWith=t;var e=require("tslib"),r=require("./combineLatest");function t(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return r.combineLatest.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(t)))}
|
|
275
|
+
},{"tslib":"B5W1","./combineLatest":"xTmU"}],"u95e":[function(require,module,exports) {
|
|
276
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatMap=t;var e=require("./mergeMap"),r=require("../util/isFunction");function t(t,i){return(0,r.isFunction)(i)?(0,e.mergeMap)(t,i,1):(0,e.mergeMap)(t,1)}
|
|
277
|
+
},{"./mergeMap":"mGWE","../util/isFunction":"IMGL"}],"haX1":[function(require,module,exports) {
|
|
278
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatMapTo=e;var t=require("./concatMap"),n=require("../util/isFunction");function e(e,r){return(0,n.isFunction)(r)?(0,t.concatMap)(function(){return e},r):(0,t.concatMap)(function(){return e})}
|
|
279
|
+
},{"./concatMap":"u95e","../util/isFunction":"IMGL"}],"Ge6C":[function(require,module,exports) {
|
|
280
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concat=i;var r=require("tslib"),e=require("../util/lift"),t=require("./concatAll"),o=require("../util/args"),u=require("../observable/from");function i(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var l=(0,o.popScheduler)(i);return(0,e.operate)(function(e,o){(0,t.concatAll)()((0,u.from)((0,r.__spreadArray)([e],(0,r.__read)(i)),l)).subscribe(o)})}
|
|
281
|
+
},{"tslib":"B5W1","../util/lift":"gwDu","./concatAll":"SHNp","../util/args":"cFBb","../observable/from":"xTp9"}],"wpEC":[function(require,module,exports) {
|
|
282
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.concatWith=t;var e=require("tslib"),r=require("./concat");function t(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];return r.concat.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(t)))}
|
|
283
|
+
},{"tslib":"B5W1","./concat":"Ge6C"}],"eGGm":[function(require,module,exports) {
|
|
284
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromSubscribable=r;var e=require("../Observable");function r(r){return new e.Observable(function(e){return r.subscribe(e)})}
|
|
285
|
+
},{"../Observable":"EkNV"}],"aOS7":[function(require,module,exports) {
|
|
286
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.connect=u;var e=require("../Subject"),r=require("../observable/innerFrom"),n=require("../util/lift"),o=require("../observable/fromSubscribable"),t={connector:function(){return new e.Subject}};function u(e,u){void 0===u&&(u=t);var i=u.connector;return(0,n.operate)(function(n,t){var u=i();(0,r.innerFrom)(e((0,o.fromSubscribable)(u))).subscribe(t),t.add(n.subscribe(u))})}
|
|
287
|
+
},{"../Subject":"BDW7","../observable/innerFrom":"pOze","../util/lift":"gwDu","../observable/fromSubscribable":"eGGm"}],"O922":[function(require,module,exports) {
|
|
288
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.count=r;var e=require("./reduce");function r(r){return(0,e.reduce)(function(e,t,u){return!r||r(t,u)?e+1:e},0)}
|
|
289
|
+
},{"./reduce":"gTgQ"}],"WKkD":[function(require,module,exports) {
|
|
290
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.debounce=i;var e=require("../util/lift"),r=require("../util/noop"),u=require("./OperatorSubscriber"),n=require("../observable/innerFrom");function i(i){return(0,e.operate)(function(e,o){var t=!1,l=null,c=null,b=function(){if(null==c||c.unsubscribe(),c=null,t){t=!1;var e=l;l=null,o.next(e)}};e.subscribe((0,u.createOperatorSubscriber)(o,function(e){null==c||c.unsubscribe(),t=!0,l=e,c=(0,u.createOperatorSubscriber)(o,b,r.noop),(0,n.innerFrom)(i(e)).subscribe(c)},function(){b(),o.complete()},void 0,function(){l=c=null}))})}
|
|
291
|
+
},{"../util/lift":"gwDu","../util/noop":"hNvY","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze"}],"N6Fx":[function(require,module,exports) {
|
|
292
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.debounceTime=n;var e=require("../scheduler/async"),r=require("../util/lift"),u=require("./OperatorSubscriber");function n(n,i){return void 0===i&&(i=e.asyncScheduler),(0,r.operate)(function(e,r){var t=null,c=null,o=null,l=function(){if(t){t.unsubscribe(),t=null;var e=c;c=null,r.next(e)}};function s(){var e=o+n,u=i.now();if(u<e)return t=this.schedule(void 0,e-u),void r.add(t);l()}e.subscribe((0,u.createOperatorSubscriber)(r,function(e){c=e,o=i.now(),t||(t=i.schedule(s,n),r.add(t))},function(){l(),r.complete()},void 0,function(){c=t=null}))})}
|
|
293
|
+
},{"../scheduler/async":"WQPT","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"Fah0":[function(require,module,exports) {
|
|
294
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultIfEmpty=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(t){return(0,e.operate)(function(e,u){var i=!1;e.subscribe((0,r.createOperatorSubscriber)(u,function(e){i=!0,u.next(e)},function(){i||u.next(t),u.complete()}))})}
|
|
295
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"mmu8":[function(require,module,exports) {
|
|
296
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.take=u;var e=require("../observable/empty"),r=require("../util/lift"),t=require("./OperatorSubscriber");function u(u){return u<=0?function(){return e.EMPTY}:(0,r.operate)(function(e,r){var i=0;e.subscribe((0,t.createOperatorSubscriber)(r,function(e){++i<=u&&(r.next(e),u<=i&&r.complete())}))})}
|
|
297
|
+
},{"../observable/empty":"qOvc","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"JGPk":[function(require,module,exports) {
|
|
298
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ignoreElements=i;var e=require("../util/lift"),r=require("./OperatorSubscriber"),t=require("../util/noop");function i(){return(0,e.operate)(function(e,i){e.subscribe((0,r.createOperatorSubscriber)(i,t.noop))})}
|
|
299
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/noop":"hNvY"}],"qCL4":[function(require,module,exports) {
|
|
300
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mapTo=r;var e=require("./map");function r(r){return(0,e.map)(function(){return r})}
|
|
301
|
+
},{"./map":"N8Yl"}],"UAqC":[function(require,module,exports) {
|
|
302
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.delayWhen=o;var e=require("../observable/concat"),r=require("./take"),t=require("./ignoreElements"),n=require("./mapTo"),i=require("./mergeMap");function o(u,a){return a?function(n){return(0,e.concat)(a.pipe((0,r.take)(1),(0,t.ignoreElements)()),n.pipe(o(u)))}:(0,i.mergeMap)(function(e,t){return u(e,t).pipe((0,r.take)(1),(0,n.mapTo)(e))})}
|
|
303
|
+
},{"../observable/concat":"nSjD","./take":"mmu8","./ignoreElements":"JGPk","./mapTo":"qCL4","./mergeMap":"mGWE"}],"NHnw":[function(require,module,exports) {
|
|
304
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.delay=u;var e=require("../scheduler/async"),r=require("./delayWhen"),t=require("../observable/timer");function u(u,n){void 0===n&&(n=e.asyncScheduler);var i=(0,t.timer)(u,n);return(0,r.delayWhen)(function(){return i})}
|
|
305
|
+
},{"../scheduler/async":"WQPT","./delayWhen":"UAqC","../observable/timer":"x2FQ"}],"xeau":[function(require,module,exports) {
|
|
306
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.dematerialize=i;var e=require("../Notification"),r=require("../util/lift"),t=require("./OperatorSubscriber");function i(){return(0,r.operate)(function(r,i){r.subscribe((0,t.createOperatorSubscriber)(i,function(r){return(0,e.observeNotification)(r,i)}))})}
|
|
307
|
+
},{"../Notification":"swlq","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"vBqk":[function(require,module,exports) {
|
|
308
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.distinct=u;var e=require("../util/lift"),r=require("./OperatorSubscriber"),t=require("../util/noop");function u(u,i){return(0,e.operate)(function(e,n){var o=new Set;e.subscribe((0,r.createOperatorSubscriber)(n,function(e){var r=u?u(e):e;o.has(r)||(o.add(r),n.next(e))})),null==i||i.subscribe((0,r.createOperatorSubscriber)(n,function(){return o.clear()},t.noop))})}
|
|
309
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/noop":"hNvY"}],"Z6Fo":[function(require,module,exports) {
|
|
310
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.distinctUntilChanged=i;var e=require("../util/identity"),r=require("../util/lift"),t=require("./OperatorSubscriber");function i(i,u){return void 0===u&&(u=e.identity),i=null!=i?i:n,(0,r.operate)(function(e,r){var n,o=!0;e.subscribe((0,t.createOperatorSubscriber)(r,function(e){var t=u(e);!o&&i(n,t)||(o=!1,n=t,r.next(e))}))})}function n(e,r){return e===r}
|
|
311
|
+
},{"../util/identity":"FeLp","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"rOn3":[function(require,module,exports) {
|
|
312
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.distinctUntilKeyChanged=e;var t=require("./distinctUntilChanged");function e(e,n){return(0,t.distinctUntilChanged)(function(t,i){return n?n(t[e],i[e]):t[e]===i[e]})}
|
|
313
|
+
},{"./distinctUntilChanged":"Z6Fo"}],"hR0o":[function(require,module,exports) {
|
|
314
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throwIfEmpty=u;var r=require("../util/EmptyError"),e=require("../util/lift"),t=require("./OperatorSubscriber");function u(r){return void 0===r&&(r=o),(0,e.operate)(function(e,u){var o=!1;e.subscribe((0,t.createOperatorSubscriber)(u,function(r){o=!0,u.next(r)},function(){return o?u.complete():u.error(r())}))})}function o(){return new r.EmptyError}
|
|
315
|
+
},{"../util/EmptyError":"wRNN","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"vaXs":[function(require,module,exports) {
|
|
316
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.elementAt=f;var e=require("../util/ArgumentOutOfRangeError"),r=require("./filter"),t=require("./throwIfEmpty"),u=require("./defaultIfEmpty"),n=require("./take");function f(f,i){if(f<0)throw new e.ArgumentOutOfRangeError;var o=arguments.length>=2;return function(a){return a.pipe((0,r.filter)(function(e,r){return r===f}),(0,n.take)(1),o?(0,u.defaultIfEmpty)(i):(0,t.throwIfEmpty)(function(){return new e.ArgumentOutOfRangeError}))}}
|
|
317
|
+
},{"../util/ArgumentOutOfRangeError":"wL5X","./filter":"IFp1","./throwIfEmpty":"hR0o","./defaultIfEmpty":"Fah0","./take":"mmu8"}],"w35o":[function(require,module,exports) {
|
|
318
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.endWith=o;var e=require("tslib"),r=require("../observable/concat"),t=require("../observable/of");function o(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return function(a){return(0,r.concat)(a,t.of.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(o))))}}
|
|
319
|
+
},{"tslib":"B5W1","../observable/concat":"nSjD","../observable/of":"lcaN"}],"DFe2":[function(require,module,exports) {
|
|
320
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.every=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(t,u){return(0,e.operate)(function(e,c){var i=0;e.subscribe((0,r.createOperatorSubscriber)(c,function(r){t.call(u,r,i++,e)||(c.next(!1),c.complete())},function(){c.next(!0),c.complete()}))})}
|
|
321
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"BqMb":[function(require,module,exports) {
|
|
322
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exhaustMap=u;var e=require("./map"),r=require("../observable/innerFrom"),n=require("../util/lift"),t=require("./OperatorSubscriber");function u(i,o){return o?function(n){return n.pipe(u(function(n,t){return(0,r.innerFrom)(i(n,t)).pipe((0,e.map)(function(e,r){return o(n,e,t,r)}))}))}:(0,n.operate)(function(e,n){var u=0,o=null,c=!1;e.subscribe((0,t.createOperatorSubscriber)(n,function(e){o||(o=(0,t.createOperatorSubscriber)(n,void 0,function(){o=null,c&&n.complete()}),(0,r.innerFrom)(i(e,u++)).subscribe(o))},function(){c=!0,!o&&n.complete()}))})}
|
|
323
|
+
},{"./map":"N8Yl","../observable/innerFrom":"pOze","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"ftIR":[function(require,module,exports) {
|
|
324
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exhaustAll=r;var e=require("./exhaustMap"),t=require("../util/identity");function r(){return(0,e.exhaustMap)(t.identity)}
|
|
325
|
+
},{"./exhaustMap":"BqMb","../util/identity":"FeLp"}],"Bq0T":[function(require,module,exports) {
|
|
326
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exhaust=void 0;var e=require("./exhaustAll"),t=e.exhaustAll;exports.exhaust=t;
|
|
327
|
+
},{"./exhaustAll":"ftIR"}],"TgHY":[function(require,module,exports) {
|
|
328
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.expand=t;var e=require("../util/lift"),r=require("./mergeInternals");function t(t,n,i){return void 0===n&&(n=1/0),n=(n||0)<1?1/0:n,(0,e.operate)(function(e,u){return(0,r.mergeInternals)(e,u,t,n,void 0,!0,i)})}
|
|
329
|
+
},{"../util/lift":"gwDu","./mergeInternals":"EAff"}],"Z4yU":[function(require,module,exports) {
|
|
330
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.finalize=r;var e=require("../util/lift");function r(r){return(0,e.operate)(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}
|
|
331
|
+
},{"../util/lift":"gwDu"}],"M6jc":[function(require,module,exports) {
|
|
332
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.find=t,exports.createFind=i;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(r,t){return(0,e.operate)(i(r,t,"value"))}function i(e,t,i){var n="index"===i;return function(i,u){var o=0;i.subscribe((0,r.createOperatorSubscriber)(u,function(r){var c=o++;e.call(t,r,c,i)&&(u.next(n?c:r),u.complete())},function(){u.next(n?-1:void 0),u.complete()}))}}
|
|
333
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"hdxC":[function(require,module,exports) {
|
|
334
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findIndex=t;var e=require("../util/lift"),r=require("./find");function t(t,i){return(0,e.operate)((0,r.createFind)(t,i,"index"))}
|
|
335
|
+
},{"../util/lift":"gwDu","./find":"M6jc"}],"eND7":[function(require,module,exports) {
|
|
336
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.first=f;var r=require("../util/EmptyError"),e=require("./filter"),t=require("./take"),i=require("./defaultIfEmpty"),u=require("./throwIfEmpty"),n=require("../util/identity");function f(f,o){var p=arguments.length>=2;return function(l){return l.pipe(f?(0,e.filter)(function(r,e){return f(r,e,l)}):n.identity,(0,t.take)(1),p?(0,i.defaultIfEmpty)(o):(0,u.throwIfEmpty)(function(){return new r.EmptyError}))}}
|
|
337
|
+
},{"../util/EmptyError":"wRNN","./filter":"IFp1","./take":"mmu8","./defaultIfEmpty":"Fah0","./throwIfEmpty":"hR0o","../util/identity":"FeLp"}],"JSNM":[function(require,module,exports) {
|
|
338
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.groupBy=i;var e=require("../Observable"),r=require("../observable/innerFrom"),n=require("../Subject"),t=require("../util/lift"),u=require("./OperatorSubscriber");function i(i,c,o,b){return(0,t.operate)(function(t,s){var a;c&&"function"!=typeof c?(o=c.duration,a=c.element,b=c.connector):a=c;var f=new Map,l=function(e){f.forEach(e),e(s)},v=function(e){return l(function(r){return r.error(e)})},p=0,d=!1,O=new u.OperatorSubscriber(s,function(t){try{var c=i(t),l=f.get(c);if(!l){f.set(c,l=b?b():new n.Subject);var m=(y=c,S=l,(w=new e.Observable(function(e){p++;var r=S.subscribe(e);return function(){r.unsubscribe(),0==--p&&d&&O.unsubscribe()}})).key=y,w);if(s.next(m),o){var q=(0,u.createOperatorSubscriber)(l,function(){l.complete(),null==q||q.unsubscribe()},void 0,void 0,function(){return f.delete(c)});O.add((0,r.innerFrom)(o(m)).subscribe(q))}}l.next(a?a(t):t)}catch(x){v(x)}var y,S,w},function(){return l(function(e){return e.complete()})},v,function(){return f.clear()},function(){return d=!0,0===p});t.subscribe(O)})}
|
|
339
|
+
},{"../Observable":"EkNV","../observable/innerFrom":"pOze","../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"G3o6":[function(require,module,exports) {
|
|
340
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEmpty=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(){return(0,e.operate)(function(e,t){e.subscribe((0,r.createOperatorSubscriber)(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})}
|
|
341
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"BkG9":[function(require,module,exports) {
|
|
342
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.takeLast=u;var e=require("tslib"),r=require("../observable/empty"),t=require("../util/lift"),n=require("./OperatorSubscriber");function u(u){return u<=0?function(){return r.EMPTY}:(0,t.operate)(function(r,t){var i=[];r.subscribe((0,n.createOperatorSubscriber)(t,function(e){i.push(e),u<i.length&&i.shift()},function(){var r,n;try{for(var u=(0,e.__values)(i),o=u.next();!o.done;o=u.next()){var a=o.value;t.next(a)}}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}t.complete()},void 0,function(){i=null}))})}
|
|
343
|
+
},{"tslib":"B5W1","../observable/empty":"qOvc","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"H8OC":[function(require,module,exports) {
|
|
344
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.last=f;var t=require("../util/EmptyError"),e=require("./filter"),r=require("./takeLast"),i=require("./throwIfEmpty"),u=require("./defaultIfEmpty"),n=require("../util/identity");function f(f,o){var p=arguments.length>=2;return function(a){return a.pipe(f?(0,e.filter)(function(t,e){return f(t,e,a)}):n.identity,(0,r.takeLast)(1),p?(0,u.defaultIfEmpty)(o):(0,i.throwIfEmpty)(function(){return new t.EmptyError}))}}
|
|
345
|
+
},{"../util/EmptyError":"wRNN","./filter":"IFp1","./takeLast":"BkG9","./throwIfEmpty":"hR0o","./defaultIfEmpty":"Fah0","../util/identity":"FeLp"}],"LGra":[function(require,module,exports) {
|
|
346
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.materialize=i;var e=require("../Notification"),t=require("../util/lift"),r=require("./OperatorSubscriber");function i(){return(0,t.operate)(function(t,i){t.subscribe((0,r.createOperatorSubscriber)(i,function(t){i.next(e.Notification.createNext(t))},function(){i.next(e.Notification.createComplete()),i.complete()},function(t){i.next(e.Notification.createError(t)),i.complete()}))})}
|
|
347
|
+
},{"../Notification":"swlq","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"wP5t":[function(require,module,exports) {
|
|
348
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.max=u;var e=require("./reduce"),r=require("../util/isFunction");function u(u){return(0,e.reduce)((0,r.isFunction)(u)?function(e,r){return u(e,r)>0?e:r}:function(e,r){return e>r?e:r})}
|
|
349
|
+
},{"./reduce":"gTgQ","../util/isFunction":"IMGL"}],"zBzv":[function(require,module,exports) {
|
|
350
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flatMap=void 0;var e=require("./mergeMap"),r=e.mergeMap;exports.flatMap=r;
|
|
351
|
+
},{"./mergeMap":"mGWE"}],"AZnr":[function(require,module,exports) {
|
|
352
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeMapTo=t;var e=require("./mergeMap"),r=require("../util/isFunction");function t(t,n,u){return void 0===u&&(u=1/0),(0,r.isFunction)(n)?(0,e.mergeMap)(function(){return t},n,u):("number"==typeof n&&(u=n),(0,e.mergeMap)(function(){return t},u))}
|
|
353
|
+
},{"./mergeMap":"mGWE","../util/isFunction":"IMGL"}],"L3Pv":[function(require,module,exports) {
|
|
354
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeScan=n;var e=require("../util/lift"),r=require("./mergeInternals");function n(n,t,u){return void 0===u&&(u=1/0),(0,e.operate)(function(e,i){var o=t;return(0,r.mergeInternals)(e,i,function(e,r){return n(o,e,r)},u,function(e){o=e},!1,void 0,function(){return o=null})})}
|
|
355
|
+
},{"../util/lift":"gwDu","./mergeInternals":"EAff"}],"Jh4T":[function(require,module,exports) {
|
|
356
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.merge=l;var r=require("tslib"),e=require("../util/lift"),u=require("../util/argsOrArgArray"),i=require("./mergeAll"),t=require("../util/args"),a=require("../observable/from");function l(){for(var l=[],o=0;o<arguments.length;o++)l[o]=arguments[o];var s=(0,t.popScheduler)(l),g=(0,t.popNumber)(l,1/0);return l=(0,u.argsOrArgArray)(l),(0,e.operate)(function(e,u){(0,i.mergeAll)(g)((0,a.from)((0,r.__spreadArray)([e],(0,r.__read)(l)),s)).subscribe(u)})}
|
|
357
|
+
},{"tslib":"B5W1","../util/lift":"gwDu","../util/argsOrArgArray":"h72L","./mergeAll":"leLE","../util/args":"cFBb","../observable/from":"xTp9"}],"ivs5":[function(require,module,exports) {
|
|
358
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.mergeWith=t;var e=require("tslib"),r=require("./merge");function t(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return r.merge.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(t)))}
|
|
359
|
+
},{"tslib":"B5W1","./merge":"Jh4T"}],"JiR9":[function(require,module,exports) {
|
|
360
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.min=u;var e=require("./reduce"),r=require("../util/isFunction");function u(u){return(0,e.reduce)((0,r.isFunction)(u)?function(e,r){return u(e,r)<0?e:r}:function(e,r){return e<r?e:r})}
|
|
361
|
+
},{"./reduce":"gTgQ","../util/isFunction":"IMGL"}],"eORA":[function(require,module,exports) {
|
|
362
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.multicast=t;var e=require("../observable/ConnectableObservable"),n=require("../util/isFunction"),r=require("./connect");function t(t,c){var o=(0,n.isFunction)(t)?t:function(){return t};return(0,n.isFunction)(c)?(0,r.connect)(c,{connector:o}):function(n){return new e.ConnectableObservable(n,o)}}
|
|
363
|
+
},{"../observable/ConnectableObservable":"MckT","../util/isFunction":"IMGL","./connect":"aOS7"}],"VnbW":[function(require,module,exports) {
|
|
364
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pairwise=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(){return(0,e.operate)(function(e,t){var i,u=!1;e.subscribe((0,r.createOperatorSubscriber)(t,function(e){var r=i;i=e,u&&t.next([r,e]),u=!0}))})}
|
|
365
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"u2jJ":[function(require,module,exports) {
|
|
366
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pluck=e;var r=require("./map");function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=e.length;if(0===o)throw new Error("list of properties cannot be empty.");return(0,r.map)(function(r){for(var t=r,n=0;n<o;n++){var i=null==t?void 0:t[e[n]];if(void 0===i)return;t=i}return t})}
|
|
367
|
+
},{"./map":"N8Yl"}],"nPBI":[function(require,module,exports) {
|
|
368
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publish=u;var e=require("../Subject"),t=require("./multicast"),r=require("./connect");function u(u){return u?function(e){return(0,r.connect)(u)(e)}:function(r){return(0,t.multicast)(new e.Subject)(r)}}
|
|
369
|
+
},{"../Subject":"BDW7","./multicast":"eORA","./connect":"aOS7"}],"ndtv":[function(require,module,exports) {
|
|
370
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publishBehavior=n;var e=require("../BehaviorSubject"),r=require("../observable/ConnectableObservable");function n(n){return function(t){var u=new e.BehaviorSubject(n);return new r.ConnectableObservable(t,function(){return u})}}
|
|
371
|
+
},{"../BehaviorSubject":"dUFA","../observable/ConnectableObservable":"MckT"}],"gdMW":[function(require,module,exports) {
|
|
372
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publishLast=n;var e=require("../AsyncSubject"),r=require("../observable/ConnectableObservable");function n(){return function(n){var t=new e.AsyncSubject;return new r.ConnectableObservable(n,function(){return t})}}
|
|
373
|
+
},{"../AsyncSubject":"sDwD","../observable/ConnectableObservable":"MckT"}],"HR0g":[function(require,module,exports) {
|
|
374
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.publishReplay=i;var e=require("../ReplaySubject"),t=require("./multicast"),u=require("../util/isFunction");function i(i,r,n,c){n&&!(0,u.isFunction)(n)&&(c=n);var s=(0,u.isFunction)(n)?n:void 0;return function(u){return(0,t.multicast)(new e.ReplaySubject(i,r,c),s)(u)}}
|
|
375
|
+
},{"../ReplaySubject":"dbtS","./multicast":"eORA","../util/isFunction":"IMGL"}],"XeEu":[function(require,module,exports) {
|
|
376
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.raceWith=u;var e=require("tslib"),r=require("../observable/race"),t=require("../util/lift"),i=require("../util/identity");function u(){for(var u=[],a=0;a<arguments.length;a++)u[a]=arguments[a];return u.length?(0,t.operate)(function(t,i){(0,r.raceInit)((0,e.__spreadArray)([t],(0,e.__read)(u)))(i)}):i.identity}
|
|
377
|
+
},{"tslib":"B5W1","../observable/race":"IUwa","../util/lift":"gwDu","../util/identity":"FeLp"}],"UNCB":[function(require,module,exports) {
|
|
378
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.repeat=n;var e=require("../observable/empty"),r=require("../util/lift"),u=require("./OperatorSubscriber"),t=require("../observable/innerFrom"),i=require("../observable/timer");function n(n){var o,b,c=1/0;return null!=n&&("object"==typeof n?(o=n.count,c=void 0===o?1/0:o,b=n.delay):c=n),c<=0?function(){return e.EMPTY}:(0,r.operate)(function(e,r){var n,o=0,s=function(){if(null==n||n.unsubscribe(),n=null,null!=b){var e="number"==typeof b?(0,i.timer)(b):(0,t.innerFrom)(b(o)),c=(0,u.createOperatorSubscriber)(r,function(){c.unsubscribe(),l()});e.subscribe(c)}else l()},l=function(){var t=!1;n=e.subscribe((0,u.createOperatorSubscriber)(r,void 0,function(){++o<c?n?s():t=!0:r.complete()})),t&&s()};l()})}
|
|
379
|
+
},{"../observable/empty":"qOvc","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze","../observable/timer":"x2FQ"}],"aBtb":[function(require,module,exports) {
|
|
380
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.repeatWhen=u;var e=require("../Subject"),r=require("../util/lift"),t=require("./OperatorSubscriber");function u(u){return(0,r.operate)(function(r,n){var i,c,o=!1,b=!1,s=!1,a=function(){return s&&b&&(n.complete(),!0)},f=function(){s=!1,i=r.subscribe((0,t.createOperatorSubscriber)(n,void 0,function(){s=!0,!a()&&(c||(c=new e.Subject,u(c).subscribe((0,t.createOperatorSubscriber)(n,function(){i?f():o=!0},function(){b=!0,a()}))),c).next()})),o&&(i.unsubscribe(),i=null,o=!1,f())};f()})}
|
|
381
|
+
},{"../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"IqOO":[function(require,module,exports) {
|
|
382
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.retry=n;var e=require("../util/lift"),r=require("./OperatorSubscriber"),i=require("../util/identity"),t=require("../observable/timer"),u=require("../observable/innerFrom");function n(n){var o;void 0===n&&(n=1/0);var c=(o=n&&"object"==typeof n?n:{count:n}).count,s=void 0===c?1/0:c,b=o.delay,a=o.resetOnSuccess,l=void 0!==a&&a;return s<=0?i.identity:(0,e.operate)(function(e,i){var n,o=0,c=function(){var a=!1;n=e.subscribe((0,r.createOperatorSubscriber)(i,function(e){l&&(o=0),i.next(e)},void 0,function(e){if(o++<s){var l=function(){n?(n.unsubscribe(),n=null,c()):a=!0};if(null!=b){var f="number"==typeof b?(0,t.timer)(b):(0,u.innerFrom)(b(e,o)),v=(0,r.createOperatorSubscriber)(i,function(){v.unsubscribe(),l()},function(){i.complete()});f.subscribe(v)}else l()}else i.error(e)})),a&&(n.unsubscribe(),n=null,c())};c()})}
|
|
383
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/identity":"FeLp","../observable/timer":"x2FQ","../observable/innerFrom":"pOze"}],"fivK":[function(require,module,exports) {
|
|
384
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.retryWhen=u;var e=require("../Subject"),r=require("../util/lift"),t=require("./OperatorSubscriber");function u(u){return(0,r.operate)(function(r,i){var n,c,b=!1,o=function(){n=r.subscribe((0,t.createOperatorSubscriber)(i,void 0,void 0,function(r){c||(c=new e.Subject,u(c).subscribe((0,t.createOperatorSubscriber)(i,function(){return n?o():b=!0}))),c&&c.next(r)})),b&&(n.unsubscribe(),n=null,b=!1,o())};o()})}
|
|
385
|
+
},{"../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"ueQ5":[function(require,module,exports) {
|
|
386
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sample=u;var e=require("../util/lift"),r=require("../util/noop"),t=require("./OperatorSubscriber");function u(u){return(0,e.operate)(function(e,i){var o=!1,n=null;e.subscribe((0,t.createOperatorSubscriber)(i,function(e){o=!0,n=e})),u.subscribe((0,t.createOperatorSubscriber)(i,function(){if(o){o=!1;var e=n;n=null,i.next(e)}},r.noop))})}
|
|
387
|
+
},{"../util/lift":"gwDu","../util/noop":"hNvY","./OperatorSubscriber":"qno3"}],"VxDF":[function(require,module,exports) {
|
|
388
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sampleTime=a;var e=require("../scheduler/async"),r=require("./sample"),s=require("../observable/interval");function a(a,i){return void 0===i&&(i=e.asyncScheduler),(0,r.sample)((0,s.interval)(a,i))}
|
|
389
|
+
},{"../scheduler/async":"WQPT","./sample":"ueQ5","../observable/interval":"bNP6"}],"haGV":[function(require,module,exports) {
|
|
390
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scan=t;var e=require("../util/lift"),r=require("./scanInternals");function t(t,n){return(0,e.operate)((0,r.scanInternals)(t,n,arguments.length>=2,!0))}
|
|
391
|
+
},{"../util/lift":"gwDu","./scanInternals":"oeFh"}],"iZ1A":[function(require,module,exports) {
|
|
392
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sequenceEqual=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(t,n){return void 0===n&&(n=function(e,r){return e===r}),(0,e.operate)(function(e,c){var i=u(),o=u(),f=function(e){c.next(e),c.complete()},s=function(e,t){var u=(0,r.createOperatorSubscriber)(c,function(r){var u=t.buffer,c=t.complete;0===u.length?c?f(!1):e.buffer.push(r):!n(r,u.shift())&&f(!1)},function(){e.complete=!0;var r=t.complete,n=t.buffer;r&&f(0===n.length),null==u||u.unsubscribe()});return u};e.subscribe(s(i,o)),t.subscribe(s(o,i))})}function u(){return{buffer:[],complete:!1}}
|
|
393
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"wd7X":[function(require,module,exports) {
|
|
394
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.share=t;var e=require("tslib"),r=require("../observable/innerFrom"),n=require("../Subject"),u=require("../Subscriber"),i=require("../util/lift");function t(e){void 0===e&&(e={});var t=e.connector,c=void 0===t?function(){return new n.Subject}:t,s=e.resetOnError,b=void 0===s||s,f=e.resetOnComplete,a=void 0===f||f,l=e.resetOnRefCountZero,v=void 0===l||l;return function(e){var n,t,s,f=0,l=!1,d=!1,p=function(){null==t||t.unsubscribe(),t=void 0},S=function(){p(),n=s=void 0,l=d=!1},_=function(){var e=n;S(),null==e||e.unsubscribe()};return(0,i.operate)(function(e,i){f++,d||l||p();var m=s=null!=s?s:c();i.add(function(){0!==--f||d||l||(t=o(_,v))}),m.subscribe(i),!n&&f>0&&(n=new u.SafeSubscriber({next:function(e){return m.next(e)},error:function(e){d=!0,p(),t=o(S,b,e),m.error(e)},complete:function(){l=!0,p(),t=o(S,a),m.complete()}}),(0,r.innerFrom)(e).subscribe(n))})(e)}}function o(r,n){for(var i=[],t=2;t<arguments.length;t++)i[t-2]=arguments[t];if(!0!==n){if(!1!==n){var o=new u.SafeSubscriber({next:function(){o.unsubscribe(),r()}});return n.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(i))).subscribe(o)}}else r()}
|
|
395
|
+
},{"tslib":"B5W1","../observable/innerFrom":"pOze","../Subject":"BDW7","../Subscriber":"j5Gi","../util/lift":"gwDu"}],"RJoj":[function(require,module,exports) {
|
|
396
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shareReplay=t;var e=require("../ReplaySubject"),r=require("./share");function t(t,o,n){var u,i,s,c,a=!1;return t&&"object"==typeof t?(u=t.bufferSize,c=void 0===u?1/0:u,i=t.windowTime,o=void 0===i?1/0:i,a=void 0!==(s=t.refCount)&&s,n=t.scheduler):c=null!=t?t:1/0,(0,r.share)({connector:function(){return new e.ReplaySubject(c,o,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}
|
|
397
|
+
},{"../ReplaySubject":"dbtS","./share":"wd7X"}],"pOFx":[function(require,module,exports) {
|
|
398
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.single=i;var r=require("../util/EmptyError"),e=require("../util/SequenceError"),t=require("../util/NotFoundError"),o=require("../util/lift"),u=require("./OperatorSubscriber");function i(i){return(0,o.operate)(function(o,n){var c,a=!1,s=!1,l=0;o.subscribe((0,u.createOperatorSubscriber)(n,function(r){s=!0,i&&!i(r,l++,o)||(a&&n.error(new e.SequenceError("Too many matching values")),a=!0,c=r)},function(){a?(n.next(c),n.complete()):n.error(s?new t.NotFoundError("No matching values"):new r.EmptyError)}))})}
|
|
399
|
+
},{"../util/EmptyError":"wRNN","../util/SequenceError":"g1u8","../util/NotFoundError":"kj9h","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"dhrz":[function(require,module,exports) {
|
|
400
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skip=r;var e=require("./filter");function r(r){return(0,e.filter)(function(e,t){return r<=t})}
|
|
401
|
+
},{"./filter":"IFp1"}],"CBAe":[function(require,module,exports) {
|
|
402
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skipLast=i;var e=require("../util/identity"),r=require("../util/lift"),t=require("./OperatorSubscriber");function i(i){return i<=0?e.identity:(0,r.operate)(function(e,r){var u=new Array(i),n=0;return e.subscribe((0,t.createOperatorSubscriber)(r,function(e){var t=n++;if(t<i)u[t]=e;else{var s=t%i,a=u[s];u[s]=e,r.next(a)}})),function(){u=null}})}
|
|
403
|
+
},{"../util/identity":"FeLp","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"TT30":[function(require,module,exports) {
|
|
404
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skipUntil=u;var r=require("../util/lift"),e=require("./OperatorSubscriber"),i=require("../observable/innerFrom"),t=require("../util/noop");function u(u){return(0,r.operate)(function(r,n){var o=!1,s=(0,e.createOperatorSubscriber)(n,function(){null==s||s.unsubscribe(),o=!0},t.noop);(0,i.innerFrom)(u).subscribe(s),r.subscribe((0,e.createOperatorSubscriber)(n,function(r){return o&&n.next(r)}))})}
|
|
405
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze","../util/noop":"hNvY"}],"TIPQ":[function(require,module,exports) {
|
|
406
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.skipWhile=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(t){return(0,e.operate)(function(e,i){var u=!1,n=0;e.subscribe((0,r.createOperatorSubscriber)(i,function(e){return(u||(u=!t(e,n++)))&&i.next(e)}))})}
|
|
407
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"p6pO":[function(require,module,exports) {
|
|
408
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.startWith=o;var e=require("../observable/concat"),r=require("../util/args"),t=require("../util/lift");function o(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];var c=(0,r.popScheduler)(o);return(0,t.operate)(function(r,t){(c?(0,e.concat)(o,r,c):(0,e.concat)(o,r)).subscribe(t)})}
|
|
409
|
+
},{"../observable/concat":"nSjD","../util/args":"cFBb","../util/lift":"gwDu"}],"J2D0":[function(require,module,exports) {
|
|
410
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.switchMap=t;var r=require("../observable/innerFrom"),e=require("../util/lift"),n=require("./OperatorSubscriber");function t(t,u){return(0,e.operate)(function(e,i){var c=null,o=0,s=!1,b=function(){return s&&!c&&i.complete()};e.subscribe((0,n.createOperatorSubscriber)(i,function(e){null==c||c.unsubscribe();var s=0,a=o++;(0,r.innerFrom)(t(e,a)).subscribe(c=(0,n.createOperatorSubscriber)(i,function(r){return i.next(u?u(e,r,a,s++):r)},function(){c=null,b()}))},function(){s=!0,b()}))})}
|
|
411
|
+
},{"../observable/innerFrom":"pOze","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"De8H":[function(require,module,exports) {
|
|
412
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.switchAll=i;var e=require("./switchMap"),t=require("../util/identity");function i(){return(0,e.switchMap)(t.identity)}
|
|
413
|
+
},{"./switchMap":"J2D0","../util/identity":"FeLp"}],"W7ik":[function(require,module,exports) {
|
|
414
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.switchMapTo=i;var t=require("./switchMap"),e=require("../util/isFunction");function i(i,r){return(0,e.isFunction)(r)?(0,t.switchMap)(function(){return i},r):(0,t.switchMap)(function(){return i})}
|
|
415
|
+
},{"./switchMap":"J2D0","../util/isFunction":"IMGL"}],"sDl1":[function(require,module,exports) {
|
|
416
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.switchScan=t;var e=require("./switchMap"),r=require("../util/lift");function t(t,n){return(0,r.operate)(function(r,u){var i=n;return(0,e.switchMap)(function(e,r){return t(i,e,r)},function(e,r){return i=r,r})(r).subscribe(u),function(){i=null}})}
|
|
417
|
+
},{"./switchMap":"J2D0","../util/lift":"gwDu"}],"tosq":[function(require,module,exports) {
|
|
418
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.takeUntil=o;var e=require("../util/lift"),r=require("./OperatorSubscriber"),t=require("../observable/innerFrom"),i=require("../util/noop");function o(o){return(0,e.operate)(function(e,u){(0,t.innerFrom)(o).subscribe((0,r.createOperatorSubscriber)(u,function(){return u.complete()},i.noop)),!u.closed&&e.subscribe(u)})}
|
|
419
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze","../util/noop":"hNvY"}],"ic82":[function(require,module,exports) {
|
|
420
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.takeWhile=t;var e=require("../util/lift"),r=require("./OperatorSubscriber");function t(t,i){return void 0===i&&(i=!1),(0,e.operate)(function(e,u){var o=0;e.subscribe((0,r.createOperatorSubscriber)(u,function(e){var r=t(e,o++);(r||i)&&u.next(e),!r&&u.complete()}))})}
|
|
421
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"uDXP":[function(require,module,exports) {
|
|
422
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.tap=t;var e=require("../util/isFunction"),r=require("../util/lift"),i=require("./OperatorSubscriber"),l=require("../util/identity");function t(t,n,u){var o=(0,e.isFunction)(t)||n||u?{next:t,error:n,complete:u}:t;return o?(0,r.operate)(function(e,r){var l;null===(l=o.subscribe)||void 0===l||l.call(o);var t=!0;e.subscribe((0,i.createOperatorSubscriber)(r,function(e){var i;null===(i=o.next)||void 0===i||i.call(o,e),r.next(e)},function(){var e;t=!1,null===(e=o.complete)||void 0===e||e.call(o),r.complete()},function(e){var i;t=!1,null===(i=o.error)||void 0===i||i.call(o,e),r.error(e)},function(){var e,r;t&&(null===(e=o.unsubscribe)||void 0===e||e.call(o)),null===(r=o.finalize)||void 0===r||r.call(o)}))}):l.identity}
|
|
423
|
+
},{"../util/isFunction":"IMGL","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/identity":"FeLp"}],"KrMa":[function(require,module,exports) {
|
|
424
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throttle=i,exports.defaultThrottleConfig=void 0;var e=require("../util/lift"),r=require("./OperatorSubscriber"),t=require("../observable/innerFrom"),n={leading:!0,trailing:!1};function i(i,o){return void 0===o&&(o=n),(0,e.operate)(function(e,n){var u=o.leading,l=o.trailing,c=!1,s=null,a=null,b=!1,f=function(){null==a||a.unsubscribe(),a=null,l&&(v(),b&&n.complete())},p=function(){a=null,b&&n.complete()},d=function(e){return a=(0,t.innerFrom)(i(e)).subscribe((0,r.createOperatorSubscriber)(n,f,p))},v=function(){if(c){c=!1;var e=s;s=null,n.next(e),!b&&d(e)}};e.subscribe((0,r.createOperatorSubscriber)(n,function(e){c=!0,s=e,(!a||a.closed)&&(u?v():d(e))},function(){b=!0,(!(l&&c&&a)||a.closed)&&n.complete()}))})}exports.defaultThrottleConfig=n;
|
|
425
|
+
},{"../util/lift":"gwDu","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze"}],"i2pQ":[function(require,module,exports) {
|
|
426
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.throttleTime=o;var e=require("../scheduler/async"),r=require("./throttle"),t=require("../observable/timer");function o(o,i,u){void 0===i&&(i=e.asyncScheduler),void 0===u&&(u=r.defaultThrottleConfig);var l=(0,t.timer)(o,i);return(0,r.throttle)(function(){return l},u)}
|
|
427
|
+
},{"../scheduler/async":"WQPT","./throttle":"KrMa","../observable/timer":"x2FQ"}],"OBGt":[function(require,module,exports) {
|
|
428
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeInterval=i,exports.TimeInterval=void 0;var e=require("../scheduler/async"),r=require("../util/lift"),t=require("./OperatorSubscriber");function i(i){return void 0===i&&(i=e.asyncScheduler),(0,r.operate)(function(e,r){var u=i.now();e.subscribe((0,t.createOperatorSubscriber)(r,function(e){var t=i.now(),o=t-u;u=t,r.next(new n(e,o))}))})}var n=function(){return function(e,r){this.value=e,this.interval=r}}();exports.TimeInterval=n;
|
|
429
|
+
},{"../scheduler/async":"WQPT","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"Vs6L":[function(require,module,exports) {
|
|
430
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timeoutWith=i;var e=require("../scheduler/async"),r=require("../util/isDate"),t=require("./timeout");function i(i,o,u){var n,s,l;if(u=null!=u?u:e.async,(0,r.isValidDate)(i)?n=i:"number"==typeof i&&(s=i),!o)throw new TypeError("No observable provided to switch to");if(l=function(){return o},null==n&&null==s)throw new TypeError("No timeout provided.");return(0,t.timeout)({first:n,each:s,scheduler:u,with:l})}
|
|
431
|
+
},{"../scheduler/async":"WQPT","../util/isDate":"NBBr","./timeout":"jt1g"}],"XUFT":[function(require,module,exports) {
|
|
432
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.timestamp=t;var e=require("../scheduler/dateTimestampProvider"),r=require("./map");function t(t){return void 0===t&&(t=e.dateTimestampProvider),(0,r.map)(function(e){return{value:e,timestamp:t.now()}})}
|
|
433
|
+
},{"../scheduler/dateTimestampProvider":"x2eE","./map":"N8Yl"}],"MnAl":[function(require,module,exports) {
|
|
434
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.window=n;var e=require("../Subject"),r=require("../util/lift"),t=require("./OperatorSubscriber"),u=require("../util/noop");function n(n){return(0,r.operate)(function(r,o){var i=new e.Subject;o.next(i.asObservable());var c=function(e){i.error(e),o.error(e)};return r.subscribe((0,t.createOperatorSubscriber)(o,function(e){return null==i?void 0:i.next(e)},function(){i.complete(),o.complete()},c)),n.subscribe((0,t.createOperatorSubscriber)(o,function(){i.complete(),o.next(i=new e.Subject)},u.noop,c)),function(){null==i||i.unsubscribe(),i=null}})}
|
|
435
|
+
},{"../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/noop":"hNvY"}],"ycrj":[function(require,module,exports) {
|
|
436
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowCount=o;var e=require("tslib"),r=require("../Subject"),t=require("../util/lift"),n=require("./OperatorSubscriber");function o(o,u){void 0===u&&(u=0);var i=u>0?u:o;return(0,t.operate)(function(t,u){var l=[new r.Subject],a=0;u.next(l[0].asObservable()),t.subscribe((0,n.createOperatorSubscriber)(u,function(t){var n,c;try{for(var s=(0,e.__values)(l),f=s.next();!f.done;f=s.next()){f.value.next(t)}}catch(p){n={error:p}}finally{try{f&&!f.done&&(c=s.return)&&c.call(s)}finally{if(n)throw n.error}}var b=a-o+1;if(b>=0&&b%i==0&&l.shift().complete(),++a%i==0){var v=new r.Subject;l.push(v),u.next(v.asObservable())}},function(){for(;l.length>0;)l.shift().complete();u.complete()},function(e){for(;l.length>0;)l.shift().error(e);u.error(e)},function(){null,l=null}))})}
|
|
437
|
+
},{"tslib":"B5W1","../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3"}],"fQsK":[function(require,module,exports) {
|
|
438
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowTime=s;var e=require("../Subject"),r=require("../scheduler/async"),u=require("../Subscription"),n=require("../util/lift"),t=require("./OperatorSubscriber"),i=require("../util/arrRemove"),c=require("../util/args"),o=require("../util/executeSchedule");function s(s){for(var l,a,f=[],b=1;b<arguments.length;b++)f[b-1]=arguments[b];var d=null!==(l=(0,c.popScheduler)(f))&&void 0!==l?l:r.asyncScheduler,v=null!==(a=f[0])&&void 0!==a?a:null,p=f[1]||1/0;return(0,n.operate)(function(r,n){var c=[],l=!1,a=function(e){var r=e.window,u=e.subs;r.complete(),u.unsubscribe(),(0,i.arrRemove)(c,e),l&&f()},f=function(){if(c){var r=new u.Subscription;n.add(r);var t=new e.Subject,i={window:t,subs:r,seen:0};c.push(i),n.next(t.asObservable()),(0,o.executeSchedule)(r,d,function(){return a(i)},s)}};null!==v&&v>=0?(0,o.executeSchedule)(n,d,f,v,!0):l=!0,f();var b=function(e){return c.slice().forEach(e)},w=function(e){b(function(r){var u=r.window;return e(u)}),e(n),n.unsubscribe()};return r.subscribe((0,t.createOperatorSubscriber)(n,function(e){b(function(r){r.window.next(e),p<=++r.seen&&a(r)})},function(){return w(function(e){return e.complete()})},function(e){return w(function(r){return r.error(e)})})),function(){c=null}})}
|
|
439
|
+
},{"../Subject":"BDW7","../scheduler/async":"WQPT","../Subscription":"Atlq","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../util/arrRemove":"h9cX","../util/args":"cFBb","../util/executeSchedule":"WVgR"}],"vmsA":[function(require,module,exports) {
|
|
440
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowToggle=s;var r=require("tslib"),e=require("../Subject"),t=require("../Subscription"),i=require("../util/lift"),o=require("../observable/innerFrom"),n=require("./OperatorSubscriber"),u=require("../util/noop"),c=require("../util/arrRemove");function s(s,a){return(0,i.operate)(function(i,b){var l=[],f=function(r){for(;0<l.length;)l.shift().error(r);b.error(r)};(0,o.innerFrom)(s).subscribe((0,n.createOperatorSubscriber)(b,function(r){var i=new e.Subject;l.push(i);var s,p=new t.Subscription;try{s=(0,o.innerFrom)(a(r))}catch(v){return void f(v)}b.next(i.asObservable()),p.add(s.subscribe((0,n.createOperatorSubscriber)(b,function(){(0,c.arrRemove)(l,i),i.complete(),p.unsubscribe()},u.noop,f)))},u.noop)),i.subscribe((0,n.createOperatorSubscriber)(b,function(e){var t,i,o=l.slice();try{for(var n=(0,r.__values)(o),u=n.next();!u.done;u=n.next()){u.value.next(e)}}catch(c){t={error:c}}finally{try{u&&!u.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}},function(){for(;0<l.length;)l.shift().complete();b.complete()},f,function(){for(;0<l.length;)l.shift().unsubscribe()}))})}
|
|
441
|
+
},{"tslib":"B5W1","../Subject":"BDW7","../Subscription":"Atlq","../util/lift":"gwDu","../observable/innerFrom":"pOze","./OperatorSubscriber":"qno3","../util/noop":"hNvY","../util/arrRemove":"h9cX"}],"SO6T":[function(require,module,exports) {
|
|
442
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.windowWhen=u;var e=require("../Subject"),r=require("../util/lift"),n=require("./OperatorSubscriber"),t=require("../observable/innerFrom");function u(u){return(0,r.operate)(function(r,i){var c,o,b=function(e){c.error(e),i.error(e)},s=function(){var r;null==o||o.unsubscribe(),null==c||c.complete(),c=new e.Subject,i.next(c.asObservable());try{r=(0,t.innerFrom)(u())}catch(l){return void b(l)}r.subscribe(o=(0,n.createOperatorSubscriber)(i,s,s,b))};s(),r.subscribe((0,n.createOperatorSubscriber)(i,function(e){return c.next(e)},function(){c.complete(),i.complete()},b,function(){null==o||o.unsubscribe(),c=null}))})}
|
|
443
|
+
},{"../Subject":"BDW7","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze"}],"KD22":[function(require,module,exports) {
|
|
444
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withLatestFrom=a;var r=require("tslib"),e=require("../util/lift"),t=require("./OperatorSubscriber"),i=require("../observable/innerFrom"),u=require("../util/identity"),n=require("../util/noop"),o=require("../util/args");function a(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var c=(0,o.popResultSelector)(a);return(0,e.operate)(function(e,o){for(var s=a.length,l=new Array(s),p=a.map(function(){return!1}),b=!1,f=function(r){(0,i.innerFrom)(a[r]).subscribe((0,t.createOperatorSubscriber)(o,function(e){l[r]=e,b||p[r]||(p[r]=!0,(b=p.every(u.identity))&&(p=null))},n.noop))},_=0;_<s;_++)f(_);e.subscribe((0,t.createOperatorSubscriber)(o,function(e){if(b){var t=(0,r.__spreadArray)([e],(0,r.__read)(l));o.next(c?c.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)(t))):t)}}))})}
|
|
445
|
+
},{"tslib":"B5W1","../util/lift":"gwDu","./OperatorSubscriber":"qno3","../observable/innerFrom":"pOze","../util/identity":"FeLp","../util/noop":"hNvY","../util/args":"cFBb"}],"GYYb":[function(require,module,exports) {
|
|
446
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.zipAll=l;var e=require("../observable/zip"),r=require("./joinAllInternals");function l(l){return(0,r.joinAllInternals)(e.zip,l)}
|
|
447
|
+
},{"../observable/zip":"T2xt","./joinAllInternals":"oubL"}],"qevp":[function(require,module,exports) {
|
|
448
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.zip=t;var e=require("tslib"),r=require("../observable/zip"),i=require("../util/lift");function t(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return(0,i.operate)(function(i,u){r.zip.apply(void 0,(0,e.__spreadArray)([i],(0,e.__read)(t))).subscribe(u)})}
|
|
449
|
+
},{"tslib":"B5W1","../observable/zip":"T2xt","../util/lift":"gwDu"}],"O3Ok":[function(require,module,exports) {
|
|
450
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.zipWith=i;var e=require("tslib"),r=require("./zip");function i(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return r.zip.apply(void 0,(0,e.__spreadArray)([],(0,e.__read)(i)))}
|
|
451
|
+
},{"tslib":"B5W1","./zip":"qevp"}],"Zr8e":[function(require,module,exports) {
|
|
452
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={Observable:!0,ConnectableObservable:!0,observable:!0,animationFrames:!0,Subject:!0,BehaviorSubject:!0,ReplaySubject:!0,AsyncSubject:!0,asap:!0,asapScheduler:!0,async:!0,asyncScheduler:!0,queue:!0,queueScheduler:!0,animationFrame:!0,animationFrameScheduler:!0,VirtualTimeScheduler:!0,VirtualAction:!0,Scheduler:!0,Subscription:!0,Subscriber:!0,Notification:!0,NotificationKind:!0,pipe:!0,noop:!0,identity:!0,isObservable:!0,lastValueFrom:!0,firstValueFrom:!0,ArgumentOutOfRangeError:!0,EmptyError:!0,NotFoundError:!0,ObjectUnsubscribedError:!0,SequenceError:!0,TimeoutError:!0,timeout:!0,UnsubscriptionError:!0,bindCallback:!0,bindNodeCallback:!0,combineLatest:!0,concat:!0,connectable:!0,defer:!0,empty:!0,EMPTY:!0,forkJoin:!0,from:!0,fromEvent:!0,fromEventPattern:!0,generate:!0,iif:!0,interval:!0,merge:!0,never:!0,NEVER:!0,of:!0,onErrorResumeNext:!0,pairs:!0,partition:!0,race:!0,range:!0,throwError:!0,timer:!0,using:!0,zip:!0,scheduled:!0,config:!0,audit:!0,auditTime:!0,buffer:!0,bufferCount:!0,bufferTime:!0,bufferToggle:!0,bufferWhen:!0,catchError:!0,combineAll:!0,combineLatestAll:!0,combineLatestWith:!0,concatAll:!0,concatMap:!0,concatMapTo:!0,concatWith:!0,connect:!0,count:!0,debounce:!0,debounceTime:!0,defaultIfEmpty:!0,delay:!0,delayWhen:!0,dematerialize:!0,distinct:!0,distinctUntilChanged:!0,distinctUntilKeyChanged:!0,elementAt:!0,endWith:!0,every:!0,exhaust:!0,exhaustAll:!0,exhaustMap:!0,expand:!0,filter:!0,finalize:!0,find:!0,findIndex:!0,first:!0,groupBy:!0,ignoreElements:!0,isEmpty:!0,last:!0,map:!0,mapTo:!0,materialize:!0,max:!0,mergeAll:!0,flatMap:!0,mergeMap:!0,mergeMapTo:!0,mergeScan:!0,mergeWith:!0,min:!0,multicast:!0,observeOn:!0,pairwise:!0,pluck:!0,publish:!0,publishBehavior:!0,publishLast:!0,publishReplay:!0,raceWith:!0,reduce:!0,repeat:!0,repeatWhen:!0,retry:!0,retryWhen:!0,refCount:!0,sample:!0,sampleTime:!0,scan:!0,sequenceEqual:!0,share:!0,shareReplay:!0,single:!0,skip:!0,skipLast:!0,skipUntil:!0,skipWhile:!0,startWith:!0,subscribeOn:!0,switchAll:!0,switchMap:!0,switchMapTo:!0,switchScan:!0,take:!0,takeLast:!0,takeUntil:!0,takeWhile:!0,tap:!0,throttle:!0,throttleTime:!0,throwIfEmpty:!0,timeInterval:!0,timeoutWith:!0,timestamp:!0,toArray:!0,window:!0,windowCount:!0,windowTime:!0,windowToggle:!0,windowWhen:!0,withLatestFrom:!0,zipAll:!0,zipWith:!0};Object.defineProperty(exports,"Observable",{enumerable:!0,get:function(){return r.Observable}}),Object.defineProperty(exports,"ConnectableObservable",{enumerable:!0,get:function(){return t.ConnectableObservable}}),Object.defineProperty(exports,"observable",{enumerable:!0,get:function(){return n.observable}}),Object.defineProperty(exports,"animationFrames",{enumerable:!0,get:function(){return i.animationFrames}}),Object.defineProperty(exports,"Subject",{enumerable:!0,get:function(){return o.Subject}}),Object.defineProperty(exports,"BehaviorSubject",{enumerable:!0,get:function(){return u.BehaviorSubject}}),Object.defineProperty(exports,"ReplaySubject",{enumerable:!0,get:function(){return a.ReplaySubject}}),Object.defineProperty(exports,"AsyncSubject",{enumerable:!0,get:function(){return l.AsyncSubject}}),Object.defineProperty(exports,"asap",{enumerable:!0,get:function(){return p.asap}}),Object.defineProperty(exports,"asapScheduler",{enumerable:!0,get:function(){return p.asapScheduler}}),Object.defineProperty(exports,"async",{enumerable:!0,get:function(){return c.async}}),Object.defineProperty(exports,"asyncScheduler",{enumerable:!0,get:function(){return c.asyncScheduler}}),Object.defineProperty(exports,"queue",{enumerable:!0,get:function(){return s.queue}}),Object.defineProperty(exports,"queueScheduler",{enumerable:!0,get:function(){return s.queueScheduler}}),Object.defineProperty(exports,"animationFrame",{enumerable:!0,get:function(){return b.animationFrame}}),Object.defineProperty(exports,"animationFrameScheduler",{enumerable:!0,get:function(){return b.animationFrameScheduler}}),Object.defineProperty(exports,"VirtualTimeScheduler",{enumerable:!0,get:function(){return f.VirtualTimeScheduler}}),Object.defineProperty(exports,"VirtualAction",{enumerable:!0,get:function(){return f.VirtualAction}}),Object.defineProperty(exports,"Scheduler",{enumerable:!0,get:function(){return m.Scheduler}}),Object.defineProperty(exports,"Subscription",{enumerable:!0,get:function(){return d.Subscription}}),Object.defineProperty(exports,"Subscriber",{enumerable:!0,get:function(){return y.Subscriber}}),Object.defineProperty(exports,"Notification",{enumerable:!0,get:function(){return g.Notification}}),Object.defineProperty(exports,"NotificationKind",{enumerable:!0,get:function(){return g.NotificationKind}}),Object.defineProperty(exports,"pipe",{enumerable:!0,get:function(){return O.pipe}}),Object.defineProperty(exports,"noop",{enumerable:!0,get:function(){return x.noop}}),Object.defineProperty(exports,"identity",{enumerable:!0,get:function(){return j.identity}}),Object.defineProperty(exports,"isObservable",{enumerable:!0,get:function(){return h.isObservable}}),Object.defineProperty(exports,"lastValueFrom",{enumerable:!0,get:function(){return q.lastValueFrom}}),Object.defineProperty(exports,"firstValueFrom",{enumerable:!0,get:function(){return P.firstValueFrom}}),Object.defineProperty(exports,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return v.ArgumentOutOfRangeError}}),Object.defineProperty(exports,"EmptyError",{enumerable:!0,get:function(){return E.EmptyError}}),Object.defineProperty(exports,"NotFoundError",{enumerable:!0,get:function(){return w.NotFoundError}}),Object.defineProperty(exports,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return W.ObjectUnsubscribedError}}),Object.defineProperty(exports,"SequenceError",{enumerable:!0,get:function(){return T.SequenceError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return S.TimeoutError}}),Object.defineProperty(exports,"timeout",{enumerable:!0,get:function(){return S.timeout}}),Object.defineProperty(exports,"UnsubscriptionError",{enumerable:!0,get:function(){return k.UnsubscriptionError}}),Object.defineProperty(exports,"bindCallback",{enumerable:!0,get:function(){return A.bindCallback}}),Object.defineProperty(exports,"bindNodeCallback",{enumerable:!0,get:function(){return M.bindNodeCallback}}),Object.defineProperty(exports,"combineLatest",{enumerable:!0,get:function(){return C.combineLatest}}),Object.defineProperty(exports,"concat",{enumerable:!0,get:function(){return L.concat}}),Object.defineProperty(exports,"connectable",{enumerable:!0,get:function(){return F.connectable}}),Object.defineProperty(exports,"defer",{enumerable:!0,get:function(){return z.defer}}),Object.defineProperty(exports,"empty",{enumerable:!0,get:function(){return U.empty}}),Object.defineProperty(exports,"EMPTY",{enumerable:!0,get:function(){return U.EMPTY}}),Object.defineProperty(exports,"forkJoin",{enumerable:!0,get:function(){return R.forkJoin}}),Object.defineProperty(exports,"from",{enumerable:!0,get:function(){return N.from}}),Object.defineProperty(exports,"fromEvent",{enumerable:!0,get:function(){return V.fromEvent}}),Object.defineProperty(exports,"fromEventPattern",{enumerable:!0,get:function(){return I.fromEventPattern}}),Object.defineProperty(exports,"generate",{enumerable:!0,get:function(){return B.generate}}),Object.defineProperty(exports,"iif",{enumerable:!0,get:function(){return K.iif}}),Object.defineProperty(exports,"interval",{enumerable:!0,get:function(){return J.interval}}),Object.defineProperty(exports,"merge",{enumerable:!0,get:function(){return _.merge}}),Object.defineProperty(exports,"never",{enumerable:!0,get:function(){return Y.never}}),Object.defineProperty(exports,"NEVER",{enumerable:!0,get:function(){return Y.NEVER}}),Object.defineProperty(exports,"of",{enumerable:!0,get:function(){return D.of}}),Object.defineProperty(exports,"onErrorResumeNext",{enumerable:!0,get:function(){return G.onErrorResumeNext}}),Object.defineProperty(exports,"pairs",{enumerable:!0,get:function(){return H.pairs}}),Object.defineProperty(exports,"partition",{enumerable:!0,get:function(){return Q.partition}}),Object.defineProperty(exports,"race",{enumerable:!0,get:function(){return X.race}}),Object.defineProperty(exports,"range",{enumerable:!0,get:function(){return Z.range}}),Object.defineProperty(exports,"throwError",{enumerable:!0,get:function(){return $.throwError}}),Object.defineProperty(exports,"timer",{enumerable:!0,get:function(){return ee.timer}}),Object.defineProperty(exports,"using",{enumerable:!0,get:function(){return re.using}}),Object.defineProperty(exports,"zip",{enumerable:!0,get:function(){return te.zip}}),Object.defineProperty(exports,"scheduled",{enumerable:!0,get:function(){return ne.scheduled}}),Object.defineProperty(exports,"config",{enumerable:!0,get:function(){return oe.config}}),Object.defineProperty(exports,"audit",{enumerable:!0,get:function(){return ue.audit}}),Object.defineProperty(exports,"auditTime",{enumerable:!0,get:function(){return ae.auditTime}}),Object.defineProperty(exports,"buffer",{enumerable:!0,get:function(){return le.buffer}}),Object.defineProperty(exports,"bufferCount",{enumerable:!0,get:function(){return pe.bufferCount}}),Object.defineProperty(exports,"bufferTime",{enumerable:!0,get:function(){return ce.bufferTime}}),Object.defineProperty(exports,"bufferToggle",{enumerable:!0,get:function(){return se.bufferToggle}}),Object.defineProperty(exports,"bufferWhen",{enumerable:!0,get:function(){return be.bufferWhen}}),Object.defineProperty(exports,"catchError",{enumerable:!0,get:function(){return fe.catchError}}),Object.defineProperty(exports,"combineAll",{enumerable:!0,get:function(){return me.combineAll}}),Object.defineProperty(exports,"combineLatestAll",{enumerable:!0,get:function(){return de.combineLatestAll}}),Object.defineProperty(exports,"combineLatestWith",{enumerable:!0,get:function(){return ye.combineLatestWith}}),Object.defineProperty(exports,"concatAll",{enumerable:!0,get:function(){return ge.concatAll}}),Object.defineProperty(exports,"concatMap",{enumerable:!0,get:function(){return Oe.concatMap}}),Object.defineProperty(exports,"concatMapTo",{enumerable:!0,get:function(){return xe.concatMapTo}}),Object.defineProperty(exports,"concatWith",{enumerable:!0,get:function(){return je.concatWith}}),Object.defineProperty(exports,"connect",{enumerable:!0,get:function(){return he.connect}}),Object.defineProperty(exports,"count",{enumerable:!0,get:function(){return qe.count}}),Object.defineProperty(exports,"debounce",{enumerable:!0,get:function(){return Pe.debounce}}),Object.defineProperty(exports,"debounceTime",{enumerable:!0,get:function(){return ve.debounceTime}}),Object.defineProperty(exports,"defaultIfEmpty",{enumerable:!0,get:function(){return Ee.defaultIfEmpty}}),Object.defineProperty(exports,"delay",{enumerable:!0,get:function(){return we.delay}}),Object.defineProperty(exports,"delayWhen",{enumerable:!0,get:function(){return We.delayWhen}}),Object.defineProperty(exports,"dematerialize",{enumerable:!0,get:function(){return Te.dematerialize}}),Object.defineProperty(exports,"distinct",{enumerable:!0,get:function(){return Se.distinct}}),Object.defineProperty(exports,"distinctUntilChanged",{enumerable:!0,get:function(){return ke.distinctUntilChanged}}),Object.defineProperty(exports,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Ae.distinctUntilKeyChanged}}),Object.defineProperty(exports,"elementAt",{enumerable:!0,get:function(){return Me.elementAt}}),Object.defineProperty(exports,"endWith",{enumerable:!0,get:function(){return Ce.endWith}}),Object.defineProperty(exports,"every",{enumerable:!0,get:function(){return Le.every}}),Object.defineProperty(exports,"exhaust",{enumerable:!0,get:function(){return Fe.exhaust}}),Object.defineProperty(exports,"exhaustAll",{enumerable:!0,get:function(){return ze.exhaustAll}}),Object.defineProperty(exports,"exhaustMap",{enumerable:!0,get:function(){return Ue.exhaustMap}}),Object.defineProperty(exports,"expand",{enumerable:!0,get:function(){return Re.expand}}),Object.defineProperty(exports,"filter",{enumerable:!0,get:function(){return Ne.filter}}),Object.defineProperty(exports,"finalize",{enumerable:!0,get:function(){return Ve.finalize}}),Object.defineProperty(exports,"find",{enumerable:!0,get:function(){return Ie.find}}),Object.defineProperty(exports,"findIndex",{enumerable:!0,get:function(){return Be.findIndex}}),Object.defineProperty(exports,"first",{enumerable:!0,get:function(){return Ke.first}}),Object.defineProperty(exports,"groupBy",{enumerable:!0,get:function(){return Je.groupBy}}),Object.defineProperty(exports,"ignoreElements",{enumerable:!0,get:function(){return _e.ignoreElements}}),Object.defineProperty(exports,"isEmpty",{enumerable:!0,get:function(){return Ye.isEmpty}}),Object.defineProperty(exports,"last",{enumerable:!0,get:function(){return De.last}}),Object.defineProperty(exports,"map",{enumerable:!0,get:function(){return Ge.map}}),Object.defineProperty(exports,"mapTo",{enumerable:!0,get:function(){return He.mapTo}}),Object.defineProperty(exports,"materialize",{enumerable:!0,get:function(){return Qe.materialize}}),Object.defineProperty(exports,"max",{enumerable:!0,get:function(){return Xe.max}}),Object.defineProperty(exports,"mergeAll",{enumerable:!0,get:function(){return Ze.mergeAll}}),Object.defineProperty(exports,"flatMap",{enumerable:!0,get:function(){return $e.flatMap}}),Object.defineProperty(exports,"mergeMap",{enumerable:!0,get:function(){return er.mergeMap}}),Object.defineProperty(exports,"mergeMapTo",{enumerable:!0,get:function(){return rr.mergeMapTo}}),Object.defineProperty(exports,"mergeScan",{enumerable:!0,get:function(){return tr.mergeScan}}),Object.defineProperty(exports,"mergeWith",{enumerable:!0,get:function(){return nr.mergeWith}}),Object.defineProperty(exports,"min",{enumerable:!0,get:function(){return ir.min}}),Object.defineProperty(exports,"multicast",{enumerable:!0,get:function(){return or.multicast}}),Object.defineProperty(exports,"observeOn",{enumerable:!0,get:function(){return ur.observeOn}}),Object.defineProperty(exports,"pairwise",{enumerable:!0,get:function(){return ar.pairwise}}),Object.defineProperty(exports,"pluck",{enumerable:!0,get:function(){return lr.pluck}}),Object.defineProperty(exports,"publish",{enumerable:!0,get:function(){return pr.publish}}),Object.defineProperty(exports,"publishBehavior",{enumerable:!0,get:function(){return cr.publishBehavior}}),Object.defineProperty(exports,"publishLast",{enumerable:!0,get:function(){return sr.publishLast}}),Object.defineProperty(exports,"publishReplay",{enumerable:!0,get:function(){return br.publishReplay}}),Object.defineProperty(exports,"raceWith",{enumerable:!0,get:function(){return fr.raceWith}}),Object.defineProperty(exports,"reduce",{enumerable:!0,get:function(){return mr.reduce}}),Object.defineProperty(exports,"repeat",{enumerable:!0,get:function(){return dr.repeat}}),Object.defineProperty(exports,"repeatWhen",{enumerable:!0,get:function(){return yr.repeatWhen}}),Object.defineProperty(exports,"retry",{enumerable:!0,get:function(){return gr.retry}}),Object.defineProperty(exports,"retryWhen",{enumerable:!0,get:function(){return Or.retryWhen}}),Object.defineProperty(exports,"refCount",{enumerable:!0,get:function(){return xr.refCount}}),Object.defineProperty(exports,"sample",{enumerable:!0,get:function(){return jr.sample}}),Object.defineProperty(exports,"sampleTime",{enumerable:!0,get:function(){return hr.sampleTime}}),Object.defineProperty(exports,"scan",{enumerable:!0,get:function(){return qr.scan}}),Object.defineProperty(exports,"sequenceEqual",{enumerable:!0,get:function(){return Pr.sequenceEqual}}),Object.defineProperty(exports,"share",{enumerable:!0,get:function(){return vr.share}}),Object.defineProperty(exports,"shareReplay",{enumerable:!0,get:function(){return Er.shareReplay}}),Object.defineProperty(exports,"single",{enumerable:!0,get:function(){return wr.single}}),Object.defineProperty(exports,"skip",{enumerable:!0,get:function(){return Wr.skip}}),Object.defineProperty(exports,"skipLast",{enumerable:!0,get:function(){return Tr.skipLast}}),Object.defineProperty(exports,"skipUntil",{enumerable:!0,get:function(){return Sr.skipUntil}}),Object.defineProperty(exports,"skipWhile",{enumerable:!0,get:function(){return kr.skipWhile}}),Object.defineProperty(exports,"startWith",{enumerable:!0,get:function(){return Ar.startWith}}),Object.defineProperty(exports,"subscribeOn",{enumerable:!0,get:function(){return Mr.subscribeOn}}),Object.defineProperty(exports,"switchAll",{enumerable:!0,get:function(){return Cr.switchAll}}),Object.defineProperty(exports,"switchMap",{enumerable:!0,get:function(){return Lr.switchMap}}),Object.defineProperty(exports,"switchMapTo",{enumerable:!0,get:function(){return Fr.switchMapTo}}),Object.defineProperty(exports,"switchScan",{enumerable:!0,get:function(){return zr.switchScan}}),Object.defineProperty(exports,"take",{enumerable:!0,get:function(){return Ur.take}}),Object.defineProperty(exports,"takeLast",{enumerable:!0,get:function(){return Rr.takeLast}}),Object.defineProperty(exports,"takeUntil",{enumerable:!0,get:function(){return Nr.takeUntil}}),Object.defineProperty(exports,"takeWhile",{enumerable:!0,get:function(){return Vr.takeWhile}}),Object.defineProperty(exports,"tap",{enumerable:!0,get:function(){return Ir.tap}}),Object.defineProperty(exports,"throttle",{enumerable:!0,get:function(){return Br.throttle}}),Object.defineProperty(exports,"throttleTime",{enumerable:!0,get:function(){return Kr.throttleTime}}),Object.defineProperty(exports,"throwIfEmpty",{enumerable:!0,get:function(){return Jr.throwIfEmpty}}),Object.defineProperty(exports,"timeInterval",{enumerable:!0,get:function(){return _r.timeInterval}}),Object.defineProperty(exports,"timeoutWith",{enumerable:!0,get:function(){return Yr.timeoutWith}}),Object.defineProperty(exports,"timestamp",{enumerable:!0,get:function(){return Dr.timestamp}}),Object.defineProperty(exports,"toArray",{enumerable:!0,get:function(){return Gr.toArray}}),Object.defineProperty(exports,"window",{enumerable:!0,get:function(){return Hr.window}}),Object.defineProperty(exports,"windowCount",{enumerable:!0,get:function(){return Qr.windowCount}}),Object.defineProperty(exports,"windowTime",{enumerable:!0,get:function(){return Xr.windowTime}}),Object.defineProperty(exports,"windowToggle",{enumerable:!0,get:function(){return Zr.windowToggle}}),Object.defineProperty(exports,"windowWhen",{enumerable:!0,get:function(){return $r.windowWhen}}),Object.defineProperty(exports,"withLatestFrom",{enumerable:!0,get:function(){return et.withLatestFrom}}),Object.defineProperty(exports,"zipAll",{enumerable:!0,get:function(){return rt.zipAll}}),Object.defineProperty(exports,"zipWith",{enumerable:!0,get:function(){return tt.zipWith}});var r=require("./internal/Observable"),t=require("./internal/observable/ConnectableObservable"),n=require("./internal/symbol/observable"),i=require("./internal/observable/dom/animationFrames"),o=require("./internal/Subject"),u=require("./internal/BehaviorSubject"),a=require("./internal/ReplaySubject"),l=require("./internal/AsyncSubject"),p=require("./internal/scheduler/asap"),c=require("./internal/scheduler/async"),s=require("./internal/scheduler/queue"),b=require("./internal/scheduler/animationFrame"),f=require("./internal/scheduler/VirtualTimeScheduler"),m=require("./internal/Scheduler"),d=require("./internal/Subscription"),y=require("./internal/Subscriber"),g=require("./internal/Notification"),O=require("./internal/util/pipe"),x=require("./internal/util/noop"),j=require("./internal/util/identity"),h=require("./internal/util/isObservable"),q=require("./internal/lastValueFrom"),P=require("./internal/firstValueFrom"),v=require("./internal/util/ArgumentOutOfRangeError"),E=require("./internal/util/EmptyError"),w=require("./internal/util/NotFoundError"),W=require("./internal/util/ObjectUnsubscribedError"),T=require("./internal/util/SequenceError"),S=require("./internal/operators/timeout"),k=require("./internal/util/UnsubscriptionError"),A=require("./internal/observable/bindCallback"),M=require("./internal/observable/bindNodeCallback"),C=require("./internal/observable/combineLatest"),L=require("./internal/observable/concat"),F=require("./internal/observable/connectable"),z=require("./internal/observable/defer"),U=require("./internal/observable/empty"),R=require("./internal/observable/forkJoin"),N=require("./internal/observable/from"),V=require("./internal/observable/fromEvent"),I=require("./internal/observable/fromEventPattern"),B=require("./internal/observable/generate"),K=require("./internal/observable/iif"),J=require("./internal/observable/interval"),_=require("./internal/observable/merge"),Y=require("./internal/observable/never"),D=require("./internal/observable/of"),G=require("./internal/observable/onErrorResumeNext"),H=require("./internal/observable/pairs"),Q=require("./internal/observable/partition"),X=require("./internal/observable/race"),Z=require("./internal/observable/range"),$=require("./internal/observable/throwError"),ee=require("./internal/observable/timer"),re=require("./internal/observable/using"),te=require("./internal/observable/zip"),ne=require("./internal/scheduled/scheduled"),ie=require("./internal/types");Object.keys(ie).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return ie[r]}}))});var oe=require("./internal/config"),ue=require("./internal/operators/audit"),ae=require("./internal/operators/auditTime"),le=require("./internal/operators/buffer"),pe=require("./internal/operators/bufferCount"),ce=require("./internal/operators/bufferTime"),se=require("./internal/operators/bufferToggle"),be=require("./internal/operators/bufferWhen"),fe=require("./internal/operators/catchError"),me=require("./internal/operators/combineAll"),de=require("./internal/operators/combineLatestAll"),ye=require("./internal/operators/combineLatestWith"),ge=require("./internal/operators/concatAll"),Oe=require("./internal/operators/concatMap"),xe=require("./internal/operators/concatMapTo"),je=require("./internal/operators/concatWith"),he=require("./internal/operators/connect"),qe=require("./internal/operators/count"),Pe=require("./internal/operators/debounce"),ve=require("./internal/operators/debounceTime"),Ee=require("./internal/operators/defaultIfEmpty"),we=require("./internal/operators/delay"),We=require("./internal/operators/delayWhen"),Te=require("./internal/operators/dematerialize"),Se=require("./internal/operators/distinct"),ke=require("./internal/operators/distinctUntilChanged"),Ae=require("./internal/operators/distinctUntilKeyChanged"),Me=require("./internal/operators/elementAt"),Ce=require("./internal/operators/endWith"),Le=require("./internal/operators/every"),Fe=require("./internal/operators/exhaust"),ze=require("./internal/operators/exhaustAll"),Ue=require("./internal/operators/exhaustMap"),Re=require("./internal/operators/expand"),Ne=require("./internal/operators/filter"),Ve=require("./internal/operators/finalize"),Ie=require("./internal/operators/find"),Be=require("./internal/operators/findIndex"),Ke=require("./internal/operators/first"),Je=require("./internal/operators/groupBy"),_e=require("./internal/operators/ignoreElements"),Ye=require("./internal/operators/isEmpty"),De=require("./internal/operators/last"),Ge=require("./internal/operators/map"),He=require("./internal/operators/mapTo"),Qe=require("./internal/operators/materialize"),Xe=require("./internal/operators/max"),Ze=require("./internal/operators/mergeAll"),$e=require("./internal/operators/flatMap"),er=require("./internal/operators/mergeMap"),rr=require("./internal/operators/mergeMapTo"),tr=require("./internal/operators/mergeScan"),nr=require("./internal/operators/mergeWith"),ir=require("./internal/operators/min"),or=require("./internal/operators/multicast"),ur=require("./internal/operators/observeOn"),ar=require("./internal/operators/pairwise"),lr=require("./internal/operators/pluck"),pr=require("./internal/operators/publish"),cr=require("./internal/operators/publishBehavior"),sr=require("./internal/operators/publishLast"),br=require("./internal/operators/publishReplay"),fr=require("./internal/operators/raceWith"),mr=require("./internal/operators/reduce"),dr=require("./internal/operators/repeat"),yr=require("./internal/operators/repeatWhen"),gr=require("./internal/operators/retry"),Or=require("./internal/operators/retryWhen"),xr=require("./internal/operators/refCount"),jr=require("./internal/operators/sample"),hr=require("./internal/operators/sampleTime"),qr=require("./internal/operators/scan"),Pr=require("./internal/operators/sequenceEqual"),vr=require("./internal/operators/share"),Er=require("./internal/operators/shareReplay"),wr=require("./internal/operators/single"),Wr=require("./internal/operators/skip"),Tr=require("./internal/operators/skipLast"),Sr=require("./internal/operators/skipUntil"),kr=require("./internal/operators/skipWhile"),Ar=require("./internal/operators/startWith"),Mr=require("./internal/operators/subscribeOn"),Cr=require("./internal/operators/switchAll"),Lr=require("./internal/operators/switchMap"),Fr=require("./internal/operators/switchMapTo"),zr=require("./internal/operators/switchScan"),Ur=require("./internal/operators/take"),Rr=require("./internal/operators/takeLast"),Nr=require("./internal/operators/takeUntil"),Vr=require("./internal/operators/takeWhile"),Ir=require("./internal/operators/tap"),Br=require("./internal/operators/throttle"),Kr=require("./internal/operators/throttleTime"),Jr=require("./internal/operators/throwIfEmpty"),_r=require("./internal/operators/timeInterval"),Yr=require("./internal/operators/timeoutWith"),Dr=require("./internal/operators/timestamp"),Gr=require("./internal/operators/toArray"),Hr=require("./internal/operators/window"),Qr=require("./internal/operators/windowCount"),Xr=require("./internal/operators/windowTime"),Zr=require("./internal/operators/windowToggle"),$r=require("./internal/operators/windowWhen"),et=require("./internal/operators/withLatestFrom"),rt=require("./internal/operators/zipAll"),tt=require("./internal/operators/zipWith");
|
|
453
|
+
},{"./internal/Observable":"EkNV","./internal/observable/ConnectableObservable":"MckT","./internal/symbol/observable":"ubx8","./internal/observable/dom/animationFrames":"toCh","./internal/Subject":"BDW7","./internal/BehaviorSubject":"dUFA","./internal/ReplaySubject":"dbtS","./internal/AsyncSubject":"sDwD","./internal/scheduler/asap":"XpND","./internal/scheduler/async":"WQPT","./internal/scheduler/queue":"QfBT","./internal/scheduler/animationFrame":"lAIc","./internal/scheduler/VirtualTimeScheduler":"dFvp","./internal/Scheduler":"bUPD","./internal/Subscription":"Atlq","./internal/Subscriber":"j5Gi","./internal/Notification":"swlq","./internal/util/pipe":"eq9W","./internal/util/noop":"hNvY","./internal/util/identity":"FeLp","./internal/util/isObservable":"DTig","./internal/lastValueFrom":"CqFZ","./internal/firstValueFrom":"k2uW","./internal/util/ArgumentOutOfRangeError":"wL5X","./internal/util/EmptyError":"wRNN","./internal/util/NotFoundError":"kj9h","./internal/util/ObjectUnsubscribedError":"gdWq","./internal/util/SequenceError":"g1u8","./internal/operators/timeout":"jt1g","./internal/util/UnsubscriptionError":"Ns3F","./internal/observable/bindCallback":"yxvc","./internal/observable/bindNodeCallback":"kO2q","./internal/observable/combineLatest":"kXaL","./internal/observable/concat":"nSjD","./internal/observable/connectable":"aKIY","./internal/observable/defer":"gpse","./internal/observable/empty":"qOvc","./internal/observable/forkJoin":"bQiY","./internal/observable/from":"xTp9","./internal/observable/fromEvent":"IUMb","./internal/observable/fromEventPattern":"Svx6","./internal/observable/generate":"qMuK","./internal/observable/iif":"XjKV","./internal/observable/interval":"bNP6","./internal/observable/merge":"rerh","./internal/observable/never":"dyCL","./internal/observable/of":"lcaN","./internal/observable/onErrorResumeNext":"C1Ne","./internal/observable/pairs":"XoYb","./internal/observable/partition":"kc1W","./internal/observable/race":"IUwa","./internal/observable/range":"hGVv","./internal/observable/throwError":"wu76","./internal/observable/timer":"x2FQ","./internal/observable/using":"aIsN","./internal/observable/zip":"T2xt","./internal/scheduled/scheduled":"jMut","./internal/types":"zTZU","./internal/config":"nBrU","./internal/operators/audit":"OSTs","./internal/operators/auditTime":"qRa1","./internal/operators/buffer":"dt28","./internal/operators/bufferCount":"j5Mb","./internal/operators/bufferTime":"ZXjh","./internal/operators/bufferToggle":"sEzB","./internal/operators/bufferWhen":"DhIa","./internal/operators/catchError":"ZY8e","./internal/operators/combineAll":"bYSN","./internal/operators/combineLatestAll":"KhWj","./internal/operators/combineLatestWith":"X904","./internal/operators/concatAll":"SHNp","./internal/operators/concatMap":"u95e","./internal/operators/concatMapTo":"haX1","./internal/operators/concatWith":"wpEC","./internal/operators/connect":"aOS7","./internal/operators/count":"O922","./internal/operators/debounce":"WKkD","./internal/operators/debounceTime":"N6Fx","./internal/operators/defaultIfEmpty":"Fah0","./internal/operators/delay":"NHnw","./internal/operators/delayWhen":"UAqC","./internal/operators/dematerialize":"xeau","./internal/operators/distinct":"vBqk","./internal/operators/distinctUntilChanged":"Z6Fo","./internal/operators/distinctUntilKeyChanged":"rOn3","./internal/operators/elementAt":"vaXs","./internal/operators/endWith":"w35o","./internal/operators/every":"DFe2","./internal/operators/exhaust":"Bq0T","./internal/operators/exhaustAll":"ftIR","./internal/operators/exhaustMap":"BqMb","./internal/operators/expand":"TgHY","./internal/operators/filter":"IFp1","./internal/operators/finalize":"Z4yU","./internal/operators/find":"M6jc","./internal/operators/findIndex":"hdxC","./internal/operators/first":"eND7","./internal/operators/groupBy":"JSNM","./internal/operators/ignoreElements":"JGPk","./internal/operators/isEmpty":"G3o6","./internal/operators/last":"H8OC","./internal/operators/map":"N8Yl","./internal/operators/mapTo":"qCL4","./internal/operators/materialize":"LGra","./internal/operators/max":"wP5t","./internal/operators/mergeAll":"leLE","./internal/operators/flatMap":"zBzv","./internal/operators/mergeMap":"mGWE","./internal/operators/mergeMapTo":"AZnr","./internal/operators/mergeScan":"L3Pv","./internal/operators/mergeWith":"ivs5","./internal/operators/min":"JiR9","./internal/operators/multicast":"eORA","./internal/operators/observeOn":"kKa0","./internal/operators/pairwise":"VnbW","./internal/operators/pluck":"u2jJ","./internal/operators/publish":"nPBI","./internal/operators/publishBehavior":"ndtv","./internal/operators/publishLast":"gdMW","./internal/operators/publishReplay":"HR0g","./internal/operators/raceWith":"XeEu","./internal/operators/reduce":"gTgQ","./internal/operators/repeat":"UNCB","./internal/operators/repeatWhen":"aBtb","./internal/operators/retry":"IqOO","./internal/operators/retryWhen":"fivK","./internal/operators/refCount":"WUVS","./internal/operators/sample":"ueQ5","./internal/operators/sampleTime":"VxDF","./internal/operators/scan":"haGV","./internal/operators/sequenceEqual":"iZ1A","./internal/operators/share":"wd7X","./internal/operators/shareReplay":"RJoj","./internal/operators/single":"pOFx","./internal/operators/skip":"dhrz","./internal/operators/skipLast":"CBAe","./internal/operators/skipUntil":"TT30","./internal/operators/skipWhile":"TIPQ","./internal/operators/startWith":"p6pO","./internal/operators/subscribeOn":"cqCB","./internal/operators/switchAll":"De8H","./internal/operators/switchMap":"J2D0","./internal/operators/switchMapTo":"W7ik","./internal/operators/switchScan":"sDl1","./internal/operators/take":"mmu8","./internal/operators/takeLast":"BkG9","./internal/operators/takeUntil":"tosq","./internal/operators/takeWhile":"ic82","./internal/operators/tap":"uDXP","./internal/operators/throttle":"KrMa","./internal/operators/throttleTime":"i2pQ","./internal/operators/throwIfEmpty":"hR0o","./internal/operators/timeInterval":"OBGt","./internal/operators/timeoutWith":"Vs6L","./internal/operators/timestamp":"XUFT","./internal/operators/toArray":"Dse9","./internal/operators/window":"MnAl","./internal/operators/windowCount":"ycrj","./internal/operators/windowTime":"fQsK","./internal/operators/windowToggle":"vmsA","./internal/operators/windowWhen":"SO6T","./internal/operators/withLatestFrom":"KD22","./internal/operators/zipAll":"GYYb","./internal/operators/zipWith":"O3Ok"}],"Zauj":[function(require,module,exports) {
|
|
454
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.partition=t;var e=require("../util/not"),r=require("./filter");function t(t,i){return function(n){return[(0,r.filter)(t,i)(n),(0,r.filter)((0,e.not)(t,i))(n)]}}
|
|
455
|
+
},{"../util/not":"VLqq","./filter":"IFp1"}],"jVuL":[function(require,module,exports) {
|
|
456
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.race=t;var r=require("tslib"),e=require("../util/argsOrArgArray"),a=require("./raceWith");function t(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return a.raceWith.apply(void 0,(0,r.__spreadArray)([],(0,r.__read)((0,e.argsOrArgArray)(t))))}
|
|
457
|
+
},{"tslib":"B5W1","../util/argsOrArgArray":"h72L","./raceWith":"XeEu"}],"v3iE":[function(require,module,exports) {
|
|
458
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"audit",{enumerable:!0,get:function(){return e.audit}}),Object.defineProperty(exports,"auditTime",{enumerable:!0,get:function(){return r.auditTime}}),Object.defineProperty(exports,"buffer",{enumerable:!0,get:function(){return t.buffer}}),Object.defineProperty(exports,"bufferCount",{enumerable:!0,get:function(){return n.bufferCount}}),Object.defineProperty(exports,"bufferTime",{enumerable:!0,get:function(){return o.bufferTime}}),Object.defineProperty(exports,"bufferToggle",{enumerable:!0,get:function(){return i.bufferToggle}}),Object.defineProperty(exports,"bufferWhen",{enumerable:!0,get:function(){return a.bufferWhen}}),Object.defineProperty(exports,"catchError",{enumerable:!0,get:function(){return u.catchError}}),Object.defineProperty(exports,"combineAll",{enumerable:!0,get:function(){return p.combineAll}}),Object.defineProperty(exports,"combineLatestAll",{enumerable:!0,get:function(){return l.combineLatestAll}}),Object.defineProperty(exports,"combineLatest",{enumerable:!0,get:function(){return s.combineLatest}}),Object.defineProperty(exports,"combineLatestWith",{enumerable:!0,get:function(){return c.combineLatestWith}}),Object.defineProperty(exports,"concat",{enumerable:!0,get:function(){return f.concat}}),Object.defineProperty(exports,"concatAll",{enumerable:!0,get:function(){return b.concatAll}}),Object.defineProperty(exports,"concatMap",{enumerable:!0,get:function(){return m.concatMap}}),Object.defineProperty(exports,"concatMapTo",{enumerable:!0,get:function(){return d.concatMapTo}}),Object.defineProperty(exports,"concatWith",{enumerable:!0,get:function(){return g.concatWith}}),Object.defineProperty(exports,"connect",{enumerable:!0,get:function(){return y.connect}}),Object.defineProperty(exports,"count",{enumerable:!0,get:function(){return x.count}}),Object.defineProperty(exports,"debounce",{enumerable:!0,get:function(){return O.debounce}}),Object.defineProperty(exports,"debounceTime",{enumerable:!0,get:function(){return q.debounceTime}}),Object.defineProperty(exports,"defaultIfEmpty",{enumerable:!0,get:function(){return j.defaultIfEmpty}}),Object.defineProperty(exports,"delay",{enumerable:!0,get:function(){return P.delay}}),Object.defineProperty(exports,"delayWhen",{enumerable:!0,get:function(){return h.delayWhen}}),Object.defineProperty(exports,"dematerialize",{enumerable:!0,get:function(){return w.dematerialize}}),Object.defineProperty(exports,"distinct",{enumerable:!0,get:function(){return W.distinct}}),Object.defineProperty(exports,"distinctUntilChanged",{enumerable:!0,get:function(){return T.distinctUntilChanged}}),Object.defineProperty(exports,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return k.distinctUntilKeyChanged}}),Object.defineProperty(exports,"elementAt",{enumerable:!0,get:function(){return A.elementAt}}),Object.defineProperty(exports,"endWith",{enumerable:!0,get:function(){return M.endWith}}),Object.defineProperty(exports,"every",{enumerable:!0,get:function(){return E.every}}),Object.defineProperty(exports,"exhaust",{enumerable:!0,get:function(){return L.exhaust}}),Object.defineProperty(exports,"exhaustAll",{enumerable:!0,get:function(){return z.exhaustAll}}),Object.defineProperty(exports,"exhaustMap",{enumerable:!0,get:function(){return C.exhaustMap}}),Object.defineProperty(exports,"expand",{enumerable:!0,get:function(){return v.expand}}),Object.defineProperty(exports,"filter",{enumerable:!0,get:function(){return I.filter}}),Object.defineProperty(exports,"finalize",{enumerable:!0,get:function(){return U.finalize}}),Object.defineProperty(exports,"find",{enumerable:!0,get:function(){return R.find}}),Object.defineProperty(exports,"findIndex",{enumerable:!0,get:function(){return B.findIndex}}),Object.defineProperty(exports,"first",{enumerable:!0,get:function(){return S.first}}),Object.defineProperty(exports,"groupBy",{enumerable:!0,get:function(){return F.groupBy}}),Object.defineProperty(exports,"ignoreElements",{enumerable:!0,get:function(){return K.ignoreElements}}),Object.defineProperty(exports,"isEmpty",{enumerable:!0,get:function(){return N.isEmpty}}),Object.defineProperty(exports,"last",{enumerable:!0,get:function(){return _.last}}),Object.defineProperty(exports,"map",{enumerable:!0,get:function(){return D.map}}),Object.defineProperty(exports,"mapTo",{enumerable:!0,get:function(){return G.mapTo}}),Object.defineProperty(exports,"materialize",{enumerable:!0,get:function(){return H.materialize}}),Object.defineProperty(exports,"max",{enumerable:!0,get:function(){return J.max}}),Object.defineProperty(exports,"merge",{enumerable:!0,get:function(){return Q.merge}}),Object.defineProperty(exports,"mergeAll",{enumerable:!0,get:function(){return V.mergeAll}}),Object.defineProperty(exports,"flatMap",{enumerable:!0,get:function(){return X.flatMap}}),Object.defineProperty(exports,"mergeMap",{enumerable:!0,get:function(){return Y.mergeMap}}),Object.defineProperty(exports,"mergeMapTo",{enumerable:!0,get:function(){return Z.mergeMapTo}}),Object.defineProperty(exports,"mergeScan",{enumerable:!0,get:function(){return $.mergeScan}}),Object.defineProperty(exports,"mergeWith",{enumerable:!0,get:function(){return ee.mergeWith}}),Object.defineProperty(exports,"min",{enumerable:!0,get:function(){return re.min}}),Object.defineProperty(exports,"multicast",{enumerable:!0,get:function(){return te.multicast}}),Object.defineProperty(exports,"observeOn",{enumerable:!0,get:function(){return ne.observeOn}}),Object.defineProperty(exports,"onErrorResumeNext",{enumerable:!0,get:function(){return oe.onErrorResumeNext}}),Object.defineProperty(exports,"pairwise",{enumerable:!0,get:function(){return ie.pairwise}}),Object.defineProperty(exports,"partition",{enumerable:!0,get:function(){return ae.partition}}),Object.defineProperty(exports,"pluck",{enumerable:!0,get:function(){return ue.pluck}}),Object.defineProperty(exports,"publish",{enumerable:!0,get:function(){return pe.publish}}),Object.defineProperty(exports,"publishBehavior",{enumerable:!0,get:function(){return le.publishBehavior}}),Object.defineProperty(exports,"publishLast",{enumerable:!0,get:function(){return se.publishLast}}),Object.defineProperty(exports,"publishReplay",{enumerable:!0,get:function(){return ce.publishReplay}}),Object.defineProperty(exports,"race",{enumerable:!0,get:function(){return fe.race}}),Object.defineProperty(exports,"raceWith",{enumerable:!0,get:function(){return be.raceWith}}),Object.defineProperty(exports,"reduce",{enumerable:!0,get:function(){return me.reduce}}),Object.defineProperty(exports,"repeat",{enumerable:!0,get:function(){return de.repeat}}),Object.defineProperty(exports,"repeatWhen",{enumerable:!0,get:function(){return ge.repeatWhen}}),Object.defineProperty(exports,"retry",{enumerable:!0,get:function(){return ye.retry}}),Object.defineProperty(exports,"retryWhen",{enumerable:!0,get:function(){return xe.retryWhen}}),Object.defineProperty(exports,"refCount",{enumerable:!0,get:function(){return Oe.refCount}}),Object.defineProperty(exports,"sample",{enumerable:!0,get:function(){return qe.sample}}),Object.defineProperty(exports,"sampleTime",{enumerable:!0,get:function(){return je.sampleTime}}),Object.defineProperty(exports,"scan",{enumerable:!0,get:function(){return Pe.scan}}),Object.defineProperty(exports,"sequenceEqual",{enumerable:!0,get:function(){return he.sequenceEqual}}),Object.defineProperty(exports,"share",{enumerable:!0,get:function(){return we.share}}),Object.defineProperty(exports,"shareReplay",{enumerable:!0,get:function(){return We.shareReplay}}),Object.defineProperty(exports,"single",{enumerable:!0,get:function(){return Te.single}}),Object.defineProperty(exports,"skip",{enumerable:!0,get:function(){return ke.skip}}),Object.defineProperty(exports,"skipLast",{enumerable:!0,get:function(){return Ae.skipLast}}),Object.defineProperty(exports,"skipUntil",{enumerable:!0,get:function(){return Me.skipUntil}}),Object.defineProperty(exports,"skipWhile",{enumerable:!0,get:function(){return Ee.skipWhile}}),Object.defineProperty(exports,"startWith",{enumerable:!0,get:function(){return Le.startWith}}),Object.defineProperty(exports,"subscribeOn",{enumerable:!0,get:function(){return ze.subscribeOn}}),Object.defineProperty(exports,"switchAll",{enumerable:!0,get:function(){return Ce.switchAll}}),Object.defineProperty(exports,"switchMap",{enumerable:!0,get:function(){return ve.switchMap}}),Object.defineProperty(exports,"switchMapTo",{enumerable:!0,get:function(){return Ie.switchMapTo}}),Object.defineProperty(exports,"switchScan",{enumerable:!0,get:function(){return Ue.switchScan}}),Object.defineProperty(exports,"take",{enumerable:!0,get:function(){return Re.take}}),Object.defineProperty(exports,"takeLast",{enumerable:!0,get:function(){return Be.takeLast}}),Object.defineProperty(exports,"takeUntil",{enumerable:!0,get:function(){return Se.takeUntil}}),Object.defineProperty(exports,"takeWhile",{enumerable:!0,get:function(){return Fe.takeWhile}}),Object.defineProperty(exports,"tap",{enumerable:!0,get:function(){return Ke.tap}}),Object.defineProperty(exports,"throttle",{enumerable:!0,get:function(){return Ne.throttle}}),Object.defineProperty(exports,"throttleTime",{enumerable:!0,get:function(){return _e.throttleTime}}),Object.defineProperty(exports,"throwIfEmpty",{enumerable:!0,get:function(){return De.throwIfEmpty}}),Object.defineProperty(exports,"timeInterval",{enumerable:!0,get:function(){return Ge.timeInterval}}),Object.defineProperty(exports,"timeout",{enumerable:!0,get:function(){return He.timeout}}),Object.defineProperty(exports,"timeoutWith",{enumerable:!0,get:function(){return Je.timeoutWith}}),Object.defineProperty(exports,"timestamp",{enumerable:!0,get:function(){return Qe.timestamp}}),Object.defineProperty(exports,"toArray",{enumerable:!0,get:function(){return Ve.toArray}}),Object.defineProperty(exports,"window",{enumerable:!0,get:function(){return Xe.window}}),Object.defineProperty(exports,"windowCount",{enumerable:!0,get:function(){return Ye.windowCount}}),Object.defineProperty(exports,"windowTime",{enumerable:!0,get:function(){return Ze.windowTime}}),Object.defineProperty(exports,"windowToggle",{enumerable:!0,get:function(){return $e.windowToggle}}),Object.defineProperty(exports,"windowWhen",{enumerable:!0,get:function(){return er.windowWhen}}),Object.defineProperty(exports,"withLatestFrom",{enumerable:!0,get:function(){return rr.withLatestFrom}}),Object.defineProperty(exports,"zip",{enumerable:!0,get:function(){return tr.zip}}),Object.defineProperty(exports,"zipAll",{enumerable:!0,get:function(){return nr.zipAll}}),Object.defineProperty(exports,"zipWith",{enumerable:!0,get:function(){return or.zipWith}});var e=require("../internal/operators/audit"),r=require("../internal/operators/auditTime"),t=require("../internal/operators/buffer"),n=require("../internal/operators/bufferCount"),o=require("../internal/operators/bufferTime"),i=require("../internal/operators/bufferToggle"),a=require("../internal/operators/bufferWhen"),u=require("../internal/operators/catchError"),p=require("../internal/operators/combineAll"),l=require("../internal/operators/combineLatestAll"),s=require("../internal/operators/combineLatest"),c=require("../internal/operators/combineLatestWith"),f=require("../internal/operators/concat"),b=require("../internal/operators/concatAll"),m=require("../internal/operators/concatMap"),d=require("../internal/operators/concatMapTo"),g=require("../internal/operators/concatWith"),y=require("../internal/operators/connect"),x=require("../internal/operators/count"),O=require("../internal/operators/debounce"),q=require("../internal/operators/debounceTime"),j=require("../internal/operators/defaultIfEmpty"),P=require("../internal/operators/delay"),h=require("../internal/operators/delayWhen"),w=require("../internal/operators/dematerialize"),W=require("../internal/operators/distinct"),T=require("../internal/operators/distinctUntilChanged"),k=require("../internal/operators/distinctUntilKeyChanged"),A=require("../internal/operators/elementAt"),M=require("../internal/operators/endWith"),E=require("../internal/operators/every"),L=require("../internal/operators/exhaust"),z=require("../internal/operators/exhaustAll"),C=require("../internal/operators/exhaustMap"),v=require("../internal/operators/expand"),I=require("../internal/operators/filter"),U=require("../internal/operators/finalize"),R=require("../internal/operators/find"),B=require("../internal/operators/findIndex"),S=require("../internal/operators/first"),F=require("../internal/operators/groupBy"),K=require("../internal/operators/ignoreElements"),N=require("../internal/operators/isEmpty"),_=require("../internal/operators/last"),D=require("../internal/operators/map"),G=require("../internal/operators/mapTo"),H=require("../internal/operators/materialize"),J=require("../internal/operators/max"),Q=require("../internal/operators/merge"),V=require("../internal/operators/mergeAll"),X=require("../internal/operators/flatMap"),Y=require("../internal/operators/mergeMap"),Z=require("../internal/operators/mergeMapTo"),$=require("../internal/operators/mergeScan"),ee=require("../internal/operators/mergeWith"),re=require("../internal/operators/min"),te=require("../internal/operators/multicast"),ne=require("../internal/operators/observeOn"),oe=require("../internal/operators/onErrorResumeNext"),ie=require("../internal/operators/pairwise"),ae=require("../internal/operators/partition"),ue=require("../internal/operators/pluck"),pe=require("../internal/operators/publish"),le=require("../internal/operators/publishBehavior"),se=require("../internal/operators/publishLast"),ce=require("../internal/operators/publishReplay"),fe=require("../internal/operators/race"),be=require("../internal/operators/raceWith"),me=require("../internal/operators/reduce"),de=require("../internal/operators/repeat"),ge=require("../internal/operators/repeatWhen"),ye=require("../internal/operators/retry"),xe=require("../internal/operators/retryWhen"),Oe=require("../internal/operators/refCount"),qe=require("../internal/operators/sample"),je=require("../internal/operators/sampleTime"),Pe=require("../internal/operators/scan"),he=require("../internal/operators/sequenceEqual"),we=require("../internal/operators/share"),We=require("../internal/operators/shareReplay"),Te=require("../internal/operators/single"),ke=require("../internal/operators/skip"),Ae=require("../internal/operators/skipLast"),Me=require("../internal/operators/skipUntil"),Ee=require("../internal/operators/skipWhile"),Le=require("../internal/operators/startWith"),ze=require("../internal/operators/subscribeOn"),Ce=require("../internal/operators/switchAll"),ve=require("../internal/operators/switchMap"),Ie=require("../internal/operators/switchMapTo"),Ue=require("../internal/operators/switchScan"),Re=require("../internal/operators/take"),Be=require("../internal/operators/takeLast"),Se=require("../internal/operators/takeUntil"),Fe=require("../internal/operators/takeWhile"),Ke=require("../internal/operators/tap"),Ne=require("../internal/operators/throttle"),_e=require("../internal/operators/throttleTime"),De=require("../internal/operators/throwIfEmpty"),Ge=require("../internal/operators/timeInterval"),He=require("../internal/operators/timeout"),Je=require("../internal/operators/timeoutWith"),Qe=require("../internal/operators/timestamp"),Ve=require("../internal/operators/toArray"),Xe=require("../internal/operators/window"),Ye=require("../internal/operators/windowCount"),Ze=require("../internal/operators/windowTime"),$e=require("../internal/operators/windowToggle"),er=require("../internal/operators/windowWhen"),rr=require("../internal/operators/withLatestFrom"),tr=require("../internal/operators/zip"),nr=require("../internal/operators/zipAll"),or=require("../internal/operators/zipWith");
|
|
459
|
+
},{"../internal/operators/audit":"OSTs","../internal/operators/auditTime":"qRa1","../internal/operators/buffer":"dt28","../internal/operators/bufferCount":"j5Mb","../internal/operators/bufferTime":"ZXjh","../internal/operators/bufferToggle":"sEzB","../internal/operators/bufferWhen":"DhIa","../internal/operators/catchError":"ZY8e","../internal/operators/combineAll":"bYSN","../internal/operators/combineLatestAll":"KhWj","../internal/operators/combineLatest":"xTmU","../internal/operators/combineLatestWith":"X904","../internal/operators/concat":"Ge6C","../internal/operators/concatAll":"SHNp","../internal/operators/concatMap":"u95e","../internal/operators/concatMapTo":"haX1","../internal/operators/concatWith":"wpEC","../internal/operators/connect":"aOS7","../internal/operators/count":"O922","../internal/operators/debounce":"WKkD","../internal/operators/debounceTime":"N6Fx","../internal/operators/defaultIfEmpty":"Fah0","../internal/operators/delay":"NHnw","../internal/operators/delayWhen":"UAqC","../internal/operators/dematerialize":"xeau","../internal/operators/distinct":"vBqk","../internal/operators/distinctUntilChanged":"Z6Fo","../internal/operators/distinctUntilKeyChanged":"rOn3","../internal/operators/elementAt":"vaXs","../internal/operators/endWith":"w35o","../internal/operators/every":"DFe2","../internal/operators/exhaust":"Bq0T","../internal/operators/exhaustAll":"ftIR","../internal/operators/exhaustMap":"BqMb","../internal/operators/expand":"TgHY","../internal/operators/filter":"IFp1","../internal/operators/finalize":"Z4yU","../internal/operators/find":"M6jc","../internal/operators/findIndex":"hdxC","../internal/operators/first":"eND7","../internal/operators/groupBy":"JSNM","../internal/operators/ignoreElements":"JGPk","../internal/operators/isEmpty":"G3o6","../internal/operators/last":"H8OC","../internal/operators/map":"N8Yl","../internal/operators/mapTo":"qCL4","../internal/operators/materialize":"LGra","../internal/operators/max":"wP5t","../internal/operators/merge":"Jh4T","../internal/operators/mergeAll":"leLE","../internal/operators/flatMap":"zBzv","../internal/operators/mergeMap":"mGWE","../internal/operators/mergeMapTo":"AZnr","../internal/operators/mergeScan":"L3Pv","../internal/operators/mergeWith":"ivs5","../internal/operators/min":"JiR9","../internal/operators/multicast":"eORA","../internal/operators/observeOn":"kKa0","../internal/operators/onErrorResumeNext":"i85H","../internal/operators/pairwise":"VnbW","../internal/operators/partition":"Zauj","../internal/operators/pluck":"u2jJ","../internal/operators/publish":"nPBI","../internal/operators/publishBehavior":"ndtv","../internal/operators/publishLast":"gdMW","../internal/operators/publishReplay":"HR0g","../internal/operators/race":"jVuL","../internal/operators/raceWith":"XeEu","../internal/operators/reduce":"gTgQ","../internal/operators/repeat":"UNCB","../internal/operators/repeatWhen":"aBtb","../internal/operators/retry":"IqOO","../internal/operators/retryWhen":"fivK","../internal/operators/refCount":"WUVS","../internal/operators/sample":"ueQ5","../internal/operators/sampleTime":"VxDF","../internal/operators/scan":"haGV","../internal/operators/sequenceEqual":"iZ1A","../internal/operators/share":"wd7X","../internal/operators/shareReplay":"RJoj","../internal/operators/single":"pOFx","../internal/operators/skip":"dhrz","../internal/operators/skipLast":"CBAe","../internal/operators/skipUntil":"TT30","../internal/operators/skipWhile":"TIPQ","../internal/operators/startWith":"p6pO","../internal/operators/subscribeOn":"cqCB","../internal/operators/switchAll":"De8H","../internal/operators/switchMap":"J2D0","../internal/operators/switchMapTo":"W7ik","../internal/operators/switchScan":"sDl1","../internal/operators/take":"mmu8","../internal/operators/takeLast":"BkG9","../internal/operators/takeUntil":"tosq","../internal/operators/takeWhile":"ic82","../internal/operators/tap":"uDXP","../internal/operators/throttle":"KrMa","../internal/operators/throttleTime":"i2pQ","../internal/operators/throwIfEmpty":"hR0o","../internal/operators/timeInterval":"OBGt","../internal/operators/timeout":"jt1g","../internal/operators/timeoutWith":"Vs6L","../internal/operators/timestamp":"XUFT","../internal/operators/toArray":"Dse9","../internal/operators/window":"MnAl","../internal/operators/windowCount":"ycrj","../internal/operators/windowTime":"fQsK","../internal/operators/windowToggle":"vmsA","../internal/operators/windowWhen":"SO6T","../internal/operators/withLatestFrom":"KD22","../internal/operators/zip":"qevp","../internal/operators/zipAll":"GYYb","../internal/operators/zipWith":"O3Ok"}],"jIGR":[function(require,module,exports) {
|
|
460
|
+
"use strict";module.exports=function r(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var o,n,u;if(Array.isArray(t)){if((o=t.length)!=e.length)return!1;for(n=o;0!=n--;)if(!r(t[n],e[n]))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((o=(u=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(n=o;0!=n--;)if(!Object.prototype.hasOwnProperty.call(e,u[n]))return!1;for(n=o;0!=n--;){var f=u[n];if(!r(t[f],e[f]))return!1}return!0}return t!=t&&e!=e};
|
|
461
|
+
},{}],"f2sD":[function(require,module,exports) {
|
|
462
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__extends=e,exports.__rest=n,exports.__decorate=o,exports.__param=a,exports.__metadata=i,exports.__awaiter=c,exports.__generator=u,exports.__exportStar=l,exports.__values=s,exports.__read=p,exports.__spread=y,exports.__spreadArrays=h,exports.__spreadArray=d,exports.__await=_,exports.__asyncGenerator=v,exports.__asyncDelegator=b,exports.__asyncValues=w,exports.__makeTemplateObject=x,exports.__importStar=O,exports.__importDefault=g,exports.__classPrivateFieldGet=j,exports.__classPrivateFieldSet=P,exports.__createBinding=exports.__assign=void 0;var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};function e(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return exports.__assign=r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};function n(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function o(t,e,r,n){var o,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(i=(a<3?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i}function a(t,e){return function(r,n){e(r,n,t)}}function i(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,r,n){return new(r||(r=Promise))(function(o,a){function i(t){try{u(n.next(t))}catch(e){a(e)}}function c(t){try{u(n.throw(t))}catch(e){a(e)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(i,c)}u((n=n.apply(t,e||[])).next())})}function u(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(c){a=[6,c],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}exports.__assign=r;var f=Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]};function l(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||f(e,t,r)}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,a=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function h(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var a=arguments[e],i=0,c=a.length;i<c;i++,o++)n[o]=a[i];return n}function d(t,e,r){if(r||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function _(t){return this instanceof _?(this.v=t,this):new _(t)}function v(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),a=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(t){o[t]&&(n[t]=function(e){return new Promise(function(r,n){a.push([t,e,r,n])>1||c(t,e)})})}function c(t,e){try{(r=o[t](e)).value instanceof _?Promise.resolve(r.value.v).then(u,f):l(a[0][2],r)}catch(n){l(a[0][3],n)}var r}function u(t){c("next",t)}function f(t){c("throw",t)}function l(t,e){t(e),a.shift(),a.length&&c(a[0][0],a[0][1])}}function b(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:_(t[n](e)),done:"return"===n}:o?o(e):e}:o}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof s?s(t):t[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,o){(function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)})(n,o,(e=t[r](e)).done,e.value)})}}}function x(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}exports.__createBinding=f;var m=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function O(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&f(e,t,r);return m(e,t),e}function g(t){return t&&t.__esModule?t:{default:t}}function j(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function P(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}
|
|
463
|
+
},{}],"KxmD":[function(require,module,exports) {
|
|
464
|
+
var global = arguments[3];
|
|
465
|
+
var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.areCookiesEnabled=D,exports.async=re,exports.calculateBackoffMillis=ve,exports.contains=z,exports.createMockUserToken=v,exports.createSubscribe=Z,exports.deepCopy=f,exports.deepEqual=G,exports.deepExtend=p,exports.errorPrefix=ie,exports.extractQuerystring=$,exports.getGlobal=N,exports.getModularInstance=ye,exports.getUA=b,exports.isBrowser=x,exports.isBrowserExtension=g,exports.isElectron=A,exports.isEmpty=q,exports.isIE=m,exports.isIndexedDBAvailable=w,exports.isMobileCordova=_,exports.isNode=y,exports.isNodeSdk=O,exports.isReactNative=E,exports.isSafari=C,exports.isUWP=S,exports.jsonEval=P,exports.map=H,exports.ordinal=be,exports.querystring=X,exports.querystringDecode=Q,exports.safeGet=J,exports.stringify=L,exports.validateCallback=ae,exports.validateContextObject=ce,exports.validateIndexedDBOpenable=T,exports.validateNamespace=se,exports.validateArgCount=exports.stringToByteArray=exports.stringLength=exports.issuedAtTime=exports.isValidTimestamp=exports.isValidFormat=exports.isAdmin=exports.decode=exports.base64urlEncodeWithoutPadding=exports.base64Encode=exports.base64Decode=exports.base64=exports.assertionError=exports.assert=exports.Sha1=exports.RANDOM_FACTOR=exports.MAX_VALUE_MILLIS=exports.FirebaseError=exports.ErrorFactory=exports.Deferred=exports.CONSTANTS=void 0;var r=require("tslib"),t={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};exports.CONSTANTS=t;var o=function(e,r){if(!e)throw n(r)};exports.assert=o;var n=function(e){return new Error("Firebase Database ("+t.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)};exports.assertionError=n;var i=function(e){for(var r=[],t=0,o=0;o<e.length;o++){var n=e.charCodeAt(o);n<128?r[t++]=n:n<2048?(r[t++]=n>>6|192,r[t++]=63&n|128):55296==(64512&n)&&o+1<e.length&&56320==(64512&e.charCodeAt(o+1))?(n=65536+((1023&n)<<10)+(1023&e.charCodeAt(++o)),r[t++]=n>>18|240,r[t++]=n>>12&63|128,r[t++]=n>>6&63|128,r[t++]=63&n|128):(r[t++]=n>>12|224,r[t++]=n>>6&63|128,r[t++]=63&n|128)}return r},s=function(e){for(var r=[],t=0,o=0;t<e.length;){var n=e[t++];if(n<128)r[o++]=String.fromCharCode(n);else if(n>191&&n<224){var i=e[t++];r[o++]=String.fromCharCode((31&n)<<6|63&i)}else if(n>239&&n<365){var s=((7&n)<<18|(63&(i=e[t++]))<<12|(63&(a=e[t++]))<<6|63&e[t++])-65536;r[o++]=String.fromCharCode(55296+(s>>10)),r[o++]=String.fromCharCode(56320+(1023&s))}else{i=e[t++];var a=e[t++];r[o++]=String.fromCharCode((15&n)<<12|(63&i)<<6|63&a)}}return r.join("")},a={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(e,r){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var t=r?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[],n=0;n<e.length;n+=3){var i=e[n],s=n+1<e.length,a=s?e[n+1]:0,c=n+2<e.length,u=c?e[n+2]:0,h=i>>2,f=(3&i)<<4|a>>4,p=(15&a)<<2|u>>6,d=63&u;c||(d=64,s||(p=64)),o.push(t[h],t[f],t[p],t[d])}return o.join("")},encodeString:function(e,r){return this.HAS_NATIVE_SUPPORT&&!r?btoa(e):this.encodeByteArray(i(e),r)},decodeString:function(e,r){return this.HAS_NATIVE_SUPPORT&&!r?atob(e):s(this.decodeStringToByteArray(e,r))},decodeStringToByteArray:function(e,r){this.init_();for(var t=r?this.charToByteMapWebSafe_:this.charToByteMap_,o=[],n=0;n<e.length;){var i=t[e.charAt(n++)],s=n<e.length?t[e.charAt(n)]:0,a=++n<e.length?t[e.charAt(n)]:64,c=++n<e.length?t[e.charAt(n)]:64;if(++n,null==i||null==s||null==a||null==c)throw Error();var u=i<<2|s>>4;if(o.push(u),64!==a){var h=s<<4&240|a>>2;if(o.push(h),64!==c){var f=a<<6&192|c;o.push(f)}}}return o},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};exports.base64=a;var c=function(e){var r=i(e);return a.encodeByteArray(r,!0)};exports.base64Encode=c;var u=function(e){return c(e).replace(/\./g,"")};exports.base64urlEncodeWithoutPadding=u;var h=function(e){try{return a.decodeString(e,!0)}catch(r){console.error("base64Decode failed: ",r)}return null};function f(e){return p(void 0,e)}function p(e,r){if(!(r instanceof Object))return r;switch(r.constructor){case Date:return new Date(r.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return r}for(var t in r)r.hasOwnProperty(t)&&d(t)&&(e[t]=p(e[t],r[t]));return e}function d(e){return"__proto__"!==e}exports.base64Decode=h;var l=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(r,t){e.resolve=r,e.reject=t})}return e.prototype.wrapCallback=function(e){var r=this;return function(t,o){t?r.reject(t):r.resolve(o),"function"==typeof e&&(r.promise.catch(function(){}),1===e.length?e(t):e(t,o))}},e}();function v(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var o=t||"demo-project",n=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var s=(0,r.__assign)({iss:"https://securetoken.google.com/"+o,aud:o,iat:n,exp:n+3600,auth_time:n,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[u(JSON.stringify({alg:"none",type:"JWT"})),u(JSON.stringify(s)),""].join(".")}function b(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function _(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(b())}function y(){try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(r){return!1}}function x(){return"object"==typeof self&&self.self===self}function g(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function E(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function A(){return b().indexOf("Electron/")>=0}function m(){var e=b();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function S(){return b().indexOf("MSAppHost/")>=0}function O(){return!0===t.NODE_CLIENT||!0===t.NODE_ADMIN}function C(){return!y()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function w(){return"indexedDB"in self&&null!=indexedDB}function T(){return new Promise(function(e,r){try{var t=!0,o="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(o);n.onsuccess=function(){n.result.close(),t||self.indexedDB.deleteDatabase(o),e(!0)},n.onupgradeneeded=function(){t=!1},n.onerror=function(){var e;r((null===(e=n.error)||void 0===e?void 0:e.message)||"")}}catch(i){r(i)}})}function D(){return!(!navigator||!navigator.cookieEnabled)}function N(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("Unable to locate global object.")}exports.Deferred=l;var M="FirebaseError",j=function(e){function t(r,o,n){var i=e.call(this,o)||this;return i.code=r,i.customData=n,i.name=M,Object.setPrototypeOf(i,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,k.prototype.create),i}return(0,r.__extends)(t,e),t}(Error);exports.FirebaseError=j;var k=function(){function e(e,r,t){this.service=e,this.serviceName=r,this.errors=t}return e.prototype.create=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var o=r[0]||{},n=this.service+"/"+e,i=this.errors[e],s=i?B(i,o):"Error",a=this.serviceName+": "+s+" ("+n+").";return new j(n,a,o)},e}();function B(e,r){return e.replace(I,function(e,t){var o=r[t];return null!=o?String(o):"<"+t+"?>"})}exports.ErrorFactory=k;var I=/\{\$([^}]+)}/g;function P(e){return JSON.parse(e)}function L(e){return JSON.stringify(e)}var V=function(e){var r={},t={},o={},n="";try{var i=e.split(".");r=P(h(i[0])||""),t=P(h(i[1])||""),n=i[2],o=t.d||{},delete t.d}catch(s){}return{header:r,claims:t,data:o,signature:n}};exports.decode=V;var R=function(e){var r=V(e).claims,t=Math.floor((new Date).getTime()/1e3),o=0,n=0;return"object"==typeof r&&(r.hasOwnProperty("nbf")?o=r.nbf:r.hasOwnProperty("iat")&&(o=r.iat),n=r.hasOwnProperty("exp")?r.exp:o+86400),!!t&&!!o&&!!n&&t>=o&&t<=n};exports.isValidTimestamp=R;var W=function(e){var r=V(e).claims;return"object"==typeof r&&r.hasOwnProperty("iat")?r.iat:null};exports.issuedAtTime=W;var U=function(e){var r=V(e).claims;return!!r&&"object"==typeof r&&r.hasOwnProperty("iat")};exports.isValidFormat=U;var F=function(e){var r=V(e).claims;return"object"==typeof r&&!0===r.admin};function z(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function J(e,r){return Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0}function q(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}function H(e,r,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=r.call(t,e[n],n,e));return o}function G(e,r){if(e===r)return!0;for(var t=Object.keys(e),o=Object.keys(r),n=0,i=t;n<i.length;n++){var s=i[n];if(!o.includes(s))return!1;var a=e[s],c=r[s];if(K(a)&&K(c)){if(!G(a,c))return!1}else if(a!==c)return!1}for(var u=0,h=o;u<h.length;u++){s=h[u];if(!t.includes(s))return!1}return!0}function K(e){return null!==e&&"object"==typeof e}function X(e){for(var r=[],t=function(e,t){Array.isArray(t)?t.forEach(function(t){r.push(encodeURIComponent(e)+"="+encodeURIComponent(t))}):r.push(encodeURIComponent(e)+"="+encodeURIComponent(t))},o=0,n=Object.entries(e);o<n.length;o++){var i=n[o];t(i[0],i[1])}return r.length?"&"+r.join("&"):""}function Q(e){var r={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var t=e.split("="),o=t[0],n=t[1];r[decodeURIComponent(o)]=decodeURIComponent(n)}}),r}function $(e){var r=e.indexOf("?");if(!r)return"";var t=e.indexOf("#",r);return e.substring(r,t>0?t:void 0)}exports.isAdmin=F;var Y=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}return e.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},e.prototype.compress_=function(e,r){r||(r=0);var t=this.W_;if("string"==typeof e)for(var o=0;o<16;o++)t[o]=e.charCodeAt(r)<<24|e.charCodeAt(r+1)<<16|e.charCodeAt(r+2)<<8|e.charCodeAt(r+3),r+=4;else for(o=0;o<16;o++)t[o]=e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3],r+=4;for(o=16;o<80;o++){var n=t[o-3]^t[o-8]^t[o-14]^t[o-16];t[o]=4294967295&(n<<1|n>>>31)}var i,s,a=this.chain_[0],c=this.chain_[1],u=this.chain_[2],h=this.chain_[3],f=this.chain_[4];for(o=0;o<80;o++){o<40?o<20?(i=h^c&(u^h),s=1518500249):(i=c^u^h,s=1859775393):o<60?(i=c&u|h&(c|u),s=2400959708):(i=c^u^h,s=3395469782);n=(a<<5|a>>>27)+i+f+s+t[o]&4294967295;f=h,h=u,u=4294967295&(c<<30|c>>>2),c=a,a=n}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+c&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+h&4294967295,this.chain_[4]=this.chain_[4]+f&4294967295},e.prototype.update=function(e,r){if(null!=e){void 0===r&&(r=e.length);for(var t=r-this.blockSize,o=0,n=this.buf_,i=this.inbuf_;o<r;){if(0===i)for(;o<=t;)this.compress_(e,o),o+=this.blockSize;if("string"==typeof e){for(;o<r;)if(n[i]=e.charCodeAt(o),++o,++i===this.blockSize){this.compress_(n),i=0;break}}else for(;o<r;)if(n[i]=e[o],++o,++i===this.blockSize){this.compress_(n),i=0;break}}this.inbuf_=i,this.total_+=r}},e.prototype.digest=function(){var e=[],r=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var t=this.blockSize-1;t>=56;t--)this.buf_[t]=255&r,r/=256;this.compress_(this.buf_);var o=0;for(t=0;t<5;t++)for(var n=24;n>=0;n-=8)e[o]=this.chain_[t]>>n&255,++o;return e},e}();function Z(e,r){var t=new ee(e,r);return t.subscribe.bind(t)}exports.Sha1=Y;var ee=function(){function e(e,r){var t=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=r,this.task.then(function(){e(t)}).catch(function(e){t.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(r){r.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(r){r.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,r,t){var o,n=this;if(void 0===e&&void 0===r&&void 0===t)throw new Error("Missing Observer.");void 0===(o=te(e,["next","error","complete"])?e:{next:e,error:r,complete:t}).next&&(o.next=oe),void 0===o.error&&(o.error=oe),void 0===o.complete&&(o.complete=oe);var i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{n.finalError?o.error(n.finalError):o.complete()}catch(e){}}),this.observers.push(o),i},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var r=0;r<this.observers.length;r++)this.sendOne(r,e)},e.prototype.sendOne=function(e,r){var t=this;this.task.then(function(){if(void 0!==t.observers&&void 0!==t.observers[e])try{r(t.observers[e])}catch(o){"undefined"!=typeof console&&console.error&&console.error(o)}})},e.prototype.close=function(e){var r=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){r.observers=void 0,r.onNoObservers=void 0}))},e}();function re(e,r){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];Promise.resolve(!0).then(function(){e.apply(void 0,t)}).catch(function(e){r&&r(e)})}}function te(e,r){if("object"!=typeof e||null===e)return!1;for(var t=0,o=r;t<o.length;t++){var n=o[t];if(n in e&&"function"==typeof e[n])return!0}return!1}function oe(){}var ne=function(e,r,t,o){var n;if(o<r?n="at least "+r:o>t&&(n=0===t?"none":"no more than "+t),n)throw new Error(e+" failed: Was called with "+o+(1===o?" argument.":" arguments.")+" Expects "+n+".")};function ie(e,r){return e+" failed: "+r+" argument "}function se(e,r,t){if((!t||r)&&"string"!=typeof r)throw new Error(ie(e,"namespace")+"must be a valid firebase namespace.")}function ae(e,r,t,o){if((!o||t)&&"function"!=typeof t)throw new Error(ie(e,r)+"must be a valid function.")}function ce(e,r,t,o){if((!o||t)&&("object"!=typeof t||null===t))throw new Error(ie(e,r)+"must be a valid context object.")}exports.validateArgCount=ne;var ue=function(e){for(var r=[],t=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319){var s=i-55296;o(++n<e.length,"Surrogate pair missing trail surrogate."),i=65536+(s<<10)+(e.charCodeAt(n)-56320)}i<128?r[t++]=i:i<2048?(r[t++]=i>>6|192,r[t++]=63&i|128):i<65536?(r[t++]=i>>12|224,r[t++]=i>>6&63|128,r[t++]=63&i|128):(r[t++]=i>>18|240,r[t++]=i>>12&63|128,r[t++]=i>>6&63|128,r[t++]=63&i|128)}return r};exports.stringToByteArray=ue;var he=function(e){for(var r=0,t=0;t<e.length;t++){var o=e.charCodeAt(t);o<128?r++:o<2048?r+=2:o>=55296&&o<=56319?(r+=4,t++):r+=3}return r};exports.stringLength=he;var fe=1e3,pe=2,de=144e5;exports.MAX_VALUE_MILLIS=de;var le=.5;function ve(e,r,t){void 0===r&&(r=fe),void 0===t&&(t=pe);var o=r*Math.pow(t,e),n=Math.round(le*o*(Math.random()-.5)*2);return Math.min(de,o+n)}function be(e){return Number.isFinite(e)?e+_e(e):""+e}function _e(e){var r=(e=Math.abs(e))%100;if(r>=10&&r<=20)return"th";var t=e%10;return 1===t?"st":2===t?"nd":3===t?"rd":"th"}function ye(e){return e&&e._delegate?e._delegate:e}exports.RANDOM_FACTOR=le;
|
|
466
|
+
},{"tslib":"f2sD"}],"sLOu":[function(require,module,exports) {
|
|
467
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Provider=exports.ComponentContainer=exports.Component=void 0;var t=require("tslib"),e=require("@firebase/util"),n=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}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.prototype.setInstanceCreatedCallback=function(t){return this.onInstanceCreated=t,this},t}();exports.Component=n;var i="[DEFAULT]",r=function(){function n(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return n.prototype.get=function(t){var n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){var i=new e.Deferred;if(this.instancesDeferred.set(n,i),this.isInitialized(n)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:n});r&&i.resolve(r)}catch(o){}}return this.instancesDeferred.get(n).promise},n.prototype.getImmediate=function(t){var e,n=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),i=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(i)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(r){if(i)return null;throw r}},n.prototype.getComponent=function(){return this.component},n.prototype.setComponent=function(e){var n,r;if(e.name!==this.name)throw Error("Mismatching Component "+e.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=e,this.shouldAutoInitialize()){if(s(e))try{this.getOrInitializeService({instanceIdentifier:i})}catch(u){}try{for(var o=(0,t.__values)(this.instancesDeferred.entries()),a=o.next();!a.done;a=o.next()){var c=(0,t.__read)(a.value,2),h=c[0],l=c[1],p=this.normalizeInstanceIdentifier(h);try{var d=this.getOrInitializeService({instanceIdentifier:p});l.resolve(d)}catch(u){}}}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}},n.prototype.clearInstance=function(t){void 0===t&&(t=i),this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)},n.prototype.delete=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){var e;return(0,t.__generator)(this,function(n){switch(n.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all((0,t.__spreadArray)((0,t.__spreadArray)([],(0,t.__read)(e.filter(function(t){return"INTERNAL"in t}).map(function(t){return t.INTERNAL.delete()}))),(0,t.__read)(e.filter(function(t){return"_delete"in t}).map(function(t){return t._delete()}))))];case 1:return n.sent(),[2]}})})},n.prototype.isComponentSet=function(){return null!=this.component},n.prototype.isInitialized=function(t){return void 0===t&&(t=i),this.instances.has(t)},n.prototype.getOptions=function(t){return void 0===t&&(t=i),this.instancesOptions.get(t)||{}},n.prototype.initialize=function(e){var n,i;void 0===e&&(e={});var r=e.options,o=void 0===r?{}:r,s=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(s))throw Error(this.name+"("+s+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var a=this.getOrInitializeService({instanceIdentifier:s,options:o});try{for(var c=(0,t.__values)(this.instancesDeferred.entries()),h=c.next();!h.done;h=c.next()){var l=(0,t.__read)(h.value,2),p=l[0],d=l[1];s===this.normalizeInstanceIdentifier(p)&&d.resolve(a)}}catch(u){n={error:u}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return a},n.prototype.onInit=function(t,e){var n,i=this.normalizeInstanceIdentifier(e),r=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;r.add(t),this.onInitCallbacks.set(i,r);var o=this.instances.get(i);return o&&t(o,i),function(){r.delete(t)}},n.prototype.invokeOnInitCallbacks=function(e,n){var i,r,o=this.onInitCallbacks.get(n);if(o)try{for(var s=(0,t.__values)(o),a=s.next();!a.done;a=s.next()){var c=a.value;try{c(e,n)}catch(h){}}}catch(l){i={error:l}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}},n.prototype.getOrInitializeService=function(t){var e=t.instanceIdentifier,n=t.options,i=void 0===n?{}:n,r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:o(e),options:i}),this.instances.set(e,r),this.instancesOptions.set(e,i),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch(s){}return r||null},n.prototype.normalizeInstanceIdentifier=function(t){return void 0===t&&(t=i),this.component?this.component.multipleInstances?t:i:t},n.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},n}();function o(t){return t===i?void 0:t}function s(t){return"EAGER"===t.instantiationMode}exports.Provider=r;var a=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 r(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}();exports.ComponentContainer=a;
|
|
468
|
+
},{"tslib":"f2sD","@firebase/util":"KxmD"}],"TUpU":[function(require,module,exports) {
|
|
469
|
+
"use strict";function e(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var o=Array(e),n=0;for(t=0;t<r;t++)for(var l=arguments[t],i=0,s=l.length;i<s;i++,n++)o[n]=l[i];return o}var t;Object.defineProperty(exports,"__esModule",{value:!0}),exports.setLogLevel=g,exports.setUserLogHandler=u,exports.Logger=exports.LogLevel=void 0;var r,o=[];exports.LogLevel=r,function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(r||(exports.LogLevel=r={}));var n={debug:r.DEBUG,verbose:r.VERBOSE,info:r.INFO,warn:r.WARN,error:r.ERROR,silent:r.SILENT},l=r.INFO,i=((t={})[r.DEBUG]="log",t[r.VERBOSE]="log",t[r.INFO]="info",t[r.WARN]="warn",t[r.ERROR]="error",t),s=function(t,r){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];if(!(r<t.logLevel)){var l=(new Date).toISOString(),s=i[r];if(!s)throw new Error("Attempted to log a message with an invalid logType (value: "+r+")");console[s].apply(console,e(["["+l+"] "+t.name+":"],o))}},a=function(){function t(e){this.name=e,this._logLevel=l,this._logHandler=s,this._userLogHandler=null,o.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in r))throw new TypeError('Invalid value "'+e+'" assigned to `logLevel`');this._logLevel=e},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?n[e]:e},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._userLogHandler&&this._userLogHandler.apply(this,e([this,r.DEBUG],t)),this._logHandler.apply(this,e([this,r.DEBUG],t))},t.prototype.log=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._userLogHandler&&this._userLogHandler.apply(this,e([this,r.VERBOSE],t)),this._logHandler.apply(this,e([this,r.VERBOSE],t))},t.prototype.info=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._userLogHandler&&this._userLogHandler.apply(this,e([this,r.INFO],t)),this._logHandler.apply(this,e([this,r.INFO],t))},t.prototype.warn=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._userLogHandler&&this._userLogHandler.apply(this,e([this,r.WARN],t)),this._logHandler.apply(this,e([this,r.WARN],t))},t.prototype.error=function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];this._userLogHandler&&this._userLogHandler.apply(this,e([this,r.ERROR],t)),this._logHandler.apply(this,e([this,r.ERROR],t))},t}();function g(e){o.forEach(function(t){t.setLogLevel(e)})}function u(e,t){for(var l=function(o){var l=null;t&&t.level&&(l=n[t.level]),o.userLogHandler=null===e?null:function(t,o){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var s=n.map(function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(t){return null}}).filter(function(e){return e}).join(" ");o>=(null!=l?l:t.logLevel)&&e({level:r[o].toLowerCase(),message:s,args:n,type:t.name})}},i=0,s=o;i<s.length;i++){l(s[i])}}exports.Logger=a;
|
|
470
|
+
},{}],"VxYX":[function(require,module,exports) {
|
|
471
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.firebase=exports.default=void 0;var e,n,t=require("tslib"),r=require("@firebase/util"),i=require("@firebase/component"),a=require("@firebase/logger"),o=((e={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",e["bad-app-name"]="Illegal App name: '{$appName}",e["duplicate-app"]="Firebase App named '{$appName}' already exists",e["app-deleted"]="Firebase App named '{$appName}' already deleted",e["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",e["invalid-log-argument"]="First argument to `onLog` must be null or a function.",e),s=new r.ErrorFactory("app","Firebase",o),p="@firebase/app",c="0.6.30",l="@firebase/analytics",u="@firebase/app-check",f="@firebase/auth",d="@firebase/database",m="@firebase/functions",b="@firebase/installations",h="@firebase/messaging",g="@firebase/performance",v="@firebase/remote-config",y="@firebase/storage",_="@firebase/firestore",w="firebase-wrapper",N="[DEFAULT]",C=((n={})[p]="fire-core",n[l]="fire-analytics",n[u]="fire-app-check",n[f]="fire-auth",n[d]="fire-rtdb",n[m]="fire-fn",n[b]="fire-iid",n[h]="fire-fcm",n[g]="fire-perf",n[v]="fire-rc",n[y]="fire-gcs",n[_]="fire-fst",n["fire-js"]="fire-js",n[w]="fire-js-all",n),E=new a.Logger("@firebase/app"),I=function(){function e(e,n,t){var a=this;this.firebase_=t,this.isDeleted_=!1,this.name_=n.name,this.automaticDataCollectionEnabled_=n.automaticDataCollectionEnabled||!1,this.options_=(0,r.deepCopy)(e),this.container=new i.ComponentContainer(n.name),this._addComponent(new i.Component("app",function(){return a},"PUBLIC")),this.firebase_.INTERNAL.components.forEach(function(e){return a._addComponent(e)})}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(n){e.checkDestroyed_(),n()}).then(function(){return e.firebase_.INTERNAL.removeApp(e.name_),Promise.all(e.container.getProviders().map(function(e){return e.delete()}))}).then(function(){e.isDeleted_=!0})},e.prototype._getService=function(e,n){var t;void 0===n&&(n=N),this.checkDestroyed_();var r=this.container.getProvider(e);return r.isInitialized()||"EXPLICIT"!==(null===(t=r.getComponent())||void 0===t?void 0:t.instantiationMode)||r.initialize(),r.getImmediate({identifier:n})},e.prototype._removeServiceInstance=function(e,n){void 0===n&&(n=N),this.container.getProvider(e).clearInstance(n)},e.prototype._addComponent=function(e){try{this.container.addComponent(e)}catch(n){E.debug("Component "+e.name+" failed to register with FirebaseApp "+this.name,n)}},e.prototype._addOrOverwriteComponent=function(e){this.container.addOrOverwriteComponent(e)},e.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},e.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw s.create("app-deleted",{appName:this.name_})},e}();I.prototype.name&&I.prototype.options||I.prototype.delete||console.log("dc");var A="8.10.0";function P(e){var n={},t=new Map,o={__esModule:!0,initializeApp:function(t,i){void 0===i&&(i={});if("object"!=typeof i||null===i){var a=i;i={name:a}}var p=i;void 0===p.name&&(p.name=N);var c=p.name;if("string"!=typeof c||!c)throw s.create("bad-app-name",{appName:String(c)});if((0,r.contains)(n,c))throw s.create("duplicate-app",{appName:c});var l=new e(t,p,o);return n[c]=l,l},app:p,registerVersion:function(e,n,t){var r,a=null!==(r=C[e])&&void 0!==r?r:e;t&&(a+="-"+t);var o=a.match(/\s|\//),s=n.match(/\s|\//);if(o||s){var p=['Unable to register library "'+a+'" with version "'+n+'":'];return o&&p.push('library name "'+a+'" contains illegal characters (whitespace or "/")'),o&&s&&p.push("and"),s&&p.push('version name "'+n+'" contains illegal characters (whitespace or "/")'),void E.warn(p.join(" "))}c(new i.Component(a+"-version",function(){return{library:a,version:n}},"VERSION"))},setLogLevel:a.setLogLevel,onLog:function(e,n){if(null!==e&&"function"!=typeof e)throw s.create("invalid-log-argument");(0,a.setUserLogHandler)(e,n)},apps:null,SDK_VERSION:A,INTERNAL:{registerComponent:c,removeApp:function(e){delete n[e]},components:t,useAsService:function(e,n){if("serverAuth"===n)return null;return n}}};function p(e){if(e=e||N,!(0,r.contains)(n,e))throw s.create("no-app",{appName:e});return n[e]}function c(i){var a=i.name;if(t.has(a))return E.debug("There were multiple attempts to register component "+a+"."),"PUBLIC"===i.type?o[a]:null;if(t.set(a,i),"PUBLIC"===i.type){var c=function(e){if(void 0===e&&(e=p()),"function"!=typeof e[a])throw s.create("invalid-app-argument",{appName:a});return e[a]()};void 0!==i.serviceProps&&(0,r.deepExtend)(c,i.serviceProps),o[a]=c,e.prototype[a]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this._getService.bind(this,a).apply(this,i.multipleInstances?e:[])}}for(var l=0,u=Object.keys(n);l<u.length;l++){var f=u[l];n[f]._addComponent(i)}return"PUBLIC"===i.type?o[a]:null}return o.default=o,Object.defineProperty(o,"apps",{get:function(){return Object.keys(n).map(function(e){return n[e]})}}),p.App=e,o}function F(){var e=P(I);return e.INTERNAL=(0,t.__assign)((0,t.__assign)({},e.INTERNAL),{createFirebaseNamespace:F,extendNamespace:function(n){(0,r.deepExtend)(e,n)},createSubscribe:r.createSubscribe,ErrorFactory:r.ErrorFactory,deepExtend:r.deepExtend}),e}var L=F(),D=function(){function e(e){this.container=e}return e.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(e){if(k(e)){var n=e.getImmediate();return n.library+"/"+n.version}return null}).filter(function(e){return e}).join(" ")},e}();function k(e){var n=e.getComponent();return"VERSION"===(null==n?void 0:n.type)}function O(e,n){e.INTERNAL.registerComponent(new i.Component("platform-logger",function(e){return new D(e)},"PRIVATE")),e.registerVersion(p,c,n),e.registerVersion("fire-js","")}if((0,r.isBrowser)()&&void 0!==self.firebase){E.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var j=self.firebase.SDK_VERSION;j&&j.indexOf("LITE")>=0&&E.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 S=L.initializeApp;L.initializeApp=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,r.isNode)()&&E.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 '),S.apply(void 0,e)};var x=L;exports.firebase=x,O(x);var R=x;exports.default=R;
|
|
472
|
+
},{"tslib":"f2sD","@firebase/util":"KxmD","@firebase/component":"sLOu","@firebase/logger":"TUpU"}],"OJEJ":[function(require,module,exports) {
|
|
473
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.default}});var e=r(require("@firebase/app"));function r(e){return e&&e.__esModule?e:{default:e}}var t="firebase",u="8.10.0";e.default.registerVersion(t,u,"app"),e.default.SDK_VERSION=u;
|
|
474
|
+
},{"@firebase/app":"VxYX"}],"EMWj":[function(require,module,exports) {
|
|
475
|
+
var process = require("process");
|
|
476
|
+
var e=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.registerDatabase=nl,exports.enableLogging=exports.ServerValue=exports.Reference=exports.Query=exports.OnDisconnect=exports.Database=exports.DataSnapshot=void 0;var t=a(require("@firebase/app")),n=require("@firebase/component"),r=require("@firebase/util"),i=require("tslib"),o=require("@firebase/logger");function a(e){return e&&e.__esModule?e:{default:e}}var s="@firebase/database",u="0.11.0",l="";function c(e){l=e}var h=function(){function e(e){this.domStorage_=e,this.prefix_="firebase:"}return e.prototype.set=function(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),(0,r.stringify)(t))},e.prototype.get=function(e){var t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:(0,r.jsonEval)(t)},e.prototype.remove=function(e){this.domStorage_.removeItem(this.prefixedName_(e))},e.prototype.prefixedName_=function(e){return this.prefix_+e},e.prototype.toString=function(){return this.domStorage_.toString()},e}(),d=function(){function e(){this.cache_={},this.isInMemoryStorage=!0}return e.prototype.set=function(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t},e.prototype.get=function(e){return(0,r.contains)(this.cache_,e)?this.cache_[e]:null},e.prototype.remove=function(e){delete this.cache_[e]},e}(),p=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){var t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new h(t)}}catch(n){}return new d},f=p("localStorage"),_=p("sessionStorage"),v=new o.Logger("@firebase/database"),y=function(){var e=1;return function(){return e++}}(),g=function(e){var t=(0,r.stringToByteArray)(e),n=new r.Sha1;n.update(t);var i=n.digest();return r.base64.encodeByteArray(i)},m=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n="",i=0;i<e.length;i++){var o=e[i];Array.isArray(o)||o&&"object"==typeof o&&"number"==typeof o.length?n+=m.apply(null,o):n+="object"==typeof o?(0,r.stringify)(o):o,n+=" "}return n},C=null,w=!0,b=function(e,t){(0,r.assert)(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?(v.logLevel=o.LogLevel.VERBOSE,C=v.log.bind(v),t&&_.set("logging_enabled",!0)):"function"==typeof e?C=e:(C=null,_.remove("logging_enabled"))};exports.enableLogging=b;var T=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!0===w&&(w=!1,null===C&&!0===_.get("logging_enabled")&&b(!0)),C){var n=m.apply(null,e);C(n)}},k=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];T.apply(void 0,(0,i.__spreadArray)([e],(0,i.__read)(t)))}},I=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE INTERNAL ERROR: "+m.apply(void 0,(0,i.__spreadArray)([],(0,i.__read)(e)));v.error(n)},E=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE FATAL ERROR: "+m.apply(void 0,(0,i.__spreadArray)([],(0,i.__read)(e)));throw v.error(n),new Error(n)},S=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE WARNING: "+m.apply(void 0,(0,i.__spreadArray)([],(0,i.__read)(e)));v.warn(n)},P=function(){"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&S("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},x=function(e){return"number"==typeof e&&(e!=e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},N=function(e){if((0,r.isNodeSdk)()||"complete"===document.readyState)e();else{var t=!1,n=function(){document.body?t||(t=!0,e()):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))}},R="[MIN_NAME]",A="[MAX_NAME]",D=function(e,t){if(e===t)return 0;if(e===R||t===A)return-1;if(t===R||e===A)return 1;var n=z(e),r=z(t);return null!==n?null!==r?n-r==0?e.length-t.length:n-r:-1:null!==r?1:e<t?-1:1},O=function(e,t){return e===t?0:e<t?-1:1},M=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+(0,r.stringify)(t))},q=function(e){if("object"!=typeof e||null===e)return(0,r.stringify)(e);var t=[];for(var n in e)t.push(n);t.sort();for(var i="{",o=0;o<t.length;o++)0!==o&&(i+=","),i+=(0,r.stringify)(t[o]),i+=":",i+=q(e[t[o]]);return i+="}"},F=function(e,t){var n=e.length;if(n<=t)return[e];for(var r=[],i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r};function L(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])}var W=function(e){(0,r.assert)(!x(e),"Invalid JSON number");var t,n,i,o,a;0===e?(n=0,i=0,t=1/e==-1/0?1:0):(t=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(n=(o=Math.min(Math.floor(Math.log(e)/Math.LN2),1023))+1023,i=Math.round(e*Math.pow(2,52-o)-Math.pow(2,52))):(n=0,i=Math.round(e/Math.pow(2,-1074))));var s=[];for(a=52;a;a-=1)s.push(i%2?1:0),i=Math.floor(i/2);for(a=11;a;a-=1)s.push(n%2?1:0),n=Math.floor(n/2);s.push(t?1:0),s.reverse();var u=s.join(""),l="";for(a=0;a<64;a+=8){var c=parseInt(u.substr(a,8),2).toString(16);1===c.length&&(c="0"+c),l+=c}return l.toLowerCase()},j=function(){return!("object"!=typeof window||!window.chrome||!window.chrome.extension||/^chrome/.test(window.location.href))},U=function(){return"object"==typeof Windows&&"object"==typeof Windows.UI};function B(e,t){var n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===e?n="Client doesn't have permission to access the desired data.":"unavailable"===e&&(n="The service is unavailable");var r=new Error(e+" at "+t._path.toString()+": "+n);return r.code=e.toUpperCase(),r}var V=new RegExp("^-?(0*)\\d{1,10}$"),Q=-2147483648,H=2147483647,z=function(e){if(V.test(e)){var t=Number(e);if(t>=Q&&t<=H)return t}return null},Y=function(e){try{e()}catch(t){setTimeout(function(){var e=t.stack||"";throw S("Exception was thrown by user callback.",e),t},Math.floor(0))}},K=function(){return("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},G=function(e,t){var n=setTimeout(e,t);return"object"==typeof n&&n.unref&&n.unref(),n},$=function(){function e(e,t){var n=this;this.appName_=e,this.appCheckProvider=t,this.appCheck=null==t?void 0:t.getImmediate({optional:!0}),this.appCheck||null==t||t.get().then(function(e){return n.appCheck=e})}return e.prototype.getToken=function(e){var t=this;return this.appCheck?this.appCheck.getToken(e):new Promise(function(n,r){setTimeout(function(){t.appCheck?t.getToken(e).then(n,r):n(null)},0)})},e.prototype.addTokenChangeListener=function(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then(function(t){return t.addTokenListener(e)})},e.prototype.notifyForInvalidToken=function(){S('Provided AppCheck credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly.')},e}(),J=function(){function e(e,t,n){var r=this;this.appName_=e,this.firebaseOptions_=t,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit(function(e){return r.auth_=e})}return e.prototype.getToken=function(e){var t=this;return this.auth_?this.auth_.getToken(e).catch(function(e){return e&&"auth/token-not-initialized"===e.code?(T("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)}):new Promise(function(n,r){setTimeout(function(){t.auth_?t.getToken(e).then(n,r):n(null)},0)})},e.prototype.addTokenChangeListener=function(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(function(t){return t.addAuthTokenListener(e)})},e.prototype.removeTokenChangeListener=function(e){this.authProvider_.get().then(function(t){return t.removeAuthTokenListener(e)})},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',S(e)},e}(),X=function(){function e(e){this.accessToken=e}return e.prototype.getToken=function(e){return Promise.resolve({accessToken:this.accessToken})},e.prototype.addTokenChangeListener=function(e){e(this.accessToken)},e.prototype.removeTokenChangeListener=function(e){},e.prototype.notifyForInvalidToken=function(){},e.OWNER="owner",e}(),Z="5",ee="v",te="s",ne="r",re="f",ie=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,oe="ls",ae="p",se="ac",ue="websocket",le="long_polling",ce=function(){function e(e,t,n,r,i,o,a){void 0===i&&(i=!1),void 0===o&&(o=""),void 0===a&&(a=!1),this.secure=t,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=f.get("host:"+e)||this._host}return e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain},Object.defineProperty(e.prototype,"host",{get:function(){return this._host},set:function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&f.set("host:"+this._host,this.internalHost))},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){var e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return""+e+this.host+"/"+t},e}();function he(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams}function de(e,t,n){var i;if((0,r.assert)("string"==typeof t,"typeof type must == string"),(0,r.assert)("object"==typeof n,"typeof params must == object"),t===ue)i=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else{if(t!==le)throw new Error("Unknown connection type: "+t);i=(e.secure?"https://":"http://")+e.internalHost+"/.lp?"}he(e)&&(n.ns=e.namespace);var o=[];return L(n,function(e,t){o.push(e+"="+t)}),i+o.join("&")}var pe=function(){function e(){this.counters_={}}return e.prototype.incrementCounter=function(e,t){void 0===t&&(t=1),(0,r.contains)(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t},e.prototype.get=function(){return(0,r.deepCopy)(this.counters_)},e}(),fe={},_e={};function ve(e){var t=e.toString();return fe[t]||(fe[t]=new pe),fe[t]}function ye(e,t){var n=e.toString();return _e[n]||(_e[n]=t()),_e[n]}var ge=function(){function e(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return e.prototype.closeAfter=function(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},e.prototype.handleResponse=function(e,t){var n=this;this.pendingResponses[e]=t;for(var r=function(){var e=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var t=function(t){e[t]&&Y(function(){n.onMessage_(e[t])})},r=0;r<e.length;++r)t(r);if(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}},e}(),me="start",Ce="close",we="pLPCommand",be="pRTLPCB",Te="id",ke="pw",Ie="ser",Ee="cb",Se="seg",Pe="ts",xe="d",Ne="dframe",Re=1870,Ae=30,De=Re-Ae,Oe=25e3,Me=3e4,qe=function(){function e(e,t,n,r,i,o,a){var s=this;this.connId=e,this.repoInfo=t,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.transportSessionId=o,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=k(e),this.stats_=ve(t),this.urlFn=function(e){return s.appCheckToken&&(e[se]=s.appCheckToken),de(t,le,e)}}return e.prototype.open=function(e,t){var n=this;this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new ge(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null},Math.floor(Me)),N(function(){if(!n.isClosed_){n.scriptTagHolder=new Fe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,i.__read)(e,5),o=r[0],a=r[1],s=r[2];if(r[3],r[4],n.incrementIncomingBytes_(e),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,o===me)n.id=a,n.password=s;else{if(o!==Ce)throw new Error("Unrecognized command received: "+o);a?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(a,function(){n.onClosed_()})):n.onClosed_()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,i.__read)(e,2),o=r[0],a=r[1];n.incrementIncomingBytes_(e),n.myPacketOrderer.handleResponse(o,a)},function(){n.onClosed_()},n.urlFn);var e={};e[me]="t",e[Ie]=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(e[Ee]=n.scriptTagHolder.uniqueCallbackIdentifier),e[ee]=Z,n.transportSessionId&&(e[te]=n.transportSessionId),n.lastSessionId&&(e[oe]=n.lastSessionId),n.applicationId&&(e[ae]=n.applicationId),n.appCheckToken&&(e[se]=n.appCheckToken),"undefined"!=typeof location&&location.hostname&&ie.test(location.hostname)&&(e[ne]=re);var t=n.urlFn(e);n.log_("Connecting via long-poll to "+t),n.scriptTagHolder.addTag(t,function(){})}})},e.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},e.forceAllow=function(){e.forceAllow_=!0},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){return!(0,r.isNodeSdk)()&&(!!e.forceAllow_||!e.forceDisallow_&&"undefined"!=typeof document&&null!=document.createElement&&!j()&&!U())},e.prototype.markConnectionHealthy=function(){},e.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)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},e.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},e.prototype.send=function(e){var t=(0,r.stringify)(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);for(var n=(0,r.base64Encode)(t),i=F(n,De),o=0;o<i.length;o++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[o]),this.curSegmentNum++},e.prototype.addDisconnectPingFrame=function(e,t){if(!(0,r.isNodeSdk)()){this.myDisconnFrame=document.createElement("iframe");var n={};n[Ne]="t",n[Te]=e,n[ke]=t,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},e.prototype.incrementIncomingBytes_=function(e){var t=(0,r.stringify)(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)},e}(),Fe=function(){function e(t,n,i,o){if(this.onDisconnect=i,this.urlFn=o,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,(0,r.isNodeSdk)())this.commandCB=t,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=y(),window[we+this.uniqueCallbackIdentifier]=t,window[be+this.uniqueCallbackIdentifier]=n,this.myIFrame=e.createIFrame_();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){T("frame writing exception"),u.stack&&T(u.stack),T(u)}}}return e.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||T("No IE domain setting required")}catch(n){var t=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+t+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},e.prototype.close=function(){var e=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},Math.floor(0)));var t=this.onDisconnect;t&&(this.onDisconnect=null,t())},e.prototype.startLongPoll=function(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););},e.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e[Te]=this.myID,e[ke]=this.myPW,e[Ie]=this.currentSerial;for(var t=this.urlFn(e),n="",r=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+Ae+n.length<=Re))break;var i=this.pendingSegs.shift();n=n+"&"+Se+r+"="+i.seg+"&"+Pe+r+"="+i.ts+"&"+xe+r+"="+i.d,r++}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1},e.prototype.enqueueSegment=function(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()},e.prototype.addLongPollTag_=function(e,t){var n=this;this.outstandingRequests.add(t);var r=function(){n.outstandingRequests.delete(t),n.newRequest_()},i=setTimeout(r,Math.floor(Oe));this.addTag(e,function(){clearTimeout(i),r()})},e.prototype.addTag=function(e,t){var n=this;(0,r.isNodeSdk)()?this.doNodeLongPoll(e,t):setTimeout(function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){var e=r.readyState;e&&"loaded"!==e&&"complete"!==e||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),t())},r.onerror=function(){T("Long-poll script failed to load: "+e),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}},Math.floor(1))},e}(),Le=16384,We=45e3,je=null;"undefined"!=typeof MozWebSocket?je=MozWebSocket:"undefined"!=typeof WebSocket&&(je=WebSocket);var Ue=function(){function t(e,n,r,i,o,a,s){this.connId=e,this.applicationId=r,this.appCheckToken=i,this.authToken=o,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=k(this.connId),this.stats_=ve(n),this.connURL=t.connectionURL_(n,a,s,i),this.nodeAdmin=n.nodeAdmin}return t.connectionURL_=function(e,t,n,i){var o={};return o[ee]=Z,!(0,r.isNodeSdk)()&&"undefined"!=typeof location&&location.hostname&&ie.test(location.hostname)&&(o[ne]=re),t&&(o[te]=t),n&&(o[oe]=n),i&&(o[se]=i),de(e,ue,o)},t.prototype.open=function(t,n){var i=this;this.onDisconnect=n,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,f.set("previous_websocket_failure",!0);try{if((0,r.isNodeSdk)()){var o=this.nodeAdmin?"AdminNode":"Node",a={headers:{"User-Agent":"Firebase/"+Z+"/"+l+"/"+e.platform+"/"+o,"X-Firebase-GMPID":this.applicationId||""}};this.authToken&&(a.headers.Authorization="Bearer "+this.authToken),this.appCheckToken&&(a.headers["X-Firebase-AppCheck"]=this.appCheckToken);var s=e.env,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 je(this.connURL,[],a)}else{a={headers:{"X-Firebase-GMPID":this.applicationId||"","X-Firebase-AppCheck":this.appCheckToken||""}};this.mySock=new je(this.connURL,[],a)}}catch(h){this.log_("Error instantiating WebSocket.");var c=h.message||h.data;return c&&this.log_(c),void this.onClosed_()}this.mySock.onopen=function(){i.log_("Websocket connected."),i.everConnected_=!0},this.mySock.onclose=function(){i.log_("Websocket connection was disconnected."),i.mySock=null,i.onClosed_()},this.mySock.onmessage=function(e){i.handleIncomingFrame(e)},this.mySock.onerror=function(e){i.log_("WebSocket error. Closing connection.");var t=e.message||e.data;t&&i.log_(t),i.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!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&&(e=!0)}return!e&&null!==je&&!t.forceDisallow_},t.previouslyFailed=function(){return f.isInMemoryStorage||!0===f.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){f.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length===this.totalFrames){var t=this.frames.join("");this.frames=null;var n=(0,r.jsonEval)(t);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},t.prototype.extractFrameCount_=function(e){if((0,r.assert)(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},t.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var n=this.extractFrameCount_(t);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(e){this.resetKeepAlive();var t=(0,r.stringify)(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var n=F(t,Le);n.length>1&&this.sendString_(String(n.length));for(var i=0;i<n.length;i++)this.sendString_(n[i])},t.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},t.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},t.prototype.resetKeepAlive=function(){var e=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(function(){e.mySock&&e.sendString_("0"),e.resetKeepAlive()},Math.floor(We))},t.prototype.sendString_=function(e){try{this.mySock.send(e)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}(),Be=function(){function e(e){this.initTransports_(e)}return Object.defineProperty(e,"ALL_TRANSPORTS",{get:function(){return[qe,Ue]},enumerable:!1,configurable:!0}),e.prototype.initTransports_=function(t){var n,r,o=Ue&&Ue.isAvailable(),a=o&&!Ue.previouslyFailed();if(t.webSocketOnly&&(o||S("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),a=!0),a)this.transports_=[Ue];else{var s=this.transports_=[];try{for(var u=(0,i.__values)(e.ALL_TRANSPORTS),l=u.next();!l.done;l=u.next()){var c=l.value;c&&c.isAvailable()&&s.push(c)}}catch(h){n={error:h}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},e.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}(),Ve=6e4,Qe=5e3,He=10240,ze=102400,Ye="t",Ke="d",Ge="s",$e="r",Je="e",Xe="o",Ze="a",et="n",tt="p",nt="h",rt=function(){function e(e,t,n,r,i,o,a,s,u,l){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.appCheckToken_=r,this.authToken_=i,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=s,this.onKill_=u,this.lastSessionId=l,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=k("c:"+this.id+":"),this.transportManager_=new Be(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=t.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(){e.conn_&&e.conn_.open(n,r)},Math.floor(0));var i=t.healthyTimeout||0;i>0&&(this.healthyTimeout_=G(function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>ze?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>He?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))},Math.floor(i)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(n){e===t.conn_?t.onConnectionLost_(n):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(n){2!==t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(n):e===t.secondaryConn_?t.onSecondaryMessageReceived_(n):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.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)},e.prototype.onSecondaryControl_=function(e){if(Ye in e){var t=e[Ye];t===Ze?this.upgradeIfSecondaryHealthy_():t===$e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):t===Xe&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=M("t",e),n=M("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.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:tt,d:{}}}))},e.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:Ze,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:et,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},e.prototype.onPrimaryMessageReceived_=function(e){var t=M("t",e),n=M("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},e.prototype.onControl_=function(e){var t=M(Ye,e);if(Ke in e){var n=e[Ke];if(t===nt)this.onHandshake_(n);else if(t===et){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 t===Ge?this.onConnectionShutdown_(n):t===$e?this.onReset_(n):t===Je?I("Server Error: "+n):t===Xe?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):I("Unknown control packet command: "+t)}},e.prototype.onHandshake_=function(e){var t=e.ts,n=e.v,r=e.h;this.sessionId=e.s,this.repoInfo_.host=r,0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),Z!==n&&S("Protocol version mismatch detected"),this.tryStartUpgrade_())},e.prototype.tryStartUpgrade_=function(){var e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)},e.prototype.startUpgrade_=function(e){var t=this;this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),G(function(){t.secondaryConn_&&(t.log_("Timed out trying to upgrade."),t.secondaryConn_.close())},Math.floor(Ve))},e.prototype.onReset_=function(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,1===this.state_?this.close():(this.closeConnections_(),this.start_())},e.prototype.onConnectionEstablished_=function(e,t){var n=this;this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):G(function(){n.sendPingOnPrimaryIfNecessary_()},Math.floor(Qe))},e.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:tt,d:{}}}))},e.prototype.onSecondaryConnectionLost_=function(){var e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()},e.prototype.onConnectionLost_=function(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(f.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},e.prototype.onConnectionShutdown_=function(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()},e.prototype.sendData_=function(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)},e.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},e.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)},e}(),it=function(){function e(){}return e.prototype.put=function(e,t,n,r){},e.prototype.merge=function(e,t,n,r){},e.prototype.refreshAuthToken=function(e){},e.prototype.refreshAppCheckToken=function(e){},e.prototype.onDisconnectPut=function(e,t,n){},e.prototype.onDisconnectMerge=function(e,t,n){},e.prototype.onDisconnectCancel=function(e,t){},e.prototype.reportStats=function(e){},e}(),ot=function(){function e(e){this.allowedEvents_=e,this.listeners_={},(0,r.assert)(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}return e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Array.isArray(this.listeners_[e]))for(var r=(0,i.__spreadArray)([],(0,i.__read)(this.listeners_[e])),o=0;o<r.length;o++)r[o].callback.apply(r[o].context,t)},e.prototype.on=function(e,t,n){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:n});var r=this.getInitialEvent(e);r&&t.apply(n,r)},e.prototype.off=function(e,t,n){this.validateEventType_(e);for(var r=this.listeners_[e]||[],i=0;i<r.length;i++)if(r[i].callback===t&&(!n||n===r[i].context))return void r.splice(i,1)},e.prototype.validateEventType_=function(e){(0,r.assert)(this.allowedEvents_.find(function(t){return t===e}),"Unknown event: "+e)},e}(),at=function(e){function t(){var t=e.call(this,["online"])||this;return t.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||(0,r.isMobileCordova)()||(window.addEventListener("online",function(){t.online_||(t.online_=!0,t.trigger("online",!0))},!1),window.addEventListener("offline",function(){t.online_&&(t.online_=!1,t.trigger("online",!1))},!1)),t}return(0,i.__extends)(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return(0,r.assert)("online"===e,"Unknown event type: "+e),[this.online_]},t.prototype.currentlyOnline=function(){return this.online_},t}(ot),st=32,ut=768,lt=function(){function e(e,t){if(void 0===t){this.pieces_=e.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_=e,this.pieceNum_=t}return e.prototype.toString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"},e}();function ct(){return new lt("")}function ht(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function dt(e){return e.pieces_.length-e.pieceNum_}function pt(e){var t=e.pieceNum_;return t<e.pieces_.length&&t++,new lt(e.pieces_,t)}function ft(e){return e.pieceNum_<e.pieces_.length?e.pieces_[e.pieces_.length-1]:null}function _t(e){for(var t="",n=e.pieceNum_;n<e.pieces_.length;n++)""!==e.pieces_[n]&&(t+="/"+encodeURIComponent(String(e.pieces_[n])));return t||"/"}function vt(e,t){return void 0===t&&(t=0),e.pieces_.slice(e.pieceNum_+t)}function yt(e){if(e.pieceNum_>=e.pieces_.length)return null;for(var t=[],n=e.pieceNum_;n<e.pieces_.length-1;n++)t.push(e.pieces_[n]);return new lt(t,0)}function gt(e,t){for(var n=[],r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);if(t instanceof lt)for(r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);else{var i=t.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new lt(n,0)}function mt(e){return e.pieceNum_>=e.pieces_.length}function Ct(e,t){var n=ht(e),r=ht(t);if(null===n)return t;if(n===r)return Ct(pt(e),pt(t));throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function wt(e,t){for(var n=vt(e,0),r=vt(t,0),i=0;i<n.length&&i<r.length;i++){var o=D(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1}function bt(e,t){if(dt(e)!==dt(t))return!1;for(var n=e.pieceNum_,r=t.pieceNum_;n<=e.pieces_.length;n++,r++)if(e.pieces_[n]!==t.pieces_[r])return!1;return!0}function Tt(e,t){var n=e.pieceNum_,r=t.pieceNum_;if(dt(e)>dt(t))return!1;for(;n<e.pieces_.length;){if(e.pieces_[n]!==t.pieces_[r])return!1;++n,++r}return!0}var kt=function(){return function(e,t){this.errorPrefix_=t,this.parts_=vt(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=(0,r.stringLength)(this.parts_[n]);St(this)}}();function It(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=(0,r.stringLength)(t),St(e)}function Et(e){var t=e.parts_.pop();e.byteLength_-=(0,r.stringLength)(t),e.parts_.length>0&&(e.byteLength_-=1)}function St(e){if(e.byteLength_>ut)throw new Error(e.errorPrefix_+"has a key path longer than "+ut+" bytes ("+e.byteLength_+").");if(e.parts_.length>st)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+st+") or object contains a cycle "+Pt(e))}function Pt(e){return 0===e.parts_.length?"":"in property '"+e.parts_.join(".")+"'"}var xt,Nt,Rt=function(e){function t(){var t,n,r=e.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",t="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",t="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",t="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",t="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,function(){var e=!document[t];e!==r.visible_&&(r.visible_=e,r.trigger("visible",e))},!1),r}return(0,i.__extends)(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return(0,r.assert)("visible"===e,"Unknown event type: "+e),[this.visible_]},t}(ot),At=1e3,Dt=3e5,Ot=3e3,Mt=3e4,qt=1.3,Ft=3e4,Lt="server_kill",Wt=3,jt=function(e){function t(n,i,o,a,s,u,l,c){var h=e.call(this)||this;if(h.repoInfo_=n,h.applicationId_=i,h.onDataUpdate_=o,h.onConnectStatus_=a,h.onServerInfoUpdate_=s,h.authTokenProvider_=u,h.appCheckTokenProvider_=l,h.authOverride_=c,h.id=t.nextPersistentConnectionId_++,h.log_=k("p:"+h.id+":"),h.interruptReasons_={},h.listens=new Map,h.outstandingPuts_=[],h.outstandingGets_=[],h.outstandingPutCount_=0,h.outstandingGetCount_=0,h.onDisconnectRequestQueue_=[],h.connected_=!1,h.reconnectDelay_=At,h.maxReconnectDelay_=Dt,h.securityDebugCallback_=null,h.lastSessionId=null,h.establishConnectionTimer_=null,h.visible_=!1,h.requestCBHash_={},h.requestNumber_=0,h.realtime_=null,h.authToken_=null,h.appCheckToken_=null,h.forceTokenRefresh_=!1,h.invalidAuthTokenCount_=0,h.invalidAppCheckTokenCount_=0,h.firstConnection_=!0,h.lastConnectionAttemptTime_=null,h.lastConnectionEstablishedTime_=null,c&&!(0,r.isNodeSdk)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return Rt.getInstance().on("visible",h.onVisible_,h),-1===n.host.indexOf("fblocal")&&at.getInstance().on("online",h.onOnline_,h),h}return(0,i.__extends)(t,e),t.prototype.sendRequest=function(e,t,n){var i=++this.requestNumber_,o={r:i,a:e,b:t};this.log_((0,r.stringify)(o)),(0,r.assert)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(o),n&&(this.requestCBHash_[i]=n)},t.prototype.get=function(e){var t=this;this.initConnection_();var n=new r.Deferred,i={p:e._path.toString(),q:e._queryObject},o={action:"g",request:i,onComplete:function(e){var r=e.d;"ok"===e.s?(t.onDataUpdate_(i.p,r,!1,null),n.resolve(r)):n.reject(r)}};this.outstandingGets_.push(o),this.outstandingGetCount_++;var a=this.outstandingGets_.length-1;return this.connected_||setTimeout(function(){var e=t.outstandingGets_[a];void 0!==e&&o===e&&(delete t.outstandingGets_[a],t.outstandingGetCount_--,0===t.outstandingGetCount_&&(t.outstandingGets_=[]),t.log_("get "+a+" timed out on connection"),n.reject(new Error("Client is offline.")))},Ot),this.connected_&&this.sendGet_(a),n.promise},t.prototype.listen=function(e,t,n,i){this.initConnection_();var o=e._queryIdentifier,a=e._path.toString();this.log_("Listen called for "+a+" "+o),this.listens.has(a)||this.listens.set(a,new Map),(0,r.assert)(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),(0,r.assert)(!this.listens.get(a).has(o),"listen() called twice for same path/queryId.");var s={onComplete:i,hashFn:t,query:e,tag:n};this.listens.get(a).set(o,s),this.connected_&&this.sendListen_(s)},t.prototype.sendGet_=function(e){var t=this,n=this.outstandingGets_[e];this.sendRequest("g",n.request,function(r){delete t.outstandingGets_[e],t.outstandingGetCount_--,0===t.outstandingGetCount_&&(t.outstandingGets_=[]),n.onComplete&&n.onComplete(r)})},t.prototype.sendListen_=function(e){var n=this,r=e.query,i=r._path.toString(),o=r._queryIdentifier;this.log_("Listen on "+i+" for "+o);var a={p:i};e.tag&&(a.q=r._queryObject,a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,function(a){var s=a.d,u=a.s;t.warnOnListenWarnings_(s,r),(n.listens.get(i)&&n.listens.get(i).get(o))===e&&(n.log_("listen response",a),"ok"!==u&&n.removeListen_(i,o),e.onComplete&&e.onComplete(u,s))})},t.warnOnListenWarnings_=function(e,t){if(e&&"object"==typeof e&&(0,r.contains)(e,"w")){var n=(0,r.safeGet)(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var i='".indexOn": "'+t._queryParams.getIndex().toString()+'"',o=t._path.toString();S("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+i+" at "+o+" to your security rules for better performance.")}}},t.prototype.refreshAuthToken=function(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},function(){}),this.reduceReconnectDelayIfAdminCredential_(e)},t.prototype.reduceReconnectDelayIfAdminCredential_=function(e){(e&&40===e.length||(0,r.isAdmin)(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=Mt)},t.prototype.refreshAppCheckToken=function(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},function(){})},t.prototype.tryAuth=function(){var e=this;if(this.connected_&&this.authToken_){var t=this.authToken_,n=(0,r.isValidFormat)(t)?"auth":"gauth",i={cred:t};null===this.authOverride_?i.noauth=!0:"object"==typeof this.authOverride_&&(i.authvar=this.authOverride_),this.sendRequest(n,i,function(n){var r=n.s,i=n.d||"error";e.authToken_===t&&("ok"===r?e.invalidAuthTokenCount_=0:e.onAuthRevoked_(r,i))})}},t.prototype.tryAppCheck=function(){var e=this;this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},function(t){var n=t.s,r=t.d||"error";"ok"===n?e.invalidAppCheckTokenCount_=0:e.onAppCheckRevoked_(n,r)})},t.prototype.unlisten=function(e,t){var n=e._path.toString(),i=e._queryIdentifier;this.log_("Unlisten called for "+n+" "+i),(0,r.assert)(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,i)&&this.connected_&&this.sendUnlisten_(n,i,e._queryObject,t)},t.prototype.sendUnlisten_=function(e,t,n,r){this.log_("Unlisten on "+e+" for "+t);var i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},t.prototype.onDisconnectPut=function(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})},t.prototype.onDisconnectMerge=function(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})},t.prototype.onDisconnectCancel=function(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.sendOnDisconnect_=function(e,t,n,r){var i={p:t,d:n};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,function(e){r&&setTimeout(function(){r(e.s,e.d)},Math.floor(0))})},t.prototype.put=function(e,t,n,r){this.putInternal("p",e,t,n,r)},t.prototype.merge=function(e,t,n,r){this.putInternal("m",e,t,n,r)},t.prototype.putInternal=function(e,t,n,r,i){this.initConnection_();var o={p:t,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)},t.prototype.sendPut_=function(e){var t=this,n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,function(r){t.log_(n+" response",r),delete t.outstandingPuts_[e],t.outstandingPutCount_--,0===t.outstandingPutCount_&&(t.outstandingPuts_=[]),i&&i(r.s,r.d)})},t.prototype.reportStats=function(e){var t=this;if(this.connected_){var n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,function(e){if("ok"!==e.s){var n=e.d;t.log_("reportStats","Error sending stats: "+n)}})}},t.prototype.onDataMessage_=function(e){if("r"in e){this.log_("from server: "+(0,r.stringify)(e));var t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}},t.prototype.onDataPush_=function(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):I("Unrecognized action received from server: "+(0,r.stringify)(e)+"\nAre you using the latest client?")},t.prototype.onReady_=function(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},t.prototype.scheduleConnect_=function(e){var t=this;(0,r.assert)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(function(){t.establishConnectionTimer_=null,t.establishConnection_()},Math.floor(e))},t.prototype.initConnection_=function(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)},t.prototype.onVisible_=function(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=At,this.realtime_||this.scheduleConnect_(0)),this.visible_=e},t.prototype.onOnline_=function(e){e?(this.log_("Browser went online."),this.reconnectDelay_=At,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},t.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_>Ft&&(this.reconnectDelay_=At),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var e=(new Date).getTime()-this.lastConnectionAttemptTime_,t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*qt)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){return(0,i.__awaiter)(this,void 0,void 0,function(){var e,n,o,a,s,u,l,c,h,d,p,f,_,v,y=this;return(0,i.__generator)(this,function(g){switch(g.label){case 0:if(!this.shouldReconnect_())return[3,4];this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null,e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),o=this.onRealtimeDisconnect_.bind(this),a=this.id+":"+t.nextConnectionId_++,s=this.lastSessionId,u=!1,l=null,c=function(){l?l.close():(u=!0,o())},h=function(e){(0,r.assert)(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(e)},this.realtime_={close:c,sendRequest:h},d=this.forceTokenRefresh_,this.forceTokenRefresh_=!1,g.label=1;case 1:return g.trys.push([1,3,,4]),[4,Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)])];case 2:return p=i.__read.apply(void 0,[g.sent(),2]),f=p[0],_=p[1],u?T("getToken() completed but was canceled"):(T("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=_&&_.token,l=new rt(a,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,n,o,function(e){S(e+" ("+y.repoInfo_.toString()+")"),y.interrupt(Lt)},s)),[3,4];case 3:return v=g.sent(),this.log_("Failed to get token: "+v),u||(this.repoInfo_.nodeAdmin&&S(v),c()),[3,4];case 4:return[2]}})})},t.prototype.interrupt=function(e){T("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){T("Resuming connection for reason: "+e),delete this.interruptReasons_[e],(0,r.isEmpty)(this.interruptReasons_)&&(this.reconnectDelay_=At,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e<this.outstandingPuts_.length;e++){var t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},t.prototype.onListenRevoked_=function(e,t){var n;n=t?t.map(function(e){return q(e)}).join("$"):"default";var r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete("permission_denied")},t.prototype.removeListen_=function(e,t){var n,r=new lt(e).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(t),i.delete(t),0===i.size&&this.listens.delete(r)}else n=void 0;return n},t.prototype.onAuthRevoked_=function(e,t){T("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=Wt&&(this.reconnectDelay_=Mt,this.authTokenProvider_.notifyForInvalidToken()))},t.prototype.onAppCheckRevoked_=function(e,t){T("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=Wt&&this.appCheckTokenProvider_.notifyForInvalidToken())},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e,t,n,r;this.tryAuth(),this.tryAppCheck();try{for(var o=(0,i.__values)(this.listens.values()),a=o.next();!a.done;a=o.next()){var s=a.value;try{for(var u=(n=void 0,(0,i.__values)(s.values())),l=u.next();!l.done;l=u.next()){var c=l.value;this.sendListen_(c)}}catch(p){n={error:p}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(f){e={error:f}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}for(var h=0;h<this.outstandingPuts_.length;h++)this.outstandingPuts_[h]&&this.sendPut_(h);for(;this.onDisconnectRequestQueue_.length;){var d=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(d.action,d.pathString,d.data,d.onComplete)}for(h=0;h<this.outstandingGets_.length;h++)this.outstandingGets_[h]&&this.sendGet_(h)},t.prototype.sendConnectStats_=function(){var e={},t="js";(0,r.isNodeSdk)()&&(t=this.repoInfo_.nodeAdmin?"admin_node":"node"),e["sdk."+t+"."+l.replace(/\./g,"-")]=1,(0,r.isMobileCordova)()?e["framework.cordova"]=1:(0,r.isReactNative)()&&(e["framework.reactnative"]=1),this.reportStats(e)},t.prototype.shouldReconnect_=function(){var e=at.getInstance().currentlyOnline();return(0,r.isEmpty)(this.interruptReasons_)&&e},t.nextPersistentConnectionId_=0,t.nextConnectionId_=0,t}(it),Ut=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}(),Bt=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new Ut(R,e),r=new Ut(R,t);return 0!==this.compare(n,r)},e.prototype.minPost=function(){return Ut.MIN},e}(),Vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return xt},set:function(e){xt=e},enumerable:!1,configurable:!0}),t.prototype.compare=function(e,t){return D(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw(0,r.assertionError)("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return Ut.MIN},t.prototype.maxPost=function(){return new Ut(A,xt)},t.prototype.makePost=function(e,t){return(0,r.assert)("string"==typeof e,"KeyIndex indexValue must always be a string."),new Ut(e,xt)},t.prototype.toString=function(){return".key"},t}(Bt),Qt=new Vt,Ht=function(){function e(e,t,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!e.isEmpty();)if(e=e,o=t?n(e.key,t):1,r&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}return e.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e},e.prototype.hasNext=function(){return this.nodeStack_.length>0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}(),zt=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:Kt.EMPTY_NODE,this.right=null!=o?o:Kt.EMPTY_NODE}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return Kt.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),(e=e.copy(null,null,null,e.left.removeMin_(),null)).fixUp_()},e.prototype.remove=function(e,t){var n,r;if(t(e,(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(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return Kt.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(e,t))}return n.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},e.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight_())).rotateLeft_()).colorFlip_()),e},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=(e=e.rotateRight_()).colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}(),Yt=function(){function e(){}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new zt(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}(),Kt=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.comparator_=t,this.root_=n}return e.prototype.insert=function(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,zt.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,zt.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.root_;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.root_,r=null;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new Ht(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new Ht(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new Ht(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new Ht(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new Yt,e}();function Gt(e,t){return D(e.name,t.name)}function $t(e,t){return D(e,t)}function Jt(e){Nt=e}var Xt,Zt,en,tn=function(e){return"number"==typeof e?"number:"+W(e):"string:"+e},nn=function(e){if(e.isLeafNode()){var t=e.val();(0,r.assert)("string"==typeof t||"number"==typeof t||"object"==typeof t&&(0,r.contains)(t,".sv"),"Priority must be a string or number.")}else(0,r.assert)(e===Nt||e.isEmpty(),"priority of unexpected type.");(0,r.assert)(e===Nt||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},rn=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=n,this.lazyHash_=null,(0,r.assert)(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),nn(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return Xt},set:function(e){Xt=e},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return mt(t)?this:".priority"===ht(t)?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,n){var i=ht(t);return null===i?n:n.isEmpty()&&".priority"!==i?this:((0,r.assert)(".priority"!==i||1===dt(t),".priority must be the last token in a path"),this.updateImmediateChild(i,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(pt(t),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+tn(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?W(this.value_):this.value_,this.lazyHash_=g(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:((0,r.assert)(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var n=typeof t.value_,i=typeof this.value_,o=e.VALUE_TYPE_ORDER.indexOf(n),a=e.VALUE_TYPE_ORDER.indexOf(i);return(0,r.assert)(o>=0,"Unknown leaf type: "+n),(0,r.assert)(a>=0,"Unknown leaf type: "+i),o===a?"object"===i?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:a-o},e.prototype.withIndex=function(){return this},e.prototype.isIndexed=function(){return!0},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode()){var t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1},e.VALUE_TYPE_ORDER=["object","boolean","number","string"],e}();function on(e){Zt=e}function an(e){en=e}var sn,un,ln=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype.compare=function(e,t){var n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return 0===i?D(e.name,t.name):i},t.prototype.isDefinedOn=function(e){return!e.getPriority().isEmpty()},t.prototype.indexedValueChanged=function(e,t){return!e.getPriority().equals(t.getPriority())},t.prototype.minPost=function(){return Ut.MIN},t.prototype.maxPost=function(){return new Ut(A,new rn("[PRIORITY-POST]",en))},t.prototype.makePost=function(e,t){var n=Zt(e);return new Ut(t,new rn("[PRIORITY-POST]",n))},t.prototype.toString=function(){return".priority"},t}(Bt),cn=new ln,hn=Math.log(2),dn=function(){function e(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/hn,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=e+1&r}return e.prototype.nextBitIsOne=function(){var e=!(this.bits_&1<<this.current_);return this.current_--,e},e}(),pn=function(e,t,n,r){e.sort(t);var i=function(t,r){var o,a,s=r-t;if(0===s)return null;if(1===s)return o=e[t],a=n?n(o):o,new zt(a,o.node,zt.BLACK,null,null);var u=parseInt(s/2,10)+t,l=i(t,u),c=i(u+1,r);return o=e[u],a=n?n(o):o,new zt(a,o.node,zt.BLACK,l,c)},o=function(t){for(var r=null,o=null,a=e.length,s=function(t,r){var o=a-t,s=a;a-=t;var l=i(o+1,s),c=e[o],h=n?n(c):c;u(new zt(h,c.node,r,null,l))},u=function(e){r?(r.left=e,r=e):(o=e,r=e)},l=0;l<t.count;++l){var c=t.nextBitIsOne(),h=Math.pow(2,t.count-(l+1));c?s(h,zt.BLACK):(s(h,zt.BLACK),s(h,zt.RED))}return o}(new dn(e.length));return new Kt(r||t,o)},fn={},_n=function(){function e(e,t){this.indexes_=e,this.indexSet_=t}return Object.defineProperty(e,"Default",{get:function(){return(0,r.assert)(fn&&cn,"ChildrenNode.ts has not been loaded"),sn=sn||new e({".priority":fn},{".priority":cn})},enumerable:!1,configurable:!0}),e.prototype.get=function(e){var t=(0,r.safeGet)(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof Kt?t:null},e.prototype.hasIndex=function(e){return(0,r.contains)(this.indexSet_,e.toString())},e.prototype.addIndex=function(t,n){(0,r.assert)(t!==Qt,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var o,a=[],s=!1,u=n.getIterator(Ut.Wrap),l=u.getNext();l;)s=s||t.isDefinedOn(l.node),a.push(l),l=u.getNext();o=s?pn(a,t.getCompare()):fn;var c=t.toString(),h=(0,i.__assign)({},this.indexSet_);h[c]=t;var d=(0,i.__assign)({},this.indexes_);return d[c]=o,new e(d,h)},e.prototype.addToIndexes=function(t,n){var i=this;return new e((0,r.map)(this.indexes_,function(e,o){var a=(0,r.safeGet)(i.indexSet_,o);if((0,r.assert)(a,"Missing index implementation for "+o),e===fn){if(a.isDefinedOn(t.node)){for(var s=[],u=n.getIterator(Ut.Wrap),l=u.getNext();l;)l.name!==t.name&&s.push(l),l=u.getNext();return s.push(t),pn(s,a.getCompare())}return fn}var c=n.get(t.name),h=e;return c&&(h=h.remove(new Ut(t.name,c))),h.insert(t,t.node)}),this.indexSet_)},e.prototype.removeFromIndexes=function(t,n){return new e((0,r.map)(this.indexes_,function(e){if(e===fn)return e;var r=n.get(t.name);return r?e.remove(new Ut(t.name,r)):e}),this.indexSet_)},e}(),vn=function(){function e(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&nn(this.priorityNode_),this.children_.isEmpty()&&(0,r.assert)(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(e,"EMPTY_NODE",{get:function(){return un||(un=new e(new Kt($t),null,_n.Default))},enumerable:!1,configurable:!0}),e.prototype.isLeafNode=function(){return!1},e.prototype.getPriority=function(){return this.priorityNode_||un},e.prototype.updatePriority=function(t){return this.children_.isEmpty()?this:new e(this.children_,t,this.indexMap_)},e.prototype.getImmediateChild=function(e){if(".priority"===e)return this.getPriority();var t=this.children_.get(e);return null===t?un:t},e.prototype.getChild=function(e){var t=ht(e);return null===t?this:this.getImmediateChild(t).getChild(pt(e))},e.prototype.hasChild=function(e){return null!==this.children_.get(e)},e.prototype.updateImmediateChild=function(t,n){if((0,r.assert)(n,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(n);var i=new Ut(t,n),o=void 0,a=void 0;n.isEmpty()?(o=this.children_.remove(t),a=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(t,n),a=this.indexMap_.addToIndexes(i,this.children_));var s=o.isEmpty()?un:this.priorityNode_;return new e(o,s,a)},e.prototype.updateChild=function(e,t){var n=ht(e);if(null===n)return t;(0,r.assert)(".priority"!==ht(e)||1===dt(e),".priority must be the last token in a path");var i=this.getImmediateChild(n).updateChild(pt(e),t);return this.updateImmediateChild(n,i)},e.prototype.isEmpty=function(){return this.children_.isEmpty()},e.prototype.numChildren=function(){return this.children_.count()},e.prototype.val=function(t){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(cn,function(a,s){n[a]=s.val(t),r++,o&&e.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1}),!t&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return t&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.getPriority().isEmpty()||(e+="priority:"+tn(this.getPriority().val())+":"),this.forEachChild(cn,function(t,n){var r=n.hash();""!==r&&(e+=":"+t+":"+r)}),this.lazyHash_=""===e?"":g(e)}return this.lazyHash_},e.prototype.getPredecessorChildName=function(e,t,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new Ut(e,t));return i?i.name:null}return this.children_.getPredecessorKey(e)},e.prototype.getFirstChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.minKey();return n&&n.name}return this.children_.minKey()},e.prototype.getFirstChild=function(e){var t=this.getFirstChildName(e);return t?new Ut(t,this.children_.get(t)):null},e.prototype.getLastChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.maxKey();return n&&n.name}return this.children_.maxKey()},e.prototype.getLastChild=function(e){var t=this.getLastChildName(e);return t?new Ut(t,this.children_.get(t)):null},e.prototype.forEachChild=function(e,t){var n=this.resolveIndex_(e);return n?n.inorderTraversal(function(e){return t(e.name,e.node)}):this.children_.inorderTraversal(t)},e.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},e.prototype.getIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,function(e){return e});for(var r=this.children_.getIteratorFrom(e.name,Ut.Wrap),i=r.peek();null!=i&&t.compare(i,e)<0;)r.getNext(),i=r.peek();return r},e.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},e.prototype.getReverseIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,function(e){return e});for(var r=this.children_.getReverseIteratorFrom(e.name,Ut.Wrap),i=r.peek();null!=i&&t.compare(i,e)>0;)r.getNext(),i=r.peek();return r},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===gn?-1:0},e.prototype.withIndex=function(t){if(t===Qt||this.indexMap_.hasIndex(t))return this;var n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)},e.prototype.isIndexed=function(e){return e===Qt||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var n=this.getIterator(cn),r=t.getIterator(cn),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},e.prototype.resolveIndex_=function(e){return e===Qt?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}(),yn=function(e){function t(){return e.call(this,new Kt($t),vn.EMPTY_NODE,_n.Default)||this}return(0,i.__extends)(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return vn.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(vn),gn=new yn;Object.defineProperties(Ut,{MIN:{value:new Ut(R,vn.EMPTY_NODE)},MAX:{value:new Ut(A,gn)}}),Vt.__EMPTY_NODE=vn.EMPTY_NODE,rn.__childrenNodeConstructor=vn,Jt(gn),an(gn);var mn=!0;function Cn(e,t){if(void 0===t&&(t=null),null===e)return vn.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),(0,r.assert)(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e)return new rn(e,Cn(t));if(e instanceof Array||!mn){var n=vn.EMPTY_NODE;return L(e,function(t,i){if((0,r.contains)(e,t)&&"."!==t.substring(0,1)){var o=Cn(i);!o.isLeafNode()&&o.isEmpty()||(n=n.updateImmediateChild(t,o))}}),n.updatePriority(Cn(t))}var i=[],o=!1;if(L(e,function(e,t){if("."!==e.substring(0,1)){var n=Cn(t);n.isEmpty()||(o=o||!n.getPriority().isEmpty(),i.push(new Ut(e,n)))}}),0===i.length)return vn.EMPTY_NODE;var a=pn(i,Gt,function(e){return e.name},$t);if(o){var s=pn(i,cn.getCompare());return new vn(a,Cn(t),new _n({".priority":s},{".priority":cn}))}return new vn(a,Cn(t),_n.Default)}on(Cn);var wn=function(e){function t(t){var n=e.call(this)||this;return n.indexPath_=t,(0,r.assert)(!mt(t)&&".priority"!==ht(t),"Can't create PathIndex with empty path or .priority key"),n}return(0,i.__extends)(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?D(e.name,t.name):i},t.prototype.makePost=function(e,t){var n=Cn(e),r=vn.EMPTY_NODE.updateChild(this.indexPath_,n);return new Ut(t,r)},t.prototype.maxPost=function(){var e=vn.EMPTY_NODE.updateChild(this.indexPath_,gn);return new Ut(A,e)},t.prototype.toString=function(){return vt(this.indexPath_,0).join("/")},t}(Bt),bn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?D(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return Ut.MIN},t.prototype.maxPost=function(){return Ut.MAX},t.prototype.makePost=function(e,t){var n=Cn(e);return new Ut(t,n)},t.prototype.toString=function(){return".value"},t}(Bt),Tn=new bn,kn="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",In="-",En="z",Sn=786,Pn=function(){var e=0,t=[];return function(n){var i,o=n===e;e=n;var a=new Array(8);for(i=7;i>=0;i--)a[i]=kn.charAt(n%64),n=Math.floor(n/64);(0,r.assert)(0===n,"Cannot push at time == 0");var s=a.join("");if(o){for(i=11;i>=0&&63===t[i];i--)t[i]=0;t[i]++}else for(i=0;i<12;i++)t[i]=Math.floor(64*Math.random());for(i=0;i<12;i++)s+=kn.charAt(t[i]);return(0,r.assert)(20===s.length,"nextPushId: Length should be 20."),s}}(),xn=function(e){if(e===""+H)return In;var t=z(e);if(null!=t)return""+(t+1);for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e.charAt(r);if(n.length<Sn)return n.push(In),n.join("");for(var i=n.length-1;i>=0&&n[i]===En;)i--;if(-1===i)return A;var o=n[i],a=kn.charAt(kn.indexOf(o)+1);return n[i]=a,n.slice(0,i+1).join("")},Nn=function(e){if(e===""+Q)return R;var t=z(e);if(null!=t)return""+(t-1);for(var n=new Array(e.length),r=0;r<n.length;r++)n[r]=e.charAt(r);return n[n.length-1]===In?1===n.length?""+H:(delete n[n.length-1],n.join("")):(n[n.length-1]=kn.charAt(kn.indexOf(n[n.length-1])-1),n.join("")+En.repeat(Sn-n.length))};function Rn(e){return{type:"value",snapshotNode:e}}function An(e,t){return{type:"child_added",snapshotNode:t,childName:e}}function Dn(e,t){return{type:"child_removed",snapshotNode:t,childName:e}}function On(e,t,n){return{type:"child_changed",snapshotNode:t,childName:e,oldSnap:n}}function Mn(e,t){return{type:"child_moved",snapshotNode:t,childName:e}}var qn=function(){function e(e){this.index_=e}return e.prototype.updateChild=function(e,t,n,i,o,a){(0,r.assert)(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");var s=e.getImmediateChild(t);return s.getChild(i).equals(n.getChild(i))&&s.isEmpty()===n.isEmpty()?e:(null!=a&&(n.isEmpty()?e.hasChild(t)?a.trackChildChange(Dn(t,s)):(0,r.assert)(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):s.isEmpty()?a.trackChildChange(An(t,n)):a.trackChildChange(On(t,n,s))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.index_))},e.prototype.updateFullNode=function(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(cn,function(e,r){t.hasChild(e)||n.trackChildChange(Dn(e,r))}),t.isLeafNode()||t.forEachChild(cn,function(t,r){if(e.hasChild(t)){var i=e.getImmediateChild(t);i.equals(r)||n.trackChildChange(On(t,r,i))}else n.trackChildChange(An(t,r))})),t.withIndex(this.index_)},e.prototype.updatePriority=function(e,t){return e.isEmpty()?vn.EMPTY_NODE:e.updatePriority(t)},e.prototype.filtersNodes=function(){return!1},e.prototype.getIndexedFilter=function(){return this},e.prototype.getIndex=function(){return this.index_},e}(),Fn=function(){function e(t){this.indexedFilter_=new qn(t.getIndex()),this.index_=t.getIndex(),this.startPost_=e.getStartPost_(t),this.endPost_=e.getEndPost_(t)}return e.prototype.getStartPost=function(){return this.startPost_},e.prototype.getEndPost=function(){return this.endPost_},e.prototype.matches=function(e){return this.index_.compare(this.getStartPost(),e)<=0&&this.index_.compare(e,this.getEndPost())<=0},e.prototype.updateChild=function(e,t,n,r,i,o){return this.matches(new Ut(t,n))||(n=vn.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,o)},e.prototype.updateFullNode=function(e,t,n){t.isLeafNode()&&(t=vn.EMPTY_NODE);var r=t.withIndex(this.index_);r=r.updatePriority(vn.EMPTY_NODE);var i=this;return t.forEachChild(cn,function(e,t){i.matches(new Ut(e,t))||(r=r.updateImmediateChild(e,vn.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.indexedFilter_},e.prototype.getIndex=function(){return this.index_},e.getStartPost_=function(e){if(e.hasStart()){var t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()},e.getEndPost_=function(e){if(e.hasEnd()){var t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()},e}(),Ln=function(){function e(e){this.rangedFilter_=new Fn(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft()}return e.prototype.updateChild=function(e,t,n,r,i,o){return this.rangedFilter_.matches(new Ut(t,n))||(n=vn.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,r,i,o):this.fullLimitUpdateChild_(e,t,n,i,o)},e.prototype.updateFullNode=function(e,t,n){var r;if(t.isLeafNode()||t.isEmpty())r=vn.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){r=vn.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.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=t.withIndex(this.index_)).updatePriority(vn.EMPTY_NODE);var s=void 0,u=void 0,l=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),u=this.rangedFilter_.getStartPost();var c=this.index_.getCompare();l=function(e,t){return c(t,e)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),u=this.rangedFilter_.getEndPost(),l=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();){a=i.getNext();!h&&l(s,a)<=0&&(h=!0),h&&o<this.limit_&&l(a,u)<=0?o++:r=r.updateImmediateChild(a.name,vn.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},e.prototype.getIndex=function(){return this.index_},e.prototype.fullLimitUpdateChild_=function(e,t,n,i,o){var a;if(this.reverse_){var s=this.index_.getCompare();a=function(e,t){return s(t,e)}}else a=this.index_.getCompare();var u=e;(0,r.assert)(u.numChildren()===this.limit_,"");var l=new Ut(t,n),c=this.reverse_?u.getFirstChild(this.index_):u.getLastChild(this.index_),h=this.rangedFilter_.matches(l);if(u.hasChild(t)){for(var d=u.getImmediateChild(t),p=i.getChildAfterChild(this.index_,c,this.reverse_);null!=p&&(p.name===t||u.hasChild(p.name));)p=i.getChildAfterChild(this.index_,p,this.reverse_);var f=null==p?1:a(p,l);if(h&&!n.isEmpty()&&f>=0)return null!=o&&o.trackChildChange(On(t,n,d)),u.updateImmediateChild(t,n);null!=o&&o.trackChildChange(Dn(t,d));var _=u.updateImmediateChild(t,vn.EMPTY_NODE);return null!=p&&this.rangedFilter_.matches(p)?(null!=o&&o.trackChildChange(An(p.name,p.node)),_.updateImmediateChild(p.name,p.node)):_}return n.isEmpty()?e:h&&a(c,l)>=0?(null!=o&&(o.trackChildChange(Dn(c.name,c.node)),o.trackChildChange(An(t,n))),u.updateImmediateChild(t,n).updateImmediateChild(c.name,vn.EMPTY_NODE)):e},e}(),Wn=function(){function e(){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_=cn}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.hasStartAfter=function(){return this.startAfterSet_},e.prototype.hasEndBefore=function(){return this.endBeforeSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_},e.prototype.getIndexStartValue=function(){return(0,r.assert)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return(0,r.assert)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:R},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return(0,r.assert)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return(0,r.assert)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:A},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return(0,r.assert)(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===cn},e.prototype.copy=function(){var t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t},e}();function jn(e){return e.loadsAllData()?new qn(e.getIndex()):e.hasLimit()?new Ln(e):new Fn(e)}function Un(e,t){var n=e.copy();return n.limitSet_=!0,n.limit_=t,n.viewFrom_="l",n}function Bn(e,t){var n=e.copy();return n.limitSet_=!0,n.limit_=t,n.viewFrom_="r",n}function Vn(e,t,n){var r=e.copy();return r.startSet_=!0,void 0===t&&(t=null),r.indexStartValue_=t,null!=n?(r.startNameSet_=!0,r.indexStartName_=n):(r.startNameSet_=!1,r.indexStartName_=""),r}function Qn(e,t,n){var r;if(e.index_===Qt)"string"==typeof t&&(t=xn(t)),r=Vn(e,t,n);else{r=Vn(e,t,null==n?A:xn(n))}return r.startAfterSet_=!0,r}function Hn(e,t,n){var r=e.copy();return r.endSet_=!0,void 0===t&&(t=null),r.indexEndValue_=t,void 0!==n?(r.endNameSet_=!0,r.indexEndName_=n):(r.endNameSet_=!1,r.indexEndName_=""),r}function zn(e,t,n){var r;return e.index_===Qt?("string"==typeof t&&(t=Nn(t)),r=Hn(e,t,n)):r=Hn(e,t,null==n?R:Nn(n)),r.endBeforeSet_=!0,r}function Yn(e,t){var n=e.copy();return n.index_=t,n}function Kn(e){var t,n={};return e.isDefault()?n:(e.index_===cn?t="$priority":e.index_===Tn?t="$value":e.index_===Qt?t="$key":((0,r.assert)(e.index_ instanceof wn,"Unrecognized index type!"),t=e.index_.toString()),n.orderBy=(0,r.stringify)(t),e.startSet_&&(n.startAt=(0,r.stringify)(e.indexStartValue_),e.startNameSet_&&(n.startAt+=","+(0,r.stringify)(e.indexStartName_))),e.endSet_&&(n.endAt=(0,r.stringify)(e.indexEndValue_),e.endNameSet_&&(n.endAt+=","+(0,r.stringify)(e.indexEndName_))),e.limitSet_&&(e.isViewFromLeft()?n.limitToFirst=e.limit_:n.limitToLast=e.limit_),n)}function Gn(e){var t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_)),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_)),e.limitSet_){t.l=e.limit_;var n=e.viewFrom_;""===n&&(n=e.isViewFromLeft()?"l":"r"),t.vf=n}return e.index_!==cn&&(t.i=e.index_.toString()),t}var $n=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.repoInfo_=t,o.onDataUpdate_=n,o.authTokenProvider_=r,o.appCheckTokenProvider_=i,o.log_=k("p:rest:"),o.listens_={},o}return(0,i.__extends)(t,e),t.prototype.reportStats=function(e){throw new Error("Method not implemented.")},t.getListenId_=function(e,t){return void 0!==t?"tag$"+t:((0,r.assert)(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())},t.prototype.listen=function(e,n,i,o){var a=this,s=e._path.toString();this.log_("Listen called for "+s+" "+e._queryIdentifier);var u=t.getListenId_(e,i),l={};this.listens_[u]=l;var c=Kn(e._queryParams);this.restRequest_(s+".json",c,function(e,t){var n=t;(404===e&&(n=null,e=null),null===e&&a.onDataUpdate_(s,n,!1,i),(0,r.safeGet)(a.listens_,u)===l)&&o(e?401===e?"permission_denied":"rest_error:"+e:"ok",null)})},t.prototype.unlisten=function(e,n){var r=t.getListenId_(e,n);delete this.listens_[r]},t.prototype.get=function(e){var t=this,n=Kn(e._queryParams),i=e._path.toString(),o=new r.Deferred;return this.restRequest_(i+".json",n,function(e,n){var r=n;404===e&&(r=null,e=null),null===e?(t.onDataUpdate_(i,r,!1,null),o.resolve(r)):o.reject(new Error(r))}),o.promise},t.prototype.refreshAuthToken=function(e){},t.prototype.restRequest_=function(e,t,n){var o=this;return void 0===t&&(t={}),t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(function(a){var s=(0,i.__read)(a,2),u=s[0],l=s[1];u&&u.accessToken&&(t.auth=u.accessToken),l&&l.token&&(t.ac=l.token);var c=(o.repoInfo_.secure?"https://":"http://")+o.repoInfo_.host+e+"?ns="+o.repoInfo_.namespace+(0,r.querystring)(t);o.log_("Sending REST request for "+c);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(n&&4===h.readyState){o.log_("REST Response for "+c+" received. status:",h.status,"response:",h.responseText);var e=null;if(h.status>=200&&h.status<300){try{e=(0,r.jsonEval)(h.responseText)}catch(t){S("Failed to parse JSON response for "+c+": "+h.responseText)}n(null,e)}else 401!==h.status&&404!==h.status&&S("Got unsuccessful REST response for "+c+" Status: "+h.status),n(h.status);n=null}},h.open("GET",c,!0),h.send()})},t}(it),Jn=function(){function e(){this.rootNode_=vn.EMPTY_NODE}return e.prototype.getNode=function(e){return this.rootNode_.getChild(e)},e.prototype.updateSnapshot=function(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)},e}();function Xn(){return{value:null,children:new Map}}function Zn(e,t,n){if(mt(t))e.value=n,e.children.clear();else if(null!==e.value)e.value=e.value.updateChild(t,n);else{var r=ht(t);e.children.has(r)||e.children.set(r,Xn()),Zn(e.children.get(r),t=pt(t),n)}}function er(e,t){if(mt(t))return e.value=null,e.children.clear(),!0;if(null!==e.value){if(e.value.isLeafNode())return!1;var n=e.value;return e.value=null,n.forEachChild(cn,function(t,n){Zn(e,new lt(t),n)}),er(e,t)}if(e.children.size>0){var r=ht(t);if(t=pt(t),e.children.has(r))er(e.children.get(r),t)&&e.children.delete(r);return 0===e.children.size}return!0}function tr(e,t,n){null!==e.value?n(t,e.value):nr(e,function(e,r){tr(r,new lt(t.toString()+"/"+e),n)})}function nr(e,t){e.children.forEach(function(e,n){t(n,e)})}var rr,ir=function(){function e(e){this.collection_=e,this.last_=null}return e.prototype.get=function(){var e=this.collection_.get(),t=(0,i.__assign)({},e);return this.last_&&L(this.last_,function(e,n){t[e]=t[e]-n}),this.last_=e,t},e}(),or=1e4,ar=3e4,sr=3e5,ur=function(){function e(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new ir(e);var n=or+(ar-or)*Math.random();G(this.reportStats_.bind(this),Math.floor(n))}return e.prototype.reportStats_=function(){var e=this,t=this.statsListener_.get(),n={},i=!1;L(t,function(t,o){o>0&&(0,r.contains)(e.statsToReport_,t)&&(n[t]=o,i=!0)}),i&&this.server_.reportStats(n),G(this.reportStats_.bind(this),Math.floor(2*Math.random()*sr))},e}();function lr(e,t){e.statsToReport_[t]=!0}function cr(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function hr(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function dr(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(rr||(rr={}));var pr,fr=function(){function e(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=rr.ACK_USER_WRITE,this.source=cr()}return e.prototype.operationForChild=function(t){if(mt(this.path)){if(null!=this.affectedTree.value)return(0,r.assert)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new lt(t));return new e(ct(),n,this.revert)}return(0,r.assert)(ht(this.path)===t,"operationForChild called for unrelated child."),new e(pt(this.path),this.affectedTree,this.revert)},e}(),_r=function(){function e(e,t){this.source=e,this.path=t,this.type=rr.LISTEN_COMPLETE}return e.prototype.operationForChild=function(t){return mt(this.path)?new e(this.source,ct()):new e(this.source,pt(this.path))},e}(),vr=function(){function e(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=rr.OVERWRITE}return e.prototype.operationForChild=function(t){return mt(this.path)?new e(this.source,ct(),this.snap.getImmediateChild(t)):new e(this.source,pt(this.path),this.snap)},e}(),yr=function(){function e(e,t,n){this.source=e,this.path=t,this.children=n,this.type=rr.MERGE}return e.prototype.operationForChild=function(t){if(mt(this.path)){var n=this.children.subtree(new lt(t));return n.isEmpty()?null:n.value?new vr(this.source,ct(),n.value):new e(this.source,ct(),n)}return(0,r.assert)(ht(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new e(this.source,pt(this.path),this.children)},e.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},e}(),gr=function(){function e(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}return e.prototype.isFullyInitialized=function(){return this.fullyInitialized_},e.prototype.isFiltered=function(){return this.filtered_},e.prototype.isCompleteForPath=function(e){if(mt(e))return this.isFullyInitialized()&&!this.filtered_;var t=ht(e);return this.isCompleteForChild(t)},e.prototype.isCompleteForChild=function(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)},e.prototype.getNode=function(){return this.node_},e}(),mr=function(){return function(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}();function Cr(e,t,n,r){var i=[],o=[];return t.forEach(function(t){"child_changed"===t.type&&e.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(Mn(t.childName,t.snapshotNode))}),wr(e,i,"child_removed",t,r,n),wr(e,i,"child_added",t,r,n),wr(e,i,"child_moved",o,r,n),wr(e,i,"child_changed",t,r,n),wr(e,i,"value",t,r,n),i}function wr(e,t,n,r,i,o){var a=r.filter(function(e){return e.type===n});a.sort(function(t,n){return Tr(e,t,n)}),a.forEach(function(n){var r=br(e,n,o);i.forEach(function(i){i.respondsTo(n.type)&&t.push(i.createEvent(r,e.query_))})})}function br(e,t,n){return"value"===t.type||"child_removed"===t.type?t:(t.prevName=n.getPredecessorChildName(t.childName,t.snapshotNode,e.index_),t)}function Tr(e,t,n){if(null==t.childName||null==n.childName)throw(0,r.assertionError)("Should only compare child_ events.");var i=new Ut(t.childName,t.snapshotNode),o=new Ut(n.childName,n.snapshotNode);return e.index_.compare(i,o)}function kr(e,t){return{eventCache:e,serverCache:t}}function Ir(e,t,n,r){return kr(new gr(t,n,r),e.serverCache)}function Er(e,t,n,r){return kr(e.eventCache,new gr(t,n,r))}function Sr(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function Pr(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}var xr=function(){return pr||(pr=new Kt(O)),pr},Nr=function(){function e(e,t){void 0===t&&(t=xr()),this.value=e,this.children=t}return e.fromObject=function(t){var n=new e(null);return L(t,function(e,t){n=n.set(new lt(e),t)}),n},e.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},e.prototype.findRootMostMatchingPathAndValue=function(e,t){if(null!=this.value&&t(this.value))return{path:ct(),value:this.value};if(mt(e))return null;var n=ht(e),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(pt(e),t);return null!=i?{path:gt(new lt(n),i.path),value:i.value}:null}return null},e.prototype.findRootMostValueAndPath=function(e){return this.findRootMostMatchingPathAndValue(e,function(){return!0})},e.prototype.subtree=function(t){if(mt(t))return this;var n=ht(t),r=this.children.get(n);return null!==r?r.subtree(pt(t)):new e(null)},e.prototype.set=function(t,n){if(mt(t))return new e(n,this.children);var r=ht(t),i=(this.children.get(r)||new e(null)).set(pt(t),n),o=this.children.insert(r,i);return new e(this.value,o)},e.prototype.remove=function(t){if(mt(t))return this.children.isEmpty()?new e(null):new e(null,this.children);var n=ht(t),r=this.children.get(n);if(r){var i=r.remove(pt(t)),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?new e(null):new e(this.value,o)}return this},e.prototype.get=function(e){if(mt(e))return this.value;var t=ht(e),n=this.children.get(t);return n?n.get(pt(e)):null},e.prototype.setTree=function(t,n){if(mt(t))return n;var r=ht(t),i=(this.children.get(r)||new e(null)).setTree(pt(t),n),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new e(this.value,o)},e.prototype.fold=function(e){return this.fold_(ct(),e)},e.prototype.fold_=function(e,t){var n={};return this.children.inorderTraversal(function(r,i){n[r]=i.fold_(gt(e,r),t)}),t(e,this.value,n)},e.prototype.findOnPath=function(e,t){return this.findOnPath_(e,ct(),t)},e.prototype.findOnPath_=function(e,t,n){var r=!!this.value&&n(t,this.value);if(r)return r;if(mt(e))return null;var i=ht(e),o=this.children.get(i);return o?o.findOnPath_(pt(e),gt(t,i),n):null},e.prototype.foreachOnPath=function(e,t){return this.foreachOnPath_(e,ct(),t)},e.prototype.foreachOnPath_=function(t,n,r){if(mt(t))return this;this.value&&r(n,this.value);var i=ht(t),o=this.children.get(i);return o?o.foreachOnPath_(pt(t),gt(n,i),r):new e(null)},e.prototype.foreach=function(e){this.foreach_(ct(),e)},e.prototype.foreach_=function(e,t){this.children.inorderTraversal(function(n,r){r.foreach_(gt(e,n),t)}),this.value&&t(e,this.value)},e.prototype.foreachChild=function(e){this.children.inorderTraversal(function(t,n){n.value&&e(t,n.value)})},e}(),Rr=function(){function e(e){this.writeTree_=e}return e.empty=function(){return new e(new Nr(null))},e}();function Ar(e,t,n){if(mt(t))return new Rr(new Nr(n));var r=e.writeTree_.findRootMostValueAndPath(t);if(null!=r){var i=r.path,o=r.value,a=Ct(i,t);return o=o.updateChild(a,n),new Rr(e.writeTree_.set(i,o))}var s=new Nr(n),u=e.writeTree_.setTree(t,s);return new Rr(u)}function Dr(e,t,n){var r=e;return L(n,function(e,n){r=Ar(r,gt(t,e),n)}),r}function Or(e,t){if(mt(t))return Rr.empty();var n=e.writeTree_.setTree(t,new Nr(null));return new Rr(n)}function Mr(e,t){return null!=qr(e,t)}function qr(e,t){var n=e.writeTree_.findRootMostValueAndPath(t);return null!=n?e.writeTree_.get(n.path).getChild(Ct(n.path,t)):null}function Fr(e){var t=[],n=e.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(cn,function(e,n){t.push(new Ut(e,n))}):e.writeTree_.children.inorderTraversal(function(e,n){null!=n.value&&t.push(new Ut(e,n.value))}),t}function Lr(e,t){if(mt(t))return e;var n=qr(e,t);return new Rr(null!=n?new Nr(n):e.writeTree_.subtree(t))}function Wr(e){return e.writeTree_.isEmpty()}function jr(e,t){return Ur(ct(),e.writeTree_,t)}function Ur(e,t,n){if(null!=t.value)return n.updateChild(e,t.value);var i=null;return t.children.inorderTraversal(function(t,o){".priority"===t?((0,r.assert)(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):n=Ur(gt(e,t),o,n)}),n.getChild(e).isEmpty()||null===i||(n=n.updateChild(gt(e,".priority"),i)),n}function Br(e,t){return hi(t,e)}function Vr(e,t,n,i,o){(0,r.assert)(i>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===o&&(o=!0),e.allWrites.push({path:t,snap:n,writeId:i,visible:o}),o&&(e.visibleWrites=Ar(e.visibleWrites,t,n)),e.lastWriteId=i}function Qr(e,t,n,i){(0,r.assert)(i>e.lastWriteId,"Stacking an older merge on top of newer ones"),e.allWrites.push({path:t,children:n,writeId:i,visible:!0}),e.visibleWrites=Dr(e.visibleWrites,t,n),e.lastWriteId=i}function Hr(e,t){for(var n=0;n<e.allWrites.length;n++){var r=e.allWrites[n];if(r.writeId===t)return r}return null}function zr(e,t){var n=e.allWrites.findIndex(function(e){return e.writeId===t});(0,r.assert)(n>=0,"removeWrite called with nonexistent writeId.");var i=e.allWrites[n];e.allWrites.splice(n,1);for(var o=i.visible,a=!1,s=e.allWrites.length-1;o&&s>=0;){var u=e.allWrites[s];u.visible&&(s>=n&&Yr(u,i.path)?o=!1:Tt(i.path,u.path)&&(a=!0)),s--}if(o){if(a)return Kr(e),!0;i.snap?e.visibleWrites=Or(e.visibleWrites,i.path):L(i.children,function(t){e.visibleWrites=Or(e.visibleWrites,gt(i.path,t))});return!0}return!1}function Yr(e,t){if(e.snap)return Tt(e.path,t);for(var n in e.children)if(e.children.hasOwnProperty(n)&&Tt(gt(e.path,n),t))return!0;return!1}function Kr(e){e.visibleWrites=$r(e.allWrites,Gr,ct()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}function Gr(e){return e.visible}function $r(e,t,n){for(var i=Rr.empty(),o=0;o<e.length;++o){var a=e[o];if(t(a)){var s=a.path,u=void 0;if(a.snap)Tt(n,s)?i=Ar(i,u=Ct(n,s),a.snap):Tt(s,n)&&(u=Ct(s,n),i=Ar(i,ct(),a.snap.getChild(u)));else{if(!a.children)throw(0,r.assertionError)("WriteRecord should have .snap or .children");if(Tt(n,s))i=Dr(i,u=Ct(n,s),a.children);else if(Tt(s,n))if(mt(u=Ct(s,n)))i=Dr(i,ct(),a.children);else{var l=(0,r.safeGet)(a.children,ht(u));if(l){var c=l.getChild(pt(u));i=Ar(i,ct(),c)}}}}}return i}function Jr(e,t,n,r,i){if(r||i){var o=Lr(e.visibleWrites,t);if(!i&&Wr(o))return n;if(i||null!=n||Mr(o,ct())){return jr($r(e.allWrites,function(e){return(e.visible||i)&&(!r||!~r.indexOf(e.writeId))&&(Tt(e.path,t)||Tt(t,e.path))},t),n||vn.EMPTY_NODE)}return null}var a=qr(e.visibleWrites,t);if(null!=a)return a;var s=Lr(e.visibleWrites,t);return Wr(s)?n:null!=n||Mr(s,ct())?jr(s,n||vn.EMPTY_NODE):null}function Xr(e,t,n){var r=vn.EMPTY_NODE,i=qr(e.visibleWrites,t);if(i)return i.isLeafNode()||i.forEachChild(cn,function(e,t){r=r.updateImmediateChild(e,t)}),r;if(n){var o=Lr(e.visibleWrites,t);return n.forEachChild(cn,function(e,t){var n=jr(Lr(o,new lt(e)),t);r=r.updateImmediateChild(e,n)}),Fr(o).forEach(function(e){r=r.updateImmediateChild(e.name,e.node)}),r}return Fr(Lr(e.visibleWrites,t)).forEach(function(e){r=r.updateImmediateChild(e.name,e.node)}),r}function Zr(e,t,n,i,o){(0,r.assert)(i||o,"Either existingEventSnap or existingServerSnap must exist");var a=gt(t,n);if(Mr(e.visibleWrites,a))return null;var s=Lr(e.visibleWrites,a);return Wr(s)?o.getChild(n):jr(s,o.getChild(n))}function ei(e,t,n,r){var i=gt(t,n),o=qr(e.visibleWrites,i);return null!=o?o:r.isCompleteForChild(n)?jr(Lr(e.visibleWrites,i),r.getNode().getImmediateChild(n)):null}function ti(e,t){return qr(e.visibleWrites,t)}function ni(e,t,n,r,i,o,a){var s,u=Lr(e.visibleWrites,t),l=qr(u,ct());if(null!=l)s=l;else{if(null==n)return[];s=jr(u,n)}if((s=s.withIndex(a)).isEmpty()||s.isLeafNode())return[];for(var c=[],h=a.getCompare(),d=o?s.getReverseIteratorFrom(r,a):s.getIteratorFrom(r,a),p=d.getNext();p&&c.length<i;)0!==h(p,r)&&c.push(p),p=d.getNext();return c}function ri(){return{visibleWrites:Rr.empty(),allWrites:[],lastWriteId:-1}}function ii(e,t,n,r){return Jr(e.writeTree,e.treePath,t,n,r)}function oi(e,t){return Xr(e.writeTree,e.treePath,t)}function ai(e,t,n,r){return Zr(e.writeTree,e.treePath,t,n,r)}function si(e,t){return ti(e.writeTree,gt(e.treePath,t))}function ui(e,t,n,r,i,o){return ni(e.writeTree,e.treePath,t,n,r,i,o)}function li(e,t,n){return ei(e.writeTree,e.treePath,t,n)}function ci(e,t){return hi(gt(e.treePath,t),e.writeTree)}function hi(e,t){return{treePath:e,writeTree:t}}var di=function(){function e(){this.changeMap=new Map}return e.prototype.trackChildChange=function(e){var t=e.type,n=e.childName;(0,r.assert)("child_added"===t||"child_changed"===t||"child_removed"===t,"Only child changes supported for tracking"),(0,r.assert)(".priority"!==n,"Only non-priority child changes can be tracked.");var i=this.changeMap.get(n);if(i){var o=i.type;if("child_added"===t&&"child_removed"===o)this.changeMap.set(n,On(n,e.snapshotNode,i.snapshotNode));else if("child_removed"===t&&"child_added"===o)this.changeMap.delete(n);else if("child_removed"===t&&"child_changed"===o)this.changeMap.set(n,Dn(n,i.oldSnap));else if("child_changed"===t&&"child_added"===o)this.changeMap.set(n,An(n,e.snapshotNode));else{if("child_changed"!==t||"child_changed"!==o)throw(0,r.assertionError)("Illegal combination of changes: "+e+" occurred after "+i);this.changeMap.set(n,On(n,e.snapshotNode,i.oldSnap))}}else this.changeMap.set(n,e)},e.prototype.getChanges=function(){return Array.from(this.changeMap.values())},e}(),pi=function(){function e(){}return e.prototype.getCompleteChild=function(e){return null},e.prototype.getChildAfterChild=function(e,t,n){return null},e}(),fi=new pi,_i=function(){function e(e,t,n){void 0===n&&(n=null),this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}return e.prototype.getCompleteChild=function(e){var t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);var n=null!=this.optCompleteServerCache_?new gr(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return li(this.writes_,e,n)},e.prototype.getChildAfterChild=function(e,t,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:Pr(this.viewCache_),i=ui(this.writes_,r,t,1,n,e);return 0===i.length?null:i[0]},e}();function vi(e){return{filter:e}}function yi(e,t){(0,r.assert)(t.eventCache.getNode().isIndexed(e.filter.getIndex()),"Event snap not indexed"),(0,r.assert)(t.serverCache.getNode().isIndexed(e.filter.getIndex()),"Server snap not indexed")}function gi(e,t,n,i,o){var a,s,u=new di;if(n.type===rr.OVERWRITE){var l=n;l.source.fromUser?a=bi(e,t,l.path,l.snap,i,o,u):((0,r.assert)(l.source.fromServer,"Unknown source."),s=l.source.tagged||t.serverCache.isFiltered()&&!mt(l.path),a=wi(e,t,l.path,l.snap,i,o,s,u))}else if(n.type===rr.MERGE){var c=n;c.source.fromUser?a=ki(e,t,c.path,c.children,i,o,u):((0,r.assert)(c.source.fromServer,"Unknown source."),s=c.source.tagged||t.serverCache.isFiltered(),a=Ei(e,t,c.path,c.children,i,o,s,u))}else if(n.type===rr.ACK_USER_WRITE){var h=n;a=h.revert?xi(e,t,h.path,i,o,u):Si(e,t,h.path,h.affectedTree,i,o,u)}else{if(n.type!==rr.LISTEN_COMPLETE)throw(0,r.assertionError)("Unknown operation type: "+n.type);a=Pi(e,t,n.path,i,u)}var d=u.getChanges();return mi(t,a,d),{viewCache:a,changes:d}}function mi(e,t,n){var r=t.eventCache;if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=Sr(e);(n.length>0||!e.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(Rn(Sr(t)))}}function Ci(e,t,n,i,o,a){var s=t.eventCache;if(null!=si(i,n))return t;var u=void 0,l=void 0;if(mt(n))if((0,r.assert)(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){var c=Pr(t),h=oi(i,c instanceof vn?c:vn.EMPTY_NODE);u=e.filter.updateFullNode(t.eventCache.getNode(),h,a)}else{var d=ii(i,Pr(t));u=e.filter.updateFullNode(t.eventCache.getNode(),d,a)}else{var p=ht(n);if(".priority"===p){(0,r.assert)(1===dt(n),"Can't have a priority with additional path components");var f=s.getNode(),_=ai(i,n,f,l=t.serverCache.getNode());u=null!=_?e.filter.updatePriority(f,_):s.getNode()}else{var v=pt(n),y=void 0;if(s.isCompleteForChild(p)){l=t.serverCache.getNode();var g=ai(i,n,s.getNode(),l);y=null!=g?s.getNode().getImmediateChild(p).updateChild(v,g):s.getNode().getImmediateChild(p)}else y=li(i,p,t.serverCache);u=null!=y?e.filter.updateChild(s.getNode(),p,y,v,o,a):s.getNode()}}return Ir(t,u,s.isFullyInitialized()||mt(n),e.filter.filtersNodes())}function wi(e,t,n,r,i,o,a,s){var u,l=t.serverCache,c=a?e.filter:e.filter.getIndexedFilter();if(mt(n))u=c.updateFullNode(l.getNode(),r,null);else if(c.filtersNodes()&&!l.isFiltered()){var h=l.getNode().updateChild(n,r);u=c.updateFullNode(l.getNode(),h,null)}else{var d=ht(n);if(!l.isCompleteForPath(n)&&dt(n)>1)return t;var p=pt(n),f=l.getNode().getImmediateChild(d).updateChild(p,r);u=".priority"===d?c.updatePriority(l.getNode(),f):c.updateChild(l.getNode(),d,f,p,fi,null)}var _=Er(t,u,l.isFullyInitialized()||mt(n),c.filtersNodes());return Ci(e,_,n,i,new _i(i,_,o),s)}function bi(e,t,n,r,i,o,a){var s,u,l=t.eventCache,c=new _i(i,t,o);if(mt(n))u=e.filter.updateFullNode(t.eventCache.getNode(),r,a),s=Ir(t,u,!0,e.filter.filtersNodes());else{var h=ht(n);if(".priority"===h)u=e.filter.updatePriority(t.eventCache.getNode(),r),s=Ir(t,u,l.isFullyInitialized(),l.isFiltered());else{var d=pt(n),p=l.getNode().getImmediateChild(h),f=void 0;if(mt(d))f=r;else{var _=c.getCompleteChild(h);f=null!=_?".priority"===ft(d)&&_.getChild(yt(d)).isEmpty()?_:_.updateChild(d,r):vn.EMPTY_NODE}if(p.equals(f))s=t;else s=Ir(t,e.filter.updateChild(l.getNode(),h,f,d,c,a),l.isFullyInitialized(),e.filter.filtersNodes())}}return s}function Ti(e,t){return e.eventCache.isCompleteForChild(t)}function ki(e,t,n,r,i,o,a){var s=t;return r.foreach(function(r,u){var l=gt(n,r);Ti(t,ht(l))&&(s=bi(e,s,l,u,i,o,a))}),r.foreach(function(r,u){var l=gt(n,r);Ti(t,ht(l))||(s=bi(e,s,l,u,i,o,a))}),s}function Ii(e,t,n){return n.foreach(function(e,n){t=t.updateChild(e,n)}),t}function Ei(e,t,n,r,i,o,a,s){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;var u,l=t;u=mt(n)?r:new Nr(null).setTree(n,r);var c=t.serverCache.getNode();return u.children.inorderTraversal(function(n,r){if(c.hasChild(n)){var u=t.serverCache.getNode().getImmediateChild(n),h=Ii(e,u,r);l=wi(e,l,new lt(n),h,i,o,a,s)}}),u.children.inorderTraversal(function(n,r){var u=!t.serverCache.isCompleteForChild(n)&&void 0===r.value;if(!c.hasChild(n)&&!u){var h=t.serverCache.getNode().getImmediateChild(n),d=Ii(e,h,r);l=wi(e,l,new lt(n),d,i,o,a,s)}}),l}function Si(e,t,n,r,i,o,a){if(null!=si(i,n))return t;var s=t.serverCache.isFiltered(),u=t.serverCache;if(null!=r.value){if(mt(n)&&u.isFullyInitialized()||u.isCompleteForPath(n))return wi(e,t,n,u.getNode().getChild(n),i,o,s,a);if(mt(n)){var l=new Nr(null);return u.getNode().forEachChild(Qt,function(e,t){l=l.set(new lt(e),t)}),Ei(e,t,n,l,i,o,s,a)}return t}var c=new Nr(null);return r.foreach(function(e,t){var r=gt(n,e);u.isCompleteForPath(r)&&(c=c.set(e,u.getNode().getChild(r)))}),Ei(e,t,n,c,i,o,s,a)}function Pi(e,t,n,r,i){var o=t.serverCache;return Ci(e,Er(t,o.getNode(),o.isFullyInitialized()||mt(n),o.isFiltered()),n,r,fi,i)}function xi(e,t,n,i,o,a){var s;if(null!=si(i,n))return t;var u=new _i(i,t,o),l=t.eventCache.getNode(),c=void 0;if(mt(n)||".priority"===ht(n)){var h=void 0;if(t.serverCache.isFullyInitialized())h=ii(i,Pr(t));else{var d=t.serverCache.getNode();(0,r.assert)(d instanceof vn,"serverChildren would be complete if leaf node"),h=oi(i,d)}h=h,c=e.filter.updateFullNode(l,h,a)}else{var p=ht(n),f=li(i,p,t.serverCache);null==f&&t.serverCache.isCompleteForChild(p)&&(f=l.getImmediateChild(p)),(c=null!=f?e.filter.updateChild(l,p,f,pt(n),u,a):t.eventCache.getNode().hasChild(p)?e.filter.updateChild(l,p,vn.EMPTY_NODE,pt(n),u,a):l).isEmpty()&&t.serverCache.isFullyInitialized()&&(s=ii(i,Pr(t))).isLeafNode()&&(c=e.filter.updateFullNode(c,s,a))}return s=t.serverCache.isFullyInitialized()||null!=si(i,ct()),Ir(t,c,s,e.filter.filtersNodes())}var Ni,Ri=function(){function e(e,t){this.query_=e,this.eventRegistrations_=[];var n=this.query_._queryParams,r=new qn(n.getIndex()),i=jn(n);this.processor_=vi(i);var o=t.serverCache,a=t.eventCache,s=r.updateFullNode(vn.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(vn.EMPTY_NODE,a.getNode(),null),l=new gr(s,o.isFullyInitialized(),r.filtersNodes()),c=new gr(u,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=kr(c,l),this.eventGenerator_=new mr(this.query_)}return Object.defineProperty(e.prototype,"query",{get:function(){return this.query_},enumerable:!1,configurable:!0}),e}();function Ai(e){return e.viewCache_.serverCache.getNode()}function Di(e){return Sr(e.viewCache_)}function Oi(e,t){var n=Pr(e.viewCache_);return n&&(e.query._queryParams.loadsAllData()||!mt(t)&&!n.getImmediateChild(ht(t)).isEmpty())?n.getChild(t):null}function Mi(e){return 0===e.eventRegistrations_.length}function qi(e,t){e.eventRegistrations_.push(t)}function Fi(e,t,n){var i=[];if(n){(0,r.assert)(null==t,"A cancel should cancel all event registrations.");var o=e.query._path;e.eventRegistrations_.forEach(function(e){var t=e.createCancelEvent(n,o);t&&i.push(t)})}if(t){for(var a=[],s=0;s<e.eventRegistrations_.length;++s){var u=e.eventRegistrations_[s];if(u.matches(t)){if(t.hasAnyCallback()){a=a.concat(e.eventRegistrations_.slice(s+1));break}}else a.push(u)}e.eventRegistrations_=a}else e.eventRegistrations_=[];return i}function Li(e,t,n,i){t.type===rr.MERGE&&null!==t.source.queryId&&((0,r.assert)(Pr(e.viewCache_),"We should always have a full cache before handling merges"),(0,r.assert)(Sr(e.viewCache_),"Missing event cache, even though we have a server cache"));var o=e.viewCache_,a=gi(e.processor_,o,t,n,i);return yi(e.processor_,a.viewCache),(0,r.assert)(a.viewCache.serverCache.isFullyInitialized()||!o.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),e.viewCache_=a.viewCache,ji(e,a.changes,a.viewCache.eventCache.getNode(),null)}function Wi(e,t){var n=e.viewCache_.eventCache,r=[];n.getNode().isLeafNode()||n.getNode().forEachChild(cn,function(e,t){r.push(An(e,t))});return n.isFullyInitialized()&&r.push(Rn(n.getNode())),ji(e,r,n.getNode(),t)}function ji(e,t,n,r){var i=r?[r]:e.eventRegistrations_;return Cr(e.eventGenerator_,t,n,i)}var Ui,Bi=function(){return function(){this.views=new Map}}();function Vi(e){(0,r.assert)(!Ni,"__referenceConstructor has already been defined"),Ni=e}function Qi(){return(0,r.assert)(Ni,"Reference.ts has not been loaded"),Ni}function Hi(e){return 0===e.views.size}function zi(e,t,n,o){var a,s,u=t.source.queryId;if(null!==u){var l=e.views.get(u);return(0,r.assert)(null!=l,"SyncTree gave us an op for an invalid query."),Li(l,t,n,o)}var c=[];try{for(var h=(0,i.__values)(e.views.values()),d=h.next();!d.done;d=h.next()){l=d.value;c=c.concat(Li(l,t,n,o))}}catch(p){a={error:p}}finally{try{d&&!d.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}return c}function Yi(e,t,n,r,i){var o=t._queryIdentifier,a=e.views.get(o);if(!a){var s=ii(n,i?r:null),u=!1;s?u=!0:r instanceof vn?(s=oi(n,r),u=!1):(s=vn.EMPTY_NODE,u=!1);var l=kr(new gr(s,u,!1),new gr(r,i,!1));return new Ri(t,l)}return a}function Ki(e,t,n,r,i,o){var a=Yi(e,t,r,i,o);return e.views.has(t._queryIdentifier)||e.views.set(t._queryIdentifier,a),qi(a,n),Wi(a,n)}function Gi(e,t,n,r){var o,a,s=t._queryIdentifier,u=[],l=[],c=eo(e);if("default"===s)try{for(var h=(0,i.__values)(e.views.entries()),d=h.next();!d.done;d=h.next()){var p=(0,i.__read)(d.value,2),f=p[0],_=p[1];l=l.concat(Fi(_,n,r)),Mi(_)&&(e.views.delete(f),_.query._queryParams.loadsAllData()||u.push(_.query))}}catch(v){o={error:v}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}else(_=e.views.get(s))&&(l=l.concat(Fi(_,n,r)),Mi(_)&&(e.views.delete(s),_.query._queryParams.loadsAllData()||u.push(_.query)));return c&&!eo(e)&&u.push(new(Qi())(t._repo,t._path)),{removed:u,events:l}}function $i(e){var t,n,r=[];try{for(var o=(0,i.__values)(e.views.values()),a=o.next();!a.done;a=o.next()){var s=a.value;s.query._queryParams.loadsAllData()||r.push(s)}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function Ji(e,t){var n,r,o=null;try{for(var a=(0,i.__values)(e.views.values()),s=a.next();!s.done;s=a.next()){var u=s.value;o=o||Oi(u,t)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}function Xi(e,t){if(t._queryParams.loadsAllData())return to(e);var n=t._queryIdentifier;return e.views.get(n)}function Zi(e,t){return null!=Xi(e,t)}function eo(e){return null!=to(e)}function to(e){var t,n;try{for(var r=(0,i.__values)(e.views.values()),o=r.next();!o.done;o=r.next()){var a=o.value;if(a.query._queryParams.loadsAllData())return a}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return null}function no(e){(0,r.assert)(!Ui,"__referenceConstructor has already been defined"),Ui=e}function ro(){return(0,r.assert)(Ui,"Reference.ts has not been loaded"),Ui}var io=1,oo=function(){return function(e){this.listenProvider_=e,this.syncPointTree_=new Nr(null),this.pendingWriteTree_=ri(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}();function ao(e,t,n,r,i){return Vr(e.pendingWriteTree_,t,n,r,i),i?Co(e,new vr(cr(),t,n)):[]}function so(e,t,n,r){Qr(e.pendingWriteTree_,t,n,r);var i=Nr.fromObject(n);return Co(e,new yr(cr(),t,i))}function uo(e,t,n){void 0===n&&(n=!1);var r=Hr(e.pendingWriteTree_,t);if(zr(e.pendingWriteTree_,t)){var i=new Nr(null);return null!=r.snap?i=i.set(ct(),!0):L(r.children,function(e){i=i.set(new lt(e),!0)}),Co(e,new fr(r.path,i,n))}return[]}function lo(e,t,n){return Co(e,new vr(hr(),t,n))}function co(e,t,n){var r=Nr.fromObject(n);return Co(e,new yr(hr(),t,r))}function ho(e,t){return Co(e,new _r(hr(),t))}function po(e,t,n){var r=Eo(e,n);if(r){var i=So(r),o=i.path,a=i.queryId,s=Ct(o,t);return Po(e,o,new _r(dr(a),s))}return[]}function fo(e,t,n,r){var i=t._path,o=e.syncPointTree_.get(i),a=[];if(o&&("default"===t._queryIdentifier||Zi(o,t))){var s=Gi(o,t,n,r);Hi(o)&&(e.syncPointTree_=e.syncPointTree_.remove(i));var u=s.removed;a=s.events;var l=-1!==u.findIndex(function(e){return e._queryParams.loadsAllData()}),c=e.syncPointTree_.findOnPath(i,function(e,t){return eo(t)});if(l&&!c){var h=e.syncPointTree_.subtree(i);if(!h.isEmpty())for(var d=xo(h),p=0;p<d.length;++p){var f=d[p],_=f.query,v=To(e,f);e.listenProvider_.startListening(No(_),ko(e,_),v.hashFn,v.onComplete)}}if(!c&&u.length>0&&!r)if(l){e.listenProvider_.stopListening(No(t),null)}else u.forEach(function(t){var n=e.queryToTagMap.get(Io(t));e.listenProvider_.stopListening(No(t),n)});Ro(e,u)}return a}function _o(e,t,n,r){var i=Eo(e,r);if(null!=i){var o=So(i),a=o.path,s=o.queryId,u=Ct(a,t);return Po(e,a,new vr(dr(s),u,n))}return[]}function vo(e,t,n,r){var i=Eo(e,r);if(i){var o=So(i),a=o.path,s=o.queryId,u=Ct(a,t),l=Nr.fromObject(n);return Po(e,a,new yr(dr(s),u,l))}return[]}function yo(e,t,n){var i=t._path,o=null,a=!1;e.syncPointTree_.foreachOnPath(i,function(e,t){var n=Ct(e,i);o=o||Ji(t,n),a=a||eo(t)});var s,u=e.syncPointTree_.get(i);(u?(a=a||eo(u),o=o||Ji(u,ct())):(u=new Bi,e.syncPointTree_=e.syncPointTree_.set(i,u)),null!=o)?s=!0:(s=!1,o=vn.EMPTY_NODE,e.syncPointTree_.subtree(i).foreachChild(function(e,t){var n=Ji(t,ct());n&&(o=o.updateImmediateChild(e,n))}));var l=Zi(u,t);if(!l&&!t._queryParams.loadsAllData()){var c=Io(t);(0,r.assert)(!e.queryToTagMap.has(c),"View does not exist, but we have a tag");var h=Ao();e.queryToTagMap.set(c,h),e.tagToQueryMap.set(h,c)}var d=Ki(u,t,n,Br(e.pendingWriteTree_,i),o,s);if(!l&&!a){var p=Xi(u,t);d=d.concat(Do(e,t,p))}return d}function go(e,t,n){var r=e.pendingWriteTree_,i=e.syncPointTree_.findOnPath(t,function(e,n){var r=Ji(n,Ct(e,t));if(r)return r});return Jr(r,t,i,n,!0)}function mo(e,t){var n=t._path,r=null;e.syncPointTree_.foreachOnPath(n,function(e,t){var i=Ct(e,n);r=r||Ji(t,i)});var i=e.syncPointTree_.get(n);i?r=r||Ji(i,ct()):(i=new Bi,e.syncPointTree_=e.syncPointTree_.set(n,i));var o=null!=r,a=o?new gr(r,!0,!1):null;return Di(Yi(i,t,Br(e.pendingWriteTree_,t._path),o?a.getNode():vn.EMPTY_NODE,o))}function Co(e,t){return wo(t,e.syncPointTree_,null,Br(e.pendingWriteTree_,ct()))}function wo(e,t,n,r){if(mt(e.path))return bo(e,t,n,r);var i=t.get(ct());null==n&&null!=i&&(n=Ji(i,ct()));var o=[],a=ht(e.path),s=e.operationForChild(a),u=t.children.get(a);if(u&&s){var l=n?n.getImmediateChild(a):null,c=ci(r,a);o=o.concat(wo(s,u,l,c))}return i&&(o=o.concat(zi(i,e,r,n))),o}function bo(e,t,n,r){var i=t.get(ct());null==n&&null!=i&&(n=Ji(i,ct()));var o=[];return t.children.inorderTraversal(function(t,i){var a=n?n.getImmediateChild(t):null,s=ci(r,t),u=e.operationForChild(t);u&&(o=o.concat(bo(u,i,a,s)))}),i&&(o=o.concat(zi(i,e,r,n))),o}function To(e,t){var n=t.query,r=ko(e,n);return{hashFn:function(){return(Ai(t)||vn.EMPTY_NODE).hash()},onComplete:function(t){if("ok"===t)return r?po(e,n._path,r):ho(e,n._path);var i=B(t,n);return fo(e,n,null,i)}}}function ko(e,t){var n=Io(t);return e.queryToTagMap.get(n)}function Io(e){return e._path.toString()+"$"+e._queryIdentifier}function Eo(e,t){return e.tagToQueryMap.get(t)}function So(e){var t=e.indexOf("$");return(0,r.assert)(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new lt(e.substr(0,t))}}function Po(e,t,n){var i=e.syncPointTree_.get(t);return(0,r.assert)(i,"Missing sync point for query tag that we're tracking"),zi(i,n,Br(e.pendingWriteTree_,t),null)}function xo(e){return e.fold(function(e,t,n){if(t&&eo(t))return[to(t)];var r=[];return t&&(r=$i(t)),L(n,function(e,t){r=r.concat(t)}),r})}function No(e){return e._queryParams.loadsAllData()&&!e._queryParams.isDefault()?new(ro())(e._repo,e._path):e}function Ro(e,t){for(var n=0;n<t.length;++n){var r=t[n];if(!r._queryParams.loadsAllData()){var i=Io(r),o=e.queryToTagMap.get(i);e.queryToTagMap.delete(i),e.tagToQueryMap.delete(o)}}}function Ao(){return io++}function Do(e,t,n){var i=t._path,o=ko(e,t),a=To(e,n),s=e.listenProvider_.startListening(No(t),o,a.hashFn,a.onComplete),u=e.syncPointTree_.subtree(i);if(o)(0,r.assert)(!eo(u.value),"If we're adding a query, it shouldn't be shadowed");else for(var l=u.fold(function(e,t,n){if(!mt(e)&&t&&eo(t))return[to(t).query];var r=[];return t&&(r=r.concat($i(t).map(function(e){return e.query}))),L(n,function(e,t){r=r.concat(t)}),r}),c=0;c<l.length;++c){var h=l[c];e.listenProvider_.stopListening(No(h),ko(e,h))}return s}var Oo=function(){function e(e){this.node_=e}return e.prototype.getImmediateChild=function(t){return new e(this.node_.getImmediateChild(t))},e.prototype.node=function(){return this.node_},e}(),Mo=function(){function e(e,t){this.syncTree_=e,this.path_=t}return e.prototype.getImmediateChild=function(t){var n=gt(this.path_,t);return new e(this.syncTree_,n)},e.prototype.node=function(){return go(this.syncTree_,this.path_)},e}(),qo=function(e){return(e=e||{}).timestamp=e.timestamp||(new Date).getTime(),e},Fo=function(e,t,n){return e&&"object"==typeof e?((0,r.assert)(".sv"in e,"Unexpected leaf node or priority contents"),"string"==typeof e[".sv"]?Lo(e[".sv"],t,n):"object"==typeof e[".sv"]?Wo(e[".sv"],t):void(0,r.assert)(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},Lo=function(e,t,n){switch(e){case"timestamp":return n.timestamp;default:(0,r.assert)(!1,"Unexpected server value: "+e)}},Wo=function(e,t,n){e.hasOwnProperty("increment")||(0,r.assert)(!1,"Unexpected server value: "+JSON.stringify(e,null,2));var i=e.increment;"number"!=typeof i&&(0,r.assert)(!1,"Unexpected increment value: "+i);var o=t.node();if((0,r.assert)(null!=o,"Expected ChildrenNode.EMPTY_NODE for nulls"),!o.isLeafNode())return i;var a=o.getValue();return"number"!=typeof a?i:a+i},jo=function(e,t,n,r){return Bo(t,new Mo(n,e),r)},Uo=function(e,t,n){return Bo(e,new Oo(t),n)};function Bo(e,t,n){var r,i=e.getPriority().val(),o=Fo(i,t.getImmediateChild(".priority"),n);if(e.isLeafNode()){var a=e,s=Fo(a.getValue(),t,n);return s!==a.getValue()||o!==a.getPriority().val()?new rn(s,Cn(o)):e}var u=e;return r=u,o!==u.getPriority().val()&&(r=r.updatePriority(new rn(o))),u.forEachChild(cn,function(e,i){var o=Bo(i,t.getImmediateChild(e),n);o!==i&&(r=r.updateImmediateChild(e,o))}),r}var Vo=function(){return function(e,t,n){void 0===e&&(e=""),void 0===t&&(t=null),void 0===n&&(n={children:{},childCount:0}),this.name=e,this.parent=t,this.node=n}}();function Qo(e,t){for(var n=t instanceof lt?t:new lt(t),i=e,o=ht(n);null!==o;){var a=(0,r.safeGet)(i.node.children,o)||{children:{},childCount:0};i=new Vo(o,i,a),o=ht(n=pt(n))}return i}function Ho(e){return e.node.value}function zo(e,t){e.node.value=t,Zo(e)}function Yo(e){return e.node.childCount>0}function Ko(e){return void 0===Ho(e)&&!Yo(e)}function Go(e,t){L(e.node.children,function(n,r){t(new Vo(n,e,r))})}function $o(e,t,n,r){n&&!r&&t(e),Go(e,function(e){$o(e,t,!0,r)}),n&&r&&t(e)}function Jo(e,t,n){for(var r=n?e:e.parent;null!==r;){if(t(r))return!0;r=r.parent}return!1}function Xo(e){return new lt(null===e.parent?e.name:Xo(e.parent)+"/"+e.name)}function Zo(e){null!==e.parent&&ea(e.parent,e.name,e)}function ea(e,t,n){var i=Ko(n),o=(0,r.contains)(e.node.children,t);i&&o?(delete e.node.children[t],e.node.childCount--,Zo(e)):i||o||(e.node.children[t]=n.node,e.node.childCount++,Zo(e))}var ta=/[\[\].#$\/\u0000-\u001F\u007F]/,na=/[\[\].#$\u0000-\u001F\u007F]/,ra=10485760,ia=function(e){return"string"==typeof e&&0!==e.length&&!ta.test(e)},oa=function(e){return"string"==typeof e&&0!==e.length&&!na.test(e)},aa=function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),oa(e)},sa=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!x(e)||e&&"object"==typeof e&&(0,r.contains)(e,".sv")},ua=function(e,t,n,i){i&&void 0===t||la((0,r.errorPrefix)(e,"value"),t,n)},la=function(e,t,n){var i=n instanceof lt?new kt(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+Pt(i));if("function"==typeof t)throw new Error(e+"contains a function "+Pt(i)+" with contents = "+t.toString());if(x(t))throw new Error(e+"contains "+t.toString()+" "+Pt(i));if("string"==typeof t&&t.length>ra/3&&(0,r.stringLength)(t)>ra)throw new Error(e+"contains a string greater than "+ra+" utf8 bytes "+Pt(i)+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){var o=!1,a=!1;if(L(t,function(t,n){if(".value"===t)o=!0;else if(".priority"!==t&&".sv"!==t&&(a=!0,!ia(t)))throw new Error(e+" contains an invalid key ("+t+") "+Pt(i)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');It(i,t),la(e,n,i),Et(i)}),o&&a)throw new Error(e+' contains ".value" child '+Pt(i)+" in addition to actual children.")}},ca=function(e,t){var n,r;for(n=0;n<t.length;n++)for(var i=vt(r=t[n]),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!ia(i[o]))throw new Error(e+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');t.sort(wt);var a=null;for(n=0;n<t.length;n++){if(r=t[n],null!==a&&Tt(a,r))throw new Error(e+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}},ha=function(e,t,n,i){if(!i||void 0!==t){var o=(0,r.errorPrefix)(e,"values");if(!t||"object"!=typeof t||Array.isArray(t))throw new Error(o+" must be an object containing the children to replace.");var a=[];L(t,function(e,t){var r=new lt(e);if(la(o,t,gt(n,r)),".priority"===ft(r)&&!sa(t))throw new Error(o+"contains an invalid value for '"+r.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(r)}),ca(o,a)}},da=function(e,t,n){if(!n||void 0!==t){if(x(t))throw new Error((0,r.errorPrefix)(e,"priority")+"is "+t.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!sa(t))throw new Error((0,r.errorPrefix)(e,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},pa=function(e,t,n){if(!n||void 0!==t)switch(t){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error((0,r.errorPrefix)(e,"eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},fa=function(e,t,n,i){if(!(i&&void 0===n||ia(n)))throw new Error((0,r.errorPrefix)(e,t)+'was an invalid key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},_a=function(e,t,n,i){if(!(i&&void 0===n||oa(n)))throw new Error((0,r.errorPrefix)(e,t)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},va=function(e,t,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),_a(e,t,n,r)},ya=function(e,t){if(".info"===ht(t))throw new Error(e+" failed = Can't modify data under /.info/")},ga=function(e,t){var n=t.path.toString();if("string"!=typeof t.repoInfo.host||0===t.repoInfo.host.length||!ia(t.repoInfo.namespace)&&"localhost"!==t.repoInfo.host.split(":")[0]||0!==n.length&&!aa(n))throw new Error((0,r.errorPrefix)(e,"url")+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},ma=function(e,t,n,i){if((!i||void 0!==n)&&"boolean"!=typeof n)throw new Error((0,r.errorPrefix)(e,t)+"must be a boolean.")},Ca=function(){return function(){this.eventLists_=[],this.recursionDepth_=0}}();function wa(e,t){for(var n=null,r=0;r<t.length;r++){var i=t[r],o=i.getPath();null===n||bt(o,n.path)||(e.eventLists_.push(n),n=null),null===n&&(n={events:[],path:o}),n.events.push(i)}n&&e.eventLists_.push(n)}function ba(e,t,n){wa(e,n),ka(e,function(e){return bt(e,t)})}function Ta(e,t,n){wa(e,n),ka(e,function(e){return Tt(e,t)||Tt(t,e)})}function ka(e,t){e.recursionDepth_++;for(var n=!0,r=0;r<e.eventLists_.length;r++){var i=e.eventLists_[r];if(i)t(i.path)?(Ia(e.eventLists_[r]),e.eventLists_[r]=null):n=!1}n&&(e.eventLists_=[]),e.recursionDepth_--}function Ia(e){for(var t=0;t<e.events.length;t++){var n=e.events[t];if(null!==n){e.events[t]=null;var r=n.getEventRunner();C&&T("event: "+n.toString()),Y(r)}}}var Ea="repo_interrupt",Sa=25,Pa=function(){function e(e,t,n,r){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=n,this.appCheckProvider_=r,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Ca,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Xn(),this.transactionQueueTree_=new Vo,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}return e.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},e}();function xa(e,t,n){if(e.stats_=ve(e.repoInfo_),e.forceRestClient_||K())e.server_=new $n(e.repoInfo_,function(t,n,r,i){Aa(e,t,n,r,i)},e.authTokenProvider_,e.appCheckProvider_),setTimeout(function(){return Oa(e,!0)},0);else{if(null!=n){if("object"!=typeof n)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{(0,r.stringify)(n)}catch(i){throw new Error("Invalid authOverride provided: "+i)}}e.persistentConnection_=new jt(e.repoInfo_,t,function(t,n,r,i){Aa(e,t,n,r,i)},function(t){Oa(e,t)},function(t){Ma(e,t)},e.authTokenProvider_,e.appCheckProvider_,n),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener(function(t){e.server_.refreshAuthToken(t)}),e.appCheckProvider_.addTokenChangeListener(function(t){e.server_.refreshAppCheckToken(t.token)}),e.statsReporter_=ye(e.repoInfo_,function(){return new ur(e.stats_,e.server_)}),e.infoData_=new Jn,e.infoSyncTree_=new oo({startListening:function(t,n,r,i){var o=[],a=e.infoData_.getNode(t._path);return a.isEmpty()||(o=lo(e.infoSyncTree_,t._path,a),setTimeout(function(){i("ok")},0)),o},stopListening:function(){}}),qa(e,"connected",!1),e.serverSyncTree_=new oo({startListening:function(t,n,r,i){return e.server_.listen(t,r,n,function(n,r){var o=i(n,r);Ta(e.eventQueue_,t._path,o)}),[]},stopListening:function(t,n){e.server_.unlisten(t,n)}})}function Na(e){var t=e.infoData_.getNode(new lt(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t}function Ra(e){return qo({timestamp:Na(e)})}function Aa(e,t,n,i,o){e.dataUpdateCount++;var a=new lt(t);n=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,n):n;var s=[];if(o)if(i){var u=(0,r.map)(n,function(e){return Cn(e)});s=vo(e.serverSyncTree_,a,u,o)}else{var l=Cn(n);s=_o(e.serverSyncTree_,a,l,o)}else if(i){var c=(0,r.map)(n,function(e){return Cn(e)});s=co(e.serverSyncTree_,a,c)}else{var h=Cn(n);s=lo(e.serverSyncTree_,a,h)}var d=a;s.length>0&&(d=is(e,a)),Ta(e.eventQueue_,d,s)}function Da(e,t){e.interceptServerDataCallback_=t}function Oa(e,t){qa(e,"connected",t),!1===t&&Ua(e)}function Ma(e,t){L(t,function(t,n){qa(e,t,n)})}function qa(e,t,n){var r=new lt("/.info/"+t),i=Cn(n);e.infoData_.updateSnapshot(r,i);var o=lo(e.infoSyncTree_,r,i);Ta(e.eventQueue_,r,o)}function Fa(e){return e.nextWriteId_++}function La(e,t){var n=mo(e.serverSyncTree_,t);return null!=n?Promise.resolve(n):e.server_.get(t).then(function(n){var r=Cn(n).withIndex(t._queryParams.getIndex()),i=lo(e.serverSyncTree_,t._path,r);return ba(e.eventQueue_,t._path,i),Promise.resolve(r)},function(n){return Xa(e,"get for query "+(0,r.stringify)(t)+" failed: "+n),Promise.reject(new Error(n))})}function Wa(e,t,n,r,i){Xa(e,"set",{path:t.toString(),value:n,priority:r});var o=Ra(e),a=Cn(n,r),s=go(e.serverSyncTree_,t),u=Uo(a,s,o),l=Fa(e),c=ao(e.serverSyncTree_,t,u,l,!0);wa(e.eventQueue_,c),e.server_.put(t.toString(),a.val(!0),function(n,r){var o="ok"===n;o||S("set at "+t+" failed: "+n);var a=uo(e.serverSyncTree_,l,!o);Ta(e.eventQueue_,t,a),Za(e,i,n,r)});var h=cs(e,t);is(e,h),Ta(e.eventQueue_,h,[])}function ja(e,t,n,r){Xa(e,"update",{path:t.toString(),value:n});var i=!0,o=Ra(e),a={};if(L(n,function(n,r){i=!1,a[n]=jo(gt(t,n),Cn(r),e.serverSyncTree_,o)}),i)T("update() called with empty data. Don't do anything."),Za(e,r,"ok",void 0);else{var s=Fa(e),u=so(e.serverSyncTree_,t,a,s);wa(e.eventQueue_,u),e.server_.merge(t.toString(),n,function(n,i){var o="ok"===n;o||S("update at "+t+" failed: "+n);var a=uo(e.serverSyncTree_,s,!o),u=a.length>0?is(e,t):t;Ta(e.eventQueue_,u,a),Za(e,r,n,i)}),L(n,function(n){var r=cs(e,gt(t,n));is(e,r)}),Ta(e.eventQueue_,t,[])}}function Ua(e){Xa(e,"onDisconnectEvents");var t=Ra(e),n=Xn();tr(e.onDisconnect_,ct(),function(r,i){var o=jo(r,i,e.serverSyncTree_,t);Zn(n,r,o)});var r=[];tr(n,ct(),function(t,n){r=r.concat(lo(e.serverSyncTree_,t,n));var i=cs(e,t);is(e,i)}),e.onDisconnect_=Xn(),Ta(e.eventQueue_,ct(),r)}function Ba(e,t,n){e.server_.onDisconnectCancel(t.toString(),function(r,i){"ok"===r&&er(e.onDisconnect_,t),Za(e,n,r,i)})}function Va(e,t,n,r){var i=Cn(n);e.server_.onDisconnectPut(t.toString(),i.val(!0),function(n,o){"ok"===n&&Zn(e.onDisconnect_,t,i),Za(e,r,n,o)})}function Qa(e,t,n,r,i){var o=Cn(n,r);e.server_.onDisconnectPut(t.toString(),o.val(!0),function(n,r){"ok"===n&&Zn(e.onDisconnect_,t,o),Za(e,i,n,r)})}function Ha(e,t,n,i){if((0,r.isEmpty)(n))return T("onDisconnect().update() called with empty data. Don't do anything."),void Za(e,i,"ok",void 0);e.server_.onDisconnectMerge(t.toString(),n,function(r,o){"ok"===r&&L(n,function(n,r){var i=Cn(r);Zn(e.onDisconnect_,gt(t,n),i)}),Za(e,i,r,o)})}function za(e,t,n){var r;r=".info"===ht(t._path)?yo(e.infoSyncTree_,t,n):yo(e.serverSyncTree_,t,n),ba(e.eventQueue_,t._path,r)}function Ya(e,t,n){var r;r=".info"===ht(t._path)?fo(e.infoSyncTree_,t,n):fo(e.serverSyncTree_,t,n),ba(e.eventQueue_,t._path,r)}function Ka(e){e.persistentConnection_&&e.persistentConnection_.interrupt(Ea)}function Ga(e){e.persistentConnection_&&e.persistentConnection_.resume(Ea)}function $a(e,t){if(void 0===t&&(t=!1),"undefined"!=typeof console){var n;t?(e.statsListener_||(e.statsListener_=new ir(e.stats_)),n=e.statsListener_.get()):n=e.stats_.get();var r=Object.keys(n).reduce(function(e,t){return Math.max(t.length,e)},0);L(n,function(e,t){for(var n=e,i=e.length;i<r+2;i++)n+=" ";console.log(n+t)})}}function Ja(e,t){e.stats_.incrementCounter(t),lr(e.statsReporter_,t)}function Xa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r="";e.persistentConnection_&&(r=e.persistentConnection_.id+":"),T.apply(void 0,(0,i.__spreadArray)([r],(0,i.__read)(t)))}function Za(e,t,n,r){t&&Y(function(){if("ok"===n)t(null);else{var e=(n||"error").toUpperCase(),i=e;r&&(i+=": "+r);var o=new Error(i);o.code=e,t(o)}})}function es(e,t,n,i,o,a){Xa(e,"transaction on "+t);var s={path:t,update:n,onComplete:i,status:null,order:y(),applyLocally:a,retryCount:0,unwatcher:o,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},u=ts(e,t,void 0);s.currentInputSnapshot=u;var l=s.update(u.val());if(void 0===l)s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete&&s.onComplete(null,!1,s.currentInputSnapshot);else{la("transaction failed: Data returned ",l,s.path),s.status=0;var c=Qo(e.transactionQueueTree_,t),h=Ho(c)||[];h.push(s),zo(c,h);var d=void 0;if("object"==typeof l&&null!==l&&(0,r.contains)(l,".priority"))d=(0,r.safeGet)(l,".priority"),(0,r.assert)(sa(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else d=(go(e.serverSyncTree_,t)||vn.EMPTY_NODE).getPriority().val();var p=Ra(e),f=Cn(l,d),_=Uo(f,u,p);s.currentOutputSnapshotRaw=f,s.currentOutputSnapshotResolved=_,s.currentWriteId=Fa(e);var v=ao(e.serverSyncTree_,t,_,s.currentWriteId,s.applyLocally);Ta(e.eventQueue_,t,v),ns(e,e.transactionQueueTree_)}}function ts(e,t,n){return go(e.serverSyncTree_,t,n)||vn.EMPTY_NODE}function ns(e,t){if(void 0===t&&(t=e.transactionQueueTree_),t||ls(e,t),Ho(t)){var n=ss(e,t);(0,r.assert)(n.length>0,"Sending zero length transaction queue"),n.every(function(e){return 0===e.status})&&rs(e,Xo(t),n)}else Yo(t)&&Go(t,function(t){ns(e,t)})}function rs(e,t,n){for(var i=n.map(function(e){return e.currentWriteId}),o=ts(e,t,i),a=o,s=o.hash(),u=0;u<n.length;u++){var l=n[u];(0,r.assert)(0===l.status,"tryToSendTransactionQueue_: items in queue should all be run."),l.status=1,l.retryCount++;var c=Ct(t,l.path);a=a.updateChild(c,l.currentOutputSnapshotRaw)}var h=a.val(!0),d=t;e.server_.put(d.toString(),h,function(r){Xa(e,"transaction put response",{path:d.toString(),status:r});var i=[];if("ok"===r){for(var o=[],a=function(t){n[t].status=2,i=i.concat(uo(e.serverSyncTree_,n[t].currentWriteId)),n[t].onComplete&&o.push(function(){return n[t].onComplete(null,!0,n[t].currentOutputSnapshotResolved)}),n[t].unwatcher()},s=0;s<n.length;s++)a(s);ls(e,Qo(e.transactionQueueTree_,t)),ns(e,e.transactionQueueTree_),Ta(e.eventQueue_,t,i);for(s=0;s<o.length;s++)Y(o[s])}else{if("datastale"===r)for(s=0;s<n.length;s++)3===n[s].status?n[s].status=4:n[s].status=0;else{S("transaction at "+d.toString()+" failed: "+r);for(s=0;s<n.length;s++)n[s].status=4,n[s].abortReason=r}is(e,t)}},s)}function is(e,t){var n=as(e,t),r=Xo(n);return os(e,ss(e,n),r),r}function os(e,t,n){if(0!==t.length){for(var i=[],o=[],a=t.filter(function(e){return 0===e.status}).map(function(e){return e.currentWriteId}),s=function(s){var u,l,c=t[s],h=Ct(n,c.path),d=!1;if((0,r.assert)(null!==h,"rerunTransactionsUnderNode_: relativePath should not be null."),4===c.status)d=!0,u=c.abortReason,o=o.concat(uo(e.serverSyncTree_,c.currentWriteId,!0));else if(0===c.status)if(c.retryCount>=Sa)d=!0,u="maxretry",o=o.concat(uo(e.serverSyncTree_,c.currentWriteId,!0));else{var p=ts(e,c.path,a);c.currentInputSnapshot=p;var f=t[s].update(p.val());if(void 0!==f){la("transaction failed: Data returned ",f,c.path);var _=Cn(f);"object"==typeof f&&null!=f&&(0,r.contains)(f,".priority")||(_=_.updatePriority(p.getPriority()));var v=c.currentWriteId,y=Ra(e),g=Uo(_,p,y);c.currentOutputSnapshotRaw=_,c.currentOutputSnapshotResolved=g,c.currentWriteId=Fa(e),a.splice(a.indexOf(v),1),o=(o=o.concat(ao(e.serverSyncTree_,c.path,g,c.currentWriteId,c.applyLocally))).concat(uo(e.serverSyncTree_,v,!0))}else d=!0,u="nodata",o=o.concat(uo(e.serverSyncTree_,c.currentWriteId,!0))}Ta(e.eventQueue_,n,o),o=[],d&&(t[s].status=2,l=t[s].unwatcher,setTimeout(l,Math.floor(0)),t[s].onComplete&&("nodata"===u?i.push(function(){return t[s].onComplete(null,!1,t[s].currentInputSnapshot)}):i.push(function(){return t[s].onComplete(new Error(u),!1,null)})))},u=0;u<t.length;u++)s(u);ls(e,e.transactionQueueTree_);for(u=0;u<i.length;u++)Y(i[u]);ns(e,e.transactionQueueTree_)}}function as(e,t){var n,r=e.transactionQueueTree_;for(n=ht(t);null!==n&&void 0===Ho(r);)r=Qo(r,n),n=ht(t=pt(t));return r}function ss(e,t){var n=[];return us(e,t,n),n.sort(function(e,t){return e.order-t.order}),n}function us(e,t,n){var r=Ho(t);if(r)for(var i=0;i<r.length;i++)n.push(r[i]);Go(t,function(t){us(e,t,n)})}function ls(e,t){var n=Ho(t);if(n){for(var r=0,i=0;i<n.length;i++)2!==n[i].status&&(n[r]=n[i],r++);n.length=r,zo(t,n.length>0?n:void 0)}Go(t,function(t){ls(e,t)})}function cs(e,t){var n=Xo(as(e,t)),r=Qo(e.transactionQueueTree_,t);return Jo(r,function(t){hs(e,t)}),hs(e,r),$o(r,function(t){hs(e,t)}),n}function hs(e,t){var n=Ho(t);if(n){for(var i=[],o=[],a=-1,s=0;s<n.length;s++)3===n[s].status||(1===n[s].status?((0,r.assert)(a===s-1,"All SENT items should be at beginning of queue."),a=s,n[s].status=3,n[s].abortReason="set"):((0,r.assert)(0===n[s].status,"Unexpected transaction status in abort"),n[s].unwatcher(),o=o.concat(uo(e.serverSyncTree_,n[s].currentWriteId,!0)),n[s].onComplete&&i.push(n[s].onComplete.bind(null,new Error("set"),!1,null))));-1===a?zo(t,void 0):n.length=a+1,Ta(e.eventQueue_,Xo(t),o);for(s=0;s<i.length;s++)Y(i[s])}}function ds(e){for(var t="",n=e.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}t+="/"+i}return t}function ps(e){var t,n,r={};"?"===e.charAt(0)&&(e=e.substring(1));try{for(var o=(0,i.__values)(e.split("&")),a=o.next();!a.done;a=o.next()){var s=a.value;if(0!==s.length){var u=s.split("=");2===u.length?r[decodeURIComponent(u[0])]=decodeURIComponent(u[1]):S("Invalid query segment '"+s+"' in query '"+e+"'")}}}catch(l){t={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}var fs=function(e,t){var n=_s(e),r=n.namespace;"firebase.com"===n.domain&&E(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||E("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||P();var i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new ce(n.host,n.secure,r,t,i,"",r!==n.subdomain),path:new lt(n.pathString)}},_s=function(e){var t="",n="",r="",i="",o="",a=!0,s="https",u=443;if("string"==typeof e){var l=e.indexOf("//");l>=0&&(s=e.substring(0,l-1),e=e.substring(l+2));var c=e.indexOf("/");-1===c&&(c=e.length);var h=e.indexOf("?");-1===h&&(h=e.length),t=e.substring(0,Math.min(c,h)),c<h&&(i=ds(e.substring(c,h)));var d=ps(e.substring(Math.min(e.length,h)));(l=t.indexOf(":"))>=0?(a="https"===s||"wss"===s,u=parseInt(t.substring(l+1),10)):l=t.length;var p=t.slice(0,l);if("localhost"===p.toLowerCase())n="localhost";else if(p.split(".").length<=2)n=p;else{var f=t.indexOf(".");r=t.substring(0,f).toLowerCase(),n=t.substring(f+1),o=r}"ns"in d&&(o=d.ns)}return{host:t,port:u,domain:n,subdomain:r,secure:a,scheme:s,pathString:i,namespace:o}},vs=function(){function e(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}return e.prototype.getPath=function(){var e=this.snapshot.ref;return"value"===this.eventType?e._path:e.parent._path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+(0,r.stringify)(this.snapshot.exportVal())},e}(),ys=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}(),gs=function(){function e(e,t){this.snapshotCallback=e,this.cancelCallback=t}return e.prototype.onValue=function(e,t){this.snapshotCallback.call(null,e,t)},e.prototype.onCancel=function(e){return(0,r.assert)(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)},Object.defineProperty(e.prototype,"hasCancelCallback",{get:function(){return!!this.cancelCallback},enumerable:!1,configurable:!0}),e.prototype.matches=function(e){return this.snapshotCallback===e.snapshotCallback||void 0!==this.snapshotCallback.userCallback&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context},e}(),ms=function(){function e(e,t){this._repo=e,this._path=t}return e.prototype.cancel=function(){var e=new r.Deferred;return Ba(this._repo,this._path,e.wrapCallback(function(){})),e.promise},e.prototype.remove=function(){ya("OnDisconnect.remove",this._path);var e=new r.Deferred;return Va(this._repo,this._path,null,e.wrapCallback(function(){})),e.promise},e.prototype.set=function(e){ya("OnDisconnect.set",this._path),ua("OnDisconnect.set",e,this._path,!1);var t=new r.Deferred;return Va(this._repo,this._path,e,t.wrapCallback(function(){})),t.promise},e.prototype.setWithPriority=function(e,t){ya("OnDisconnect.setWithPriority",this._path),ua("OnDisconnect.setWithPriority",e,this._path,!1),da("OnDisconnect.setWithPriority",t,!1);var n=new r.Deferred;return Qa(this._repo,this._path,e,t,n.wrapCallback(function(){})),n.promise},e.prototype.update=function(e){ya("OnDisconnect.update",this._path),ha("OnDisconnect.update",e,this._path,!1);var t=new r.Deferred;return Ha(this._repo,this._path,e,t.wrapCallback(function(){})),t.promise},e}(),Cs=function(){function e(e,t,n,r){this._repo=e,this._path=t,this._queryParams=n,this._orderByCalled=r}return Object.defineProperty(e.prototype,"key",{get:function(){return mt(this._path)?null:ft(this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ref",{get:function(){return new ks(this._repo,this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_queryIdentifier",{get:function(){var e=Gn(this._queryParams),t=q(e);return"{}"===t?"default":t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_queryObject",{get:function(){return Gn(this._queryParams)},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){if(!((t=(0,r.getModularInstance)(t))instanceof e))return!1;var n=this._repo===t._repo,i=bt(this._path,t._path),o=this._queryIdentifier===t._queryIdentifier;return n&&i&&o},e.prototype.toJSON=function(){return this.toString()},e.prototype.toString=function(){return this._repo.toString()+_t(this._path)},e}();function ws(e,t){if(!0===e._orderByCalled)throw new Error(t+": You can't combine multiple orderBy calls.")}function bs(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===Qt){var i="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",o="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!==R)throw new Error(i);if("string"!=typeof t)throw new Error(o)}if(e.hasEnd()){if(e.getIndexEndName()!==A)throw new Error(i);if("string"!=typeof n)throw new Error(o)}}else if(e.getIndex()===cn){if(null!=t&&!sa(t)||null!=n&&!sa(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((0,r.assert)(e.getIndex()instanceof wn||e.getIndex()===Tn,"unknown index type."),null!=t&&"object"==typeof t||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function Ts(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}var ks=function(e){function t(t,n){return e.call(this,t,n,new Wn,!1)||this}return(0,i.__extends)(t,e),Object.defineProperty(t.prototype,"parent",{get:function(){var e=yt(this._path);return null===e?null:new t(this._repo,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e},enumerable:!1,configurable:!0}),t}(Cs),Is=function(){function e(e,t,n){this._node=e,this.ref=t,this._index=n}return Object.defineProperty(e.prototype,"priority",{get:function(){return this._node.getPriority().val()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.ref.key},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._node.numChildren()},enumerable:!1,configurable:!0}),e.prototype.child=function(t){var n=new lt(t),r=Ps(this.ref,t);return new e(this._node.getChild(n),r,cn)},e.prototype.exists=function(){return!this._node.isEmpty()},e.prototype.exportVal=function(){return this._node.val(!0)},e.prototype.forEach=function(t){var n=this;return!this._node.isLeafNode()&&!!this._node.forEachChild(this._index,function(r,i){return t(new e(i,Ps(n.ref,r),cn))})},e.prototype.hasChild=function(e){var t=new lt(e);return!this._node.getChild(t).isEmpty()},e.prototype.hasChildren=function(){return!this._node.isLeafNode()&&!this._node.isEmpty()},e.prototype.toJSON=function(){return this.exportVal()},e.prototype.val=function(){return this._node.val()},e}();function Es(e,t){return(e=(0,r.getModularInstance)(e))._checkNotDeleted("ref"),void 0!==t?Ps(e._root,t):e._root}function Ss(e,t){(e=(0,r.getModularInstance)(e))._checkNotDeleted("refFromURL");var n=fs(t,e._repo.repoInfo_.nodeAdmin);ga("refFromURL",n);var i=n.repoInfo;return e._repo.repoInfo_.isCustomHost()||i.host===e._repo.repoInfo_.host||E("refFromURL: Host name does not match the current database: (found "+i.host+" but expected "+e._repo.repoInfo_.host+")"),Es(e,n.path.toString())}function Ps(e,t){return null===ht((e=(0,r.getModularInstance)(e))._path)?va("child","path",t,!1):_a("child","path",t,!1),new ks(e._repo,gt(e._path,t))}function xs(e,t){e=(0,r.getModularInstance)(e),ya("push",e._path),ua("push",t,e._path,!0);var n,i=Na(e._repo),o=Pn(i),a=Ps(e,o),s=Ps(e,o);return n=null!=t?Rs(s,t).then(function(){return s}):Promise.resolve(s),a.then=n.then.bind(n),a.catch=n.then.bind(n,void 0),a}function Ns(e){return ya("remove",e._path),Rs(e,null)}function Rs(e,t){e=(0,r.getModularInstance)(e),ya("set",e._path),ua("set",t,e._path,!1);var n=new r.Deferred;return Wa(e._repo,e._path,t,null,n.wrapCallback(function(){})),n.promise}function As(e,t){e=(0,r.getModularInstance)(e),ya("setPriority",e._path),da("setPriority",t,!1);var n=new r.Deferred;return Wa(e._repo,gt(e._path,".priority"),t,null,n.wrapCallback(function(){})),n.promise}function Ds(e,t,n){if(ya("setWithPriority",e._path),ua("setWithPriority",t,e._path,!1),da("setWithPriority",n,!1),".length"===e.key||".keys"===e.key)throw"setWithPriority failed: "+e.key+" is a read-only object.";var i=new r.Deferred;return Wa(e._repo,e._path,t,n,i.wrapCallback(function(){})),i.promise}function Os(e,t){ha("update",t,e._path,!1);var n=new r.Deferred;return ja(e._repo,e._path,t,n.wrapCallback(function(){})),n.promise}function Ms(e){return La((e=(0,r.getModularInstance)(e))._repo,e).then(function(t){return new Is(t,new ks(e._repo,e._path),e._queryParams.getIndex())})}var qs=function(){function e(e){this.callbackContext=e}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t._queryParams.getIndex();return new vs("value",this,new Is(e.snapshotNode,new ks(t._repo,t._path),n))},e.prototype.getEventRunner=function(e){var t=this;return"cancel"===e.getEventType()?function(){return t.callbackContext.onCancel(e.error)}:function(){return t.callbackContext.onValue(e.snapshot,null)}},e.prototype.createCancelEvent=function(e,t){return this.callbackContext.hasCancelCallback?new ys(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.callbackContext||!this.callbackContext||t.callbackContext.matches(this.callbackContext))},e.prototype.hasAnyCallback=function(){return null!==this.callbackContext},e}(),Fs=function(){function e(e,t){this.eventType=e,this.callbackContext=t}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,this.eventType===t},e.prototype.createCancelEvent=function(e,t){return this.callbackContext.hasCancelCallback?new ys(this,e,t):null},e.prototype.createEvent=function(e,t){(0,r.assert)(null!=e.childName,"Child events should have a childName.");var n=Ps(new ks(t._repo,t._path),e.childName),i=t._queryParams.getIndex();return new vs(e.type,this,new Is(e.snapshotNode,n,i),e.prevName)},e.prototype.getEventRunner=function(e){var t=this;return"cancel"===e.getEventType()?function(){return t.callbackContext.onCancel(e.error)}:function(){return t.callbackContext.onValue(e.snapshot,e.prevName)}},e.prototype.matches=function(t){return t instanceof e&&(this.eventType===t.eventType&&(!this.callbackContext||!t.callbackContext||this.callbackContext.matches(t.callbackContext)))},e.prototype.hasAnyCallback=function(){return!!this.callbackContext},e}();function Ls(e,t,n,r,i){var o;if("object"==typeof r&&(o=void 0,i=r),"function"==typeof r&&(o=r),i&&i.onlyOnce){var a=n,s=function(t,n){Ya(e._repo,e,l),a(t,n)};s.userCallback=n.userCallback,s.context=n.context,n=s}var u=new gs(n,o||void 0),l="value"===t?new qs(u):new Fs(t,u);return za(e._repo,e,l),function(){return Ya(e._repo,e,l)}}function Ws(e,t,n,r){return Ls(e,"value",t,n,r)}function js(e,t,n,r){return Ls(e,"child_added",t,n,r)}function Us(e,t,n,r){return Ls(e,"child_changed",t,n,r)}function Bs(e,t,n,r){return Ls(e,"child_moved",t,n,r)}function Vs(e,t,n,r){return Ls(e,"child_removed",t,n,r)}function Qs(e,t,n){var r=null,i=n?new gs(n):null;"value"===t?r=new qs(i):t&&(r=new Fs(t,i)),Ya(e._repo,e,r)}var Hs=function(){return function(){}}(),zs=function(e){function t(t,n){var r=e.call(this)||this;return r._value=t,r._key=n,r}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ua("endAt",this._value,e._path,!0);var t=Hn(e._queryParams,this._value,this._key);if(Ts(t),bs(t),e._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new Cs(e._repo,e._path,t,e._orderByCalled)},t}(Hs);function Ys(e,t){return fa("endAt","key",t,!0),new zs(e,t)}var Ks=function(e){function t(t,n){var r=e.call(this)||this;return r._value=t,r._key=n,r}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ua("endBefore",this._value,e._path,!1);var t=zn(e._queryParams,this._value,this._key);if(Ts(t),bs(t),e._queryParams.hasEnd())throw new Error("endBefore: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new Cs(e._repo,e._path,t,e._orderByCalled)},t}(Hs);function Gs(e,t){return fa("endBefore","key",t,!0),new Ks(e,t)}var $s=function(e){function t(t,n){var r=e.call(this)||this;return r._value=t,r._key=n,r}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ua("startAt",this._value,e._path,!0);var t=Vn(e._queryParams,this._value,this._key);if(Ts(t),bs(t),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new Cs(e._repo,e._path,t,e._orderByCalled)},t}(Hs);function Js(e,t){return void 0===e&&(e=null),fa("startAt","key",t,!0),new $s(e,t)}var Xs=function(e){function t(t,n){var r=e.call(this)||this;return r._value=t,r._key=n,r}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ua("startAfter",this._value,e._path,!1);var t=Qn(e._queryParams,this._value,this._key);if(Ts(t),bs(t),e._queryParams.hasStart())throw new Error("startAfter: Starting point was already set (by another call to startAt, startAfter, or equalTo).");return new Cs(e._repo,e._path,t,e._orderByCalled)},t}(Hs);function Zs(e,t){return fa("startAfter","key",t,!0),new Xs(e,t)}var eu=function(e){function t(t){var n=e.call(this)||this;return n._limit=t,n}return(0,i.__extends)(t,e),t.prototype._apply=function(e){if(e._queryParams.hasLimit())throw new Error("limitToFirst: Limit was already set (by another call to limitToFirst or limitToLast).");return new Cs(e._repo,e._path,Un(e._queryParams,this._limit),e._orderByCalled)},t}(Hs);function tu(e){if("number"!=typeof e||Math.floor(e)!==e||e<=0)throw new Error("limitToFirst: First argument must be a positive integer.");return new eu(e)}var nu=function(e){function t(t){var n=e.call(this)||this;return n._limit=t,n}return(0,i.__extends)(t,e),t.prototype._apply=function(e){if(e._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new Cs(e._repo,e._path,Bn(e._queryParams,this._limit),e._orderByCalled)},t}(Hs);function ru(e){if("number"!=typeof e||Math.floor(e)!==e||e<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new nu(e)}var iu=function(e){function t(t){var n=e.call(this)||this;return n._path=t,n}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ws(e,"orderByChild");var t=new lt(this._path);if(mt(t))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");var n=new wn(t),r=Yn(e._queryParams,n);return bs(r),new Cs(e._repo,e._path,r,!0)},t}(Hs);function ou(e){if("$key"===e)throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if("$priority"===e)throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if("$value"===e)throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return _a("orderByChild","path",e,!1),new iu(e)}var au=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ws(e,"orderByKey");var t=Yn(e._queryParams,Qt);return bs(t),new Cs(e._repo,e._path,t,!0)},t}(Hs);function su(){return new au}var uu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ws(e,"orderByPriority");var t=Yn(e._queryParams,cn);return bs(t),new Cs(e._repo,e._path,t,!0)},t}(Hs);function lu(){return new uu}var cu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.__extends)(t,e),t.prototype._apply=function(e){ws(e,"orderByValue");var t=Yn(e._queryParams,Tn);return bs(t),new Cs(e._repo,e._path,t,!0)},t}(Hs);function hu(){return new cu}var du=function(e){function t(t,n){var r=e.call(this)||this;return r._value=t,r._key=n,r}return(0,i.__extends)(t,e),t.prototype._apply=function(e){if(ua("equalTo",this._value,e._path,!1),e._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(e._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new zs(this._value,this._key)._apply(new $s(this._value,this._key)._apply(e))},t}(Hs);function pu(e,t){return fa("equalTo","key",t,!0),new du(e,t)}function fu(e){for(var t,n,o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];var s=(0,r.getModularInstance)(e);try{for(var u=(0,i.__values)(o),l=u.next();!l.done;l=u.next()){s=l.value._apply(s)}}catch(c){t={error:c}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return s}Vi(ks),no(ks);var _u="FIREBASE_DATABASE_EMULATOR_HOST",vu={},yu=!1;function gu(e,t,n,r){e.repoInfo_=new ce(t+":"+n,!1,e.repoInfo_.namespace,e.repoInfo_.webSocketOnly,e.repoInfo_.nodeAdmin,e.repoInfo_.persistenceKey,e.repoInfo_.includeNamespaceInQueryParams),r&&(e.authTokenProvider_=r)}function mu(t,n,r,i,o){var a=i||t.options.databaseURL;void 0===a&&(t.options.projectId||E("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),T("Using default host for project ",t.options.projectId),a=t.options.projectId+"-default-rtdb.firebaseio.com");var s,u=fs(a,o),l=u.repoInfo,c=void 0;void 0!==e&&(c=e.env[_u]),c?(s=!0,a="http://"+c+"?ns="+l.namespace,l=(u=fs(a,o)).repoInfo):s=!u.repoInfo.secure;var h=o&&s?new X(X.OWNER):new J(t.name,t.options,n);ga("Invalid Firebase Database URL",u),mt(u.path)||E("Database URL must point to the root of a Firebase Database (not including a child path).");var d=wu(l,t,h,new $(t.name,r));return new Tu(d,t)}function Cu(e,t){var n=vu[t];n&&n[e.key]===e||E("Database "+t+"("+e.repoInfo_+") has already been deleted."),Ka(e),delete n[e.key]}function wu(e,t,n,r){var i=vu[t.name];i||(i={},vu[t.name]=i);var o=i[e.toURLString()];return o&&E("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),o=new Pa(e,yu,n,r),i[e.toURLString()]=o,o}function bu(e){yu=e}var Tu=function(){function e(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}return Object.defineProperty(e.prototype,"_repo",{get:function(){return this._instanceStarted||(xa(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_root",{get:function(){return this._rootInternal||(this._rootInternal=new ks(this._repo,ct())),this._rootInternal},enumerable:!1,configurable:!0}),e.prototype._delete=function(){return null!==this._rootInternal&&(Cu(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()},e.prototype._checkNotDeleted=function(e){null===this._rootInternal&&E("Cannot call "+e+" on a deleted database.")},e}();function ku(e,t,n,i){void 0===i&&(i={}),(e=(0,r.getModularInstance)(e))._checkNotDeleted("useEmulator"),e._instanceStarted&&E("Cannot call useEmulator() after instance has already been initialized.");var o=e._repoInternal,a=void 0;if(o.repoInfo_.nodeAdmin)i.mockUserToken&&E('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),a=new X(X.OWNER);else if(i.mockUserToken){var s="string"==typeof i.mockUserToken?i.mockUserToken:(0,r.createMockUserToken)(i.mockUserToken,e.app.options.projectId);a=new X(s)}gu(o,t,n,a)}function Iu(e){(e=(0,r.getModularInstance)(e))._checkNotDeleted("goOffline"),Ka(e._repo)}function Eu(e){(e=(0,r.getModularInstance)(e))._checkNotDeleted("goOnline"),Ga(e._repo)}var Su={".sv":"timestamp"};function Pu(){return Su}function xu(e){return{".sv":{increment:e}}}var Nu=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}();function Ru(e,t,n){var i;if(e=(0,r.getModularInstance)(e),ya("Reference.transaction",e._path),".length"===e.key||".keys"===e.key)throw"Reference.transaction failed: "+e.key+" is a read-only object.";var o=null===(i=null==n?void 0:n.applyLocally)||void 0===i||i,a=new r.Deferred,s=Ws(e,function(){});return es(e._repo,e._path,t,function(t,n,r){var i=null;t?a.reject(t):(i=new Is(r,new ks(e._repo,e._path),cn),a.resolve(new Nu(n,i)))},s,o),a.promise}var Au=function(){function e(e){this._delegate=e}return e.prototype.cancel=function(e){(0,r.validateArgCount)("OnDisconnect.cancel",0,1,arguments.length),(0,r.validateCallback)("OnDisconnect.cancel","onComplete",e,!0);var t=this._delegate.cancel();return e&&t.then(function(){return e(null)},function(t){return e(t)}),t},e.prototype.remove=function(e){(0,r.validateArgCount)("OnDisconnect.remove",0,1,arguments.length),(0,r.validateCallback)("OnDisconnect.remove","onComplete",e,!0);var t=this._delegate.remove();return e&&t.then(function(){return e(null)},function(t){return e(t)}),t},e.prototype.set=function(e,t){(0,r.validateArgCount)("OnDisconnect.set",1,2,arguments.length),(0,r.validateCallback)("OnDisconnect.set","onComplete",t,!0);var n=this._delegate.set(e);return t&&n.then(function(){return t(null)},function(e){return t(e)}),n},e.prototype.setWithPriority=function(e,t,n){(0,r.validateArgCount)("OnDisconnect.setWithPriority",2,3,arguments.length),(0,r.validateCallback)("OnDisconnect.setWithPriority","onComplete",n,!0);var i=this._delegate.setWithPriority(e,t);return n&&i.then(function(){return n(null)},function(e){return n(e)}),i},e.prototype.update=function(e,t){if((0,r.validateArgCount)("OnDisconnect.update",1,2,arguments.length),Array.isArray(e)){for(var n={},i=0;i<e.length;++i)n[""+i]=e[i];e=n,S("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.")}(0,r.validateCallback)("OnDisconnect.update","onComplete",t,!0);var o=this._delegate.update(e);return t&&o.then(function(){return t(null)},function(e){return t(e)}),o},e}();exports.OnDisconnect=Au;var Du=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return(0,r.validateArgCount)("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}(),Ou=function(){function e(e,t){this._database=e,this._delegate=t}return e.prototype.val=function(){return(0,r.validateArgCount)("DataSnapshot.val",0,0,arguments.length),this._delegate.val()},e.prototype.exportVal=function(){return(0,r.validateArgCount)("DataSnapshot.exportVal",0,0,arguments.length),this._delegate.exportVal()},e.prototype.toJSON=function(){return(0,r.validateArgCount)("DataSnapshot.toJSON",0,1,arguments.length),this._delegate.toJSON()},e.prototype.exists=function(){return(0,r.validateArgCount)("DataSnapshot.exists",0,0,arguments.length),this._delegate.exists()},e.prototype.child=function(t){return(0,r.validateArgCount)("DataSnapshot.child",0,1,arguments.length),t=String(t),_a("DataSnapshot.child","path",t,!1),new e(this._database,this._delegate.child(t))},e.prototype.hasChild=function(e){return(0,r.validateArgCount)("DataSnapshot.hasChild",1,1,arguments.length),_a("DataSnapshot.hasChild","path",e,!1),this._delegate.hasChild(e)},e.prototype.getPriority=function(){return(0,r.validateArgCount)("DataSnapshot.getPriority",0,0,arguments.length),this._delegate.priority},e.prototype.forEach=function(t){var n=this;return(0,r.validateArgCount)("DataSnapshot.forEach",1,1,arguments.length),(0,r.validateCallback)("DataSnapshot.forEach","action",t,!1),this._delegate.forEach(function(r){return t(new e(n._database,r))})},e.prototype.hasChildren=function(){return(0,r.validateArgCount)("DataSnapshot.hasChildren",0,0,arguments.length),this._delegate.hasChildren()},Object.defineProperty(e.prototype,"key",{get:function(){return this._delegate.key},enumerable:!1,configurable:!0}),e.prototype.numChildren=function(){return(0,r.validateArgCount)("DataSnapshot.numChildren",0,0,arguments.length),this._delegate.size},e.prototype.getRef=function(){return(0,r.validateArgCount)("DataSnapshot.ref",0,0,arguments.length),new qu(this._database,this._delegate.ref)},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),e}();exports.DataSnapshot=Ou;var Mu=function(){function e(e,t){this.database=e,this._delegate=t}return e.prototype.on=function(t,n,i,o){var a,s=this;(0,r.validateArgCount)("Query.on",2,4,arguments.length),(0,r.validateCallback)("Query.on","callback",n,!1);var u=e.getCancelAndContextArgs_("Query.on",i,o),l=function(e,t){n.call(u.context,new Ou(s.database,e),t)};l.userCallback=n,l.context=u.context;var c=null===(a=u.cancel)||void 0===a?void 0:a.bind(u.context);switch(t){case"value":return Ws(this._delegate,l,c),n;case"child_added":return js(this._delegate,l,c),n;case"child_removed":return Vs(this._delegate,l,c),n;case"child_changed":return Us(this._delegate,l,c),n;case"child_moved":return Bs(this._delegate,l,c),n;default:throw new Error((0,r.errorPrefix)("Query.on","eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},e.prototype.off=function(e,t,n){if((0,r.validateArgCount)("Query.off",0,3,arguments.length),pa("Query.off",e,!0),(0,r.validateCallback)("Query.off","callback",t,!0),(0,r.validateContextObject)("Query.off","context",n,!0),t){var i=function(){};i.userCallback=t,i.context=n,Qs(this._delegate,e,i)}else Qs(this._delegate,e)},e.prototype.get=function(){var e=this;return Ms(this._delegate).then(function(t){return new Ou(e.database,t)})},e.prototype.once=function(t,n,i,o){var a=this;(0,r.validateArgCount)("Query.once",1,4,arguments.length),(0,r.validateCallback)("Query.once","callback",n,!0);var s=e.getCancelAndContextArgs_("Query.once",i,o),u=new r.Deferred,l=function(e,t){var r=new Ou(a.database,e);n&&n.call(s.context,r,t),u.resolve(r)};l.userCallback=n,l.context=s.context;var c=function(e){s.cancel&&s.cancel.call(s.context,e),u.reject(e)};switch(t){case"value":Ws(this._delegate,l,c,{onlyOnce:!0});break;case"child_added":js(this._delegate,l,c,{onlyOnce:!0});break;case"child_removed":Vs(this._delegate,l,c,{onlyOnce:!0});break;case"child_changed":Us(this._delegate,l,c,{onlyOnce:!0});break;case"child_moved":Bs(this._delegate,l,c,{onlyOnce:!0});break;default:throw new Error((0,r.errorPrefix)("Query.once","eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}return u.promise},e.prototype.limitToFirst=function(t){return(0,r.validateArgCount)("Query.limitToFirst",1,1,arguments.length),new e(this.database,fu(this._delegate,tu(t)))},e.prototype.limitToLast=function(t){return(0,r.validateArgCount)("Query.limitToLast",1,1,arguments.length),new e(this.database,fu(this._delegate,ru(t)))},e.prototype.orderByChild=function(t){return(0,r.validateArgCount)("Query.orderByChild",1,1,arguments.length),new e(this.database,fu(this._delegate,ou(t)))},e.prototype.orderByKey=function(){return(0,r.validateArgCount)("Query.orderByKey",0,0,arguments.length),new e(this.database,fu(this._delegate,su()))},e.prototype.orderByPriority=function(){return(0,r.validateArgCount)("Query.orderByPriority",0,0,arguments.length),new e(this.database,fu(this._delegate,lu()))},e.prototype.orderByValue=function(){return(0,r.validateArgCount)("Query.orderByValue",0,0,arguments.length),new e(this.database,fu(this._delegate,hu()))},e.prototype.startAt=function(t,n){return void 0===t&&(t=null),(0,r.validateArgCount)("Query.startAt",0,2,arguments.length),new e(this.database,fu(this._delegate,Js(t,n)))},e.prototype.startAfter=function(t,n){return void 0===t&&(t=null),(0,r.validateArgCount)("Query.startAfter",0,2,arguments.length),new e(this.database,fu(this._delegate,Zs(t,n)))},e.prototype.endAt=function(t,n){return void 0===t&&(t=null),(0,r.validateArgCount)("Query.endAt",0,2,arguments.length),new e(this.database,fu(this._delegate,Ys(t,n)))},e.prototype.endBefore=function(t,n){return void 0===t&&(t=null),(0,r.validateArgCount)("Query.endBefore",0,2,arguments.length),new e(this.database,fu(this._delegate,Gs(t,n)))},e.prototype.equalTo=function(t,n){return(0,r.validateArgCount)("Query.equalTo",1,2,arguments.length),new e(this.database,fu(this._delegate,pu(t,n)))},e.prototype.toString=function(){return(0,r.validateArgCount)("Query.toString",0,0,arguments.length),this._delegate.toString()},e.prototype.toJSON=function(){return(0,r.validateArgCount)("Query.toJSON",0,1,arguments.length),this._delegate.toJSON()},e.prototype.isEqual=function(t){if((0,r.validateArgCount)("Query.isEqual",1,1,arguments.length),!(t instanceof e)){throw new Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.")}return this._delegate.isEqual(t._delegate)},e.getCancelAndContextArgs_=function(e,t,n){var i={cancel:void 0,context:void 0};if(t&&n)i.cancel=t,(0,r.validateCallback)(e,"cancel",i.cancel,!0),i.context=n,(0,r.validateContextObject)(e,"context",i.context,!0);else if(t)if("object"==typeof t&&null!==t)i.context=t;else{if("function"!=typeof t)throw new Error((0,r.errorPrefix)(e,"cancelOrContext")+" must either be a cancel callback or a context object.");i.cancel=t}return i},Object.defineProperty(e.prototype,"ref",{get:function(){return new qu(this.database,new ks(this._delegate._repo,this._delegate._path))},enumerable:!1,configurable:!0}),e}();exports.Query=Mu;var qu=function(e){function t(t,n){var r=e.call(this,t,new Cs(n._repo,n._path,new Wn,!1))||this;return r.database=t,r._delegate=n,r}return(0,i.__extends)(t,e),t.prototype.getKey=function(){return(0,r.validateArgCount)("Reference.key",0,0,arguments.length),this._delegate.key},t.prototype.child=function(e){return(0,r.validateArgCount)("Reference.child",1,1,arguments.length),"number"==typeof e&&(e=String(e)),new t(this.database,Ps(this._delegate,e))},t.prototype.getParent=function(){(0,r.validateArgCount)("Reference.parent",0,0,arguments.length);var e=this._delegate.parent;return e?new t(this.database,e):null},t.prototype.getRoot=function(){return(0,r.validateArgCount)("Reference.root",0,0,arguments.length),new t(this.database,this._delegate.root)},t.prototype.set=function(e,t){(0,r.validateArgCount)("Reference.set",1,2,arguments.length),(0,r.validateCallback)("Reference.set","onComplete",t,!0);var n=Rs(this._delegate,e);return t&&n.then(function(){return t(null)},function(e){return t(e)}),n},t.prototype.update=function(e,t){if((0,r.validateArgCount)("Reference.update",1,2,arguments.length),Array.isArray(e)){for(var n={},i=0;i<e.length;++i)n[""+i]=e[i];e=n,S("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.")}ya("Reference.update",this._delegate._path),(0,r.validateCallback)("Reference.update","onComplete",t,!0);var o=Os(this._delegate,e);return t&&o.then(function(){return t(null)},function(e){return t(e)}),o},t.prototype.setWithPriority=function(e,t,n){(0,r.validateArgCount)("Reference.setWithPriority",2,3,arguments.length),(0,r.validateCallback)("Reference.setWithPriority","onComplete",n,!0);var i=Ds(this._delegate,e,t);return n&&i.then(function(){return n(null)},function(e){return n(e)}),i},t.prototype.remove=function(e){(0,r.validateArgCount)("Reference.remove",0,1,arguments.length),(0,r.validateCallback)("Reference.remove","onComplete",e,!0);var t=Ns(this._delegate);return e&&t.then(function(){return e(null)},function(t){return e(t)}),t},t.prototype.transaction=function(e,t,n){var i=this;(0,r.validateArgCount)("Reference.transaction",1,3,arguments.length),(0,r.validateCallback)("Reference.transaction","transactionUpdate",e,!1),(0,r.validateCallback)("Reference.transaction","onComplete",t,!0),ma("Reference.transaction","applyLocally",n,!0);var o=Ru(this._delegate,e,{applyLocally:n}).then(function(e){return new Du(e.committed,new Ou(i.database,e.snapshot))});return t&&o.then(function(e){return t(null,e.committed,e.snapshot)},function(e){return t(e,!1,null)}),o},t.prototype.setPriority=function(e,t){(0,r.validateArgCount)("Reference.setPriority",1,2,arguments.length),(0,r.validateCallback)("Reference.setPriority","onComplete",t,!0);var n=As(this._delegate,e);return t&&n.then(function(){return t(null)},function(e){return t(e)}),n},t.prototype.push=function(e,n){var i=this;(0,r.validateArgCount)("Reference.push",0,2,arguments.length),(0,r.validateCallback)("Reference.push","onComplete",n,!0);var o=xs(this._delegate,e),a=o.then(function(e){return new t(i.database,e)});n&&a.then(function(){return n(null)},function(e){return n(e)});var s=new t(this.database,o);return s.then=a.then.bind(a),s.catch=a.catch.bind(a,void 0),s},t.prototype.onDisconnect=function(){return ya("Reference.onDisconnect",this._delegate._path),new Au(new ms(this._delegate._repo,this._delegate._path))},Object.defineProperty(t.prototype,"key",{get:function(){return this.getKey()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.getRoot()},enumerable:!1,configurable:!0}),t}(Mu);exports.Reference=qu;var Fu=function(){function e(e,t){var n=this;this._delegate=e,this.app=t,this.INTERNAL={delete:function(){return n._delegate._delete()}}}return e.prototype.useEmulator=function(e,t,n){void 0===n&&(n={}),ku(this._delegate,e,t,n)},e.prototype.ref=function(e){if((0,r.validateArgCount)("database.ref",0,1,arguments.length),e instanceof qu){var t=Ss(this._delegate,e.toString());return new qu(this,t)}t=Es(this._delegate,e);return new qu(this,t)},e.prototype.refFromURL=function(e){(0,r.validateArgCount)("database.refFromURL",1,1,arguments.length);var t=Ss(this._delegate,e);return new qu(this,t)},e.prototype.goOffline=function(){return(0,r.validateArgCount)("database.goOffline",0,0,arguments.length),Iu(this._delegate)},e.prototype.goOnline=function(){return(0,r.validateArgCount)("database.goOnline",0,0,arguments.length),Eu(this._delegate)},e.ServerValue={TIMESTAMP:Pu(),increment:function(e){return xu(e)}},e}();exports.Database=Fu;var Lu=function(){Ue.forceDisallow(),qe.forceAllow()},Wu=function(){qe.forceDisallow()},ju=function(){return Ue.isAvailable()},Uu=function(e,t){e._delegate._repo.persistentConnection_.securityDebugCallback_=t},Bu=function(e,t){$a(e._delegate._repo,t)},Vu=function(e,t){Ja(e._delegate._repo,t)},Qu=function(e){return e._delegate._repo.dataUpdateCount},Hu=function(e,t){return Da(e._delegate._repo,t)};function zu(e){var t=e.app,r=e.url,i=e.version,o=e.customAuthImpl,a=e.namespace,s=e.nodeAdmin,u=void 0!==s&&s;c(i);var l=new n.Provider("auth-internal",new n.ComponentContainer("database-standalone"));return l.setComponent(new n.Component("auth-internal",function(){return o},"PRIVATE")),{instance:new Fu(mu(t,l,void 0,r,u),t),namespace:a}}var Yu=Object.freeze({__proto__:null,forceLongPolling:Lu,forceWebSockets:Wu,isWebSocketsAvailable:ju,setSecurityDebugCallback:Uu,stats:Bu,statsIncrementCounter:Vu,dataUpdateCount:Qu,interceptServerData:Hu,initStandalone:zu}),Ku=jt;jt.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},jt.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};var Gu=rt,$u=function(e){var t=jt.prototype.put;return jt.prototype.put=function(n,r,i,o){void 0!==o&&(o=e()),t.call(this,n,r,i,o)},function(){jt.prototype.put=t}},Ju=ce,Xu=function(e){return e._delegate._queryIdentifier},Zu=function(e){bu(e)},el=Object.freeze({__proto__:null,DataConnection:Ku,RealTimeConnection:Gu,hijackHash:$u,ConnectionTarget:Ju,queryIdentifier:Xu,forceRestClient:Zu}),tl=Fu.ServerValue;function nl(e){c(e.SDK_VERSION);var t=e.INTERNAL.registerComponent(new n.Component("database",function(e,t){var n=t.instanceIdentifier,r=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),o=e.getProvider("app-check-internal");return new Fu(mu(r,i,o,n),r)},"PUBLIC").setServiceProps({Reference:qu,Query:Mu,Database:Fu,DataSnapshot:Ou,enableLogging:b,INTERNAL:Yu,ServerValue:tl,TEST_ACCESS:el}).setMultipleInstances(!0));e.registerVersion(s,u),(0,r.isNodeSdk)()&&(module.exports=t)}exports.ServerValue=tl,nl(t.default);
|
|
477
|
+
},{"@firebase/app":"VxYX","@firebase/component":"sLOu","@firebase/util":"KxmD","tslib":"f2sD","@firebase/logger":"TUpU","process":"pBGv"}],"Uuoh":[function(require,module,exports) {
|
|
478
|
+
"use strict";require("@firebase/database");
|
|
479
|
+
},{"@firebase/database":"EMWj"}],"EkFk":[function(require,module,exports) {
|
|
480
|
+
var global = arguments[3];
|
|
481
|
+
var t=arguments[3],e=n(require("@firebase/app"));function n(t){return t&&t.__esModule?t:{default:t}}(function(){var n,i="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};var r=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 i=e[n];if(i&&i.Math==Math)return i}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=r;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&&i(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 i(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=r.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(i){this.f(i)}}}this.a=null},n.prototype.f=function(t){this.c(function(){throw t})},e.prototype.f=function(){function t(t){return function(i){n||(n=!0,t.call(e,i))}}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.Ra(e.resolve,e.reject)},e.prototype.u=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(i){n.reject(i)}},e.prototype.then=function(t,n){function i(t,e){return"function"==typeof t?function(e){try{r(t(e))}catch(n){o(n)}}:e}var r,o,a=new e(function(t,e){r=t,o=e});return this.Ra(i(t,r),i(n,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Ra=function(t,e){function n(){switch(i.b){case 1:t(i.c);break;case 2:e(i.c);break;default:throw Error("Unexpected state: "+i.b)}}var i=this;null==this.a?s.b(n):this.a.push(n)},e.resolve=i,e.reject=function(t){return new e(function(e,n){n(t)})},e.race=function(t){return new e(function(e,n){for(var r=a(t),o=r.next();!o.done;o=r.next())i(o.value).Ra(e,n)})},e.all=function(t){var n=a(t),r=n.next();return r.done?i([]):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++,i(r.value).Ra(o(a.length-1),e),r=n.next()}while(!r.done)})},e});var s=s||{},u=this||self,c=/^[\w+/_-]+[=]{0,2}$/,h=null;function l(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,b)&&t[b]||(t[b]=++y)}var b="closure_uid_"+(1e9*Math.random()>>>0),y=0;function w(t,e,n){return t.call.apply(t.bind,arguments)}function I(t,e,n){if(!t)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,i),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function T(t,e,n){return(T=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?w:I).apply(null,arguments)}function E(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 A=Date.now;function k(t,e){function n(){}n.prototype=e.prototype,t.bb=e.prototype,t.prototype=new n,t.prototype.constructor=t}function S(t){return t}function N(t,e,n){this.code=C+t,this.message=e||R[t]||"",this.a=n||null}function _(t){var e=t&&t.code;return e?new N(e.substring(C.length),t.message,t.serverResponse):null}k(N,Error),N.prototype.w=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},N.prototype.toJSON=function(){return this.w()};var O,C="auth/",R={"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 always 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 to 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.","invalid-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."},P={ld:{Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",$a:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Xa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},sd:{Ua:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",$a:"https://securetoken.googleapis.com/v1/token",Xa:"https://identitytoolkit.googleapis.com/v2/",id:"p"},ud:{Ua:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",$a:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Xa:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},vd:{Ua:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",$a:"https://test-securetoken.sandbox.googleapis.com/v1/token",Xa:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};function D(t){for(var e in P)if(P[e].id===t)return{firebaseEndpoint:(t=P[e]).Ua,secureTokenEndpoint:t.$a,identityPlatformEndpoint:t.Xa};return null}function L(t){if(!t)return!1;try{return!!t.$goog_Thenable}catch(e){return!1}}function x(t){if(Error.captureStackTrace)Error.captureStackTrace(this,x);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function M(t,e){for(var n="",i=(t=t.split("%s")).length-1,r=0;r<i;r++)n+=t[r]+(r<e.length?e[r]:"%s");x.call(this,n+t[i])}function j(t,e){throw new M("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function U(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function V(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function F(){this.b=this.a=null}O=D("__EID__")?"__EID__":void 0,k(x,Error),x.prototype.name="CustomError",k(M,x),M.prototype.name="AssertionError",U.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 q=new U(function(){return new H},function(t){t.reset()});function K(){var t=Ie,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}F.prototype.add=function(t,e){var n=q.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 G=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},B=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var i=t.length,r="string"==typeof t?t.split(""):t,o=0;o<i;o++)o in r&&e.call(n,r[o],o,t)};var W=Array.prototype.filter?function(t,e){return Array.prototype.filter.call(t,e,void 0)}:function(t,e){for(var n=t.length,i=[],r=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)&&(i[r++]=s)}return i},X=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,i=Array(n),r="string"==typeof t?t.split(""):t,o=0;o<n;o++)o in r&&(i[o]=e.call(void 0,r[o],o,t));return i},J=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,i="string"==typeof t?t.split(""):t,r=0;r<n;r++)if(r in i&&e.call(void 0,i[r],r,t))return!0;return!1};function Y(t,e){return 0<=G(t,e)}function z(t,e){var n;return(n=0<=(e=G(t,e)))&&Array.prototype.splice.call(t,e,1),n}function $(t,e){!function(t,e){for(var n="string"==typeof t?t.split(""):t,i=t.length-1;0<=i;--i)i in n&&e.call(void 0,n[i],i,t)}(t,function(n,i){e.call(void 0,n,i,t)&&1==Array.prototype.splice.call(t,i,1).length&&0})}function Z(t){return Array.prototype.concat.apply([],arguments)}function Q(t){var e=t.length;if(0<e){for(var n=Array(e),i=0;i<e;i++)n[i]=t[i];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,it=/</g,rt=/>/g,ot=/"/g,at=/'/g,st=/\x00/g,ut=/[\x00&<>"']/;function ct(t,e){return-1!=t.indexOf(e)}function ht(t,e){return t<e?-1:t>e?1:0}t:{var lt=u.navigator;if(lt){var ft=lt.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 bt(t,e){for(var n,i,r=1;r<arguments.length;r++){for(n in i=arguments[r])t[n]=i[n];for(var o=0;o<gt.length;o++)n=gt[o],Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}}function yt(t,e){t:{try{var n=t&&t.ownerDocument,i=n&&(n.defaultView||n.parentWindow);if((i=i||u).Element&&i.Location){var r=i;break t}}catch(a){}r=null}if(r&&void 0!==r[e]&&(!t||!(t instanceof r[e])&&(t instanceof r.Location||t instanceof r.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;j("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function wt(t,e){this.a=t===At&&e||"",this.b=Et}function It(t){return t instanceof wt&&t.constructor===wt&&t.b===Et?t.a:(j("expected object of type Const, got '"+t+"'"),"type_error:Const")}wt.prototype.ta=!0,wt.prototype.sa=function(){return this.a},wt.prototype.toString=function(){return"Const{"+this.a+"}"};var Tt,Et={},At={};function kt(){if(void 0===Tt){var t=null,e=u.trustedTypes;if(e&&e.createPolicy){try{t=e.createPolicy("goog#html",{createHTML:S,createScript:S,createScriptURL:S})}catch(n){u.console&&u.console.error(n.message)}Tt=t}else Tt=t}return Tt}function St(t,e){this.a=e===Rt?t:""}function Nt(t){return t instanceof St&&t.constructor===St?t.a:(j("expected object of type TrustedResourceUrl, got '"+t+"' of type "+d(t)),"type_error:TrustedResourceUrl")}function _t(t,e){var n=It(t);if(!Ct.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(t){var e=kt();return new St(t=e?e.createScriptURL(t):t,Rt)}(t=n.replace(Ot,function(t,i){if(!Object.prototype.hasOwnProperty.call(e,i))throw Error('Found marker, "'+i+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[i])instanceof wt?It(t):encodeURIComponent(String(t))}))}St.prototype.ta=!0,St.prototype.sa=function(){return this.a.toString()},St.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var Ot=/%{(\w+)}/g,Ct=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Rt={};function Pt(t,e){this.a=e===Vt?t:""}function Dt(t){return t instanceof Pt&&t.constructor===Pt?t.a:(j("expected object of type SafeUrl, got '"+t+"' of type "+d(t)),"type_error:SafeUrl")}Pt.prototype.ta=!0,Pt.prototype.sa=function(){return this.a.toString()},Pt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Lt=/^(?: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,xt=/^data:(.*);base64,[a-z0-9+\/]+=*$/i,Mt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function jt(t){if(t instanceof Pt)return t;if(t="object"==typeof t&&t.ta?t.sa():String(t),Mt.test(t))t=new Pt(t,Vt);else{var e=(t=(t=String(t)).replace(/(%0A|%0D)/g,"")).match(xt);t=e&&Lt.test(e[1])?new Pt(t,Vt):null}return t}function Ut(t){return t instanceof Pt?t:(t="object"==typeof t&&t.ta?t.sa():String(t),Mt.test(t)||(t="about:invalid#zClosurez"),new Pt(t,Vt))}var Vt={},Ft=new Pt("about:invalid#zClosurez",Vt);function qt(t,e,n){this.a=n===Kt?t:""}qt.prototype.ta=!0,qt.prototype.sa=function(){return this.a.toString()},qt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Kt={};function Ht(t,e,n,i){return t=t instanceof Pt?t:Ut(t),e=e||u,n=n instanceof wt?It(n):n||"",e.open(Dt(t),n,i,void 0)}function Gt(t,e){for(var n=t.split("%s"),i="",r=Array.prototype.slice.call(arguments,1);r.length&&1<n.length;)i+=n.shift()+r.shift();return i+n.join("%s")}function Bt(t){return ut.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(nt,"&")),-1!=t.indexOf("<")&&(t=t.replace(it,"<")),-1!=t.indexOf(">")&&(t=t.replace(rt,">")),-1!=t.indexOf('"')&&(t=t.replace(ot,""")),-1!=t.indexOf("'")&&(t=t.replace(at,"'")),-1!=t.indexOf("\0")&&(t=t.replace(st,"�"))),t}function Wt(t){return Wt[" "](t),t}Wt[" "]=f;var Xt,Jt,Yt=dt("Opera"),zt=dt("Trident")||dt("MSIE"),$t=dt("Edge"),Zt=$t||zt,Qt=dt("Gecko")&&!(ct(tt.toLowerCase(),"webkit")&&!dt("Edge"))&&!(dt("Trident")||dt("MSIE"))&&!dt("Edge"),te=ct(tt.toLowerCase(),"webkit")&&!dt("Edge");function ee(){var t=u.document;return t?t.documentMode:void 0}t:{var ne="",ie=(Jt=tt,Qt?/rv:([^\);]+)(\)|;)/.exec(Jt):$t?/Edge\/([\d\.]+)/.exec(Jt):zt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Jt):te?/WebKit\/(\S+)/.exec(Jt):Yt?/(?:Version)[ \/]?(\S+)/.exec(Jt):void 0);if(ie&&(ne=ie?ie[1]:""),zt){var re=ee();if(null!=re&&re>parseFloat(ne)){Xt=String(re);break t}}Xt=ne}var oe,ae={};function se(t){return function(t,e){var n=ae;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,function(){for(var e=0,n=et(String(Xt)).split("."),i=et(String(t)).split("."),r=Math.max(n.length,i.length),o=0;0==e&&o<r;o++){var a=n[o]||"",s=i[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=ht(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||ht(0==a[2].length,0==s[2].length)||ht(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e})}if(u.document&&zt){var ue=ee();oe=ue||(parseInt(Xt,10)||void 0)}else oe=void 0;var ce=oe;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(Jt){}var he=!zt||9<=Number(ce);function le(t){var e=document;return"string"==typeof t?e.getElementById(t):t}function fe(t,e){pt(e,function(e,n){e&&"object"==typeof e&&e.ta&&(e=e.sa()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:ve.hasOwnProperty(n)?t.setAttribute(ve[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e})}var de,pe,ve={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function me(t,e,n){var i=arguments,r=document,o=String(i[0]),a=i[1];if(!he&&a&&(a.name||a.type)){if(o=["<",o],a.name&&o.push(' name="',Bt(a.name),'"'),a.type){o.push(' type="',Bt(a.type),'"');var s={};bt(s,a),delete s.type,a=s}o.push(">"),o=o.join("")}return o=ge(r,o),a&&("string"==typeof a?o.className=a:Array.isArray(a)?o.className=a.join(" "):fe(o,a)),2<i.length&&function(t,e,n){function i(n){n&&e.appendChild("string"==typeof n?t.createTextNode(n):n)}for(var r=2;r<n.length;r++){var o=n[r];if(!p(o)||m(o)&&0<o.nodeType)i(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}B(a?Q(o):o,i)}}}(r,o,i),o}function ge(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function be(t){u.setTimeout(function(){throw t},0)}function ye(t,e){pe||function(){if(u.Promise&&u.Promise.resolve){var t=u.Promise.resolve(void 0);pe=function(){t.then(Te)}}else pe=function(){var t=Te;!v(u.setImmediate)||u.Window&&u.Window.prototype&&!dt("Edge")&&u.Window.prototype.setImmediate==u.setImmediate?(de||(de=function(){var t=u.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!dt("Presto")&&(t=function(){var t=ge(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(),i="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=T(function(t){"*"!=i&&t.origin!=i||t.data!=n||this.port1.onmessage()},this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,i)}}}),void 0!==t&&!dt("Trident")&&!dt("MSIE")){var e=new t,n={},i=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).Hb;n.Hb=null,t()}},function(t){i.next={Hb:t},i=i.next,e.port2.postMessage(0)}}return function(t){u.setTimeout(t,0)}}()),de(t)):u.setImmediate(t)}}(),we||(pe(),we=!0),Ie.add(t,e)}var we=!1,Ie=new F;function Te(){for(var t;t=K();){try{t.a.call(t.b)}catch(e){be(e)}V(q,t)}we=!1}function Ee(t,e){if(this.a=Ae,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){Me(n,ke,t)},function(t){if(!(t instanceof He))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}Me(n,Se,t)})}catch(i){Me(this,Se,i)}}var Ae=0,ke=2,Se=3;function Ne(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}Ne.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var _e=new U(function(){return new Ne},function(t){t.reset()});function Oe(t,e,n){var i=_e.get();return i.g=t,i.b=e,i.f=n,i}function Ce(t){if(t instanceof Ee)return t;var e=new Ee(f);return Me(e,ke,t),e}function Re(t){return new Ee(function(e,n){n(t)})}function Pe(t,e,n){je(t,e,n,null)||ye(E(e,t))}function De(t){return new Ee(function(e){var n=t.length,i=[];if(n)for(var r=function(t,r,o){n--,i[t]=r?{Qb:!0,value:o}:{Qb:!1,reason:o},0==n&&e(i)},o=0;o<t.length;o++)Pe(t[o],E(r,o,!0),E(r,o,!1));else e(i)})}function Le(t,e){t.b||t.a!=ke&&t.a!=Se||Ue(t),t.f?t.f.next=e:t.b=e,t.f=e}function xe(t,e,n,i){var r=Oe(null,null,null);return r.a=new Ee(function(t,o){r.g=e?function(n){try{var r=e.call(i,n);t(r)}catch(a){o(a)}}:t,r.b=n?function(e){try{var r=n.call(i,e);void 0===r&&e instanceof He?o(e):t(r)}catch(a){o(a)}}:o}),r.a.c=t,Le(t,r),r.a}function Me(t,e,n){t.a==Ae&&(t===n&&(e=Se,n=new TypeError("Promise cannot resolve to itself")),t.a=1,je(n,t.$c,t.ad,t)||(t.i=n,t.a=e,t.c=null,Ue(t),e!=Se||n instanceof He||function(t,e){t.g=!0,ye(function(){t.g&&Ke.call(null,e)})}(t,n)))}function je(t,e,n,i){if(t instanceof Ee)return Le(t,Oe(e||f,n||null,i)),!0;if(L(t))return t.then(e,n,i),!0;if(m(t))try{var r=t.then;if(v(r))return function(t,e,n,i,r){function o(t){a||(a=!0,i.call(r,t))}var a=!1;try{e.call(t,function(t){a||(a=!0,n.call(r,t))},o)}catch(s){o(s)}}(t,r,e,n,i),!0}catch(o){return n.call(i,o),!0}return!1}function Ue(t){t.h||(t.h=!0,ye(t.gc,t))}function Ve(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Fe(t,e,n,i){if(n==Se&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,qe(e,n,i);else try{e.c?e.g.call(e.f):qe(e,n,i)}catch(r){Ke.call(null,r)}V(_e,e)}function qe(t,e,n){e==ke?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}Ee.prototype.then=function(t,e,n){return xe(this,v(t)?t:null,v(e)?e:null,n)},Ee.prototype.$goog_Thenable=!0,(n=Ee.prototype).oa=function(t,e){return(t=Oe(t,t,e)).c=!0,Le(this,t),this},n.o=function(t,e){return xe(this,null,t,e)},n.cancel=function(t){if(this.a==Ae){var e=new He(t);ye(function(){!function t(e,n){if(e.a==Ae)if(e.c){var i=e.c;if(i.b){for(var r=0,o=null,a=null,s=i.b;s&&(s.c||(r++,s.a==e&&(o=s),!(o&&1<r)));s=s.next)o||(a=s);o&&(i.a==Ae&&1==r?t(i,n):(a?((r=a).next==i.f&&(i.f=r),r.next=r.next.next):Ve(i),Fe(i,o,Se,n)))}e.c=null}else Me(e,Se,n)}(this,e)},this)}},n.$c=function(t){this.a=Ae,Me(this,ke,t)},n.ad=function(t){this.a=Ae,Me(this,Se,t)},n.gc=function(){for(var t;t=Ve(this);)Fe(this,t,this.a,this.i);this.h=!1};var Ke=be;function He(t){x.call(this,t)}function Ge(){0!=Be&&(We[g(this)]=this),this.ya=this.ya,this.pa=this.pa}k(He,x),He.prototype.name="cancel";var Be=0,We={};function Xe(t){if(!t.ya&&(t.ya=!0,t.Da(),0!=Be)){var e=g(t);if(0!=Be&&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 We[e]}}Ge.prototype.ya=!1,Ge.prototype.Da=function(){if(this.pa)for(;this.pa.length;)this.pa.shift()()};var Je=Object.freeze||function(t){return t},Ye=!zt||9<=Number(ce),ze=zt&&!se("9"),$e=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 Qe(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,i=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if(Qt){t:{try{Wt(e.nodeName);var r=!0;break t}catch(o){}r=!1}r||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,i?(this.clientX=void 0!==i.clientX?i.clientX:i.pageX,this.clientY=void 0!==i.clientY?i.clientY:i.pageY,this.screenX=i.screenX||0,this.screenY=i.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},k(Qe,Ze);var tn=Je({2:"touch",3:"pen",4:"mouse"});Qe.prototype.preventDefault=function(){Qe.bb.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,ze)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},Qe.prototype.g=function(){return this.a};var en="closure_listenable_"+(1e6*Math.random()|0),nn=0;function rn(t,e,n,i,r){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!i,this.Wa=r,this.key=++nn,this.wa=this.Qa=!1}function on(t){t.wa=!0,t.listener=null,t.proxy=null,t.src=null,t.Wa=null}function an(t){this.src=t,this.a={},this.b=0}function sn(t,e){var n=e.type;n in t.a&&z(t.a[n],e)&&(on(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function un(t,e,n,i){for(var r=0;r<t.length;++r){var o=t[r];if(!o.wa&&o.listener==e&&o.capture==!!n&&o.Wa==i)return r}return-1}an.prototype.add=function(t,e,n,i,r){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=un(t,e,i,r);return-1<a?(e=t[a],n||(e.Qa=!1)):((e=new rn(e,this.src,o,!!i,r)).Qa=n,t.push(e)),e};var cn="closure_lm_"+(1e6*Math.random()|0),hn={};function ln(t,e,n,i,r){if(i&&i.once)dn(t,e,n,i,r);else if(Array.isArray(e))for(var o=0;o<e.length;o++)ln(t,e[o],n,i,r);else n=Tn(n),t&&t[en]?An(t,e,n,m(i)?!!i.capture:!!i,r):fn(t,e,n,!1,i,r)}function fn(t,e,n,i,r,o){if(!e)throw Error("Invalid event type");var a=m(r)?!!r.capture:!!r,s=wn(t);if(s||(t[cn]=s=new an(t)),!(n=s.add(e,n,i,a,o)).proxy){if(i=function(){var t=yn,e=Ye?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=i,i.src=t,i.listener=n,t.addEventListener)$e||(r=a),void 0===r&&(r=!1),t.addEventListener(e.toString(),i,r);else if(t.attachEvent)t.attachEvent(mn(e.toString()),i);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(i)}0}}function dn(t,e,n,i,r){if(Array.isArray(e))for(var o=0;o<e.length;o++)dn(t,e[o],n,i,r);else n=Tn(n),t&&t[en]?kn(t,e,n,m(i)?!!i.capture:!!i,r):fn(t,e,n,!0,i,r)}function pn(t,e,n,i,r){if(Array.isArray(e))for(var o=0;o<e.length;o++)pn(t,e[o],n,i,r);else i=m(i)?!!i.capture:!!i,n=Tn(n),t&&t[en]?(t=t.v,(e=String(e).toString())in t.a&&(-1<(n=un(o=t.a[e],n,i,r))&&(on(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=wn(t))&&(e=t.a[e.toString()],t=-1,e&&(t=un(e,n,i,r)),(n=-1<t?e[t]:null)&&vn(n))}function vn(t){if("number"!=typeof t&&t&&!t.wa){var e=t.src;if(e&&e[en])sn(e.v,t);else{var n=t.type,i=t.proxy;e.removeEventListener?e.removeEventListener(n,i,t.capture):e.detachEvent?e.detachEvent(mn(n),i):e.addListener&&e.removeListener&&e.removeListener(i),0,(n=wn(e))?(sn(n,t),0==n.b&&(n.src=null,e[cn]=null)):on(t)}}}function mn(t){return t in hn?hn[t]:hn[t]="on"+t}function gn(t,e,n,i){var r=!0;if((t=wn(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.wa&&(o=bn(o,i),r=r&&!1!==o)}return r}function bn(t,e){var n=t.listener,i=t.Wa||t.src;return t.Qa&&vn(t),n.call(i,e)}function yn(t,e){if(t.wa)return!0;if(!Ye){if(!e)t:{e=["window","event"];for(var n=u,i=0;i<e.length;i++)if(null==(n=n[e[i]])){e=null;break t}e=n}if(e=new Qe(i=e,this),n=!0,!(0>i.keyCode||null!=i.returnValue)){t:{var r=!1;if(0==i.keyCode)try{i.keyCode=-1;break t}catch(a){r=!0}(r||null==i.returnValue)&&(i.returnValue=!0)}for(i=[],r=e.b;r;r=r.parentNode)i.push(r);for(t=t.type,r=i.length-1;0<=r;r--){e.b=i[r];var o=gn(i[r],t,!0,e);n=n&&o}for(r=0;r<i.length;r++)e.b=i[r],o=gn(i[r],t,!1,e),n=n&&o}return n}return bn(t,new Qe(e,this))}function wn(t){return(t=t[cn])instanceof an?t:null}var In="__closure_events_fn_"+(1e9*Math.random()>>>0);function Tn(t){return v(t)?t:(t[In]||(t[In]=function(e){return t.handleEvent(e)}),t[In])}function En(){Ge.call(this),this.v=new an(this),this.bc=this,this.hb=null}function An(t,e,n,i,r){t.v.add(String(e),n,!1,i,r)}function kn(t,e,n,i,r){t.v.add(String(e),n,!0,i,r)}function Sn(t,e,n,i){if(!(e=t.v.a[String(e)]))return!0;e=e.concat();for(var r=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.wa&&a.capture==n){var s=a.listener,u=a.Wa||a.src;a.Qa&&sn(t.v,a),r=!1!==s.call(u,i)&&r}}return r&&!i.defaultPrevented}function Nn(t,e,n){if(v(t))n&&(t=T(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=T(t.handleEvent,t)}return 2147483647<Number(e)?-1:u.setTimeout(t,e||0)}function _n(t){var e=null;return new Ee(function(n,i){-1==(e=Nn(function(){n(void 0)},t))&&i(Error("Failed to schedule timer."))}).o(function(t){throw u.clearTimeout(e),t})}function On(t){if(t.X&&"function"==typeof t.X)return t.X();if("string"==typeof t)return t.split("");if(p(t)){for(var e=[],n=t.length,i=0;i<n;i++)e.push(t[i]);return e}for(i in e=[],n=0,t)e[n++]=t[i];return e}function Cn(t){if(t.Y&&"function"==typeof t.Y)return t.Y();if(!t.X||"function"!=typeof t.X){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 i in e=[],n=0,t)e[n++]=i;return e}}function Rn(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 i=0;i<n;i+=2)this.set(arguments[i],arguments[i+1])}else if(t)if(t instanceof Rn)for(n=t.Y(),i=0;i<n.length;i++)this.set(n[i],t.get(n[i]));else for(i in t)this.set(i,t[i])}function Pn(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var i=t.a[e];Dn(t.b,i)&&(t.a[n++]=i),e++}t.a.length=n}if(t.c!=t.a.length){var r={};for(n=e=0;e<t.a.length;)Dn(r,i=t.a[e])||(t.a[n++]=i,r[i]=1),e++;t.a.length=n}}function Dn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}k(En,Ge),En.prototype[en]=!0,En.prototype.addEventListener=function(t,e,n,i){ln(this,t,e,n,i)},En.prototype.removeEventListener=function(t,e,n,i){pn(this,t,e,n,i)},En.prototype.dispatchEvent=function(t){var e,n=this.hb;if(n)for(e=[];n;n=n.hb)e.push(n);n=this.bc;var i=t.type||t;if("string"==typeof t)t=new Ze(t,n);else if(t instanceof Ze)t.target=t.target||n;else{var r=t;bt(t=new Ze(i,n),r)}if(r=!0,e)for(var o=e.length-1;0<=o;o--){var a=t.b=e[o];r=Sn(a,i,!0,t)&&r}if(r=Sn(a=t.b=n,i,!0,t)&&r,r=Sn(a,i,!1,t)&&r,e)for(o=0;o<e.length;o++)r=Sn(a=t.b=e[o],i,!1,t)&&r;return r},En.prototype.Da=function(){if(En.bb.Da.call(this),this.v){var t,e=this.v;for(t in e.a){for(var n=e.a[t],i=0;i<n.length;i++)0,on(n[i]);delete e.a[t],e.b--}}this.hb=null},(n=Rn.prototype).X=function(){Pn(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},n.Y=function(){return Pn(this),this.a.concat()},n.clear=function(){this.b={},this.c=this.a.length=0},n.get=function(t,e){return Dn(this.b,t)?this.b[t]:e},n.set=function(t,e){Dn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},n.forEach=function(t,e){for(var n=this.Y(),i=0;i<n.length;i++){var r=n[i],o=this.get(r);t.call(e,o,r,this)}};var Ln=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function xn(t,e){var n;this.a=this.l=this.c="",this.g=null,this.h=this.f="",this.i=!1,t instanceof xn?(this.i=void 0!==e?e:t.i,Mn(this,t.c),this.l=t.l,this.a=t.a,jn(this,t.g),this.f=t.f,Un(this,ii(t.b)),this.h=t.h):t&&(n=String(t).match(Ln))?(this.i=!!e,Mn(this,n[1]||"",!0),this.l=Hn(n[2]||""),this.a=Hn(n[3]||"",!0),jn(this,n[4]),this.f=Hn(n[5]||"",!0),Un(this,n[6]||"",!0),this.h=Hn(n[7]||"")):(this.i=!!e,this.b=new $n(null,this.i))}function Mn(t,e,n){t.c=n?Hn(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function jn(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 Un(t,e,n){e instanceof $n?(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&&(ti(this,e),ni(this,n,t))},t)),t.f=e}(t.b,t.i)):(n||(e=Gn(e,Yn)),t.b=new $n(e,t.i))}function Vn(t,e,n){t.b.set(e,n)}function Fn(t,e){return t.b.get(e)}function qn(t){return t instanceof xn?new xn(t):new xn(t,void 0)}function Kn(t,e,n,i){var r=new xn(null,void 0);return t&&Mn(r,t),e&&(r.a=e),n&&jn(r,n),i&&(r.f=i),r}function Hn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Gn(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,Bn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Bn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}xn.prototype.toString=function(){var t=[],e=this.c;e&&t.push(Gn(e,Wn,!0),":");var n=this.a;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(Gn(e,Wn,!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(Gn(n,"/"==n.charAt(0)?Jn:Xn,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.h)&&t.push("#",Gn(n,zn)),t.join("")},xn.prototype.resolve=function(t){var e=new xn(this),n=!!t.c;n?Mn(e,t.c):n=!!t.l,n?e.l=t.l:n=!!t.a,n?e.a=t.a:n=null!=t.g;var i=t.f;if(n)jn(e,t.g);else if(n=!!t.f){if("/"!=i.charAt(0))if(this.a&&!this.f)i="/"+i;else{var r=e.f.lastIndexOf("/");-1!=r&&(i=e.f.substr(0,r+1)+i)}if(".."==(r=i)||"."==r)i="";else if(ct(r,"./")||ct(r,"/.")){i=0==r.lastIndexOf("/",0),r=r.split("/");for(var o=[],a=0;a<r.length;){var s=r[a++];"."==s?i&&a==r.length&&o.push(""):".."==s?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),i&&a==r.length&&o.push("")):(o.push(s),i=!0)}i=o.join("/")}else i=r}return n?e.f=i:n=""!==t.b.toString(),n?Un(e,ii(t.b)):n=!!t.h,n&&(e.h=t.h),e};var Wn=/[#\/\?@]/g,Xn=/[#\?:]/g,Jn=/[#\?]/g,Yn=/[#\?@]/g,zn=/#/g;function $n(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Zn(t){t.a||(t.a=new Rn,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var i=t[n].indexOf("="),r=null;if(0<=i){var o=t[n].substring(0,i);r=t[n].substring(i+1)}else o=t[n];e(o,r?decodeURIComponent(r.replace(/\+/g," ")):"")}}}(t.c,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}function Qn(t){var e=Cn(t);if(void 0===e)throw Error("Keys are undefined");var n=new $n(null,void 0);t=On(t);for(var i=0;i<e.length;i++){var r=e[i],o=t[i];Array.isArray(o)?ni(n,r,o):n.add(r,o)}return n}function ti(t,e){Zn(t),e=ri(t,e),Dn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,Dn((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Pn(t)))}function ei(t,e){return Zn(t),e=ri(t,e),Dn(t.a.b,e)}function ni(t,e,n){ti(t,e),0<n.length&&(t.c=null,t.a.set(ri(t,e),Q(n)),t.b+=n.length)}function ii(t){var e=new $n;return e.c=t.c,t.a&&(e.a=new Rn(t.a),e.b=t.b),e}function ri(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function oi(t){var e=[];return function t(e,n,i){if(null==n)i.push("null");else{if("object"==typeof n){if(Array.isArray(n)){var r=n;n=r.length,i.push("[");for(var o="",a=0;a<n;a++)i.push(o),t(e,r[a],i),o=",";return void i.push("]")}if(!(n instanceof String||n instanceof Number||n instanceof Boolean)){for(r in i.push("{"),o="",n)Object.prototype.hasOwnProperty.call(n,r)&&("function"!=typeof(a=n[r])&&(i.push(o),ci(r,i),i.push(":"),t(e,a,i),o=","));return void i.push("}")}n=n.valueOf()}switch(typeof n){case"string":ci(n,i);break;case"number":i.push(isFinite(n)&&!isNaN(n)?String(n):"null");break;case"boolean":i.push(String(n));break;case"function":i.push("null");break;default:throw Error("Unknown type: "+typeof n)}}}(new ai,t,e),e.join("")}function ai(){}(n=$n.prototype).add=function(t,e){Zn(this),this.c=null,t=ri(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,i){B(n,function(n){t.call(e,n,i,this)},this)},this)},n.Y=function(){Zn(this);for(var t=this.a.X(),e=this.a.Y(),n=[],i=0;i<e.length;i++)for(var r=t[i],o=0;o<r.length;o++)n.push(e[i]);return n},n.X=function(t){Zn(this);var e=[];if("string"==typeof t)ei(this,t)&&(e=Z(e,this.a.get(ri(this,t))));else{t=this.a.X();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,ei(this,t=ri(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.X(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 i=e[n],r=encodeURIComponent(String(i));i=this.X(i);for(var o=0;o<i.length;o++){var a=r;""!==i[o]&&(a+="="+encodeURIComponent(String(i[o]))),t.push(a)}}return this.c=t.join("&")};var si={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},ui=/\uffff/.test("")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function ci(t,e){e.push('"',t.replace(ui,function(t){var e=si[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),si[t]=e),e}),'"')}function hi(){var t=Oi();return zt&&!!ce&&11==ce||/Edge\/\d+/.test(t)}function li(){return u.window&&u.window.location.href||self&&self.location&&self.location.href||""}function fi(t,e){e=e||u.window;var n="about:blank";t&&(n=Dt(jt(t)||Ft)),e.location.href=n}function di(t){return!!((t=(t||Oi()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function pi(t){t=t||u.window;try{t.close()}catch(e){}}function vi(t,e,n){var i=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var r=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(a in e={width:e,height:n,top:0<r?r:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=Oi().toLowerCase(),i&&(e.target=i,ct(n,"crios/")&&(e.target="_blank")),Si(Oi())==Ai&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),i=window,e=n instanceof Pt?n:jt(void 0!==n.href?n.href:String(n))||Ft,n=t.target||n.target,r=[],t)switch(a){case"width":case"height":case"top":case"left":r.push(a+"="+t[a]);break;case"target":case"noopener":case"noreferrer":break;default:r.push(a+"="+(t[a]?1:0))}var a=r.join(",");if((dt("iPhone")&&!dt("iPod")&&!dt("iPad")||dt("iPad")||dt("iPod"))&&i.navigator&&i.navigator.standalone&&n&&"_self"!=n?(yt(a=ge(document,"A"),"HTMLAnchorElement"),e=e instanceof Pt?e:Ut(e),a.href=Dt(e),a.setAttribute("target",n),t.noreferrer&&a.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,i,1),a.dispatchEvent(t),a={}):t.noreferrer?(a=Ht("",i,n,a),t=Dt(e),a&&(Zt&&ct(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+Bt(t)+'">',t=new qt(t=(i=kt())?i.createHTML(t):t,null,Kt),i=a.document)&&(i.write(function(t){return t instanceof qt&&t.constructor===qt?t.a:(j("expected object of type SafeHtml, got '"+t+"' of type "+d(t)),"type_error:SafeHtml")}(t)),i.close())):(a=Ht(e,i,n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(s){}return a}var mi=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,gi=/^[^@]+@[^@]+$/;function bi(){var t=null;return new Ee(function(e){"complete"==u.document.readyState?e():(t=function(){e()},dn(window,"load",t))}).o(function(e){throw pn(window,"load",t),e})}function yi(t){return t=t||Oi(),!("file:"!==Li()&&"ionic:"!==Li()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function wi(){var t=u.window;try{return!(!t||t==t.top)}catch(e){return!1}}function Ii(){return void 0!==u.WorkerGlobalScope&&"function"==typeof u.importScripts}function Ti(){return e.default.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":e.default.INTERNAL.hasOwnProperty("node")?"Node":Ii()?"Worker":"Browser"}function Ei(){var t=Ti();return"ReactNative"===t||"Node"===t}var Ai="Firefox",ki="Chrome";function Si(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/")?Ai: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":ki:"Safari"}var Ni={md:"FirebaseCore-web",od:"FirebaseUI-web"};function _i(t,e){e=e||[];var n,i=[],r={};for(n in Ni)r[Ni[n]]=!0;for(n=0;n<e.length;n++)void 0!==r[e[n]]&&(delete r[e[n]],i.push(e[n]));return i.sort(),(e=i).length||(e=["FirebaseCore-web"]),"Browser"===(i=Ti())?i=Si(r=Oi()):"Worker"===i&&(i=Si(r=Oi())+"-"+i),i+"/JsCore/"+t+"/"+e.join(",")}function Oi(){return u.navigator&&u.navigator.userAgent||""}function Ci(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 Ri(){try{var t=u.localStorage,e=Vi();if(t)return t.setItem(e,"1"),t.removeItem(e),!hi()||!!u.indexedDB}catch(n){return Ii()&&!!u.indexedDB}return!1}function Pi(){return(Di()||"chrome-extension:"===Li()||yi())&&!Ei()&&Ri()&&!Ii()}function Di(){return"http:"===Li()||"https:"===Li()}function Li(){return u.location&&u.location.protocol||null}function xi(t){return!di(t=t||Oi())&&Si(t)!=Ai}function Mi(t){return void 0===t?null:oi(t)}function ji(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 Ui(t){if(null!==t)return JSON.parse(t)}function Vi(t){return t||Math.floor(1e9*Math.random()).toString()}function Fi(t){return"Safari"!=Si(t=t||Oi())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function qi(){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 Ki(t,e){if(t>e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Oi(),e=Ti(),this.b=di(t)||"ReactNative"===e}function Hi(){var t=u.document;return!t||void 0===t.visibilityState||"visible"==t.visibilityState}function Gi(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 Bi(){return!(!Ci("fireauth.oauthhelper",u)&&!Ci("fireauth.iframe",u))}Ki.prototype.get=function(){var t=u.navigator;return!t||"boolean"!=typeof t.onLine||!Di()&&"chrome-extension:"!==Li()&&void 0===t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Wi,Xi={};function Ji(t){Xi[t]||(Xi[t]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t))}try{var Yi={};Object.defineProperty(Yi,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Yi,"abcd",{configurable:!0,enumerable:!0,value:2}),Wi=2==Yi.abcd}catch(Jt){Wi=!1}function zi(t,e,n){Wi?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function $i(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&zi(t,n,e[n])}function Zi(t){var e={};return $i(e,t),e}function Qi(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)zi(e,n,Qi(t[n]));return e}function tr(t){var e=t&&(t[or]?"phone":null);if(!(e&&t&&t[rr]))throw new N("internal-error","Internal assert: invalid MultiFactorInfo object");zi(this,"uid",t[rr]),zi(this,"displayName",t[nr]||null);var n=null;t[ir]&&(n=new Date(t[ir]).toUTCString()),zi(this,"enrollmentTime",n),zi(this,"factorId",e)}function er(t){try{var e=new ar(t)}catch(n){e=null}return e}tr.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var nr="displayName",ir="enrolledAt",rr="mfaEnrollmentId",or="phoneInfo";function ar(t){tr.call(this,t),zi(this,"phoneNumber",t[or])}function sr(t){var e={},n=t[lr],i=t[dr],r=t[pr];if(t=er(t[fr]),!r||r!=cr&&r!=hr&&!n||r==hr&&!i||r==ur&&!t)throw Error("Invalid checkActionCode response!");r==hr?(e[mr]=n||null,e[br]=n||null,e[vr]=i):(e[mr]=i||null,e[br]=i||null,e[vr]=n||null),e[gr]=t||null,zi(this,wr,r),zi(this,yr,Qi(e))}k(ar,tr),ar.prototype.w=function(){var t=ar.bb.w.call(this);return t.phoneNumber=this.phoneNumber,t};var ur="REVERT_SECOND_FACTOR_ADDITION",cr="EMAIL_SIGNIN",hr="VERIFY_AND_CHANGE_EMAIL",lr="email",fr="mfaInfo",dr="newEmail",pr="requestType",vr="email",mr="fromEmail",gr="multiFactorInfo",br="previousEmail",yr="data",wr="operation";function Ir(t){var e=Fn(t=qn(t),Tr)||null,n=Fn(t,Er)||null,i=Fn(t,Sr)||null;if(i=i&&_r[i]||null,!e||!n||!i)throw new N("argument-error",Tr+", "+Er+"and "+Sr+" are required in a valid action code URL.");$i(this,{apiKey:e,operation:i,code:n,continueUrl:Fn(t,Ar)||null,languageCode:Fn(t,kr)||null,tenantId:Fn(t,Nr)||null})}var Tr="apiKey",Er="oobCode",Ar="continueUrl",kr="languageCode",Sr="mode",Nr="tenantId",_r={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:ur,signIn:cr,verifyAndChangeEmail:hr,verifyEmail:"VERIFY_EMAIL"};function Or(t){try{return new Ir(t)}catch(e){return null}}function Cr(t){var e=t[xr];if(void 0===e)throw new N("missing-continue-uri");if("string"!=typeof e||"string"==typeof e&&!e.length)throw new N("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[Rr];if(n&&"object"==typeof n){e=n[Ur];var i=n[Mr];if(n=n[jr],"string"==typeof e&&e.length){if(this.a=e,void 0!==i&&"boolean"!=typeof i)throw new N("argument-error",Mr+" property must be a boolean when specified.");if(this.g=!!i,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new N("argument-error",jr+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==e)throw new N("argument-error",Ur+" property must be a non empty string when specified.");if(void 0!==i||void 0!==n)throw new N("missing-android-pkg-name")}}else if(void 0!==n)throw new N("argument-error",Rr+" property must be a non null object when specified.");if(this.f=null,(e=t[Lr])&&"object"==typeof e){if("string"==typeof(e=e[Vr])&&e.length)this.f=e;else if(void 0!==e)throw new N("argument-error",Vr+" property must be a non empty string when specified.")}else if(void 0!==e)throw new N("argument-error",Lr+" property must be a non null object when specified.");if(void 0!==(e=t[Dr])&&"boolean"!=typeof e)throw new N("argument-error",Dr+" property must be a boolean when specified.");if(this.c=!!e,void 0!==(t=t[Pr])&&("string"!=typeof t||"string"==typeof t&&!t.length))throw new N("argument-error",Pr+" property must be a non empty string when specified.");this.i=t||null}var Rr="android",Pr="dynamicLinkDomain",Dr="handleCodeInApp",Lr="iOS",xr="url",Mr="installApp",jr="minimumVersion",Ur="packageName",Vr="bundleId";function Fr(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 qr=null;function Kr(t){var e=[];return function(t,e){function n(e){for(;i<t.length;){var n=t.charAt(i++),r=qr[n];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!qr){qr={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++)for(var i=t.concat(e[n].split("")),r=0;r<i.length;r++){var o=i[r];void 0===qr[o]&&(qr[o]=r)}}}();for(var i=0;;){var r=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===r)break;e(r<<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 Hr(t){var e=Br(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 Gr(t){try{return new Hr(t)}catch(e){return null}}function Br(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 i=Kr(t);for(t=[],n=e=0;e<i.length;){var r=i[e++];if(128>r)t[n++]=String.fromCharCode(r);else if(191<r&&224>r){var o=i[e++];t[n++]=String.fromCharCode((31&r)<<6|63&o)}else if(239<r&&365>r){o=i[e++];var a=i[e++],s=((7&r)<<18|(63&o)<<12|(63&a)<<6|63&i[e++])-65536;t[n++]=String.fromCharCode(55296+(s>>10)),t[n++]=String.fromCharCode(56320+(1023&s))}else o=i[e++],a=i[e++],t[n++]=String.fromCharCode((15&r)<<12|(63&o)<<6|63&a)}return JSON.parse(t.join(""))}catch(u){}return null}Hr.prototype.T=function(){return this.f},Hr.prototype.l=function(){return this.c},Hr.prototype.toString=function(){return this.h};var Wr="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Xr=["client_id","response_type","scope","redirect_uri","state"],Jr={nd:{Ja:"locale",va:700,ua:600,fa:"facebook.com",Ya:Xr},pd:{Ja:null,va:500,ua:750,fa:"github.com",Ya:Xr},qd:{Ja:"hl",va:515,ua:680,fa:"google.com",Ya:Xr},wd:{Ja:"lang",va:485,ua:705,fa:"twitter.com",Ya:Wr},kd:{Ja:"locale",va:640,ua:600,fa:"apple.com",Ya:[]}};function Yr(t){for(var e in Jr)if(Jr[e].fa==t)return Jr[e];return null}function zr(t){var e={};e["facebook.com"]=eo,e["google.com"]=io,e["github.com"]=no,e["twitter.com"]=ro;var n=t&&t[Zr];try{if(n)return e[n]?new e[n](t):new to(t);if(void 0!==t[$r])return new Qr(t)}catch(i){}return null}var $r="idToken",Zr="providerId";function Qr(t){var e=t[Zr];if(!e&&t[$r]){var n=Gr(t[$r]);n&&n.b&&(e=n.b)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,void 0!==t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),zi(this,"providerId",e),zi(this,"isNewUser",n)}function to(t){Qr.call(this,t),zi(this,"profile",Qi((t=Ui(t.rawUserInfo||"{}"))||{}))}function eo(t){if(to.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function no(t){if(to.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");zi(this,"username",this.profile&&this.profile.login||null)}function io(t){if(to.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function ro(t){if(to.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");zi(this,"username",t.screenName||null)}function oo(t){var e=qn(t),n=Fn(e,"link"),i=Fn(qn(n),"link");return e=Fn(e,"deep_link_id"),Fn(qn(e),"link")||e||i||n||t}function ao(t,e){if(!t&&!e)throw new N("internal-error","Internal assert: no raw session string available");if(t&&e)throw new N("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?so:uo}k(to,Qr),k(eo,to),k(no,to),k(io,to),k(ro,to);var so="enroll",uo="signin";function co(){}function ho(t,e){return t.then(function(t){if(t[Za]){var n=Gr(t[Za]);if(!n||e!=n.i)throw new N("user-mismatch");return t}throw new N("user-mismatch")}).o(function(t){throw t&&t.code&&t.code==C+"user-not-found"?new N("user-mismatch"):t})}function lo(t,e){if(!e)throw new N("internal-error","failed to construct a credential");this.a=e,zi(this,"providerId",t),zi(this,"signInMethod",t)}function fo(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function po(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new lo(t.providerId,t.pendingToken)}catch(e){}return null}function vo(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&zi(this,"idToken",e.idToken),e.accessToken&&zi(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&zi(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new N("internal-error","failed to construct a credential");zi(this,"accessToken",e.oauthToken),zi(this,"secret",e.oauthTokenSecret)}zi(this,"providerId",t),zi(this,"signInMethod",n)}function mo(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:Qn(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function go(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 vo(t.providerId,e,t.signInMethod)}catch(n){}}return null}function bo(t,e){this.Qc=e||[],$i(this,{providerId:t,isOAuthProvider:!0}),this.Jb={},this.qb=(Yr(t)||{}).Ja||null,this.pb=null}function yo(t){if("string"!=typeof t||0!=t.indexOf("saml."))throw new N("argument-error",'SAML provider IDs must be prefixed with "saml."');bo.call(this,t,[])}function wo(t){bo.call(this,t,Xr),this.a=[]}function Io(){wo.call(this,"facebook.com")}function To(t){if(!t)throw new N("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new Io).credential({accessToken:e})}function Eo(){wo.call(this,"github.com")}function Ao(t){if(!t)throw new N("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new Eo).credential({accessToken:e})}function ko(){wo.call(this,"google.com"),this.Ca("profile")}function So(t,e){var n=t;return m(t)&&(n=t.idToken,e=t.accessToken),(new ko).credential({idToken:n,accessToken:e})}function No(){bo.call(this,"twitter.com",Wr)}function _o(t,e){var n=t;if(m(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new N("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new vo("twitter.com",n,"twitter.com")}function Oo(t,e,n){this.a=t,this.f=e,zi(this,"providerId","password"),zi(this,"signInMethod",n===Ro.EMAIL_LINK_SIGN_IN_METHOD?Ro.EMAIL_LINK_SIGN_IN_METHOD:Ro.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Co(t){return t&&t.email&&t.password?new Oo(t.email,t.password,t.signInMethod):null}function Ro(){$i(this,{providerId:"password",isOAuthProvider:!1})}function Po(t,e){if(!(e=Do(e)))throw new N("argument-error","Invalid email link!");return new Oo(t,e.code,Ro.EMAIL_LINK_SIGN_IN_METHOD)}function Do(t){return(t=Or(t=oo(t)))&&t.operation===cr?t:null}function Lo(t){if(!(t.fb&&t.eb||t.La&&t.ea))throw new N("internal-error");this.a=t,zi(this,"providerId","phone"),this.fa="phone",zi(this,"signInMethod","phone")}function xo(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return B(["verificationId","verificationCode","temporaryProof","phoneNumber"],function(n){t[n]&&(e[n]=t[n])}),new Lo(e)}return null}function Mo(t){return t.a.La&&t.a.ea?{temporaryProof:t.a.La,phoneNumber:t.a.ea}:{sessionInfo:t.a.fb,code:t.a.eb}}function jo(t){try{this.a=t||e.default.auth()}catch(n){throw new N("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().")}$i(this,{providerId:"phone",isOAuthProvider:!1})}function Uo(t,e){if(!t)throw new N("missing-verification-id");if(!e)throw new N("missing-verification-code");return new Lo({fb:t,eb: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,i=t&&t.oauthTokenSecret,r=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return So(o,n);case"facebook.com":return To(n);case"github.com":return Ao(n);case"twitter.com":return _o(n,i);default:return n||i||o||a?a?0==e.indexOf("saml.")?new lo(e,a):new vo(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new wo(e).credential({idToken:o,accessToken:n,rawNonce:r}):null}}catch(s){return null}}function Fo(t){if(!t.isOAuthProvider)throw new N("invalid-oauth-provider")}function qo(t,e,n,i,r,o,a){if(this.c=t,this.b=e||null,this.g=n||null,this.f=i||null,this.i=o||null,this.h=a||null,this.a=r||null,!this.g&&!this.a)throw new N("invalid-auth-event");if(this.g&&this.a)throw new N("invalid-auth-event");if(this.g&&!this.f)throw new N("invalid-auth-event")}function Ko(t){return(t=t||{}).type?new qo(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&_(t.error),t.postBody,t.tenantId):null}function Ho(){this.b=null,this.a=[]}ao.prototype.Ha=function(){return this.a?Ce(this.a):Ce(this.b)},ao.prototype.w=function(){return this.type==so?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},co.prototype.ka=function(){},co.prototype.b=function(){},co.prototype.c=function(){},co.prototype.w=function(){},lo.prototype.ka=function(t){return ws(t,fo(this))},lo.prototype.b=function(t,e){var n=fo(this);return n.idToken=e,Is(t,n)},lo.prototype.c=function(t,e){return ho(Ts(t,fo(this)),e)},lo.prototype.w=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},vo.prototype.ka=function(t){return ws(t,mo(this))},vo.prototype.b=function(t,e){var n=mo(this);return n.idToken=e,Is(t,n)},vo.prototype.c=function(t,e){return ho(Ts(t,mo(this)),e)},vo.prototype.w=function(){var t={providerId:this.providerId,signInMethod: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},bo.prototype.Ka=function(t){return this.Jb=mt(t),this},k(yo,bo),k(wo,bo),wo.prototype.Ca=function(t){return Y(this.a,t)||this.a.push(t),this},wo.prototype.Rb=function(){return Q(this.a)},wo.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 N("argument-error","credential failed: must provide the ID token and/or the access token.");return new vo(this.providerId,n,this.providerId)},k(Io,wo),zi(Io,"PROVIDER_ID","facebook.com"),zi(Io,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),k(Eo,wo),zi(Eo,"PROVIDER_ID","github.com"),zi(Eo,"GITHUB_SIGN_IN_METHOD","github.com"),k(ko,wo),zi(ko,"PROVIDER_ID","google.com"),zi(ko,"GOOGLE_SIGN_IN_METHOD","google.com"),k(No,bo),zi(No,"PROVIDER_ID","twitter.com"),zi(No,"TWITTER_SIGN_IN_METHOD","twitter.com"),Oo.prototype.ka=function(t){return this.signInMethod==Ro.EMAIL_LINK_SIGN_IN_METHOD?iu(t,Cs,{email:this.a,oobCode:this.f}):iu(t,Zs,{email:this.a,password:this.f})},Oo.prototype.b=function(t,e){return this.signInMethod==Ro.EMAIL_LINK_SIGN_IN_METHOD?iu(t,Rs,{idToken:e,email:this.a,oobCode:this.f}):iu(t,Gs,{idToken:e,email:this.a,password:this.f})},Oo.prototype.c=function(t,e){return ho(this.ka(t),e)},Oo.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},$i(Ro,{PROVIDER_ID:"password"}),$i(Ro,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),$i(Ro,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Lo.prototype.ka=function(t){return t.gb(Mo(this))},Lo.prototype.b=function(t,e){var n=Mo(this);return n.idToken=e,iu(t,tu,n)},Lo.prototype.c=function(t,e){var n=Mo(this);return n.operation="REAUTH",ho(t=iu(t,eu,n),e)},Lo.prototype.w=function(){var t={providerId:"phone"};return this.a.fb&&(t.verificationId=this.a.fb),this.a.eb&&(t.verificationCode=this.a.eb),this.a.La&&(t.temporaryProof=this.a.La),this.a.ea&&(t.phoneNumber=this.a.ea),t},jo.prototype.gb=function(t,e){var n=this.a.a;return Ce(e.verify()).then(function(i){if("string"!=typeof i)throw new N("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 r=m(t)?t.session:null,o=m(t)?t.phoneNumber:t;return(r&&r.type==so?r.Ha().then(function(t){return iu(n,Ws,{idToken:t,phoneEnrollmentInfo:{phoneNumber:o,recaptchaToken:i}}).then(function(t){return t.phoneSessionInfo.sessionInfo})}):r&&r.type==uo?r.Ha().then(function(e){return function(t,e){return iu(t,Xs,e).then(function(t){return t.phoneResponseInfo.sessionInfo})}(n,{mfaPendingCredential:e,mfaEnrollmentId:t.multiFactorHint&&t.multiFactorHint.uid||t.multiFactorUid,phoneSignInInfo:{recaptchaToken:i}})}):function(t,e){return iu(t,Ks,e)}(n,{phoneNumber:o,recaptchaToken:i})).then(function(t){return"function"==typeof e.reset&&e.reset(),t},function(t){throw"function"==typeof e.reset&&e.reset(),t});default:throw new N("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}})},$i(jo,{PROVIDER_ID:"phone"}),$i(jo,{PHONE_SIGN_IN_METHOD:"phone"}),qo.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("-")},qo.prototype.T=function(){return this.h},qo.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,Bo=null;function Wo(t){var e="unauthorized-domain",n=void 0,i=qn(t);t=i.a,"chrome-extension"==(i=i.c)?n=Gt("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"==i||"https"==i?n=Gt("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",N.call(this,e,n)}function Xo(t,e,n){N.call(this,t,n),(t=e||{}).Kb&&zi(this,"email",t.Kb),t.ea&&zi(this,"phoneNumber",t.ea),t.credential&&zi(this,"credential",t.credential),t.$b&&zi(this,"tenantId",t.$b)}function Jo(t){if(t.code){var e=t.code||"";0==e.indexOf(C)&&(e=e.substring(C.length));var n={credential:Vo(t),$b:t.tenantId};if(t.email)n.Kb=t.email;else if(t.phoneNumber)n.ea=t.phoneNumber;else if(!n.credential)return new N(e,t.message||void 0);return new Xo(e,n,t.message)}return null}function Yo(){}function zo(t){return t.c||(t.c=t.b())}function $o(){}function Zo(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 i=e[n];try{return new ActiveXObject(i),t.f=i}catch(r){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function Qo(){}function ta(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=T(this.qc,this),this.a.onerror=T(this.Tb,this),this.a.onprogress=T(this.rc,this),this.a.ontimeout=T(this.vc,this)}function ea(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function na(t,e,n){this.reset(t,e,n,void 0,void 0)}k(Wo,N),k(Xo,N),Xo.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&&bt(t,e),t},Xo.prototype.toJSON=function(){return this.w()},Yo.prototype.c=null,k($o,Yo),$o.prototype.a=function(){var t=Zo(this);return t?new ActiveXObject(t):new XMLHttpRequest},$o.prototype.b=function(){var t={};return Zo(this)&&(t[0]=!0,t[1]=!0),t},Go=new $o,k(Qo,Yo),Qo.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new ta;throw Error("Unsupported browser")},Qo.prototype.b=function(){return{}},(n=ta.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,ea(this,4)},n.Tb=function(){this.status=500,this.response=this.responseText="",ea(this,4)},n.vc=function(){this.Tb()},n.rc=function(){this.status=200,ea(this,1)},n.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},na.prototype.a=null;function ia(t){this.f=t,this.b=this.c=this.a=null}function ra(t,e){this.name=t,this.value=e}na.prototype.reset=function(t,e,n,i,r){"number"==typeof r||0,i||A(),delete this.a},ra.prototype.toString=function(){return this.name};var oa=new ra("SEVERE",1e3),aa=new ra("WARNING",900),sa=new ra("CONFIG",700),ua=new ra("FINE",500);ia.prototype.log=function(t,e,n){if(t.value>=function t(e){return e.c?e.c:e.a?t(e.a):(j("Root logger has no level set."),null)}(this).value)for(v(e)&&(e=e()),t=new na(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var ca={},ha=null;function la(t){var e;if(ha||(ha=new ia(""),ca[""]=ha,ha.c=sa),!(e=ca[t])){e=new ia(t);var n=t.lastIndexOf("."),i=t.substr(n+1);(n=la(t.substr(0,n))).b||(n.b={}),n.b[i]=e,e.a=n,ca[t]=e}return e}function fa(t,e){t&&t.log(ua,e,void 0)}function da(t){this.f=t}function pa(t){En.call(this),this.u=t,this.h=void 0,this.readyState=va,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=la("goog.net.FetchXmlHttp"),this.m=this.c=this.g=null}k(da,Yo),da.prototype.a=function(){return new pa(this.f)},da.prototype.b=function(t){return function(){return t}}({}),k(pa,En);var va=0;function ma(t){t.c.read().then(t.pc.bind(t)).catch(t.Va.bind(t))}function ga(t){t.readyState=4,t.g=null,t.c=null,t.m=null,ba(t)}function ba(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function ya(t){En.call(this),this.headers=new Rn,this.D=t||null,this.c=!1,this.C=this.a=null,this.h=this.P=this.l="",this.f=this.N=this.i=this.J=!1,this.g=0,this.s=null,this.m=wa,this.u=this.S=!1}(n=pa.prototype).open=function(t,e){if(this.readyState!=va)throw this.abort(),Error("Error reopening a connection");this.s=t,this.f=e,this.readyState=1,ba(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};t&&(e.body=t),this.u.fetch(new Request(this.f,e)).then(this.uc.bind(this),this.Va.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,ga(this)),this.readyState=va},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,ba(this)),this.a&&(this.readyState=3,ba(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.sc.bind(this),this.Va.bind(this)):void 0!==u.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.m=new TextDecoder,ma(this)):t.text().then(this.tc.bind(this),this.Va.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?ga(this):ba(this),3==this.readyState&&ma(this)}},n.tc=function(t){this.a&&(this.response=this.responseText=t,ga(this))},n.sc=function(t){this.a&&(this.response=t,ga(this))},n.Va=function(t){var e=this.i;e&&e.log(aa,"Failed to fetch url "+this.f,t instanceof Error?t:Error(t)),this.a&&ga(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(aa,"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(aa,"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(pa.prototype,"withCredentials",{get:function(){return"include"===this.h},set:function(t){this.h=t?"include":"same-origin"}}),k(ya,En);var wa="";ya.prototype.b=la("goog.net.XhrIo");var Ia=/^https?$/i,Ta=["POST","PUT"];function Ea(t,e,n,i,r){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.P=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=T(t.Wb,t);try{fa(t.b,Pa(t,"Opening Xhr")),t.N=!0,t.a.open(n,String(e),!0),t.N=!1}catch(a){return fa(t.b,Pa(t,"Error opening Xhr: "+a.message)),void ka(t,a)}e=i||"";var o=new Rn(t.headers);r&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(p(t)||"string"==typeof t)B(t,e,void 0);else for(var n=Cn(t),i=On(t),r=i.length,o=0;o<r;o++)e.call(void 0,i[o],n&&n[o],t)}(r,function(t,e){o.set(e,t)}),r=function(t){t:{for(var e=Aa,n=t.length,i="string"==typeof t?t.split(""):t,r=0;r<n;r++)if(r in i&&e.call(void 0,i[r],r,t)){e=r;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}(o.Y()),i=u.FormData&&e instanceof u.FormData,!Y(Ta,n)||r||i||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{Oa(t),0<t.g&&(t.u=function(t){return zt&&se(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(t.a),fa(t.b,Pa(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.u)),t.u?(t.a.timeout=t.g,t.a.ontimeout=T(t.Ma,t)):t.s=Nn(t.Ma,t.g,t)),fa(t.b,Pa(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(a){fa(t.b,Pa(t,"Send error: "+a.message)),ka(t,a)}}function Aa(t){return"content-type"==t.toLowerCase()}function ka(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,Sa(t),_a(t)}function Sa(t){t.J||(t.J=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function Na(t){if(t.c&&void 0!==s)if(t.C[1]&&4==Ca(t)&&2==Ra(t))fa(t.b,Pa(t,"Local request error detected and ignored"));else if(t.i&&4==Ca(t))Nn(t.Wb,0,t);else if(t.dispatchEvent("readystatechange"),4==Ca(t)){fa(t.b,Pa(t,"Request complete")),t.c=!1;try{var e,n=Ra(t);t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var i=!0;break t;default:i=!1}if(!(e=i)){var r;if(r=0===n){var o=String(t.l).match(Ln)[1]||null;if(!o&&u.self&&u.self.location){var a=u.self.location.protocol;o=a.substr(0,a.length-1)}r=!Ia.test(o?o.toLowerCase():"")}e=r}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<Ca(t)?t.a.statusText:""}catch(h){fa(t.b,"Can not get status: "+h.message),c=""}t.h=c+" ["+Ra(t)+"]",Sa(t)}}finally{_a(t)}}}function _a(t,e){if(t.a){Oa(t);var n=t.a,i=t.C[0]?f:null;t.a=null,t.C=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=i}catch(r){(t=t.b)&&t.log(oa,"Problem encountered resetting onreadystatechange: "+r.message,void 0)}}}function Oa(t){t.a&&t.u&&(t.a.ontimeout=null),t.s&&(u.clearTimeout(t.s),t.s=null)}function Ca(t){return t.a?t.a.readyState:0}function Ra(t){try{return 2<Ca(t)?t.a.status:-1}catch(e){return-1}}function Pa(t,e){return e+" ["+t.P+" "+t.l+" "+Ra(t)+"]"}function Da(t){var e=Ga;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 La(t,e,n){t.a=!0,t.c=n,t.f=!e,Ua(t)}function xa(t){if(t.a){if(!t.v)throw new Va(t);t.v=!1}}function Ma(t,e,n,i){t.g.push([e,n,i]),t.a&&Ua(t)}function ja(t){return J(t.g,function(t){return v(t[1])})}function Ua(t){if(t.h&&t.a&&ja(t)){var e=t.h,n=Ka[e];n&&(u.clearTimeout(n.a),delete Ka[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var i=n=!1;t.g.length&&!t.i;){var r=t.g.shift(),o=r[0],a=r[1];if(r=r[2],o=t.f?a:o)try{var s=o.call(r||t.s,e);void 0!==s&&(t.f=t.f&&(s==e||s instanceof Error),t.c=e=s),(L(e)||"function"==typeof u.Promise&&e instanceof u.Promise)&&(i=!0,t.i=!0)}catch(c){e=c,t.f=!0,ja(t)||(n=!0)}}t.c=e,i&&(s=T(t.m,t,!0),i=T(t.m,t,!1),e instanceof Da?(Ma(e,s,i),e.C=!0):e.then(s,i)),n&&(e=new qa(e),Ka[e.a]=e,t.h=e.a)}function Va(){x.call(this)}function Fa(){x.call(this)}function qa(t){this.a=u.setTimeout(T(this.c,this),0),this.b=t}(n=ya.prototype).Ma=function(){void 0!==s&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",fa(this.b,Pa(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},n.abort=function(){this.a&&this.c&&(fa(this.b,Pa(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),_a(this))},n.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),_a(this,!0)),ya.bb.Da.call(this)},n.Wb=function(){this.ya||(this.N||this.i||this.f?Na(this):this.Jc())},n.Jc=function(){Na(this)},n.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case wa: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(oa,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(e){return fa(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 Fa(this),xa(this),La(this,!1,t))}},Da.prototype.m=function(t,e){this.i=!1,La(this,t,e)},Da.prototype.then=function(t,e,n){var i,r,o=new Ee(function(t,e){i=t,r=e});return Ma(this,i,function(t){t instanceof Fa?o.cancel():r(t)}),o.then(t,e,n)},Da.prototype.$goog_Thenable=!0,k(Va,x),Va.prototype.message="Deferred has already fired",Va.prototype.name="AlreadyCalledError",k(Fa,x),Fa.prototype.message="Deferred was canceled",Fa.prototype.name="CanceledError",qa.prototype.c=function(){throw delete Ka[this.a],this.b};var Ka={};function Ha(t){var e={},n=e.document||document,i=Nt(t).toString(),r=ge(document,"SCRIPT"),o={Xb:r,Ma:void 0},a=new Da(o),s=null,c=null!=e.timeout?e.timeout:5e3;return 0<c&&(s=window.setTimeout(function(){Ba(r,!0);var t=new Ja(Xa,"Timeout reached for loading script "+i);xa(a),La(a,!1,t)},c),o.Ma=s),r.onload=r.onreadystatechange=function(){r.readyState&&"loaded"!=r.readyState&&"complete"!=r.readyState||(Ba(r,e.xd||!1,s),xa(a),La(a,!0,null))},r.onerror=function(){Ba(r,!0,s);var t=new Ja(Wa,"Error while loading script "+i);xa(a),La(a,!1,t)},bt(o=e.attributes||{},{type:"text/javascript",charset:"UTF-8"}),fe(r,o),function(t,e){yt(t,"HTMLScriptElement"),t.src=Nt(e),(e=t.ownerDocument&&t.ownerDocument.defaultView)&&e!=u?e=l(e.document):(null===h&&(h=l(u.document)),e=h),e&&t.setAttribute("nonce",e)}(r,t),function(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}(n).appendChild(r),a}function Ga(){if(this&&this.Xb){var t=this.Xb;t&&"SCRIPT"==t.tagName&&Ba(t,!0,this.Ma)}}function Ba(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 Wa=0,Xa=1;function Ja(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),x.call(this,n),this.code=t}function Ya(t){this.f=t}function za(t,n,i){if(this.c=t,t=n||{},this.l=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||Qa,this.g=mt(t.secureTokenHeaders||ts),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.v=t.firebaseTimeout||es,this.a=mt(t.firebaseHeaders||ns),i&&(this.a["X-Client-Version"]=i,this.g["X-Client-Version"]=i),i="Node"==Ti(),!(i=u.XMLHttpRequest||i&&e.default.INTERNAL.node&&e.default.INTERNAL.node.XMLHttpRequest)&&!Ii())throw new N("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,Ii()?this.f=new da(self):Ei()?this.f=new Ya(i):this.f=new Qo,this.b=null}k(Ja,x),k(Ya,Yo),Ya.prototype.a=function(){return new this.f},Ya.prototype.b=function(){return{}};var $a,Za="idToken",Qa=new Ki(3e4,6e4),ts={"Content-Type":"application/x-www-form-urlencoded"},es=new Ki(3e4,6e4),ns={"Content-Type":"application/json"};function is(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function rs(t,e){e&&(t.l=os("https://securetoken.googleapis.com/v1/token",e),t.h=os("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",e),t.i=os("https://identitytoolkit.googleapis.com/v2/",e))}function os(t,e){return t=qn(t),e=qn(e.url),t.f=t.a+t.f,Mn(t,e.c),t.a=e.a,jn(t,e.g),t.toString()}function as(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 ss(t,e,n,i,r,o,a){(function(){var t=Oi();return!((t=Si(t)!=ki?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t||zt&&ce&&!(9<ce))})()||Ii()?t=T(t.u,t):($a||($a=new Ee(function(t,e){!function(t,e){if(((window.gapi||{}).client||{}).request)t();else{u[cs]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))};var n=_t(us,{onload:cs});!function(t,e){Ma(t,null,e,void 0)}(Ha(n),function(){e(Error("CORS_UNSUPPORTED"))})}}(t,e)})),t=T(t.s,t)),t(e,n,i,r,o,a)}za.prototype.T=function(){return this.b},za.prototype.u=function(t,e,n,i,r,o){if(Ii()&&(void 0===u.fetch||void 0===u.Headers||void 0===u.Request))throw new N("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 ya(this.f);if(o){a.g=Math.max(0,o);var s=setTimeout(function(){a.dispatchEvent("timeout")},o)}An(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 fa(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(n){t=null}e&&e(t)}),kn(a,"ready",function(){s&&clearTimeout(s),Xe(this)}),kn(a,"timeout",function(){s&&clearTimeout(s),Xe(this),e&&e(null)}),Ea(a,t,n,i,r)};var us=new wt(At,"https://apis.google.com/js/client.js?onload=%{onload}"),cs="__fcb"+Math.floor(1e6*Math.random()).toString();function hs(t,e,n,i,r,o,a){var s=qn(e+n);Vn(s,"key",t.c),a&&Vn(s,"cb",Date.now().toString());var u="GET"==i;if(u)for(var c in r)r.hasOwnProperty(c)&&Vn(s,c,r[c]);return new Ee(function(e,n){ss(t,s.toString(),function(t){t?t.error?n(ou(t,o||{})):e(t):n(new N("network-request-failed"))},i,u?void 0:oi(ji(r)),t.a,t.v.get())})}function ls(t){if("string"!=typeof(t=t.email)||!gi.test(t))throw new N("invalid-email")}function fs(t){"email"in t&&ls(t)}function ds(t){if(!t[Za]){if(t.mfaPendingCredential)throw new N("multi-factor-auth-required",null,mt(t));throw new N("internal-error")}}function ps(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new N("internal-error")}else{if(!t.sessionInfo)throw new N("missing-verification-id");if(!t.code)throw new N("missing-verification-code")}}za.prototype.s=function(t,e,n,i,r){var o=this;$a.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:i,headers:r,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"}})})},za.prototype.Ab=function(){return iu(this,Bs,{})},za.prototype.Cb=function(t,e){return iu(this,Hs,{idToken:t,email:e})},za.prototype.Db=function(t,e){return iu(this,Gs,{idToken:t,password:e})};var vs={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function ms(t){if(!t.phoneVerificationInfo)throw new N("internal-error");if(!t.phoneVerificationInfo.sessionInfo)throw new N("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new N("missing-verification-code")}function gs(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new N("internal-error")}function bs(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&(ei(t=new $n(t.postBody),"nonce")&&(e.nonce=t.get("nonce")))),e}function ys(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=Jo(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=Jo(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=Jo(t)):t.errorMessage&&(e=ru(t.errorMessage)),e)throw e;ds(t)}function ws(t,e){return e.returnIdpCredential=!0,iu(t,Js,e)}function Is(t,e){return e.returnIdpCredential=!0,iu(t,zs,e)}function Ts(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,iu(t,Ys,e)}function Es(t){if(!t.oobCode)throw new N("invalid-action-code")}(n=za.prototype).Eb=function(t,e){var n={idToken:t},i=[];return pt(vs,function(t,r){var o=e[r];null===o?i.push(t):r in e&&(n[r]=o)}),i.length&&(n.deleteAttribute=i),iu(this,Hs,n)},n.wb=function(t,e){return bt(t={requestType:"PASSWORD_RESET",email:t},e),iu(this,Us,t)},n.xb=function(t,e){return bt(t={requestType:"EMAIL_SIGNIN",email:t},e),iu(this,xs,t)},n.vb=function(t,e){return bt(t={requestType:"VERIFY_EMAIL",idToken:t},e),iu(this,Ms,t)},n.Fb=function(t,e,n){return bt(t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},n),iu(this,js,t)},n.gb=function(t){return iu(this,Qs,t)},n.ob=function(t,e){return iu(this,qs,{oobCode:t,newPassword:e})},n.Sa=function(t){return iu(this,ks,{oobCode:t})},n.kb=function(t){return iu(this,As,{oobCode:t})};var As={endpoint:"setAccountInfo",A:Es,Z:"email",B:!0},ks={endpoint:"resetPassword",A:Es,G:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new N("internal-error")},B:!0},Ss={endpoint:"signupNewUser",A:function(t){if(ls(t),!t.password)throw new N("weak-password")},G:ds,V:!0,B:!0},Ns={endpoint:"createAuthUri",B:!0},_s={endpoint:"deleteAccount",O:["idToken"]},Os={endpoint:"setAccountInfo",O:["idToken","deleteProvider"],A:function(t){if(!Array.isArray(t.deleteProvider))throw new N("internal-error")}},Cs={endpoint:"emailLinkSignin",O:["email","oobCode"],A:ls,G:ds,V:!0,B:!0},Rs={endpoint:"emailLinkSignin",O:["idToken","email","oobCode"],A:ls,G:ds,V:!0},Ps={endpoint:"accounts/mfaEnrollment:finalize",O:["idToken","phoneVerificationInfo"],A:ms,G:ds,B:!0,Na:!0},Ds={endpoint:"accounts/mfaSignIn:finalize",O:["mfaPendingCredential","phoneVerificationInfo"],A:ms,G:ds,B:!0,Na:!0},Ls={endpoint:"getAccountInfo"},xs={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new N("internal-error");ls(t)},Z:"email",B:!0},Ms={endpoint:"getOobConfirmationCode",O:["idToken","requestType"],A:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new N("internal-error")},Z:"email",B:!0},js={endpoint:"getOobConfirmationCode",O:["idToken","newEmail","requestType"],A:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new N("internal-error")},Z:"email",B:!0},Us={endpoint:"getOobConfirmationCode",O:["requestType"],A:function(t){if("PASSWORD_RESET"!=t.requestType)throw new N("internal-error");ls(t)},Z:"email",B:!0},Vs={mb:!0,endpoint:"getProjectConfig",Vb:"GET"},Fs={mb:!0,endpoint:"getRecaptchaParam",Vb:"GET",G:function(t){if(!t.recaptchaSiteKey)throw new N("internal-error")}},qs={endpoint:"resetPassword",A:Es,Z:"email",B:!0},Ks={endpoint:"sendVerificationCode",O:["phoneNumber","recaptchaToken"],Z:"sessionInfo",B:!0},Hs={endpoint:"setAccountInfo",O:["idToken"],A:fs,V:!0},Gs={endpoint:"setAccountInfo",O:["idToken"],A:function(t){if(fs(t),!t.password)throw new N("weak-password")},G:ds,V:!0},Bs={endpoint:"signupNewUser",G:ds,V:!0,B:!0},Ws={endpoint:"accounts/mfaEnrollment:start",O:["idToken","phoneEnrollmentInfo"],A:function(t){if(!t.phoneEnrollmentInfo)throw new N("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new N("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new N("missing-app-credential")},G:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new N("internal-error")},B:!0,Na:!0},Xs={endpoint:"accounts/mfaSignIn:start",O:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new N("missing-app-credential")},G:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new N("internal-error")},B:!0,Na:!0},Js={endpoint:"verifyAssertion",A:gs,Za:bs,G:ys,V:!0,B:!0},Ys={endpoint:"verifyAssertion",A:gs,Za:bs,G:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new N("user-not-found");if(t.errorMessage)throw ru(t.errorMessage);ds(t)},V:!0,B:!0},zs={endpoint:"verifyAssertion",A:function(t){if(gs(t),!t.idToken)throw new N("internal-error")},Za:bs,G:ys,V:!0},$s={endpoint:"verifyCustomToken",A:function(t){if(!t.token)throw new N("invalid-custom-token")},G:ds,V:!0,B:!0},Zs={endpoint:"verifyPassword",A:function(t){if(ls(t),!t.password)throw new N("wrong-password")},G:ds,V:!0,B:!0},Qs={endpoint:"verifyPhoneNumber",A:ps,G:ds,B:!0},tu={endpoint:"verifyPhoneNumber",A:function(t){if(!t.idToken)throw new N("internal-error");ps(t)},G:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",Jo(t);ds(t)}},eu={Ib:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:ps,G:ds,B:!0},nu={endpoint:"accounts/mfaEnrollment:withdraw",O:["idToken","mfaEnrollmentId"],G:function(t){if(!!t[Za]^!!t.refreshToken)throw new N("internal-error")},B:!0,Na:!0};function iu(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 i=t[e[n]];if(null==i||""===i)return!1}return!0}(n,e.O))return Re(new N("internal-error"));var i,r=!!e.Na,o=e.Vb||"POST";return Ce(n).then(e.A).then(function(){return e.V&&(n.returnSecureToken=!0),e.B&&t.b&&void 0===n.tenantId&&(n.tenantId=t.b),hs(t,r?t.i:t.h,e.endpoint,o,n,e.Ib,e.mb||!1)}).then(function(t){return i=t,e.Za?e.Za(n,i):i}).then(e.G).then(function(){if(!e.Z)return i;if(!(e.Z in i))throw new N("internal-error");return i[e.Z]})}function ru(t){return ou({error:{errors:[{message:t}],code:400,message:t}})}function ou(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",i={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=i[n]?new N(i[n]):null)return n;for(var r in n=t.error&&t.error.message||"",bt(i={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_NONCE:"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,i)if(0===n.indexOf(r))return new N(i[r],e);return!e&&t&&(e=Mi(t)),new N("internal-error",e)}function au(t){this.b=t,this.a=null,this.sb=function(t){return(hu||(hu=new Ee(function(t,e){function n(){qi(),Ci("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){qi(),e(Error("Network Error"))},timeout:uu.get()})}if(Ci("gapi.iframes.Iframe"))t();else if(Ci("gapi.load"))n();else{var i="__iframefcb"+Math.floor(1e6*Math.random()).toString();u[i]=function(){Ci("gapi.load")?n():e(Error("Network Error"))},Ce(Ha(i=_t(su,{onload:i}))).o(function(){e(Error("Network Error"))})}}).o(function(t){throw hu=null,t}))).then(function(){return new Ee(function(e,n){Ci("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:Ci("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(i){function r(){clearTimeout(o),e()}t.a=i,t.a.restyle({setHideOnLeave:!1});var o=setTimeout(function(){n(Error("Network Error"))},cu.get());i.ping(r).then(r,function(){n(Error("Network Error"))})})})})}(this)}var su=new wt(At,"https://apis.google.com/js/api.js?onload=%{onload}"),uu=new Ki(3e4,6e4),cu=new Ki(5e3,15e3),hu=null;function lu(t,e,n,i){this.l=t,this.h=e,this.i=n,this.g=i,this.f=null,this.g?t=Kn((t=qn(this.g.url)).c,t.a,t.g,"/emulator/auth/iframe"):t=Kn("https",this.l,null,"/__/auth/iframe"),this.a=t,Vn(this.a,"apiKey",this.h),Vn(this.a,"appName",this.i),this.b=null,this.c=[]}function fu(t,e,n,i,r,o){this.u=t,this.s=e,this.c=n,this.m=i,this.v=o,this.i=this.g=this.l=null,this.a=r,this.h=this.f=null}function du(t){try{return e.default.app(t).auth().Ga()}catch(n){return[]}}function pu(t,e,n,i,r,o){this.s=t,this.g=e,this.b=n,this.f=o,this.c=i||null,this.i=r||null,this.l=this.u=this.C=null,this.h=[],this.m=this.a=null}function vu(t){var e=li();return function(t){return iu(t,Vs,{}).then(function(t){return t.authorizedDomains||[]})}(t).then(function(t){t:{var n=qn(e),i=n.c;n=n.a;for(var r=0;r<t.length;r++){var o=t[r],a=n,s=i;if(0==o.indexOf("chrome-extension://")?a=qn(o).a==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:mi.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){t=!0;break t}}t=!1}if(!t)throw new Wo(li())})}function mu(t){return t.m?t.m:(t.m=bi().then(function(){if(!t.u){var e=t.c,n=t.i,i=du(t.b),r=new lu(t.s,t.g,t.b,t.f);r.f=e,r.b=n,r.c=Q(i||[]),t.u=r.toString()}t.v=new au(t.u),function(t){if(!t.v)throw Error("IfcHandler must be initialized!");!function(t,e){t.sb.then(function(){t.a.register("authEvent",e,Ci("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}(t.v,function(e){var n={};if(e&&e.authEvent){var i=!1;for(e=Ko(e.authEvent),n=0;n<t.h.length;n++)i=t.h[n](e)||i;return(n={}).status=i?"ACK":"ERROR",Ce(n)}return n.status="ERROR",Ce(n)})}(t)}),t.m)}function gu(t){return t.l||(t.C=t.c?_i(t.c,du(t.b)):null,t.l=new za(t.g,D(t.i),t.C),t.f&&rs(t.l,t.f)),t.l}function bu(t,e,n,i,r,o,a,s,u,c,h,l){return(t=new fu(t,e,n,i,r,l)).l=o,t.g=a,t.i=s,t.b=mt(u||null),t.f=c,t.zb(h).toString()}function yu(t){if(this.a=t||e.default.INTERNAL.reactNative&&e.default.INTERNAL.reactNative.AsyncStorage,!this.a)throw new N("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function wu(t){this.b=t,this.a={},this.f=T(this.c,this)}lu.prototype.toString=function(){return this.f?Vn(this.a,"v",this.f):ti(this.a.b,"v"),this.b?Vn(this.a,"eid",this.b):ti(this.a.b,"eid"),this.c.length?Vn(this.a,"fw",this.c.join(",")):ti(this.a.b,"fw"),this.a.toString()},fu.prototype.zb=function(t){return this.h=t,this},fu.prototype.toString=function(){if(this.v){var t=qn(this.v.url);t=Kn(t.c,t.a,t.g,"/emulator/auth/handler")}else t=Kn("https",this.u,null,"/__/auth/handler");if(Vn(t,"apiKey",this.s),Vn(t,"appName",this.c),Vn(t,"authType",this.m),this.a.isOAuthProvider){var n=this.a;try{var i=e.default.app(this.c).auth().la()}catch(u){i=null}for(var r in n.pb=i,Vn(t,"providerId",this.a.providerId),n=ji((i=this.a).Jb))n[r]=n[r].toString();r=i.Qc,n=mt(n);for(var o=0;o<r.length;o++){var a=r[o];a in n&&delete n[a]}i.qb&&i.pb&&!n[i.qb]&&(n[i.qb]=i.pb),vt(n)||Vn(t,"customParameters",Mi(n))}if("function"==typeof this.a.Rb&&((i=this.a.Rb()).length&&Vn(t,"scopes",i.join(","))),this.l?Vn(t,"redirectUrl",this.l):ti(t.b,"redirectUrl"),this.g?Vn(t,"eventId",this.g):ti(t.b,"eventId"),this.i?Vn(t,"v",this.i):ti(t.b,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Fn(t,s)&&Vn(t,s,this.b[s]);return this.h?Vn(t,"tid",this.h):ti(t.b,"tid"),this.f?Vn(t,"eid",this.f):ti(t.b,"eid"),(s=du(this.c)).length&&Vn(t,"fw",s.join(",")),t.toString()},(n=pu.prototype).Pb=function(t,e,n){var i=new N("popup-closed-by-user"),r=new N("web-storage-unsupported"),o=this,a=!1;return this.ma().then(function(){(function(t){var e={type:"webStorageSupport"};return mu(t).then(function(){return function(t,e){return t.sb.then(function(){return new Ee(function(n){t.a.send(e.type,e,n,Ci("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}(t.v,e)}).then(function(t){if(t&&t.length&&void 0!==t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()})})(o).then(function(n){n||(t&&pi(t),e(r),a=!0)})}).o(function(){}).then(function(){if(!a)return function(t){return new Ee(function(e){return function n(){_n(2e3).then(function(){if(t&&!t.closed)return n();e()})}()})}(t)}).then(function(){if(!a)return _n(n).then(function(){e(i)})})},n.Yb=function(){var t=Oi();return!xi(t)&&!Fi(t)},n.Ub=function(){return!1},n.Nb=function(t,e,n,i,r,o,a,s){if(!t)return Re(new N("popup-blocked"));if(a&&!xi())return this.ma().o(function(e){pi(t),r(e)}),i(),Ce();this.a||(this.a=vu(gu(this)));var u=this;return this.a.then(function(){var e=u.ma().o(function(e){throw pi(t),r(e),e});return i(),e}).then(function(){(Fo(n),a)||fi(bu(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.Ob=function(t,e,n,i){this.a||(this.a=vu(gu(this)));var r=this;return this.a.then(function(){Fo(e),fi(bu(r.s,r.g,r.b,t,e,li(),n,r.c,void 0,r.i,i,r.f))}).o(function(t){throw"auth/network-request-failed"==t.code&&(r.a=null),t})},n.ma=function(){var t=this;return mu(this).then(function(){return t.v.sb}).o(function(){throw t.a=null,new N("network-request-failed")})},n.ac=function(){return!0},n.Ea=function(t){this.h.push(t)},n.Ta=function(t){$(this.h,function(e){return e==t})},(n=yu.prototype).get=function(t){return Ce(this.a.getItem(t)).then(function(t){return t&&Ui(t)})},n.set=function(t,e){return Ce(this.a.setItem(t,Mi(e)))},n.U=function(t){return Ce(this.a.removeItem(t))},n.ca=function(){},n.ia=function(){};var Iu,Tu=[];function Eu(t,e,n){vt(t.a)&&t.b.addEventListener("message",t.f),void 0===t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function Au(t){this.a=t}function ku(t){this.c=t,this.b=!1,this.a=[]}function Su(t,e,n,i){var r,o,a,s,u=n||{},c=null;if(t.b)return Re(Error("connection_unavailable"));var h=i?800:50,l="undefined"!=typeof MessageChannel?new MessageChannel:null;return new Ee(function(n,i){l?(r=Math.floor(Math.random()*Math.pow(10,20)).toString(),l.port1.start(),a=setTimeout(function(){i(Error("unsupported_event"))},h),c={messageChannel:l,onMessage:o=function(t){t.data.eventId===r&&("ack"===t.data.status?(clearTimeout(a),s=setTimeout(function(){i(Error("timeout"))},3e3)):"done"===t.data.status?(clearTimeout(s),void 0!==t.data.response?n(t.data.response):i(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),i(Error("invalid_response"))))}},t.a.push(c),l.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:r,data:u},[l.port2])):i(Error("connection_unavailable"))}).then(function(e){return Nu(t,c),e}).o(function(e){throw Nu(t,c),e})}function Nu(t,e){if(e){var n=e.messageChannel,i=e.onMessage;n&&(n.port1.removeEventListener("message",i),n.port1.close()),$(t.a,function(t){return t==e})}}function _u(){if(!Pu())throw new N("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;Ii()&&self?(this.v=function(){var t=Ii()?self:null;if(B(Tu,function(n){n.b==t&&(e=n)}),!e){var e=new wu(t);Tu.push(e)}return e}(),Eu(this.v,"keyChanged",function(e,n){return ju(t).then(function(e){return 0<e.length&&B(t.a,function(t){t(e)}),{keyProcessed:Y(e,n.key)}})}),Eu(this.v,"ping",function(){return Ce(["keyChanged"])})):function(){var t=u.navigator;return t&&t.serviceWorker?Ce().then(function(){return t.serviceWorker.ready}).then(function(t){return t.active||null}).o(function(){return null}):Ce(null)}().then(function(e){(t.h=e)&&(t.g=new ku(new Au(e)),Su(t.g,"ping",null,!0).then(function(e){e[0].fulfilled&&Y(e[0].value,"keyChanged")&&(t.s=!0)}).o(function(){}))})}function Ou(t){return new Ee(function(e,n){var i=t.m.open("firebaseLocalStorageDb",1);i.onerror=function(t){try{t.preventDefault()}catch(e){}n(Error(t.target.error))},i.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},i.onsuccess=function(i){(i=i.target.result).objectStoreNames.contains("firebaseLocalStorage")?e(i):function(t){return new Ee(function(e,n){var i=t.m.deleteDatabase("firebaseLocalStorageDb");i.onsuccess=function(){e()},i.onerror=function(t){n(Error(t.target.error))}})}(t).then(function(){return Ou(t)}).then(function(t){e(t)}).o(function(t){n(t)})}})}function Cu(t){return t.i||(t.i=Ou(t)),t.i}function Ru(t,e){var n=0;return new Ee(function i(r,o){Cu(t).then(e).then(r).o(function(e){if(!(3<++n))return Cu(t).then(function(e){return e.close(),t.i=void 0,i(r,o)}).o(function(t){o(t)});o(e)})})}function Pu(){try{return!!u.indexedDB}catch(Jt){return!1}}function Du(t){return t.objectStore("firebaseLocalStorage")}function Lu(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function xu(t){return new Ee(function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}})}function Mu(t,e){return t.g&&t.h&&function(){var t=u.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?Su(t.g,"keyChanged",{key:e},t.s).then(function(){}).o(function(){}):Ce()}function ju(t){return Cu(t).then(function(t){var e=Du(Lu(t,!1));return e.getAll?xu(e.getAll()):new Ee(function(t,n){var i=[],r=e.openCursor();r.onsuccess=function(e){(e=e.target.result)?(i.push(e.value),e.continue()):t(i)},r.onerror=function(t){n(t.target.error)}})}).then(function(e){var n={},i=[];if(0==t.b){for(i=0;i<e.length;i++)n[e[i].fbase_key]=e[i].value;i=function t(e,n){var i,r=[];for(i in e)i in n?typeof e[i]!=typeof n[i]?r.push(i):"object"==typeof e[i]&&null!=e[i]&&null!=n[i]?0<t(e[i],n[i]).length&&r.push(i):e[i]!==n[i]&&r.push(i):r.push(i);for(i in n)i in e||r.push(i);return r}(t.c,n),t.c=n}return i})}function Uu(t){t.l&&t.l.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Vu(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=Ce().then(function(){if(Pu()){var t=Vi(),i="__sak"+t;return Iu||(Iu=new _u),(n=Iu).set(i,t).then(function(){return n.get(i)}).then(function(e){if(e!==t)throw Error("indexedDB not supported!");return n.U(i)}).then(function(){return n}).o(function(){return e.c})}return e.c}).then(function(t){return e.type=t.type,t.ca(function(t){B(e.a,function(e){e(t)})}),t})}function Fu(){this.a={},this.type="inMemory"}function qu(){if(!function(){var t="Node"==Ti();if(!(t=Ku()||t&&e.default.INTERNAL.node&&e.default.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(n){return!1}}()){if("Node"==Ti())throw new N("internal-error","The LocalStorage compatibility library was not found.");throw new N("web-storage-unsupported")}this.a=Ku()||e.default.INTERNAL.node.localStorage,this.type="localStorage"}function Ku(){try{var t=u.localStorage,e=Vi();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Hu(){this.type="nullStorage"}function Gu(){if(!function(){var t="Node"==Ti();if(!(t=Bu()||t&&e.default.INTERNAL.node&&e.default.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(n){return!1}}()){if("Node"==Ti())throw new N("internal-error","The SessionStorage compatibility library was not found.");throw new N("web-storage-unsupported")}this.a=Bu()||e.default.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Bu(){try{var t=u.sessionStorage,e=Vi();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Wu(){var t={};t.Browser=Yu,t.Node=zu,t.ReactNative=$u,t.Worker=Zu,this.a=t[Ti()]}wu.prototype.c=function(t){var e=t.data.eventType,n=t.data.eventId,i=this.a[e];if(i&&0<i.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var r=[];B(i,function(e){r.push(Ce().then(function(){return e(t.origin,t.data.data)}))}),De(r).then(function(i){var r=[];B(i,function(t){r.push({fulfilled:t.Qb,value:t.value,reason:t.reason?t.reason.message:void 0})}),B(r,function(t){for(var e in t)void 0===t[e]&&delete t[e]}),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:r})})}},Au.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},ku.prototype.close=function(){for(;0<this.a.length;)Nu(this,this.a[0]);this.b=!0},(n=_u.prototype).set=function(t,e){var n=this,i=!1;return Ru(this,function(e){return xu((e=Du(Lu(e,!0))).get(t))}).then(function(r){return Ru(n,function(o){if(o=Du(Lu(o,!0)),r)return r.value=e,xu(o.put(r));n.b++,i=!0;var a={};return a.fbase_key=t,a.value=e,xu(o.add(a))})}).then(function(){return n.c[t]=e,Mu(n,t)}).oa(function(){i&&n.b--})},n.get=function(t){return Ru(this,function(e){return xu(Du(Lu(e,!1)).get(t))}).then(function(t){return t&&t.value})},n.U=function(t){var e=this,n=!1;return Ru(this,function(i){return n=!0,e.b++,xu(Du(Lu(i,!0)).delete(t))}).then(function(){return delete e.c[t],Mu(e,t)}).oa(function(){n&&e.b--})},n.ca=function(t){0==this.a.length&&function(t){Uu(t),function e(){t.f=setTimeout(function(){t.l=ju(t).then(function(e){0<e.length&&B(t.a,function(t){t(e)})}).then(function(){e()}).o(function(t){"STOP_EVENT"!=t.message&&e()})},800)}()}(this),this.a.push(t)},n.ia=function(t){$(this.a,function(e){return e==t}),0==this.a.length&&Uu(this)},(n=Vu.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){$(this.a,function(e){return e==t})},(n=Fu.prototype).get=function(t){return Ce(this.a[t])},n.set=function(t,e){return this.a[t]=e,Ce()},n.U=function(t){return delete this.a[t],Ce()},n.ca=function(){},n.ia=function(){},(n=qu.prototype).get=function(t){var e=this;return Ce().then(function(){return Ui(e.a.getItem(t))})},n.set=function(t,e){var n=this;return Ce().then(function(){var i=Mi(e);null===i?n.U(t):n.a.setItem(t,i)})},n.U=function(t){var e=this;return Ce().then(function(){e.a.removeItem(t)})},n.ca=function(t){u.window&&ln(u.window,"storage",t)},n.ia=function(t){u.window&&pn(u.window,"storage",t)},(n=Hu.prototype).get=function(){return Ce(null)},n.set=function(){return Ce()},n.U=function(){return Ce()},n.ca=function(){},n.ia=function(){},(n=Gu.prototype).get=function(t){var e=this;return Ce().then(function(){return Ui(e.a.getItem(t))})},n.set=function(t,e){var n=this;return Ce().then(function(){var i=Mi(e);null===i?n.U(t):n.a.setItem(t,i)})},n.U=function(t){var e=this;return Ce().then(function(){e.a.removeItem(t)})},n.ca=function(){},n.ia=function(){};var Xu,Ju,Yu={F:qu,cb:Gu},zu={F:qu,cb:Gu},$u={F:yu,cb:Hu},Zu={F:qu,cb:Hu},Qu={rd:"local",NONE:"none",td:"session"};function tc(){var t=!(Fi(Oi())||!wi()),e=xi(),n=Ri();this.m=t,this.h=e,this.l=n,this.a={},Xu||(Xu=new Wu),t=Xu;try{this.g=!hi()&&Bi()||!u.indexedDB?new t.a.F:new Vu(Ii()?new Fu:new t.a.F)}catch(i){this.g=new Fu,this.h=!0}try{this.i=new t.a.cb}catch(i){this.i=new Fu}this.v=new Fu,this.f=T(this.Zb,this),this.b={}}function ec(){return Ju||(Ju=new tc),Ju}function nc(t,e){switch(e){case"session":return t.i;case"none":return t.v;default:return t.g}}function ic(t,e){return"firebase:"+t.name+(e?":"+e:"")}function rc(t,e,n){return n=ic(e,n),"local"==e.F&&(t.b[n]=null),nc(t,e.F).U(n)}function oc(t){t.c&&(clearInterval(t.c),t.c=null)}function ac(t){this.a=t,this.b=ec()}(n=tc.prototype).get=function(t,e){return nc(this,t.F).get(ic(t,e))},n.set=function(t,e,n){var i=ic(t,n),r=this,o=nc(this,t.F);return o.set(i,e).then(function(){return o.get(i)}).then(function(e){"local"==t.F&&(r.b[i]=e)})},n.addListener=function(t,e,n){t=ic(t,e),this.l&&(this.b[t]=u.localStorage.getItem(t)),vt(this.a)&&(nc(this,"local").ca(this.f),this.h||(hi()||!Bi())&&u.indexedDB||!this.l||function(t){oc(t),t.c=setInterval(function(){for(var e in t.a){var n=u.localStorage.getItem(e),i=t.b[e];n!=i&&(t.b[e]=n,n=new Qe({type:"storage",key:e,target:window,oldValue:i,newValue:n,a:!0}),t.Zb(n))}},1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},n.removeListener=function(t,e,n){t=ic(t,e),this.a[t]&&($(this.a[t],function(t){return t==n}),0==this.a[t].length&&delete this.a[t]),vt(this.a)&&(nc(this,"local").ia(this.f),oc(this))},n.Zb=function(t){if(t&&t.g){var e=t.a.key;if(null==e)for(var n in this.a){var i=this.b[n];void 0===i&&(i=null);var r=u.localStorage.getItem(n);r!==i&&(this.b[n]=r,this.nb(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if(void 0!==t.a.a?nc(this,"local").ia(this.f):oc(this),this.m)if(n=u.localStorage.getItem(e),(i=t.a.newValue)!==n)null!==i?u.localStorage.setItem(e,i):u.localStorage.removeItem(e);else if(this.b[e]===i&&void 0===t.a.a)return;var o=this;n=function(){void 0===t.a.a&&o.b[e]===u.localStorage.getItem(e)||(o.b[e]=u.localStorage.getItem(e),o.nb(e))},zt&&ce&&10==ce&&u.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}else B(t,T(this.nb,this))},n.nb=function(t){this.a[t]&&B(this.a[t],function(t){t()})};var sc,uc={name:"authEvent",F:"local"};function cc(){this.a=ec()}function hc(t,e){this.b=lc,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===sc&&(sc=u.Int32Array?new Int32Array(bc):bc),this.reset()}k(hc,function(){this.b=-1});for(var lc=64,fc=lc-1,dc=[],pc=0;pc<fc;pc++)dc[pc]=0;var vc=Z(128,dc);function mc(t){for(var e=t.f,n=t.l,i=0,r=0;r<e.length;)n[i++]=e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3],r=4*i;for(e=16;64>e;e++){r=0|n[e-15],i=0|n[e-2];var o=(0|n[e-16])+((r>>>7|r<<25)^(r>>>18|r<<14)^r>>>3)|0,a=(0|n[e-7])+((i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10)|0;n[e]=o+a|0}i=0|t.a[0],r=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&s^r&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&h^~c&l)+(0|sc[e])|0)+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=r,r=i,i=a+f|0}t.a[0]=t.a[0]+i|0,t.a[1]=t.a[1]+r|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]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function gc(t,e,n){void 0===n&&(n=e.length);var i=0,r=t.c;if("string"==typeof e)for(;i<n;)t.f[r++]=e.charCodeAt(i++),r==t.b&&(mc(t),r=0);else{if(!p(e))throw Error("message must be string or array");for(;i<n;){var o=e[i++];if(!("number"==typeof o&&0<=o&&255>=o&&o==(0|o)))throw Error("message must be a byte array");t.f[r++]=o,r==t.b&&(mc(t),r=0)}}t.c=r,t.g+=n}hc.prototype.reset=function(){this.g=this.c=0,this.a=u.Int32Array?new Int32Array(this.h):Q(this.h)};var bc=[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 yc(){hc.call(this,8,wc)}k(yc,hc);var wc=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function Ic(t,e,n,i,r,o){this.v=t,this.i=e,this.l=n,this.m=i||null,this.u=r||null,this.s=o,this.h=e+":"+n,this.C=new cc,this.g=new ac(this.h),this.f=null,this.b=[],this.a=this.c=null}function Tc(t){return new N("invalid-cordova-configuration",t)}function Ec(t){var e=new yc;gc(e,t),t=[];var n=8*e.g;56>e.c?gc(e,vc,56-e.c):gc(e,vc,e.b-(e.c-56));for(var i=63;56<=i;i--)e.f[i]=255&n,n/=256;for(mc(e),i=n=0;i<e.i;i++)for(var r=24;0<=r;r-=8)t[n++]=e.a[i]>>r&255;return function(t){return X(t,function(t){return 1<(t=t.toString(16)).length?t:"0"+t}).join("")}(t)}function Ac(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(i){}}function kc(t){return t.f||(t.f=t.ma().then(function(){return new Ee(function(e){t.Ea(function n(i){return e(i),t.Ta(n),!1}),function(t){function e(e){i=!0,r&&r.cancel(),Sc(t).then(function(i){var r=n;if(i&&e&&e.url){var o=null;-1!=(r=oo(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"==typeof(o=Ui(Fn(o=qn(r),"firebaseError")||null))?_(o):null)?new qo(i.c,i.b,null,null,o,null,i.T()):new qo(i.c,i.b,r,i.f,null,null,i.T())),r=o||n}Ac(t,r)})}var n=new qo("unknown",null,null,null,new N("no-auth-event")),i=!1,r=_n(500).then(function(){return Sc(t).then(function(){i||Ac(t,n)})}),o=u.handleOpenURL;u.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(Ci("BuildInfo.packageName",u).toLowerCase()+"://")&&e({url:t}),"function"==typeof o)try{o(t)}catch(n){console.error(n)}},Bo||(Bo=new Ho),function(t){var e=Bo;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=Ci("universalLinks.subscribe",u))&&t(null,e.b))}(e)}(t)})})),t.f}function Sc(t){var e=null;return function(t){return t.b.get(uc,t.a).then(function(t){return Ko(t)})}(t.g).then(function(n){return e=n,rc((n=t.g).b,uc,n.a)}).then(function(){return e})}function Nc(t){this.a=t,this.b=ec()}(n=Ic.prototype).ma=function(){return this.Ia?this.Ia:this.Ia=(yi(void 0)?bi().then(function(){return new Ee(function(t,e){var n=u.document,i=setTimeout(function(){e(Error("Cordova framework is not ready."))},1e3);n.addEventListener("deviceready",function(){clearTimeout(i),t()},!1)})}):Re(Error("Cordova must run in an Android or iOS file scheme."))).then(function(){if("function"!=typeof Ci("universalLinks.subscribe",u))throw Tc("cordova-universal-links-plugin-fix is not installed");if(void 0===Ci("BuildInfo.packageName",u))throw Tc("cordova-plugin-buildinfo is not installed");if("function"!=typeof Ci("cordova.plugins.browsertab.openUrl",u))throw Tc("cordova-plugin-browsertab is not installed");if("function"!=typeof Ci("cordova.InAppBrowser.open",u))throw Tc("cordova-plugin-inappbrowser is not installed")},function(){throw new N("cordova-not-ready")})},n.Pb=function(t,e){return e(new N("operation-not-supported-in-this-environment")),Ce()},n.Nb=function(){return Re(new N("operation-not-supported-in-this-environment"))},n.ac=function(){return!1},n.Yb=function(){return!0},n.Ub=function(){return!0},n.Ob=function(t,e,n,i){if(this.c)return Re(new N("redirect-operation-pending"));var r=this,o=u.document,a=null,s=null,c=null,h=null;return this.c=Ce().then(function(){return Fo(e),kc(r)}).then(function(){return function(t,e,n,i,r){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 qo(e,i,null,o,new N("no-auth-event"),null,r),s=Ci("BuildInfo.packageName",u);if("string"!=typeof s)throw new N("invalid-cordova-configuration");var c=Ci("BuildInfo.displayName",u),h={};if(Oi().toLowerCase().match(/iphone|ipad|ipod/))h.ibi=s;else{if(!Oi().toLowerCase().match(/android/))return Re(new N("operation-not-supported-in-this-environment"));h.apn=s}c&&(h.appDisplayName=c),o=Ec(o),h.sessionId=o;var l=bu(t.v,t.i,t.l,e,n,null,i,t.m,h,t.u,r,t.s);return t.ma().then(function(){var e=t.h;return t.C.a.set(uc,a.w(),e)}).then(function(){var e=Ci("cordova.plugins.browsertab.isAvailable",u);if("function"!=typeof e)throw new N("invalid-cordova-configuration");var n=null;e(function(e){if(e){if("function"!=typeof(n=Ci("cordova.plugins.browsertab.openUrl",u)))throw new N("invalid-cordova-configuration");n(l)}else{if("function"!=typeof(n=Ci("cordova.InAppBrowser.open",u)))throw new N("invalid-cordova-configuration");e=Oi(),t.a=n(l,e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}})})}(r,t,e,n,i)}).then(function(){return new Ee(function(t,e){s=function(){var e=Ci("cordova.plugins.browsertab.close",u);return t(),"function"==typeof e&&e(),r.a&&"function"==typeof r.a.close&&(r.a.close(),r.a=null),!1},r.Ea(s),c=function(){a||(a=_n(2e3).then(function(){e(new N("redirect-cancelled-by-user"))}))},h=function(){Hi()&&c()},o.addEventListener("resume",c,!1),Oi().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",h,!1)}).o(function(t){return Sc(r).then(function(){throw t})})}).oa(function(){c&&o.removeEventListener("resume",c,!1),h&&o.removeEventListener("visibilitychange",h,!1),a&&a.cancel(),s&&r.Ta(s),r.c=null})},n.Ea=function(t){this.b.push(t),kc(this).o(function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new qo("unknown",null,null,null,new N("no-auth-event")),t(e))})},n.Ta=function(t){$(this.b,function(e){return e==t})};var _c={name:"pendingRedirect",F:"session"};function Oc(t){return rc(t.b,_c,t.a)}function Cc(t,e,n,i){this.i={},this.u=0,this.D=t,this.v=e,this.m=n,this.J=i,this.h=[],this.f=!1,this.l=T(this.s,this),this.b=new Bc,this.C=new zc,this.g=new Nc(Hc(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=Rc(this.D,this.v,this.m,O,this.J)}function Rc(t,n,i,r,o){var a=e.default.SDK_VERSION||null;return yi()?new Ic(t,n,i,a,r,o):new pu(t,n,i,a,r,o)}function Pc(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.Yb()&&Pc(t).o(function(e){var n=new qo("unknown",null,null,null,new N("operation-not-supported-in-this-environment"));Vc(e)&&t.s(n)}),t.a.Ub()||Wc(t.b)}function Lc(t,e){Y(t.h,e)||t.h.push(e),t.f||function(t){return t.b.get(_c,t.a).then(function(t){return"pending"==t})}(t.g).then(function(e){e?Oc(t.g).then(function(){Pc(t).o(function(e){var n=new qo("unknown",null,null,null,new N("operation-not-supported-in-this-environment"));Vc(e)&&t.s(n)})}):Dc(t)}).o(function(){Dc(t)})}function xc(t,e){$(t.h,function(t){return t==e})}Cc.prototype.reset=function(){this.f=!1,this.a.Ta(this.l),this.a=Rc(this.D,this.v,this.m,null,this.J),this.i={}},Cc.prototype.s=function(t){if(!t)throw new N("invalid-auth-event");if(6e5<=Date.now()-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 i=this.h[n];if(i.Gb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,i),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.u=Date.now())),e=!0;break}}return Wc(this.b),e};var Mc=new Ki(2e3,1e4),jc=new Ki(3e4,6e4);function Uc(t,e,n,i,r,o,a){return t.a.Nb(e,n,i,function(){t.f||(t.f=!0,t.a.Ea(t.l))},function(){t.reset()},r,o,a)}function Vc(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function Fc(t,e,n,i,r){var o;return function(t){return t.b.set(_c,"pending",t.a)}(t.g).then(function(){return t.a.Ob(e,n,i,r).o(function(e){if(Vc(e))throw new N("operation-not-supported-in-this-environment");return o=e,Oc(t.g).then(function(){throw o})}).then(function(){return t.a.ac()?new Ee(function(){}):Oc(t.g).then(function(){return t.ra()}).then(function(){}).o(function(){})})})}function qc(t,e,n,i,r){return t.a.Pb(i,function(t){e.na(n,null,t,r)},Mc.get())}Cc.prototype.ra=function(){return this.b.ra()};var Kc={};function Hc(t,e,n){return t=t+":"+e,n&&(t=t+":"+n.url),t}function Gc(t,e,n,i){var r=Hc(e,n,i);return Kc[r]||(Kc[r]=new Cc(t,e,n,i)),Kc[r]}function Bc(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Wc(t){t.g||(t.g=!0,Yc(t,!1,null,null))}function Xc(t){t.g&&!t.i&&Yc(t,!1,null,null)}function Jc(t,e){if(t.b=function(){return Ce(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function Yc(t,e,n,i){e?i?function(t,e){if(t.b=function(){return Re(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,i):Jc(t,n):Jc(t,{user:null}),t.f=[],t.c=[]}function zc(){}function $c(){this.jb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.jb},set:function(t){this.jb=t},enumerable:!1})}function Zc(t,e){this.a=e,zi(this,"verificationId",t)}function Qc(t,e,n,i){return new jo(t).gb(e,n).then(function(t){return new Zc(t,i)})}function th(t){var e=Br(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new N("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");$i(this,{token:t,expirationTime:Gi(1e3*e.exp),authTime:Gi(1e3*e.auth_time),issuedAtTime:Gi(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 eh(t,e,n){var i=e&&e[ih];if(!i)throw new N("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=mt(e),this.g=n,this.c=new ao(null,i),this.b=[];var r=this;B(e[nh]||[],function(t){(t=er(t))&&r.b.push(t)}),zi(this,"auth",this.a),zi(this,"session",this.c),zi(this,"hints",this.b)}Bc.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Bc.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.c,i=t.b,r=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!r&&!o),"unknown"!=n||r||o?t.a?(Yc(this,!0,null,t.a),Ce()):e.Fa(n,i)?function(t,e,n){n=n.Fa(e.c,e.b);var i=e.g,r=e.f,o=e.i,a=e.T(),s=!!e.c.match(/Redirect$/);n(i,r,a,o).then(function(e){Yc(t,s,e,null)}).o(function(e){Yc(t,s,null,e)})}(this,t,e):Re(new N("invalid-auth-event")):(Yc(this,!1,null,null),Ce())}else Re(new N("invalid-auth-event"))},Bc.prototype.ra=function(){var t=this;return new Ee(function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new N("timeout");t.a&&t.a.cancel(),t.a=_n(jc.get()).then(function(){t.b||(t.g=!0,Yc(t,!0,null,e))})}(t))})},zc.prototype.h=function(t,e){if(t){var n=t.c,i=t.b;t.a?(e.na(t.c,null,t.a,t.b),Ce()):e.Fa(n,i)?function(t,e){var n=t.b,i=t.c;e.Fa(i,n)(t.g,t.f,t.T(),t.i).then(function(t){e.na(i,t,null,n)}).o(function(t){e.na(i,null,t,n)})}(t,e):Re(new N("invalid-auth-event"))}else Re(new N("invalid-auth-event"))},Zc.prototype.confirm=function(t){return t=Uo(this.verificationId,t),this.a(t)};var nh="mfaInfo",ih="mfaPendingCredential";function rh(t,e,n,i){N.call(this,"multi-factor-auth-required",i,e),this.b=new eh(t,e,n),zi(this,"resolver",this.b)}function oh(t,e,n){if(t&&m(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new rh(e,t.serverResponse,n,t.message)}catch(i){}return null}function ah(){}function sh(t){zi(this,"factorId",t.fa),this.a=t}function uh(t){if(sh.call(this,t),this.a.fa!=jo.PROVIDER_ID)throw new N("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function ch(t,e){for(var n in Ze.call(this,t),e)this[n]=e[n]}function hh(t,e){this.a=t,this.b=[],this.c=T(this.yc,this),ln(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&B(e.multiFactor.enrolledFactors,function(t){var e=null,i={};if(t){t.uid&&(i[rr]=t.uid),t.displayName&&(i[nr]=t.displayName),t.enrollmentTime&&(i[ir]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(i[or]=t.phoneNumber);try{e=new ar(i)}catch(r){}t=e}else t=null;t&&n.push(t)}),lh(this,n)}function lh(t,e){t.b=e,zi(t,"enrolledFactors",e)}function fh(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 dh(t){this.f=t,this.b=this.a=null,this.c=Date.now()}function ph(t,e){void 0===e&&(t.b?e=(e=t.b).a-e.g:e=0),t.c=Date.now()+1e3*e}function vh(t,e){t.b=Gr(e[Za]||""),t.a=e.refreshToken,ph(t,void 0!==(e=e.expiresIn)?Number(e):void 0)}function mh(t,e){return function(t,e){return new Ee(function(n,i){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?ss(t,t.l+"?key="+encodeURIComponent(t.c),function(t){t?t.error?i(ou(t)):t.access_token&&t.refresh_token?n(t):i(new N("internal-error")):i(new N("network-request-failed"))},"POST",Qn(e).toString(),t.g,t.m.get()):i(new N("internal-error"))})}(t.f,e).then(function(e){return t.b=Gr(e.access_token),t.a=e.refresh_token,ph(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 gh(t,e){this.a=t||null,this.b=e||null,$i(this,{lastSignInTime:Gi(e||null),creationTime:Gi(t||null)})}function bh(t,e,n,i,r,o){$i(this,{uid:t,displayName:i||null,photoURL:r||null,email:n||null,phoneNumber:o||null,providerId:e})}function yh(t,n,i){this.N=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null;var r=e.default.SDK_VERSION?_i(e.default.SDK_VERSION):null;this.a=new za(this.l,D(O),r),(this.u=t.emulatorConfig||null)&&rs(this.a,this.u),this.h=new dh(this.a),_h(this,n[Za]),vh(this.h,n),zi(this,"refreshToken",this.h.a),Rh(this,i||{}),En.call(this),this.P=!1,this.s&&Pi()&&(this.b=Gc(this.s,this.l,this.m,this.u)),this.W=[],this.i=null,this.D=function(t){return new fh(function(){return t.I(!0)},function(t){return!(!t||"auth/network-request-failed"!=t.code)},function(){var e=t.h.c-Date.now()-3e5;return 0<e?e:0})}(this),this.ba=T(this.ib,this);var o=this;this.za=null,this.Pa=function(t){o.xa(t.h)},this.qa=null,this.Ba=function(t){wh(o,t.c)},this.$=null,this.aa=[],this.Oa=function(t){Eh(o,t.f)},this.ja=null,this.S=new hh(this,i),zi(this,"multiFactor",this.S)}function wh(t,e){t.u=e,rs(t.a,e),t.b&&(e=t.b,t.b=Gc(t.s,t.l,t.m,t.u),t.P&&(xc(e,t),Lc(t.b,t)))}function Ih(t,e){t.qa&&pn(t.qa,"languageCodeChanged",t.Pa),(t.qa=e)&&ln(e,"languageCodeChanged",t.Pa)}function Th(t,e){t.$&&pn(t.$,"emulatorConfigChanged",t.Ba),(t.$=e)&&ln(e,"emulatorConfigChanged",t.Ba)}function Eh(t,n){t.aa=n,as(t.a,e.default.SDK_VERSION?_i(e.default.SDK_VERSION,t.aa):null)}function Ah(t,e){t.ja&&pn(t.ja,"frameworkChanged",t.Oa),(t.ja=e)&&ln(e,"frameworkChanged",t.Oa)}function kh(t){try{return e.default.app(t.m).auth()}catch(n){throw new N("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function Sh(t){t.J||t.D.b||(t.D.start(),pn(t,"tokenChanged",t.ba),ln(t,"tokenChanged",t.ba))}function Nh(t){pn(t,"tokenChanged",t.ba),t.D.stop()}function _h(t,e){t.Aa=e,zi(t,"_lat",e)}function Oh(t){for(var e=[],n=0;n<t.W.length;n++)e.push(t.W[n](t));return De(e).then(function(){return t})}function Ch(t){t.b&&!t.P&&(t.P=!0,Lc(t.b,t))}function Rh(t,e){$i(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 gh(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function Ph(){}function Dh(t){return Ce().then(function(){if(t.J)throw new N("app-deleted")})}function Lh(t){return X(t.providerData,function(t){return t.providerId})}function xh(t,e){e&&(Mh(t,e.providerId),t.providerData.push(e))}function Mh(t,e){$(t.providerData,function(t){return t.providerId==e})}function jh(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&zi(t,e,n)}function Uh(t,e){t!=e&&($i(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,tenantId:e.tenantId,providerData:[]}),e.metadata?zi(t,"metadata",function(t){return new gh(t.a,t.b)}(e.metadata)):zi(t,"metadata",new gh),B(e.providerData,function(e){xh(t,e)}),function(t,e){t.b=e.b,t.a=e.a,t.c=e.c}(t.h,e.h),zi(t,"refreshToken",t.h.a),lh(t.S,e.S.b))}function Vh(t){return t.I().then(function(e){var n=t.isAnonymous;return function(t,e){return iu(t.a,Ls,{idToken:e}).then(T(t.Kc,t))}(t,e).then(function(){return n||jh(t,"isAnonymous",!1),e})})}function Fh(t,e){e[Za]&&t.Aa!=e[Za]&&(vh(t.h,e),t.dispatchEvent(new ch("tokenChanged")),_h(t,e[Za]),jh(t,"refreshToken",t.h.a))}function qh(t,e){return Vh(t).then(function(){if(Y(Lh(t),e))return Oh(t).then(function(){throw new N("provider-already-linked")})})}function Kh(t,e,n){return Zi({user:t,credential:Vo(e),additionalUserInfo:e=zr(e),operationType:n})}function Hh(t,e){return Fh(t,e),t.reload().then(function(){return t})}function Gh(t,n,i,r,o){if(!Pi())return Re(new N("operation-not-supported-in-this-environment"));if(t.i&&!o)return Re(t.i);var a=Yr(i.providerId),s=Vi(t.uid+":::"),u=null;(!xi()||wi())&&t.s&&i.isOAuthProvider&&(u=bu(t.s,t.l,t.m,n,i,null,s,e.default.SDK_VERSION||null,null,null,t.tenantId,t.u));var c=vi(u,a&&a.va,a&&a.ua);return r=r().then(function(){if(Wh(t),!o)return t.I().then(function(){})}).then(function(){return Uc(t.b,c,n,i,s,!!u,t.tenantId)}).then(function(){return new Ee(function(e,i){t.na(n,null,new N("cancelled-popup-request"),t.g||null),t.f=e,t.C=i,t.g=s,t.c=qc(t.b,t,n,c,s)})}).then(function(t){return c&&pi(c),t?Zi(t):null}).o(function(t){throw c&&pi(c),t}),Xh(t,r,o)}function Bh(t,e,n,i,r){if(!Pi())return Re(new N("operation-not-supported-in-this-environment"));if(t.i&&!r)return Re(t.i);var o=null,a=Vi(t.uid+":::");return i=i().then(function(){if(Wh(t),!r)return t.I().then(function(){})}).then(function(){return t.ga=a,Oh(t)}).then(function(e){return t.ha&&(e=(e=t.ha).b.set(zh,t.w(),e.a)),e}).then(function(){return Fc(t.b,e,n,a,t.tenantId)}).o(function(e){if(o=e,t.ha)return $h(t.ha);throw o}).then(function(){if(o)throw o}),Xh(t,i,r)}function Wh(t){if(!t.b||!t.P){if(t.b&&!t.P)throw new N("internal-error");throw new N("auth-domain-config-required")}}function Xh(t,e,n){var i=function(t,e,n){return t.i&&!n?(e.cancel(),Re(t.i)):e.o(function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.i||t.dispatchEvent(new ch("userInvalidated")),t.i=e),e})}(t,e,n);return t.N.push(i),i.oa(function(){z(t.N,i)}),i.o(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=oh(e.w(),kh(t),T(t.jc,t))),n||e})}function Jh(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[Za]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var i=t.stsTokenManager.expirationTime;i&&(n.expiresIn=(i-Date.now())/1e3);var r=new yh(e,n,t);return t.providerData&&B(t.providerData,function(t){t&&xh(r,Zi(t))}),t.redirectEventId&&(r.ga=t.redirectEventId),r}function Yh(t){this.a=t,this.b=ec()}eh.prototype.Rc=function(t){var e=this;return t.tb(this.a.a,this.c).then(function(t){var n=mt(e.f);return delete n[nh],delete n[ih],bt(n,t),e.g(n)})},k(rh,N),ah.prototype.tb=function(t,e,n){return e.type==so?function(t,e,n,i){return n.Ha().then(function(n){return n={idToken:n},void 0!==i&&(n.displayName=i),bt(n,{phoneVerificationInfo:Mo(t.a)}),iu(e,Ps,n)})}(this,t,e,n):function(t,e,n){return n.Ha().then(function(n){return bt(n={mfaPendingCredential:n},{phoneVerificationInfo:Mo(t.a)}),iu(e,Ds,n)})}(this,t,e)},k(sh,ah),k(uh,sh),k(ch,Ze),(n=hh.prototype).yc=function(t){lh(this,function(t){var e=[];return B(t.mfaInfo||[],function(t){(t=er(t))&&e.push(t)}),e}(t.hd))},n.Sb=function(){return this.a.I().then(function(t){return new ao(t,null)})},n.fc=function(t,e){var n=this,i=this.a.a;return this.Sb().then(function(n){return t.tb(i,n,e)}).then(function(t){return Fh(n.a,t),n.a.reload()})},n.bd=function(t){var e=this,n="string"==typeof t?t:t.uid,i=this.a.a;return this.a.I().then(function(t){return iu(i,nu,{idToken:t,mfaEnrollmentId:n})}).then(function(t){var i=W(e.b,function(t){return t.uid!=n});return lh(e,i),Fh(e.a,t),e.a.reload().o(function(t){if("auth/user-token-expired"!=t.code)throw t})})},n.w=function(){return{multiFactor:{enrolledFactors:X(this.b,function(t){return t.w()})}}},fh.prototype.start=function(){this.a=this.c,function t(e,n){e.stop();e.b=_n(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)}(e,n)).then(function(){return t=u.document,e=null,Hi()||!t?Ce():new Ee(function(n){e=function(){Hi()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)}).o(function(n){throw t.removeEventListener("visibilitychange",e,!1),n});var t,e}).then(function(){return e.h()}).then(function(){t(e,!0)}).o(function(n){e.i(n)&&t(e,!1)})}(this,!0)},fh.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},dh.prototype.w=function(){return{apiKey:this.f.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:this.c}},dh.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Re(new N("user-token-expired")):t||!this.b||Date.now()>this.c-3e4?this.a?mh(this,{grant_type:"refresh_token",refresh_token:this.a}):Ce(null):Ce({accessToken:this.b.toString(),refreshToken:this.a})},gh.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},k(yh,En),yh.prototype.xa=function(t){this.za=t,is(this.a,t)},yh.prototype.la=function(){return this.za},yh.prototype.Ga=function(){return Q(this.aa)},yh.prototype.ib=function(){this.D.b&&(this.D.stop(),this.D.start())},zi(yh.prototype,"providerId","firebase"),(n=yh.prototype).reload=function(){var t=this;return Xh(this,Dh(this).then(function(){return Vh(t).then(function(){return Oh(t)}).then(Ph)}))},n.oc=function(t){return this.I(t).then(function(t){return new th(t)})},n.I=function(t){var e=this;return Xh(this,Dh(this).then(function(){return e.h.getToken(t)}).then(function(t){if(!t)throw new N("internal-error");return t.accessToken!=e.Aa&&(_h(e,t.accessToken),e.dispatchEvent(new ch("tokenChanged"))),jh(e,"refreshToken",t.refreshToken),t.accessToken}))},n.Kc=function(t){if(!(t=t.users)||!t.length)throw new N("internal-error");Rh(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?X(t,function(t){return new bh(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)}):[]}(t),n=0;n<e.length;n++)xh(this,e[n]);jh(this,"isAnonymous",!(this.email&&t.passwordHash||this.providerData&&this.providerData.length)),this.dispatchEvent(new ch("userReloaded",{hd:t}))},n.Lc=function(t){return Ji("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.ub(t)},n.ub=function(t){var e=this,n=null;return Xh(this,t.c(this.a,this.uid).then(function(t){return Fh(e,t),n=Kh(e,t,"reauthenticate"),e.i=null,e.reload()}).then(function(){return n}),!0)},n.Cc=function(t){return Ji("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.rb(t)},n.rb=function(t){var e=this,n=null;return Xh(this,qh(this,t.providerId).then(function(){return e.I()}).then(function(n){return t.b(e.a,n)}).then(function(t){return n=Kh(e,t,"link"),Hh(e,t)}).then(function(){return n}))},n.Dc=function(t,e){var n=this;return Xh(this,qh(this,"phone").then(function(){return Qc(kh(n),t,e,T(n.rb,n))}))},n.Mc=function(t,e){var n=this;return Xh(this,Ce().then(function(){return Qc(kh(n),t,e,T(n.ub,n))}),!0)},n.Cb=function(t){var e=this;return Xh(this,this.I().then(function(n){return e.a.Cb(n,t)}).then(function(t){return Fh(e,t),e.reload()}))},n.ed=function(t){var e=this;return Xh(this,this.I().then(function(n){return t.b(e.a,n)}).then(function(t){return Fh(e,t),e.reload()}))},n.Db=function(t){var e=this;return Xh(this,this.I().then(function(n){return e.a.Db(n,t)}).then(function(t){return Fh(e,t),e.reload()}))},n.Eb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return Dh(this);var e=this;return Xh(this,this.I().then(function(n){return e.a.Eb(n,{displayName:t.displayName,photoUrl:t.photoURL})}).then(function(t){return Fh(e,t),jh(e,"displayName",t.displayName||null),jh(e,"photoURL",t.photoUrl||null),B(e.providerData,function(t){"password"===t.providerId&&(zi(t,"displayName",e.displayName),zi(t,"photoURL",e.photoURL))}),Oh(e)}).then(Ph))},n.cd=function(t){var e=this;return Xh(this,Vh(this).then(function(n){return Y(Lh(e),t)?function(t,e,n){return iu(t,Os,{idToken:e,deleteProvider:n})}(e.a,n,[t]).then(function(t){var n={};return B(t.providerUserInfo||[],function(t){n[t.providerId]=!0}),B(Lh(e),function(t){n[t]||Mh(e,t)}),n[jo.PROVIDER_ID]||zi(e,"phoneNumber",null),Oh(e)}):Oh(e).then(function(){throw new N("no-such-provider")})}))},n.delete=function(){var t=this;return Xh(this,this.I().then(function(e){return iu(t.a,_s,{idToken:e})}).then(function(){t.dispatchEvent(new ch("userDeleted"))})).then(function(){for(var e=0;e<t.N.length;e++)t.N[e].cancel("app-deleted");Ih(t,null),Th(t,null),Ah(t,null),t.N=[],t.J=!0,Nh(t),zi(t,"refreshToken",null),t.b&&xc(t.b,t)})},n.Gb=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,i){"linkViaPopup"!=t&&"reauthViaPopup"!=t||i!=(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)?T(this.Lb,this):"reauthViaPopup"==t&&e==(this.g||null)?T(this.Mb,this):"linkViaRedirect"==t&&(this.ga||null)==e?T(this.Lb,this):"reauthViaRedirect"==t&&(this.ga||null)==e?T(this.Mb,this):null},n.Ec=function(t){var e=this;return Gh(this,"linkViaPopup",t,function(){return qh(e,t.providerId).then(function(){return Oh(e)})},!1)},n.Nc=function(t){return Gh(this,"reauthViaPopup",t,function(){return Ce()},!0)},n.Fc=function(t){var e=this;return Bh(this,"linkViaRedirect",t,function(){return qh(e,t.providerId)},!1)},n.Oc=function(t){return Bh(this,"reauthViaRedirect",t,function(){return Ce()},!0)},n.Lb=function(t,e,n,i){var r=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Xh(this,this.I().then(function(n){return Is(r.a,{requestUri:t,postBody:i,sessionId:e,idToken:n})}).then(function(t){return o=Kh(r,t,"link"),Hh(r,t)}).then(function(){return o}))},n.Mb=function(t,e,n,i){var r=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Xh(this,Ce().then(function(){return ho(Ts(r.a,{requestUri:t,sessionId:e,postBody:i,tenantId:n}),r.uid)}).then(function(t){return o=Kh(r,t,"reauthenticate"),Fh(r,t),r.i=null,r.reload()}).then(function(){return o}),!0)},n.vb=function(t){var e=this,n=null;return Xh(this,this.I().then(function(e){return n=e,void 0===t||vt(t)?{}:Fr(new Cr(t))}).then(function(t){return e.a.vb(n,t)}).then(function(t){if(e.email!=t)return e.reload()}).then(function(){}))},n.Fb=function(t,e){var n=this,i=null;return Xh(this,this.I().then(function(t){return i=t,void 0===e||vt(e)?{}:Fr(new Cr(e))}).then(function(e){return n.a.Fb(i,t,e)}).then(function(t){if(n.email!=t)return n.reload()}).then(function(){}))},n.jc=function(t){var e=null,n=this;return Xh(this,t=ho(Ce(t),n.uid).then(function(t){return e=Kh(n,t,"reauthenticate"),Fh(n,t),n.i=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.h.w(),redirectEventId:this.ga||null};return this.metadata&&bt(t,this.metadata.w()),B(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))}),bt(t,this.S.w()),t};var zh={name:"redirectUser",F:"session"};function $h(t){return rc(t.b,zh,t.a)}function Zh(t){this.a=t,this.b=ec(),this.c=null,this.f=function(t){var e=el("local"),n=el("session"),i=el("none");return function(t,e,n){var i=ic(e,n),r=nc(t,e.F);return t.get(e,n).then(function(o){var a=null;try{a=Ui(u.localStorage.getItem(i))}catch(s){}if(a&&!o)return u.localStorage.removeItem(i),t.set(e,a,n);a&&o&&"localStorage"!=r.type&&u.localStorage.removeItem(i)})}(t.b,e,t.a).then(function(){return t.b.get(n,t.a)}).then(function(r){return r?n:t.b.get(i,t.a).then(function(n){return n?i:t.b.get(e,t.a).then(function(n){return n?e:t.b.get(tl,t.a).then(function(t){return t?el(t):e})})})}).then(function(e){return t.c=e,Qh(t,e.F)}).o(function(){t.c||(t.c=e)})}(this),this.b.addListener(el("local"),this.a,T(this.g,this))}function Qh(t,e){var n,i=[];for(n in Qu)Qu[n]!==e&&i.push(rc(t.b,el(Qu[n]),t.a));return i.push(rc(t.b,tl,t.a)),function(t){return new Ee(function(e,n){var i=t.length,r=[];if(i)for(var o=function(t,n){i--,r[t]=n,0==i&&e(r)},a=function(t){n(t)},s=0;s<t.length;s++)Pe(t[s],E(o,s),a);else e(r)})}(i)}Zh.prototype.g=function(){var t=this,e=el("local");ol(this,function(){return Ce().then(function(){return t.c&&"local"!=t.c.F?t.b.get(e,t.a):null}).then(function(n){if(n)return Qh(t,"local").then(function(){t.c=e})})})};var tl={name:"persistence",F:"session"};function el(t){return{name:"authUser",F:t}}function nl(t,e){return ol(t,function(){return t.b.set(t.c,e.w(),t.a)})}function il(t){return ol(t,function(){return rc(t.b,t.c,t.a)})}function rl(t,e,n){return ol(t,function(){return t.b.get(t.c,t.a).then(function(t){return t&&e&&(t.authDomain=e),t&&n&&(t.emulatorConfig=n),Jh(t||{})})})}function ol(t,e){return t.f=t.f.then(e,e),t.f}function al(t){if(this.l=!1,zi(this,"settings",new $c),zi(this,"app",t),!vl(this).options||!vl(this).options.apiKey)throw new N("invalid-api-key");t=e.default.SDK_VERSION?_i(e.default.SDK_VERSION):null,this.a=new za(vl(this).options&&vl(this).options.apiKey,D(O),t),this.P=[],this.s=[],this.N=[],this.Pa=e.default.INTERNAL.createSubscribe(T(this.zc,this)),this.W=void 0,this.ib=e.default.INTERNAL.createSubscribe(T(this.Ac,this)),dl(this,null),this.i=new Zh(vl(this).options.apiKey+":"+vl(this).name),this.D=new Yh(vl(this).options.apiKey+":"+vl(this).name),this.$=yl(this,function(t){var e=vl(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(zh,t.a).then(function(t){return t&&e&&(t.authDomain=e),Jh(t||{})})}(t.D,vl(t).options.authDomain).then(function(e){return(t.m=e)&&(e.ha=t.D),$h(t.D)});return yl(t,e)}(t).then(function(){return rl(t.i,e,t.R)}).then(function(e){return e?(e.ha=t.D,t.m&&(t.m.ga||null)==(e.ga||null)?e:e.reload().then(function(){return nl(t.i,e).then(function(){return e})}).o(function(n){return"auth/network-request-failed"==n.code?e:il(t.i)})):null}).then(function(e){dl(t,e||null)});return yl(t,n)}(this)),this.h=yl(this,function(t){return t.$.then(function(){return ll(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(el("local"),e.a,t.ja)}})}(this)),this.ba=!1,this.ja=T(this.Zc,this),this.Ba=T(this.da,this),this.qa=T(this.mc,this),this.za=T(this.wc,this),this.Aa=T(this.xc,this),this.b=null,function(t){var e=vl(t).options.authDomain,n=vl(t).options.apiKey;e&&Pi()&&(t.Oa=t.$.then(function(){if(!t.l){if(t.b=Gc(e,n,vl(t).name,t.R),Lc(t.b,t),ml(t)&&Ch(ml(t)),t.m){Ch(t.m);var i=t.m;i.xa(t.la()),Ih(i,t),Eh(i=t.m,t.J),Ah(i,t),wh(i=t.m,t.R),Th(i,t),t.m=null}return t.b}}))}(this),this.INTERNAL={},this.INTERNAL.delete=T(this.delete,this),this.INTERNAL.logFramework=T(this.Gc,this),this.u=0,En.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.la()},set:function(t){this.xa(t)},enumerable:!1}),t.aa=null,Object.defineProperty(t,"ti",{get:function(){return this.T()},set:function(t){this.zb(t)},enumerable:!1}),t.S=null,Object.defineProperty(t,"emulatorConfig",{get:function(){if(this.R){var t=qn(this.R.url);t=Zi({protocol:t.c,host:t.a,port:t.g,options:Zi({disableWarnings:this.R.ec})})}else t=null;return t},enumerable:!1})}(this),this.J=[],this.R=null}function sl(t){Ze.call(this,"languageCodeChanged"),this.h=t}function ul(t){Ze.call(this,"emulatorConfigChanged"),this.c=t}function cl(t){Ze.call(this,"frameworkChanged"),this.f=t}function hl(t){return t.Oa||Re(new N("auth-domain-config-required"))}function ll(t){if(!Pi())return Re(new N("operation-not-supported-in-this-environment"));var e=hl(t).then(function(){return t.b.ra()}).then(function(t){return t?Zi(t):null});return yl(t,e)}function fl(t,e){var n={};return n.apiKey=vl(t).options.apiKey,n.authDomain=vl(t).options.authDomain,n.appName=vl(t).name,t.R&&(n.emulatorConfig=t.R),t.$.then(function(){return function(t,e,n,i){var r=new yh(t,e);return n&&(r.ha=n),i&&Eh(r,i),r.reload().then(function(){return r})}(n,e,t.D,t.Ga())}).then(function(e){return ml(t)&&e.uid==ml(t).uid?(Uh(ml(t),e),t.da(e)):(dl(t,e),Ch(e),t.da(e))}).then(function(){bl(t)})}function dl(t,e){ml(t)&&(function(t,e){$(t.W,function(t){return t==e})}(ml(t),t.Ba),pn(ml(t),"tokenChanged",t.qa),pn(ml(t),"userDeleted",t.za),pn(ml(t),"userInvalidated",t.Aa),Nh(ml(t))),e&&(e.W.push(t.Ba),ln(e,"tokenChanged",t.qa),ln(e,"userDeleted",t.za),ln(e,"userInvalidated",t.Aa),0<t.u&&Sh(e)),zi(t,"currentUser",e),e&&(e.xa(t.la()),Ih(e,t),Eh(e,t.J),Ah(e,t),wh(e,t.R),Th(e,t))}function pl(t,e){var n=null,i=null;return yl(t,e.then(function(e){return n=Vo(e),i=zr(e),fl(t,e)},function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=oh(e.w(),t,T(t.kc,t))),n||e}).then(function(){return Zi({user:ml(t),credential:n,additionalUserInfo:i,operationType:"signIn"})}))}function vl(t){return t.app}function ml(t){return t.currentUser}function gl(t){return ml(t)&&ml(t)._lat||null}function bl(t){if(t.ba){for(var e=0;e<t.s.length;e++)t.s[e]&&t.s[e](gl(t));if(t.W!==t.getUid()&&t.N.length)for(t.W=t.getUid(),e=0;e<t.N.length;e++)t.N[e]&&t.N[e](gl(t))}}function yl(t,e){return t.P.push(e),e.oa(function(){z(t.P,e)}),e}function wl(){}function Il(){this.a={},this.b=1e12}Zh.prototype.yb=function(t){var e=null,n=this;return function(t){var e=new N("invalid-persistence-type"),n=new N("unsupported-persistence-type");t:{for(i in Qu)if(Qu[i]==t){var i=!0;break t}i=!1}if(!i||"string"!=typeof t)throw e;switch(Ti()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Pu()&&"none"!==t)throw n;break;default:if(!Ri()&&"none"!==t)throw n}}(t),ol(this,function(){return t!=n.c.F?n.b.get(n.c,n.a).then(function(i){return e=i,Qh(n,t)}).then(function(){if(n.c=el(t),e)return n.b.set(n.c,e,n.a)}):Ce()})},k(al,En),k(sl,Ze),k(ul,Ze),k(cl,Ze),(n=al.prototype).yb=function(t){return yl(this,t=this.i.yb(t))},n.xa=function(t){this.aa===t||this.l||(this.aa=t,is(this.a,this.aa),this.dispatchEvent(new sl(this.la())))},n.la=function(){return this.aa},n.fd=function(){var t=u.navigator;this.xa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},n.gd=function(t,e){if(!this.R){if(!/^https?:\/\//.test(t))throw new N("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&&bi().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="#b50000",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.R={url:t,ec:e},this.settings.jb=!0,rs(this.a,this.R),this.dispatchEvent(new ul(this.R))}},n.Gc=function(t){this.J.push(t),as(this.a,e.default.SDK_VERSION?_i(e.default.SDK_VERSION,this.J):null),this.dispatchEvent(new cl(this.J))},n.Ga=function(){return Q(this.J)},n.zb=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:vl(this).options.apiKey,authDomain:vl(this).options.authDomain,appName:vl(this).name,currentUser:ml(this)&&ml(this).w()}},n.Gb=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,i){"signInViaPopup"==t&&this.g==i&&(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?T(this.ic,this):null},n.ic=function(t,e,n,i){var r=this,o={requestUri:t,postBody:i,sessionId:e,tenantId:n};return this.c&&(this.c.cancel(),this.c=null),r.$.then(function(){return pl(r,ws(r.a,o))})},n.Xc=function(t){if(!Pi())return Re(new N("operation-not-supported-in-this-environment"));var n=this,i=Yr(t.providerId),r=Vi(),o=null;(!xi()||wi())&&vl(this).options.authDomain&&t.isOAuthProvider&&(o=bu(vl(this).options.authDomain,vl(this).options.apiKey,vl(this).name,"signInViaPopup",t,null,r,e.default.SDK_VERSION||null,null,null,this.T(),this.R));var a=vi(o,i&&i.va,i&&i.ua);return yl(this,i=hl(this).then(function(e){return Uc(e,a,"signInViaPopup",t,r,!!o,n.T())}).then(function(){return new Ee(function(t,e){n.na("signInViaPopup",null,new N("cancelled-popup-request"),n.g),n.f=t,n.C=e,n.g=r,n.c=qc(n.b,n,"signInViaPopup",a,r)})}).then(function(t){return a&&pi(a),t?Zi(t):null}).o(function(t){throw a&&pi(a),t}))},n.Yc=function(t){if(!Pi())return Re(new N("operation-not-supported-in-this-environment"));var e=this;return yl(this,hl(this).then(function(){return ol(t=e.i,function(){return t.b.set(tl,t.c.F,t.a)});var t}).then(function(){return Fc(e.b,"signInViaRedirect",t,void 0,e.T())}))},n.ra=function(){var t=this;return ll(this).then(function(e){return t.b&&Xc(t.b.b),e}).o(function(e){throw t.b&&Xc(t.b.b),e})},n.dd=function(t){if(!t)return Re(new N("null-user"));if(this.S!=t.tenantId)return Re(new N("tenant-id-mismatch"));var e=this,n={};n.apiKey=vl(this).options.apiKey,n.authDomain=vl(this).options.authDomain,n.appName=vl(this).name;var i=function(t,e,n,i){var r=t.h,o={};return o[Za]=r.b&&r.b.toString(),o.refreshToken=r.a,e=new yh(e||{apiKey:t.l,authDomain:t.s,appName:t.m},o),n&&(e.ha=n),i&&Eh(e,i),Uh(e,t),e}(t,n,e.D,e.Ga());return yl(this,this.h.then(function(){if(vl(e).options.apiKey!=t.l)return i.reload()}).then(function(){return ml(e)&&t.uid==ml(e).uid?(Uh(ml(e),t),e.da(t)):(dl(e,i),Ch(i),e.da(i))}).then(function(){bl(e)}))},n.Bb=function(){var t=this;return yl(this,this.h.then(function(){return t.b&&Xc(t.b.b),ml(t)?(dl(t,null),il(t.i).then(function(){bl(t)})):Ce()}))},n.Zc=function(){var t=this;return rl(this.i,vl(this).options.authDomain).then(function(e){if(!t.l){var n;if(n=ml(t)&&e){n=ml(t).uid;var i=e.uid;n=null!=n&&""!==n&&null!=i&&""!==i&&n==i}if(n)return Uh(ml(t),e),ml(t).I();(ml(t)||e)&&(dl(t,e),e&&(Ch(e),e.ha=t.D),t.b&&Lc(t.b,t),bl(t))}})},n.da=function(t){return nl(this.i,t)},n.mc=function(){bl(this),this.da(ml(this))},n.wc=function(){this.Bb()},n.xc=function(){this.Bb()},n.kc=function(t){var e=this;return this.h.then(function(){return pl(e,Ce(t))})},n.zc=function(t){var e=this;this.addAuthTokenListener(function(){t.next(ml(e))})},n.Ac=function(t){var e=this;!function(t,e){t.N.push(e),yl(t,t.h.then(function(){!t.l&&Y(t.N,e)&&t.W!==t.getUid()&&(t.W=t.getUid(),e(gl(t)))}))}(this,function(){t.next(ml(e))})},n.Ic=function(t,e,n){var i=this;return this.ba&&Promise.resolve().then(function(){"function"==typeof t?t(ml(i)):"function"==typeof t.next&&t.next(ml(i))}),this.Pa(t,e,n)},n.Hc=function(t,e,n){var i=this;return this.ba&&Promise.resolve().then(function(){i.W=i.getUid(),"function"==typeof t?t(ml(i)):"function"==typeof t.next&&t.next(ml(i))}),this.ib(t,e,n)},n.nc=function(t){var e=this;return yl(this,this.h.then(function(){return ml(e)?ml(e).I(t).then(function(t){return{accessToken:t}}):null}))},n.Tc=function(t){var e=this;return this.h.then(function(){return pl(e,iu(e.a,$s,{token:t}))}).then(function(t){var n=t.user;return jh(n,"isAnonymous",!1),e.da(n),t})},n.Uc=function(t,e){var n=this;return this.h.then(function(){return pl(n,iu(n.a,Zs,{email:t,password:e}))})},n.dc=function(t,e){var n=this;return this.h.then(function(){return pl(n,iu(n.a,Ss,{email:t,password:e}))})},n.ab=function(t){var e=this;return this.h.then(function(){return pl(e,t.ka(e.a))})},n.Sc=function(t){return Ji("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.ab(t)},n.Ab=function(){var t=this;return this.h.then(function(){var e=ml(t);if(e&&e.isAnonymous){var n=Zi({providerId:null,isNewUser:!1});return Zi({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return pl(t,t.a.Ab()).then(function(e){var n=e.user;return jh(n,"isAnonymous",!0),t.da(n),e})})},n.getUid=function(){return ml(this)&&ml(this).uid||null},n.cc=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&ml(this)&&Sh(ml(this))},n.Pc=function(t){var e=this;B(this.s,function(n){n==t&&e.u--}),0>this.u&&(this.u=0),0==this.u&&ml(this)&&Nh(ml(this)),this.removeAuthTokenListener(t)},n.addAuthTokenListener=function(t){var e=this;this.s.push(t),yl(this,this.h.then(function(){e.l||Y(e.s,t)&&t(gl(e))}))},n.removeAuthTokenListener=function(t){$(this.s,function(e){return e==t})},n.delete=function(){this.l=!0;for(var t=0;t<this.P.length;t++)this.P[t].cancel("app-deleted");return this.P=[],this.i&&(t=this.i).b.removeListener(el("local"),t.a,this.ja),this.b&&(xc(this.b,this),Xc(this.b.b)),Promise.resolve()},n.hc=function(t){return yl(this,function(t,e){return iu(t,Ns,{identifier:e,continueUri:Di()?li():"http://localhost"}).then(function(t){return t.signinMethods||[]})}(this.a,t))},n.Bc=function(t){return!!Do(t)},n.xb=function(t,e){var n=this;return yl(this,Ce().then(function(){var t=new Cr(e);if(!t.c)throw new N("argument-error",Dr+" must be true when sending sign in link to email");return Fr(t)}).then(function(e){return n.a.xb(t,e)}).then(function(){}))},n.jd=function(t){return this.Sa(t).then(function(t){return t.data.email})},n.ob=function(t,e){return yl(this,this.a.ob(t,e).then(function(){}))},n.Sa=function(t){return yl(this,this.a.Sa(t).then(function(t){return new sr(t)}))},n.kb=function(t){return yl(this,this.a.kb(t).then(function(){}))},n.wb=function(t,e){var n=this;return yl(this,Ce().then(function(){return void 0===e||vt(e)?{}:Fr(new Cr(e))}).then(function(e){return n.a.wb(t,e)}).then(function(){}))},n.Wc=function(t,e){return yl(this,Qc(this,t,e,T(this.ab,this)))},n.Vc=function(t,e){var n=this;return yl(this,Ce().then(function(){var i=e||li(),r=Po(t,i);if(!(i=Do(i)))throw new N("argument-error","Invalid email link!");if(i.tenantId!==n.T())throw new N("tenant-id-mismatch");return n.ab(r)}))},wl.prototype.render=function(){},wl.prototype.reset=function(){},wl.prototype.getResponse=function(){},wl.prototype.execute=function(){};var Tl=null;function El(t,e){return(e=Al(e))&&t.a[e]||null}function Al(t){return(t=void 0===t?1e12:t)?t.toString():null}function kl(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():ln(this.f,"click",this.i)}function Sl(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function Nl(){}function _l(){}Il.prototype.render=function(t,e){return this.a[this.b.toString()]=new kl(t,e),this.b++},Il.prototype.reset=function(t){var e=El(this,t);t=Al(t),e&&t&&(e.delete(),delete this.a[t])},Il.prototype.getResponse=function(t){return(t=El(this,t))?t.getResponse():null},Il.prototype.execute=function(t){(t=El(this,t))&&t.execute()},kl.prototype.getResponse=function(){return Sl(this),this.b},kl.prototype.execute=function(){Sl(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(i){}t.a=setTimeout(function(){if(t.a=null,t.b=null,n)try{n()}catch(i){}t.h&&t.execute()},6e4)},500))},kl.prototype.delete=function(){Sl(this),this.g=!0,clearTimeout(this.a),this.a=null,pn(this.f,"click",this.i)},zi(Nl,"FACTOR_ID","phone"),_l.prototype.g=function(){return Tl||(Tl=new Il),Ce(Tl)},_l.prototype.c=function(){};var Ol=null;function Cl(){this.b=u.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var Rl=new wt(At,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Pl=new Ki(3e4,6e4);Cl.prototype.g=function(t){var e=this;return new Ee(function(n,i){var r=setTimeout(function(){i(new N("network-request-failed"))},Pl.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(r),n(u.grecaptcha)}else clearTimeout(r),i(new N("internal-error"));delete u[e.a]},Ce(Ha(_t(Rl,{onload:e.a,hl:t||""}))).o(function(){clearTimeout(r),i(new N("internal-error","Unable to load external reCAPTCHA dependencies!"))})):(clearTimeout(r),n(u.grecaptcha))})},Cl.prototype.c=function(){this.b--};var Dl=null;function Ll(t,e,n,i,r,o,a){if(zi(this,"type","recaptcha"),this.c=this.f=null,this.J=!1,this.v=e,this.g=null,a?(Ol||(Ol=new _l),a=Ol):(Dl||(Dl=new Cl),a=Dl),this.m=a,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[jl])throw new N("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[Ul],!u.document)throw new N("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 N("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new za(t,o||null,r||null),this.u=i||function(){return null};var s=this;this.l=[];var c=this.a[xl];this.a[xl]=function(t){if(Vl(s,t),"function"==typeof c)c(t);else if("string"==typeof c){var e=Ci(c,u);"function"==typeof e&&e(t)}};var h=this.a[Ml];this.a[Ml]=function(){if(Vl(s,null),"function"==typeof h)h();else if("string"==typeof h){var t=Ci(h,u);"function"==typeof t&&t()}}}var xl="callback",Ml="expired-callback",jl="sitekey",Ul="size";function Vl(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(i){}}function Fl(t,e){return t.h.push(e),e.oa(function(){z(t.h,e)}),e}function ql(t){if(t.J)throw new N("internal-error","RecaptchaVerifier instance has been destroyed.")}function Kl(t,n,i){var r=!1;try{this.b=i||e.default.app()}catch(s){throw new N("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new N("invalid-api-key");i=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().Ga()}catch(s){}try{r=this.b.auth().settings.appVerificationDisabledForTesting}catch(s){}a=e.default.SDK_VERSION?_i(e.default.SDK_VERSION,a):null,Ll.call(this,i,t,n,function(){try{var t=o.b.auth().la()}catch(e){t=null}return t},a,D(O),r)}function Hl(t,e,n,i){t:{n=Array.prototype.slice.call(n);for(var r=0,o=!1,a=0;a<e.length;a++)if(e[a].optional)o=!0;else{if(o)throw new N("internal-error","Argument validator encountered a required argument after an optional argument.");r++}if(o=e.length,n.length<r||o<n.length)i="Expected "+(r==o?1==r?"1 argument":r+" arguments":r+"-"+o+" arguments")+" but got "+n.length+".";else{for(r=0;r<n.length;r++)if(o=e[r].optional&&void 0===n[r],!e[r].M(n[r])&&!o){if(e=e[r],0>r||r>=Gl.length)throw new N("internal-error","Argument validator received an unsupported number of arguments.");n=Gl[r],i=(i?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}i=null}}if(i)throw new N("argument-error",t+" failed: "+i)}(n=Ll.prototype).Ia=function(){var t=this;return this.f?this.f:this.f=Fl(this,Ce().then(function(){if(Di()&&!Ii())return bi();throw new N("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,iu(t.s,Fs,{})}).then(function(e){t.a[jl]=e.recaptchaSiteKey}).o(function(e){throw t.f=null,e}))},n.render=function(){ql(this);var t=this;return Fl(this,this.Ia().then(function(){if(null===t.c){var e=t.v;if(!t.i){var n=le(e);e=me("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c}))},n.verify=function(){ql(this);var t=this;return Fl(this,this.render().then(function(e){return new Ee(function(n){var i=t.g.getResponse(e);if(i)n(i);else{var r=function(e){e&&(function(t,e){$(t.l,function(t){return t==e})}(t,r),n(e))};t.l.push(r),t.i&&t.g.execute(t.c)}})}))},n.reset=function(){ql(this),null!==this.c&&this.g.reset(this.c)},n.clear=function(){ql(this),this.J=!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)}},k(Kl,Ll);var Gl="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Bl(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:function(t){return"string"==typeof t}}}function Wl(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:function(t){return"boolean"==typeof t}}}function Xl(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:m}}function Jl(t,e){return{name:t||"",K:"a function",optional:!!e,M:function(t){return"function"==typeof t}}}function Yl(t,e){return{name:t||"",K:"null",optional:!!e,M:function(t){return null===t}}}function zl(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 $l(t,e){return m(t)&&"string"==typeof t.type&&t.type===e&&"function"==typeof t.Ha}function Zl(t){return m(t)&&"string"==typeof t.uid}function Ql(t,e,n,i){return{name:n||"",K:t.K+" or "+e.K,optional:!!i,M:function(n){return t.M(n)||e.M(n)}}}function tf(t,e){for(var n in e){var i=e[n].name;t[i]=rf(i,t[n],e[n].j)}}function ef(t,e){for(var n in e){var i=e[n].name;i!==n&&Object.defineProperty(t,i,{get:E(function(t){return this[t]},n),set:E(function(t,e,n,i){Hl(t,[n],[i],!0),this[e]=i},i,n,e[n].lb),enumerable:!0})}}function nf(t,e,n,i){t[e]=rf(e,n,i)}function rf(t,e,n){function i(){var t=Array.prototype.slice.call(arguments);return Hl(o,n,t),e.apply(this,t)}if(!n)return e;var r,o=function(t){return(t=t.split("."))[t.length-1]}(t);for(r in e)i[r]=e[r];for(r in e.prototype)i.prototype[r]=e.prototype[r];return i}tf(al.prototype,{kb:{name:"applyActionCode",j:[Bl("code")]},Sa:{name:"checkActionCode",j:[Bl("code")]},ob:{name:"confirmPasswordReset",j:[Bl("code"),Bl("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[Bl("email"),Bl("password")]},hc:{name:"fetchSignInMethodsForEmail",j:[Bl("email")]},ra:{name:"getRedirectResult",j:[]},Bc:{name:"isSignInWithEmailLink",j:[Bl("emailLink")]},Hc:{name:"onAuthStateChanged",j:[Ql(Xl(),Jl(),"nextOrObserver"),Jl("opt_error",!0),Jl("opt_completed",!0)]},Ic:{name:"onIdTokenChanged",j:[Ql(Xl(),Jl(),"nextOrObserver"),Jl("opt_error",!0),Jl("opt_completed",!0)]},wb:{name:"sendPasswordResetEmail",j:[Bl("email"),Ql(Xl("opt_actionCodeSettings",!0),Yl(null,!0),"opt_actionCodeSettings",!0)]},xb:{name:"sendSignInLinkToEmail",j:[Bl("email"),Xl("actionCodeSettings")]},yb:{name:"setPersistence",j:[Bl("persistence")]},Sc:{name:"signInAndRetrieveDataWithCredential",j:[zl()]},Ab:{name:"signInAnonymously",j:[]},ab:{name:"signInWithCredential",j:[zl()]},Tc:{name:"signInWithCustomToken",j:[Bl("token")]},Uc:{name:"signInWithEmailAndPassword",j:[Bl("email"),Bl("password")]},Vc:{name:"signInWithEmailLink",j:[Bl("email"),Bl("emailLink",!0)]},Wc:{name:"signInWithPhoneNumber",j:[Bl("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:[Ql({name:"user",K:"an instance of Firebase User",optional:!1,M:function(t){return!!(t&&t instanceof yh)}},Yl(),"user")]},Bb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Bl(null,!0)]},fd:{name:"useDeviceLanguage",j:[]},gd:{name:"useEmulator",j:[Bl("url"),Xl("options",!0)]},jd:{name:"verifyPasswordResetCode",j:[Bl("code")]}}),ef(al.prototype,{lc:{name:"languageCode",lb:Ql(Bl(),Yl(),"languageCode")},ti:{name:"tenantId",lb:Ql(Bl(),Yl(),"tenantId")}}),al.Persistence=Qu,al.Persistence.LOCAL="local",al.Persistence.SESSION="session",al.Persistence.NONE="none",tf(yh.prototype,{delete:{name:"delete",j:[]},oc:{name:"getIdTokenResult",j:[Wl("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Wl("opt_forceRefresh",!0)]},Cc:{name:"linkAndRetrieveDataWithCredential",j:[zl()]},rb:{name:"linkWithCredential",j:[zl()]},Dc:{name:"linkWithPhoneNumber",j:[Bl("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:[zl()]},ub:{name:"reauthenticateWithCredential",j:[zl()]},Mc:{name:"reauthenticateWithPhoneNumber",j:[Bl("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:[]},vb:{name:"sendEmailVerification",j:[Ql(Xl("opt_actionCodeSettings",!0),Yl(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Bl(null,!0)]},cd:{name:"unlink",j:[Bl("provider")]},Cb:{name:"updateEmail",j:[Bl("email")]},Db:{name:"updatePassword",j:[Bl("password")]},ed:{name:"updatePhoneNumber",j:[zl("phone")]},Eb:{name:"updateProfile",j:[Xl("profile")]},Fb:{name:"verifyBeforeUpdateEmail",j:[Bl("email"),Ql(Xl("opt_actionCodeSettings",!0),Yl(null,!0),"opt_actionCodeSettings",!0)]}}),tf(Il.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),tf(wl.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),tf(Ee.prototype,{oa:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),ef($c.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",lb:Wl("appVerificationDisabledForTesting")}}),tf(Zc.prototype,{confirm:{name:"confirm",j:[Bl("verificationCode")]}}),nf(co,"fromJSON",function(t){t="string"==typeof t?JSON.parse(t):t;for(var e,n=[go,Co,xo,po],i=0;i<n.length;i++)if(e=n[i](t))return e;return null},[Ql(Bl(),Xl(),"json")]),nf(Ro,"credential",function(t,e){return new Oo(t,e)},[Bl("email"),Bl("password")]),tf(Oo.prototype,{w:{name:"toJSON",j:[Bl(null,!0)]}}),tf(Io.prototype,{Ca:{name:"addScope",j:[Bl("scope")]},Ka:{name:"setCustomParameters",j:[Xl("customOAuthParameters")]}}),nf(Io,"credential",To,[Ql(Bl(),Xl(),"token")]),nf(Ro,"credentialWithLink",Po,[Bl("email"),Bl("emailLink")]),tf(Eo.prototype,{Ca:{name:"addScope",j:[Bl("scope")]},Ka:{name:"setCustomParameters",j:[Xl("customOAuthParameters")]}}),nf(Eo,"credential",Ao,[Ql(Bl(),Xl(),"token")]),tf(ko.prototype,{Ca:{name:"addScope",j:[Bl("scope")]},Ka:{name:"setCustomParameters",j:[Xl("customOAuthParameters")]}}),nf(ko,"credential",So,[Ql(Bl(),Ql(Xl(),Yl()),"idToken"),Ql(Bl(),Yl(),"accessToken",!0)]),tf(No.prototype,{Ka:{name:"setCustomParameters",j:[Xl("customOAuthParameters")]}}),nf(No,"credential",_o,[Ql(Bl(),Xl(),"token"),Bl("secret",!0)]),tf(wo.prototype,{Ca:{name:"addScope",j:[Bl("scope")]},credential:{name:"credential",j:[Ql(Bl(),Ql(Xl(),Yl()),"optionsOrIdToken"),Ql(Bl(),Yl(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[Xl("customOAuthParameters")]}}),tf(vo.prototype,{w:{name:"toJSON",j:[Bl(null,!0)]}}),tf(lo.prototype,{w:{name:"toJSON",j:[Bl(null,!0)]}}),nf(jo,"credential",Uo,[Bl("verificationId"),Bl("verificationCode")]),tf(jo.prototype,{gb:{name:"verifyPhoneNumber",j:[Ql(Bl(),{name:"phoneInfoOptions",K:"valid phone info options",optional:!1,M:function(t){return!!t&&(t.session&&t.phoneNumber?$l(t.session,so)&&"string"==typeof t.phoneNumber:t.session&&t.multiFactorHint?$l(t.session,uo)&&Zl(t.multiFactorHint):t.session&&t.multiFactorUid?$l(t.session,uo)&&"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)}}]}}),tf(Lo.prototype,{w:{name:"toJSON",j:[Bl(null,!0)]}}),tf(N.prototype,{toJSON:{name:"toJSON",j:[Bl(null,!0)]}}),tf(Xo.prototype,{toJSON:{name:"toJSON",j:[Bl(null,!0)]}}),tf(Wo.prototype,{toJSON:{name:"toJSON",j:[Bl(null,!0)]}}),tf(rh.prototype,{toJSON:{name:"toJSON",j:[Bl(null,!0)]}}),tf(eh.prototype,{Rc:{name:"resolveSignIn",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.tb}}]}}),tf(hh.prototype,{Sb:{name:"getSession",j:[]},fc:{name:"enroll",j:[{name:"multiFactorAssertion",K:"a valid multiFactorAssertion",optional:!1,M:function(t){return!!t&&!!t.tb}},Bl("displayName",!0)]},bd:{name:"unenroll",j:[Ql({name:"multiFactorInfo",K:"a valid multiFactorInfo",optional:!1,M:Zl},Bl(),"multiFactorInfoIdentifier")]}}),tf(Kl.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),nf(Ir,"parseLink",Or,[Bl("link")]),nf(Nl,"assertion",function(t){return new uh(t)},[zl("phone")]),function(){if(void 0===e.default||!e.default.INTERNAL||!e.default.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:cr,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:ur,VERIFY_AND_CHANGE_EMAIL:hr,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:al,AuthCredential:co,Error:N};nf(t,"EmailAuthProvider",Ro,[]),nf(t,"FacebookAuthProvider",Io,[]),nf(t,"GithubAuthProvider",Eo,[]),nf(t,"GoogleAuthProvider",ko,[]),nf(t,"TwitterAuthProvider",No,[]),nf(t,"OAuthProvider",wo,[Bl("providerId")]),nf(t,"SAMLAuthProvider",yo,[Bl("providerId")]),nf(t,"PhoneAuthProvider",jo,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof al)}}]),nf(t,"RecaptchaVerifier",Kl,[Ql(Bl(),{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),Xl("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof e.default.app.App)}}]),nf(t,"ActionCodeURL",Ir,[]),nf(t,"PhoneMultiFactorGenerator",Nl,[]),e.default.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return new al(t=t.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC",onInstanceCreated:function(t){t.getProvider("auth-internal").initialize()}}),e.default.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return{getUid:T((t=t.getProvider("auth").getImmediate()).getUid,t),getToken:T(t.nc,t),addAuthTokenListener:T(t.cc,t),removeAuthTokenListener:T(t.Pc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),e.default.registerVersion("@firebase/auth","0.16.8"),e.default.INTERNAL.extendNamespace({User:yh})}()}).apply(void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});
|
|
482
|
+
},{"@firebase/app":"VxYX"}],"zKjx":[function(require,module,exports) {
|
|
483
|
+
"use strict";require("@firebase/auth");
|
|
484
|
+
},{"@firebase/auth":"EkFk"}],"SScM":[function(require,module,exports) {
|
|
485
|
+
"use strict";var e=r(require("@firebase/app")),t=require("tslib"),n=require("@firebase/component");function r(e){return e&&e.__esModule?e:{default:e}}var i={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"},o=function(e){function n(t,r,i){var o=e.call(this,r)||this;return Object.setPrototypeOf(o,n.prototype),o.code=t,o.details=i,o}return(0,t.__extends)(n,e),n}(Error);function a(e){if(e>=200&&e<300)return"ok";switch(e){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"}function s(e,t,n){var r=a(e),s=r,u=void 0;try{var c=t&&t.error;if(c){var l=c.status;if("string"==typeof l){if(!i[l])return new o("internal","internal");r=i[l],s=l}var d=c.message;"string"==typeof d&&(s=d),void 0!==(u=c.details)&&(u=n.decode(u))}}catch(f){}return"ok"===r?null:new o(r,s,u)}var u=function(){function e(e,t){var n=this;this.auth=null,this.messaging=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then(function(e){return n.auth=e},function(){}),this.messaging||t.get().then(function(e){return n.messaging=e},function(){})}return e.prototype.getAuthToken=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){var e;return(0,t.__generator)(this,function(t){switch(t.label){case 0:if(!this.auth)return[2,void 0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.auth.getToken()];case 2:return(e=t.sent())?[2,e.accessToken]:[2,void 0];case 3:return t.sent(),[2,void 0];case 4:return[2]}})})},e.prototype.getInstanceIdToken=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){return(0,t.__generator)(this,function(e){switch(e.label){case 0:if(!(this.messaging&&"Notification"in self&&"granted"===Notification.permission))return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.messaging.getToken()];case 2:return[2,e.sent()];case 3:return e.sent(),[2,void 0];case 4:return[2]}})})},e.prototype.getContext=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){var e,n;return(0,t.__generator)(this,function(t){switch(t.label){case 0:return[4,this.getAuthToken()];case 1:return e=t.sent(),[4,this.getInstanceIdToken()];case 2:return n=t.sent(),[2,{authToken:e,instanceIdToken:n}]}})})},e}(),c="type.googleapis.com/google.protobuf.Int64Value",l="type.googleapis.com/google.protobuf.UInt64Value";function d(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}var f=function(){function e(){}return e.prototype.encode=function(e){var t=this;if(null==e)return null;if(e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&isFinite(e))return e;if(!0===e||!1===e)return e;if("[object String]"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(function(e){return t.encode(e)});if("function"==typeof e||"object"==typeof e)return d(e,function(e){return t.encode(e)});throw new Error("Data cannot be encoded in JSON: "+e)},e.prototype.decode=function(e){var t=this;if(null==e)return e;if(e["@type"])switch(e["@type"]){case c:case l:var n=Number(e.value);if(isNaN(n))throw new Error("Data cannot be decoded from JSON: "+e);return n;default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map(function(e){return t.decode(e)}):"function"==typeof e||"object"==typeof e?d(e,function(e){return t.decode(e)}):e},e}();function h(e){var t,n=new Promise(function(n,r){t=setTimeout(function(){r(new o("deadline-exceeded","deadline-exceeded"))},e)});return{timer:t,promise:n}}var p=function(){function e(e,t,n,r,i,o){var a=this;void 0===i&&(i="us-central1"),this.app_=e,this.appCheckProvider=r,this.fetchImpl=o,this.serializer=new f,this.emulatorOrigin=null,this.INTERNAL={delete:function(){return Promise.resolve(a.deleteService())}},this.contextProvider=new u(t,n),this.cancelAllRequests=new Promise(function(e){a.deleteService=function(){return e()}});try{var s=new URL(i);this.customDomain=s.origin,this.region="us-central1"}catch(c){this.customDomain=null,this.region=i}}return Object.defineProperty(e.prototype,"app",{get:function(){return this.app_},enumerable:!1,configurable:!0}),e.prototype._url=function(e){var t=this.app_.options.projectId;return null!==this.emulatorOrigin?this.emulatorOrigin+"/"+t+"/"+this.region+"/"+e:null!==this.customDomain?this.customDomain+"/"+e:"https://"+this.region+"-"+t+".cloudfunctions.net/"+e},e.prototype.useEmulator=function(e,t){this.emulatorOrigin="http://"+e+":"+t},e.prototype.useFunctionsEmulator=function(e){this.emulatorOrigin=e},e.prototype.httpsCallable=function(e,t){var n=this;return function(r){return n.call(e,r,t||{})}},e.prototype.postJSON=function(e,n,r){return(0,t.__awaiter)(this,void 0,void 0,function(){var i,o,a;return(0,t.__generator)(this,function(t){switch(t.label){case 0:return r["Content-Type"]="application/json",[4,this.getAppCheckToken()];case 1:null!==(i=t.sent())&&(r["X-Firebase-AppCheck"]=i),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.fetchImpl(e,{method:"POST",body:JSON.stringify(n),headers:r})];case 3:return o=t.sent(),[3,5];case 4:return t.sent(),[2,{status:0,json:null}];case 5:a=null,t.label=6;case 6:return t.trys.push([6,8,,9]),[4,o.json()];case 7:return a=t.sent(),[3,9];case 8:return t.sent(),[3,9];case 9:return[2,{status:o.status,json:a}]}})})},e.prototype.getAppCheckToken=function(){return(0,t.__awaiter)(this,void 0,void 0,function(){var e;return(0,t.__generator)(this,function(t){switch(t.label){case 0:return(e=this.appCheckProvider.getImmediate({optional:!0}))?[4,e.getToken()]:[3,2];case 1:return[2,t.sent().token];case 2:return[2,null]}})})},e.prototype.call=function(e,n,r){return(0,t.__awaiter)(this,void 0,void 0,function(){var i,a,u,c,l,d,f,p,v,m,_;return(0,t.__generator)(this,function(t){switch(t.label){case 0:return i=this._url(e),n=this.serializer.encode(n),a={data:n},u={},[4,this.contextProvider.getContext()];case 1:return(c=t.sent()).authToken&&(u.Authorization="Bearer "+c.authToken),c.instanceIdToken&&(u["Firebase-Instance-ID-Token"]=c.instanceIdToken),l=r.timeout||7e4,d=h(l),f=d.timer,p=d.promise,[4,Promise.race([g(f,this.postJSON(i,a,u)),p,g(f,this.cancelAllRequests)])];case 2:if(!(v=t.sent()))throw new o("cancelled","Firebase Functions instance was deleted.");if(m=s(v.status,v.json,this.serializer))throw m;if(!v.json)throw new o("internal","Response is not valid JSON object.");if(void 0===(_=v.json.data)&&(_=v.json.result),void 0===_)throw new o("internal","Response is missing data field.");return[2,{data:this.serializer.decode(_)}]}})})},e}();function g(e,n){return(0,t.__awaiter)(this,void 0,void 0,function(){var r;return(0,t.__generator)(this,function(t){switch(t.label){case 0:return[4,n];case 1:return r=t.sent(),clearTimeout(e),[2,r]}})})}var v="functions";function m(e,t){var r={Functions:p};e.INTERNAL.registerComponent(new n.Component(v,function(e,n){var r=n.instanceIdentifier,i=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal"),s=e.getProvider("messaging");return new p(i,o,s,a,r,t)},"PUBLIC").setServiceProps(r).setMultipleInstances(!0))}var _="@firebase/functions",w="0.6.15";m(e.default,fetch.bind(self)),e.default.registerVersion(_,w);
|
|
486
|
+
},{"@firebase/app":"VxYX","tslib":"f2sD","@firebase/component":"sLOu"}],"a7Bh":[function(require,module,exports) {
|
|
487
|
+
"use strict";require("@firebase/functions");
|
|
488
|
+
},{"@firebase/functions":"SScM"}],"ueHA":[function(require,module,exports) {
|
|
489
|
+
var global = arguments[3];
|
|
490
|
+
var t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStatEventTarget=exports.createWebChannelTransport=exports.XhrIo=exports.WebChannel=exports.Stat=exports.FetchXmlHttpFactory=exports.EventType=exports.Event=exports.ErrorCode=exports.default=void 0;var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])})(t,e)};function e(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}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function n(t){var i="function"==typeof Symbol&&Symbol.iterator,e=i&&t[i],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}var r,s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},o=o||{},h=s||self;function a(){}function l(t){var i=typeof t;return"array"==(i="object"!=i?i:t?Array.isArray(t)?"array":i:"null")||"object"==i&&"number"==typeof t.length}function u(t){var i=typeof t;return"object"==i&&null!=t||"function"==i}function c(t){return Object.prototype.hasOwnProperty.call(t,f)&&t[f]||(t[f]=++g)}var f="closure_uid_"+(1e9*Math.random()>>>0),g=0;function p(t,i,e){return t.call.apply(t.bind,arguments)}function v(t,i,e){if(!t)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(e,n),t.apply(i,e)}}return function(){return t.apply(i,arguments)}}function d(t,i,e){return(d=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?p:v).apply(null,arguments)}function y(t,i){var e=Array.prototype.slice.call(arguments,1);return function(){var i=e.slice();return i.push.apply(i,arguments),t.apply(this,i)}}function m(t,i){function e(){}e.prototype=i.prototype,t.Z=i.prototype,t.prototype=new e,t.prototype.constructor=t,t.Vb=function(t,e,n){for(var r=Array(arguments.length-2),s=2;s<arguments.length;s++)r[s-2]=arguments[s];return i.prototype[e].apply(t,r)}}function b(){this.s=this.s,this.o=this.o}var w=0,T={};b.prototype.s=!1,b.prototype.na=function(){if(!this.s&&(this.s=!0,this.M(),0!=w)){var t=c(this);delete T[t]}},b.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};var E=Array.prototype.indexOf?function(t,i){return Array.prototype.indexOf.call(t,i,void 0)}:function(t,i){if("string"==typeof t)return"string"!=typeof i||1!=i.length?-1:t.indexOf(i,0);for(var e=0;e<t.length;e++)if(e in t&&t[e]===i)return e;return-1},S=Array.prototype.forEach?function(t,i,e){Array.prototype.forEach.call(t,i,e)}:function(t,i,e){for(var n=t.length,r="string"==typeof t?t.split(""):t,s=0;s<n;s++)s in r&&i.call(e,r[s],s,t)};function x(t){t:{for(var i=Ne,e=t.length,n="string"==typeof t?t.split(""):t,r=0;r<e;r++)if(r in n&&i.call(void 0,n[r],r,t)){i=r;break t}i=-1}return 0>i?null:"string"==typeof t?t.charAt(i):t[i]}function j(t){return Array.prototype.concat.apply([],arguments)}function C(t){var i=t.length;if(0<i){for(var e=Array(i),n=0;n<i;n++)e[n]=t[n];return e}return[]}function I(t){return/^[\s\xa0]*$/.test(t)}var A,R=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function O(t,i){return-1!=t.indexOf(i)}function P(t,i){return t<i?-1:t>i?1:0}t:{var D=h.navigator;if(D){var M=D.userAgent;if(M){A=M;break t}}A=""}function L(t,i,e){for(var n in t)i.call(e,t[n],n,t)}function X(t){var i={};for(var e in t)i[e]=t[e];return i}var H="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function _(t,i){for(var e,n,r=1;r<arguments.length;r++){for(e in n=arguments[r])t[e]=n[e];for(var s=0;s<H.length;s++)e=H[s],Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}}function k(t){return k[" "](t),t}function B(t){var i=Z;return Object.prototype.hasOwnProperty.call(i,9)?i[9]:i[9]=t(9)}k[" "]=a;var F,N=O(A,"Opera"),U=O(A,"Trident")||O(A,"MSIE"),K=O(A,"Edge"),Y=K||U,G=O(A,"Gecko")&&!(O(A.toLowerCase(),"webkit")&&!O(A,"Edge"))&&!(O(A,"Trident")||O(A,"MSIE"))&&!O(A,"Edge"),J=O(A.toLowerCase(),"webkit")&&!O(A,"Edge");function W(){var t=h.document;return t?t.documentMode:void 0}t:{var V="",$=function(){var t=A;return G?/rv:([^\);]+)(\)|;)/.exec(t):K?/Edge\/([\d\.]+)/.exec(t):U?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):J?/WebKit\/(\S+)/.exec(t):N?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if($&&(V=$?$[1]:""),U){var q=W();if(null!=q&&q>parseFloat(V)){F=String(q);break t}}F=V}var z,Z={};function Q(){return B(function(){for(var t=0,i=R(String(F)).split("."),e=R("9").split("."),n=Math.max(i.length,e.length),r=0;0==t&&r<n;r++){var s=i[r]||"",o=e[r]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],0==s[0].length&&0==o[0].length)break;t=P(0==s[1].length?0:parseInt(s[1],10),0==o[1].length?0:parseInt(o[1],10))||P(0==s[2].length,0==o[2].length)||P(s[2],o[2]),s=s[3],o=o[3]}while(0==t)}return 0<=t})}if(h.document&&U){var tt=W();z=tt||(parseInt(F,10)||void 0)}else z=void 0;var it=z,et=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var t=!1,i=Object.defineProperty({},"passive",{get:function(){t=!0}});try{h.addEventListener("test",a,i),h.removeEventListener("test",a,i)}catch(e){}return t}();function nt(t,i){this.type=t,this.g=this.target=i,this.defaultPrevented=!1}function rt(t,i){if(nt.call(this,t?t.type:""),this.relatedTarget=this.g=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.state=null,this.pointerId=0,this.pointerType="",this.i=null,t){var e=this.type=t.type,n=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.g=i,i=t.relatedTarget){if(G){t:{try{k(i.nodeName);var r=!0;break t}catch(s){}r=!1}r||(i=null)}}else"mouseover"==e?i=t.fromElement:"mouseout"==e&&(i=t.toElement);this.relatedTarget=i,n?(this.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.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:st[t.pointerType]||"",this.state=t.state,this.i=t,t.defaultPrevented&&rt.Z.h.call(this)}}nt.prototype.h=function(){this.defaultPrevented=!0},m(rt,nt);var st={2:"touch",3:"pen",4:"mouse"};rt.prototype.h=function(){rt.Z.h.call(this);var t=this.i;t.preventDefault?t.preventDefault():t.returnValue=!1};var ot="closure_listenable_"+(1e6*Math.random()|0),ht=0;function at(t,i,e,n,r){this.listener=t,this.proxy=null,this.src=i,this.type=e,this.capture=!!n,this.ia=r,this.key=++ht,this.ca=this.fa=!1}function lt(t){t.ca=!0,t.listener=null,t.proxy=null,t.src=null,t.ia=null}function ut(t){this.src=t,this.g={},this.h=0}function ct(t,i){var e=i.type;if(e in t.g){var n,r=t.g[e],s=E(r,i);(n=0<=s)&&Array.prototype.splice.call(r,s,1),n&&(lt(i),0==t.g[e].length&&(delete t.g[e],t.h--))}}function ft(t,i,e,n){for(var r=0;r<t.length;++r){var s=t[r];if(!s.ca&&s.listener==i&&s.capture==!!e&&s.ia==n)return r}return-1}ut.prototype.add=function(t,i,e,n,r){var s=t.toString();(t=this.g[s])||(t=this.g[s]=[],this.h++);var o=ft(t,i,n,r);return-1<o?(i=t[o],e||(i.fa=!1)):((i=new at(i,this.src,s,!!n,r)).fa=e,t.push(i)),i};var gt="closure_lm_"+(1e6*Math.random()|0),pt={};function vt(t,i,e,n,r){if(n&&n.once)return mt(t,i,e,n,r);if(Array.isArray(i)){for(var s=0;s<i.length;s++)vt(t,i[s],e,n,r);return null}return e=jt(e),t&&t[ot]?t.N(i,e,u(n)?!!n.capture:!!n,r):dt(t,i,e,!1,n,r)}function dt(t,i,e,n,r,s){if(!i)throw Error("Invalid event type");var o=u(r)?!!r.capture:!!r,h=St(t);if(h||(t[gt]=h=new ut(t)),(e=h.add(i,e,n,o,s)).proxy)return e;if(n=yt(),e.proxy=n,n.src=t,n.listener=e,t.addEventListener)et||(r=o),void 0===r&&(r=!1),t.addEventListener(i.toString(),n,r);else if(t.attachEvent)t.attachEvent(Tt(i.toString()),n);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(n)}return e}function yt(){var t=Et;return function i(e){return t.call(i.src,i.listener,e)}}function mt(t,i,e,n,r){if(Array.isArray(i)){for(var s=0;s<i.length;s++)mt(t,i[s],e,n,r);return null}return e=jt(e),t&&t[ot]?t.O(i,e,u(n)?!!n.capture:!!n,r):dt(t,i,e,!0,n,r)}function bt(t,i,e,n,r){if(Array.isArray(i))for(var s=0;s<i.length;s++)bt(t,i[s],e,n,r);else n=u(n)?!!n.capture:!!n,e=jt(e),t&&t[ot]?(t=t.i,(i=String(i).toString())in t.g&&(-1<(e=ft(s=t.g[i],e,n,r))&&(lt(s[e]),Array.prototype.splice.call(s,e,1),0==s.length&&(delete t.g[i],t.h--)))):t&&(t=St(t))&&(i=t.g[i.toString()],t=-1,i&&(t=ft(i,e,n,r)),(e=-1<t?i[t]:null)&&wt(e))}function wt(t){if("number"!=typeof t&&t&&!t.ca){var i=t.src;if(i&&i[ot])ct(i.i,t);else{var e=t.type,n=t.proxy;i.removeEventListener?i.removeEventListener(e,n,t.capture):i.detachEvent?i.detachEvent(Tt(e),n):i.addListener&&i.removeListener&&i.removeListener(n),(e=St(i))?(ct(e,t),0==e.h&&(e.src=null,i[gt]=null)):lt(t)}}}function Tt(t){return t in pt?pt[t]:pt[t]="on"+t}function Et(t,i){if(t.ca)t=!0;else{i=new rt(i,this);var e=t.listener,n=t.ia||t.src;t.fa&&wt(t),t=e.call(n,i)}return t}function St(t){return(t=t[gt])instanceof ut?t:null}var xt="__closure_events_fn_"+(1e9*Math.random()>>>0);function jt(t){return"function"==typeof t?t:(t[xt]||(t[xt]=function(i){return t.handleEvent(i)}),t[xt])}function Ct(){b.call(this),this.i=new ut(this),this.P=this,this.I=null}function It(t,i){var e,n=t.I;if(n)for(e=[];n;n=n.I)e.push(n);if(t=t.P,n=i.type||i,"string"==typeof i)i=new nt(i,t);else if(i instanceof nt)i.target=i.target||t;else{var r=i;_(i=new nt(n,t),r)}if(r=!0,e)for(var s=e.length-1;0<=s;s--){var o=i.g=e[s];r=At(o,n,!0,i)&&r}if(r=At(o=i.g=t,n,!0,i)&&r,r=At(o,n,!1,i)&&r,e)for(s=0;s<e.length;s++)r=At(o=i.g=e[s],n,!1,i)&&r}function At(t,i,e,n){if(!(i=t.i.g[String(i)]))return!0;i=i.concat();for(var r=!0,s=0;s<i.length;++s){var o=i[s];if(o&&!o.ca&&o.capture==e){var h=o.listener,a=o.ia||o.src;o.fa&&ct(t.i,o),r=!1!==h.call(a,n)&&r}}return r&&!n.defaultPrevented}m(Ct,b),Ct.prototype[ot]=!0,Ct.prototype.removeEventListener=function(t,i,e,n){bt(this,t,i,e,n)},Ct.prototype.M=function(){if(Ct.Z.M.call(this),this.i){var t,i=this.i;for(t in i.g){for(var e=i.g[t],n=0;n<e.length;n++)lt(e[n]);delete i.g[t],i.h--}}this.I=null},Ct.prototype.N=function(t,i,e,n){return this.i.add(String(t),i,!1,e,n)},Ct.prototype.O=function(t,i,e,n){return this.i.add(String(t),i,!0,e,n)};var Rt=h.JSON.stringify;function Ot(){var t=Bt,i=null;return t.g&&(i=t.g,t.g=t.g.next,t.g||(t.h=null),i.next=null),i}var Pt,Dt=function(){function t(){this.h=this.g=null}return t.prototype.add=function(t,i){var e=Mt.get();e.set(t,i),this.h?this.h.next=e:this.g=e,this.h=e},t}(),Mt=new(function(){function t(t,i){this.i=t,this.j=i,this.h=0,this.g=null}return t.prototype.get=function(){var t;return 0<this.h?(this.h--,t=this.g,this.g=t.next,t.next=null):t=this.i(),t},t}())(function(){return new Lt},function(t){return t.reset()}),Lt=function(){function t(){this.next=this.g=this.h=null}return t.prototype.set=function(t,i){this.h=t,this.g=i,this.next=null},t.prototype.reset=function(){this.next=this.g=this.h=null},t}();function Xt(t){h.setTimeout(function(){throw t},0)}function Ht(t,i){Pt||_t(),kt||(Pt(),kt=!0),Bt.add(t,i)}function _t(){var t=h.Promise.resolve(void 0);Pt=function(){t.then(Ft)}}var kt=!1,Bt=new Dt;function Ft(){for(var t;t=Ot();){try{t.h.call(t.g)}catch(e){Xt(e)}var i=Mt;i.j(t),100>i.h&&(i.h++,t.next=i.g,i.g=t)}kt=!1}function Nt(t,i){Ct.call(this),this.h=t||1,this.g=i||h,this.j=d(this.kb,this),this.l=Date.now()}function Ut(t){t.da=!1,t.S&&(t.g.clearTimeout(t.S),t.S=null)}function Kt(t,i,e){if("function"==typeof t)e&&(t=d(t,e));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=d(t.handleEvent,t)}return 2147483647<Number(i)?-1:h.setTimeout(t,i||0)}function Yt(t){t.g=Kt(function(){t.g=null,t.i&&(t.i=!1,Yt(t))},t.j);var i=t.h;t.h=null,t.m.apply(null,i)}m(Nt,Ct),(r=Nt.prototype).da=!1,r.S=null,r.kb=function(){if(this.da){var t=Date.now()-this.l;0<t&&t<.8*this.h?this.S=this.g.setTimeout(this.j,this.h-t):(this.S&&(this.g.clearTimeout(this.S),this.S=null),It(this,"tick"),this.da&&(Ut(this),this.start()))}},r.start=function(){this.da=!0,this.S||(this.S=this.g.setTimeout(this.j,this.h),this.l=Date.now())},r.M=function(){Nt.Z.M.call(this),Ut(this),delete this.g};var Gt=function(t){function i(i,e){var n=t.call(this)||this;return n.m=i,n.j=e,n.h=null,n.i=!1,n.g=null,n}return e(i,t),i.prototype.l=function(t){this.h=arguments,this.g?this.i=!0:Yt(this)},i.prototype.M=function(){t.prototype.M.call(this),this.g&&(h.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)},i}(b);function Jt(t){b.call(this),this.h=t,this.g={}}m(Jt,b);var Wt=[];function Vt(t,i,e,n){Array.isArray(e)||(e&&(Wt[0]=e.toString()),e=Wt);for(var r=0;r<e.length;r++){var s=vt(i,e[r],n||t.handleEvent,!1,t.h||t);if(!s)break;t.g[s.key]=s}}function $t(t){L(t.g,function(t,i){this.g.hasOwnProperty(i)&&wt(t)},t),t.g={}}function qt(){this.g=!0}function zt(t,i,e,n,r,s){t.info(function(){if(t.g)if(s)for(var o="",h=s.split("&"),a=0;a<h.length;a++){var l=h[a].split("=");if(1<l.length){var u=l[0];l=l[1];var c=u.split("_");o=2<=c.length&&"type"==c[1]?o+(u+"=")+l+"&":o+(u+"=redacted&")}}else o=null;else o=s;return"XMLHTTP REQ ("+n+") [attempt "+r+"]: "+i+"\n"+e+"\n"+o})}function Zt(t,i,e,n,r,s,o){t.info(function(){return"XMLHTTP RESP ("+n+") [ attempt "+r+"]: "+i+"\n"+e+"\n"+s+" "+o})}function Qt(t,i,e,n){t.info(function(){return"XMLHTTP TEXT ("+i+"): "+ii(t,e)+(n?" "+n:"")})}function ti(t,i){t.info(function(){return"TIMEOUT: "+i})}function ii(t,i){if(!t.g)return i;if(!i)return null;try{var e=JSON.parse(i);if(e)for(t=0;t<e.length;t++)if(Array.isArray(e[t])){var n=e[t];if(!(2>n.length)){var r=n[1];if(Array.isArray(r)&&!(1>r.length)){var s=r[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var o=1;o<r.length;o++)r[o]=""}}}return Rt(e)}catch(h){return i}}Jt.prototype.M=function(){Jt.Z.M.call(this),$t(this)},Jt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},qt.prototype.Aa=function(){this.g=!1},qt.prototype.info=function(){};var ei={},ni=null;function ri(){return ni=ni||new Ct}function si(t){nt.call(this,ei.Ma,t)}function oi(t){var i=ri();It(i,new si(i,t))}function hi(t,i){nt.call(this,ei.STAT_EVENT,t),this.stat=i}function ai(t){var i=ri();It(i,new hi(i,t))}function li(t,i){nt.call(this,ei.Na,t),this.size=i}function ui(t,i){if("function"!=typeof t)throw Error("Fn must not be null and must be a function");return h.setTimeout(function(){t()},i)}ei.Ma="serverreachability",m(si,nt),ei.STAT_EVENT="statevent",m(hi,nt),ei.Na="timingevent",m(li,nt);var ci={NO_ERROR:0,lb:1,yb:2,xb:3,sb:4,wb:5,zb:6,Ja:7,TIMEOUT:8,Cb:9},fi={qb:"complete",Mb:"success",Ka:"error",Ja:"abort",Eb:"ready",Fb:"readystatechange",TIMEOUT:"timeout",Ab:"incrementaldata",Db:"progress",tb:"downloadprogress",Ub:"uploadprogress"};function gi(){}function pi(t){return t.h||(t.h=t.i())}function vi(){}gi.prototype.h=null;var di,yi={OPEN:"a",pb:"b",Ka:"c",Bb:"d"};function mi(){nt.call(this,"d")}function bi(){nt.call(this,"c")}function wi(){}function Ti(t,i,e,n){this.l=t,this.j=i,this.m=e,this.X=n||1,this.V=new Jt(this),this.P=Si,t=Y?125:void 0,this.W=new Nt(t),this.H=null,this.i=!1,this.s=this.A=this.v=this.K=this.F=this.Y=this.B=null,this.D=[],this.g=null,this.C=0,this.o=this.u=null,this.N=-1,this.I=!1,this.O=0,this.L=null,this.aa=this.J=this.$=this.U=!1,this.h=new Ei}function Ei(){this.i=null,this.g="",this.h=!1}m(mi,nt),m(bi,nt),m(wi,gi),wi.prototype.g=function(){return new XMLHttpRequest},wi.prototype.i=function(){return{}},di=new wi;var Si=45e3,xi={},ji={};function Ci(t,i,e){t.K=1,t.v=zi(Gi(i)),t.s=e,t.U=!0,Ii(t,null)}function Ii(t,i){t.F=Date.now(),Pi(t),t.A=Gi(t.v);var e=t.A,n=t.X;Array.isArray(n)||(n=[String(n)]),fe(e.h,"t",n),t.C=0,e=t.l.H,t.h=new Ei,t.g=bn(t.l,e?i:null,!t.s),0<t.O&&(t.L=new Gt(d(t.Ia,t,t.g),t.O)),Vt(t.V,t.g,"readystatechange",t.gb),i=t.H?X(t.H):{},t.s?(t.u||(t.u="POST"),i["Content-Type"]="application/x-www-form-urlencoded",t.g.ea(t.A,t.u,t.s,i)):(t.u="GET",t.g.ea(t.A,t.u,null,i)),oi(1),zt(t.j,t.u,t.A,t.m,t.X,t.s)}function Ai(t){return!!t.g&&("GET"==t.u&&2!=t.K&&t.l.Ba)}function Ri(t,i,e){for(var n,r=!0;!t.I&&t.C<e.length;){if((n=Oi(t,e))==ji){4==i&&(t.o=4,ai(14),r=!1),Qt(t.j,t.m,null,"[Incomplete Response]");break}if(n==xi){t.o=4,ai(15),Qt(t.j,t.m,e,"[Invalid Chunk]"),r=!1;break}Qt(t.j,t.m,n,null),Hi(t,n)}Ai(t)&&n!=ji&&n!=xi&&(t.h.g="",t.C=0),4!=i||0!=e.length||t.h.h||(t.o=1,ai(16),r=!1),t.i=t.i&&r,r?0<e.length&&!t.aa&&(t.aa=!0,(i=t.l).g==t&&i.$&&!i.L&&(i.h.info("Great, no buffering proxy detected. Bytes received: "+e.length),cn(i),i.L=!0,ai(11))):(Qt(t.j,t.m,e,"[Invalid Chunked Response]"),Xi(t),Li(t))}function Oi(t,i){var e=t.C,n=i.indexOf("\n",e);return-1==n?ji:(e=Number(i.substring(e,n)),isNaN(e)?xi:(n+=1)+e>i.length?ji:(i=i.substr(n,e),t.C=n+e,i))}function Pi(t){t.Y=Date.now()+t.P,Di(t,t.P)}function Di(t,i){if(null!=t.B)throw Error("WatchDog timer not null");t.B=ui(d(t.eb,t),i)}function Mi(t){t.B&&(h.clearTimeout(t.B),t.B=null)}function Li(t){0==t.l.G||t.I||pn(t.l,t)}function Xi(t){Mi(t);var i=t.L;i&&"function"==typeof i.na&&i.na(),t.L=null,Ut(t.W),$t(t.V),t.g&&(i=t.g,t.g=null,i.abort(),i.na())}function Hi(t,i){try{var e=t.l;if(0!=e.G&&(e.g==t||we(e.i,t)))if(e.I=t.N,!t.J&&we(e.i,t)&&3==e.G){try{var n=e.Ca.g.parse(i)}catch(s){n=null}if(Array.isArray(n)&&3==n.length){var r=n;if(0==r[0]){t:if(!e.u){if(e.g){if(!(e.g.F+3e3<t.F))break t;gn(e),tn(e)}un(e),ai(18)}}else e.ta=r[1],0<e.ta-e.U&&37500>r[2]&&e.N&&0==e.A&&!e.v&&(e.v=ui(d(e.ab,e),6e3));if(1>=be(e.i)&&e.ka){try{e.ka()}catch(s){}e.ka=void 0}}else dn(e,11)}else if((t.J||e.g==t)&&gn(e),!I(i))for(r=e.Ca.g.parse(i),i=0;i<r.length;i++){var s=r[i];if(e.U=s[0],s=s[1],2==e.G)if("c"==s[0]){e.J=s[1],e.la=s[2];var o=s[3];null!=o&&(e.ma=o,e.h.info("VER="+e.ma));var h=s[4];null!=h&&(e.za=h,e.h.info("SVER="+e.za));var a=s[5];null!=a&&"number"==typeof a&&0<a&&(n=1.5*a,e.K=n,e.h.info("backChannelRequestTimeoutMs_="+n)),n=e;var l=t.g;if(l){var u=l.g?l.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(u){var c=n.i;!c.g&&(O(u,"spdy")||O(u,"quic")||O(u,"h2"))&&(c.j=c.l,c.g=new Set,c.h&&(Te(c,c.h),c.h=null))}if(n.D){var f=l.g?l.g.getResponseHeader("X-HTTP-Session-Id"):null;f&&(n.sa=f,qi(n.F,n.D,f))}}e.G=3,e.j&&e.j.xa(),e.$&&(e.O=Date.now()-t.F,e.h.info("Handshake RTT: "+e.O+"ms"));var g=t;if((n=e).oa=mn(n,n.H?n.la:null,n.W),g.J){Ee(n.i,g);var p=g,v=n.K;v&&p.setTimeout(v),p.B&&(Mi(p),Pi(p)),n.g=g}else ln(n);0<e.l.length&&rn(e)}else"stop"!=s[0]&&"close"!=s[0]||dn(e,7);else 3==e.G&&("stop"==s[0]||"close"==s[0]?"stop"==s[0]?dn(e,7):Qe(e):"noop"!=s[0]&&e.j&&e.j.wa(s),e.A=0)}oi(4)}catch(s){}}function _i(t){if(t.R&&"function"==typeof t.R)return t.R();if("string"==typeof t)return t.split("");if(l(t)){for(var i=[],e=t.length,n=0;n<e;n++)i.push(t[n]);return i}for(n in i=[],e=0,t)i[e++]=t[n];return i}function ki(t,i){if(t.forEach&&"function"==typeof t.forEach)t.forEach(i,void 0);else if(l(t)||"string"==typeof t)S(t,i,void 0);else{if(t.T&&"function"==typeof t.T)var e=t.T();else if(t.R&&"function"==typeof t.R)e=void 0;else if(l(t)||"string"==typeof t){e=[];for(var n=t.length,r=0;r<n;r++)e.push(r)}else for(r in e=[],n=0,t)e[n++]=r;r=(n=_i(t)).length;for(var s=0;s<r;s++)i.call(void 0,n[s],e&&e[s],t)}}function Bi(t,i){this.h={},this.g=[],this.i=0;var e=arguments.length;if(1<e){if(e%2)throw Error("Uneven number of arguments");for(var n=0;n<e;n+=2)this.set(arguments[n],arguments[n+1])}else if(t)if(t instanceof Bi)for(e=t.T(),n=0;n<e.length;n++)this.set(e[n],t.get(e[n]));else for(n in t)this.set(n,t[n])}function Fi(t){if(t.i!=t.g.length){for(var i=0,e=0;i<t.g.length;){var n=t.g[i];Ni(t.h,n)&&(t.g[e++]=n),i++}t.g.length=e}if(t.i!=t.g.length){var r={};for(e=i=0;i<t.g.length;)Ni(r,n=t.g[i])||(t.g[e++]=n,r[n]=1),i++;t.g.length=e}}function Ni(t,i){return Object.prototype.hasOwnProperty.call(t,i)}(r=Ti.prototype).setTimeout=function(t){this.P=t},r.gb=function(t){t=t.target;var i=this.L;i&&3==We(t)?i.l():this.Ia(t)},r.Ia=function(t){try{if(t==this.g)t:{var i=We(this.g),e=this.g.Da(),n=this.g.ba();if(!(3>i)&&(3!=i||Y||this.g&&(this.h.h||this.g.ga()||Ve(this.g)))){this.I||4!=i||7==e||oi(8==e||0>=n?3:2),Mi(this);var r=this.g.ba();this.N=r;i:if(Ai(this)){var s=Ve(this.g);t="";var o=s.length,a=4==We(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Xi(this),Li(this);var l="";break i}this.h.i=new h.TextDecoder}for(e=0;e<o;e++)this.h.h=!0,t+=this.h.i.decode(s[e],{stream:a&&e==o-1});s.splice(0,o),this.h.g+=t,this.C=0,l=this.h.g}else l=this.g.ga();if(this.i=200==r,Zt(this.j,this.u,this.A,this.m,this.X,i,r),this.i){if(this.$&&!this.J){i:{if(this.g){var u,c=this.g;if((u=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!I(u)){var f=u;break i}}f=null}if(!(r=f)){this.i=!1,this.o=3,ai(12),Xi(this),Li(this);break t}Qt(this.j,this.m,r,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,Hi(this,r)}this.U?(Ri(this,i,l),Y&&this.i&&3==i&&(Vt(this.V,this.W,"tick",this.fb),this.W.start())):(Qt(this.j,this.m,l,null),Hi(this,l)),4==i&&Xi(this),this.i&&!this.I&&(4==i?pn(this.l,this):(this.i=!1,Pi(this)))}else 400==r&&0<l.indexOf("Unknown SID")?(this.o=3,ai(12)):(this.o=0,ai(13)),Xi(this),Li(this)}}}catch(i){}},r.fb=function(){if(this.g){var t=We(this.g),i=this.g.ga();this.C<i.length&&(Mi(this),Ri(this,t,i),this.i&&4!=t&&Pi(this))}},r.cancel=function(){this.I=!0,Xi(this)},r.eb=function(){this.B=null;var t=Date.now();0<=t-this.Y?(ti(this.j,this.A),2!=this.K&&(oi(3),ai(17)),Xi(this),this.o=2,Li(this)):Di(this,this.Y-t)},(r=Bi.prototype).R=function(){Fi(this);for(var t=[],i=0;i<this.g.length;i++)t.push(this.h[this.g[i]]);return t},r.T=function(){return Fi(this),this.g.concat()},r.get=function(t,i){return Ni(this.h,t)?this.h[t]:i},r.set=function(t,i){Ni(this.h,t)||(this.i++,this.g.push(t)),this.h[t]=i},r.forEach=function(t,i){for(var e=this.T(),n=0;n<e.length;n++){var r=e[n],s=this.get(r);t.call(i,s,r,this)}};var Ui=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Ki(t,i){if(t){t=t.split("&");for(var e=0;e<t.length;e++){var n=t[e].indexOf("="),r=null;if(0<=n){var s=t[e].substring(0,n);r=t[e].substring(n+1)}else s=t[e];i(s,r?decodeURIComponent(r.replace(/\+/g," ")):"")}}}function Yi(t,i){if(this.i=this.s=this.j="",this.m=null,this.o=this.l="",this.g=!1,t instanceof Yi){this.g=void 0!==i?i:t.g,Ji(this,t.j),this.s=t.s,Wi(this,t.i),Vi(this,t.m),this.l=t.l,i=t.h;var e=new ae;e.i=i.i,i.g&&(e.g=new Bi(i.g),e.h=i.h),$i(this,e),this.o=t.o}else t&&(e=String(t).match(Ui))?(this.g=!!i,Ji(this,e[1]||"",!0),this.s=te(e[2]||""),Wi(this,e[3]||"",!0),Vi(this,e[4]),this.l=te(e[5]||"",!0),$i(this,e[6]||"",!0),this.o=te(e[7]||"")):(this.g=!!i,this.h=new ae(null,this.g))}function Gi(t){return new Yi(t)}function Ji(t,i,e){t.j=e?te(i,!0):i,t.j&&(t.j=t.j.replace(/:$/,""))}function Wi(t,i,e){t.i=e?te(i,!0):i}function Vi(t,i){if(i){if(i=Number(i),isNaN(i)||0>i)throw Error("Bad port number "+i);t.m=i}else t.m=null}function $i(t,i,e){i instanceof ae?(t.h=i,pe(t.h,t.g)):(e||(i=ie(i,oe)),t.h=new ae(i,t.g))}function qi(t,i,e){t.h.set(i,e)}function zi(t){return qi(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function Zi(t){return t instanceof Yi?Gi(t):new Yi(t,void 0)}function Qi(t,i,e,n){var r=new Yi(null,void 0);return t&&Ji(r,t),i&&Wi(r,i),e&&Vi(r,e),n&&(r.l=n),r}function te(t,i){return t?i?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function ie(t,i,e){return"string"==typeof t?(t=encodeURI(t).replace(i,ee),e&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function ee(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Yi.prototype.toString=function(){var t=[],i=this.j;i&&t.push(ie(i,ne,!0),":");var e=this.i;return(e||"file"==i)&&(t.push("//"),(i=this.s)&&t.push(ie(i,ne,!0),"@"),t.push(encodeURIComponent(String(e)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(e=this.m)&&t.push(":",String(e))),(e=this.l)&&(this.i&&"/"!=e.charAt(0)&&t.push("/"),t.push(ie(e,"/"==e.charAt(0)?se:re,!0))),(e=this.h.toString())&&t.push("?",e),(e=this.o)&&t.push("#",ie(e,he)),t.join("")};var ne=/[#\/\?@]/g,re=/[#\?:]/g,se=/[#\?]/g,oe=/[#\?@]/g,he=/#/g;function ae(t,i){this.h=this.g=null,this.i=t||null,this.j=!!i}function le(t){t.g||(t.g=new Bi,t.h=0,t.i&&Ki(t.i,function(i,e){t.add(decodeURIComponent(i.replace(/\+/g," ")),e)}))}function ue(t,i){le(t),i=ge(t,i),Ni(t.g.h,i)&&(t.i=null,t.h-=t.g.get(i).length,Ni((t=t.g).h,i)&&(delete t.h[i],t.i--,t.g.length>2*t.i&&Fi(t)))}function ce(t,i){return le(t),i=ge(t,i),Ni(t.g.h,i)}function fe(t,i,e){ue(t,i),0<e.length&&(t.i=null,t.g.set(ge(t,i),C(e)),t.h+=e.length)}function ge(t,i){return i=String(i),t.j&&(i=i.toLowerCase()),i}function pe(t,i){i&&!t.j&&(le(t),t.i=null,t.g.forEach(function(t,i){var e=i.toLowerCase();i!=e&&(ue(this,i),fe(this,e,t))},t)),t.j=i}(r=ae.prototype).add=function(t,i){le(this),this.i=null,t=ge(this,t);var e=this.g.get(t);return e||this.g.set(t,e=[]),e.push(i),this.h+=1,this},r.forEach=function(t,i){le(this),this.g.forEach(function(e,n){S(e,function(e){t.call(i,e,n,this)},this)},this)},r.T=function(){le(this);for(var t=this.g.R(),i=this.g.T(),e=[],n=0;n<i.length;n++)for(var r=t[n],s=0;s<r.length;s++)e.push(i[n]);return e},r.R=function(t){le(this);var i=[];if("string"==typeof t)ce(this,t)&&(i=j(i,this.g.get(ge(this,t))));else{t=this.g.R();for(var e=0;e<t.length;e++)i=j(i,t[e])}return i},r.set=function(t,i){return le(this),this.i=null,ce(this,t=ge(this,t))&&(this.h-=this.g.get(t).length),this.g.set(t,[i]),this.h+=1,this},r.get=function(t,i){return t&&0<(t=this.R(t)).length?String(t[0]):i},r.toString=function(){if(this.i)return this.i;if(!this.g)return"";for(var t=[],i=this.g.T(),e=0;e<i.length;e++){var n=i[e],r=encodeURIComponent(String(n));n=this.R(n);for(var s=0;s<n.length;s++){var o=r;""!==n[s]&&(o+="="+encodeURIComponent(String(n[s]))),t.push(o)}}return this.i=t.join("&")};var ve=function(){return function(t,i){this.h=t,this.g=i}}();function de(t){this.l=t||ye,h.PerformanceNavigationTiming?t=0<(t=h.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):t=!!(h.g&&h.g.Ea&&h.g.Ea()&&h.g.Ea().Zb),this.j=t?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var ye=10;function me(t){return!!t.h||!!t.g&&t.g.size>=t.j}function be(t){return t.h?1:t.g?t.g.size:0}function we(t,i){return t.h?t.h==i:!!t.g&&t.g.has(i)}function Te(t,i){t.g?t.g.add(i):t.h=i}function Ee(t,i){t.h&&t.h==i?t.h=null:t.g&&t.g.has(i)&&t.g.delete(i)}function Se(t){var i,e;if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){var r=t.i;try{for(var s=n(t.g.values()),o=s.next();!o.done;o=s.next()){var h=o.value;r=r.concat(h.D)}}catch(a){i={error:a}}finally{try{o&&!o.done&&(e=s.return)&&e.call(s)}finally{if(i)throw i.error}}return r}return C(t.i)}function xe(){}function je(){this.g=new xe}function Ce(t,i,e){var n=e||"";try{ki(t,function(t,e){var r=t;u(t)&&(r=Rt(t)),i.push(n+e+"="+encodeURIComponent(r))})}catch(r){throw i.push(n+"type="+encodeURIComponent("_badmap")),r}}function Ie(t,i){var e=new qt;if(h.Image){var n=new Image;n.onload=y(Ae,e,n,"TestLoadImage: loaded",!0,i),n.onerror=y(Ae,e,n,"TestLoadImage: error",!1,i),n.onabort=y(Ae,e,n,"TestLoadImage: abort",!1,i),n.ontimeout=y(Ae,e,n,"TestLoadImage: timeout",!1,i),h.setTimeout(function(){n.ontimeout&&n.ontimeout()},1e4),n.src=t}else i(!1)}function Ae(t,i,e,n,r){try{i.onload=null,i.onerror=null,i.onabort=null,i.ontimeout=null,r(n)}catch(s){}}function Re(t){this.l=t.$b||null,this.j=t.ib||!1}function Oe(t,i){Ct.call(this),this.D=t,this.u=i,this.m=void 0,this.readyState=Pe,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}de.prototype.cancel=function(){var t,i;if(this.i=Se(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var e=n(this.g.values()),r=e.next();!r.done;r=e.next()){r.value.cancel()}}catch(s){t={error:s}}finally{try{r&&!r.done&&(i=e.return)&&i.call(e)}finally{if(t)throw t.error}}this.g.clear()}},xe.prototype.stringify=function(t){return h.JSON.stringify(t,void 0)},xe.prototype.parse=function(t){return h.JSON.parse(t,void 0)},m(Re,gi),Re.prototype.g=function(){return new Oe(this.l,this.j)},Re.prototype.i=function(t){return function(){return t}}({}),m(Oe,Ct);var Pe=0;function De(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Me(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Le(t)}function Le(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(r=Oe.prototype).open=function(t,i){if(this.readyState!=Pe)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=i,this.readyState=1,Le(this)},r.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var i={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(i.body=t),(this.D||h).fetch(new Request(this.B,i)).then(this.Va.bind(this),this.ha.bind(this))},r.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Me(this)),this.readyState=Pe},r.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Le(this)),this.g&&(this.readyState=3,Le(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==h.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;De(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},r.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var i=t.value?t.value:new Uint8Array(0);(i=this.A.decode(i,{stream:!t.done}))&&(this.response=this.responseText+=i)}t.done?Me(this):Le(this),3==this.readyState&&De(this)}},r.Ua=function(t){this.g&&(this.response=this.responseText=t,Me(this))},r.Ta=function(t){this.g&&(this.response=t,Me(this))},r.ha=function(){this.g&&Me(this)},r.setRequestHeader=function(t,i){this.v.append(t,i)},r.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},r.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],i=this.h.entries(),e=i.next();!e.done;)e=e.value,t.push(e[0]+": "+e[1]),e=i.next();return t.join("\r\n")},Object.defineProperty(Oe.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Xe=h.JSON.parse;function He(t){Ct.call(this),this.headers=new Bi,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=_e,this.K=this.L=!1}m(He,Ct);var _e="",ke=/^https?$/i,Be=["POST","PUT"];function Fe(t){return U&&Q()&&"number"==typeof t.timeout&&void 0!==t.ontimeout}function Ne(t){return"content-type"==t.toLowerCase()}function Ue(t,i){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=i,t.m=5,Ke(t),Ge(t)}function Ke(t){t.D||(t.D=!0,It(t,"complete"),It(t,"error"))}function Ye(t){if(t.h&&void 0!==o&&(!t.C[1]||4!=We(t)||2!=t.ba()))if(t.v&&4==We(t))Kt(t.Fa,0,t);else if(It(t,"readystatechange"),4==We(t)){t.h=!1;try{var i,e=t.ba();t:switch(e){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var n=!0;break t;default:n=!1}if(!(i=n)){var r;if(r=0===e){var s=String(t.H).match(Ui)[1]||null;if(!s&&h.self&&h.self.location){var a=h.self.location.protocol;s=a.substr(0,a.length-1)}r=!ke.test(s?s.toLowerCase():"")}i=r}if(i)It(t,"complete"),It(t,"success");else{t.m=6;try{var l=2<We(t)?t.g.statusText:""}catch(u){l=""}t.j=l+" ["+t.ba()+"]",Ke(t)}}finally{Ge(t)}}}function Ge(t,i){if(t.g){Je(t);var e=t.g,n=t.C[0]?a:null;t.g=null,t.C=null,i||It(t,"ready");try{e.onreadystatechange=n}catch(r){}}}function Je(t){t.g&&t.K&&(t.g.ontimeout=null),t.A&&(h.clearTimeout(t.A),t.A=null)}function We(t){return t.g?t.g.readyState:0}function Ve(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.J){case _e:case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch(i){return null}}function $e(t){var i="";return L(t,function(t,e){i+=e,i+=":",i+=t,i+="\r\n"}),i}function qe(t,i,e){t:{for(n in e){var n=!1;break t}n=!0}n||(e=$e(e),"string"==typeof t?null!=e&&encodeURIComponent(String(e)):qi(t,i,e))}function ze(t,i,e){return e&&e.internalChannelParams&&e.internalChannelParams[t]||i}function Ze(t){this.za=0,this.l=[],this.h=new qt,this.la=this.oa=this.F=this.W=this.g=this.sa=this.D=this.aa=this.o=this.P=this.s=null,this.Za=this.V=0,this.Xa=ze("failFast",!1,t),this.N=this.v=this.u=this.m=this.j=null,this.X=!0,this.I=this.ta=this.U=-1,this.Y=this.A=this.C=0,this.Pa=ze("baseRetryDelayMs",5e3,t),this.$a=ze("retryDelaySeedMs",1e4,t),this.Ya=ze("forwardChannelMaxRetries",2,t),this.ra=ze("forwardChannelRequestTimeoutMs",2e4,t),this.qa=t&&t.xmlHttpFactory||void 0,this.Ba=t&&t.Yb||!1,this.K=void 0,this.H=t&&t.supportsCrossDomainXhr||!1,this.J="",this.i=new de(t&&t.concurrentRequestLimit),this.Ca=new je,this.ja=t&&t.fastHandshake||!1,this.Ra=t&&t.Wb||!1,t&&t.Aa&&this.h.Aa(),t&&t.forceLongPolling&&(this.X=!1),this.$=!this.ja&&this.X&&t&&t.detectBufferingProxy||!1,this.ka=void 0,this.O=0,this.L=!1,this.B=null,this.Wa=!t||!1!==t.Xb}function Qe(t){if(en(t),3==t.G){var i=t.V++,e=Gi(t.F);qi(e,"SID",t.J),qi(e,"RID",i),qi(e,"TYPE","terminate"),hn(t,e),(i=new Ti(t,t.h,i,void 0)).K=2,i.v=zi(Gi(e)),e=!1,h.navigator&&h.navigator.sendBeacon&&(e=h.navigator.sendBeacon(i.v.toString(),"")),!e&&h.Image&&((new Image).src=i.v,e=!0),e||(i.g=bn(i.l,null),i.g.ea(i.v)),i.F=Date.now(),Pi(i)}yn(t)}function tn(t){t.g&&(cn(t),t.g.cancel(),t.g=null)}function en(t){tn(t),t.u&&(h.clearTimeout(t.u),t.u=null),gn(t),t.i.cancel(),t.m&&("number"==typeof t.m&&h.clearTimeout(t.m),t.m=null)}function nn(t,i){t.l.push(new ve(t.Za++,i)),3==t.G&&rn(t)}function rn(t){me(t.i)||t.m||(t.m=!0,Ht(t.Ha,t),t.C=0)}function sn(t,i){return!(be(t.i)>=t.i.j-(t.m?1:0))&&(t.m?(t.l=i.D.concat(t.l),!0):!(1==t.G||2==t.G||t.C>=(t.Xa?0:t.Ya))&&(t.m=ui(d(t.Ha,t,i),vn(t,t.C)),t.C++,!0))}function on(t,i){var e;e=i?i.m:t.V++;var n=Gi(t.F);qi(n,"SID",t.J),qi(n,"RID",e),qi(n,"AID",t.U),hn(t,n),t.o&&t.s&&qe(n,t.o,t.s),e=new Ti(t,t.h,e,t.C+1),null===t.o&&(e.H=t.s),i&&(t.l=i.D.concat(t.l)),i=an(t,e,1e3),e.setTimeout(Math.round(.5*t.ra)+Math.round(.5*t.ra*Math.random())),Te(t.i,e),Ci(e,n,i)}function hn(t,i){t.j&&ki({},function(t,e){qi(i,e,t)})}function an(t,i,e){e=Math.min(t.l.length,e);var n=t.j?d(t.j.Oa,t.j,t):null;t:for(var r=t.l,s=-1;;){var o=["count="+e];-1==s?0<e?(s=r[0].h,o.push("ofs="+s)):s=0:o.push("ofs="+s);for(var h=!0,a=0;a<e;a++){var l=r[a].h,u=r[a].g;if(0>(l-=s))s=Math.max(0,r[a].h-100),h=!1;else try{Ce(u,o,"req"+l+"_")}catch(c){n&&n(u)}}if(h){n=o.join("&");break t}}return t=t.l.splice(0,e),i.D=t,n}function ln(t){t.g||t.u||(t.Y=1,Ht(t.Ga,t),t.A=0)}function un(t){return!(t.g||t.u||3<=t.A)&&(t.Y++,t.u=ui(d(t.Ga,t),vn(t,t.A)),t.A++,!0)}function cn(t){null!=t.B&&(h.clearTimeout(t.B),t.B=null)}function fn(t){t.g=new Ti(t,t.h,"rpc",t.Y),null===t.o&&(t.g.H=t.s),t.g.O=0;var i=Gi(t.oa);qi(i,"RID","rpc"),qi(i,"SID",t.J),qi(i,"CI",t.N?"0":"1"),qi(i,"AID",t.U),hn(t,i),qi(i,"TYPE","xmlhttp"),t.o&&t.s&&qe(i,t.o,t.s),t.K&&t.g.setTimeout(t.K);var e=t.g;t=t.la,e.K=1,e.v=zi(Gi(i)),e.s=null,e.U=!0,Ii(e,t)}function gn(t){null!=t.v&&(h.clearTimeout(t.v),t.v=null)}function pn(t,i){var e=null;if(t.g==i){gn(t),cn(t),t.g=null;var n=2}else{if(!we(t.i,i))return;e=i.D,Ee(t.i,i),n=1}if(t.I=i.N,0!=t.G)if(i.i)if(1==n){e=i.s?i.s.length:0,i=Date.now()-i.F;var r=t.C;It(n=ri(),new li(n,e,i,r)),rn(t)}else ln(t);else if(3==(r=i.o)||0==r&&0<t.I||!(1==n&&sn(t,i)||2==n&&un(t)))switch(e&&0<e.length&&(i=t.i,i.i=i.i.concat(e)),r){case 1:dn(t,5);break;case 4:dn(t,10);break;case 3:dn(t,6);break;default:dn(t,2)}}function vn(t,i){var e=t.Pa+Math.floor(Math.random()*t.$a);return t.j||(e*=2),e*i}function dn(t,i){if(t.h.info("Error code "+i),2==i){var e=null;t.j&&(e=null);var n=d(t.jb,t);e||(e=new Yi("//www.google.com/images/cleardot.gif"),h.location&&"http"==h.location.protocol||Ji(e,"https"),zi(e)),Ie(e.toString(),n)}else ai(2);t.G=0,t.j&&t.j.va(i),yn(t),en(t)}function yn(t){t.G=0,t.I=-1,t.j&&(0==Se(t.i).length&&0==t.l.length||(t.i.i.length=0,C(t.l),t.l.length=0),t.j.ua())}function mn(t,i,e){var n=Zi(e);if(""!=n.i)i&&Wi(n,i+"."+n.i),Vi(n,n.m);else{var r=h.location;n=Qi(r.protocol,i?i+"."+r.hostname:r.hostname,+r.port,e)}return t.aa&&L(t.aa,function(t,i){qi(n,i,t)}),i=t.D,e=t.sa,i&&e&&qi(n,i,e),qi(n,"VER",t.ma),hn(t,n),n}function bn(t,i,e){if(i&&!t.H)throw Error("Can't create secondary domain capable XhrIo object.");return(i=e&&t.Ba&&!t.qa?new He(new Re({ib:!0})):new He(t.qa)).L=t.H,i}function wn(){}function Tn(){if(U&&!(10<=Number(it)))throw Error("Environmental error: no available transport.")}function En(t,i){Ct.call(this),this.g=new Ze(i),this.l=t,this.h=i&&i.messageUrlParams||null,t=i&&i.messageHeaders||null,i&&i.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.s=t,t=i&&i.initMessageHeaders||null,i&&i.messageContentType&&(t?t["X-WebChannel-Content-Type"]=i.messageContentType:t={"X-WebChannel-Content-Type":i.messageContentType}),i&&i.ya&&(t?t["X-WebChannel-Client-Profile"]=i.ya:t={"X-WebChannel-Client-Profile":i.ya}),this.g.P=t,(t=i&&i.httpHeadersOverwriteParam)&&!I(t)&&(this.g.o=t),this.A=i&&i.supportsCrossDomainXhr||!1,this.v=i&&i.sendRawJson||!1,(i=i&&i.httpSessionIdParam)&&!I(i)&&(this.g.D=i,null!==(t=this.h)&&i in t&&(i in(t=this.h)&&delete t[i])),this.j=new jn(this)}function Sn(t){mi.call(this);var i=t.__sm__;if(i){t:{for(var e in i){t=e;break t}t=void 0}(this.i=t)&&(t=this.i,i=null!==i&&t in i?i[t]:void 0),this.data=i}else this.data=t}function xn(){bi.call(this),this.status=1}function jn(t){this.g=t}(r=He.prototype).ea=function(t,i,e,n){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+t);i=i?i.toUpperCase():"GET",this.H=t,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():di.g(),this.C=this.u?pi(this.u):pi(di),this.g.onreadystatechange=d(this.Fa,this);try{this.F=!0,this.g.open(i,String(t),!0),this.F=!1}catch(s){return void Ue(this,s)}t=e||"";var r=new Bi(this.headers);n&&ki(n,function(t,i){r.set(i,t)}),n=x(r.T()),e=h.FormData&&t instanceof h.FormData,!(0<=E(Be,i))||n||e||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach(function(t,i){this.g.setRequestHeader(i,t)},this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Je(this),0<this.B&&((this.K=Fe(this.g))?(this.g.timeout=this.B,this.g.ontimeout=d(this.pa,this)):this.A=Kt(this.pa,this.B,this)),this.v=!0,this.g.send(t),this.v=!1}catch(s){Ue(this,s)}},r.pa=function(){void 0!==o&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,It(this,"timeout"),this.abort(8))},r.abort=function(t){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=t||7,It(this,"complete"),It(this,"abort"),Ge(this))},r.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),Ge(this,!0)),He.Z.M.call(this)},r.Fa=function(){this.s||(this.F||this.v||this.l?Ye(this):this.cb())},r.cb=function(){Ye(this)},r.ba=function(){try{return 2<We(this)?this.g.status:-1}catch(t){return-1}},r.ga=function(){try{return this.g?this.g.responseText:""}catch(t){return""}},r.Qa=function(t){if(this.g){var i=this.g.responseText;return t&&0==i.indexOf(t)&&(i=i.substring(t.length)),Xe(i)}},r.Da=function(){return this.m},r.La=function(){return"string"==typeof this.j?this.j:String(this.j)},(r=Ze.prototype).ma=8,r.G=1,r.hb=function(t){try{this.h.info("Origin Trials invoked: "+t)}catch(i){}},r.Ha=function(t){if(this.m)if(this.m=null,1==this.G){if(!t){this.V=Math.floor(1e5*Math.random()),t=this.V++;var i=new Ti(this,this.h,t,void 0),e=this.s;if(this.P&&(e?_(e=X(e),this.P):e=this.P),null===this.o&&(i.H=e),this.ja)t:{for(var n=0,r=0;r<this.l.length;r++){var s=this.l[r];if(void 0===(s="__data__"in s.g&&"string"==typeof(s=s.g.__data__)?s.length:void 0))break;if(4096<(n+=s)){n=r;break t}if(4096===n||r===this.l.length-1){n=r+1;break t}}n=1e3}else n=1e3;n=an(this,i,n),qi(r=Gi(this.F),"RID",t),qi(r,"CVER",22),this.D&&qi(r,"X-HTTP-Session-Id",this.D),hn(this,r),this.o&&e&&qe(r,this.o,e),Te(this.i,i),this.Ra&&qi(r,"TYPE","init"),this.ja?(qi(r,"$req",n),qi(r,"SID","null"),i.$=!0,Ci(i,r,null)):Ci(i,r,n),this.G=2}}else 3==this.G&&(t?on(this,t):0==this.l.length||me(this.i)||on(this))},r.Ga=function(){if(this.u=null,fn(this),this.$&&!(this.L||null==this.g||0>=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=ui(d(this.bb,this),t)}},r.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,ai(10),tn(this),fn(this))},r.ab=function(){null!=this.v&&(this.v=null,tn(this),un(this),ai(19))},r.jb=function(t){t?(this.h.info("Successfully pinged google.com"),ai(2)):(this.h.info("Failed to ping google.com"),ai(1))},(r=wn.prototype).xa=function(){},r.wa=function(){},r.va=function(){},r.ua=function(){},r.Oa=function(){},Tn.prototype.g=function(t,i){return new En(t,i)},m(En,Ct),En.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var t=this.g,i=this.l,e=this.h||void 0;t.Wa&&(t.h.info("Origin Trials enabled."),Ht(d(t.hb,t,i))),ai(0),t.W=i,t.aa=e||{},t.N=t.X,t.F=mn(t,null,t.W),rn(t)},En.prototype.close=function(){Qe(this.g)},En.prototype.u=function(t){if("string"==typeof t){var i={};i.__data__=t,nn(this.g,i)}else this.v?((i={}).__data__=Rt(t),nn(this.g,i)):nn(this.g,t)},En.prototype.M=function(){this.g.j=null,delete this.j,Qe(this.g),delete this.g,En.Z.M.call(this)},m(Sn,mi),m(xn,bi),m(jn,wn),jn.prototype.xa=function(){It(this.g,"a")},jn.prototype.wa=function(t){It(this.g,new Sn(t))},jn.prototype.va=function(t){It(this.g,new xn(t))},jn.prototype.ua=function(){It(this.g,"b")},Tn.prototype.createWebChannel=Tn.prototype.g,En.prototype.send=En.prototype.u,En.prototype.open=En.prototype.m,En.prototype.close=En.prototype.close,ci.NO_ERROR=0,ci.TIMEOUT=8,ci.HTTP_ERROR=6,fi.COMPLETE="complete",vi.EventType=yi,yi.OPEN="a",yi.CLOSE="b",yi.ERROR="c",yi.MESSAGE="d",Ct.prototype.listen=Ct.prototype.N,He.prototype.listenOnce=He.prototype.O,He.prototype.getLastError=He.prototype.La,He.prototype.getLastErrorCode=He.prototype.Da,He.prototype.getStatus=He.prototype.ba,He.prototype.getResponseJson=He.prototype.Qa,He.prototype.getResponseText=He.prototype.ga,He.prototype.send=He.prototype.ea;var Cn=function(){return new Tn};exports.createWebChannelTransport=Cn;var In=function(){return ri()};exports.getStatEventTarget=In;var An=ci;exports.ErrorCode=An;var Rn=fi;exports.EventType=Rn;var On=ei;exports.Event=On;var Pn={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20};exports.Stat=Pn;var Dn=Re;exports.FetchXmlHttpFactory=Dn;var Mn=vi;exports.WebChannel=Mn;var Ln=He;exports.XhrIo=Ln;var Xn={createWebChannelTransport:Cn,getStatEventTarget:In,ErrorCode:An,EventType:Rn,Event:On,Stat:Pn,FetchXmlHttpFactory:Dn,WebChannel:Mn,XhrIo:Ln},Hn=Xn;exports.default=Hn;
|
|
491
|
+
},{}],"Emx5":[function(require,module,exports) {
|
|
492
|
+
var process = require("process");
|
|
493
|
+
var t=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.Q=ac,exports.c=Tc,exports.u=Sc,exports.z=exports.t=exports.s=exports.r=exports.q=exports.o=exports.n=exports.j=exports.a=exports.Z=exports.X=exports.W=exports.U=exports.T=exports.M=exports.E=exports.C=void 0;var e=require("tslib"),n=require("@firebase/util"),r=require("@firebase/logger"),i=require("@firebase/webchannel-wrapper");function o(t){return(o="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)}var s=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.sequenceNumberHandler=function(t){return n.t(t)},this.i=function(t){return e.writeSequenceNumber(t)})}return t.prototype.t=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.i&&this.i(t),t},t}();s.o=-1;var a={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"},u=function(t){function n(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(0,e.__extends)(n,t),n}(Error),c=new r.Logger("@firebase/firestore");function h(){return c.logLevel}function f(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];if(c.logLevel<=r.LogLevel.DEBUG){var o=n.map(p);c.debug.apply(c,(0,e.__spreadArray)(["Firestore (8.10.0): "+t],o))}}function l(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];if(c.logLevel<=r.LogLevel.ERROR){var o=n.map(p);c.error.apply(c,(0,e.__spreadArray)(["Firestore (8.10.0): "+t],o))}}function d(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];if(c.logLevel<=r.LogLevel.WARN){var o=n.map(p);c.warn.apply(c,(0,e.__spreadArray)(["Firestore (8.10.0): "+t],o))}}function p(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t}var e}function y(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (8.10.0) INTERNAL ASSERTION FAILED: "+t;throw l(e),new Error(e)}function v(t,e){t||y()}function m(t,e){return t}function g(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 _=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=g(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function w(t,e){return t<e?-1:t>e?1:0}function b(t,e,n){return t.length===e.length&&t.every(function(t,r){return n(t,e[r])})}function I(t){return t+"\0"}var E=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new u(a.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new u(a.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new u(a.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new u(a.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,Math.floor(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._compareTo=function(t){return this.seconds===t.seconds?w(this.nanoseconds,t.nanoseconds):w(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}(),T=function(){function t(t){this.timestamp=t}return t.fromTimestamp=function(e){return new t(e)},t.min=function(){return new t(new E(0,0))},t.prototype.compareTo=function(t){return this.timestamp._compareTo(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.toMicroseconds=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.toTimestamp=function(){return this.timestamp},t}();function S(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function N(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function D(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}exports.M=E;var A=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&y(),void 0===n?n=t.length-e:n>t.length-e&&y(),this.segments=t,this.offset=e,this.len=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.len},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.comparator(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.construct(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.popFirst=function(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)},t.prototype.popLast=function(){return this.construct(this.segments,this.offset,this.length-1)},t.prototype.firstSegment=function(){return this.segments[this.offset]},t.prototype.lastSegment=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.isEmpty=function(){return 0===this.length},t.prototype.isPrefixOf=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.isImmediateParentOf=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.toArray=function(){return this.segments.slice(this.offset,this.limit())},t.comparator=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}(),x=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype.construct=function(t,e,r){return new n(t,e,r)},n.prototype.canonicalString=function(){return this.toArray().join("/")},n.prototype.toString=function(){return this.canonicalString()},n.fromString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=[],i=0,o=t;i<o.length;i++){var s=o[i];if(s.indexOf("//")>=0)throw new u(a.INVALID_ARGUMENT,"Invalid segment ("+s+"). Paths must not contain // in them.");r.push.apply(r,s.split("/").filter(function(t){return t.length>0}))}return new n(r)},n.emptyPath=function(){return new n([])},n}(A),k=/^[_a-zA-Z][_a-zA-Z0-9]*$/,C=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype.construct=function(t,e,r){return new n(t,e,r)},n.isValidIdentifier=function(t){return k.test(t)},n.prototype.canonicalString=function(){return this.toArray().map(function(t){return t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),n.isValidIdentifier(t)||(t="`"+t+"`"),t}).join(".")},n.prototype.toString=function(){return this.canonicalString()},n.prototype.isKeyField=function(){return 1===this.length&&"__name__"===this.get(0)},n.keyField=function(){return new n(["__name__"])},n.fromServerFormat=function(t){for(var e=[],r="",i=0,o=function(){if(0===r.length)throw new u(a.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");e.push(r),r=""},s=!1;i<t.length;){var c=t[i];if("\\"===c){if(i+1===t.length)throw new u(a.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var h=t[i+1];if("\\"!==h&&"."!==h&&"`"!==h)throw new u(a.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=h,i+=2}else"`"===c?(s=!s,i++):"."!==c||s?(r+=c,i++):(o(),i++)}if(o(),s)throw new u(a.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new n(e)},n.emptyPath=function(){return new n([])},n}(A),R=function(){function t(t){this.fields=t,t.sort(C.comparator)}return t.prototype.covers=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].isPrefixOf(t))return!0;return!1},t.prototype.isEqual=function(t){return b(this.fields,t.fields,function(t,e){return t.isEqual(e)})},t}(),L=function(){function t(t){this.binaryString=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.binaryString,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.binaryString)},t.prototype.approximateByteSize=function(){return 2*this.binaryString.length},t.prototype.compareTo=function(t){return w(this.binaryString,t.binaryString)},t.prototype.isEqual=function(t){return this.binaryString===t.binaryString},t}();L.EMPTY_BYTE_STRING=new L("");var O=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function P(t){if(v(!!t),"string"==typeof t){var e=0,n=O.exec(t);if(v(!!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:F(t.seconds),nanos:F(t.nanos)}}function F(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function M(t){return"string"==typeof t?L.fromBase64String(t):L.fromUint8Array(t)}function V(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 V(e)?q(e):e}function U(t){var e=P(t.mapValue.fields.__local_write_time__.timestampValue);return new E(e.seconds,e.nanos)}function B(t){return null==t}function j(t){return 0===t&&1/t==-1/0}function K(t){return"number"==typeof t&&Number.isInteger(t)&&!j(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var Q=function(){function t(t){this.path=t}return t.fromPath=function(e){return new t(x.fromString(e))},t.fromName=function(e){return new t(x.fromString(e).popFirst(5))},t.prototype.hasCollectionId=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===x.comparator(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.comparator=function(t,e){return x.comparator(t.path,e.path)},t.isDocumentKey=function(t){return t.length%2==0},t.fromSegments=function(e){return new t(new x(e.slice()))},t}();function G(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?V(t)?4:10:y()}function z(t,e){var n=G(t);if(n!==G(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return U(t).isEqual(U(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=P(t.timestampValue),r=P(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 M(t.bytesValue).isEqual(M(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return F(t.geoPointValue.latitude)===F(e.geoPointValue.latitude)&&F(t.geoPointValue.longitude)===F(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return F(t.integerValue)===F(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=F(t.doubleValue),r=F(e.doubleValue);return n===r?j(n)===j(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return b(t.arrayValue.values||[],e.arrayValue.values||[],z);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(S(n)!==S(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!z(n[i],r[i])))return!1;return!0}(t,e);default:return y()}}function W(t,e){return void 0!==(t.values||[]).find(function(t){return z(t,e)})}function H(t,e){var n=G(t),r=G(e);if(n!==r)return w(n,r);switch(n){case 0:return 0;case 1:return w(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=F(t.integerValue||t.doubleValue),r=F(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 Y(t.timestampValue,e.timestampValue);case 4:return Y(U(t),U(e));case 5:return w(t.stringValue,e.stringValue);case 6:return function(t,e){var n=M(t),r=M(e);return n.compareTo(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=w(n[i],r[i]);if(0!==o)return o}return w(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=w(F(t.latitude),F(e.latitude));return 0!==n?n:w(F(t.longitude),F(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=H(n[i],r[i]);if(o)return o}return w(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 s=0;s<r.length&&s<o.length;++s){var a=w(r[s],o[s]);if(0!==a)return a;var u=H(n[r[s]],i[o[s]]);if(0!==u)return u}return w(r.length,o.length)}(t.mapValue,e.mapValue);default:throw y()}}function Y(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return w(t,e);var n=P(t),r=P(e),i=w(n.seconds,r.seconds);return 0!==i?i:w(n.nanos,r.nanos)}function $(t){return X(t)}function X(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=P(t);return"time("+e.seconds+","+e.nanos+")"}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?M(t.bytesValue).toBase64():"referenceValue"in t?(n=t.referenceValue,Q.fromName(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+=X(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+":"+X(t.fields[o])}return e+"}"}(t.mapValue):y();var e,n}function J(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.canonicalString()}}function Z(t){return!!t&&"integerValue"in t}function tt(t){return!!t&&"arrayValue"in t}function et(t){return!!t&&"nullValue"in t}function nt(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function rt(t){return!!t&&"mapValue"in t}function it(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&"object"==o(t.timestampValue))return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){var e={mapValue:{fields:{}}};return N(t.mapValue.fields,function(t,n){return e.mapValue.fields[t]=it(n)}),e}if(t.arrayValue){for(var n={arrayValue:{values:[]}},r=0;r<(t.arrayValue.values||[]).length;++r)n.arrayValue.values[r]=it(t.arrayValue.values[r]);return n}return Object.assign({},t)}var ot=function(){function t(t){this.value=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(t){if(t.isEmpty())return this.value;for(var e=this.value,n=0;n<t.length-1;++n)if(!rt(e=(e.mapValue.fields||{})[t.get(n)]))return null;return(e=(e.mapValue.fields||{})[t.lastSegment()])||null},t.prototype.set=function(t,e){this.getFieldsMap(t.popLast())[t.lastSegment()]=it(e)},t.prototype.setAll=function(t){var e=this,n=C.emptyPath(),r={},i=[];t.forEach(function(t,o){if(!n.isImmediateParentOf(o)){var s=e.getFieldsMap(n);e.applyChanges(s,r,i),r={},i=[],n=o.popLast()}t?r[o.lastSegment()]=it(t):i.push(o.lastSegment())});var o=this.getFieldsMap(n);this.applyChanges(o,r,i)},t.prototype.delete=function(t){var e=this.field(t.popLast());rt(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]},t.prototype.isEqual=function(t){return z(this.value,t.value)},t.prototype.getFieldsMap=function(t){var e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(var n=0;n<t.length;++n){var r=e.mapValue.fields[t.get(n)];rt(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},e.mapValue.fields[t.get(n)]=r),e=r}return e.mapValue.fields},t.prototype.applyChanges=function(t,e,n){N(e,function(e,n){return t[e]=n});for(var r=0,i=n;r<i.length;r++){var o=i[r];delete t[o]}},t.prototype.clone=function(){return new t(it(this.value))},t}();function st(t){var e=[];return N(t.fields,function(t,n){var r=new C([t]);if(rt(n)){var i=st(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,s=i;o<s.length;o++){var a=s[o];e.push(r.child(a))}}else e.push(r)}),new R(e)}var at=function(){function t(t,e,n,r,i){this.key=t,this.documentType=e,this.version=n,this.data=r,this.documentState=i}return t.newInvalidDocument=function(e){return new t(e,0,T.min(),ot.empty(),0)},t.newFoundDocument=function(e,n,r){return new t(e,1,n,r,0)},t.newNoDocument=function(e,n){return new t(e,2,n,ot.empty(),0)},t.newUnknownDocument=function(e,n){return new t(e,3,n,ot.empty(),2)},t.prototype.convertToFoundDocument=function(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this},t.prototype.convertToNoDocument=function(t){return this.version=t,this.documentType=2,this.data=ot.empty(),this.documentState=0,this},t.prototype.convertToUnknownDocument=function(t){return this.version=t,this.documentType=3,this.data=ot.empty(),this.documentState=2,this},t.prototype.setHasCommittedMutations=function(){return this.documentState=2,this},t.prototype.setHasLocalMutations=function(){return this.documentState=1,this},Object.defineProperty(t.prototype,"hasLocalMutations",{get:function(){return 1===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasCommittedMutations",{get:function(){return 2===this.documentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return this.hasLocalMutations||this.hasCommittedMutations},enumerable:!1,configurable:!0}),t.prototype.isValidDocument=function(){return 0!==this.documentType},t.prototype.isFoundDocument=function(){return 1===this.documentType},t.prototype.isNoDocument=function(){return 2===this.documentType},t.prototype.isUnknownDocument=function(){return 3===this.documentType},t.prototype.isEqual=function(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)},t.prototype.clone=function(){return new t(this.key,this.documentType,this.version,this.data.clone(),this.documentState)},t.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+JSON.stringify(this.data.value)+", {documentType: "+this.documentType+"}), {documentState: "+this.documentState+"})"},t}(),ut=function(t,e,n,r,i,o,s){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===s&&(s=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=s,this.h=null};function ct(t,e,n,r,i,o,s){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===s&&(s=null),new ut(t,e,n,r,i,o,s)}function ht(t){var e=m(t);if(null===e.h){var n=e.path.canonicalString();null!==e.collectionGroup&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(function(t){return function(t){return t.field.canonicalString()+t.op.toString()+$(t.value)}(t)}).join(","),n+="|ob:",n+=e.orderBy.map(function(t){return function(t){return t.field.canonicalString()+t.dir}(t)}).join(","),B(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=Et(e.startAt)),e.endAt&&(n+="|ub:",n+=Et(e.endAt)),e.h=n}return e.h}function ft(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(!St(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)||!z(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!Dt(t.startAt,e.startAt)&&Dt(t.endAt,e.endAt)}function lt(t){return Q.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}var dt=function(t){function n(e,n,r){var i=this;return(i=t.call(this)||this).field=e,i.op=n,i.value=r,i}return(0,e.__extends)(n,t),n.create=function(t,e,r){return t.isKeyField()?"in"===e||"not-in"===e?this.l(t,e,r):new pt(t,e,r):"array-contains"===e?new gt(t,r):"in"===e?new _t(t,r):"not-in"===e?new wt(t,r):"array-contains-any"===e?new bt(t,r):new n(t,e,r)},n.l=function(t,e,n){return"in"===e?new yt(t,n):new vt(t,n)},n.prototype.matches=function(t){var e=t.data.field(this.field);return"!="===this.op?null!==e&&this.m(H(e,this.value)):null!==e&&G(this.value)===G(e)&&this.m(H(e,this.value))},n.prototype.m=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 y()}},n.prototype.g=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},n}(function(){}),pt=function(t){function n(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=Q.fromName(r.referenceValue),i}return(0,e.__extends)(n,t),n.prototype.matches=function(t){var e=Q.comparator(t.key,this.key);return this.m(e)},n}(dt),yt=function(t){function n(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=mt("in",n),r}return(0,e.__extends)(n,t),n.prototype.matches=function(t){return this.keys.some(function(e){return e.isEqual(t.key)})},n}(dt),vt=function(t){function n(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=mt("not-in",n),r}return(0,e.__extends)(n,t),n.prototype.matches=function(t){return!this.keys.some(function(e){return e.isEqual(t.key)})},n}(dt);function mt(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map(function(t){return Q.fromName(t.referenceValue)})}var gt=function(t){function n(e,n){return t.call(this,e,"array-contains",n)||this}return(0,e.__extends)(n,t),n.prototype.matches=function(t){var e=t.data.field(this.field);return tt(e)&&W(e.arrayValue,this.value)},n}(dt),_t=function(t){function n(e,n){return t.call(this,e,"in",n)||this}return(0,e.__extends)(n,t),n.prototype.matches=function(t){var e=t.data.field(this.field);return null!==e&&W(this.value.arrayValue,e)},n}(dt),wt=function(t){function n(e,n){return t.call(this,e,"not-in",n)||this}return(0,e.__extends)(n,t),n.prototype.matches=function(t){if(W(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.data.field(this.field);return null!==e&&!W(this.value.arrayValue,e)},n}(dt),bt=function(t){function n(e,n){return t.call(this,e,"array-contains-any",n)||this}return(0,e.__extends)(n,t),n.prototype.matches=function(t){var e=this,n=t.data.field(this.field);return!(!tt(n)||!n.arrayValue.values)&&n.arrayValue.values.some(function(t){return W(e.value.arrayValue,t)})},n}(dt),It=function(t,e){this.position=t,this.before=e};function Et(t){return(t.before?"b":"a")+":"+t.position.map(function(t){return $(t)}).join(",")}var Tt=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function St(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function Nt(t,e,n){for(var r=0,i=0;i<t.position.length;i++){var o=e[i],s=t.position[i];if(r=o.field.isKeyField()?Q.comparator(Q.fromName(s.referenceValue),n.key):H(s,n.data.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function Dt(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(!z(t.position[n],e.position[n]))return!1;return!0}var At=function(t,e,n,r,i,o,s,a){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===s&&(s=null),void 0===a&&(a=null),this.path=t,this.collectionGroup=e,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=s,this.endAt=a,this.p=null,this.T=null,this.startAt,this.endAt};function xt(t,e,n,r,i,o,s,a){return new At(t,e,n,r,i,o,s,a)}function kt(t){return new At(t)}function Ct(t){return!B(t.limit)&&"F"===t.limitType}function Rt(t){return!B(t.limit)&&"L"===t.limitType}function Lt(t){return t.explicitOrderBy.length>0?t.explicitOrderBy[0].field:null}function Ot(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.g())return r.field}return null}function Pt(t){return null!==t.collectionGroup}function Ft(t){var e=m(t);if(null===e.p){e.p=[];var n=Ot(e),r=Lt(e);if(null!==n&&null===r)n.isKeyField()||e.p.push(new Tt(n)),e.p.push(new Tt(C.keyField(),"asc"));else{for(var i=!1,o=0,s=e.explicitOrderBy;o<s.length;o++){var a=s[o];e.p.push(a),a.field.isKeyField()&&(i=!0)}if(!i){var u=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.p.push(new Tt(C.keyField(),u))}}}return e.p}function Mt(t){var e=m(t);if(!e.T)if("F"===e.limitType)e.T=ct(e.path,e.collectionGroup,Ft(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=Ft(e);r<i.length;r++){var o=i[r],s="desc"===o.dir?"asc":"desc";n.push(new Tt(o.field,s))}var a=e.endAt?new It(e.endAt.position,!e.endAt.before):null,u=e.startAt?new It(e.startAt.position,!e.startAt.before):null;e.T=ct(e.path,e.collectionGroup,n,e.filters,e.limit,a,u)}return e.T}function Vt(t,e,n){return new At(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function qt(t,e){return ft(Mt(t),Mt(e))&&t.limitType===e.limitType}function Ut(t){return ht(Mt(t))+"|lt:"+t.limitType}function Bt(t){return"Query(target="+function(t){var e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=", filters: ["+t.filters.map(function(t){return(e=t).field.canonicalString()+" "+e.op+" "+$(e.value);var e}).join(", ")+"]"),B(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=", orderBy: ["+t.orderBy.map(function(t){return function(t){return t.field.canonicalString()+" ("+t.dir+")"}(t)}).join(", ")+"]"),t.startAt&&(e+=", startAt: "+Et(t.startAt)),t.endAt&&(e+=", endAt: "+Et(t.endAt)),"Target("+e+")"}(Mt(t))+"; limitType="+t.limitType+")"}function jt(t,e){return e.isFoundDocument()&&function(t,e){var n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):Q.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(var n=0,r=t.explicitOrderBy;n<r.length;n++){var i=r[n];if(!i.field.isKeyField()&&null===e.data.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&&!Nt(t.startAt,Ft(t),e)||t.endAt&&Nt(t.endAt,Ft(t),e))}(t,e)}function Kt(t){return function(e,n){for(var r=!1,i=0,o=Ft(t);i<o.length;i++){var s=o[i],a=Qt(s,e,n);if(0!==a)return a;r=r||s.field.isKeyField()}return 0}}function Qt(t,e,n){var r=t.field.isKeyField()?Q.comparator(e.key,n.key):function(t,e,n){var r=e.data.field(t),i=n.data.field(t);return null!==r&&null!==i?H(r,i):y()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return y()}}function Gt(t,e){if(t.I){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:j(e)?"-0":e}}function zt(t){return{integerValue:""+t}}function Wt(t,e){return K(e)?zt(e):Gt(t,e)}var Ht=function(){this._=void 0};function Yt(t,e,n){return t instanceof Jt?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 Zt?te(t,e):t instanceof ee?ne(t,e):function(t,e){var n=Xt(t,e),r=ie(n)+ie(t.A);return Z(n)&&Z(t.A)?zt(r):Gt(t.R,r)}(t,e)}function $t(t,e,n){return t instanceof Zt?te(t,e):t instanceof ee?ne(t,e):n}function Xt(t,e){return t instanceof re?Z(n=e)||n&&"doubleValue"in n?e:{integerValue:0}:null;var n}var Jt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n}(Ht),Zt=function(t){function n(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,e.__extends)(n,t),n}(Ht);function te(t,e){for(var n=oe(e),r=function(t){n.some(function(e){return z(e,t)})||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var ee=function(t){function n(e){var n=this;return(n=t.call(this)||this).elements=e,n}return(0,e.__extends)(n,t),n}(Ht);function ne(t,e){for(var n=oe(e),r=function(t){n=n.filter(function(e){return!z(e,t)})},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var re=function(t){function n(e,n){var r=this;return(r=t.call(this)||this).R=e,r.A=n,r}return(0,e.__extends)(n,t),n}(Ht);function ie(t){return F(t.integerValue||t.doubleValue)}function oe(t){return tt(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var se=function(t,e){this.field=t,this.transform=e},ae=function(t,e){this.version=t,this.transformResults=e},ue=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.none=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,"isNone",{get:function(){return void 0===this.updateTime&&void 0===this.exists},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 ce(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}var he=function(){};function fe(t,e,n){t instanceof ve?function(t,e,n){var r=t.value.clone(),i=_e(t.fieldTransforms,e,n.transformResults);r.setAll(i),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):t instanceof me?function(t,e,n){if(ce(t.precondition,e)){var r=_e(t.fieldTransforms,e,n.transformResults),i=e.data;i.setAll(ge(t)),i.setAll(r),e.convertToFoundDocument(n.version,i).setHasCommittedMutations()}else e.convertToUnknownDocument(n.version)}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function le(t,e,n){t instanceof ve?function(t,e,n){if(ce(t.precondition,e)){var r=t.value.clone(),i=we(t.fieldTransforms,n,e);r.setAll(i),e.convertToFoundDocument(ye(e),r).setHasLocalMutations()}}(t,e,n):t instanceof me?function(t,e,n){if(ce(t.precondition,e)){var r=we(t.fieldTransforms,n,e),i=e.data;i.setAll(ge(t)),i.setAll(r),e.convertToFoundDocument(ye(e),i).setHasLocalMutations()}}(t,e,n):function(t,e){ce(t.precondition,e)&&e.convertToNoDocument(T.min())}(t,e)}function de(t,e){for(var n=null,r=0,i=t.fieldTransforms;r<i.length;r++){var o=i[r],s=e.data.field(o.field),a=Xt(o.transform,s||null);null!=a&&(null==n&&(n=ot.empty()),n.set(o.field,a))}return n||null}function pe(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&b(t,e,function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Zt&&e instanceof Zt||t instanceof ee&&e instanceof ee?b(t.elements,e.elements,z):t instanceof re&&e instanceof re?z(t.A,e.A):t instanceof Jt&&e instanceof Jt}(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.fieldMask.isEqual(e.fieldMask))}function ye(t){return t.isFoundDocument()?t.version:T.min()}var ve=function(t){function n(e,n,r,i){void 0===i&&(i=[]);var o=this;return(o=t.call(this)||this).key=e,o.value=n,o.precondition=r,o.fieldTransforms=i,o.type=0,o}return(0,e.__extends)(n,t),n}(he),me=function(t){function n(e,n,r,i,o){void 0===o&&(o=[]);var s=this;return(s=t.call(this)||this).key=e,s.data=n,s.fieldMask=r,s.precondition=i,s.fieldTransforms=o,s.type=1,s}return(0,e.__extends)(n,t),n}(he);function ge(t){var e=new Map;return t.fieldMask.fields.forEach(function(n){if(!n.isEmpty()){var r=t.data.field(n);e.set(n,r)}}),e}function _e(t,e,n){var r=new Map;v(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],s=o.transform,a=e.data.field(o.field);r.set(o.field,$t(s,a,n[i]))}return r}function we(t,e,n){for(var r=new Map,i=0,o=t;i<o.length;i++){var s=o[i],a=s.transform,u=n.data.field(s.field);r.set(s.field,Yt(a,u,e))}return r}var be,Ie,Ee=function(t){function n(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=2,r.fieldTransforms=[],r}return(0,e.__extends)(n,t),n}(he),Te=function(t){function n(e,n){var r=this;return(r=t.call(this)||this).key=e,r.precondition=n,r.type=3,r.fieldTransforms=[],r}return(0,e.__extends)(n,t),n}(he),Se=function(t){this.count=t};function Ne(t){switch(t){case a.OK:return y();case a.CANCELLED:case a.UNKNOWN:case a.DEADLINE_EXCEEDED:case a.RESOURCE_EXHAUSTED:case a.INTERNAL:case a.UNAVAILABLE:case a.UNAUTHENTICATED:return!1;case a.INVALID_ARGUMENT:case a.NOT_FOUND:case a.ALREADY_EXISTS:case a.PERMISSION_DENIED:case a.FAILED_PRECONDITION:case a.ABORTED:case a.OUT_OF_RANGE:case a.UNIMPLEMENTED:case a.DATA_LOSS:return!0;default:return y()}}function De(t){if(void 0===t)return l("GRPC error has no .code"),a.UNKNOWN;switch(t){case be.OK:return a.OK;case be.CANCELLED:return a.CANCELLED;case be.UNKNOWN:return a.UNKNOWN;case be.DEADLINE_EXCEEDED:return a.DEADLINE_EXCEEDED;case be.RESOURCE_EXHAUSTED:return a.RESOURCE_EXHAUSTED;case be.INTERNAL:return a.INTERNAL;case be.UNAVAILABLE:return a.UNAVAILABLE;case be.UNAUTHENTICATED:return a.UNAUTHENTICATED;case be.INVALID_ARGUMENT:return a.INVALID_ARGUMENT;case be.NOT_FOUND:return a.NOT_FOUND;case be.ALREADY_EXISTS:return a.ALREADY_EXISTS;case be.PERMISSION_DENIED:return a.PERMISSION_DENIED;case be.FAILED_PRECONDITION:return a.FAILED_PRECONDITION;case be.ABORTED:return a.ABORTED;case be.OUT_OF_RANGE:return a.OUT_OF_RANGE;case be.UNIMPLEMENTED:return a.UNIMPLEMENTED;case be.DATA_LOSS:return a.DATA_LOSS;default:return y()}}(Ie=be||(be={}))[Ie.OK=0]="OK",Ie[Ie.CANCELLED=1]="CANCELLED",Ie[Ie.UNKNOWN=2]="UNKNOWN",Ie[Ie.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Ie[Ie.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Ie[Ie.NOT_FOUND=5]="NOT_FOUND",Ie[Ie.ALREADY_EXISTS=6]="ALREADY_EXISTS",Ie[Ie.PERMISSION_DENIED=7]="PERMISSION_DENIED",Ie[Ie.UNAUTHENTICATED=16]="UNAUTHENTICATED",Ie[Ie.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Ie[Ie.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Ie[Ie.ABORTED=10]="ABORTED",Ie[Ie.OUT_OF_RANGE=11]="OUT_OF_RANGE",Ie[Ie.UNIMPLEMENTED=12]="UNIMPLEMENTED",Ie[Ie.INTERNAL=13]="INTERNAL",Ie[Ie.UNAVAILABLE=14]="UNAVAILABLE",Ie[Ie.DATA_LOSS=15]="DATA_LOSS";var Ae=function(){function t(t,e){this.comparator=t,this.root=e||ke.EMPTY}return t.prototype.insert=function(e,n){return new t(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,ke.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,ke.BLACK,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.isEmpty();){var n=this.comparator(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.isEmpty();){var r=this.comparator(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.isEmpty=function(){return this.root.isEmpty()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),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.forEach=function(t){this.inorderTraversal(function(e,n){return t(e,n),!1})},t.prototype.toString=function(){var t=[];return this.inorderTraversal(function(e,n){return t.push(e+":"+n),!1}),"{"+t.join(", ")+"}"},t.prototype.reverseTraversal=function(t){return this.root.reverseTraversal(t)},t.prototype.getIterator=function(){return new xe(this.root,null,this.comparator,!1)},t.prototype.getIteratorFrom=function(t){return new xe(this.root,t,this.comparator,!1)},t.prototype.getReverseIterator=function(){return new xe(this.root,null,this.comparator,!0)},t.prototype.getReverseIteratorFrom=function(t){return new xe(this.root,t,this.comparator,!0)},t}(),xe=function(){function t(t,e,n,r){this.isReverse=r,this.nodeStack=[];for(var i=1;!t.isEmpty();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}return t.prototype.getNext=function(){var t=this.nodeStack.pop(),e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e},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{key:t.key,value:t.value}},t}(),ke=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.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 t.EMPTY;var e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===n(e,i.key)){if(i.right.isEmpty())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.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.size+1},t.prototype.check=function(){if(this.isRed()&&this.left.isRed())throw y();if(this.right.isRed())throw y();var t=this.left.check();if(t!==this.right.check())throw y();return t+(this.isRed()?0:1)},t}();ke.EMPTY=null,ke.RED=!0,ke.BLACK=!1,ke.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw y()},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new ke(t,e)},t.prototype.remove=function(t,e){return this},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.isRed=function(){return!1},t.prototype.checkMaxDepth=function(){return!0},t.prototype.check=function(){return 0},t}());var Ce=function(){function t(t){this.comparator=t,this.data=new Ae(this.comparator)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.minKey()},t.prototype.last=function(){return this.data.maxKey()},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.inorderTraversal(function(e,n){return t(e),!1})},t.prototype.forEachInRange=function(t,e){for(var n=this.data.getIteratorFrom(t[0]);n.hasNext();){var r=n.getNext();if(this.comparator(r.key,t[1])>=0)return;e(r.key)}},t.prototype.forEachWhile=function(t,e){var n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return},t.prototype.firstAfterOrEqual=function(t){var e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null},t.prototype.getIterator=function(){return new Re(this.data.getIterator())},t.prototype.getIteratorFrom=function(t){return new Re(this.data.getIteratorFrom(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).insert(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.isEmpty=function(){return this.data.isEmpty()},t.prototype.unionWith=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.getIterator(),r=e.data.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0},t.prototype.toArray=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.comparator);return n.data=e,n},t}(),Re=function(){function t(t){this.iter=t}return t.prototype.getNext=function(){return this.iter.getNext().key},t.prototype.hasNext=function(){return this.iter.hasNext()},t}(),Le=new Ae(Q.comparator);function Oe(){return Le}var Pe=new Ae(Q.comparator);function Fe(){return Pe}var Me=new Ae(Q.comparator);function Ve(){return Me}var qe=new Ce(Q.comparator);function Ue(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=qe,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var Be=new Ce(w);function je(){return Be}var Ke=function(){function t(t,e,n,r,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}return t.createSynthesizedRemoteEventForCurrentChange=function(e,n){var r=new Map;return r.set(e,Qe.createSynthesizedTargetChangeForCurrentChange(e,n)),new t(T.min(),r,je(),Oe(),Ue())},t}(),Qe=function(){function t(t,e,n,r,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}return t.createSynthesizedTargetChangeForCurrentChange=function(e,n){return new t(L.EMPTY_BYTE_STRING,n,Ue(),Ue(),Ue())},t}(),Ge=function(t,e,n,r){this.v=t,this.removedTargetIds=e,this.key=n,this.P=r},ze=function(t,e){this.targetId=t,this.V=e},We=function(t,e,n,r){void 0===n&&(n=L.EMPTY_BYTE_STRING),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},He=function(){function t(){this.S=0,this.D=Xe(),this.C=L.EMPTY_BYTE_STRING,this.N=!1,this.k=!0}return Object.defineProperty(t.prototype,"current",{get:function(){return this.N},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"F",{get:function(){return 0!==this.S},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"$",{get:function(){return this.k},enumerable:!1,configurable:!0}),t.prototype.O=function(t){t.approximateByteSize()>0&&(this.k=!0,this.C=t)},t.prototype.M=function(){var t=Ue(),e=Ue(),n=Ue();return this.D.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:y()}}),new Qe(this.C,this.N,t,e,n)},t.prototype.L=function(){this.k=!1,this.D=Xe()},t.prototype.B=function(t,e){this.k=!0,this.D=this.D.insert(t,e)},t.prototype.q=function(t){this.k=!0,this.D=this.D.remove(t)},t.prototype.U=function(){this.S+=1},t.prototype.K=function(){this.S-=1},t.prototype.j=function(){this.k=!0,this.N=!0},t}(),Ye=function(){function t(t){this.W=t,this.G=new Map,this.H=Oe(),this.J=$e(),this.Y=new Ce(w)}return t.prototype.X=function(t){for(var e=0,n=t.v;e<n.length;e++){var r=n[e];t.P&&t.P.isFoundDocument()?this.Z(r,t.P):this.tt(r,t.key,t.P)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)r=o[i],this.tt(r,t.key,t.P)},t.prototype.et=function(t){var e=this;this.forEachTarget(t,function(n){var r=e.nt(n);switch(t.state){case 0:e.st(n)&&r.O(t.resumeToken);break;case 1:r.K(),r.F||r.L(),r.O(t.resumeToken);break;case 2:r.K(),r.F||e.removeTarget(n);break;case 3:e.st(n)&&(r.j(),r.O(t.resumeToken));break;case 4:e.st(n)&&(e.it(n),r.O(t.resumeToken));break;default:y()}})},t.prototype.forEachTarget=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.G.forEach(function(t,r){n.st(r)&&e(r)})},t.prototype.rt=function(t){var e=t.targetId,n=t.V.count,r=this.ot(e);if(r){var i=r.target;if(lt(i))if(0===n){var o=new Q(i.path);this.tt(e,o,at.newNoDocument(o,T.min()))}else v(1===n);else this.ct(e)!==n&&(this.it(e),this.Y=this.Y.add(e))}},t.prototype.ut=function(t){var e=this,n=new Map;this.G.forEach(function(r,i){var o=e.ot(i);if(o){if(r.current&<(o.target)){var s=new Q(o.target.path);null!==e.H.get(s)||e.at(i,s)||e.tt(i,s,at.newNoDocument(s,t))}r.$&&(n.set(i,r.M()),r.L())}});var r=Ue();this.J.forEach(function(t,n){var i=!0;n.forEachWhile(function(t){var n=e.ot(t);return!n||2===n.purpose||(i=!1,!1)}),i&&(r=r.add(t))});var i=new Ke(t,n,this.Y,this.H,r);return this.H=Oe(),this.J=$e(),this.Y=new Ce(w),i},t.prototype.Z=function(t,e){if(this.st(t)){var n=this.at(t,e.key)?2:0;this.nt(t).B(e.key,n),this.H=this.H.insert(e.key,e),this.J=this.J.insert(e.key,this.ht(e.key).add(t))}},t.prototype.tt=function(t,e,n){if(this.st(t)){var r=this.nt(t);this.at(t,e)?r.B(e,1):r.q(e),this.J=this.J.insert(e,this.ht(e).delete(t)),n&&(this.H=this.H.insert(e,n))}},t.prototype.removeTarget=function(t){this.G.delete(t)},t.prototype.ct=function(t){var e=this.nt(t).M();return this.W.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size},t.prototype.U=function(t){this.nt(t).U()},t.prototype.nt=function(t){var e=this.G.get(t);return e||(e=new He,this.G.set(t,e)),e},t.prototype.ht=function(t){var e=this.J.get(t);return e||(e=new Ce(w),this.J=this.J.insert(t,e)),e},t.prototype.st=function(t){var e=null!==this.ot(t);return e||f("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.ot=function(t){var e=this.G.get(t);return e&&e.F?null:this.W.lt(t)},t.prototype.it=function(t){var e=this;this.G.set(t,new He),this.W.getRemoteKeysForTarget(t).forEach(function(n){e.tt(t,n,null)})},t.prototype.at=function(t,e){return this.W.getRemoteKeysForTarget(t).has(e)},t}();function $e(){return new Ae(Q.comparator)}function Xe(){return new Ae(Q.comparator)}var Je={asc:"ASCENDING",desc:"DESCENDING"},Ze={"<":"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"},tn=function(t,e){this.databaseId=t,this.I=e};function en(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function nn(t,e){return t.I?e.toBase64():e.toUint8Array()}function rn(t,e){return en(t,e.toTimestamp())}function on(t){return v(!!t),T.fromTimestamp(function(t){var e=P(t);return new E(e.seconds,e.nanos)}(t))}function sn(t,e){return function(t){return new x(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function an(t){var e=x.fromString(t);return v(Cn(e)),e}function un(t,e){return sn(t.databaseId,e.path)}function cn(t,e){var n=an(e);if(n.get(1)!==t.databaseId.projectId)throw new u(a.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new u(a.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new Q(dn(n))}function hn(t,e){return sn(t.databaseId,e)}function fn(t){var e=an(t);return 4===e.length?x.emptyPath():dn(e)}function ln(t){return new x(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function dn(t){return v(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function pn(t,e,n){return{name:un(t,e),fields:n.value.mapValue.fields}}function yn(t,e,n){var r=cn(t,e.name),i=on(e.updateTime),o=new ot({mapValue:{fields:e.fields}}),s=at.newFoundDocument(r,i,o);return n&&s.setHasCommittedMutations(),n?s.setHasCommittedMutations():s}function vn(t,e){var n;if(e instanceof ve)n={update:pn(t,e.key,e.value)};else if(e instanceof Ee)n={delete:un(t,e.key)};else if(e instanceof me)n={update:pn(t,e.key,e.data),updateMask:kn(e.fieldMask)};else{if(!(e instanceof Te))return y();n={verify:un(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 Jt)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Zt)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof ee)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof re)return{fieldPath:e.field.canonicalString(),increment:n.A};throw y()}(0,t)})),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:rn(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:y()}(t,e.precondition)),n}function mn(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?ue.updateTime(on(t.updateTime)):void 0!==t.exists?ue.exists(t.exists):ue.none()}(e.currentDocument):ue.none(),r=e.updateTransforms?e.updateTransforms.map(function(e){return function(t,e){var n=null;if("setToServerValue"in e)v("REQUEST_TIME"===e.setToServerValue),n=new Jt;else if("appendMissingElements"in e){var r=e.appendMissingElements.values||[];n=new Zt(r)}else if("removeAllFromArray"in e){var i=e.removeAllFromArray.values||[];n=new ee(i)}else"increment"in e?n=new re(t,e.increment):y();var o=C.fromServerFormat(e.fieldPath);return new se(o,n)}(t,e)}):[];if(e.update){e.update.name;var i=cn(t,e.update.name),o=new ot({mapValue:{fields:e.update.fields}});if(e.updateMask){var s=function(t){var e=t.fieldPaths||[];return new R(e.map(function(t){return C.fromServerFormat(t)}))}(e.updateMask);return new me(i,o,s,n,r)}return new ve(i,o,n,r)}if(e.delete){var a=cn(t,e.delete);return new Ee(a,n)}if(e.verify){var u=cn(t,e.verify);return new Te(u,n)}return y()}function gn(t,e){return{documents:[hn(t,e.path)]}}function _n(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=hn(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=hn(t,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);var i=function(t){if(0!==t.length){var e=t.map(function(t){return function(t){if("=="===t.op){if(nt(t.value))return{unaryFilter:{field:Nn(t.field),op:"IS_NAN"}};if(et(t.value))return{unaryFilter:{field:Nn(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(nt(t.value))return{unaryFilter:{field:Nn(t.field),op:"IS_NOT_NAN"}};if(et(t.value))return{unaryFilter:{field:Nn(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Nn(t.field),op:Sn(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:Nn(t.field),direction:Tn(t.dir)}}(t)})}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var s=function(t,e){return t.I||B(e)?e:{value:e}}(t,e.limit);return null!==s&&(n.structuredQuery.limit=s),e.startAt&&(n.structuredQuery.startAt=In(e.startAt)),e.endAt&&(n.structuredQuery.endAt=In(e.endAt)),n}function wn(t){var e=fn(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){v(1===r);var s=n.from[0];s.allDescendants?i=s.collectionId:e=e.child(s.collectionId)}var a=[];n.where&&(a=bn(n.where));var u=[];n.orderBy&&(u=n.orderBy.map(function(t){return function(t){return new Tt(Dn(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t)}));var c=null;n.limit&&(c=function(t){var e;return B(e="object"==o(t)?t.value:t)?null:e}(n.limit));var h=null;n.startAt&&(h=En(n.startAt));var f=null;return n.endAt&&(f=En(n.endAt)),xt(e,i,u,a,c,"F",h,f)}function bn(t){return t?void 0!==t.unaryFilter?[xn(t)]:void 0!==t.fieldFilter?[An(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map(function(t){return bn(t)}).reduce(function(t,e){return t.concat(e)}):y():[]}function In(t){return{before:t.before,values:t.position}}function En(t){var e=!!t.before,n=t.values||[];return new It(n,e)}function Tn(t){return Je[t]}function Sn(t){return Ze[t]}function Nn(t){return{fieldPath:t.canonicalString()}}function Dn(t){return C.fromServerFormat(t.fieldPath)}function An(t){return dt.create(Dn(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 y()}}(t.fieldFilter.op),t.fieldFilter.value)}function xn(t){switch(t.unaryFilter.op){case"IS_NAN":var e=Dn(t.unaryFilter.field);return dt.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=Dn(t.unaryFilter.field);return dt.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=Dn(t.unaryFilter.field);return dt.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=Dn(t.unaryFilter.field);return dt.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return y()}}function kn(t){var e=[];return t.fields.forEach(function(t){return e.push(t.canonicalString())}),{fieldPaths:e}}function Cn(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}function Rn(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=On(e)),e=Ln(t.get(n),e);return On(e)}function Ln(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="";break;case"":n+="";break;default:n+=o}}return n}function On(t){return t+""}function Pn(t){var e=t.length;if(v(e>=2),2===e)return v(""===t.charAt(0)&&""===t.charAt(1)),x.emptyPath();for(var n=e-2,r=[],i="",o=0;o<e;){var s=t.indexOf("",o);switch((s<0||s>n)&&y(),t.charAt(s+1)){case"":var a=t.substring(o,s),u=void 0;0===i.length?u=a:(u=i+=a,i=""),r.push(u);break;case"":i+=t.substring(o,s),i+="\0";break;case"":i+=t.substring(o,s+1);break;default:y()}o=s+2}return new x(r)}var Fn=function(t,e){this.seconds=t,this.nanoseconds=e},Mn=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};Mn.store="owner",Mn.key="owner";var Vn=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};Vn.store="mutationQueues",Vn.keyPath="userId";var qn=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};qn.store="mutations",qn.keyPath="batchId",qn.userMutationsIndex="userMutationsIndex",qn.userMutationsKeyPath=["userId","batchId"];var Un=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,Rn(e)]},t.key=function(t,e,n){return[t,Rn(e),n]},t}();Un.store="documentMutations",Un.PLACEHOLDER=new Un;var Bn=function(t,e){this.path=t,this.readTime=e},jn=function(t,e){this.path=t,this.version=e},Kn=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};Kn.store="remoteDocuments",Kn.readTimeIndex="readTimeIndex",Kn.readTimeIndexPath="readTime",Kn.collectionReadTimeIndex="collectionReadTimeIndex",Kn.collectionReadTimeIndexPath=["parentPath","readTime"];var Qn=function(t){this.byteSize=t};Qn.store="remoteDocumentGlobal",Qn.key="remoteDocumentGlobalKey";var Gn=function(t,e,n,r,i,o,s){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=s};Gn.store="targets",Gn.keyPath="targetId",Gn.queryTargetsIndexName="queryTargetsIndex",Gn.queryTargetsKeyPath=["canonicalId","targetId"];var zn=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};zn.store="targetDocuments",zn.keyPath=["targetId","path"],zn.documentTargetsIndex="documentTargetsIndex",zn.documentTargetsKeyPath=["path","targetId"];var Wn=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};Wn.key="targetGlobalKey",Wn.store="targetGlobal";var Hn=function(t,e){this.collectionId=t,this.parent=e};Hn.store="collectionParents",Hn.keyPath=["collectionId","parent"];var Yn=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};Yn.store="clientMetadata",Yn.keyPath="clientId";var $n=function(t,e,n){this.bundleId=t,this.createTime=e,this.version=n};$n.store="bundles",$n.keyPath="bundleId";var Xn=function(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n};Xn.store="namedQueries",Xn.keyPath="name";var Jn=(0,e.__spreadArray)((0,e.__spreadArray)([],(0,e.__spreadArray)((0,e.__spreadArray)([],(0,e.__spreadArray)((0,e.__spreadArray)([],(0,e.__spreadArray)((0,e.__spreadArray)([],[Vn.store,qn.store,Un.store,Kn.store,Gn.store,Mn.store,Wn.store,zn.store]),[Yn.store])),[Qn.store])),[Hn.store])),[$n.store,Xn.store]),Zn="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",tr=function(){function t(){this.onCommittedListeners=[]}return t.prototype.addOnCommittedListener=function(t){this.onCommittedListeners.push(t)},t.prototype.raiseOnCommittedEvent=function(){this.onCommittedListeners.forEach(function(t){return t()})},t}(),er=function(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})},nr=function(){function t(t){var e=this;this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t(function(t){e.isDone=!0,e.result=t,e.nextCallback&&e.nextCallback(t)},function(t){e.isDone=!0,e.error=t,e.catchCallback&&e.catchCallback(t)})}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.callbackAttached&&y(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new t(function(t,i){r.nextCallback=function(n){r.wrapSuccess(e,n).next(t,i)},r.catchCallback=function(e){r.wrapFailure(n,e).next(t,i)}})},t.prototype.toPromise=function(){var t=this;return new Promise(function(e,n){t.next(e,n)})},t.prototype.wrapUserFunction=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.wrapSuccess=function(e,n){return e?this.wrapUserFunction(function(){return e(n)}):t.resolve(n)},t.prototype.wrapFailure=function(e,n){return e?this.wrapUserFunction(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.waitFor=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.or=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.waitFor(r)},t}(),rr=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.ft=new er,this.transaction.oncomplete=function(){n.ft.resolve()},this.transaction.onabort=function(){e.error?n.ft.reject(new sr(t,e.error)):n.ft.resolve()},this.transaction.onerror=function(e){var r=fr(e.target.error);n.ft.reject(new sr(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new sr(n,e)}},Object.defineProperty(t.prototype,"dt",{get:function(){return this.ft.promise},enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.ft.reject(t),this.aborted||(f("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 ur(e)},t}(),ir=function(){function r(t,e,i){this.name=t,this.version=e,this.wt=i,12.2===r._t((0,n.getUA)())&&l("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 r.delete=function(t){return f("SimpleDb","Removing database:",t),cr(window.indexedDB.deleteDatabase(t)).toPromise()},r.yt=function(){if("undefined"==typeof indexedDB)return!1;if(r.gt())return!0;var t=(0,n.getUA)(),e=r._t(t),i=0<e&&e<10,o=r.Et(t),s=0<o&&o<4.5;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||i||s)},r.gt=function(){var e;return void 0!==t&&"YES"===(null===(e=t.env)||void 0===e?void 0:e.Tt)},r.It=function(t,e){return t.store(e)},r._t=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)},r.Et=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},r.prototype.At=function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n,r=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.db?[3,2]:(f("SimpleDb","Opening database:",this.name),n=this,[4,new Promise(function(e,n){var i=indexedDB.open(r.name,r.version);i.onsuccess=function(t){var n=t.target.result;e(n)},i.onblocked=function(){n(new sr(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 r=e.target.error;"VersionError"===r.name?n(new u(a.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.")):n(new sr(t,r))},i.onupgradeneeded=function(t){f("SimpleDb",'Database "'+r.name+'" requires upgrade from version:',t.oldVersion);var e=t.target.result;r.wt.Rt(e,i.transaction,t.oldVersion,r.version).next(function(){f("SimpleDb","Database upgrade to version "+r.version+" complete")})}})]);case 1:n.db=e.sent(),e.label=2;case 2:return[2,(this.bt&&(this.db.onversionchange=function(t){return r.bt(t)}),this.db)]}})})},r.prototype.vt=function(t){this.bt=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},r.prototype.runTransaction=function(t,n,r,i){return(0,e.__awaiter)(this,void 0,void 0,function(){var s,a,u,c,h;return(0,e.__generator)(this,function(l){switch(l.label){case 0:s="readonly"===n,a=0,u=function(){var n,o,u,h,l;return(0,e.__generator)(this,function(e){switch(e.label){case 0:++a,e.label=1;case 1:return e.trys.push([1,4,,5]),[4,c.At(t)];case 2:return c.db=e.sent(),n=rr.open(c.db,t,s?"readonly":"readwrite",r),o=i(n).catch(function(t){return n.abort(t),nr.reject(t)}).toPromise(),u={},o.catch(function(){}),[4,n.dt];case 3:return[2,(u.value=(e.sent(),o),u)];case 4:return h=e.sent(),l="FirebaseError"!==h.name&&a<3,f("SimpleDb","Transaction failed with error:",h.message,"Retrying:",l),c.close(),l?[3,5]:[2,{value:Promise.reject(h)}];case 5:return[2]}})},c=this,l.label=1;case 1:return[5,u()];case 2:if("object"==o(h=l.sent()))return[2,h.value];l.label=3;case 3:return[3,1];case 4:return[2]}})})},r.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},r}(),or=function(){function t(t){this.Pt=t,this.Vt=!1,this.St=null}return Object.defineProperty(t.prototype,"isDone",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Dt",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.Vt=!0},t.prototype.Ct=function(t){this.St=t},t.prototype.delete=function(){return cr(this.Pt.delete())},t}(),sr=function(t){function n(e,n){var r=this;return(r=t.call(this,a.UNAVAILABLE,"IndexedDB transaction '"+e+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return(0,e.__extends)(n,t),n}(u);function ar(t){return"IndexedDbTransactionError"===t.name}var ur=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(f("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(f("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),cr(n)},t.prototype.add=function(t){return f("SimpleDb","ADD",this.store.name,t,t),cr(this.store.add(t))},t.prototype.get=function(t){var e=this;return cr(this.store.get(t)).next(function(n){return void 0===n&&(n=null),f("SimpleDb","GET",e.store.name,t,n),n})},t.prototype.delete=function(t){return f("SimpleDb","DELETE",this.store.name,t),cr(this.store.delete(t))},t.prototype.count=function(){return f("SimpleDb","COUNT",this.store.name),cr(this.store.count())},t.prototype.Nt=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.xt(n,function(t,e){r.push(e)}).next(function(){return r})},t.prototype.kt=function(t,e){f("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.Ft=!1;var r=this.cursor(n);return this.xt(r,function(t,e,n){return n.delete()})},t.prototype.$t=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.xt(r,e)},t.prototype.Ot=function(t){var e=this.cursor({});return new nr(function(n,r){e.onerror=function(t){var e=fr(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.xt=function(t,e){var n=[];return new nr(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 or(i),s=e(i.primaryKey,i.value,o);if(s instanceof nr){var a=s.catch(function(t){return o.done(),nr.reject(t)});n.push(a)}o.isDone?r():null===o.Dt?i.continue():i.continue(o.Dt)}else r()}}).next(function(){return nr.waitFor(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.Ft?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function cr(t){return new nr(function(e,n){t.onsuccess=function(t){var n=t.target.result;e(n)},t.onerror=function(t){var e=fr(t.target.error);n(e)}})}var hr=!1;function fr(t){var e=ir._t((0,n.getUA)());if(e>=12.2&&e<13){var r="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(r)>=0){var i=new u("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+r+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return hr||(hr=!0,setTimeout(function(){throw i},0)),i}}return t}var lr=function(t){function n(e,n){var r=this;return(r=t.call(this)||this).Mt=e,r.currentSequenceNumber=n,r}return(0,e.__extends)(n,t),n}(tr);function dr(t,e){var n=m(t);return ir.It(n.Mt,e)}var pr=function(){function t(t,e,n,r){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=r}return t.prototype.applyToRemoteDocument=function(t,e){for(var n=e.mutationResults,r=0;r<this.mutations.length;r++){var i=this.mutations[r];i.key.isEqual(t.key)&&fe(i,t,n[r])}},t.prototype.applyToLocalView=function(t){for(var e=0,n=this.baseMutations;e<n.length;e++)(o=n[e]).key.isEqual(t.key)&&le(o,t,this.localWriteTime);for(var r=0,i=this.mutations;r<i.length;r++){var o;(o=i[r]).key.isEqual(t.key)&&le(o,t,this.localWriteTime)}},t.prototype.applyToLocalDocumentSet=function(t){var e=this;this.mutations.forEach(function(n){var r=t.get(n.key),i=r;e.applyToLocalView(i),r.isValidDocument()||i.convertToNoDocument(T.min())})},t.prototype.keys=function(){return this.mutations.reduce(function(t,e){return t.add(e.key)},Ue())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&b(this.mutations,t.mutations,function(t,e){return pe(t,e)})&&b(this.baseMutations,t.baseMutations,function(t,e){return pe(t,e)})},t}(),yr=function(){function t(t,e,n,r){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=r}return t.from=function(e,n,r){v(e.mutations.length===r.length);for(var i=Ve(),o=e.mutations,s=0;s<o.length;s++)i=i.insert(o[s].key,r[s].version);return new t(e,n,r,i)},t}(),vr=function(){function t(t,e,n,r,i,o,s){void 0===i&&(i=T.min()),void 0===o&&(o=T.min()),void 0===s&&(s=L.EMPTY_BYTE_STRING),this.target=t,this.targetId=e,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=s}return t.prototype.withSequenceNumber=function(e){return new t(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.withResumeToken=function(e,n){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.withLastLimboFreeSnapshotVersion=function(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken)},t}(),mr=function(t){this.Lt=t};function gr(t,e){if(e.document)return yn(t.Lt,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=Q.fromSegments(e.noDocument.path),r=Er(e.noDocument.readTime),i=at.newNoDocument(n,r);return e.hasCommittedMutations?i.setHasCommittedMutations():i}if(e.unknownDocument){var o=Q.fromSegments(e.unknownDocument.path);return r=Er(e.unknownDocument.version),at.newUnknownDocument(o,r)}return y()}function _r(t,e,n){var r=wr(n),i=e.key.path.popLast().toArray();if(e.isFoundDocument()){var o=function(t,e){return{name:un(t,e.key),fields:e.data.value.mapValue.fields,updateTime:en(t,e.version.toTimestamp())}}(t.Lt,e),s=e.hasCommittedMutations;return new Kn(null,null,o,s,r,i)}if(e.isNoDocument()){var a=e.key.path.toArray(),u=Ir(e.version);return s=e.hasCommittedMutations,new Kn(null,new Bn(a,u),null,s,r,i)}if(e.isUnknownDocument()){var c=e.key.path.toArray(),h=Ir(e.version);return new Kn(new jn(c,h),null,null,!0,r,i)}return y()}function wr(t){var e=t.toTimestamp();return[e.seconds,e.nanoseconds]}function br(t){var e=new E(t[0],t[1]);return T.fromTimestamp(e)}function Ir(t){var e=t.toTimestamp();return new Fn(e.seconds,e.nanoseconds)}function Er(t){var e=new E(t.seconds,t.nanoseconds);return T.fromTimestamp(e)}function Tr(t,e){for(var n=(e.baseMutations||[]).map(function(e){return mn(t.Lt,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 s=e.mutations.map(function(e){return mn(t.Lt,e)}),a=E.fromMillis(e.localWriteTimeMs);return new pr(e.batchId,a,n,s)}function Sr(t){var e,n,r=Er(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?Er(t.lastLimboFreeSnapshotVersion):T.min();return void 0!==t.query.documents?(v(1===(n=t.query).documents.length),e=Mt(kt(fn(n.documents[0])))):e=function(t){return Mt(wn(t))}(t.query),new vr(e,t.targetId,0,t.lastListenSequenceNumber,r,i,L.fromBase64String(t.resumeToken))}function Nr(t,e){var n,r=Ir(e.snapshotVersion),i=Ir(e.lastLimboFreeSnapshotVersion);n=lt(e.target)?gn(t.Lt,e.target):_n(t.Lt,e.target);var o=e.resumeToken.toBase64();return new Gn(e.targetId,ht(e.target),r,o,e.sequenceNumber,i,n)}function Dr(t){var e=wn({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Vt(e,e.limit,"L"):e}var Ar=function(){function t(){}return t.prototype.getBundleMetadata=function(t,e){return xr(t).get(e).next(function(t){if(t)return{id:(e=t).bundleId,createTime:Er(e.createTime),version:e.version};var e})},t.prototype.saveBundleMetadata=function(t,e){return xr(t).put({bundleId:(n=e).id,createTime:Ir(on(n.createTime)),version:n.version});var n},t.prototype.getNamedQuery=function(t,e){return kr(t).get(e).next(function(t){if(t)return{name:(e=t).name,query:Dr(e.bundledQuery),readTime:Er(e.readTime)};var e})},t.prototype.saveNamedQuery=function(t,e){return kr(t).put(function(t){return{name:t.name,readTime:Ir(on(t.readTime)),bundledQuery:t.bundledQuery}}(e))},t}();function xr(t){return dr(t,$n.store)}function kr(t){return dr(t,Xn.store)}var Cr=function(){function t(){this.Bt=new Rr}return t.prototype.addToCollectionParentIndex=function(t,e){return this.Bt.add(e),nr.resolve()},t.prototype.getCollectionParents=function(t,e){return nr.resolve(this.Bt.getEntries(e))},t}(),Rr=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e]||new Ce(x.comparator),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t.lastSegment(),n=t.popLast(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new Ce(x.comparator)).toArray()},t}(),Lr=function(){function t(){this.qt=new Rr}return t.prototype.addToCollectionParentIndex=function(t,e){var n=this;if(!this.qt.has(e)){var r=e.lastSegment(),i=e.popLast();t.addOnCommittedListener(function(){n.qt.add(e)});var o={collectionId:r,parent:Rn(i)};return Or(t).put(o)}return nr.resolve()},t.prototype.getCollectionParents=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[I(e),""],!1,!0);return Or(t).Nt(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(Pn(o.parent))}return n})},t}();function Or(t){return dr(t,Hn.store)}var Pr={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},Fr=function(){function t(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}return t.withCacheSize=function(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)},t}();function Mr(t,e,n){var r=t.store(qn.store),i=t.store(Un.store),o=[],s=IDBKeyRange.only(n.batchId),a=0,u=r.$t({range:s},function(t,e,n){return a++,n.delete()});o.push(u.next(function(){v(1===a)}));for(var c=[],h=0,f=n.mutations;h<f.length;h++){var l=f[h],d=Un.key(e,l.key.path,n.batchId);o.push(i.delete(d)),c.push(l.key)}return nr.waitFor(o).next(function(){return c})}function Vr(t){if(!t)return 0;var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw y();e=t.noDocument}return JSON.stringify(e).length}Fr.DEFAULT_COLLECTION_PERCENTILE=10,Fr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Fr.DEFAULT=new Fr(41943040,Fr.DEFAULT_COLLECTION_PERCENTILE,Fr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Fr.DISABLED=new Fr(-1,0,0);var qr=function(){function t(t,e,n,r){this.userId=t,this.R=e,this.Ut=n,this.referenceDelegate=r,this.Kt={}}return t.Qt=function(e,n,r,i){return v(""!==e.uid),new t(e.isAuthenticated()?e.uid:"",n,r,i)},t.prototype.checkEmpty=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Br(t).$t({index:qn.userMutationsIndex,range:n},function(t,n,r){e=!1,r.done()}).next(function(){return e})},t.prototype.addMutationBatch=function(t,e,n,r){var i=this,o=jr(t),s=Br(t);return s.add({}).next(function(a){v("number"==typeof a);for(var u=new pr(a,e,n,r),c=function(t,e,n){var r=n.baseMutations.map(function(e){return vn(t.Lt,e)}),i=n.mutations.map(function(e){return vn(t.Lt,e)});return new qn(e,n.batchId,n.localWriteTime.toMillis(),r,i)}(i.R,i.userId,u),h=[],f=new Ce(function(t,e){return w(t.canonicalString(),e.canonicalString())}),l=0,d=r;l<d.length;l++){var p=d[l],y=Un.key(i.userId,p.key.path,a);f=f.add(p.key.path.popLast()),h.push(s.put(c)),h.push(o.put(y,Un.PLACEHOLDER))}return f.forEach(function(e){h.push(i.Ut.addToCollectionParentIndex(t,e))}),t.addOnCommittedListener(function(){i.Kt[a]=u.keys()}),nr.waitFor(h).next(function(){return u})})},t.prototype.lookupMutationBatch=function(t,e){var n=this;return Br(t).get(e).next(function(t){return t?(v(t.userId===n.userId),Tr(n.R,t)):null})},t.prototype.jt=function(t,e){var n=this;return this.Kt[e]?nr.resolve(this.Kt[e]):this.lookupMutationBatch(t,e).next(function(t){if(t){var r=t.keys();return n.Kt[e]=r,r}return null})},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return Br(t).$t({index:qn.userMutationsIndex,range:i},function(t,e,i){e.userId===n.userId&&(v(e.batchId>=r),o=Tr(n.R,e)),i.done()}).next(function(){return o})},t.prototype.getHighestUnacknowledgedBatchId=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return Br(t).$t({index:qn.userMutationsIndex,range:e,reverse:!0},function(t,e,r){n=e.batchId,r.done()}).next(function(){return n})},t.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Br(t).Nt(qn.userMutationsIndex,n).next(function(t){return t.map(function(t){return Tr(e.R,t)})})},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=Un.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return jr(t).$t({range:i},function(r,i,s){var a=r[0],u=r[1],c=r[2],h=Pn(u);if(a===n.userId&&e.path.isEqual(h))return Br(t).get(c).next(function(t){if(!t)throw y();v(t.userId===n.userId),o.push(Tr(n.R,t))});s.done()}).next(function(){return o})},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Ce(w),i=[];return e.forEach(function(e){var o=Un.prefixForPath(n.userId,e.path),s=IDBKeyRange.lowerBound(o),a=jr(t).$t({range:s},function(t,i,o){var s=t[0],a=t[1],u=t[2],c=Pn(a);s===n.userId&&e.path.isEqual(c)?r=r.add(u):o.done()});i.push(a)}),nr.waitFor(i).next(function(){return n.Wt(t,r)})},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=this,r=e.path,i=r.length+1,o=Un.prefixForPath(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new Ce(w);return jr(t).$t({range:s},function(t,e,o){var s=t[0],u=t[1],c=t[2],h=Pn(u);s===n.userId&&r.isPrefixOf(h)?h.length===i&&(a=a.add(c)):o.done()}).next(function(){return n.Wt(t,a)})},t.prototype.Wt=function(t,e){var n=this,r=[],i=[];return e.forEach(function(e){i.push(Br(t).get(e).next(function(t){if(null===t)throw y();v(t.userId===n.userId),r.push(Tr(n.R,t))}))}),nr.waitFor(i).next(function(){return r})},t.prototype.removeMutationBatch=function(t,e){var n=this;return Mr(t.Mt,this.userId,e).next(function(r){return t.addOnCommittedListener(function(){n.Gt(e.batchId)}),nr.forEach(r,function(e){return n.referenceDelegate.markPotentiallyOrphaned(t,e)})})},t.prototype.Gt=function(t){delete this.Kt[t]},t.prototype.performConsistencyCheck=function(t){var e=this;return this.checkEmpty(t).next(function(n){if(!n)return nr.resolve();var r=IDBKeyRange.lowerBound(Un.prefixForUser(e.userId)),i=[];return jr(t).$t({range:r},function(t,n,r){if(t[0]===e.userId){var o=Pn(t[1]);i.push(o)}else r.done()}).next(function(){v(0===i.length)})})},t.prototype.containsKey=function(t,e){return Ur(t,this.userId,e)},t.prototype.zt=function(t){var e=this;return Kr(t).get(this.userId).next(function(t){return t||new Vn(e.userId,-1,"")})},t}();function Ur(t,e,n){var r=Un.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return jr(t).$t({range:o,Ft:!0},function(t,n,r){var o=t[0],a=t[1];t[2],o===e&&a===i&&(s=!0),r.done()}).next(function(){return s})}function Br(t){return dr(t,qn.store)}function jr(t){return dr(t,Un.store)}function Kr(t){return dr(t,Vn.store)}var Qr=function(){function t(t){this.Ht=t}return t.prototype.next=function(){return this.Ht+=2,this.Ht},t.Jt=function(){return new t(0)},t.Yt=function(){return new t(-1)},t}(),Gr=function(){function t(t,e){this.referenceDelegate=t,this.R=e}return t.prototype.allocateTargetId=function(t){var e=this;return this.Xt(t).next(function(n){var r=new Qr(n.highestTargetId);return n.highestTargetId=r.next(),e.Zt(t,n).next(function(){return n.highestTargetId})})},t.prototype.getLastRemoteSnapshotVersion=function(t){return this.Xt(t).next(function(t){return T.fromTimestamp(new E(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))})},t.prototype.getHighestSequenceNumber=function(t){return this.Xt(t).next(function(t){return t.highestListenSequenceNumber})},t.prototype.setTargetsMetadata=function(t,e,n){var r=this;return this.Xt(t).next(function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.toTimestamp()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.Zt(t,i)})},t.prototype.addTargetData=function(t,e){var n=this;return this.te(t,e).next(function(){return n.Xt(t).next(function(r){return r.targetCount+=1,n.ee(e,r),n.Zt(t,r)})})},t.prototype.updateTargetData=function(t,e){return this.te(t,e)},t.prototype.removeTargetData=function(t,e){var n=this;return this.removeMatchingKeysForTargetId(t,e.targetId).next(function(){return zr(t).delete(e.targetId)}).next(function(){return n.Xt(t)}).next(function(e){return v(e.targetCount>0),e.targetCount-=1,n.Zt(t,e)})},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return zr(t).$t(function(s,a){var u=Sr(a);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.removeTargetData(t,u)))}).next(function(){return nr.waitFor(o)}).next(function(){return i})},t.prototype.forEachTarget=function(t,e){return zr(t).$t(function(t,n){var r=Sr(n);e(r)})},t.prototype.Xt=function(t){return Wr(t).get(Wn.key).next(function(t){return v(null!==t),t})},t.prototype.Zt=function(t,e){return Wr(t).put(Wn.key,e)},t.prototype.te=function(t,e){return zr(t).put(Nr(this.R,e))},t.prototype.ee=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.getTargetCount=function(t){return this.Xt(t).next(function(t){return t.targetCount})},t.prototype.getTargetData=function(t,e){var n=ht(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return zr(t).$t({range:r,index:Gn.queryTargetsIndexName},function(t,n,r){var o=Sr(n);ft(e,o.target)&&(i=o,r.done())}).next(function(){return i})},t.prototype.addMatchingKeys=function(t,e,n){var r=this,i=[],o=Hr(t);return e.forEach(function(e){var s=Rn(e.path);i.push(o.put(new zn(n,s))),i.push(r.referenceDelegate.addReference(t,n,e))}),nr.waitFor(i)},t.prototype.removeMatchingKeys=function(t,e,n){var r=this,i=Hr(t);return nr.forEach(e,function(e){var o=Rn(e.path);return nr.waitFor([i.delete([n,o]),r.referenceDelegate.removeReference(t,n,e)])})},t.prototype.removeMatchingKeysForTargetId=function(t,e){var n=Hr(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=Hr(t),i=Ue();return r.$t({range:n,Ft:!0},function(t,e,n){var r=Pn(t[1]),o=new Q(r);i=i.add(o)}).next(function(){return i})},t.prototype.containsKey=function(t,e){var n=Rn(e.path),r=IDBKeyRange.bound([n],[I(n)],!1,!0),i=0;return Hr(t).$t({index:zn.documentTargetsIndex,Ft:!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.lt=function(t,e){return zr(t).get(e).next(function(t){return t?Sr(t):null})},t}();function zr(t){return dr(t,Gn.store)}function Wr(t){return dr(t,Wn.store)}function Hr(t){return dr(t,zn.store)}function Yr(t){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){if(t.code!==a.FAILED_PRECONDITION||t.message!==Zn)throw t;return f("LocalStore","Unexpectedly lost primary lease"),[2]})})}function $r(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],s=w(n,i);return 0===s?w(r,o):s}var Xr=function(){function t(t){this.ne=t,this.buffer=new Ce($r),this.se=0}return t.prototype.ie=function(){return++this.se},t.prototype.re=function(t){var e=[t,this.ie()];if(this.buffer.size<this.ne)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();$r(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),t}(),Jr=function(){function t(t,e){this.garbageCollector=t,this.asyncQueue=e,this.oe=!1,this.ce=null}return t.prototype.start=function(t){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.ue(t)},t.prototype.stop=function(){this.ce&&(this.ce.cancel(),this.ce=null)},Object.defineProperty(t.prototype,"started",{get:function(){return null!==this.ce},enumerable:!1,configurable:!0}),t.prototype.ue=function(t){var n=this,r=this.oe?3e5:6e4;f("LruGarbageCollector","Garbage collection scheduled in "+r+"ms"),this.ce=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",r,function(){return(0,e.__awaiter)(n,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:this.ce=null,this.oe=!0,e.label=1;case 1:return e.trys.push([1,3,,7]),[4,t.collectGarbage(this.garbageCollector)];case 2:return e.sent(),[3,7];case 3:return ar(n=e.sent())?(f("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",n),[3,6]):[3,4];case 4:return[4,Yr(n)];case 5:e.sent(),e.label=6;case 6:return[3,7];case 7:return[4,this.ue(t)];case 8:return e.sent(),[2]}})})})},t}(),Zr=function(){function t(t,e){this.ae=t,this.params=e}return t.prototype.calculateTargetCount=function(t,e){return this.ae.he(t).next(function(t){return Math.floor(e/100*t)})},t.prototype.nthSequenceNumber=function(t,e){var n=this;if(0===e)return nr.resolve(s.o);var r=new Xr(e);return this.ae.forEachTarget(t,function(t){return r.re(t.sequenceNumber)}).next(function(){return n.ae.le(t,function(t){return r.re(t)})}).next(function(){return r.maxValue})},t.prototype.removeTargets=function(t,e,n){return this.ae.removeTargets(t,e,n)},t.prototype.removeOrphanedDocuments=function(t,e){return this.ae.removeOrphanedDocuments(t,e)},t.prototype.collect=function(t,e){var n=this;return-1===this.params.cacheSizeCollectionThreshold?(f("LruGarbageCollector","Garbage collection skipped; disabled"),nr.resolve(Pr)):this.getCacheSize(t).next(function(r){return r<n.params.cacheSizeCollectionThreshold?(f("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.cacheSizeCollectionThreshold),Pr):n.fe(t,e)})},t.prototype.getCacheSize=function(t){return this.ae.getCacheSize(t)},t.prototype.fe=function(t,e){var n,i,o,s,a,u,c,l=this,d=Date.now();return this.calculateTargetCount(t,this.params.percentileToCollect).next(function(e){return e>l.params.maximumSequenceNumbersToCollect?(f("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+l.params.maximumSequenceNumbersToCollect+" from "+e),i=l.params.maximumSequenceNumbersToCollect):i=e,s=Date.now(),l.nthSequenceNumber(t,i)}).next(function(r){return n=r,a=Date.now(),l.removeTargets(t,n,e)}).next(function(e){return o=e,u=Date.now(),l.removeOrphanedDocuments(t,n)}).next(function(t){return c=Date.now(),h()<=r.LogLevel.DEBUG&&f("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-d)+"ms\n\tDetermined least recently used "+i+" in "+(a-s)+"ms\n\tRemoved "+o+" targets in "+(u-a)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-d)+"ms"),nr.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:t})})},t}(),ti=function(){function t(t,e){this.db=t,this.garbageCollector=function(t,e){return new Zr(t,e)}(this,e)}return t.prototype.he=function(t){var e=this.de(t);return this.db.getTargetCache().getTargetCount(t).next(function(t){return e.next(function(e){return t+e})})},t.prototype.de=function(t){var e=0;return this.le(t,function(t){e++}).next(function(){return e})},t.prototype.forEachTarget=function(t,e){return this.db.getTargetCache().forEachTarget(t,e)},t.prototype.le=function(t,e){return this.we(t,function(t,n){return e(n)})},t.prototype.addReference=function(t,e,n){return ei(t,n)},t.prototype.removeReference=function(t,e,n){return ei(t,n)},t.prototype.removeTargets=function(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)},t.prototype.markPotentiallyOrphaned=function(t,e){return ei(t,e)},t.prototype._e=function(t,e){return function(t,e){var n=!1;return Kr(t).Ot(function(r){return Ur(t,r,e).next(function(t){return t&&(n=!0),nr.resolve(!t)})}).next(function(){return n})}(t,e)},t.prototype.removeOrphanedDocuments=function(t,e){var n=this,r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[],o=0;return this.we(t,function(s,a){if(a<=e){var u=n._e(t,s).next(function(e){if(!e)return o++,r.getEntry(t,s).next(function(){return r.removeEntry(s),Hr(t).delete([0,Rn(s.path)])})});i.push(u)}}).next(function(){return nr.waitFor(i)}).next(function(){return r.apply(t)}).next(function(){return o})},t.prototype.removeTarget=function(t,e){var n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)},t.prototype.updateLimboDocument=function(t,e){return ei(t,e)},t.prototype.we=function(t,e){var n,r=Hr(t),i=s.o;return r.$t({index:zn.documentTargetsIndex},function(t,r){var o=t[0];t[1];var a=r.path,u=r.sequenceNumber;0===o?(i!==s.o&&e(new Q(Pn(n)),i),i=u,n=a):i=s.o}).next(function(){i!==s.o&&e(new Q(Pn(n)),i)})},t.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},t}();function ei(t,e){return Hr(t).put(function(t,e){return new zn(0,Rn(t.path),e)}(e,t.currentSequenceNumber))}var ni=function(){function t(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}return t.prototype.get=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[0],a=o[1];if(this.equalsFn(s,t))return a}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.mapKeyFn(t),r=this.inner[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.equalsFn(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.inner[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.mapKeyFn(t),n=this.inner[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.equalsFn(n[r][0],t))return 1===n.length?delete this.inner[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){N(this.inner,function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[0],a=o[1];t(s,a)}})},t.prototype.isEmpty=function(){return D(this.inner)},t}(),ri=function(){function t(){this.changes=new ni(function(t){return t.toString()},function(t,e){return t.isEqual(e)}),this.changesApplied=!1}return t.prototype.getReadTime=function(t){var e=this.changes.get(t);return e?e.readTime:T.min()},t.prototype.addEntry=function(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})},t.prototype.removeEntry=function(t,e){void 0===e&&(e=null),this.assertNotApplied(),this.changes.set(t,{document:at.newInvalidDocument(t),readTime:e})},t.prototype.getEntry=function(t,e){this.assertNotApplied();var n=this.changes.get(e);return void 0!==n?nr.resolve(n.document):this.getFromCache(t,e)},t.prototype.getEntries=function(t,e){return this.getAllFromCache(t,e)},t.prototype.apply=function(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)},t.prototype.assertNotApplied=function(){},t}(),ii=function(){function t(t,e){this.R=t,this.Ut=e}return t.prototype.addEntry=function(t,e,n){return ai(t).put(ui(e),n)},t.prototype.removeEntry=function(t,e){var n=ai(t),r=ui(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.me(t,r)})},t.prototype.getEntry=function(t,e){var n=this;return ai(t).get(ui(e)).next(function(t){return n.ye(e,t)})},t.prototype.ge=function(t,e){var n=this;return ai(t).get(ui(e)).next(function(t){return{document:n.ye(e,t),size:Vr(t)}})},t.prototype.getEntries=function(t,e){var n=this,r=Oe();return this.pe(t,e,function(t,e){var i=n.ye(t,e);r=r.insert(t,i)}).next(function(){return r})},t.prototype.Ee=function(t,e){var n=this,r=Oe(),i=new Ae(Q.comparator);return this.pe(t,e,function(t,e){var o=n.ye(t,e);r=r.insert(t,o),i=i.insert(t,Vr(e))}).next(function(){return{documents:r,Te:i}})},t.prototype.pe=function(t,e,n){if(e.isEmpty())return nr.resolve();var r=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),i=e.getIterator(),o=i.getNext();return ai(t).$t({range:r},function(t,e,r){for(var s=Q.fromSegments(t);o&&Q.comparator(o,s)<0;)n(o,null),o=i.getNext();o&&o.isEqual(s)&&(n(o,e),o=i.hasNext()?i.getNext():null),o?r.Ct(o.path.toArray()):r.done()}).next(function(){for(;o;)n(o,null),o=i.hasNext()?i.getNext():null})},t.prototype.getDocumentsMatchingQuery=function(t,e,n){var r=this,i=Oe(),o=e.path.length+1,s={};if(n.isEqual(T.min())){var a=e.path.toArray();s.range=IDBKeyRange.lowerBound(a)}else{var u=e.path.toArray(),c=wr(n);s.range=IDBKeyRange.lowerBound([u,c],!0),s.index=Kn.collectionReadTimeIndex}return ai(t).$t(s,function(t,n,s){if(t.length===o){var a=gr(r.R,n);e.path.isPrefixOf(a.key.path)?jt(e,a)&&(i=i.insert(a.key,a)):s.done()}}).next(function(){return i})},t.prototype.newChangeBuffer=function(t){return new oi(this,!!t&&t.trackRemovals)},t.prototype.getSize=function(t){return this.getMetadata(t).next(function(t){return t.byteSize})},t.prototype.getMetadata=function(t){return si(t).get(Qn.key).next(function(t){return v(!!t),t})},t.prototype.me=function(t,e){return si(t).put(Qn.key,e)},t.prototype.ye=function(t,e){if(e){var n=gr(this.R,e);if(!n.isNoDocument()||!n.version.isEqual(T.min()))return n}return at.newInvalidDocument(t)},t}(),oi=function(t){function n(e,n){var r=this;return(r=t.call(this)||this).Ie=e,r.trackRemovals=n,r.Ae=new ni(function(t){return t.toString()},function(t,e){return t.isEqual(e)}),r}return(0,e.__extends)(n,t),n.prototype.applyChanges=function(t){var e=this,n=[],r=0,i=new Ce(function(t,e){return w(t.canonicalString(),e.canonicalString())});return this.changes.forEach(function(o,s){var a=e.Ae.get(o);if(s.document.isValidDocument()){var u=_r(e.Ie.R,s.document,e.getReadTime(o));i=i.add(o.path.popLast());var c=Vr(u);r+=c-a,n.push(e.Ie.addEntry(t,o,u))}else if(r-=a,e.trackRemovals){var h=_r(e.Ie.R,at.newNoDocument(o,T.min()),e.getReadTime(o));n.push(e.Ie.addEntry(t,o,h))}else n.push(e.Ie.removeEntry(t,o))}),i.forEach(function(r){n.push(e.Ie.Ut.addToCollectionParentIndex(t,r))}),n.push(this.Ie.updateMetadata(t,r)),nr.waitFor(n)},n.prototype.getFromCache=function(t,e){var n=this;return this.Ie.ge(t,e).next(function(t){return n.Ae.set(e,t.size),t.document})},n.prototype.getAllFromCache=function(t,e){var n=this;return this.Ie.Ee(t,e).next(function(t){var e=t.documents;return t.Te.forEach(function(t,e){n.Ae.set(t,e)}),e})},n}(ri);function si(t){return dr(t,Qn.store)}function ai(t){return dr(t,Kn.store)}function ui(t){return t.path.toArray()}var ci=function(){function t(t){this.R=t}return t.prototype.Rt=function(t,e,n,r){var i=this;v(n<r&&n>=0&&r<=11);var o=new rr("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(Mn.store)}(t),function(t){t.createObjectStore(Vn.store,{keyPath:Vn.keyPath}),t.createObjectStore(qn.store,{keyPath:qn.keyPath,autoIncrement:!0}).createIndex(qn.userMutationsIndex,qn.userMutationsKeyPath,{unique:!0}),t.createObjectStore(Un.store)}(t),hi(t),function(t){t.createObjectStore(Kn.store)}(t));var s=nr.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(zn.store),t.deleteObjectStore(Gn.store),t.deleteObjectStore(Wn.store)}(t),hi(t)),s=s.next(function(){return t=o.store(Wn.store),e=new Wn(0,0,T.min().toTimestamp(),0),t.put(Wn.key,e);var t,e})),n<4&&r>=4&&(0!==n&&(s=s.next(function(){return function(t,e){return e.store(qn.store).Nt().next(function(n){t.deleteObjectStore(qn.store),t.createObjectStore(qn.store,{keyPath:qn.keyPath,autoIncrement:!0}).createIndex(qn.userMutationsIndex,qn.userMutationsKeyPath,{unique:!0});var r=e.store(qn.store),i=n.map(function(t){return r.put(t)});return nr.waitFor(i)})}(t,o)})),s=s.next(function(){!function(t){t.createObjectStore(Yn.store,{keyPath:Yn.keyPath})}(t)})),n<5&&r>=5&&(s=s.next(function(){return i.Re(o)})),n<6&&r>=6&&(s=s.next(function(){return function(t){t.createObjectStore(Qn.store)}(t),i.be(o)})),n<7&&r>=7&&(s=s.next(function(){return i.ve(o)})),n<8&&r>=8&&(s=s.next(function(){return i.Pe(t,o)})),n<9&&r>=9&&(s=s.next(function(){!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){var e=t.objectStore(Kn.store);e.createIndex(Kn.readTimeIndex,Kn.readTimeIndexPath,{unique:!1}),e.createIndex(Kn.collectionReadTimeIndex,Kn.collectionReadTimeIndexPath,{unique:!1})}(e)})),n<10&&r>=10&&(s=s.next(function(){return i.Ve(o)})),n<11&&r>=11&&(s=s.next(function(){!function(t){t.createObjectStore($n.store,{keyPath:$n.keyPath})}(t),function(t){t.createObjectStore(Xn.store,{keyPath:Xn.keyPath})}(t)})),s},t.prototype.be=function(t){var e=0;return t.store(Kn.store).$t(function(t,n){e+=Vr(n)}).next(function(){var n=new Qn(e);return t.store(Qn.store).put(Qn.key,n)})},t.prototype.Re=function(t){var e=this,n=t.store(Vn.store),r=t.store(qn.store);return n.Nt().next(function(n){return nr.forEach(n,function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Nt(qn.userMutationsIndex,i).next(function(r){return nr.forEach(r,function(r){v(r.userId===n.userId);var i=Tr(e.R,r);return Mr(t,n.userId,i).next(function(){})})})})})},t.prototype.ve=function(t){var e=t.store(zn.store),n=t.store(Kn.store);return t.store(Wn.store).get(Wn.key).next(function(t){var r=[];return n.$t(function(n,i){var o=new x(n),s=[0,Rn(o)];r.push(e.get(s).next(function(n){return n?nr.resolve():function(n){return e.put(new zn(0,Rn(n),t.highestListenSequenceNumber))}(o)}))}).next(function(){return nr.waitFor(r)})})},t.prototype.Pe=function(t,e){t.createObjectStore(Hn.store,{keyPath:Hn.keyPath});var n=e.store(Hn.store),r=new Rr,i=function(t){if(r.add(t)){var e=t.lastSegment(),i=t.popLast();return n.put({collectionId:e,parent:Rn(i)})}};return e.store(Kn.store).$t({Ft:!0},function(t,e){var n=new x(t);return i(n.popLast())}).next(function(){return e.store(Un.store).$t({Ft:!0},function(t,e){t[0];var n=t[1];t[2];var r=Pn(n);return i(r.popLast())})})},t.prototype.Ve=function(t){var e=this,n=t.store(Gn.store);return n.$t(function(t,r){var i=Sr(r),o=Nr(e.R,i);return n.put(o)})},t}();function hi(t){t.createObjectStore(zn.store,{keyPath:zn.keyPath}).createIndex(zn.documentTargetsIndex,zn.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Gn.store,{keyPath:Gn.keyPath}).createIndex(Gn.queryTargetsIndexName,Gn.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Wn.store)}var fi="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.",li=function(){function t(e,n,r,i,o,s,c,h,f,d){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Se=o,this.window=s,this.document=c,this.De=f,this.Ce=d,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ke=null,this.inForeground=!1,this.Fe=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(t){return Promise.resolve()},!t.yt())throw new u(a.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new ti(this,i),this.Le=n+"main",this.R=new mr(h),this.Be=new ir(this.Le,11,new ci(this.R)),this.qe=new Gr(this.referenceDelegate,this.R),this.Ut=new Lr,this.Ue=function(t,e){return new ii(t,e)}(this.R,this.Ut),this.Ke=new Ar,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,!1===d&&l("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.je().then(function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new u(a.FAILED_PRECONDITION,fi);return t.We(),t.Ge(),t.ze(),t.runTransaction("getHighestListenSequenceNumber","readonly",function(e){return t.qe.getHighestSequenceNumber(e)})}).then(function(e){t.Ne=new s(e,t.De)}).then(function(){t.xe=!0}).catch(function(e){return t.Be&&t.Be.close(),Promise.reject(e)})},t.prototype.He=function(t){var n=this;return this.Me=function(r){return(0,e.__awaiter)(n,void 0,void 0,function(){return(0,e.__generator)(this,function(e){return this.started?[2,t(r)]:[2]})})},t(this.isPrimary)},t.prototype.setDatabaseDeletedListener=function(t){var n=this;this.Be.vt(function(r){return(0,e.__awaiter)(n,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return null===r.newVersion?[4,t()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})})},t.prototype.setNetworkEnabled=function(t){var n=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.Se.enqueueAndForget(function(){return(0,e.__awaiter)(n,void 0,void 0,function(){return(0,e.__generator)(this,function(t){switch(t.label){case 0:return this.started?[4,this.je()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}))},t.prototype.je=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",function(e){return pi(e).put(new Yn(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next(function(){if(t.isPrimary)return t.Je(e).next(function(e){e||(t.isPrimary=!1,t.Se.enqueueRetryable(function(){return t.Me(!1)}))})}).next(function(){return t.Ye(e)}).next(function(n){return t.isPrimary&&!n?t.Xe(e).next(function(){return!1}):!!n&&t.Ze(e).next(function(){return!0})})}).catch(function(e){if(ar(e))return f("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return f("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1}).then(function(e){t.isPrimary!==e&&t.Se.enqueueRetryable(function(){return t.Me(e)}),t.isPrimary=e})},t.prototype.Je=function(t){var e=this;return di(t).get(Mn.key).next(function(t){return nr.resolve(e.tn(t))})},t.prototype.en=function(t){return pi(t).delete(this.clientId)},t.prototype.nn=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return!this.isPrimary||this.sn(this.Oe,18e5)?[3,2]:(this.Oe=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",function(t){var e=dr(t,Yn.store);return e.Nt().next(function(t){var n=o.rn(t,18e5),r=t.filter(function(t){return-1===n.indexOf(t)});return nr.forEach(r,function(t){return e.delete(t.clientId)}).next(function(){return r})})}).catch(function(){return[]})]);case 1:if(t=e.sent(),this.Qe)for(n=0,r=t;n<r.length;n++)i=r[n],this.Qe.removeItem(this.on(i.clientId));e.label=2;case 2:return[2]}})})},t.prototype.ze=function(){var t=this;this.$e=this.Se.enqueueAfterDelay("client_metadata_refresh",4e3,function(){return t.je().then(function(){return t.nn()}).then(function(){return t.ze()})})},t.prototype.tn=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.Ye=function(t){var e=this;return this.Ce?nr.resolve(!0):di(t).get(Mn.key).next(function(n){if(null!==n&&e.sn(n.leaseTimestampMs,5e3)&&!e.cn(n.ownerId)){if(e.tn(n)&&e.networkEnabled)return!0;if(!e.tn(n)){if(!n.allowTabSynchronization)throw new u(a.FAILED_PRECONDITION,fi);return!1}}return!(!e.networkEnabled||!e.inForeground)||pi(t).Nt().next(function(t){return void 0===e.rn(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&&f("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t})},t.prototype.shutdown=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.xe=!1,this.un(),this.$e&&(this.$e.cancel(),this.$e=null),this.an(),this.hn(),[4,this.Be.runTransaction("shutdown","readwrite",[Mn.store,Yn.store],function(e){var n=new lr(e,s.o);return t.Xe(n).next(function(){return t.en(n)})})];case 1:return e.sent(),this.Be.close(),this.ln(),[2]}})})},t.prototype.rn=function(t,e){var n=this;return t.filter(function(t){return n.sn(t.updateTimeMs,e)&&!n.cn(t.clientId)})},t.prototype.fn=function(){var t=this;return this.runTransaction("getActiveClients","readonly",function(e){return pi(e).Nt().next(function(e){return t.rn(e,18e5).map(function(t){return t.clientId})})})},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.getMutationQueue=function(t){return qr.Qt(t,this.R,this.Ut,this.referenceDelegate)},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(t,e,n){var r=this;f("IndexedDbPersistence","Starting transaction:",t);var i,o="readonly"===e?"readonly":"readwrite";return this.Be.runTransaction(t,o,Jn,function(o){return i=new lr(o,r.Ne?r.Ne.next():s.o),"readwrite-primary"===e?r.Je(i).next(function(t){return!!t||r.Ye(i)}).next(function(e){if(!e)throw l("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r.Se.enqueueRetryable(function(){return r.Me(!1)}),new u(a.FAILED_PRECONDITION,Zn);return n(i)}).next(function(t){return r.Ze(i).next(function(){return t})}):r.dn(i).next(function(){return n(i)})}).then(function(t){return i.raiseOnCommittedEvent(),t})},t.prototype.dn=function(t){var e=this;return di(t).get(Mn.key).next(function(t){if(null!==t&&e.sn(t.leaseTimestampMs,5e3)&&!e.cn(t.ownerId)&&!e.tn(t)&&!(e.Ce||e.allowTabSynchronization&&t.allowTabSynchronization))throw new u(a.FAILED_PRECONDITION,fi)})},t.prototype.Ze=function(t){var e=new Mn(this.clientId,this.allowTabSynchronization,Date.now());return di(t).put(Mn.key,e)},t.yt=function(){return ir.yt()},t.prototype.Xe=function(t){var e=this,n=di(t);return n.get(Mn.key).next(function(t){return e.tn(t)?(f("IndexedDbPersistence","Releasing primary lease."),n.delete(Mn.key)):nr.resolve()})},t.prototype.sn=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(l("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.We=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Fe=function(){t.Se.enqueueAndForget(function(){return t.inForeground="visible"===t.document.visibilityState,t.je()})},this.document.addEventListener("visibilitychange",this.Fe),this.inForeground="visible"===this.document.visibilityState)},t.prototype.an=function(){this.Fe&&(this.document.removeEventListener("visibilitychange",this.Fe),this.Fe=null)},t.prototype.Ge=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.ke=function(){e.un(),(0,n.isSafari)()&&navigator.appVersion.match("Version/14")&&e.Se.enterRestrictedMode(!0),e.Se.enqueueAndForget(function(){return e.shutdown()})},this.window.addEventListener("pagehide",this.ke))},t.prototype.hn=function(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)},t.prototype.cn=function(t){var e;try{var n=null!==(null===(e=this.Qe)||void 0===e?void 0:e.getItem(this.on(t)));return f("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return l("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(t){l("Failed to set zombie client id.",t)}},t.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch(t){}},t.prototype.on=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function di(t){return dr(t,Mn.store)}function pi(t){return dr(t,Yn.store)}function yi(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var vi=function(t,e){this.progress=t,this.wn=e},mi=function(){function t(t,e,n){this.Ue=t,this._n=e,this.Ut=n}return t.prototype.mn=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKey(t,e).next(function(r){return n.yn(t,e,r)})},t.prototype.yn=function(t,e,n){return this.Ue.getEntry(t,e).next(function(t){for(var e=0,r=n;e<r.length;e++)r[e].applyToLocalView(t);return t})},t.prototype.gn=function(t,e){t.forEach(function(t,n){for(var r=0,i=e;r<i.length;r++)i[r].applyToLocalView(n)})},t.prototype.pn=function(t,e){var n=this;return this.Ue.getEntries(t,e).next(function(e){return n.En(t,e).next(function(){return e})})},t.prototype.En=function(t,e){var n=this;return this._n.getAllMutationBatchesAffectingDocumentKeys(t,e).next(function(t){return n.gn(e,t)})},t.prototype.getDocumentsMatchingQuery=function(t,e,n){return function(t){return Q.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Tn(t,e.path):Pt(e)?this.In(t,e,n):this.An(t,e,n)},t.prototype.Tn=function(t,e){return this.mn(t,new Q(e)).next(function(t){var e=Fe();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e})},t.prototype.In=function(t,e,n){var r=this,i=e.collectionGroup,o=Fe();return this.Ut.getCollectionParents(t,i).next(function(s){return nr.forEach(s,function(s){var a=function(t,e){return new At(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,s.child(i));return r.An(t,a,n).next(function(t){t.forEach(function(t,e){o=o.insert(t,e)})})}).next(function(){return o})})},t.prototype.An=function(t,e,n){var r,i,o=this;return this.Ue.getDocumentsMatchingQuery(t,e,n).next(function(n){return r=n,o._n.getAllMutationBatchesAffectingQuery(t,e)}).next(function(e){return i=e,o.Rn(t,i,r).next(function(t){r=t;for(var e=0,n=i;e<n.length;e++)for(var o=n[e],s=0,a=o.mutations;s<a.length;s++){var u=a[s],c=u.key,h=r.get(c);null==h&&(h=at.newInvalidDocument(c),r=r.insert(c,h)),le(u,h,o.localWriteTime),h.isFoundDocument()||(r=r.remove(c))}})}).next(function(){return r.forEach(function(t,n){jt(e,n)||(r=r.remove(t))}),r})},t.prototype.Rn=function(t,e,n){for(var r=Ue(),i=0,o=e;i<o.length;i++)for(var s=0,a=o[i].mutations;s<a.length;s++){var u=a[s];u instanceof me&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.Ue.getEntries(t,r).next(function(t){return t.forEach(function(t,e){e.isFoundDocument()&&(c=c.insert(t,e))}),c})},t}(),gi=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.bn=n,this.vn=r}return t.Pn=function(e,n){for(var r=Ue(),i=Ue(),o=0,s=n.docChanges;o<s.length;o++){var a=s[o];switch(a.type){case 0:r=r.add(a.doc.key);break;case 1:i=i.add(a.doc.key)}}return new t(e,n.fromCache,r,i)},t}(),_i=function(){function t(){}return t.prototype.Vn=function(t){this.Sn=t},t.prototype.getDocumentsMatchingQuery=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.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(T.min())?this.Dn(t,e):this.Sn.pn(t,i).next(function(s){var a=o.Cn(e,s);return(Ct(e)||Rt(e))&&o.Nn(e.limitType,a,i,n)?o.Dn(t,e):(h()<=r.LogLevel.DEBUG&&f("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Bt(e)),o.Sn.getDocumentsMatchingQuery(t,e,n).next(function(t){return a.forEach(function(e){t=t.insert(e.key,e)}),t}))})},t.prototype.Cn=function(t,e){var n=new Ce(Kt(t));return e.forEach(function(e,r){jt(t,r)&&(n=n.add(r))}),n},t.prototype.Nn=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.compareTo(r)>0)},t.prototype.Dn=function(t,e){return h()<=r.LogLevel.DEBUG&&f("QueryEngine","Using full collection scan to execute query:",Bt(e)),this.Sn.getDocumentsMatchingQuery(t,e,T.min())},t}(),wi=function(){function t(t,e,n,r){this.persistence=t,this.xn=e,this.R=r,this.kn=new Ae(w),this.Fn=new ni(function(t){return ht(t)},ft),this.$n=T.min(),this._n=t.getMutationQueue(n),this.On=t.getRemoteDocumentCache(),this.qe=t.getTargetCache(),this.Mn=new mi(this.On,this._n,this.persistence.getIndexManager()),this.Ke=t.getBundleCache(),this.xn.Vn(this.Mn)}return t.prototype.collectGarbage=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",function(n){return t.collect(n,e.kn)})},t}();function bi(t,e,n,r){return new wi(t,e,n,r)}function Ii(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=m(t),i=r._n,o=r.Mn,[4,r.persistence.runTransaction("Handle user change","readonly",function(t){var e;return r._n.getAllMutationBatches(t).next(function(s){return e=s,i=r.persistence.getMutationQueue(n),o=new mi(r.On,i,r.persistence.getIndexManager()),i.getAllMutationBatches(t)}).next(function(n){for(var r=[],i=[],s=Ue(),a=0,u=e;a<u.length;a++){var c=u[a];r.push(c.batchId);for(var h=0,f=c.mutations;h<f.length;h++){var l=f[h];s=s.add(l.key)}}for(var d=0,p=n;d<p.length;d++){var y=p[d];i.push(y.batchId);for(var v=0,m=y.mutations;v<m.length;v++){var g=m[v];s=s.add(g.key)}}return o.pn(t,s).next(function(t){return{Ln:t,removedBatchIds:r,addedBatchIds:i}})})})];case 1:return s=e.sent(),[2,(r._n=i,r.Mn=o,r.xn.Vn(r.Mn),s)]}})})}function Ei(t,e){var n=m(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",function(t){var r=e.batch.keys(),i=n.On.newChangeBuffer({trackRemovals:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),s=nr.resolve();return o.forEach(function(t){s=s.next(function(){return r.getEntry(e,t)}).next(function(e){var o=n.docVersions.get(t);v(null!==o),e.version.compareTo(o)<0&&(i.applyToRemoteDocument(e,n),e.isValidDocument()&&r.addEntry(e,n.commitVersion))})}),s.next(function(){return t._n.removeMutationBatch(e,i)})}(n,t,e,i).next(function(){return i.apply(t)}).next(function(){return n._n.performConsistencyCheck(t)}).next(function(){return n.Mn.pn(t,r)})})}function Ti(t){var e=m(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",function(t){return e.qe.getLastRemoteSnapshotVersion(t)})}function Si(t,e){var n=m(t),r=e.snapshotVersion,i=n.kn;return n.persistence.runTransaction("Apply remote event","readwrite-primary",function(t){var o=n.On.newChangeBuffer({trackRemovals:!0});i=n.kn;var s=[];e.targetChanges.forEach(function(e,o){var a=i.get(o);if(a){s.push(n.qe.removeMatchingKeys(t,e.removedDocuments,o).next(function(){return n.qe.addMatchingKeys(t,e.addedDocuments,o)}));var u=e.resumeToken;if(u.approximateByteSize()>0){var c=a.withResumeToken(u,r).withSequenceNumber(t.currentSequenceNumber);i=i.insert(o,c),function(t,e,n){return v(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(a,c,e)&&s.push(n.qe.updateTargetData(t,c))}}});var a=Oe();if(e.documentUpdates.forEach(function(r,i){e.resolvedLimboDocuments.has(r)&&s.push(n.persistence.referenceDelegate.updateLimboDocument(t,r))}),s.push(Ni(t,o,e.documentUpdates,r,void 0).next(function(t){a=t})),!r.isEqual(T.min())){var u=n.qe.getLastRemoteSnapshotVersion(t).next(function(e){return n.qe.setTargetsMetadata(t,t.currentSequenceNumber,r)});s.push(u)}return nr.waitFor(s).next(function(){return o.apply(t)}).next(function(){return n.Mn.En(t,a)}).next(function(){return a})}).then(function(t){return n.kn=i,t})}function Ni(t,e,n,r,i){var o=Ue();return n.forEach(function(t){return o=o.add(t)}),e.getEntries(t,o).next(function(t){var o=Oe();return n.forEach(function(n,s){var a=t.get(n),u=(null==i?void 0:i.get(n))||r;s.isNoDocument()&&s.version.isEqual(T.min())?(e.removeEntry(n,u),o=o.insert(n,s)):!a.isValidDocument()||s.version.compareTo(a.version)>0||0===s.version.compareTo(a.version)&&a.hasPendingWrites?(e.addEntry(s,u),o=o.insert(n,s)):f("LocalStore","Ignoring outdated watch update for ",n,". Current version:",a.version," Watch version:",s.version)}),o})}function Di(t,e){var n=m(t);return n.persistence.runTransaction("Get next mutation batch","readonly",function(t){return void 0===e&&(e=-1),n._n.getNextMutationBatchAfterBatchId(t,e)})}function Ai(t,e){var n=m(t);return n.persistence.runTransaction("Allocate target","readwrite",function(t){var r;return n.qe.getTargetData(t,e).next(function(i){return i?(r=i,nr.resolve(r)):n.qe.allocateTargetId(t).next(function(i){return r=new vr(e,i,0,t.currentSequenceNumber),n.qe.addTargetData(t,r).next(function(){return r})})})}).then(function(t){var r=n.kn.get(t.targetId);return(null===r||t.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.kn=n.kn.insert(t.targetId,t),n.Fn.set(e,t.targetId)),t})}function xi(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:i=m(t),o=i.kn.get(n),s=r?"readwrite":"readwrite-primary",e.label=1;case 1:return e.trys.push([1,4,,5]),r?[3,3]:[4,i.persistence.runTransaction("Release target",s,function(t){return i.persistence.referenceDelegate.removeTarget(t,o)})];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:if(!ar(a=e.sent()))throw a;return f("LocalStore","Failed to update sequence numbers for target "+n+": "+a),[3,5];case 5:return i.kn=i.kn.remove(n),i.Fn.delete(o.target),[2]}})})}function ki(t,e,n){var r=m(t),i=T.min(),o=Ue();return r.persistence.runTransaction("Execute query","readonly",function(t){return function(t,e,n){var r=m(t),i=r.Fn.get(n);return void 0!==i?nr.resolve(r.kn.get(i)):r.qe.getTargetData(e,n)}(r,t,Mt(e)).next(function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r.qe.getMatchingKeysForTargetId(t,e.targetId).next(function(t){o=t})}).next(function(){return r.xn.getDocumentsMatchingQuery(t,e,n?i:T.min(),n?o:Ue())}).next(function(t){return{documents:t,Bn:o}})})}function Ci(t,e){var n=m(t),r=m(n.qe),i=n.kn.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",function(t){return r.lt(t,e).next(function(t){return t?t.target:null})})}function Ri(t){var e=m(t);return e.persistence.runTransaction("Get new document changes","readonly",function(t){return function(t,e,n){var r=m(t),i=Oe(),o=wr(n),s=ai(e),a=IDBKeyRange.lowerBound(o,!0);return s.$t({index:Kn.readTimeIndex,range:a},function(t,e){var n=gr(r.R,e);i=i.insert(n.key,n),o=e.readTime}).next(function(){return{wn:i,readTime:br(o)}})}(e.On,t,e.$n)}).then(function(t){var n=t.wn,r=t.readTime;return e.$n=r,n})}function Li(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){return[2,(n=m(t)).persistence.runTransaction("Synchronize last document change read time","readonly",function(t){return function(t){var e=ai(t),n=T.min();return e.$t({index:Kn.readTimeIndex,reverse:!0},function(t,e,r){e.readTime&&(n=br(e.readTime)),r.done()}).next(function(){return n})}(t)}).then(function(t){n.$n=t})]})})}function Oi(t,n,r,i){return(0,e.__awaiter)(this,void 0,void 0,function(){var o,s,a,u,c,h,f,l,d,p;return(0,e.__generator)(this,function(e){switch(e.label){case 0:for(o=m(t),s=Ue(),a=Oe(),u=Ve(),c=0,h=r;c<h.length;c++)f=h[c],l=n.qn(f.metadata.name),f.document&&(s=s.add(l)),a=a.insert(l,n.Un(f)),u=u.insert(l,n.Kn(f.metadata.readTime));return d=o.On.newChangeBuffer({trackRemovals:!0}),[4,Ai(o,function(t){return Mt(kt(x.fromString("__bundle__/docs/"+t)))}(i))];case 1:return p=e.sent(),[2,o.persistence.runTransaction("Apply bundle documents","readwrite",function(t){return Ni(t,d,a,T.min(),u).next(function(e){return d.apply(t),e}).next(function(e){return o.qe.removeMatchingKeysForTargetId(t,p.targetId).next(function(){return o.qe.addMatchingKeys(t,s,p.targetId)}).next(function(){return o.Mn.En(t,e)}).next(function(){return e})})})]}})})}function Pi(t,n,r){return void 0===r&&(r=Ue()),(0,e.__awaiter)(this,void 0,void 0,function(){var i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,Ai(t,Mt(Dr(n.bundledQuery)))];case 1:return i=e.sent(),[2,(o=m(t)).persistence.runTransaction("Save named query","readwrite",function(t){var e=on(n.readTime);if(i.snapshotVersion.compareTo(e)>=0)return o.Ke.saveNamedQuery(t,n);var s=i.withResumeToken(L.EMPTY_BYTE_STRING,e);return o.kn=o.kn.insert(s.targetId,s),o.qe.updateTargetData(t,s).next(function(){return o.qe.removeMatchingKeysForTargetId(t,i.targetId)}).next(function(){return o.qe.addMatchingKeys(t,r,i.targetId)}).next(function(){return o.Ke.saveNamedQuery(t,n)})})]}})})}var Fi=function(){function t(t){this.R=t,this.Qn=new Map,this.jn=new Map}return t.prototype.getBundleMetadata=function(t,e){return nr.resolve(this.Qn.get(e))},t.prototype.saveBundleMetadata=function(t,e){var n;return this.Qn.set(e.id,{id:(n=e).id,version:n.version,createTime:on(n.createTime)}),nr.resolve()},t.prototype.getNamedQuery=function(t,e){return nr.resolve(this.jn.get(e))},t.prototype.saveNamedQuery=function(t,e){return this.jn.set(e.name,function(t){return{name:t.name,query:Dr(t.bundledQuery),readTime:on(t.readTime)}}(e)),nr.resolve()},t}(),Mi=function(){function t(){this.Wn=new Ce(Vi.Gn),this.zn=new Ce(Vi.Hn)}return t.prototype.isEmpty=function(){return this.Wn.isEmpty()},t.prototype.addReference=function(t,e){var n=new Vi(t,e);this.Wn=this.Wn.add(n),this.zn=this.zn.add(n)},t.prototype.Jn=function(t,e){var n=this;t.forEach(function(t){return n.addReference(t,e)})},t.prototype.removeReference=function(t,e){this.Yn(new Vi(t,e))},t.prototype.Xn=function(t,e){var n=this;t.forEach(function(t){return n.removeReference(t,e)})},t.prototype.Zn=function(t){var e=this,n=new Q(new x([])),r=new Vi(n,t),i=new Vi(n,t+1),o=[];return this.zn.forEachInRange([r,i],function(t){e.Yn(t),o.push(t.key)}),o},t.prototype.ts=function(){var t=this;this.Wn.forEach(function(e){return t.Yn(e)})},t.prototype.Yn=function(t){this.Wn=this.Wn.delete(t),this.zn=this.zn.delete(t)},t.prototype.es=function(t){var e=new Q(new x([])),n=new Vi(e,t),r=new Vi(e,t+1),i=Ue();return this.zn.forEachInRange([n,r],function(t){i=i.add(t.key)}),i},t.prototype.containsKey=function(t){var e=new Vi(t,0),n=this.Wn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)},t}(),Vi=function(){function t(t,e){this.key=t,this.ns=e}return t.Gn=function(t,e){return Q.comparator(t.key,e.key)||w(t.ns,e.ns)},t.Hn=function(t,e){return w(t.ns,e.ns)||Q.comparator(t.key,e.key)},t}(),qi=function(){function t(t,e){this.Ut=t,this.referenceDelegate=e,this._n=[],this.ss=1,this.rs=new Ce(Vi.Gn)}return t.prototype.checkEmpty=function(t){return nr.resolve(0===this._n.length)},t.prototype.addMutationBatch=function(t,e,n,r){var i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];var o=new pr(i,e,n,r);this._n.push(o);for(var s=0,a=r;s<a.length;s++){var u=a[s];this.rs=this.rs.add(new Vi(u.key,i)),this.Ut.addToCollectionParentIndex(t,u.key.path.popLast())}return nr.resolve(o)},t.prototype.lookupMutationBatch=function(t,e){return nr.resolve(this.os(e))},t.prototype.getNextMutationBatchAfterBatchId=function(t,e){var n=e+1,r=this.cs(n),i=r<0?0:r;return nr.resolve(this._n.length>i?this._n[i]:null)},t.prototype.getHighestUnacknowledgedBatchId=function(){return nr.resolve(0===this._n.length?-1:this.ss-1)},t.prototype.getAllMutationBatches=function(t){return nr.resolve(this._n.slice())},t.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new Vi(e,0),i=new Vi(e,Number.POSITIVE_INFINITY),o=[];return this.rs.forEachInRange([r,i],function(t){var e=n.os(t.ns);o.push(e)}),nr.resolve(o)},t.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Ce(w);return e.forEach(function(t){var e=new Vi(t,0),i=new Vi(t,Number.POSITIVE_INFINITY);n.rs.forEachInRange([e,i],function(t){r=r.add(t.ns)})}),nr.resolve(this.us(r))},t.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,i=n;Q.isDocumentKey(i)||(i=i.child(""));var o=new Vi(new Q(i),0),s=new Ce(w);return this.rs.forEachWhile(function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(s=s.add(t.ns)),!0)},o),nr.resolve(this.us(s))},t.prototype.us=function(t){var e=this,n=[];return t.forEach(function(t){var r=e.os(t);null!==r&&n.push(r)}),n},t.prototype.removeMutationBatch=function(t,e){var n=this;v(0===this.hs(e.batchId,"removed")),this._n.shift();var r=this.rs;return nr.forEach(e.mutations,function(i){var o=new Vi(i.key,e.batchId);return r=r.delete(o),n.referenceDelegate.markPotentiallyOrphaned(t,i.key)}).next(function(){n.rs=r})},t.prototype.Gt=function(t){},t.prototype.containsKey=function(t,e){var n=new Vi(e,0),r=this.rs.firstAfterOrEqual(n);return nr.resolve(e.isEqual(r&&r.key))},t.prototype.performConsistencyCheck=function(t){return this._n.length,nr.resolve()},t.prototype.hs=function(t,e){return this.cs(t)},t.prototype.cs=function(t){return 0===this._n.length?0:t-this._n[0].batchId},t.prototype.os=function(t){var e=this.cs(t);return e<0||e>=this._n.length?null:this._n[e]},t}(),Ui=function(){function t(t,e){this.Ut=t,this.ls=e,this.docs=new Ae(Q.comparator),this.size=0}return t.prototype.addEntry=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,s=this.ls(e);return this.docs=this.docs.insert(r,{document:e.clone(),size:s,readTime:n}),this.size+=s-o,this.Ut.addToCollectionParentIndex(t,r.path.popLast())},t.prototype.removeEntry=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.getEntry=function(t,e){var n=this.docs.get(e);return nr.resolve(n?n.document.clone():at.newInvalidDocument(e))},t.prototype.getEntries=function(t,e){var n=this,r=Oe();return e.forEach(function(t){var e=n.docs.get(t);r=r.insert(t,e?e.document.clone():at.newInvalidDocument(t))}),nr.resolve(r)},t.prototype.getDocumentsMatchingQuery=function(t,e,n){for(var r=Oe(),i=new Q(e.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var s=o.getNext(),a=s.key,u=s.value,c=u.document,h=u.readTime;if(!e.path.isPrefixOf(a.path))break;h.compareTo(n)<=0||jt(e,c)&&(r=r.insert(c.key,c.clone()))}return nr.resolve(r)},t.prototype.fs=function(t,e){return nr.forEach(this.docs,function(t){return e(t)})},t.prototype.newChangeBuffer=function(t){return new Bi(this)},t.prototype.getSize=function(t){return nr.resolve(this.size)},t}(),Bi=function(t){function n(e){var n=this;return(n=t.call(this)||this).Ie=e,n}return(0,e.__extends)(n,t),n.prototype.applyChanges=function(t){var e=this,n=[];return this.changes.forEach(function(r,i){i.document.isValidDocument()?n.push(e.Ie.addEntry(t,i.document,e.getReadTime(r))):e.Ie.removeEntry(r)}),nr.waitFor(n)},n.prototype.getFromCache=function(t,e){return this.Ie.getEntry(t,e)},n.prototype.getAllFromCache=function(t,e){return this.Ie.getEntries(t,e)},n}(ri),ji=function(){function t(t){this.persistence=t,this.ds=new ni(function(t){return ht(t)},ft),this.lastRemoteSnapshotVersion=T.min(),this.highestTargetId=0,this.ws=0,this._s=new Mi,this.targetCount=0,this.ys=Qr.Jt()}return t.prototype.forEachTarget=function(t,e){return this.ds.forEach(function(t,n){return e(n)}),nr.resolve()},t.prototype.getLastRemoteSnapshotVersion=function(t){return nr.resolve(this.lastRemoteSnapshotVersion)},t.prototype.getHighestSequenceNumber=function(t){return nr.resolve(this.ws)},t.prototype.allocateTargetId=function(t){return this.highestTargetId=this.ys.next(),nr.resolve(this.highestTargetId)},t.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ws&&(this.ws=e),nr.resolve()},t.prototype.te=function(t){this.ds.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.ys=new Qr(e),this.highestTargetId=e),t.sequenceNumber>this.ws&&(this.ws=t.sequenceNumber)},t.prototype.addTargetData=function(t,e){return this.te(e),this.targetCount+=1,nr.resolve()},t.prototype.updateTargetData=function(t,e){return this.te(e),nr.resolve()},t.prototype.removeTargetData=function(t,e){return this.ds.delete(e.target),this._s.Zn(e.targetId),this.targetCount-=1,nr.resolve()},t.prototype.removeTargets=function(t,e,n){var r=this,i=0,o=[];return this.ds.forEach(function(s,a){a.sequenceNumber<=e&&null===n.get(a.targetId)&&(r.ds.delete(s),o.push(r.removeMatchingKeysForTargetId(t,a.targetId)),i++)}),nr.waitFor(o).next(function(){return i})},t.prototype.getTargetCount=function(t){return nr.resolve(this.targetCount)},t.prototype.getTargetData=function(t,e){var n=this.ds.get(e)||null;return nr.resolve(n)},t.prototype.addMatchingKeys=function(t,e,n){return this._s.Jn(e,n),nr.resolve()},t.prototype.removeMatchingKeys=function(t,e,n){this._s.Xn(e,n);var r=this.persistence.referenceDelegate,i=[];return r&&e.forEach(function(e){i.push(r.markPotentiallyOrphaned(t,e))}),nr.waitFor(i)},t.prototype.removeMatchingKeysForTargetId=function(t,e){return this._s.Zn(e),nr.resolve()},t.prototype.getMatchingKeysForTargetId=function(t,e){var n=this._s.es(e);return nr.resolve(n)},t.prototype.containsKey=function(t,e){return nr.resolve(this._s.containsKey(e))},t}(),Ki=function(){function t(t,e){var n=this;this.gs={},this.Ne=new s(0),this.xe=!1,this.xe=!0,this.referenceDelegate=t(this),this.qe=new ji(this),this.Ut=new Cr,this.Ue=function(t,e){return new Ui(t,function(t){return n.referenceDelegate.ps(t)})}(this.Ut),this.R=new mr(e),this.Ke=new Fi(this.R)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(t.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),t.prototype.setDatabaseDeletedListener=function(){},t.prototype.setNetworkEnabled=function(){},t.prototype.getIndexManager=function(){return this.Ut},t.prototype.getMutationQueue=function(t){var e=this.gs[t.toKey()];return e||(e=new qi(this.Ut,this.referenceDelegate),this.gs[t.toKey()]=e),e},t.prototype.getTargetCache=function(){return this.qe},t.prototype.getRemoteDocumentCache=function(){return this.Ue},t.prototype.getBundleCache=function(){return this.Ke},t.prototype.runTransaction=function(t,e,n){var r=this;f("MemoryPersistence","Starting transaction:",t);var i=new Qi(this.Ne.next());return this.referenceDelegate.Es(),n(i).next(function(t){return r.referenceDelegate.Ts(i).next(function(){return t})}).toPromise().then(function(t){return i.raiseOnCommittedEvent(),t})},t.prototype.Is=function(t,e){return nr.or(Object.values(this.gs).map(function(n){return function(){return n.containsKey(t,e)}}))},t}(),Qi=function(t){function n(e){var n=this;return(n=t.call(this)||this).currentSequenceNumber=e,n}return(0,e.__extends)(n,t),n}(tr),Gi=function(){function t(t){this.persistence=t,this.As=new Mi,this.Rs=null}return t.bs=function(e){return new t(e)},Object.defineProperty(t.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw y()},enumerable:!1,configurable:!0}),t.prototype.addReference=function(t,e,n){return this.As.addReference(n,e),this.vs.delete(n.toString()),nr.resolve()},t.prototype.removeReference=function(t,e,n){return this.As.removeReference(n,e),this.vs.add(n.toString()),nr.resolve()},t.prototype.markPotentiallyOrphaned=function(t,e){return this.vs.add(e.toString()),nr.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.As.Zn(e.targetId).forEach(function(t){return n.vs.add(t.toString())});var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(t,e.targetId).next(function(t){t.forEach(function(t){return n.vs.add(t.toString())})}).next(function(){return r.removeTargetData(t,e)})},t.prototype.Es=function(){this.Rs=new Set},t.prototype.Ts=function(t){var e=this,n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return nr.forEach(this.vs,function(r){var i=Q.fromPath(r);return e.Ps(t,i).next(function(t){t||n.removeEntry(i)})}).next(function(){return e.Rs=null,n.apply(t)})},t.prototype.updateLimboDocument=function(t,e){var n=this;return this.Ps(t,e).next(function(t){t?n.vs.delete(e.toString()):n.vs.add(e.toString())})},t.prototype.ps=function(t){return 0},t.prototype.Ps=function(t,e){var n=this;return nr.or([function(){return nr.resolve(n.As.containsKey(e))},function(){return n.persistence.getTargetCache().containsKey(t,e)},function(){return n.persistence.Is(t,e)}])},t}(),zi=function(){function t(t){this.uid=t}return t.prototype.isAuthenticated=function(){return null!=this.uid},t.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}();function Wi(t,e){return"firestore_clients_"+t+"_"+e}function Hi(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(r+="_"+e.uid),r}function Yi(t,e){return"firestore_targets_"+t+"_"+e}zi.UNAUTHENTICATED=new zi(null),zi.GOOGLE_CREDENTIALS=new zi("google-credentials-uid"),zi.FIRST_PARTY=new zi("first-party-uid"),zi.MOCK_USER=new zi("mock-user");var $i=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.Vs=function(e,n,r){var i,s=JSON.parse(r),a="object"==o(s)&&-1!==["pending","acknowledged","rejected"].indexOf(s.state)&&(void 0===s.error||"object"==o(s.error));return a&&s.error&&(a="string"==typeof s.error.message&&"string"==typeof s.error.code)&&(i=new u(s.error.code,s.error.message)),a?new t(e,n,s.state,i):(l("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.Ss=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}(),Xi=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.Vs=function(e,n){var r,i=JSON.parse(n),s="object"==o(i)&&-1!==["not-current","current","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==o(i.error));return s&&i.error&&(s="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new u(i.error.code,i.error.message)),s?new t(e,i.state,r):(l("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.Ss=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}(),Ji=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.Vs=function(e,n){for(var r=JSON.parse(n),i="object"==o(r)&&r.activeTargetIds instanceof Array,s=je(),a=0;i&&a<r.activeTargetIds.length;++a)i=K(r.activeTargetIds[a]),s=s.add(r.activeTargetIds[a]);return i?new t(e,s):(l("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),Zi=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.Vs=function(e){var n=JSON.parse(e);return"object"==o(n)&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new t(n.clientId,n.onlineState):(l("SharedClientState","Failed to parse online state: "+e),null)},t}(),to=function(){function t(){this.activeTargetIds=je()}return t.prototype.Ds=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.Cs=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.Ss=function(){var t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),eo=function(){function t(t,e,n,r,i){this.window=t,this.Se=e,this.persistenceKey=n,this.Ns=r,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.xs=this.ks.bind(this),this.Fs=new Ae(w),this.started=!1,this.$s=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Os=Wi(this.persistenceKey,this.Ns),this.Ms=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.Fs=this.Fs.insert(this.Ns,new to),this.Ls=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Bs=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.qs=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.Us=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.Ks=function(t){return"firestore_bundle_loaded_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.xs)}return t.yt=function(t){return!(!t||!t.localStorage)},t.prototype.start=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,s,a,u,c,h,f,l=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,this.syncEngine.fn()];case 1:for(t=e.sent(),n=0,r=t;n<r.length;n++)(i=r[n])!==this.Ns&&(o=this.getItem(Wi(this.persistenceKey,i)))&&(s=Ji.Vs(i,o))&&(this.Fs=this.Fs.insert(s.clientId,s));for(this.Qs(),(a=this.storage.getItem(this.Us))&&(u=this.js(a))&&this.Ws(u),c=0,h=this.$s;c<h.length;c++)f=h[c],this.ks(f);return this.$s=[],this.window.addEventListener("pagehide",function(){return l.shutdown()}),this.started=!0,[2]}})})},t.prototype.writeSequenceNumber=function(t){this.setItem(this.Ms,JSON.stringify(t))},t.prototype.getAllActiveQueryTargets=function(){return this.Gs(this.Fs)},t.prototype.isActiveQueryTarget=function(t){var e=!1;return this.Fs.forEach(function(n,r){r.activeTargetIds.has(t)&&(e=!0)}),e},t.prototype.addPendingMutation=function(t){this.zs(t,"pending")},t.prototype.updateMutationState=function(t,e,n){this.zs(t,e,n),this.Hs(t)},t.prototype.addLocalQueryTarget=function(t){var e="not-current";if(this.isActiveQueryTarget(t)){var n=this.storage.getItem(Yi(this.persistenceKey,t));if(n){var r=Xi.Vs(t,n);r&&(e=r.state)}}return this.Js.Ds(t),this.Qs(),e},t.prototype.removeLocalQueryTarget=function(t){this.Js.Cs(t),this.Qs()},t.prototype.isLocalQueryTarget=function(t){return this.Js.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){this.removeItem(Yi(this.persistenceKey,t))},t.prototype.updateQueryState=function(t,e,n){this.Ys(t,e,n)},t.prototype.handleUserChange=function(t,e,n){var r=this;e.forEach(function(t){r.Hs(t)}),this.currentUser=t,n.forEach(function(t){r.addPendingMutation(t)})},t.prototype.setOnlineState=function(t){this.Xs(t)},t.prototype.notifyBundleLoaded=function(){this.Zs()},t.prototype.shutdown=function(){this.started&&(this.window.removeEventListener("storage",this.xs),this.removeItem(this.Os),this.started=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return f("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){f("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){f("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.ks=function(t){var n=this,r=t;if(r.storageArea===this.storage){if(f("SharedClientState","EVENT",r.key,r.newValue),r.key===this.Os)return void l("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Se.enqueueRetryable(function(){return(0,e.__awaiter)(n,void 0,void 0,function(){var t,n,i,o,a,u;return(0,e.__generator)(this,function(e){if(this.started){if(null!==r.key)if(this.Ls.test(r.key)){if(null==r.newValue)return t=this.ti(r.key),[2,this.ei(t,null)];if(n=this.ni(r.key,r.newValue))return[2,this.ei(n.clientId,n)]}else if(this.Bs.test(r.key)){if(null!==r.newValue&&(i=this.si(r.key,r.newValue)))return[2,this.ii(i)]}else if(this.qs.test(r.key)){if(null!==r.newValue&&(o=this.ri(r.key,r.newValue)))return[2,this.oi(o)]}else if(r.key===this.Us){if(null!==r.newValue&&(a=this.js(r.newValue)))return[2,this.Ws(a)]}else if(r.key===this.Ms)(u=function(t){var e=s.o;if(null!=t)try{var n=JSON.parse(t);v("number"==typeof n),e=n}catch(t){l("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(r.newValue))!==s.o&&this.sequenceNumberHandler(u);else if(r.key===this.Ks)return[2,this.syncEngine.ci()]}else this.$s.push(r);return[2]})})})}},Object.defineProperty(t.prototype,"Js",{get:function(){return this.Fs.get(this.Ns)},enumerable:!1,configurable:!0}),t.prototype.Qs=function(){this.setItem(this.Os,this.Js.Ss())},t.prototype.zs=function(t,e,n){var r=new $i(this.currentUser,t,e,n),i=Hi(this.persistenceKey,this.currentUser,t);this.setItem(i,r.Ss())},t.prototype.Hs=function(t){var e=Hi(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.Xs=function(t){var e={clientId:this.Ns,onlineState:t};this.storage.setItem(this.Us,JSON.stringify(e))},t.prototype.Ys=function(t,e,n){var r=Yi(this.persistenceKey,t),i=new Xi(t,e,n);this.setItem(r,i.Ss())},t.prototype.Zs=function(){this.setItem(this.Ks,"value-not-used")},t.prototype.ti=function(t){var e=this.Ls.exec(t);return e?e[1]:null},t.prototype.ni=function(t,e){var n=this.ti(t);return Ji.Vs(n,e)},t.prototype.si=function(t,e){var n=this.Bs.exec(t),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return $i.Vs(new zi(i),r,e)},t.prototype.ri=function(t,e){var n=this.qs.exec(t),r=Number(n[1]);return Xi.Vs(r,e)},t.prototype.js=function(t){return Zi.Vs(t)},t.prototype.ii=function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){return t.user.uid===this.currentUser.uid?[2,this.syncEngine.ui(t.batchId,t.state,t.error)]:(f("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])})})},t.prototype.oi=function(t){return this.syncEngine.ai(t.targetId,t.state,t.error)},t.prototype.ei=function(t,e){var n=this,r=e?this.Fs.insert(t,e):this.Fs.remove(t),i=this.Gs(this.Fs),o=this.Gs(r),s=[],a=[];return o.forEach(function(t){i.has(t)||s.push(t)}),i.forEach(function(t){o.has(t)||a.push(t)}),this.syncEngine.hi(s,a).then(function(){n.Fs=r})},t.prototype.Ws=function(t){this.Fs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)},t.prototype.Gs=function(t){var e=je();return t.forEach(function(t,n){e=e.unionWith(n.activeTargetIds)}),e},t}(),no=function(){function t(){this.li=new to,this.fi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}return t.prototype.addPendingMutation=function(t){},t.prototype.updateMutationState=function(t,e,n){},t.prototype.addLocalQueryTarget=function(t){return this.li.Ds(t),this.fi[t]||"not-current"},t.prototype.updateQueryState=function(t,e,n){this.fi[t]=e},t.prototype.removeLocalQueryTarget=function(t){this.li.Cs(t)},t.prototype.isLocalQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.clearQueryState=function(t){delete this.fi[t]},t.prototype.getAllActiveQueryTargets=function(){return this.li.activeTargetIds},t.prototype.isActiveQueryTarget=function(t){return this.li.activeTargetIds.has(t)},t.prototype.start=function(){return this.li=new to,Promise.resolve()},t.prototype.handleUserChange=function(t,e,n){},t.prototype.setOnlineState=function(t){},t.prototype.shutdown=function(){},t.prototype.writeSequenceNumber=function(t){},t.prototype.notifyBundleLoaded=function(){},t}(),ro=function(){function t(){}return t.prototype.di=function(t){},t.prototype.shutdown=function(){},t}(),io=function(){function t(){var t=this;this.wi=function(){return t._i()},this.mi=function(){return t.yi()},this.gi=[],this.pi()}return t.prototype.di=function(t){this.gi.push(t)},t.prototype.shutdown=function(){window.removeEventListener("online",this.wi),window.removeEventListener("offline",this.mi)},t.prototype.pi=function(){window.addEventListener("online",this.wi),window.addEventListener("offline",this.mi)},t.prototype._i=function(){f("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(0)},t.prototype.yi=function(){f("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.gi;t<e.length;t++)(0,e[t])(1)},t.yt=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),oo={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},so=function(){function t(t){this.Ei=t.Ei,this.Ti=t.Ti}return t.prototype.Ii=function(t){this.Ai=t},t.prototype.Ri=function(t){this.bi=t},t.prototype.onMessage=function(t){this.vi=t},t.prototype.close=function(){this.Ti()},t.prototype.send=function(t){this.Ei(t)},t.prototype.Pi=function(){this.Ai()},t.prototype.Vi=function(t){this.bi(t)},t.prototype.Si=function(t){this.vi(t)},t}(),ao=function(t){function r(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n.autoDetectLongPolling=e.autoDetectLongPolling,n.useFetchStreams=e.useFetchStreams,n}return(0,e.__extends)(r,t),r.prototype.Fi=function(t,e,n,r){return new Promise(function(o,s){var c=new i.XhrIo;c.listenOnce(i.EventType.COMPLETE,function(){try{switch(c.getLastErrorCode()){case i.ErrorCode.NO_ERROR:var e=c.getResponseJson();f("Connection","XHR received:",JSON.stringify(e)),o(e);break;case i.ErrorCode.TIMEOUT:f("Connection",'RPC "'+t+'" timed out'),s(new u(a.DEADLINE_EXCEEDED,"Request time out"));break;case i.ErrorCode.HTTP_ERROR:var n=c.getStatus();if(f("Connection",'RPC "'+t+'" failed with status:',n,"response text:",c.getResponseText()),n>0){var r=c.getResponseJson().error;if(r&&r.status&&r.message){var h=function(t){var e=r.status.toLowerCase().replace(/_/g,"-");return Object.values(a).indexOf(e)>=0?e:a.UNKNOWN}();s(new u(h,r.message))}else s(new u(a.UNKNOWN,"Server responded with status "+c.getStatus()))}else s(new u(a.UNAVAILABLE,"Connection failed."));break;default:y()}}finally{f("Connection",'RPC "'+t+'" completed.')}});var h=JSON.stringify(r);c.send(e,"POST",h,n,15)})},r.prototype.Oi=function(t,e){var r=[this.Di,"/","google.firestore.v1.Firestore","/",t,"/channel"],o=(0,i.createWebChannelTransport)(),s=(0,i.getStatEventTarget)(),c={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(c.xmlHttpFactory=new i.FetchXmlHttpFactory({})),this.ki(c.initMessageHeaders,e),(0,n.isMobileCordova)()||(0,n.isReactNative)()||(0,n.isElectron)()||(0,n.isIE)()||(0,n.isUWP)()||(0,n.isBrowserExtension)()||(c.httpHeadersOverwriteParam="$httpHeaders");var h=r.join("");f("Connection","Creating WebChannel: "+h,c);var l=o.createWebChannel(h,c),p=!1,y=!1,m=new so({Ei:function(t){y?f("Connection","Not sending because WebChannel is closed:",t):(p||(f("Connection","Opening WebChannel transport."),l.open(),p=!0),f("Connection","WebChannel sending:",t),l.send(t))},Ti:function(){return l.close()}}),g=function(t,e,n){t.listen(e,function(t){try{n(t)}catch(t){setTimeout(function(){throw t},0)}})};return g(l,i.WebChannel.EventType.OPEN,function(){y||f("Connection","WebChannel transport opened.")}),g(l,i.WebChannel.EventType.CLOSE,function(){y||(y=!0,f("Connection","WebChannel transport closed"),m.Vi())}),g(l,i.WebChannel.EventType.ERROR,function(t){y||(y=!0,d("Connection","WebChannel transport errored:",t),m.Vi(new u(a.UNAVAILABLE,"The operation could not be completed")))}),g(l,i.WebChannel.EventType.MESSAGE,function(t){var e;if(!y){var n=t.data[0];v(!!n);var r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){f("Connection","WebChannel received error:",i);var o=i.status,s=function(t){var e=be[o];if(void 0!==e)return De(e)}(),c=i.message;void 0===s&&(s=a.INTERNAL,c="Unknown error status: "+o+" with message "+i.message),y=!0,m.Vi(new u(s,c)),l.close()}else f("Connection","WebChannel received:",n),m.Si(n)}}),g(s,i.Event.STAT_EVENT,function(t){t.stat===i.Stat.PROXY?f("Connection","Detected buffering proxy"):t.stat===i.Stat.NOPROXY&&f("Connection","Detected no buffering proxy")}),setTimeout(function(){m.Pi()},0),m},r}(function(){function t(t){this.databaseInfo=t,this.databaseId=t.databaseId;var e=t.ssl?"https":"http";this.Di=e+"://"+t.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}return t.prototype.Ni=function(t,e,n,r){var i=this.xi(t,e);f("RestConnection","Sending: ",i,n);var o={};return this.ki(o,r),this.Fi(t,i,o,n).then(function(t){return f("RestConnection","Received: ",t),t},function(e){throw d("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e})},t.prototype.$i=function(t,e,n,r){return this.Ni(t,e,n,r)},t.prototype.ki=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/8.10.0",t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(var n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])},t.prototype.xi=function(t,e){var n=oo[t];return this.Di+"/v1/"+e+":"+n},t}());function uo(){return"undefined"!=typeof window?window:null}function co(){return"undefined"!=typeof document?document:null}function ho(t){return new tn(t,!0)}var fo=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.Se=t,this.timerId=e,this.Mi=n,this.Li=r,this.Bi=i,this.qi=0,this.Ui=null,this.Ki=Date.now(),this.reset()}return t.prototype.reset=function(){this.qi=0},t.prototype.Qi=function(){this.qi=this.Bi},t.prototype.ji=function(t){var e=this;this.cancel();var n=Math.floor(this.qi+this.Wi()),r=Math.max(0,Date.now()-this.Ki),i=Math.max(0,n-r);i>0&&f("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.qi+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.Ui=this.Se.enqueueAfterDelay(this.timerId,i,function(){return e.Ki=Date.now(),t()}),this.qi*=this.Li,this.qi<this.Mi&&(this.qi=this.Mi),this.qi>this.Bi&&(this.qi=this.Bi)},t.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},t.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},t.prototype.Wi=function(){return(Math.random()-.5)*this.qi},t}(),lo=function(){function t(t,e,n,r,i,o){this.Se=t,this.zi=n,this.Hi=r,this.Ji=i,this.listener=o,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new fo(t,e)}return t.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.er=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.nr()},t.prototype.stop=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(t){switch(t.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},t.prototype.sr=function(){this.state=0,this.Zi.reset()},t.prototype.ir=function(){var t=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,function(){return t.rr()}))},t.prototype.cr=function(t){this.ur(),this.stream.send(t)},t.prototype.rr=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(t){return this.er()?[2,this.close(0)]:[2]})})},t.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},t.prototype.close=function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==t?this.Zi.reset():n&&n.code===a.RESOURCE_EXHAUSTED?(l(n.toString()),l("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):n&&n.code===a.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Ri(n)];case 1:return e.sent(),[2]}})})},t.prototype.ar=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.hr(this.Yi),n=this.Yi;this.Ji.getToken().then(function(e){t.Yi===n&&t.lr(e)},function(n){e(function(){var e=new u(a.UNKNOWN,"Fetching auth token failed: "+n.message);return t.dr(e)})})},t.prototype.lr=function(t){var e=this,n=this.hr(this.Yi);this.stream=this.wr(t),this.stream.Ii(function(){n(function(){return e.state=2,e.listener.Ii()})}),this.stream.Ri(function(t){n(function(){return e.dr(t)})}),this.stream.onMessage(function(t){n(function(){return e.onMessage(t)})})},t.prototype.nr=function(){var t=this;this.state=4,this.Zi.ji(function(){return(0,e.__awaiter)(t,void 0,void 0,function(){return(0,e.__generator)(this,function(t){return this.state=0,this.start(),[2]})})})},t.prototype.dr=function(t){return f("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.hr=function(t){var e=this;return function(n){e.Se.enqueueAndForget(function(){return e.Yi===t?n():(f("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},t}(),po=function(t){function n(e,n,r,i,o){var s=this;return(s=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).R=i,s}return(0,e.__extends)(n,t),n.prototype.wr=function(t){return this.Hi.Oi("Listen",t)},n.prototype.onMessage=function(t){this.Zi.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:y()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.I?(v(void 0===e||"string"==typeof e),L.fromBase64String(e||"")):(v(void 0===e||e instanceof Uint8Array),L.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),s=(c=e.targetChange.cause)&&function(t){var e=void 0===t.code?a.UNKNOWN:De(t.code);return new u(e,t.message||"")}(c);n=new We(r,i,o,s||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=on(r.document.updateTime);var c=new ot({mapValue:{fields:r.document.fields}}),h=(s=at.newFoundDocument(i,o,c),r.targetIds||[]),f=r.removedTargetIds||[];n=new Ge(h,f,s.key,s)}else if("documentDelete"in e)e.documentDelete,(r=e.documentDelete).document,i=cn(t,r.document),o=r.readTime?on(r.readTime):T.min(),c=at.newNoDocument(i,o),s=r.removedTargetIds||[],n=new Ge([],s,c.key,c);else if("documentRemove"in e)e.documentRemove,(r=e.documentRemove).document,i=cn(t,r.document),o=r.removedTargetIds||[],n=new Ge([],o,i,null);else{if(!("filter"in e))return y();e.filter;var l=e.filter;l.targetId,r=l.count||0,i=new Se(r),o=l.targetId,n=new ze(o,i)}return n}(this.R,t),n=function(t){if(!("targetChange"in t))return T.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?T.min():e.readTime?on(e.readTime):T.min()}(t);return this.listener._r(e,n)},n.prototype.mr=function(t){var e={};e.database=ln(this.R),e.addTarget=function(t,e){var n,r=e.target;return(n=lt(r)?{documents:gn(t,r)}:{query:_n(t,r)}).targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=nn(t,e.resumeToken):e.snapshotVersion.compareTo(T.min())>0&&(n.readTime=en(t,e.snapshotVersion.toTimestamp())),n}(this.R,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 y()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.R,t);n&&(e.labels=n),this.cr(e)},n.prototype.yr=function(t){var e={};e.database=ln(this.R),e.removeTarget=t,this.cr(e)},n}(lo),yo=function(t){function n(e,n,r,i,o){var s=this;return(s=t.call(this,e,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).R=i,s.gr=!1,s}return(0,e.__extends)(n,t),Object.defineProperty(n.prototype,"pr",{get:function(){return this.gr},enumerable:!1,configurable:!0}),n.prototype.start=function(){this.gr=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},n.prototype.ar=function(){this.gr&&this.Er([])},n.prototype.wr=function(t){return this.Hi.Oi("Write",t)},n.prototype.onMessage=function(t){if(v(!!t.streamToken),this.lastStreamToken=t.streamToken,this.gr){this.Zi.reset();var e=function(t,e){return t&&t.length>0?(v(void 0!==e),t.map(function(t){return function(t,e){var n=t.updateTime?on(t.updateTime):on(e);return n.isEqual(T.min())&&(n=on(e)),new ae(n,t.transformResults||[])}(t,e)})):[]}(t.writeResults,t.commitTime),n=on(t.commitTime);return this.listener.Tr(n,e)}return v(!t.writeResults||0===t.writeResults.length),this.gr=!0,this.listener.Ir()},n.prototype.Ar=function(){var t={};t.database=ln(this.R),this.cr(t)},n.prototype.Er=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map(function(t){return vn(e.R,t)})};this.cr(n)},n}(lo),vo=function(t){function n(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.Hi=n,i.R=r,i.Rr=!1,i}return(0,e.__extends)(n,t),n.prototype.br=function(){if(this.Rr)throw new u(a.FAILED_PRECONDITION,"The client has already been terminated.")},n.prototype.Ni=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then(function(i){return r.Hi.Ni(t,e,n,i)}).catch(function(t){throw"FirebaseError"===t.name?(t.code===a.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new u(a.UNKNOWN,t.toString())})},n.prototype.$i=function(t,e,n){var r=this;return this.br(),this.credentials.getToken().then(function(i){return r.Hi.$i(t,e,n,i)}).catch(function(t){throw"FirebaseError"===t.name?(t.code===a.UNAUTHENTICATED&&r.credentials.invalidateToken(),t):new u(a.UNKNOWN,t.toString())})},n.prototype.terminate=function(){this.Rr=!0},n}(function(){}),mo=function(){function t(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.vr=0,this.Pr=null,this.Vr=!0}return t.prototype.Sr=function(){var t=this;0===this.vr&&(this.Dr("Unknown"),this.Pr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,function(){return t.Pr=null,t.Cr("Backend didn't respond within 10 seconds."),t.Dr("Offline"),Promise.resolve()}))},t.prototype.Nr=function(t){"Online"===this.state?this.Dr("Unknown"):(this.vr++,this.vr>=1&&(this.kr(),this.Cr("Connection failed 1 times. Most recent error: "+t.toString()),this.Dr("Offline")))},t.prototype.set=function(t){this.kr(),this.vr=0,"Online"===t&&(this.Vr=!1),this.Dr(t)},t.prototype.Dr=function(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))},t.prototype.Cr=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.Vr?(l(e),this.Vr=!1):f("OnlineStateTracker",e)},t.prototype.kr=function(){null!==this.Pr&&(this.Pr.cancel(),this.Pr=null)},t}(),go=function(t,n,r,i,o){var s=this;this.localStore=t,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Fr=[],this.$r=new Map,this.Or=new Set,this.Mr=[],this.Lr=o,this.Lr.di(function(t){r.enqueueAndForget(function(){return(0,e.__awaiter)(s,void 0,void 0,function(){return(0,e.__generator)(this,function(t){switch(t.label){case 0:return Do(this)?(f("RemoteStore","Restarting streams for network reachability change."),[4,function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return(n=m(t)).Or.add(4),[4,wo(n)];case 1:return e.sent(),n.Br.set("Unknown"),n.Or.delete(4),[4,_o(n)];case 2:return e.sent(),[2]}})})}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})})}),this.Br=new mo(r,i)};function _o(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:if(!Do(t))return[3,4];n=0,r=t.Mr,e.label=1;case 1:return n<r.length?[4,(0,r[n])(!0)]:[3,4];case 2:e.sent(),e.label=3;case 3:return n++,[3,1];case 4:return[2]}})})}function wo(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:n=0,r=t.Mr,e.label=1;case 1:return n<r.length?[4,(0,r[n])(!1)]:[3,4];case 2:e.sent(),e.label=3;case 3:return n++,[3,1];case 4:return[2]}})})}function bo(t,e){var n=m(t);n.$r.has(e.targetId)||(n.$r.set(e.targetId,e),No(n)?So(n):jo(n).er()&&Eo(n,e))}function Io(t,e){var n=m(t),r=jo(n);n.$r.delete(e),r.er()&&To(n,e),0===n.$r.size&&(r.er()?r.ir():Do(n)&&n.Br.set("Unknown"))}function Eo(t,e){t.qr.U(e.targetId),jo(t).mr(e)}function To(t,e){t.qr.U(e),jo(t).yr(e)}function So(t){t.qr=new Ye({getRemoteKeysForTarget:function(e){return t.remoteSyncer.getRemoteKeysForTarget(e)},lt:function(e){return t.$r.get(e)||null}}),jo(t).start(),t.Br.Sr()}function No(t){return Do(t)&&!jo(t).tr()&&t.$r.size>0}function Do(t){return 0===m(t).Or.size}function Ao(t){t.qr=void 0}function xo(t){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){return t.$r.forEach(function(e,n){Eo(t,e)}),[2]})})}function ko(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){return Ao(t),No(t)?(t.Br.Nr(n),So(t)):t.Br.set("Unknown"),[2]})})}function Co(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s;return(0,e.__generator)(this,function(a){switch(a.label){case 0:if(t.Br.set("Online"),!(n instanceof We&&2===n.state&&n.cause))return[3,6];a.label=1;case 1:return a.trys.push([1,3,,5]),[4,function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s;return(0,e.__generator)(this,function(e){switch(e.label){case 0:r=n.cause,i=0,o=n.targetIds,e.label=1;case 1:return i<o.length?(s=o[i],t.$r.has(s)?[4,t.remoteSyncer.rejectListen(s,r)]:[3,3]):[3,5];case 2:e.sent(),t.$r.delete(s),t.qr.removeTarget(s),e.label=3;case 3:e.label=4;case 4:return i++,[3,1];case 5:return[2]}})})}(t,n)];case 2:return a.sent(),[3,5];case 3:return i=a.sent(),f("RemoteStore","Failed to remove targets %s: %s ",n.targetIds.join(","),i),[4,Ro(t,i)];case 4:return a.sent(),[3,5];case 5:return[3,13];case 6:if(n instanceof Ge?t.qr.X(n):n instanceof ze?t.qr.rt(n):t.qr.et(n),r.isEqual(T.min()))return[3,13];a.label=7;case 7:return a.trys.push([7,11,,13]),[4,Ti(t.localStore)];case 8:return o=a.sent(),r.compareTo(o)>=0?[4,function(t,e){var n=t.qr.ut(e);return n.targetChanges.forEach(function(n,r){if(n.resumeToken.approximateByteSize()>0){var i=t.$r.get(r);i&&t.$r.set(r,i.withResumeToken(n.resumeToken,e))}}),n.targetMismatches.forEach(function(e){var n=t.$r.get(e);if(n){t.$r.set(e,n.withResumeToken(L.EMPTY_BYTE_STRING,n.snapshotVersion)),To(t,e);var r=new vr(n.target,e,1,n.sequenceNumber);Eo(t,r)}}),t.remoteSyncer.applyRemoteEvent(n)}(t,r)]:[3,10];case 9:a.sent(),a.label=10;case 10:return[3,13];case 11:return f("RemoteStore","Failed to raise snapshot:",s=a.sent()),[4,Ro(t,s)];case 12:return a.sent(),[3,13];case 13:return[2]}})})}function Ro(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i=this;return(0,e.__generator)(this,function(o){switch(o.label){case 0:if(!ar(n))throw n;return t.Or.add(1),[4,wo(t)];case 1:return o.sent(),t.Br.set("Offline"),r||(r=function(){return Ti(t.localStore)}),t.asyncQueue.enqueueRetryable(function(){return(0,e.__awaiter)(i,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return f("RemoteStore","Retrying IndexedDB access"),[4,r()];case 1:return e.sent(),t.Or.delete(1),[4,_o(t)];case 2:return e.sent(),[2]}})})}),[2]}})})}function Lo(t,e){return e().catch(function(n){return Ro(t,n,e)})}function Oo(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n,r,i,o,s;return(0,e.__generator)(this,function(e){switch(e.label){case 0:n=m(t),r=Ko(n),i=n.Fr.length>0?n.Fr[n.Fr.length-1].batchId:-1,e.label=1;case 1:if(!function(t){return Do(t)&&t.Fr.length<10}(n))return[3,7];e.label=2;case 2:return e.trys.push([2,4,,6]),[4,Di(n.localStore,i)];case 3:return null===(o=e.sent())?(0===n.Fr.length&&r.ir(),[3,7]):(i=o.batchId,function(t,e){t.Fr.push(e);var n=Ko(t);n.er()&&n.pr&&n.Er(e.mutations)}(n,o),[3,6]);case 4:return s=e.sent(),[4,Ro(n,s)];case 5:return e.sent(),[3,6];case 6:return[3,1];case 7:return Po(n)&&Fo(n),[2]}})})}function Po(t){return Do(t)&&!Ko(t).tr()&&t.Fr.length>0}function Fo(t){Ko(t).start()}function Mo(t){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){return Ko(t).Ar(),[2]})})}function Vo(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n,r,i,o;return(0,e.__generator)(this,function(e){for(n=Ko(t),r=0,i=t.Fr;r<i.length;r++)o=i[r],n.Er(o.mutations);return[2]})})}function qo(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return i=t.Fr.shift(),o=yr.from(i,n,r),[4,Lo(t,function(){return t.remoteSyncer.applySuccessfulWrite(o)})];case 1:return e.sent(),[4,Oo(t)];case 2:return e.sent(),[2]}})})}function Uo(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(r){switch(r.label){case 0:return n&&Ko(t).pr?[4,function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return Ne(i=n.code)&&i!==a.ABORTED?(r=t.Fr.shift(),Ko(t).sr(),[4,Lo(t,function(){return t.remoteSyncer.rejectFailedWrite(r.batchId,n)})]):[3,3];case 1:return e.sent(),[4,Oo(t)];case 2:e.sent(),e.label=3;case 3:return[2]}})})}(t,n)]:[3,2];case 1:r.sent(),r.label=2;case 2:return Po(t)&&Fo(t),[2]}})})}function Bo(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=m(t),n?(r.Or.delete(2),[4,_o(r)]):[3,2];case 1:return e.sent(),[3,5];case 2:return n?[3,4]:(r.Or.add(2),[4,wo(r)]);case 3:e.sent(),r.Br.set("Unknown"),e.label=4;case 4:e.label=5;case 5:return[2]}})})}function jo(t){var n=this;return t.Ur||(t.Ur=function(t,e,n){var r=m(t);return r.br(),new po(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:xo.bind(null,t),Ri:ko.bind(null,t),_r:Co.bind(null,t)}),t.Mr.push(function(r){return(0,e.__awaiter)(n,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r?(t.Ur.sr(),No(t)?So(t):t.Br.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.Ur.stop()];case 2:e.sent(),Ao(t),e.label=3;case 3:return[2]}})})})),t.Ur}function Ko(t){var n=this;return t.Kr||(t.Kr=function(t,e,n){var r=m(t);return r.br(),new yo(e,r.Hi,r.credentials,r.R,n)}(t.datastore,t.asyncQueue,{Ii:Mo.bind(null,t),Ri:Uo.bind(null,t),Ir:Vo.bind(null,t),Tr:qo.bind(null,t)}),t.Mr.push(function(r){return(0,e.__awaiter)(n,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r?(t.Kr.sr(),[4,Oo(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.Kr.stop()];case 3:e.sent(),t.Fr.length>0&&(f("RemoteStore","Stopping write stream with "+t.Fr.length+" pending writes"),t.Fr=[]),e.label=4;case 4:return[2]}})})})),t.Kr}var Qo=function(){function t(t,e,n,r,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new er,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(function(t){})}return t.createAndSchedule=function(e,n,r,i,o){var s=new t(e,n,Date.now()+r,i,o);return s.start(r),s},t.prototype.start=function(t){var e=this;this.timerHandle=setTimeout(function(){return e.handleDelayElapsed()},t)},t.prototype.skipDelay=function(){return this.handleDelayElapsed()},t.prototype.cancel=function(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new u(a.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},t.prototype.handleDelayElapsed=function(){var t=this;this.asyncQueue.enqueueAndForget(function(){return null!==t.timerHandle?(t.clearTimeout(),t.op().then(function(e){return t.deferred.resolve(e)})):Promise.resolve()})},t.prototype.clearTimeout=function(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)},t}();function Go(t,e){if(l("AsyncQueue",e+": "+t),ar(t))return new u(a.UNAVAILABLE,e+": "+t);throw t}var zo=function(){function t(t){this.comparator=t?function(e,n){return t(e,n)||Q.comparator(e.key,n.key)}:function(t,e){return Q.comparator(t.key,e.key)},this.keyedMap=Fe(),this.sortedSet=new Ae(this.comparator)}return t.emptySet=function(e){return new t(e.comparator)},t.prototype.has=function(t){return null!=this.keyedMap.get(t)},t.prototype.get=function(t){return this.keyedMap.get(t)},t.prototype.first=function(){return this.sortedSet.minKey()},t.prototype.last=function(){return this.sortedSet.maxKey()},t.prototype.isEmpty=function(){return this.sortedSet.isEmpty()},t.prototype.indexOf=function(t){var e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.sortedSet.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.sortedSet.inorderTraversal(function(e,n){return t(e),!1})},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.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.sortedSet.getIterator(),r=e.sortedSet.getIterator();n.hasNext();){var i=n.getNext().key,o=r.getNext().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.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r},t}(),Wo=function(){function t(){this.Qr=new Ae(Q.comparator)}return t.prototype.track=function(t){var e=t.doc.key,n=this.Qr.get(e);n?0!==t.type&&3===n.type?this.Qr=this.Qr.insert(e,t):3===t.type&&1!==n.type?this.Qr=this.Qr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Qr=this.Qr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Qr=this.Qr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Qr=this.Qr.remove(e):1===t.type&&2===n.type?this.Qr=this.Qr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Qr=this.Qr.insert(e,{type:2,doc:t.doc}):y():this.Qr=this.Qr.insert(e,t)},t.prototype.jr=function(){var t=[];return this.Qr.inorderTraversal(function(e,n){t.push(n)}),t},t}(),Ho=function(){function t(t,e,n,r,i,o,s,a){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=s,this.excludesMetadataChanges=a}return t.fromInitialDocuments=function(e,n,r,i){var o=[];return n.forEach(function(t){o.push({type:0,doc:t})}),new t(e,n,zo.emptySet(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.mutatedKeys.isEmpty()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&qt(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))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}(),Yo=function(){this.Wr=void 0,this.listeners=[]},$o=function(){this.queries=new ni(function(t){return Ut(t)},qt),this.onlineState="Unknown",this.Gr=new Set};function Xo(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,u,c;return(0,e.__generator)(this,function(e){switch(e.label){case 0:if(r=m(t),i=n.query,o=!1,(s=r.queries.get(i))||(o=!0,s=new Yo),!o)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),a=s,[4,r.onListen(i)];case 2:return a.Wr=e.sent(),[3,4];case 3:return u=e.sent(),c=Go(u,"Initialization of query '"+Bt(n.query)+"' failed"),[2,void n.onError(c)];case 4:return r.queries.set(i,s),s.listeners.push(n),n.zr(r.onlineState),s.Wr&&n.Hr(s.Wr)&&es(r),[2]}})})}function Jo(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a;return(0,e.__generator)(this,function(e){return r=m(t),i=n.query,o=!1,(s=r.queries.get(i))&&(a=s.listeners.indexOf(n))>=0&&(s.listeners.splice(a,1),o=0===s.listeners.length),o?[2,(r.queries.delete(i),r.onUnlisten(i))]:[2]})})}function Zo(t,e){for(var n=m(t),r=!1,i=0,o=e;i<o.length;i++){var s=o[i],a=s.query,u=n.queries.get(a);if(u){for(var c=0,h=u.listeners;c<h.length;c++)h[c].Hr(s)&&(r=!0);u.Wr=s}}r&&es(n)}function ts(t,e,n){var r=m(t),i=r.queries.get(e);if(i)for(var o=0,s=i.listeners;o<s.length;o++)s[o].onError(n);r.queries.delete(e)}function es(t){t.Gr.forEach(function(t){t.next()})}var ns=function(){function t(t,e,n){this.query=t,this.Jr=e,this.Yr=!1,this.Xr=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Hr=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 Ho(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}var o=!1;return this.Yr?this.Zr(t)&&(this.Jr.next(t),o=!0):this.eo(t,this.onlineState)&&(this.no(t),o=!0),this.Xr=t,o},t.prototype.onError=function(t){this.Jr.error(t)},t.prototype.zr=function(t){this.onlineState=t;var e=!1;return this.Xr&&!this.Yr&&this.eo(this.Xr,t)&&(this.no(this.Xr),e=!0),e},t.prototype.eo=function(t,e){if(!t.fromCache)return!0;var n="Offline"!==e;return!(this.options.so&&n||t.docs.isEmpty()&&"Offline"!==e)},t.prototype.Zr=function(t){if(t.docChanges.length>0)return!0;var e=this.Xr&&this.Xr.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges},t.prototype.no=function(t){t=Ho.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.Yr=!0,this.Jr.next(t)},t}(),rs=function(){function t(t,e){this.payload=t,this.byteLength=e}return t.prototype.io=function(){return"metadata"in this.payload},t}(),is=function(){function t(t){this.R=t}return t.prototype.qn=function(t){return cn(this.R,t)},t.prototype.Un=function(t){return t.metadata.exists?yn(this.R,t.document,!1):at.newNoDocument(this.qn(t.metadata.name),this.Kn(t.metadata.readTime))},t.prototype.Kn=function(t){return on(t)},t}(),os=function(){function t(t,e,n){this.ro=t,this.localStore=e,this.R=n,this.queries=[],this.documents=[],this.progress=ss(t)}return t.prototype.oo=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.co=function(t){for(var e=new Map,n=new is(this.R),r=0,i=t;r<i.length;r++){var o=i[r];if(o.metadata.queries)for(var s=n.qn(o.metadata.name),a=0,u=o.metadata.queries;a<u.length;a++){var c=u[a],h=(e.get(c)||Ue()).add(s);e.set(c,h)}}return e},t.prototype.complete=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,Oi(this.localStore,new is(this.R),this.documents,this.ro.id)];case 1:t=e.sent(),n=this.co(this.documents),r=0,i=this.queries,e.label=2;case 2:return r<i.length?(o=i[r],[4,Pi(this.localStore,o,n.get(o.name))]):[3,5];case 3:e.sent(),e.label=4;case 4:return r++,[3,2];case 5:return[2,(this.progress.taskState="Success",new vi(Object.assign({},this.progress),t))]}})})},t}();function ss(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}var as=function(t){this.key=t},us=function(t){this.key=t},cs=function(){function t(t,e){this.query=t,this.uo=e,this.ao=null,this.current=!1,this.ho=Ue(),this.mutatedKeys=Ue(),this.lo=Kt(t),this.fo=new zo(this.lo)}return Object.defineProperty(t.prototype,"wo",{get:function(){return this.uo},enumerable:!1,configurable:!0}),t.prototype._o=function(t,e){var n=this,r=e?e.mo:new Wo,i=e?e.fo:this.fo,o=e?e.mutatedKeys:this.mutatedKeys,s=i,a=!1,u=Ct(this.query)&&i.size===this.query.limit?i.last():null,c=Rt(this.query)&&i.size===this.query.limit?i.first():null;if(t.inorderTraversal(function(t,e){var h=i.get(t),f=jt(n.query,e)?e:null,l=!!h&&n.mutatedKeys.has(h.key),d=!!f&&(f.hasLocalMutations||n.mutatedKeys.has(f.key)&&f.hasCommittedMutations),p=!1;h&&f?h.data.isEqual(f.data)?l!==d&&(r.track({type:3,doc:f}),p=!0):n.yo(h,f)||(r.track({type:2,doc:f}),p=!0,(u&&n.lo(f,u)>0||c&&n.lo(f,c)<0)&&(a=!0)):!h&&f?(r.track({type:0,doc:f}),p=!0):h&&!f&&(r.track({type:1,doc:h}),p=!0,(u||c)&&(a=!0)),p&&(f?(s=s.add(f),o=d?o.add(t):o.delete(t)):(s=s.delete(t),o=o.delete(t)))}),Ct(this.query)||Rt(this.query))for(;s.size>this.query.limit;){var h=Ct(this.query)?s.last():s.first();s=s.delete(h.key),o=o.delete(h.key),r.track({type:1,doc:h})}return{fo:s,mo:r,Nn:a,mutatedKeys:o}},t.prototype.yo=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},t.prototype.applyChanges=function(t,e,n){var r=this,i=this.fo;this.fo=t.fo,this.mutatedKeys=t.mutatedKeys;var o=t.mo.jr();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 y()}};return n(t)-n(e)}(t.type,e.type)||r.lo(t.doc,e.doc)}),this.po(n);var s=e?this.Eo():[],a=0===this.ho.size&&this.current?1:0,u=a!==this.ao;return this.ao=a,0!==o.length||u?{snapshot:new Ho(this.query,t.fo,i,o,t.mutatedKeys,0===a,u,!1),To:s}:{To:s}},t.prototype.zr=function(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({fo:this.fo,mo:new Wo,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},t.prototype.Io=function(t){return!this.uo.has(t)&&!!this.fo.has(t)&&!this.fo.get(t).hasLocalMutations},t.prototype.po=function(t){var e=this;t&&(t.addedDocuments.forEach(function(t){return e.uo=e.uo.add(t)}),t.modifiedDocuments.forEach(function(t){}),t.removedDocuments.forEach(function(t){return e.uo=e.uo.delete(t)}),this.current=t.current)},t.prototype.Eo=function(){var t=this;if(!this.current)return[];var e=this.ho;this.ho=Ue(),this.fo.forEach(function(e){t.Io(e.key)&&(t.ho=t.ho.add(e.key))});var n=[];return e.forEach(function(e){t.ho.has(e)||n.push(new us(e))}),this.ho.forEach(function(t){e.has(t)||n.push(new as(t))}),n},t.prototype.Ao=function(t){this.uo=t.Bn,this.ho=Ue();var e=this._o(t.documents);return this.applyChanges(e,!0)},t.prototype.Ro=function(){return Ho.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},t}(),hs=function(t,e,n){this.query=t,this.targetId=e,this.view=n},fs=function(t){this.key=t,this.bo=!1},ls=function(){function t(t,e,n,r,i,o){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new ni(function(t){return Ut(t)},qt),this.Vo=new Map,this.So=new Set,this.Do=new Ae(Q.comparator),this.Co=new Map,this.No=new Mi,this.xo={},this.ko=new Map,this.Fo=Qr.Yt(),this.onlineState="Unknown",this.$o=void 0}return Object.defineProperty(t.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),t}();function ds(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,u;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=js(t),(s=r.Po.get(n))?(i=s.targetId,r.sharedClientState.addLocalQueryTarget(i),o=s.view.Ro(),[3,4]):[3,1];case 1:return[4,Ai(r.localStore,Mt(n))];case 2:return a=e.sent(),u=r.sharedClientState.addLocalQueryTarget(a.targetId),i=a.targetId,[4,ps(r,n,i,"current"===u)];case 3:o=e.sent(),r.isPrimaryClient&&bo(r.remoteStore,a),e.label=4;case 4:return[2,o]}})})}function ps(t,n,r,i){return(0,e.__awaiter)(this,void 0,void 0,function(){var o,s,a,u,c,h;return(0,e.__generator)(this,function(f){switch(f.label){case 0:return t.Oo=function(n,r,i){return function(t,n,r,i){return(0,e.__awaiter)(this,void 0,void 0,function(){var o,s,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return(o=n.view._o(r)).Nn?[4,ki(t.localStore,n.query,!1).then(function(t){var e=t.documents;return n.view._o(e,o)})]:[3,2];case 1:o=e.sent(),e.label=2;case 2:return s=i&&i.targetChanges.get(n.targetId),a=n.view.applyChanges(o,t.isPrimaryClient,s),[2,(Ds(t,n.targetId,a.To),a.snapshot)]}})})}(t,n,r,i)},[4,ki(t.localStore,n,!0)];case 1:return o=f.sent(),s=new cs(n,o.Bn),a=s._o(o.documents),u=Qe.createSynthesizedTargetChangeForCurrentChange(r,i&&"Offline"!==t.onlineState),c=s.applyChanges(a,t.isPrimaryClient,u),Ds(t,r,c.To),h=new hs(n,r,s),[2,(t.Po.set(n,h),t.Vo.has(r)?t.Vo.get(r).push(n):t.Vo.set(r,[n]),c.snapshot)]}})})}function ys(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=m(t),i=r.Po.get(n),(o=r.Vo.get(i.targetId)).length>1?[2,(r.Vo.set(i.targetId,o.filter(function(t){return!qt(t,n)})),void r.Po.delete(n))]:r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)?[3,2]:[4,xi(r.localStore,i.targetId,!1).then(function(){r.sharedClientState.clearQueryState(i.targetId),Io(r.remoteStore,i.targetId),Ss(r,i.targetId)}).catch(Yr)]):[3,3];case 1:e.sent(),e.label=2;case 2:return[3,5];case 3:return Ss(r,i.targetId),[4,xi(r.localStore,i.targetId,!0)];case 4:e.sent(),e.label=5;case 5:return[2]}})})}function vs(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:i=Ks(t),e.label=1;case 1:return e.trys.push([1,5,,6]),[4,function(t,e){var n,r=m(t),i=E.now(),o=e.reduce(function(t,e){return t.add(e.key)},Ue());return r.persistence.runTransaction("Locally write mutations","readwrite",function(t){return r.Mn.pn(t,o).next(function(o){n=o;for(var s=[],a=0,u=e;a<u.length;a++){var c=u[a],h=de(c,n.get(c.key));null!=h&&s.push(new me(c.key,h,st(h.value.mapValue),ue.exists(!0)))}return r._n.addMutationBatch(t,i,s,e)})}).then(function(t){return t.applyToLocalDocumentSet(n),{batchId:t.batchId,changes:n}})}(i.localStore,n)];case 2:return o=e.sent(),i.sharedClientState.addPendingMutation(o.batchId),function(t,e,n){var r=t.xo[t.currentUser.toKey()];r||(r=new Ae(w)),r=r.insert(e,n),t.xo[t.currentUser.toKey()]=r}(i,o.batchId,r),[4,ks(i,o.changes)];case 3:return e.sent(),[4,Oo(i.remoteStore)];case 4:return e.sent(),[3,6];case 5:return s=e.sent(),a=Go(s,"Failed to persist write"),r.reject(a),[3,6];case 6:return[2]}})})}function ms(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:r=m(t),e.label=1;case 1:return e.trys.push([1,4,,6]),[4,Si(r.localStore,n)];case 2:return i=e.sent(),n.targetChanges.forEach(function(t,e){var n=r.Co.get(e);n&&(v(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?n.bo=!0:t.modifiedDocuments.size>0?v(n.bo):t.removedDocuments.size>0&&(v(n.bo),n.bo=!1))}),[4,ks(r,i,n)];case 3:return e.sent(),[3,6];case 4:return[4,Yr(e.sent())];case 5:return e.sent(),[3,6];case 6:return[2]}})})}function gs(t,e,n){var r=m(t);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){var i=[];r.Po.forEach(function(t,n){var r=n.view.zr(e);r.snapshot&&i.push(r.snapshot)}),function(t,e){var n=m(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].zr(e)&&(r=!0)}),r&&es(n)}(r.eventManager,e),i.length&&r.vo._r(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function _s(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s,a,u,c;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return(i=m(t)).sharedClientState.updateQueryState(n,"rejected",r),o=i.Co.get(n),(s=o&&o.key)?(a=(a=new Ae(Q.comparator)).insert(s,at.newNoDocument(s,T.min())),u=Ue().add(s),c=new Ke(T.min(),new Map,new Ce(w),a,u),[4,ms(i,c)]):[3,2];case 1:return e.sent(),i.Do=i.Do.remove(s),i.Co.delete(n),xs(i),[3,4];case 2:return[4,xi(i.localStore,n,!1).then(function(){return Ss(i,n,r)}).catch(Yr)];case 3:e.sent(),e.label=4;case 4:return[2]}})})}function ws(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:r=m(t),i=n.batch.batchId,e.label=1;case 1:return e.trys.push([1,4,,6]),[4,Ei(r.localStore,n)];case 2:return o=e.sent(),Ts(r,i,null),Es(r,i),r.sharedClientState.updateMutationState(i,"acknowledged"),[4,ks(r,o)];case 3:return e.sent(),[3,6];case 4:return[4,Yr(e.sent())];case 5:return e.sent(),[3,6];case 6:return[2]}})})}function bs(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:i=m(t),e.label=1;case 1:return e.trys.push([1,4,,6]),[4,function(t,e){var n=m(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",function(t){var r;return n._n.lookupMutationBatch(t,e).next(function(e){return v(null!==e),r=e.keys(),n._n.removeMutationBatch(t,e)}).next(function(){return n._n.performConsistencyCheck(t)}).next(function(){return n.Mn.pn(t,r)})})}(i.localStore,n)];case 2:return o=e.sent(),Ts(i,n,r),Es(i,n),i.sharedClientState.updateMutationState(n,"rejected",r),[4,ks(i,o)];case 3:return e.sent(),[3,6];case 4:return[4,Yr(e.sent())];case 5:return e.sent(),[3,6];case 6:return[2]}})})}function Is(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:Do((r=m(t)).remoteStore)||f("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,function(t){var e=m(r.localStore);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",function(t){return e._n.getHighestUnacknowledgedBatchId(t)})}()];case 2:return-1===(i=e.sent())?[2,void n.resolve()]:((o=r.ko.get(i)||[]).push(n),r.ko.set(i,o),[3,4]);case 3:return s=e.sent(),a=Go(s,"Initialization of waitForPendingWrites() operation failed"),n.reject(a),[3,4];case 4:return[2]}})})}function Es(t,e){(t.ko.get(e)||[]).forEach(function(t){t.resolve()}),t.ko.delete(e)}function Ts(t,e,n){var r=m(t),i=r.xo[r.currentUser.toKey()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.xo[r.currentUser.toKey()]=i}}function Ss(t,e,n){void 0===n&&(n=null),t.sharedClientState.removeLocalQueryTarget(e);for(var r=0,i=t.Vo.get(e);r<i.length;r++){var o=i[r];t.Po.delete(o),n&&t.vo.Mo(o,n)}t.Vo.delete(e),t.isPrimaryClient&&t.No.Zn(e).forEach(function(e){t.No.containsKey(e)||Ns(t,e)})}function Ns(t,e){t.So.delete(e.path.canonicalString());var n=t.Do.get(e);null!==n&&(Io(t.remoteStore,n),t.Do=t.Do.remove(e),t.Co.delete(n),xs(t))}function Ds(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof as?(t.No.addReference(o.key,e),As(t,o)):o instanceof us?(f("SyncEngine","Document no longer in limbo: "+o.key),t.No.removeReference(o.key,e),t.No.containsKey(o.key)||Ns(t,o.key)):y()}}function As(t,e){var n=e.key,r=n.path.canonicalString();t.Do.get(n)||t.So.has(r)||(f("SyncEngine","New document in limbo: "+n),t.So.add(r),xs(t))}function xs(t){for(;t.So.size>0&&t.Do.size<t.maxConcurrentLimboResolutions;){var e=t.So.values().next().value;t.So.delete(e);var n=new Q(x.fromString(e)),r=t.Fo.next();t.Co.set(r,new fs(n)),t.Do=t.Do.insert(n,r),bo(t.remoteStore,new vr(Mt(kt(n.path)),r,2,s.o))}}function ks(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s,a;return(0,e.__generator)(this,function(u){switch(u.label){case 0:return i=m(t),o=[],s=[],a=[],i.Po.isEmpty()?[3,3]:(i.Po.forEach(function(t,e){a.push(i.Oo(e,n,r).then(function(t){if(t){i.isPrimaryClient&&i.sharedClientState.updateQueryState(e.targetId,t.fromCache?"not-current":"current"),o.push(t);var n=gi.Pn(e.targetId,t);s.push(n)}}))}),[4,Promise.all(a)]);case 1:return u.sent(),i.vo._r(o),[4,function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,u,c,h,l;return(0,e.__generator)(this,function(e){switch(e.label){case 0:r=m(t),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,r.persistence.runTransaction("notifyLocalViewChanges","readwrite",function(t){return nr.forEach(n,function(e){return nr.forEach(e.bn,function(n){return r.persistence.referenceDelegate.addReference(t,e.targetId,n)}).next(function(){return nr.forEach(e.vn,function(n){return r.persistence.referenceDelegate.removeReference(t,e.targetId,n)})})})})];case 2:return e.sent(),[3,4];case 3:if(!ar(i=e.sent()))throw i;return f("LocalStore","Failed to update sequence numbers: "+i),[3,4];case 4:for(o=0,s=n;o<s.length;o++)a=s[o],u=a.targetId,a.fromCache||(c=r.kn.get(u),h=c.snapshotVersion,l=c.withLastLimboFreeSnapshotVersion(h),r.kn=r.kn.insert(u,l));return[2]}})})}(i.localStore,s)];case 2:u.sent(),u.label=3;case 3:return[2]}})})}function Cs(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return(r=m(t)).currentUser.isEqual(n)?[3,3]:(f("SyncEngine","User change. New user:",n.toKey()),[4,Ii(r.localStore,n)]);case 1:return i=e.sent(),r.currentUser=n,function(t,e){t.ko.forEach(function(t){t.forEach(function(t){t.reject(new u(a.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),t.ko.clear()}(r),r.sharedClientState.handleUserChange(n,i.removedBatchIds,i.addedBatchIds),[4,ks(r,i.Ln)];case 2:e.sent(),e.label=3;case 3:return[2]}})})}function Rs(t,e){var n=m(t),r=n.Co.get(e);if(r&&r.bo)return Ue().add(r.key);var i=Ue(),o=n.Vo.get(e);if(!o)return i;for(var s=0,a=o;s<a.length;s++){var u=a[s],c=n.Po.get(u);i=i.unionWith(c.view.wo)}return i}function Ls(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,ki((r=m(t)).localStore,n.query,!0)];case 1:return i=e.sent(),o=n.view.Ao(i),[2,(r.isPrimaryClient&&Ds(r,n.targetId,o.To),o)]}})})}function Os(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){return[2,Ri((n=m(t)).localStore).then(function(t){return ks(n,t)})]})})}function Ps(t,n,r,i){return(0,e.__awaiter)(this,void 0,void 0,function(){var o,s;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,function(t,e){var n=m(t),r=m(n._n);return n.persistence.runTransaction("Lookup mutation documents","readonly",function(t){return r.jt(t,e).next(function(e){return e?n.Mn.pn(t,e):nr.resolve(null)})})}((o=m(t)).localStore,n)];case 1:return null===(s=e.sent())?[3,6]:"pending"!==r?[3,3]:[4,Oo(o.remoteStore)];case 2:return e.sent(),[3,4];case 3:"acknowledged"===r||"rejected"===r?(Ts(o,n,i||null),Es(o,n),function(t,e){m(m(t)._n).Gt(e)}(o.localStore,n)):y(),e.label=4;case 4:return[4,ks(o,s)];case 5:return e.sent(),[3,7];case 6:f("SyncEngine","Cannot apply mutation batch with id: "+n),e.label=7;case 7:return[2]}})})}function Fs(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,u,c,h;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return js(r=m(t)),Ks(r),!0!==n||!0===r.$o?[3,3]:(i=r.sharedClientState.getAllActiveQueryTargets(),[4,Ms(r,i.toArray())]);case 1:return o=e.sent(),r.$o=!0,[4,Bo(r.remoteStore,!0)];case 2:for(e.sent(),s=0,a=o;s<a.length;s++)u=a[s],bo(r.remoteStore,u);return[3,7];case 3:return!1!==n||!1===r.$o?[3,7]:(c=[],h=Promise.resolve(),r.Vo.forEach(function(t,e){r.sharedClientState.isLocalQueryTarget(e)?c.push(e):h=h.then(function(){return Ss(r,e),xi(r.localStore,e,!0)}),Io(r.remoteStore,e)}),[4,h]);case 4:return e.sent(),[4,Ms(r,c)];case 5:return e.sent(),function(t){var e=m(r);e.Co.forEach(function(t,n){Io(e.remoteStore,n)}),e.No.ts(),e.Co=new Map,e.Do=new Ae(Q.comparator)}(),r.$o=!1,[4,Bo(r.remoteStore,!1)];case 6:e.sent(),e.label=7;case 7:return[2]}})})}function Ms(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,u,c,h,f,l,d,p,y,v;return(0,e.__generator)(this,function(e){switch(e.label){case 0:r=m(t),i=[],o=[],s=0,a=n,e.label=1;case 1:return s<a.length?(u=a[s],c=void 0,(h=r.Vo.get(u))&&0!==h.length?[4,Ai(r.localStore,Mt(h[0]))]:[3,7]):[3,13];case 2:c=e.sent(),f=0,l=h,e.label=3;case 3:return f<l.length?(d=l[f],p=r.Po.get(d),[4,Ls(r,p)]):[3,6];case 4:(y=e.sent()).snapshot&&o.push(y.snapshot),e.label=5;case 5:return f++,[3,3];case 6:return[3,11];case 7:return[4,Ci(r.localStore,u)];case 8:return v=e.sent(),[4,Ai(r.localStore,v)];case 9:return c=e.sent(),[4,ps(r,Vs(v),u,!1)];case 10:e.sent(),e.label=11;case 11:i.push(c),e.label=12;case 12:return s++,[3,1];case 13:return[2,(r.vo._r(o),i)]}})})}function Vs(t){return xt(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function qs(t){var e=m(t);return m(m(e.localStore).persistence).fn()}function Us(t,n,r,i){return(0,e.__awaiter)(this,void 0,void 0,function(){var o,s,a;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return(o=m(t)).$o?(f("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Vo.has(n))return[3,8];switch(r){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,Ri(o.localStore)];case 3:return s=e.sent(),a=Ke.createSynthesizedRemoteEventForCurrentChange(n,"current"===r),[4,ks(o,s,a)];case 4:return e.sent(),[3,8];case 5:return[4,xi(o.localStore,n,!0)];case 6:return e.sent(),Ss(o,n,i),[3,8];case 7:y(),e.label=8;case 8:return[2]}})})}function Bs(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s,a,u,c,h,l,d,p;return(0,e.__generator)(this,function(y){switch(y.label){case 0:if(!(i=js(t)).$o)return[3,10];o=0,s=n,y.label=1;case 1:return o<s.length?(a=s[o],i.Vo.has(a)?(f("SyncEngine","Adding an already active target "+a),[3,5]):[4,Ci(i.localStore,a)]):[3,6];case 2:return u=y.sent(),[4,Ai(i.localStore,u)];case 3:return c=y.sent(),[4,ps(i,Vs(u),c.targetId,!1)];case 4:y.sent(),bo(i.remoteStore,c),y.label=5;case 5:return o++,[3,1];case 6:h=function(t){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return i.Vo.has(t)?[4,xi(i.localStore,t,!1).then(function(){Io(i.remoteStore,t),Ss(i,t)}).catch(Yr)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})},l=0,d=r,y.label=7;case 7:return l<d.length?(p=d[l],[5,h(p)]):[3,10];case 8:y.sent(),y.label=9;case 9:return l++,[3,7];case 10:return[2]}})})}function js(t){var e=m(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=ms.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Rs.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=_s.bind(null,e),e.vo._r=Zo.bind(null,e.eventManager),e.vo.Mo=ts.bind(null,e.eventManager),e}function Ks(t){var e=m(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=ws.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=bs.bind(null,e),e}function Qs(t,n,r){var i=m(t);(function(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s,a,u,c;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,14,,15]),[4,n.getMetadata()];case 1:return i=e.sent(),[4,function(t,e){var n=m(t),r=on(e.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",function(t){return n.Ke.getBundleMetadata(t,e.id)}).then(function(t){return!!t&&t.createTime.compareTo(r)>=0})}(t.localStore,i)];case 2:return e.sent()?[4,n.close()]:[3,4];case 3:return[2,(e.sent(),void r._completeWith(function(t){return{taskState:"Success",documentsLoaded:t.totalDocuments,bytesLoaded:t.totalBytes,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(i)))];case 4:return r._updateProgress(ss(i)),o=new os(i,t.localStore,n.R),[4,n.Lo()];case 5:s=e.sent(),e.label=6;case 6:return s?[4,o.oo(s)]:[3,10];case 7:return(a=e.sent())&&r._updateProgress(a),[4,n.Lo()];case 8:s=e.sent(),e.label=9;case 9:return[3,6];case 10:return[4,o.complete()];case 11:return u=e.sent(),[4,ks(t,u.wn,void 0)];case 12:return e.sent(),[4,function(t,e){var n=m(t);return n.persistence.runTransaction("Save bundle","readwrite",function(t){return n.Ke.saveBundleMetadata(t,e)})}(t.localStore,i)];case 13:return e.sent(),r._completeWith(u.progress),[3,15];case 14:return d("SyncEngine","Loading bundle failed with "+(c=e.sent())),r._failWith(c),[3,15];case 15:return[2]}})})})(i,n,r).then(function(){i.sharedClientState.notifyBundleLoaded()})}var Gs=function(){function t(){this.synchronizeTabs=!1}return t.prototype.initialize=function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.R=ho(t.databaseInfo.databaseId),this.sharedClientState=this.Bo(t),this.persistence=this.qo(t),[4,this.persistence.start()];case 1:return e.sent(),this.gcScheduler=this.Uo(t),this.localStore=this.Ko(t),[2]}})})},t.prototype.Uo=function(t){return null},t.prototype.Ko=function(t){return bi(this.persistence,new _i,t.initialUser,this.R)},t.prototype.qo=function(t){return new Ki(Gi.bs,this.R)},t.prototype.Bo=function(t){return new no},t.prototype.terminate=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(t){switch(t.label){case 0:return this.gcScheduler&&this.gcScheduler.stop(),[4,this.sharedClientState.shutdown()];case 1:return t.sent(),[4,this.persistence.shutdown()];case 2:return t.sent(),[2]}})})},t}(),zs=function(t){function n(e,n,r){var i=this;return(i=t.call(this)||this).Qo=e,i.cacheSizeBytes=n,i.forceOwnership=r,i.synchronizeTabs=!1,i}return(0,e.__extends)(n,t),n.prototype.initialize=function(n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,t.prototype.initialize.call(this,n)];case 1:return e.sent(),[4,Li(this.localStore)];case 2:return e.sent(),[4,this.Qo.initialize(this,n)];case 3:return e.sent(),[4,Ks(this.Qo.syncEngine)];case 4:return e.sent(),[4,Oo(this.Qo.remoteStore)];case 5:return e.sent(),[4,this.persistence.He(function(){return r.gcScheduler&&!r.gcScheduler.started&&r.gcScheduler.start(r.localStore),Promise.resolve()})];case 6:return e.sent(),[2]}})})},n.prototype.Ko=function(t){return bi(this.persistence,new _i,t.initialUser,this.R)},n.prototype.Uo=function(t){var e=this.persistence.referenceDelegate.garbageCollector;return new Jr(e,t.asyncQueue)},n.prototype.qo=function(t){var e=yi(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?Fr.withCacheSize(this.cacheSizeBytes):Fr.DEFAULT;return new li(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,uo(),co(),this.R,this.sharedClientState,!!this.forceOwnership)},n.prototype.Bo=function(t){return new no},n}(Gs),Ws=function(t){function n(e,n){var r=this;return(r=t.call(this,e,n,!1)||this).Qo=e,r.cacheSizeBytes=n,r.synchronizeTabs=!0,r}return(0,e.__extends)(n,t),n.prototype.initialize=function(n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i=this;return(0,e.__generator)(this,function(o){switch(o.label){case 0:return[4,t.prototype.initialize.call(this,n)];case 1:return o.sent(),r=this.Qo.syncEngine,this.sharedClientState instanceof eo?(this.sharedClientState.syncEngine={ui:Ps.bind(null,r),ai:Us.bind(null,r),hi:Bs.bind(null,r),fn:qs.bind(null,r),ci:Os.bind(null,r)},[4,this.sharedClientState.start()]):[3,3];case 2:o.sent(),o.label=3;case 3:return[4,this.persistence.He(function(t){return(0,e.__awaiter)(i,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,Fs(this.Qo.syncEngine,t)];case 1:return e.sent(),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop()),[2]}})})})];case 4:return o.sent(),[2]}})})},n.prototype.Bo=function(t){var e=uo();if(!eo.yt(e))throw new u(a.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=yi(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new eo(e,t.asyncQueue,n,t.clientId,t.initialUser)},n}(zs),Hs=function(){function t(){}return t.prototype.initialize=function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.localStore?[3,2]:(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=function(t){return gs(r.syncEngine,t,1)},this.remoteStore.remoteSyncer.handleCredentialChange=Cs.bind(null,this.syncEngine),[4,Bo(this.remoteStore,this.syncEngine.isPrimaryClient)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.createEventManager=function(t){return new $o},t.prototype.createDatastore=function(t){var e,n=ho(t.databaseInfo.databaseId),r=(e=t.databaseInfo,new ao(e));return function(t,e,n){return new vo(t,r,n)}(t.credentials,0,n)},t.prototype.createRemoteStore=function(t){var e,n,r,i,o,s=this;return e=this.localStore,n=this.datastore,r=t.asyncQueue,i=function(t){return gs(s.syncEngine,t,0)},o=io.yt()?new io:new ro,new go(e,n,r,i,o)},t.prototype.createSyncEngine=function(t,e){return function(t,e,n,r,i,o,s){var a=new ls(t,e,n,r,i,o);return s&&(a.$o=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)},t.prototype.terminate=function(){return function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return n=m(t),f("RemoteStore","RemoteStore shutting down."),n.Or.add(5),[4,wo(n)];case 1:return e.sent(),n.Lr.shutdown(),n.Br.set("Unknown"),[2]}})})}(this.remoteStore)},t}();function Ys(t,n){void 0===n&&(n=10240);var r=0;return{read:function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var i;return(0,e.__generator)(this,function(e){return r<t.byteLength?(i={value:t.slice(r,r+n),done:!1},[2,(r+=n,i)]):[2,{done:!0}]})})},cancel:function(){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(t){return[2]})})},releaseLock:function(){},closed:Promise.reject("unimplemented")}}var $s=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.jo(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.jo(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.Wo=function(){this.muted=!0},t.prototype.jo=function(t,e){var n=this;this.muted||setTimeout(function(){n.muted||t(e)},0)},t}(),Xs=function(){function t(t,e){var n=this;this.Go=t,this.R=e,this.metadata=new er,this.buffer=new Uint8Array,this.zo=new TextDecoder("utf-8"),this.Ho().then(function(t){t&&t.io()?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.Go.cancel()},t.prototype.getMetadata=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(t){return[2,this.metadata.promise]})})},t.prototype.Lo=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(t){switch(t.label){case 0:return[4,this.getMetadata()];case 1:return[2,(t.sent(),this.Ho())]}})})},t.prototype.Ho=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n,r,i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,this.Jo()];case 1:return null===(t=e.sent())?[2,null]:(n=this.zo.decode(t),r=Number(n),isNaN(r)&&this.Yo("length string ("+n+") is not valid number"),[4,this.Xo(r)]);case 2:return i=e.sent(),[2,new rs(JSON.parse(i),t.length+r)]}})})},t.prototype.Zo=function(){return this.buffer.findIndex(function(t){return t==="{".charCodeAt(0)})},t.prototype.Jo=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.Zo()<0?[4,this.tc()]:[3,3];case 1:if(e.sent())return[3,3];e.label=2;case 2:return[3,0];case 3:return 0===this.buffer.length?[2,null]:((t=this.Zo())<0&&this.Yo("Reached the end of bundle when a length string is expected."),n=this.buffer.slice(0,t),[2,(this.buffer=this.buffer.slice(t),n)])}})})},t.prototype.Xo=function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return this.buffer.length<t?[4,this.tc()]:[3,3];case 1:e.sent()&&this.Yo("Reached the end of bundle when more is expected."),e.label=2;case 2:return[3,0];case 3:return n=this.zo.decode(this.buffer.slice(0,t)),[2,(this.buffer=this.buffer.slice(t),n)]}})})},t.prototype.Yo=function(t){throw this.Go.cancel(),new Error("Invalid bundle format: "+t)},t.prototype.tc=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,this.Go.read()];case 1:return(t=e.sent()).done||((n=new Uint8Array(this.buffer.length+t.value.length)).set(this.buffer),n.set(t.value,this.buffer.length),this.buffer=n),[2,t.done]}})})},t}(),Js=function(){function t(t){this.datastore=t,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastWriteError=null,this.writtenDocs=new Set}return t.prototype.lookup=function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n,r=this;return(0,e.__generator)(this,function(i){switch(i.label){case 0:if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new u(a.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,u;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=m(t),i=ln(r.R)+"/documents",o={documents:n.map(function(t){return un(r.R,t)})},[4,r.$i("BatchGetDocuments",i,o)];case 1:return s=e.sent(),a=new Map,s.forEach(function(t){var e=function(t,e){return"found"in e?function(t,e){v(!!e.found),e.found.name,e.found.updateTime;var n=cn(t,e.found.name),r=on(e.found.updateTime),i=new ot({mapValue:{fields:e.found.fields}});return at.newFoundDocument(n,r,i)}(t,e):"missing"in e?function(t,e){v(!!e.missing),v(!!e.readTime);var n=cn(t,e.missing),r=on(e.readTime);return at.newNoDocument(n,r)}(t,e):y()}(r.R,t);a.set(e.key.toString(),e)}),u=[],[2,(n.forEach(function(t){var e=a.get(t.toString());v(!!e),u.push(e)}),u)]}})})}(this.datastore,t)];case 1:return[2,((n=i.sent()).forEach(function(t){return r.recordVersion(t)}),n)]}})})},t.prototype.set=function(t,e){this.write(e.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())},t.prototype.delete=function(t){this.write(new Ee(t,this.precondition(t))),this.writtenDocs.add(t.toString())},t.prototype.commit=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n=this;return(0,e.__generator)(this,function(r){switch(r.label){case 0:if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;return t=this.readVersions,this.mutations.forEach(function(e){t.delete(e.key.toString())}),t.forEach(function(t,e){var r=Q.fromPath(e);n.mutations.push(new Te(r,n.precondition(r)))}),[4,function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=m(t),i=ln(r.R)+"/documents",o={writes:n.map(function(t){return vn(r.R,t)})},[4,r.Ni("Commit",i,o)];case 1:return e.sent(),[2]}})})}(this.datastore,this.mutations)];case 1:return r.sent(),this.committed=!0,[2]}})})},t.prototype.recordVersion=function(t){var e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw y();e=T.min()}var n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new u(a.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)},t.prototype.precondition=function(t){var e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?ue.updateTime(e):ue.none()},t.prototype.preconditionForUpdate=function(t){var e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(T.min()))throw new u(a.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return ue.updateTime(e)}return ue.exists(!0)},t.prototype.write=function(t){this.ensureCommitNotCalled(),this.mutations.push(t)},t.prototype.ensureCommitNotCalled=function(){},t}(),Zs=function(){function t(t,e,n,r){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=r,this.ec=5,this.Zi=new fo(this.asyncQueue,"transaction_retry")}return t.prototype.run=function(){this.ec-=1,this.nc()},t.prototype.nc=function(){var t=this;this.Zi.ji(function(){return(0,e.__awaiter)(t,void 0,void 0,function(){var t,n,r=this;return(0,e.__generator)(this,function(e){return t=new Js(this.datastore),(n=this.sc(t))&&n.then(function(e){r.asyncQueue.enqueueAndForget(function(){return t.commit().then(function(){r.deferred.resolve(e)}).catch(function(t){r.ic(t)})})}).catch(function(t){r.ic(t)}),[2]})})})},t.prototype.sc=function(t){try{var e=this.updateFunction(t);return!B(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}},t.prototype.ic=function(t){var e=this;this.ec>0&&this.rc(t)?(this.ec-=1,this.asyncQueue.enqueueAndForget(function(){return e.nc(),Promise.resolve()})):this.deferred.reject(t)},t.prototype.rc=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!Ne(e)}return!1},t}(),ta=function(){function t(t,n,r){var i=this;this.credentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=zi.UNAUTHENTICATED,this.clientId=_.u(),this.credentialListener=function(){return Promise.resolve()},this.credentials.setChangeListener(n,function(t){return(0,e.__awaiter)(i,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return f("FirestoreClient","Received user=",t.uid),[4,this.credentialListener(t)];case 1:return e.sent(),this.user=t,[2]}})})})}return t.prototype.getConfiguration=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(t){return[2,{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}]})})},t.prototype.setCredentialChangeListener=function(t){this.credentialListener=t},t.prototype.verifyNotTerminated=function(){if(this.asyncQueue.isShuttingDown)throw new u(a.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.terminate=function(){var t=this;this.asyncQueue.enterRestrictedMode();var n=new er;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(function(){return(0,e.__awaiter)(t,void 0,void 0,function(){var t,r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),this.onlineComponents?[4,this.onlineComponents.terminate()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.offlineComponents?[4,this.offlineComponents.terminate()]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.credentials.removeChangeListener(),n.resolve(),[3,6];case 5:return t=e.sent(),r=Go(t,"Failed to shutdown persistence"),n.reject(r),[3,6];case 6:return[2]}})})}),n.promise},t}();function ea(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i,o=this;return(0,e.__generator)(this,function(s){switch(s.label){case 0:return t.asyncQueue.verifyOperationInProgress(),f("FirestoreClient","Initializing OfflineComponentProvider"),[4,t.getConfiguration()];case 1:return r=s.sent(),[4,n.initialize(r)];case 2:return s.sent(),i=r.initialUser,t.setCredentialChangeListener(function(t){return(0,e.__awaiter)(o,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return i.isEqual(t)?[3,2]:[4,Ii(n.localStore,t)];case 1:e.sent(),i=t,e.label=2;case 2:return[2]}})})}),n.persistence.setDatabaseDeletedListener(function(){return t.terminate()}),t.offlineComponents=n,[2]}})})}function na(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,e.__generator)(this,function(o){switch(o.label){case 0:return t.asyncQueue.verifyOperationInProgress(),[4,ra(t)];case 1:return r=o.sent(),f("FirestoreClient","Initializing OnlineComponentProvider"),[4,t.getConfiguration()];case 2:return i=o.sent(),[4,n.initialize(r,i)];case 3:return o.sent(),t.setCredentialChangeListener(function(t){return function(t,n){return(0,e.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return(r=m(t)).asyncQueue.verifyOperationInProgress(),f("RemoteStore","RemoteStore received new credentials"),i=Do(r),r.Or.add(3),[4,wo(r)];case 1:return e.sent(),i&&r.Br.set("Unknown"),[4,r.remoteSyncer.handleCredentialChange(n)];case 2:return e.sent(),r.Or.delete(3),[4,_o(r)];case 3:return e.sent(),[2]}})})}(n.remoteStore,t)}),t.onlineComponents=n,[2]}})})}function ra(t){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return t.offlineComponents?[3,2]:(f("FirestoreClient","Using default OfflineComponentProvider"),[4,ea(t,new Gs)]);case 1:e.sent(),e.label=2;case 2:return[2,t.offlineComponents]}})})}function ia(t){return(0,e.__awaiter)(this,void 0,void 0,function(){return(0,e.__generator)(this,function(e){switch(e.label){case 0:return t.onlineComponents?[3,2]:(f("FirestoreClient","Using default OnlineComponentProvider"),[4,na(t,new Hs)]);case 1:e.sent(),e.label=2;case 2:return[2,t.onlineComponents]}})})}function oa(t){return ra(t).then(function(t){return t.persistence})}function sa(t){return ra(t).then(function(t){return t.localStore})}function aa(t){return ia(t).then(function(t){return t.remoteStore})}function ua(t){return ia(t).then(function(t){return t.syncEngine})}function ca(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,ia(t)];case 1:return n=e.sent(),[2,((r=n.eventManager).onListen=ds.bind(null,n.syncEngine),r.onUnlisten=ys.bind(null,n.syncEngine),r)]}})})}function ha(t,n,r){var i=this;void 0===r&&(r={});var o=new er;return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(i,void 0,void 0,function(){var i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return i=function(t,e,n,r,i){var o=new $s({next:function(o){e.enqueueAndForget(function(){return Jo(t,s)});var c=o.docs.has(n);!c&&o.fromCache?i.reject(new u(a.UNAVAILABLE,"Failed to get document because the client is offline.")):c&&o.fromCache&&r&&"server"===r.source?i.reject(new u(a.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)}}),s=new ns(kt(n.path),o,{includeMetadataChanges:!0,so:!0});return Xo(t,s)},[4,ca(t)];case 1:return[2,i.apply(void 0,[e.sent(),t.asyncQueue,n,r,o])]}})})}),o.promise}function fa(t,n,r){var i=this;void 0===r&&(r={});var o=new er;return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(i,void 0,void 0,function(){var i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return i=function(t,e,n,r,i){var o=new $s({next:function(n){e.enqueueAndForget(function(){return Jo(t,s)}),n.fromCache&&"server"===r.source?i.reject(new u(a.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)}}),s=new ns(n,o,{includeMetadataChanges:!0,so:!0});return Xo(t,s)},[4,ca(t)];case 1:return[2,i.apply(void 0,[e.sent(),t.asyncQueue,n,r,o])]}})})}),o.promise}var la=function(t,e,n,r,i,o,s,a){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=s,this.useFetchStreams=a},da=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"isDefaultDatabase",{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}(),pa=new Map,ya=function(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization="Bearer "+t},va=function(){function t(){this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t,e){this.changeListener=e,t.enqueueRetryable(function(){return e(zi.UNAUTHENTICATED)})},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),ma=function(){function t(t){this.token=t,this.changeListener=null}return t.prototype.getToken=function(){return Promise.resolve(this.token)},t.prototype.invalidateToken=function(){},t.prototype.setChangeListener=function(t,e){var n=this;this.changeListener=e,t.enqueueRetryable(function(){return e(n.token.user)})},t.prototype.removeChangeListener=function(){this.changeListener=null},t}(),ga=function(){function t(t){var e=this;this.currentUser=zi.UNAUTHENTICATED,this.oc=new er,this.cc=0,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=function(){e.cc++,e.currentUser=e.ac(),e.oc.resolve(),e.changeListener&&e.asyncQueue.enqueueRetryable(function(){return e.changeListener(e.currentUser)})};var n=function(t){f("FirebaseCredentialsProvider","Auth detected"),e.auth=t,e.auth.addAuthTokenListener(e.uc)};t.onInit(function(t){return n(t)}),setTimeout(function(){if(!e.auth){var r=t.getImmediate({optional:!0});r?n(r):(f("FirebaseCredentialsProvider","Auth not yet detected"),e.oc.resolve())}},0)}return t.prototype.getToken=function(){var t=this,e=this.cc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(function(n){return t.cc!==e?(f("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(v("string"==typeof n.accessToken),new ya(n.accessToken,t.currentUser)):null}):Promise.resolve(null)},t.prototype.invalidateToken=function(){this.forceRefresh=!0},t.prototype.setChangeListener=function(t,n){var r=this;this.asyncQueue=t,this.asyncQueue.enqueueRetryable(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){return(0,e.__generator)(this,function(t){switch(t.label){case 0:return[4,this.oc.promise];case 1:return t.sent(),[4,n(this.currentUser)];case 2:return t.sent(),this.changeListener=n,[2]}})})})},t.prototype.removeChangeListener=function(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=function(){return Promise.resolve()}},t.prototype.ac=function(){var t=this.auth&&this.auth.getUid();return v(null===t||"string"==typeof t),new zi(t)},t}(),_a=function(){function t(t,e,n){this.hc=t,this.lc=e,this.fc=n,this.type="FirstParty",this.user=zi.FIRST_PARTY}return Object.defineProperty(t.prototype,"authHeaders",{get:function(){var t={"X-Goog-AuthUser":this.lc},e=this.hc.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.fc&&(t["X-Goog-Iam-Authorization-Token"]=this.fc),t},enumerable:!1,configurable:!0}),t}(),wa=function(){function t(t,e,n){this.hc=t,this.lc=e,this.fc=n}return t.prototype.getToken=function(){return Promise.resolve(new _a(this.hc,this.lc,this.fc))},t.prototype.setChangeListener=function(t,e){t.enqueueRetryable(function(){return e(zi.FIRST_PARTY)})},t.prototype.removeChangeListener=function(){},t.prototype.invalidateToken=function(){},t}();function ba(t,e,n){if(!n)throw new u(a.INVALID_ARGUMENT,"Function "+t+"() cannot be called with an empty "+e+".")}function Ia(t,e){if(void 0===e)return{merge:!1};if(void 0!==e.mergeFields&&void 0!==e.merge)throw new u(a.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function Ea(t,e,n,r){if(!0===e&&!0===r)throw new u(a.INVALID_ARGUMENT,t+" and "+n+" cannot be used together.")}function Ta(t){if(!Q.isDocumentKey(t))throw new u(a.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t+" has "+t.length+".")}function Sa(t){if(Q.isDocumentKey(t))throw new u(a.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+t+" has "+t.length+".")}function Na(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"==o(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":y()}function Da(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new u(a.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");var n=Na(t);throw new u(a.INVALID_ARGUMENT,"Expected type '"+e.name+"', but it was: "+n)}return t}function Aa(t,e){if(e<=0)throw new u(a.INVALID_ARGUMENT,"Function "+t+"() requires a positive number, but it was: "+e+".")}var xa=function(){function t(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new u(a.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 u(a.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,Ea("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&&this.useFetchStreams===t.useFetchStreams},t}(),ka=function(){function t(t,e){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new xa({}),this._settingsFrozen=!1,t instanceof da?(this._databaseId=t,this._credentials=new va):(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new u(a.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new da(t.options.projectId)}(t),this._credentials=new ga(e))}return Object.defineProperty(t.prototype,"app",{get:function(){if(!this._app)throw new u(a.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_initialized",{get:function(){return this._settingsFrozen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_terminated",{get:function(){return void 0!==this._terminateTask},enumerable:!1,configurable:!0}),t.prototype._setSettings=function(t){if(this._settingsFrozen)throw new u(a.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._settings=new xa(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new va;switch(t.type){case"gapi":var e=t.client;return v(!("object"!=o(e)||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new wa(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new u(a.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))},t.prototype._getSettings=function(){return this._settings},t.prototype._freezeSettings=function(){return this._settingsFrozen=!0,this._settings},t.prototype._delete=function(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask},t.prototype.toJSON=function(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}},t.prototype._terminate=function(){return this,(t=pa.get(this))&&(f("ComponentProvider","Removing Datastore"),pa.delete(this),t.terminate()),Promise.resolve();var t},t}(),Ca=function(){function t(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}return Object.defineProperty(t.prototype,"_path",{get:function(){return this._key.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._key.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new La(this.firestore,this.converter,this._key.path.popLast())},enumerable:!1,configurable:!0}),t.prototype.withConverter=function(e){return new t(this.firestore,e,this._key)},t}(),Ra=function(){function t(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}return t.prototype.withConverter=function(e){return new t(this.firestore,e,this._query)},t}(),La=function(t){function n(e,n,r){var i=this;return(i=t.call(this,e,n,kt(r))||this)._path=r,i.type="collection",i}return(0,e.__extends)(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this._query.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"path",{get:function(){return this._query.path.canonicalString()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){var t=this._path.popLast();return t.isEmpty()?null:new Ca(this.firestore,null,new Q(t))},enumerable:!1,configurable:!0}),n.prototype.withConverter=function(t){return new n(this.firestore,t,this._path)},n}(Ra);function Oa(t,r){for(var i,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(t=(0,n.getModularInstance)(t),ba("collection","path",r),t instanceof ka)return Sa(i=x.fromString.apply(x,(0,e.__spreadArray)([r],o))),new La(t,null,i);if(!(t instanceof Ca||t instanceof La))throw new u(a.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Sa(i=x.fromString.apply(x,(0,e.__spreadArray)([t.path],o)).child(x.fromString(r))),new La(t.firestore,null,i)}function Pa(t,r){for(var i,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];if(t=(0,n.getModularInstance)(t),1===arguments.length&&(r=_.u()),ba("doc","path",r),t instanceof ka)return Ta(i=x.fromString.apply(x,(0,e.__spreadArray)([r],o))),new Ca(t,null,new Q(i));if(!(t instanceof Ca||t instanceof La))throw new u(a.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");return Ta(i=t._path.child(x.fromString.apply(x,(0,e.__spreadArray)([r],o)))),new Ca(t.firestore,t instanceof La?t.converter:null,new Q(i))}function Fa(t,e){return t=(0,n.getModularInstance)(t),e=(0,n.getModularInstance)(e),(t instanceof Ca||t instanceof La)&&(e instanceof Ca||e instanceof La)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function Ma(t,e){return t=(0,n.getModularInstance)(t),e=(0,n.getModularInstance)(e),t instanceof Ra&&e instanceof Ra&&t.firestore===e.firestore&&qt(t._query,e._query)&&t.converter===e.converter}var Va=function(){function t(){var t=this;this.dc=Promise.resolve(),this.wc=[],this._c=!1,this.mc=[],this.yc=null,this.gc=!1,this.Ec=!1,this.Tc=[],this.Zi=new fo(this,"async_queue_retry"),this.Ic=function(){var e=co();e&&f("AsyncQueue","Visibility state changed to "+e.visibilityState),t.Zi.Gi()};var e=co();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Ic)}return Object.defineProperty(t.prototype,"isShuttingDown",{get:function(){return this._c},enumerable:!1,configurable:!0}),t.prototype.enqueueAndForget=function(t){this.enqueue(t)},t.prototype.enqueueAndForgetEvenWhileRestricted=function(t){this.Ac(),this.Rc(t)},t.prototype.enterRestrictedMode=function(t){if(!this._c){this._c=!0,this.Ec=t||!1;var e=co();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Ic)}},t.prototype.enqueue=function(t){var e=this;if(this.Ac(),this._c)return new Promise(function(){});var n=new er;return this.Rc(function(){return e._c&&e.Ec?Promise.resolve():(t().then(n.resolve,n.reject),n.promise)}).then(function(){return n.promise})},t.prototype.enqueueRetryable=function(t){var e=this;this.enqueueAndForget(function(){return e.wc.push(t),e.bc()})},t.prototype.bc=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t,n=this;return(0,e.__generator)(this,function(e){switch(e.label){case 0:if(0===this.wc.length)return[3,5];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.wc[0]()];case 2:return e.sent(),this.wc.shift(),this.Zi.reset(),[3,4];case 3:if(!ar(t=e.sent()))throw t;return f("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.wc.length>0&&this.Zi.ji(function(){return n.bc()}),e.label=5;case 5:return[2]}})})},t.prototype.Rc=function(t){var e=this,n=this.dc.then(function(){return e.gc=!0,t().catch(function(t){throw e.yc=t,e.gc=!1,l("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.gc=!1,t})});return this.dc=n,n},t.prototype.enqueueAfterDelay=function(t,e,n){var r=this;this.Ac(),this.Tc.indexOf(t)>-1&&(e=0);var i=Qo.createAndSchedule(this,t,e,n,function(t){return r.vc(t)});return this.mc.push(i),i},t.prototype.Ac=function(){this.yc&&y()},t.prototype.verifyOperationInProgress=function(){},t.prototype.Pc=function(){return(0,e.__awaiter)(this,void 0,void 0,function(){var t;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,t=this.dc];case 1:e.sent(),e.label=2;case 2:if(t!==this.dc)return[3,0];e.label=3;case 3:return[2]}})})},t.prototype.Vc=function(t){for(var e=0,n=this.mc;e<n.length;e++)if(n[e].timerId===t)return!0;return!1},t.prototype.Sc=function(t){var e=this;return this.Pc().then(function(){e.mc.sort(function(t,e){return t.targetTimeMs-e.targetTimeMs});for(var n=0,r=e.mc;n<r.length;n++){var i=r[n];if(i.skipDelay(),"all"!==t&&i.timerId===t)break}return e.Pc()})},t.prototype.Dc=function(t){this.Tc.push(t)},t.prototype.vc=function(t){var e=this.mc.indexOf(t);this.mc.splice(e,1)},t}();function qa(t){return function(t,e){if("object"!=o(t)||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var s=i[r];if(s in n&&"function"==typeof n[s])return!0}return!1}(t)}var Ua=function(){function t(){this._progressObserver={},this._taskCompletionResolver=new er,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}return t.prototype.onProgress=function(t,e,n){this._progressObserver={next:t,error:e,complete:n}},t.prototype.catch=function(t){return this._taskCompletionResolver.promise.catch(t)},t.prototype.then=function(t,e){return this._taskCompletionResolver.promise.then(t,e)},t.prototype._completeWith=function(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)},t.prototype._failWith=function(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)},t.prototype._updateProgress=function(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)},t}(),Ba=-1,ja=function(t){function n(e,n){var r=this;return(r=t.call(this,e,n)||this).type="firestore",r._queue=new Va,r._persistenceKey="name"in e?e.name:"[DEFAULT]",r}return(0,e.__extends)(n,t),n.prototype._terminate=function(){return this._firestoreClient||Qa(this),this._firestoreClient.terminate()},n}(ka);function Ka(t){return t._firestoreClient||Qa(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function Qa(t){var e,n=t._freezeSettings(),r=function(t,e,n,r){return new la(t,e,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,r.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new ta(t._credentials,t._queue,r)}function Ga(t,n,r){var i=this,o=new er;return t.asyncQueue.enqueue(function(){return(0,e.__awaiter)(i,void 0,void 0,function(){var i;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,ea(t,r)];case 1:return e.sent(),[4,na(t,n)];case 2:return e.sent(),o.resolve(),[3,4];case 3:if(!function(t){return"FirebaseError"===t.name?t.code===a.FAILED_PRECONDITION||t.code===a.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code}(i=e.sent()))throw i;return console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+i),o.reject(i),[3,4];case 4:return[2]}})})}).then(function(){return o.promise})}function za(t){if(t._initialized||t._terminated)throw new u(a.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.")}exports.T=ja,exports.E=Ba;var Wa=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 u(a.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new C(t)}return t.prototype.isEqual=function(t){return this._internalPath.isEqual(t._internalPath)},t}(),Ha=function(){function t(t){this._byteString=t}return t.fromBase64String=function(e){try{return new t(L.fromBase64String(e))}catch(e){throw new u(a.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(L.fromUint8Array(e))},t.prototype.toBase64=function(){return this._byteString.toBase64()},t.prototype.toUint8Array=function(){return this._byteString.toUint8Array()},t.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this._byteString.isEqual(t._byteString)},t}(),Ya=function(t){this._methodName=t},$a=function(){function t(t,e){if(!isFinite(t)||t<-90||t>90)throw new u(a.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new u(a.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this._lat},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this._long},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this._lat===t._lat&&this._long===t._long},t.prototype.toJSON=function(){return{latitude:this._lat,longitude:this._long}},t.prototype._compareTo=function(t){return w(this._lat,t._lat)||w(this._long,t._long)},t}(),Xa=/^__.*__$/,Ja=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return null!==this.fieldMask?new me(t,this.data,this.fieldMask,e,this.fieldTransforms):new ve(t,this.data,e,this.fieldTransforms)},t}(),Za=function(){function t(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}return t.prototype.toMutation=function(t,e){return new me(t,this.data,this.fieldMask,e,this.fieldTransforms)},t}();function tu(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw y()}}exports.C=$a;var eu=function(){function t(t,e,n,r,i,o){this.settings=t,this.databaseId=e,this.R=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Cc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Nc",{get:function(){return this.settings.Nc},enumerable:!1,configurable:!0}),t.prototype.xc=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)},t.prototype.kc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.xc({path:n,Fc:!1});return r.$c(t),r},t.prototype.Oc=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.xc({path:n,Fc:!1});return r.Cc(),r},t.prototype.Mc=function(t){return this.xc({path:void 0,Fc:!0})},t.prototype.Lc=function(t){return bu(t,this.settings.methodName,this.settings.Bc||!1,this.path,this.settings.qc)},t.prototype.contains=function(t){return void 0!==this.fieldMask.find(function(e){return t.isPrefixOf(e)})||void 0!==this.fieldTransforms.find(function(e){return t.isPrefixOf(e.field)})},t.prototype.Cc=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.$c(this.path.get(t))},t.prototype.$c=function(t){if(0===t.length)throw this.Lc("Document fields must not be empty");if(tu(this.Nc)&&Xa.test(t))throw this.Lc('Document fields cannot begin and end with "__"')},t}(),nu=function(){function t(t,e,n){this.databaseId=t,this.ignoreUndefinedProperties=e,this.R=n||ho(t)}return t.prototype.Uc=function(t,e,n,r){return void 0===r&&(r=!1),new eu({Nc:t,methodName:e,qc:n,path:C.emptyPath(),Fc:!1,Bc:r},this.databaseId,this.R,this.ignoreUndefinedProperties)},t}();function ru(t){var e=t._freezeSettings(),n=ho(t._databaseId);return new nu(t._databaseId,!!e.ignoreUndefinedProperties,n)}function iu(t,e,n,r,i,o){void 0===o&&(o={});var s=t.Uc(o.merge||o.mergeFields?2:0,e,n,i);mu("Data must be an object, but it was:",s,r);var c,h,f=yu(r,s);if(o.merge)c=new R(s.fieldMask),h=s.fieldTransforms;else if(o.mergeFields){for(var l=[],d=0,p=o.mergeFields;d<p.length;d++){var y=gu(e,p[d],n);if(!s.contains(y))throw new u(a.INVALID_ARGUMENT,"Field '"+y+"' is specified in your field mask but missing from your input data.");Iu(l,y)||l.push(y)}c=new R(l),h=s.fieldTransforms.filter(function(t){return c.covers(t.field)})}else c=null,h=s.fieldTransforms;return new Ja(new ot(f),c,h)}var ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype._toFieldTransform=function(t){if(2!==t.Nc)throw 1===t.Nc?t.Lc(this._methodName+"() can only appear at the top level of your update data"):t.Lc(this._methodName+"() cannot be used with set() unless you pass {merge:true}");return t.fieldMask.push(t.path),null},n.prototype.isEqual=function(t){return t instanceof n},n}(Ya);function su(t,e,n){return new eu({Nc:3,qc:e.settings.qc,methodName:t._methodName,Fc:n},e.databaseId,e.R,e.ignoreUndefinedProperties)}var au=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype._toFieldTransform=function(t){return new se(t.path,new Jt)},n.prototype.isEqual=function(t){return t instanceof n},n}(Ya),uu=function(t){function n(e,n){var r=this;return(r=t.call(this,e)||this).Kc=n,r}return(0,e.__extends)(n,t),n.prototype._toFieldTransform=function(t){var e=su(this,t,!0),n=this.Kc.map(function(t){return pu(t,e)}),r=new Zt(n);return new se(t.path,r)},n.prototype.isEqual=function(t){return this===t},n}(Ya),cu=function(t){function n(e,n){var r=this;return(r=t.call(this,e)||this).Kc=n,r}return(0,e.__extends)(n,t),n.prototype._toFieldTransform=function(t){var e=su(this,t,!0),n=this.Kc.map(function(t){return pu(t,e)}),r=new ee(n);return new se(t.path,r)},n.prototype.isEqual=function(t){return this===t},n}(Ya),hu=function(t){function n(e,n){var r=this;return(r=t.call(this,e)||this).Qc=n,r}return(0,e.__extends)(n,t),n.prototype._toFieldTransform=function(t){var e=new re(t.R,Wt(t.R,this.Qc));return new se(t.path,e)},n.prototype.isEqual=function(t){return this===t},n}(Ya);function fu(t,e,r,i){var o=t.Uc(1,e,r);mu("Data must be an object, but it was:",o,i);var s=[],a=ot.empty();N(i,function(t,i){var u=wu(e,t,r);i=(0,n.getModularInstance)(i);var c=o.Oc(u);if(i instanceof ou)s.push(u);else{var h=pu(i,c);null!=h&&(s.push(u),a.set(u,h))}});var u=new R(s);return new Za(a,u,o.fieldTransforms)}function lu(t,e,r,i,o,s){var c=t.Uc(1,e,r),h=[gu(e,i,r)],f=[o];if(s.length%2!=0)throw new u(a.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var l=0;l<s.length;l+=2)h.push(gu(e,s[l])),f.push(s[l+1]);for(var d=[],p=ot.empty(),y=h.length-1;y>=0;--y)if(!Iu(d,h[y])){var v=h[y],m=f[y];m=(0,n.getModularInstance)(m);var g=c.Oc(v);if(m instanceof ou)d.push(v);else{var _=pu(m,g);null!=_&&(d.push(v),p.set(v,_))}}var w=new R(d);return new Za(p,w,c.fieldTransforms)}function du(t,e,n,r){return void 0===r&&(r=!1),pu(n,t.Uc(r?4:3,e))}function pu(t,e){if(vu(t=(0,n.getModularInstance)(t)))return mu("Unsupported field value:",e,t),yu(t,e);if(t instanceof Ya)return function(t,e){if(!tu(e.Nc))throw e.Lc(t._methodName+"() can only be used with update() and set()");if(!e.path)throw e.Lc(t._methodName+"() is not currently supported inside arrays");var n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.Nc)throw e.Lc("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var s=pu(o[i],e.Mc(r));null==s&&(s={nullValue:"NULL_VALUE"}),n.push(s),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=(0,n.getModularInstance)(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return Wt(e.R,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var r=E.fromDate(t);return{timestampValue:en(e.R,r)}}if(t instanceof E)return r=new E(t.seconds,1e3*Math.floor(t.nanoseconds/1e3)),{timestampValue:en(e.R,r)};if(t instanceof $a)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Ha)return{bytesValue:nn(e.R,t._byteString)};if(t instanceof Ca){r=e.databaseId;var i=t.firestore._databaseId;if(!i.isEqual(r))throw e.Lc("Document reference is for database "+i.projectId+"/"+i.database+" but should be for database "+r.projectId+"/"+r.database);return{referenceValue:sn(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.Lc("Unsupported field value: "+Na(t))}(t,e)}function yu(t,e){var n={};return D(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):N(t,function(t,r){var i=pu(r,e.kc(t));null!=i&&(n[t]=i)}),{mapValue:{fields:n}}}function vu(t){return!("object"!=o(t)||null===t||t instanceof Array||t instanceof Date||t instanceof E||t instanceof $a||t instanceof Ha||t instanceof Ca||t instanceof Ya)}function mu(t,e,n){if(!vu(n)||!function(t){return"object"==o(t)&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){var r=Na(n);throw"an object"===r?e.Lc(t+" a custom object"):e.Lc(t+" "+r)}}function gu(t,e,r){if((e=(0,n.getModularInstance)(e))instanceof Wa)return e._internalPath;if("string"==typeof e)return wu(t,e);throw bu("Field path arguments must be of type string or FieldPath.",t,!1,void 0,r)}var _u=new RegExp("[~\\*/\\[\\]]");function wu(t,n,r){if(n.search(_u)>=0)throw bu("Invalid field path ("+n+"). Paths must not contain '~', '*', '/', '[', or ']'",t,!1,void 0,r);try{return(new(Wa.bind.apply(Wa,(0,e.__spreadArray)([void 0],n.split(".")))))._internalPath}catch(i){throw bu("Invalid field path ("+n+"). Paths must not be empty, begin with '.', end with '.', or contain '..'",t,!1,void 0,r)}}function bu(t,e,n,r,i){var o=r&&!r.isEmpty(),s=void 0!==i,c="Function "+e+"() called with invalid data";n&&(c+=" (via `toFirestore()`)");var h="";return(o||s)&&(h+=" (found",o&&(h+=" in field "+r),s&&(h+=" in document "+i),h+=")"),new u(a.INVALID_ARGUMENT,(c+=". ")+t+h)}function Iu(t,e){return t.some(function(t){return t.isEqual(e)})}var Eu=function(){function t(t,e,n,r,i){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=r,this._converter=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this._key.path.lastSegment()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Ca(this._firestore,this._converter,this._key)},enumerable:!1,configurable:!0}),t.prototype.exists=function(){return null!==this._document},t.prototype.data=function(){if(this._document){if(this._converter){var t=new Tu(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}},t.prototype.get=function(t){if(this._document){var e=this._document.data.field(Su("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}},t}(),Tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype.data=function(){return t.prototype.data.call(this)},n}(Eu);function Su(t,e){return"string"==typeof e?wu(t,e):e instanceof Wa?e._internalPath:e._delegate._internalPath}var Nu=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}(),Du=function(t){function n(e,n,r,i,o,s){var a=this;return(a=t.call(this,e,n,r,i,s)||this)._firestore=e,a._firestoreImpl=e,a.metadata=o,a}return(0,e.__extends)(n,t),n.prototype.exists=function(){return t.prototype.exists.call(this)},n.prototype.data=function(t){if(void 0===t&&(t={}),this._document){if(this._converter){var e=new Au(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}},n.prototype.get=function(t,e){if(void 0===e&&(e={}),this._document){var n=this._document.data.field(Su("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}},n}(Eu),Au=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype.data=function(e){return void 0===e&&(e={}),t.prototype.data.call(this,e)},n}(Du),xu=function(){function t(t,e,n,r){this._firestore=t,this._userDataWriter=e,this._snapshot=r,this.metadata=new Nu(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._snapshot.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._snapshot.docs.forEach(function(r){t.call(e,new Au(n._firestore,n._userDataWriter,r.key,r,new Nu(n._snapshot.mutatedKeys.has(r.key),n._snapshot.fromCache),n.query.converter))})},t.prototype.docChanges=function(t){void 0===t&&(t={});var e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new u(a.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){var n=0;return t._snapshot.docChanges.map(function(e){return{type:"added",doc:new Au(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Nu(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:n++}})}var r=t._snapshot.oldDocs;return t._snapshot.docChanges.filter(function(t){return e||3!==t.type}).map(function(e){var n=new Au(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Nu(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter),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:ku(e.type),doc:n,oldIndex:i,newIndex:o}})}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges},t}();function ku(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return y()}}function Cu(t,e){return t instanceof Du&&e instanceof Du?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof xu&&e instanceof xu&&t._firestore===e._firestore&&Ma(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)}function Ru(t){if(Rt(t)&&0===t.explicitOrderBy.length)throw new u(a.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var Lu=function(){};function Ou(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++){t=i[r]._apply(t)}return t}var Pu=function(t){function n(e,n,r){var i=this;return(i=t.call(this)||this).jc=e,i.Wc=n,i.Gc=r,i.type="where",i}return(0,e.__extends)(n,t),n.prototype._apply=function(t){var e=ru(t.firestore),n=function(t,e,n,r,i,o,s){var c;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new u(a.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){ju(s,o);for(var h=[],f=0,l=s;f<l.length;f++){var d=l[f];h.push(Bu(r,t,d))}c={arrayValue:{values:h}}}else c=Bu(r,t,s)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||ju(s,o),c=du(n,"where",s,"in"===o||"not-in"===o);var p=dt.create(i,o,c);return function(t,e){if(e.g()){var n=Ot(t);if(null!==n&&!n.isEqual(e.field))throw new u(a.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=Lt(t);null!==r&&Ku(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(e.op){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-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[]}}());if(null!==i)throw i===e.op?new u(a.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter."):new u(a.INVALID_ARGUMENT,"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,p),p}(t._query,0,e,t.firestore._databaseId,this.jc,this.Wc,this.Gc);return new Ra(t.firestore,t.converter,function(t,e){var n=t.filters.concat([e]);return new At(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))},n}(Lu),Fu=function(t){function n(e,n){var r=this;return(r=t.call(this)||this).jc=e,r.zc=n,r.type="orderBy",r}return(0,e.__extends)(n,t),n.prototype._apply=function(t){var e=function(t,e,n){if(null!==t.startAt)throw new u(a.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new u(a.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new Tt(e,n);return function(t,e){if(null===Lt(t)){var n=Ot(t);null!==n&&Ku(t,n,e.field)}}(t,r),r}(t._query,this.jc,this.zc);return new Ra(t.firestore,t.converter,function(t,e){var n=t.explicitOrderBy.concat([e]);return new At(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))},n}(Lu),Mu=function(t){function n(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Hc=n,i.Jc=r,i}return(0,e.__extends)(n,t),n.prototype._apply=function(t){return new Ra(t.firestore,t.converter,Vt(t._query,this.Hc,this.Jc))},n}(Lu),Vu=function(t){function n(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Yc=n,i.Xc=r,i}return(0,e.__extends)(n,t),n.prototype._apply=function(t){var e=Uu(t,this.type,this.Yc,this.Xc);return new Ra(t.firestore,t.converter,function(t,e){return new At(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))},n}(Lu),qu=function(t){function n(e,n,r){var i=this;return(i=t.call(this)||this).type=e,i.Yc=n,i.Xc=r,i}return(0,e.__extends)(n,t),n.prototype._apply=function(t){var e=Uu(t,this.type,this.Yc,this.Xc);return new Ra(t.firestore,t.converter,function(t,e){return new At(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))},n}(Lu);function Uu(t,e,r,i){if(r[0]=(0,n.getModularInstance)(r[0]),r[0]instanceof Eu)return function(t,e,n,r,i){if(!r)throw new u(a.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],s=0,c=Ft(t);s<c.length;s++){var h=c[s];if(h.field.isKeyField())o.push(J(e,r.key));else{var f=r.data.field(h.field);if(V(f))throw new u(a.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+h.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===f){var l=h.field.canonicalString();throw new u(a.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(f)}}return new It(o,i)}(t._query,t.firestore._databaseId,e,r[0]._document,i);var s=ru(t.firestore);return function(t,e,n,r,i,s){var c=t.explicitOrderBy;if(i.length>c.length)throw new u(a.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 h=[],f=0;f<i.length;f++){var l=i[f];if(c[f].field.isKeyField()){if("string"!=typeof l)throw new u(a.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+o(l));if(!Pt(t)&&-1!==l.indexOf("/"))throw new u(a.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 '"+l+"' contains a slash.");var d=t.path.child(x.fromString(l));if(!Q.isDocumentKey(d))throw new u(a.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 '"+d+"' is not because it contains an odd number of segments.");var p=new Q(d);h.push(J(e,p))}else{var y=du(n,r,l);h.push(y)}}return new It(h,s)}(t._query,t.firestore._databaseId,s,e,r,i)}function Bu(t,e,r){if("string"==typeof(r=(0,n.getModularInstance)(r))){if(""===r)throw new u(a.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!Pt(e)&&-1!==r.indexOf("/"))throw new u(a.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+r+"' contains a '/' character.");var i=e.path.child(x.fromString(r));if(!Q.isDocumentKey(i))throw new u(a.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+i+"' is not because it has an odd number of segments ("+i.length+").");return J(t,new Q(i))}if(r instanceof Ca)return J(t,r._key);throw new u(a.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+Na(r)+".")}function ju(t,e){if(!Array.isArray(t)||0===t.length)throw new u(a.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new u(a.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.")}function Ku(t,e,n){if(!n.isEqual(e))throw new u(a.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.")}var Qu=function(){function t(){}return t.prototype.convertValue=function(t,e){switch(void 0===e&&(e="none"),G(t)){case 0:return null;case 1:return t.booleanValue;case 2:return F(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(M(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw y()}},t.prototype.convertObject=function(t,e){var n=this,r={};return N(t.fields,function(t,i){r[t]=n.convertValue(i,e)}),r},t.prototype.convertGeoPoint=function(t){return new $a(F(t.latitude),F(t.longitude))},t.prototype.convertArray=function(t,e){var n=this;return(t.values||[]).map(function(t){return n.convertValue(t,e)})},t.prototype.convertServerTimestamp=function(t,e){switch(e){case"previous":var n=q(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(U(t));default:return null}},t.prototype.convertTimestamp=function(t){var e=P(t);return new E(e.seconds,e.nanos)},t.prototype.convertDocumentKey=function(t,e){var n=x.fromString(t);v(Cn(n));var r=new da(n.get(1),n.get(3)),i=new Q(n.popFirst(5));return r.isEqual(e)||l("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}();function Gu(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var zu=function(t){function n(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,e.__extends)(n,t),n.prototype.convertBytes=function(t){return new Ha(t)},n.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new Ca(this.firestore,null,e)},n}(Qu),Wu=function(){function t(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=ru(t)}return t.prototype.set=function(t,e,n){this._verifyNotCommitted();var r=Hu(t,this._firestore),i=Gu(r.converter,e,n),o=iu(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,ue.none())),this},t.prototype.update=function(t,e,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];this._verifyNotCommitted();var s,a=Hu(t,this._firestore);return s="string"==typeof(e=(0,n.getModularInstance)(e))||e instanceof Wa?lu(this._dataReader,"WriteBatch.update",a._key,e,r,i):fu(this._dataReader,"WriteBatch.update",a._key,e),this._mutations.push(s.toMutation(a._key,ue.exists(!0))),this},t.prototype.delete=function(t){this._verifyNotCommitted();var e=Hu(t,this._firestore);return this._mutations=this._mutations.concat(new Ee(e._key,ue.none())),this},t.prototype.commit=function(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()},t.prototype._verifyNotCommitted=function(){if(this._committed)throw new u(a.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}();function Hu(t,e){if((t=(0,n.getModularInstance)(t)).firestore!==e)throw new u(a.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}var Yu=function(t){function n(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,e.__extends)(n,t),n.prototype.convertBytes=function(t){return new Ha(t)},n.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return new Ca(this.firestore,null,e)},n}(Qu);function $u(t,e,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];t=Da(t,Ca);var s=Da(t.firestore,ja),a=ru(s);return Ju(s,[("string"==typeof(e=(0,n.getModularInstance)(e))||e instanceof Wa?lu(a,"updateDoc",t._key,e,r,i):fu(a,"updateDoc",t._key,e)).toMutation(t._key,ue.exists(!0))])}function Xu(t){for(var r,i,s,a=[],u=1;u<arguments.length;u++)a[u-1]=arguments[u];t=(0,n.getModularInstance)(t);var c={includeMetadataChanges:!1},h=0;"object"!=o(a[h])||qa(a[h])||(c=a[h],h++);var f,l,d,p={includeMetadataChanges:c.includeMetadataChanges};if(qa(a[h])){var y=a[h];a[h]=null===(r=y.next)||void 0===r?void 0:r.bind(y),a[h+1]=null===(i=y.error)||void 0===i?void 0:i.bind(y),a[h+2]=null===(s=y.complete)||void 0===s?void 0:s.bind(y)}if(t instanceof Ca)l=Da(t.firestore,ja),d=kt(t._key.path),f={next:function(e){a[h]&&a[h](Zu(l,t,e))},error:a[h+1],complete:a[h+2]};else{var v=Da(t,Ra);l=Da(v.firestore,ja),d=v._query;var m=new Yu(l);f={next:function(t){a[h]&&a[h](new xu(l,m,v,t))},error:a[h+1],complete:a[h+2]},Ru(t._query)}return function(t,n,r,i){var o=this,s=new $s(f),a=new ns(n,s,r);return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(o,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return n=Xo,[4,ca(t)];case 1:return[2,n.apply(void 0,[e.sent(),a])]}})})}),function(){s.Wo(),t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(o,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return n=Jo,[4,ca(t)];case 1:return[2,n.apply(void 0,[e.sent(),a])]}})})})}}(Ka(l),d,p)}function Ju(t,n){return function(t,n){var r=this,i=new er;return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){var r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=vs,[4,ua(t)];case 1:return[2,r.apply(void 0,[e.sent(),n,i])]}})})}),i.promise}(Ka(t),n)}function Zu(t,e,n){var r=n.docs.get(e._key),i=new Yu(t);return new Du(t,i,e._key,r,new Nu(n.hasPendingWrites,n.fromCache),e.converter)}var tc=function(t){function n(e,n){var r=this;return(r=t.call(this,e,n)||this)._firestore=e,r}return(0,e.__extends)(n,t),n.prototype.get=function(e){var n=this,r=Hu(e,this._firestore),i=new Yu(this._firestore);return t.prototype.get.call(this,e).then(function(t){return new Du(n._firestore,i,r._key,t._document,new Nu(!1,!1),r.converter)})},n}(function(){function t(t,e){this._firestore=t,this._transaction=e,this._dataReader=ru(t)}return t.prototype.get=function(t){var e=this,n=Hu(t,this._firestore),r=new zu(this._firestore);return this._transaction.lookup([n._key]).then(function(t){if(!t||1!==t.length)return y();var i=t[0];if(i.isFoundDocument())return new Eu(e._firestore,r,i.key,i,n.converter);if(i.isNoDocument())return new Eu(e._firestore,r,n._key,null,n.converter);throw y()})},t.prototype.set=function(t,e,n){var r=Hu(t,this._firestore),i=Gu(r.converter,e,n),o=iu(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,o),this},t.prototype.update=function(t,e,r){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];var s,a=Hu(t,this._firestore);return s="string"==typeof(e=(0,n.getModularInstance)(e))||e instanceof Wa?lu(this._dataReader,"Transaction.update",a._key,e,r,i):fu(this._dataReader,"Transaction.update",a._key,e),this._transaction.update(a._key,s),this},t.prototype.delete=function(t){var e=Hu(t,this._firestore);return this._transaction.delete(e._key),this},t}());function ec(){if("undefined"==typeof Uint8Array)throw new u(a.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function nc(){if("undefined"==typeof atob)throw new u(a.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var rc=function(){function t(t){this._delegate=t}return t.fromBase64String=function(e){return nc(),new t(Ha.fromBase64String(e))},t.fromUint8Array=function(e){return ec(),new t(Ha.fromUint8Array(e))},t.prototype.toBase64=function(){return nc(),this._delegate.toBase64()},t.prototype.toUint8Array=function(){return ec(),this._delegate.toUint8Array()},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},t}(),ic=function(){function t(){}return t.prototype.enableIndexedDbPersistence=function(t,e){return function(t,e){za(t=Da(t,ja));var n=Ka(t),r=t._freezeSettings(),i=new Hs;return Ga(n,i,new zs(i,r.cacheSizeBytes,null==e?void 0:e.forceOwnership))}(t._delegate,{forceOwnership:e})},t.prototype.enableMultiTabIndexedDbPersistence=function(t){return function(t){za(t=Da(t,ja));var e=Ka(t),n=t._freezeSettings(),r=new Hs;return Ga(e,r,new Ws(r,n.cacheSizeBytes))}(t._delegate)},t.prototype.clearIndexedDbPersistence=function(t){return function(t){var n=this;if(t._initialized&&!t._terminated)throw new u(a.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");var r=new er;return t._queue.enqueueAndForgetEvenWhileRestricted(function(){return(0,e.__awaiter)(n,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return ir.yt()?(n=t+"main",[4,ir.delete(n)]):[2,Promise.resolve()];case 1:return e.sent(),[2]}})})}(yi(t._databaseId,t._persistenceKey))];case 1:return i.sent(),r.resolve(),[3,3];case 2:return n=i.sent(),r.reject(n),[3,3];case 3:return[2]}})})}),r.promise}(t._delegate)},t}(),oc=function(){function t(t,e,n){var r=this;this._delegate=e,this.Zc=n,this.INTERNAL={delete:function(){return r.terminate()}},t instanceof da||(this.tu=t)}return Object.defineProperty(t.prototype,"_databaseId",{get:function(){return this._delegate._databaseId},enumerable:!1,configurable:!0}),t.prototype.settings=function(t){var e=this._delegate._getSettings();t.merge||e.host===t.host||d("You are overriding the original host. If you did not intend to override your settings, use {merge: true}."),t.merge&&delete(t=Object.assign(Object.assign({},e),t)).merge,this._delegate._setSettings(t)},t.prototype.useEmulator=function(t,e,r){void 0===r&&(r={}),function(t,e,r,i){var o;void 0===i&&(i={});var s=(t=Da(t,ka))._getSettings();if("firestore.googleapis.com"!==s.host&&s.host!==e&&d("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},s),{host:e+":"+r,ssl:!1})),i.mockUserToken){var c,h;if("string"==typeof i.mockUserToken)c=i.mockUserToken,h=zi.MOCK_USER;else{c=(0,n.createMockUserToken)(i.mockUserToken,null===(o=t._app)||void 0===o?void 0:o.options.projectId);var f=i.mockUserToken.sub||i.mockUserToken.user_id;if(!f)throw new u(a.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new zi(f)}t._credentials=new ma(new ya(c,h))}}(this._delegate,t,e,r)},t.prototype.enableNetwork=function(){return function(t){var n=this;return t.asyncQueue.enqueue(function(){return(0,e.__awaiter)(n,void 0,void 0,function(){var n,r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,oa(t)];case 1:return n=e.sent(),[4,aa(t)];case 2:return r=e.sent(),[2,(n.setNetworkEnabled(!0),function(t){var e=m(r);return e.Or.delete(0),_o(e)}())]}})})})}(Ka(Da(this._delegate,ja)))},t.prototype.disableNetwork=function(){return function(t){var n=this;return t.asyncQueue.enqueue(function(){return(0,e.__awaiter)(n,void 0,void 0,function(){var n,r;return(0,e.__generator)(this,function(i){switch(i.label){case 0:return[4,oa(t)];case 1:return n=i.sent(),[4,aa(t)];case 2:return r=i.sent(),[2,(n.setNetworkEnabled(!1),function(t){return(0,e.__awaiter)(this,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return(n=m(t)).Or.add(0),[4,wo(n)];case 1:return e.sent(),n.Br.set("Offline"),[2]}})})}(r))]}})})})}(Ka(Da(this._delegate,ja)))},t.prototype.enablePersistence=function(t){var e=!1,n=!1;return t&&Ea("synchronizeTabs",e=!!t.synchronizeTabs,"experimentalForceOwningTab",n=!!t.experimentalForceOwningTab),e?this.Zc.enableMultiTabIndexedDbPersistence(this):this.Zc.enableIndexedDbPersistence(this,n)},t.prototype.clearPersistence=function(){return this.Zc.clearIndexedDbPersistence(this)},t.prototype.terminate=function(){return this.tu&&(this.tu._removeServiceInstance("firestore"),this.tu._removeServiceInstance("firestore-exp")),this._delegate._delete()},t.prototype.waitForPendingWrites=function(){return function(t){var n=this,r=new er;return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(n,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return n=Is,[4,ua(t)];case 1:return[2,n.apply(void 0,[e.sent(),r])]}})})}),r.promise}(Ka(Da(this._delegate,ja)))},t.prototype.onSnapshotsInSync=function(t){return function(t,n){return function(t,n){var r=this,i=new $s(n);return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return n=function(t,e){m(t).Gr.add(e),e.next()},[4,ca(t)];case 1:return[2,n.apply(void 0,[e.sent(),i])]}})})}),function(){i.Wo(),t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return n=function(t,e){m(t).Gr.delete(e)},[4,ca(t)];case 1:return[2,n.apply(void 0,[e.sent(),i])]}})})})}}(Ka(t=Da(t,ja)),qa(n)?n:{next:n})}(this._delegate,t)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.tu)throw new u(a.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.tu},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new wc(this,Oa(this._delegate,t))}catch(t){throw lc(t,"collection()","Firestore.collection()")}},t.prototype.doc=function(t){try{return new fc(this,Pa(this._delegate,t))}catch(t){throw lc(t,"doc()","Firestore.doc()")}},t.prototype.collectionGroup=function(t){try{return new mc(this,function(t,e){if(t=Da(t,ka),ba("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new u(a.INVALID_ARGUMENT,"Invalid collection ID '"+e+"' passed to function collectionGroup(). Collection IDs must not contain '/'.");return new Ra(t,null,function(t){return new At(x.emptyPath(),t)}(e))}(this._delegate,t))}catch(t){throw lc(t,"collectionGroup()","Firestore.collectionGroup()")}},t.prototype.runTransaction=function(t){var n=this;return function(t,n){return function(t,n){var r=this,i=new er;return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){var r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return[4,function(t){return ia(t).then(function(t){return t.datastore})}(t)];case 1:return r=e.sent(),new Zs(t.asyncQueue,r,n,i).run(),[2]}})})}),i.promise}(Ka(t),function(e){return n(new tc(t,e))})}(this._delegate,function(e){return t(new uc(n,e))})},t.prototype.batch=function(){var t=this;return Ka(this._delegate),new cc(new Wu(this._delegate,function(e){return Ju(t._delegate,e)}))},t.prototype.loadBundle=function(t){throw new u(a.FAILED_PRECONDITION,'"loadBundle()" does not exist, have you imported "firebase/firestore/bundle"?')},t.prototype.namedQuery=function(t){throw new u(a.FAILED_PRECONDITION,'"namedQuery()" does not exist, have you imported "firebase/firestore/bundle"?')},t}(),sc=function(t){function n(e){var n=this;return(n=t.call(this)||this).firestore=e,n}return(0,e.__extends)(n,t),n.prototype.convertBytes=function(t){return new rc(new Ha(t))},n.prototype.convertReference=function(t){var e=this.convertDocumentKey(t,this.firestore._databaseId);return fc.eu(e,this.firestore,null)},n}(Qu);function ac(t){var e;e=t,c.setLogLevel(e)}exports.U=oc,exports.q=ic,exports.a=rc;var uc=function(){function t(t,e){this._firestore=t,this._delegate=e,this._userDataWriter=new sc(t)}return t.prototype.get=function(t){var e=this,n=bc(t);return this._delegate.get(n).then(function(t){return new yc(e._firestore,new Du(e._firestore._delegate,e._userDataWriter,t._key,t._document,t.metadata,n.converter))})},t.prototype.set=function(t,e,n){var r=bc(t);return n?(Ia("Transaction.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,n,r){for(var i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];var a=bc(t);return 2===arguments.length?this._delegate.update(a,n):(i=this._delegate).update.apply(i,(0,e.__spreadArray)([a,n,r],o)),this},t.prototype.delete=function(t){var e=bc(t);return this._delegate.delete(e),this},t}(),cc=function(){function t(t){this._delegate=t}return t.prototype.set=function(t,e,n){var r=bc(t);return n?(Ia("WriteBatch.set",n),this._delegate.set(r,e,n)):this._delegate.set(r,e),this},t.prototype.update=function(t,n,r){for(var i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];var a=bc(t);return 2===arguments.length?this._delegate.update(a,n):(i=this._delegate).update.apply(i,(0,e.__spreadArray)([a,n,r],o)),this},t.prototype.delete=function(t){var e=bc(t);return this._delegate.delete(e),this},t.prototype.commit=function(){return this._delegate.commit()},t}(),hc=function(){function t(t,e,n){this._firestore=t,this._userDataWriter=e,this._delegate=n}return t.prototype.fromFirestore=function(t,e){var n=new Au(this._firestore._delegate,this._userDataWriter,t._key,t._document,t.metadata,null);return this._delegate.fromFirestore(new vc(this._firestore,n),null!=e?e:{})},t.prototype.toFirestore=function(t,e){return e?this._delegate.toFirestore(t,e):this._delegate.toFirestore(t)},t.nu=function(e,n){var r=t.su,i=r.get(e);i||(i=new WeakMap,r.set(e,i));var o=i.get(n);return o||(o=new t(e,new sc(e),n),i.set(n,o)),o},t}();exports.W=cc,exports.j=uc,hc.su=new WeakMap;var fc=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new sc(t)}return t.iu=function(e,n,r){if(e.length%2!=0)throw new u(a.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+e.canonicalString()+" has "+e.length);return new t(n,new Ca(n._delegate,r,new Q(e)))},t.eu=function(e,n,r){return new t(n,new Ca(n._delegate,r,e))},Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new wc(this.firestore,this._delegate.parent)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){try{return new wc(this.firestore,Oa(this._delegate,t))}catch(t){throw lc(t,"collection()","DocumentReference.collection()")}},t.prototype.isEqual=function(t){return(t=(0,n.getModularInstance)(t))instanceof Ca&&Fa(this._delegate,t)},t.prototype.set=function(t,e){e=Ia("DocumentReference.set",e);try{return function(t,e,n){t=Da(t,Ca);var r=Da(t.firestore,ja),i=Gu(t.converter,e,n);return Ju(r,[iu(ru(r),"setDoc",t._key,i,null!==t.converter,n).toMutation(t._key,ue.none())])}(this._delegate,t,e)}catch(t){throw lc(t,"setDoc()","DocumentReference.set()")}},t.prototype.update=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];try{return 1===arguments.length?$u(this._delegate,t):$u.apply(void 0,(0,e.__spreadArray)([this._delegate,t,n],r))}catch(t){throw lc(t,"updateDoc()","DocumentReference.update()")}},t.prototype.delete=function(){return Ju(Da((t=this._delegate).firestore,ja),[new Ee(t._key,ue.none())]);var t},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=dc(e),i=pc(e,function(e){return new yc(t.firestore,new Du(t.firestore._delegate,t._userDataWriter,e._key,e._document,e.metadata,t._delegate.converter))});return Xu(this._delegate,r,i)},t.prototype.get=function(t){var n=this;return("cache"===(null==t?void 0:t.source)?function(t){t=Da(t,Ca);var n=Da(t.firestore,ja),r=Ka(n),i=new Yu(n);return function(t,n){var r=this,i=new er;return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){var r;return(0,e.__generator)(this,function(o){switch(o.label){case 0:return r=function(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,function(t,e){var n=m(t);return n.persistence.runTransaction("read document","readonly",function(t){return n.Mn.mn(t,e)})}(t,n)];case 1:return(o=e.sent()).isFoundDocument()?r.resolve(o):o.isNoDocument()?r.resolve(null):r.reject(new u(a.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 i=e.sent(),o=Go(i,"Failed to get document '"+n+" from cache"),r.reject(o),[3,3];case 3:return[2]}})})},[4,sa(t)];case 1:return[2,r.apply(void 0,[o.sent(),n,i])]}})})}),i.promise}(r,t._key).then(function(e){return new Du(n,i,t._key,e,new Nu(null!==e&&e.hasLocalMutations,!0),t.converter)})}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Da(t,Ca);var e=Da(t.firestore,ja);return ha(Ka(e),t._key,{source:"server"}).then(function(n){return Zu(e,t,n)})}(this._delegate):function(t){t=Da(t,Ca);var e=Da(t.firestore,ja);return ha(Ka(e),t._key).then(function(n){return Zu(e,t,n)})}(this._delegate)).then(function(t){return new yc(n.firestore,new Du(n.firestore._delegate,n._userDataWriter,t._key,t._document,t.metadata,n._delegate.converter))})},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(hc.nu(this.firestore,e)):this._delegate.withConverter(null))},t}();function lc(t,e,n){return t.message=t.message.replace(e,n),t}function dc(t){for(var e=0,n=t;e<n.length;e++){var r=n[e];if("object"==o(r)&&!qa(r))return r}return{}}function pc(t,e){var n,r,i;return{next:function(t){i.next&&i.next(e(t))},error:null===(n=(i=qa(t[0])?t[0]:qa(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)}}exports.z=fc;var yc=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"ref",{get:function(){return new fc(this._firestore,this._delegate.ref)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return this._delegate.exists()},enumerable:!1,configurable:!0}),t.prototype.data=function(t){return this._delegate.data(t)},t.prototype.get=function(t,e){return this._delegate.get(t,e)},t.prototype.isEqual=function(t){return Cu(this._delegate,t._delegate)},t}(),vc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return(0,e.__extends)(n,t),n.prototype.data=function(t){return this._delegate.data(t)},n}(yc),mc=function(){function t(t,e){this.firestore=t,this._delegate=e,this._userDataWriter=new sc(t)}return t.prototype.where=function(e,n,r){try{return new t(this.firestore,Ou(this._delegate,function(t,e,n){var r=e,i=Su("where",t);return new Pu(i,r,n)}(e,n,r)))}catch(e){throw lc(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.orderBy=function(e,n){try{return new t(this.firestore,Ou(this._delegate,function(t,e){void 0===e&&(e="asc");var n=e,r=Su("orderBy",t);return new Fu(r,n)}(e,n)))}catch(e){throw lc(e,/(orderBy|where)\(\)/,"Query.$1()")}},t.prototype.limit=function(e){try{return new t(this.firestore,Ou(this._delegate,function(t){return Aa("limit",t),new Mu("limit",t,"F")}(e)))}catch(e){throw lc(e,"limit()","Query.limit()")}},t.prototype.limitToLast=function(e){try{return new t(this.firestore,Ou(this._delegate,function(t){return Aa("limitToLast",t),new Mu("limitToLast",t,"L")}(e)))}catch(e){throw lc(e,"limitToLast()","Query.limitToLast()")}},t.prototype.startAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,Ou(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Vu("startAt",t,!0)}.apply(void 0,e)))}catch(e){throw lc(e,"startAt()","Query.startAt()")}},t.prototype.startAfter=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,Ou(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new Vu("startAfter",t,!1)}.apply(void 0,e)))}catch(e){throw lc(e,"startAfter()","Query.startAfter()")}},t.prototype.endBefore=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,Ou(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new qu("endBefore",t,!0)}.apply(void 0,e)))}catch(e){throw lc(e,"endBefore()","Query.endBefore()")}},t.prototype.endAt=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return new t(this.firestore,Ou(this._delegate,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new qu("endAt",t,!1)}.apply(void 0,e)))}catch(e){throw lc(e,"endAt()","Query.endAt()")}},t.prototype.isEqual=function(t){return Ma(this._delegate,t._delegate)},t.prototype.get=function(t){var n=this;return("cache"===(null==t?void 0:t.source)?function(t){t=Da(t,Ra);var n=Da(t.firestore,ja),r=Ka(n),i=new Yu(n);return function(t,n){var r=this,i=new er;return t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){var r;return(0,e.__generator)(this,function(o){switch(o.label){case 0:return r=function(t,n,r){return(0,e.__awaiter)(this,void 0,void 0,function(){var i,o,s,a,u;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,ki(t,n,!0)];case 1:return u=e.sent(),i=new cs(n,u.Bn),o=i._o(u.documents),s=i.applyChanges(o,!1),r.resolve(s.snapshot),[3,3];case 2:return a=e.sent(),u=Go(a,"Failed to execute query '"+n+" against cache"),r.reject(u),[3,3];case 3:return[2]}})})},[4,sa(t)];case 1:return[2,r.apply(void 0,[o.sent(),n,i])]}})})}),i.promise}(r,t._query).then(function(e){return new xu(n,i,t,e)})}(this._delegate):"server"===(null==t?void 0:t.source)?function(t){t=Da(t,Ra);var e=Da(t.firestore,ja),n=Ka(e),r=new Yu(e);return fa(n,t._query,{source:"server"}).then(function(n){return new xu(e,r,t,n)})}(this._delegate):function(t){t=Da(t,Ra);var e=Da(t.firestore,ja),n=Ka(e),r=new Yu(e);return Ru(t._query),fa(n,t._query).then(function(n){return new xu(e,r,t,n)})}(this._delegate)).then(function(t){return new _c(n.firestore,new xu(n.firestore._delegate,n._userDataWriter,n._delegate,t._snapshot))})},t.prototype.onSnapshot=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=dc(e),i=pc(e,function(e){return new _c(t.firestore,new xu(t.firestore._delegate,t._userDataWriter,t._delegate,e._snapshot))});return Xu(this._delegate,r,i)},t.prototype.withConverter=function(e){return new t(this.firestore,e?this._delegate.withConverter(hc.nu(this.firestore,e)):this._delegate.withConverter(null))},t}(),gc=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"type",{get:function(){return this._delegate.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"doc",{get:function(){return new vc(this._firestore,this._delegate.doc)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"oldIndex",{get:function(){return this._delegate.oldIndex},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"newIndex",{get:function(){return this._delegate.newIndex},enumerable:!1,configurable:!0}),t}(),_c=function(){function t(t,e){this._firestore=t,this._delegate=e}return Object.defineProperty(t.prototype,"query",{get:function(){return new mc(this._firestore,this._delegate.query)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return this._delegate.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._delegate.size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this._delegate.empty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"docs",{get:function(){var t=this;return this._delegate.docs.map(function(e){return new vc(t._firestore,e)})},enumerable:!1,configurable:!0}),t.prototype.docChanges=function(t){var e=this;return this._delegate.docChanges(t).map(function(t){return new gc(e._firestore,t)})},t.prototype.forEach=function(t,e){var n=this;this._delegate.forEach(function(r){t.call(e,new vc(n._firestore,r))})},t.prototype.isEqual=function(t){return Cu(this._delegate,t._delegate)},t}(),wc=function(t){function n(e,n){var r=this;return(r=t.call(this,e,n)||this).firestore=e,r._delegate=n,r}return(0,e.__extends)(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"path",{get:function(){return this._delegate.path},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){var t=this._delegate.parent;return t?new fc(this.firestore,t):null},enumerable:!1,configurable:!0}),n.prototype.doc=function(t){try{return new fc(this.firestore,void 0===t?Pa(this._delegate):Pa(this._delegate,t))}catch(t){throw lc(t,"doc()","CollectionReference.doc()")}},n.prototype.add=function(t){var e=this;return function(t,e){var n=Da(t.firestore,ja),r=Pa(t),i=Gu(t.converter,e);return Ju(n,[iu(ru(t.firestore),"addDoc",r._key,i,null!==t.converter,{}).toMutation(r._key,ue.exists(!1))]).then(function(){return r})}(this._delegate,t).then(function(t){return new fc(e.firestore,t)})},n.prototype.isEqual=function(t){return Fa(this._delegate,t._delegate)},n.prototype.withConverter=function(t){return new n(this.firestore,t?this._delegate.withConverter(hc.nu(this.firestore,t)):this._delegate.withConverter(null))},n}(mc);function bc(t){return Da(t,Ca)}exports.s=wc,exports.n=_c,exports.t=mc,exports.Z=vc,exports.X=yc;var Ic=function(){function t(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._delegate=new(Wa.bind.apply(Wa,(0,e.__spreadArray)([void 0],t)))}return t.documentId=function(){return new t(C.keyField().canonicalString())},t.prototype.isEqual=function(t){return(t=(0,n.getModularInstance)(t))instanceof Wa&&this._delegate._internalPath.isEqual(t._internalPath)},t}(),Ec=function(){function t(t){this._delegate=t}return t.serverTimestamp=function(){var e=new au("serverTimestamp");return e._methodName="FieldValue.serverTimestamp",new t(e)},t.delete=function(){var e=new ou("deleteField");return e._methodName="FieldValue.delete",new t(e)},t.arrayUnion=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new uu("arrayUnion",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayUnion",new t(r)},t.arrayRemove=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return new cu("arrayRemove",t)}.apply(void 0,e);return r._methodName="FieldValue.arrayRemove",new t(r)},t.increment=function(e){var n=new hu("increment",e);return n._methodName="FieldValue.increment",new t(n)},t.prototype.isEqual=function(t){return this._delegate.isEqual(t._delegate)},t}();function Tc(t){return function(t,n){var r=Ka(t=Da(t,ja)),i=new Ua;return function(t,n,r,i){var o=this,s=function(t,e){return function(t,e){return new Xs(t,e)}(function(t,e){if(t instanceof Uint8Array)return Ys(t,e);if(t instanceof ArrayBuffer)return Ys(new Uint8Array(t),e);if(t instanceof ReadableStream)return t.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}("string"==typeof t?(new TextEncoder).encode(t):t),e)}(r,ho(n));t.asyncQueue.enqueueAndForget(function(){return(0,e.__awaiter)(o,void 0,void 0,function(){var n;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return n=Qs,[4,ua(t)];case 1:return n.apply(void 0,[e.sent(),s,i]),[2]}})})})}(r,t._databaseId,n,i),i}(this._delegate,t)}function Sc(t){var n,r,i=this;return(n=this._delegate,r=t,function(t,n){var r=this;return t.asyncQueue.enqueue(function(){return(0,e.__awaiter)(r,void 0,void 0,function(){var r;return(0,e.__generator)(this,function(e){switch(e.label){case 0:return r=function(t,e){var n=m(t);return n.persistence.runTransaction("Get named query","readonly",function(t){return n.Ke.getNamedQuery(t,e)})},[4,sa(t)];case 1:return[2,r.apply(void 0,[e.sent(),n])]}})})})}(Ka(n=Da(n,ja)),r).then(function(t){return t?new Ra(n,null,t.query):null})).then(function(t){return t?new mc(i,t):null})}exports.o=Ec,exports.r=Ic;
|
|
494
|
+
},{"tslib":"f2sD","@firebase/util":"KxmD","@firebase/logger":"TUpU","@firebase/webchannel-wrapper":"ueHA","process":"pBGv"}],"oyBH":[function(require,module,exports) {
|
|
495
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.registerFirestore=o;var e=i(require("@firebase/app")),r=require("./prebuilt-306f43d8-45d6f0b9.js"),t=require("@firebase/component");function i(e){return e&&e.__esModule?e:{default:e}}require("tslib"),require("@firebase/util"),require("@firebase/logger"),require("@firebase/webchannel-wrapper");var n={Firestore:r.U,GeoPoint:r.C,Timestamp:r.M,Blob:r.a,Transaction:r.j,WriteBatch:r.W,DocumentReference:r.z,DocumentSnapshot:r.X,Query:r.t,QueryDocumentSnapshot:r.Z,QuerySnapshot:r.n,CollectionReference:r.s,FieldPath:r.r,FieldValue:r.o,setLogLevel:r.Q,CACHE_SIZE_UNLIMITED:r.E};function o(e){!function(e,i){e.INTERNAL.registerComponent(new t.Component("firestore",function(e){return function(e,t){return new r.U(e,new r.T(e,t),new r.q)}(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"))},"PUBLIC").setServiceProps(Object.assign({},n)))}(e),e.registerVersion("@firebase/firestore","2.4.0")}o(e.default);
|
|
496
|
+
},{"@firebase/app":"VxYX","./prebuilt-306f43d8-45d6f0b9.js":"Emx5","@firebase/component":"sLOu","tslib":"f2sD","@firebase/util":"KxmD","@firebase/logger":"TUpU","@firebase/webchannel-wrapper":"ueHA"}],"vHL5":[function(require,module,exports) {
|
|
497
|
+
"use strict";require("@firebase/firestore");
|
|
498
|
+
},{"@firebase/firestore":"oyBH"}],"TX5A":[function(require,module,exports) {
|
|
499
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.config=void 0,exports.config={apiKey:"AIzaSyB0TkZ83Fj0CIzn8AAmE-Osc92s3ER8hy8",authDomain:"neurosity-device.firebaseapp.com",databaseURL:"https://neurosity-device.firebaseio.com",projectId:"neurosity-device",storageBucket:"neurosity-device.appspot.com",messagingSenderId:"212595049674"};
|
|
500
|
+
},{}],"OERo":[function(require,module,exports) {
|
|
501
|
+
"use strict";function e(e){return a(e)||r(e)||t()}function t(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function r(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function a(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FirebaseApp=exports.SERVER_TIMESTAMP=void 0;var s=u(require("firebase/app"));require("firebase/database"),require("firebase/auth"),require("firebase/functions"),require("firebase/firestore");var f=require("./config");exports.SERVER_TIMESTAMP=s.default.database.ServerValue.TIMESTAMP;var p=function(){function t(e){n(this,t),this.app=this.getApp(e.deviceId),this.standalone=this.app.name===e.deviceId,e.emulator&&this.connectEmulators(e)}return o(t,[{key:"getApp",value:function(t){var r=s.default.apps,a="undefined"!=typeof window&&"firebase"in window&&"apps"in window.firebase?window.firebase.apps:[],n=[].concat(e(r),e(a)).find(function(e){return"[DEFAULT]"===e.name&&e.options.databaseURL===f.config.databaseURL});if(n)return n;if(t){var i=t,o=r.find(function(e){return e.name===i});return o||s.default.initializeApp(f.config,i)}return s.default.initializeApp(f.config)}},{key:"connectEmulators",value:function(e){var t=e.emulatorHost,r=e.emulatorAuthPort,a=e.emulatorDatabasePort,n=e.emulatorFunctionsPort,i=e.emulatorFirestorePort,o=e.emulatorOptions;this.app.auth().useEmulator("http://".concat(t,":").concat(r)),this.app.database().useEmulator(t,a,o),this.app.functions().useEmulator(t,n),this.app.firestore().useEmulator(t,i,o)}},{key:"goOnline",value:function(){this.app.database().goOnline()}},{key:"goOffline",value:function(){this.app.database().goOffline()}},{key:"disconnect",value:function(){return this.standalone?this.app.delete():Promise.resolve()}}]),t}();exports.FirebaseApp=p;
|
|
502
|
+
},{"firebase/app":"OJEJ","firebase/database":"Uuoh","firebase/auth":"zKjx","firebase/functions":"a7Bh","firebase/firestore":"vHL5","./config":"TX5A"}],"Cc51":[function(require,module,exports) {
|
|
503
|
+
"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){return i(e)||n(e,t)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function n(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,u=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(c){i=!0,u=c}finally{try{n||null==o.return||o.return()}finally{if(i)throw u}}return r}}function i(e){if(Array.isArray(e))return e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}function c(){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(e){return!1}}function s(e,t,r){return(s=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&f(i,r.prototype),i}).apply(null,arguments)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,u){function a(e){try{c(n.next(e))}catch(t){u(t)}}function o(e){try{c(n.throw(e))}catch(t){u(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,o)}c((n=n.apply(e,t||[])).next())})},h=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FirebaseUser=exports.createUser=exports.credentialWithLink=void 0;var p=require("rxjs"),v=require("rxjs/operators"),d=h(require("firebase/app")),m=d.default.database.ServerValue.TIMESTAMP;function b(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s(d.default.User,t)}exports.credentialWithLink=d.default.auth.EmailAuthProvider.credentialWithLink,exports.createUser=b;var g=function(){function r(e){var t=this;u(this,r),this.app=e.app,this.app.auth().onAuthStateChanged(function(e){t.user=e})}return o(r,[{key:"auth",value:function(){return this.app.auth()}},{key:"createAccount",value:function(e){return l(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,u,a,o,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.email,i=e.password,r.next=3,this.app.auth().createUserWithEmailAndPassword(n,i).then(function(e){return[null,e]}).catch(function(e){return[e,null]});case 3:if(u=r.sent,a=t(u,2),o=a[0],c=a[1],!o){r.next=9;break}return r.abrupt("return",Promise.reject(o));case 9:return r.abrupt("return",c);case 10:case"end":return r.stop()}},r,this)}))}},{key:"deleteAccount",value:function(){return l(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,n,i,u,a,o,c=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.app.auth().currentUser){e.next=3;break}return e.abrupt("return",Promise.reject(new Error("You are trying to delete an account that is not authenticated. To delete an account, the account must have signed in recently.")));case 3:return e.next=5,this.getDevices().then(function(e){return[null,e]}).catch(function(e){return[e,null]});case 5:if(n=e.sent,i=t(n,2),u=i[0],a=i[1],!u){e.next=11;break}return e.abrupt("return",Promise.reject(u));case 11:if(!a.length){e.next=17;break}return e.next=14,Promise.all(a.map(function(e){return c.removeDevice(e.deviceId)})).then(function(){return null}).catch(function(e){return e});case 14:if(!(o=e.sent)){e.next=17;break}return e.abrupt("return",Promise.reject(o));case 17:return e.abrupt("return",r.delete());case 18:case"end":return e.stop()}},e,this)}))}},{key:"onAuthStateChanged",value:function(){var e=this;return new p.Observable(function(t){try{e.app.auth().onAuthStateChanged(function(e){t.next(e)},function(e){t.error(e)})}catch(r){t.error(r)}})}},{key:"onLogin",value:function(){var e=this;return new p.Observable(function(t){var r=e.app.auth().onAuthStateChanged(function(e){e&&(t.next(e),t.complete())});return function(){return r()}})}},{key:"login",value:function(e){if("customToken"in e){var t=e.customToken;return this.app.auth().signInWithCustomToken(t)}if("idToken"in e&&"providerId"in e){var r=new d.default.auth.OAuthProvider(e.providerId).credential(e.idToken);return this.app.auth().signInWithCredential(r)}if("email"in e&&"password"in e){var n=e.email,i=e.password;return this.app.auth().signInWithEmailAndPassword(n,i)}throw new Error("Either {email,password}, {customToken}, or {idToken,providerId} is required")}},{key:"logout",value:function(){return this.app.auth().signOut()}},{key:"createCustomToken",value:function(){return l(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,n,i,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.app.functions().httpsCallable("createCustomToken")().then(function(e){return[null,e.data]}).catch(function(e){return[e,null]});case 2:if(r=e.sent,n=t(r,2),i=n[0],u=n[1],!i){e.next=8;break}return e.abrupt("return",Promise.reject(i));case 8:return e.abrupt("return",u);case 9:case"end":return e.stop()}},e,this)}))}},{key:"removeOAuthAccess",value:function(){var e;return l(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,u,a,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(null===(e=this.user)||void 0===e?void 0:e.uid){r.next=3;break}return r.abrupt("return",Promise.reject("OAuth access can only be removed while logged in via OAuth."));case 3:return r.next=5,this.app.functions().httpsCallable("removeAccessOAuthApp")().then(function(e){return[null,e.data]}).catch(function(e){return[e,null]});case 5:if(n=r.sent,i=t(n,2),u=i[0],a=i[1],!u){r.next=11;break}return r.abrupt("return",Promise.reject(u));case 11:return r.next=13,this.logout().then(function(){return!1}).catch(function(e){return e});case 13:if(!(o=r.sent)){r.next=16;break}return r.abrupt("return",Promise.reject(o));case 16:return r.abrupt("return",a);case 17:case"end":return r.stop()}},r,this)}))}},{key:"getDevices",value:function(){var e;return l(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null===(e=this.user)||void 0===e?void 0:e.uid){t.next=3;break}return t.abrupt("return",Promise.reject("Please login."));case 3:return t.next=5,this.app.database().ref(this.getUserDevicesPath()).once("value");case 5:return r=t.sent,n=r.val(),t.abrupt("return",this.userDevicesToDeviceInfoList(n));case 8:case"end":return t.stop()}},t,this)}))}},{key:"addDevice",value:function(r){var n;return l(this,void 0,void 0,regeneratorRuntime.mark(function i(){var u,a,o,c,s,f,l,h,p,v,d,b,g;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(a=null===(n=this.user)||void 0===n?void 0:n.uid){i.next=3;break}return i.abrupt("return",Promise.reject("Please login."));case 3:return i.next=5,this.getDevices().catch(function(e){console.log(e)});case 5:if(o=i.sent,!(o&&o.length&&o.map(function(e){return e.deviceId}).includes(r))){i.next=9;break}return i.abrupt("return",Promise.reject("The device is already added to this account."));case 9:return i.next=11,this.isDeviceIdValid(r).then(function(e){return[e]}).catch(function(e){return[!1,e]});case 11:if(c=i.sent,s=t(c,2),f=s[0],l=s[1],f){i.next=17;break}return i.abrupt("return",Promise.reject(l));case 17:return h=this.getDeviceClaimedByPath(r),p=this.getUserClaimedDevicePath(r),i.next=21,this.app.database().ref().update((u={},e(u,h,a),e(u,p,{claimedOn:m}),u)).then(function(){return[!1]}).catch(function(e){return[!0,e]});case 21:if(v=i.sent,d=t(v,2),b=d[0],g=d[1],!b){i.next=27;break}return i.abrupt("return",Promise.reject(g));case 27:case"end":return i.stop()}},i,this)}))}},{key:"removeDevice",value:function(e){var r;return l(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,u,a,o,c,s,f,l;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(null===(r=this.user)||void 0===r?void 0:r.uid){n.next=3;break}return n.abrupt("return",Promise.reject("Please login."));case 3:return i=this.getDeviceClaimedByPath(e),u=this.getUserClaimedDevicePath(e),a=this.app.database().ref(i),o=this.app.database().ref(u),n.next=9,Promise.all([a.remove(),o.remove()]).then(function(){return[!1]}).catch(function(e){return[!0,e]});case 9:if(c=n.sent,s=t(c,2),f=s[0],l=s[1],!f){n.next=15;break}return n.abrupt("return",Promise.reject(l));case 15:case"end":return n.stop()}},n,this)}))}},{key:"transferDevice",value:function(e){var r;return l(this,void 0,void 0,regeneratorRuntime.mark(function n(){var i,u,a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(null===(r=this.user)||void 0===r?void 0:r.uid){n.next=3;break}return n.abrupt("return",Promise.reject(new Error("transferDevice: auth is required.")));case 3:if("recipientsEmail"in e||"recipientsUserId"in e){n.next=5;break}return n.abrupt("return",Promise.reject(new Error("transferDevice: either 'recipientsEmail' or 'recipientsUserId' key is required.")));case 5:if(null==e?void 0:e.deviceId){n.next=7;break}return n.abrupt("return",Promise.reject(new Error("transferDevice: a deviceId is required.")));case 7:return n.next=9,this.app.functions().httpsCallable("transferDeviceOwnership")(e).then(function(e){return[null,e.data]}).catch(function(e){return[e,null]});case 9:if(i=n.sent,u=t(i,2),a=u[0],u[1],!a){n.next=15;break}return n.abrupt("return",Promise.reject(a));case 15:case"end":return n.stop()}},n,this)}))}},{key:"isDeviceIdValid",value:function(e){return l(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n,i,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=/[0-9A-Fa-f]{32}/g,e&&32===e.length&&r.test(e)){t.next=3;break}return t.abrupt("return",Promise.reject("The device id is incorrectly formatted."));case 3:return n=this.getDeviceClaimedByPath(e),i=this.app.database().ref(n),t.next=7,i.once("value").catch(function(){return null});case 7:if((u=t.sent)&&!u.exists()){t.next=10;break}return t.abrupt("return",Promise.reject("The device has already been claimed."));case 10:return t.abrupt("return",!0);case 11:case"end":return t.stop()}},t,this)}))}},{key:"onUserDevicesChange",value:function(){var e=this;return this.onAuthStateChanged().pipe((0,v.switchMap)(function(r){if(!r)return p.EMPTY;var n=e.getUserDevicesPath(),i=e.app.database().ref(n);return(0,p.fromEventPattern)(function(e){return i.on("value",e)},function(e){return i.off("value",e)}).pipe((0,v.map)(function(e){return t(e,1)[0].val()}),(0,v.switchMap)(function(t){return(0,p.from)(e.userDevicesToDeviceInfoList(t))}))}))}},{key:"onUserClaimsChange",value:function(){var e=this;return this.onAuthStateChanged().pipe((0,v.switchMap)(function(r){if(!r)return p.EMPTY;var n=e.getUserClaimsUpdatedOnPath(),i=e.app.database().ref(n);return(0,p.fromEventPattern)(function(e){return i.on("value",e)},function(e){return i.off("value",e)}).pipe((0,v.map)(function(e){return t(e,1)[0].val()}),(0,v.switchMap)(function(){return(0,p.from)(e.getIdToken(!0)).pipe((0,v.switchMap)(function(){return(0,p.from)(e.getClaims())}))}))}))}},{key:"getIdToken",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return l(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n=null===(e=this.app.auth())||void 0===e?void 0:e.currentUser){r.next=3;break}return r.abrupt("return",Promise.reject("getUserIdToken: unable to get currentUser"));case 3:return r.next=5,n.getIdToken(t).catch(function(e){console.error(e)});case 5:case"end":return r.stop()}},r,this)}))}},{key:"getClaims",value:function(){var e,t=null===(e=this.app.auth())||void 0===e?void 0:e.currentUser;return t?t.getIdTokenResult().then(function(e){return e.claims}).catch(function(e){return console.error(e),null}):Promise.reject("getUserClaims: unable to get currentUser")}},{key:"userDevicesToDeviceInfoList",value:function(e){return l(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n,i,u=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object.keys(null!=e?e:{}).map(function(e){return u.app.database().ref(u.getDeviceInfoPath(e)).once("value")}),t.next=3,Promise.all(r).then(function(e){return e.map(function(e){return e.val()})});case 3:return n=t.sent,(i=n.filter(function(e){return!!e})).sort(function(t,r){return e[t.deviceId].claimedOn-e[r.deviceId].claimedOn}),t.abrupt("return",i);case 7:case"end":return t.stop()}},t)}))}},{key:"hasDevicePermission",value:function(e){return l(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getDeviceInfoPath(e),t.next=3,this.app.database().ref(r).once("value").then(function(){return!0}).catch(function(){return!1});case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}},t,this)}))}},{key:"getDeviceClaimedByPath",value:function(e){return"devices/".concat(e,"/status/claimedBy")}},{key:"getUserClaimedDevicePath",value:function(e){var t=this.user.uid;return"users/".concat(t,"/devices/").concat(e)}},{key:"getUserDevicesPath",value:function(){var e=this.user.uid;return"users/".concat(e,"/devices")}},{key:"getUserClaimsUpdatedOnPath",value:function(){var e=this.user.uid;return"users/".concat(e,"/claimsUpdatedOn")}},{key:"getDeviceInfoPath",value:function(e){return"devices/".concat(e,"/info")}},{key:"onUserExperiments",value:function(){var e=this;return this.onAuthStateChanged().pipe((0,v.switchMap)(function(r){if(!r)return p.EMPTY;var n=e.user.uid,i=e.app.database().ref("experiments").orderByChild("userId").equalTo(n).limitToFirst(100);return(0,p.fromEventPattern)(function(e){return i.on("value",e)},function(e){return i.off("value",e)}).pipe((0,v.map)(function(e){return t(e,1)[0].val()}),(0,v.map)(function(e){return Object.entries(null!=e?e:{}).map(function(e){var r,n=t(e,2),i=n[0],u=n[1];return Object.assign({id:null!==(r=null==u?void 0:u.id)&&void 0!==r?r:i},u)}).sort(function(e,t){return new Date(null==t?void 0:t.timestamp).getTime()-new Date(null==e?void 0:e.timestamp).getTime()})}))}))}},{key:"deleteUserExperiment",value:function(e){return l(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n,i=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",Promise.reject("deleteUserExperiment: please provide an experiment id"));case 2:return r=function(e){return i.app.database().ref("experiments").child(e).remove()},n=function(e){return i.app.functions().httpsCallable("removeRelations")({experimentId:e})},t.next=6,Promise.all([r(e),n(e)]).catch(function(){});case 6:case"end":return t.stop()}},t)}))}}]),r}();exports.FirebaseUser=g;
|
|
504
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","firebase/app":"OJEJ"}],"mSvX":[function(require,module,exports) {
|
|
505
|
+
"use strict";function e(e,o){return r(e)||t(e,o)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function t(e,n){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var t=[],r=!0,o=!1,c=void 0;try{for(var i,u=e[Symbol.iterator]();!(r=(i=u.next()).done)&&(t.push(i.value),!n||t.length!==n);r=!0);}catch(a){o=!0,c=a}finally{try{r||null==u.return||u.return()}finally{if(o)throw c}}return t}}function r(e){if(Array.isArray(e))return e}var o=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))(function(o,c){function i(e){try{a(r.next(e))}catch(n){c(n)}}function u(e){try{a(r.throw(e))}catch(n){c(n)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(i,u)}a((r=r.apply(e,n||[])).next())})},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.createDeviceStore=void 0;var i=c(require("firebase/app")),u=i.default.database.ServerValue.TIMESTAMP,a=function(n,t,r){var c=n.database().ref("devices/".concat(t)),i=c.child("subscriptions").push().key,a=c.child("clients/".concat(i)),s=[],f=function(e,n){return c.child(e).set(n)},l=function(e,n){return c.child(e).update(n)},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"value",n=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,r=c.child(n).on(e,function(e){t(e.val(),e)});return s.push(function(){c.child(n).off(e,r)}),r},d=function(e,n,t){t?c.child(e).off(n,t):c.child(e).off(n)},p=n.database().ref(".info/connected").on("value",function(e){e.val()&&a.onDisconnect().remove().then(function(){a.set(u),l("subscriptions",r.get()).then(function(){r.toList().forEach(function(e){var n="subscriptions/".concat(e.id);c.child(n).onDisconnect().remove()})})})});return s.push(function(){n.database().ref(".info/connected").off("value",p)}),{set:f,once:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value";return o(void 0,void 0,void 0,regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c.child(e).once(n);case 2:return r=t.sent,t.abrupt("return",r.val());case 4:case"end":return t.stop()}},t)}))},update:l,lastOfChildValue:function(n,t,r){return o(void 0,void 0,void 0,regeneratorRuntime.mark(function o(){var i,u,a,s,f;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,c.child(n).orderByChild(t).equalTo(r).limitToLast(1).once("value");case 2:return i=o.sent,u=i.val(),a=Object.values(u||{}),s=e(a,1),f=s[0],o.abrupt("return",f||null);case 6:case"end":return o.stop()}},o)}))},onNamespace:function(e,n){return v("value",e,function(e){n(e)})},offNamespace:function(e,n){d(e,"value",n)},dispatchAction:function(e){return o(void 0,void 0,void 0,regeneratorRuntime.mark(function n(){var t,r,o,i,u,a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s="actions",f=e,c.child(s).push(f);case 2:if(t=n.sent,r=t.key,o="actions/".concat(r),t.onDisconnect().remove(),!e.responseRequired){n.next=11;break}return i=e.responseTimeout||6e5,u=new Promise(function(e,n){var r=setTimeout(function(){clearTimeout(r),t.remove(),n("Action response timed out in ".concat(i,"ms."))},i)}),a=new Promise(function(e){var n,t,r,c;n="value",t="".concat(o,"/response"),r=e,v(n,t,function(e){null!==e&&(d(t,n),r(c||e))})}),n.abrupt("return",Promise.race([a,u]));case 11:return n.abrupt("return",r);case 12:case"end":return n.stop()}var s,f},n)}))},nextMetric:function(e,n){return o(void 0,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:f("metrics/".concat(e),n);case 1:case"end":return t.stop()}},t)}))},onMetric:function(e,n){var t=e.atomic,r=e.metric,o=e.labels,c=t?"metrics/".concat(r):"metrics/".concat(r,"/").concat(o[0]);return v("value",c,function(e){null!==e&&n(e)})},subscribeToMetric:function(e){var n=c.child("subscriptions").push().key,t="subscriptions/".concat(n),r=Object.assign({id:n,clientId:i},e);return f(t,r),c.child(t).onDisconnect().remove(),r},unsubscribeFromMetric:function(e){var n;n="subscriptions/".concat(e.id),c.child(n).remove()},removeMetricListener:function(e,n){var t=e.atomic,r=e.metric,o=e.labels,c=t?"metrics/".concat(r):"metrics/".concat(r,"/").concat(o[0]);d(c,"value",n)},disconnect:function(){a.remove(),s.forEach(function(e){e()}),r.toList().filter(function(e){return e.clientId===i}).forEach(function(e){var n="subscriptions/".concat(e.id);c.child(n).remove()})}}};exports.createDeviceStore=a;
|
|
506
|
+
},{"firebase/app":"OJEJ"}],"KzOJ":[function(require,module,exports) {
|
|
507
|
+
"use strict";function e(e,i){return n(e)||r(e,i)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function r(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var u,a=e[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(c){i=!0,o=c}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}}function n(e){if(Array.isArray(e))return e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e}var a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function u(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,a)}c((n=n.apply(e,t||[])).next())})},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FirebaseDevice=void 0;var s=c(require("firebase/app")),v=require("./deviceStore"),f=s.default.database.ServerValue.TIMESTAMP,d=function(){function t(e){var r=e.deviceId,n=e.firebaseApp,o=e.dependencies;if(i(this,t),!r)throw new Error("No Device ID provided.");this.deviceId=r,this.app=n.app,this.deviceStore=(0,v.createDeviceStore)(this.app,r,o.subscriptionManager)}return u(t,[{key:"dispatchAction",value:function(e){return this.deviceStore.dispatchAction(e)}},{key:"getInfo",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.deviceStore.once("info");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"onNamespace",value:function(e,t){return this.deviceStore.onNamespace(e,t)}},{key:"onceNamespace",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.deviceStore.once(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"offNamespace",value:function(e,t){this.deviceStore.offNamespace(e,t)}},{key:"getTimesync",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dispatchAction({command:"timesync",action:"get",responseRequired:!0,responseTimeout:250});case 2:return t=e.sent,e.abrupt("return",t.timestamp);case 4:case"end":return e.stop()}},e,this)}))}},{key:"nextMetric",value:function(e,t){this.deviceStore.nextMetric(e,t)}},{key:"onMetric",value:function(e,t){return this.deviceStore.onMetric(e,t)}},{key:"subscribeToMetric",value:function(e){return this.deviceStore.subscribeToMetric(Object.assign(Object.assign({},e),{serverType:t.serverType}))}},{key:"unsubscribeFromMetric",value:function(e){this.deviceStore.unsubscribeFromMetric(e)}},{key:"removeMetricListener",value:function(e,t){this.deviceStore.removeMetricListener(e,t)}},{key:"changeSettings",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.deviceStore.update("settings",e));case 1:case"end":return t.stop()}},t,this)}))}},{key:"getSkill",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.deviceStore.lastOfChildValue("skills","bundleId",e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"createBluetoothToken",value:function(){var t;return a(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,o,u;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.app.functions().httpsCallable("createBluetoothToken")({deviceId:this.deviceId}).then(function(e){var t=e.data;return[null,null==t?void 0:t.token]}).catch(function(e){return[e,null]});case 2:if(n=r.sent,i=e(n,2),o=i[0],u=i[1],!o){r.next=8;break}return r.abrupt("return",Promise.reject(null!==(t=null==o?void 0:o.message)&&void 0!==t?t:o));case 8:if(u){r.next=10;break}return r.abrupt("return",Promise.reject("Failed to create Bluetooth token."));case 10:return r.abrupt("return",u);case 11:case"end":return r.stop()}},r,this)}))}},{key:"disconnect",value:function(){this.deviceStore.disconnect()}},{key:"timestamp",get:function(){return f}}]),t}();exports.FirebaseDevice=d,d.serverType="firebase";
|
|
508
|
+
},{"firebase/app":"OJEJ","./deviceStore":"mSvX"}],"kM30":[function(require,module,exports) {
|
|
509
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&("get"in o?r.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=r[t]}),r=this&&this.__exportStar||function(r,t){for(var i in r)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||e(t,r,i)};Object.defineProperty(exports,"__esModule",{value:!0}),r(require("./FirebaseApp"),exports),r(require("./FirebaseUser"),exports),r(require("./FirebaseDevice"),exports);
|
|
510
|
+
},{"./FirebaseApp":"OERo","./FirebaseUser":"Cc51","./FirebaseDevice":"KzOJ"}],"c6Wx":[function(require,module,exports) {
|
|
511
|
+
var r=Array.isArray;function n(n){if(r(n))return t(n);var e=null,u="string"==typeof n&&n;return function(r,n,i){return e||(e=t(i,u)),r=u?r[u]:r,!~e.indexOf(r)}}function t(r,n){r=r.slice(0),n&&(r=r.map(function(r){return r[n]}));for(var t=(r=r.sort(function(r,n){return r-n})).length,i=e(r),o=u(r),a=[],c=0;c<t;c++)Math.abs(r[c]-i)>o&&a.push(r[c]);return a}function e(r){var n=r.length,t=~~(n/2);return n%2?r[t]:(r[t-1]+r[t])/2}function u(r){var n=r.length,t=e(r.slice(0,~~(n/2)));return 1.5*(e(r.slice(Math.ceil(n/2)))-t)}module.exports=n;
|
|
512
|
+
},{}],"s7Vt":[function(require,module,exports) {
|
|
513
|
+
"use strict";function e(e,o){return n(e)||t(e,o)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function t(e,r){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var t=[],n=!0,o=!1,i=void 0;try{for(var u,l=e[Symbol.iterator]();!(n=(u=l.next()).done)&&(t.push(u.value),!r||t.length!==r);n=!0);}catch(a){o=!0,i=a}finally{try{n||null==l.return||l.return()}finally{if(o)throw i}}return t}}function n(e){if(Array.isArray(e))return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.whileOnline=void 0;var o=require("rxjs"),i=require("rxjs/operators");function u(r){var t=r.status$,n=r.allowWhileOnSleepMode;return(0,o.pipe)((0,i.withLatestFrom)(t),(0,i.mergeMap)(function(r){var t=e(r,2),i=t[0];return l(t[1],n)?(0,o.of)(i):o.EMPTY}))}function l(e,r){return!("online"!==e.state||!r&&e.sleepMode)}exports.whileOnline=u;
|
|
514
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE"}],"iVIU":[function(require,module,exports) {
|
|
515
|
+
"use strict";function t(t,i){return r(t)||n(t,i)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function n(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,u=void 0;try{for(var o,a=t[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(f){i=!0,u=f}finally{try{r||null==a.return||a.return()}finally{if(i)throw u}}return n}}function r(t){if(Array.isArray(t))return t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(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 o(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),t}var a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,u){function o(t){try{f(r.next(t))}catch(e){u(e)}}function a(t){try{f(r.throw(t))}catch(e){u(e)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}f((r=r.apply(t,e||[])).next())})},f=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Timesync=void 0;var s=require("rxjs"),c=require("rxjs/operators"),l=require("rxjs/operators"),p=f(require("outliers")),h=require("../utils/whileOnline"),v={bufferSize:100,updateInterval:6e4},y=function(){function e(t){i(this,e),this._offset=0,this.options=Object.assign(Object.assign({},v),t),this.start()}return o(e,[{key:"start",value:function(){var t=this,e=this.options,n=e.bufferSize,r=e.updateInterval,i=e.status$,u=(0,s.range)(0,n),o=(0,s.timer)(r,r).pipe((0,c.map)(function(t){return n+t}),(0,h.whileOnline)({status$:i,allowWhileOnSleepMode:!0}));i.pipe((0,c.filter)(function(t){return"online"===t.state}),(0,c.take)(1)).pipe((0,l.switchMap)(function(){return u.pipe((0,c.concatWith)(o),t.toOffset(),(0,l.bufferCount)(n,1),t.filterOutliers(),(0,c.map)(function(e){return t.average(e)}))})).subscribe(function(e){t._offset=e})}},{key:"filterOutliers",value:function(){return(0,s.pipe)((0,c.map)(function(t){return t.filter((0,p.default)())}))}},{key:"toOffset",value:function(){var e=this,n=this.options.getTimesync;return(0,s.pipe)((0,l.concatMap)(function(){return a(e,void 0,void 0,regeneratorRuntime.mark(function e(){var r,i,u,o,a,f,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=Date.now(),e.next=3,n().then(function(t){return[null,t]}).catch(function(t){return[t]});case 3:if(i=e.sent,u=t(i,2),o=u[0],a=u[1],!o){e.next=9;break}return e.abrupt("return",0);case 9:return f=Date.now(),s=f-(f-r)/2-a,e.abrupt("return",s);case 13:case"end":return e.stop()}},e)}))}))}},{key:"average",value:function(t){return Math.round(t.reduce(function(t,e){return t+e})/t.length)}},{key:"offset",get:function(){return this._offset}},{key:"timestamp",get:function(){return Date.now()+this._offset}}]),e}();exports.Timesync=y;
|
|
516
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","outliers":"c6Wx","../utils/whileOnline":"s7Vt"}],"CXqr":[function(require,module,exports) {
|
|
517
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),t=this&&this.__exportStar||function(t,r){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||e(r,t,i)};Object.defineProperty(exports,"__esModule",{value:!0}),t(require("./Timesync"),exports);
|
|
518
|
+
},{"./Timesync":"iVIU"}],"BX8M":[function(require,module,exports) {
|
|
519
|
+
"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubscriptionManager=void 0;var n=function(){function t(){e(this,t),this._subscriptions={}}return i(t,[{key:"get",value:function(){return this._subscriptions}},{key:"toList",value:function(){return Object.values(this._subscriptions)}},{key:"add",value:function(e){this._subscriptions[e.id]=e}},{key:"remove",value:function(e){e.id in this._subscriptions&&Reflect.deleteProperty(this._subscriptions,e.id)}}]),t}();exports.SubscriptionManager=n;
|
|
520
|
+
},{}],"Ttuy":[function(require,module,exports) {
|
|
521
|
+
"use strict";var t,e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SLEEP_MODE_REASON=exports.STATUS=void 0,function(t){t.ONLINE="online",t.OFFLINE="offline",t.UPDATING="updating",t.BOOTING="booting",t.SHUTTING_OFF="shuttingOff"}(t=exports.STATUS||(exports.STATUS={})),function(t){t.UPDATING="updating",t.CHARGING="charging"}(e=exports.SLEEP_MODE_REASON||(exports.SLEEP_MODE_REASON={}));
|
|
522
|
+
},{}],"ImaE":[function(require,module,exports) {
|
|
523
|
+
"use strict";function t(t,a){return n(t)||r(t,a)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function r(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,a=!1,i=void 0;try{for(var u,o=t[Symbol.iterator]();!(n=(u=o.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(s){a=!0,i=s}finally{try{n||null==o.return||o.return()}finally{if(a)throw i}}return r}}function n(t){if(Array.isArray(t))return t}var a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.deviceHasLostHeartbeat=exports.heartbeatAwareStatus=void 0;var i=require("rxjs"),u=require("rxjs/operators"),o=require("rxjs/operators"),s=a(require("fast-deep-equal")),c=require("../types/status"),l=3e4,p=2.5*l;function f(e){var r=e.pipe((0,u.map)(function(t){return t.lastHeartbeat}),(0,o.distinctUntilChanged)(),(0,u.map)(function(){return Date.now()})),n=r.pipe((0,u.switchMap)(function(){return(0,i.timer)(p)}),(0,u.map)(function(){return null}),(0,u.startWith)(null));return(0,i.combineLatest)({status:e,lostHeartbeat:n}).pipe((0,o.withLatestFrom)(r),(0,u.map)(function(e){var r=t(e,2),n=r[0].status,a=r[1];return a&&b(n,a)?Object.assign(Object.assign({},n),{state:c.STATUS.OFFLINE}):n}),(0,o.distinctUntilChanged)(function(t,e){return(0,s.default)(t,e)}))}function b(t,e){return"lastHeartbeat"in t&&Date.now()-e>p}exports.heartbeatAwareStatus=f,exports.deviceHasLostHeartbeat=b;
|
|
524
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","fast-deep-equal":"jIGR","../types/status":"Ttuy"}],"qny3":[function(require,module,exports) {
|
|
525
|
+
"use strict";function r(r,i){return n(r)||e(r,i)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function e(r,t){if(Symbol.iterator in Object(r)||"[object Arguments]"===Object.prototype.toString.call(r)){var e=[],n=!0,i=!1,o=void 0;try{for(var u,a=r[Symbol.iterator]();!(n=(u=a.next()).done)&&(e.push(u.value),!t||e.length!==t);n=!0);}catch(l){i=!0,o=l}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return e}}function n(r){if(Array.isArray(r))return r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.filterInternalKeys=void 0;var i=require("rxjs"),o=require("rxjs/operators");function u(){return(0,i.pipe)((0,o.map)(function(t){return t?Object.entries(t).reduce(function(t,e){var n=r(e,2),i=n[0],o=n[1];return i.startsWith("__")||(t[i]=o),t},{}):t}))}exports.filterInternalKeys=u;
|
|
526
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE"}],"LXvB":[function(require,module,exports) {
|
|
527
|
+
"use strict";function e(e,i){return n(e)||r(e,i)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function r(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,s=void 0;try{for(var u,a=e[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(c){i=!0,s=c}finally{try{n||null==a.return||a.return()}finally{if(i)throw s}}return r}}function n(e){if(Array.isArray(e))return e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),e}var a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function u(e){try{c(n.next(e))}catch(t){s(t)}}function a(e){try{c(n.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CloudClient=exports.SERVER_TIMESTAMP=exports.createUser=exports.credentialWithLink=void 0;var c=require("rxjs"),o=require("rxjs"),f=require("rxjs/operators"),v=require("./firebase"),h=require("../timesync"),p=require("../subscriptions/SubscriptionManager"),d=require("../utils/heartbeat"),l=require("../utils/filterInternalKeys"),b=require("./firebase");Object.defineProperty(exports,"credentialWithLink",{enumerable:!0,get:function(){return b.credentialWithLink}}),Object.defineProperty(exports,"createUser",{enumerable:!0,get:function(){return b.createUser}}),Object.defineProperty(exports,"SERVER_TIMESTAMP",{enumerable:!0,get:function(){return b.SERVER_TIMESTAMP}});var m=function(){function t(e){var r=this;i(this,t),this._selectedDevice=new c.ReplaySubject(1),this.options=e,this.subscriptionManager=new p.SubscriptionManager,this.firebaseApp=new v.FirebaseApp(e),this.firebaseUser=new v.FirebaseUser(this.firebaseApp),this._selectedDevice.next(void 0),this.status$=(0,d.heartbeatAwareStatus)(this.observeNamespace("status").pipe((0,f.share)())).pipe((0,l.filterInternalKeys)(),(0,f.shareReplay)(1)),this.firebaseUser.onAuthStateChanged().subscribe(function(e){r.user=e}),this.firebaseUser.onUserClaimsChange().subscribe(function(e){r.userClaims=e}),this.onDeviceChange().subscribe(function(e){r.firebaseDevice&&r.firebaseDevice.disconnect(),e&&(r.firebaseDevice=new v.FirebaseDevice({deviceId:e.deviceId,firebaseApp:r.firebaseApp,dependencies:{subscriptionManager:r.subscriptionManager}}),r.options.timesync&&(r.timesync=new h.Timesync({status$:r.status(),getTimesync:r.firebaseDevice.getTimesync.bind(r.firebaseDevice)})))})}return u(t,[{key:"onDeviceChange",value:function(){return this._selectedDevice.asObservable().pipe((0,f.filter)(function(e){return void 0!==e}))}},{key:"setAutoSelectedDevice",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.options.deviceId){e.next=4;break}return e.next=3,this.selectDevice(function(e){return e.find(function(e){return e.deviceId===t.options.deviceId})});case 3:return e.abrupt("return",e.sent);case 4:if(this.options.deviceId||!this.options.autoSelectDevice){e.next=8;break}return e.next=7,this.selectDevice(function(e){return e[0]});case 7:return e.abrupt("return",e.sent);case 8:return e.abrupt("return",null);case 9:case"end":return e.stop()}},e,this)}))}},{key:"dispatchAction",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.firebaseDevice.dispatchAction(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"disconnect",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.firebaseApp.disconnect());case 1:case"end":return e.stop()}},e,this)}))}},{key:"getInfo",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.firebaseDevice.getInfo();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"login",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.user){t.next=2;break}return t.abrupt("return",Promise.reject("Already logged in."));case 2:return t.next=4,this.firebaseUser.login(e);case 4:return r=t.sent,t.next=7,this.setAutoSelectedDevice();case 7:return n=t.sent,t.abrupt("return",Object.assign(Object.assign({},r),{selectedDevice:n}));case 9:case"end":return t.stop()}},t,this)}))}},{key:"logout",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.firebaseDevice&&this.firebaseDevice.disconnect(),e.next=3,this.firebaseUser.logout();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}))}},{key:"onAuthStateChanged",value:function(){var e=this;return this.firebaseUser.onAuthStateChanged().pipe((0,f.switchMap)(function(t){return a(e,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",null);case 2:if(!this.didSelectDevice()){e.next=8;break}return e.next=5,this.getSelectedDevice();case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,this.setAutoSelectedDevice();case 10:e.t0=e.sent;case 11:return r=e.t0,e.abrupt("return",Object.assign(Object.assign({},t),{selectedDevice:r}));case 13:case"end":return e.stop()}},e,this)}))}))}},{key:"getDevices",value:function(){return this.firebaseUser.getDevices()}},{key:"addDevice",value:function(e){return this.firebaseUser.addDevice(e)}},{key:"removeDevice",value:function(t){return a(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,s,u,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.firebaseUser.removeDevice(t).then(function(){return[!1]}).catch(function(e){return[!0,e]});case 2:if(n=r.sent,i=e(n,2),s=i[0],u=i[1],!s){r.next=8;break}return r.abrupt("return",Promise.reject(u));case 8:return r.next=10,this.getSelectedDevice();case 10:(null==(a=r.sent)?void 0:a.deviceId)===t&&this._selectedDevice.next(null);case 12:case"end":return r.stop()}},r,this)}))}},{key:"transferDevice",value:function(t){return a(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,s,u,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.firebaseUser.transferDevice(t).then(function(){return[!1]}).catch(function(e){return[!0,e]});case 2:if(n=r.sent,i=e(n,2),s=i[0],u=i[1],!s){r.next=8;break}return r.abrupt("return",Promise.reject(u));case 8:return r.next=10,this.getSelectedDevice();case 10:(null==(a=r.sent)?void 0:a.deviceId)===t.deviceId&&this._selectedDevice.next(null);case 12:case"end":return r.stop()}},r,this)}))}},{key:"onUserDevicesChange",value:function(){return this.firebaseUser.onUserDevicesChange()}},{key:"onUserClaimsChange",value:function(){return this.firebaseUser.onUserClaimsChange()}},{key:"didSelectDevice",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSelectedDevice();case 2:return t=e.sent,e.abrupt("return",!!t);case 4:case"end":return e.stop()}},e,this)}))}},{key:"selectDevice",value:function(t){return a(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getDevices();case 2:if(n=r.sent){r.next=5;break}return r.abrupt("return",Promise.reject("Did not find any devices for this user. Make sure your device is claimed by your Neurosity account."));case 5:if(i=function(r){return r.find(function(r){if(!Array.isArray(t))return!1;var n=e(t,2),i=n[0],s=n[1];return JSON.stringify(null==r?void 0:r[i])===JSON.stringify(s)})},s="function"==typeof t?t(n):i(n)){r.next=9;break}return r.abrupt("return",Promise.reject("A device was not provided. Try returning a device from the devicesList provided in the callback."));case 9:return r.next=11,this.firebaseUser.hasDevicePermission(s.deviceId);case 11:if(r.sent){r.next=14;break}return r.abrupt("return",Promise.reject("Rejected device access due to permissions."));case 14:return this._selectedDevice.next(s),r.abrupt("return",s);case 16:case"end":return r.stop()}},r,this)}))}},{key:"getSelectedDevice",value:function(){return a(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,o.firstValueFrom)(this._selectedDevice);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"status",value:function(){return this.status$}},{key:"observeNamespace",value:function(e){var t=this;return this.onDeviceChange().pipe((0,f.switchMap)(function(r){return r?(0,o.fromEventPattern)(function(r){return t.firebaseDevice.onNamespace(e,r)},function(r){return t.firebaseDevice.offNamespace(e,r)}):c.EMPTY}))}},{key:"onceNamespace",value:function(e){return a(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.firebaseDevice.onceNamespace(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"createAccount",value:function(e){return this.firebaseUser.createAccount(e)}},{key:"deleteAccount",value:function(){return this.firebaseUser.deleteAccount()}},{key:"createBluetoothToken",value:function(){return this.firebaseDevice.createBluetoothToken()}},{key:"createCustomToken",value:function(){return this.firebaseUser.createCustomToken()}},{key:"removeOAuthAccess",value:function(){return this.firebaseUser.removeOAuthAccess()}},{key:"onUserExperiments",value:function(){return this.firebaseUser.onUserExperiments()}},{key:"deleteUserExperiment",value:function(e){return this.firebaseUser.deleteUserExperiment(e)}},{key:"getTimesyncOffset",value:function(){return this.timesync.offset}},{key:"changeSettings",value:function(e){return this.firebaseDevice.changeSettings(e)}},{key:"goOffline",value:function(){this.firebaseApp.goOffline()}},{key:"goOnline",value:function(){this.firebaseApp.goOnline()}},{key:"__getApp",value:function(){return this.firebaseApp.app}},{key:"actions",get:function(){var e=this;return{dispatch:function(t){return e.firebaseDevice.dispatchAction(t)}}}},{key:"metrics",get:function(){var e=this;return{next:function(t,r){e.firebaseDevice.nextMetric(t,r)},on:function(t,r){return e.firebaseDevice.onMetric(t,r)},subscribe:function(t){var r=e.firebaseDevice.subscribeToMetric(t);return e.subscriptionManager.add(r),r},unsubscribe:function(t,r){e.subscriptionManager.remove(t),e.firebaseDevice.unsubscribeFromMetric(t),e.firebaseDevice.removeMetricListener(t,r)}}}},{key:"skills",get:function(){var e=this;return{get:function(t){return a(e,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.firebaseDevice.getSkill(t));case 1:case"end":return e.stop()}},e,this)}))}}}},{key:"timestamp",get:function(){return this.options.timesync?this.timesync.timestamp:Date.now()}}]),t}();exports.CloudClient=m;
|
|
528
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","./firebase":"kM30","../timesync":"CXqr","../subscriptions/SubscriptionManager":"BX8M","../utils/heartbeat":"ImaE","../utils/filterInternalKeys":"qny3"}],"rekm":[function(require,module,exports) {
|
|
529
|
+
"use strict";var t,o;Object.defineProperty(exports,"__esModule",{value:!0}),exports.STREAMING_MODE=exports.STREAMING_TYPE=void 0,function(t){t.WIFI="wifi",t.BLUETOOTH="bluetooth"}(t=exports.STREAMING_TYPE||(exports.STREAMING_TYPE={})),function(t){t.WIFI_ONLY="wifi-only",t.WIFI_WITH_BLUETOOTH_FALLBACK="wifi-with-bluetooth-fallback",t.BLUETOOTH_WITH_WIFI_FALLBACK="bluetooth-with-wifi-fallback"}(o=exports.STREAMING_MODE||(exports.STREAMING_MODE={}));
|
|
530
|
+
},{}],"A5u5":[function(require,module,exports) {
|
|
531
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BLUETOOTH_CHUNK_DELIMITER=exports.BLUETOOTH_CHARACTERISTICS=exports.BLUETOOTH_DEVICE_NAME_PREFIXES=exports.BLUETOOTH_COMPANY_IDENTIFIER_STRING=exports.BLUETOOTH_COMPANY_IDENTIFIER_HEX=exports.BLUETOOTH_DESCRIPTOR_UUID=exports.BLUETOOTH_DESCRIPTOR_CODE=exports.BLUETOOTH_PRIMARY_SERVICE_COMPLETE_UUID_STRING=exports.BLUETOOTH_PRIMARY_SERVICE_UUID_STRING=exports.BLUETOOTH_PRIMARY_SERVICE_UUID_HEX=void 0;const e=6147;exports.BLUETOOTH_PRIMARY_SERVICE_UUID_HEX=6147;const E=6147..toString(16);exports.BLUETOOTH_PRIMARY_SERVICE_UUID_STRING=E;const T="00001803-0000-1000-8000-00805f9b34fb";exports.BLUETOOTH_PRIMARY_SERVICE_COMPLETE_UUID_STRING="00001803-0000-1000-8000-00805f9b34fb";const _="2901";exports.BLUETOOTH_DESCRIPTOR_CODE="2901";const I="00002901-0000-1000-8000-00805f9b34fb";exports.BLUETOOTH_DESCRIPTOR_UUID=I;const O=3022;exports.BLUETOOTH_COMPANY_IDENTIFIER_HEX=3022;const t=3022..toString(16);exports.BLUETOOTH_COMPANY_IDENTIFIER_STRING=t;const f=["Crown-","Notion-"];exports.BLUETOOTH_DEVICE_NAME_PREFIXES=f;const o={deviceId:"d7e84cb2-ff37-4afc-9ed8-5577aeb84542",deviceInfo:"97b81f68-04cf-4650-a044-14924f11b9ee",actions:"d2e4b9e7-ab9d-4806-88a3-58584c1cf02b",status:"1defa07f-2d1c-4e55-b981-eedabba7ae2b",settings:"014975ce-50df-4bfb-8ed4-a3437d619268",focus:"8e12baf1-81bb-4a1b-8948-9e68a4457d2a",calm:"7d47617d-a60a-41d1-8df6-cfb78d02ffeb",accelerometer:"84501dee-8665-4073-b111-bdecd69fb489",signalQuality:"cf28ed0c-20cd-48ed-93c5-ee2fb265099a",raw:"009cf0bb-b68d-4af1-a0e5-625f2eb964a6",rawUnfiltered:"5472432e-3313-4169-add8-6fcb29accb0e",psd:"d6684fb0-8518-40c0-8e88-4634e762435d",powerByBand:"2f6236dd-215a-427f-b94c-ab5df71937af",wifiNearbyNetworks:"f1cd519b-07dc-4f33-a285-286db2393359",wifiConnections:"37b2ce69-6fac-4547-91f3-8f1c527b875d",auth:"7f9f1a35-9816-471b-bf67-2ec6f2295a1d"};exports.BLUETOOTH_CHARACTERISTICS=o;const b="\n";exports.BLUETOOTH_CHUNK_DELIMITER="\n";
|
|
532
|
+
},{}],"ZOGh":[function(require,module,exports) {
|
|
533
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={metrics:!0};exports.default=exports.metrics=void 0;var t=require("./bluetooth");Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}}))});const r={rest:{},artifactDetector:{},leftArm:{},rightArm:{},leftHandPinch:{},rightHandPinch:{},tongue:{},jumpingJacks:{},leftFoot:{},rightFoot:{},leftThumbFinger:{},leftIndexFinger:{},leftMiddleFinger:{},leftRingFinger:{},leftPinkyFinger:{},rightThumbFinger:{},rightIndexFinger:{},rightMiddleFinger:{},rightRingFinger:{},rightPinkyFinger:{},mentalMath:{},bitingALemon:{},push:{},pull:{},lift:{},drop:{},moveLeft:{},moveRight:{},moveForward:{},moveBackward:{},rotateLeft:{},rotateRight:{},rotateClockwise:{},rotateCounterClockwise:{},disappear:{}},i={CP6:{},F6:{},C4:{},CP4:{},CP3:{},F5:{},C3:{},CP5:{}},n={kinesis:r,predictions:r,channelAnalysis:i,signalQuality:i,status:{state:{},battery:{},charging:{},connected:{},connectedSince:{},connectedLast:{},updatingProgress:{},simulate:{},ssid:{}},accelerometer:{acceleration:{},inclination:{},orientation:{},pitch:{},roll:{},x:{},y:{},z:{}},awareness:{creativity:{},comprehension:{},focus:{},meditation:{},calm:{}},brainwaves:{raw:{},rawUnfiltered:{},frequency:{},powerByBand:{},psd:{}},emotion:{joy:{},sadness:{},anger:{},surprise:{},excitement:{},disappointment:{},fear:{},love:{},stress:{},interest:{}},facialExpression:{smile:{},laugh:{},frown:{},blink:{},winkLeft:{},winkRight:{}}};exports.metrics=n;var o={metrics:n};exports.default=o;
|
|
534
|
+
},{"./bluetooth":"A5u5"}],"WDyG":[function(require,module,exports) {
|
|
535
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exceededMaxItems=exports.locationNotFound=exports.metricNotSupportedByModel=exports.mustSelectDevice=exports.prefix=void 0,exports.prefix="Neurosity SDK: ",exports.mustSelectDevice=new Error("".concat(exports.prefix,'A device must be selected. Make sure to call "neurosity.selectDevice()"'));var e=function(e,o){return new Error("".concat(exports.prefix).concat(e," not supported on model version ").concat(o,". See docs.neurosity.co for more info."))};exports.metricNotSupportedByModel=e;var o=function(e,o){return new Error("".concat(exports.prefix).concat(e," location not supported on model version ").concat(o,". Check spelling or see docs.neurosity.co for more info."))};exports.locationNotFound=o;var r=function(e){return new Error("".concat(exports.prefix,"Maximum items in array is ").concat(e))};exports.exceededMaxItems=r;
|
|
536
|
+
},{}],"yLLB":[function(require,module,exports) {
|
|
537
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&("get"in s?t.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(null!=r)for(var s in r)"default"!==s&&Object.prototype.hasOwnProperty.call(r,s)&&e(i,r,s);return t(i,r),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.validate=exports.isMetricDisallowed=exports.hasInvalidLabels=exports.getLabels=exports.isMetric=void 0;var i=require("@neurosity/ipk"),s=r(require("../utils/errors")),o=function(e){return Object.keys(i.metrics).includes(e)};exports.isMetric=o;var n=function(e){return Object.keys(i.metrics[e])};exports.getLabels=n;var a=function(e,t){var r=(0,exports.getLabels)(e);return!t.every(function(e){return r.includes(e)})};exports.hasInvalidLabels=a;var c=function(e,t){return"skill"in t&&"metrics"in t.skill&&!t.skill.metrics.includes(e)};exports.isMetricDisallowed=c;var l=function(e,t,r){var i=(0,exports.getLabels)(e).join(", ");return t.length?(0,exports.isMetricDisallowed)(e,r)?new Error("".concat(s.prefix,"No permission to access the ").concat(e," metric. To access this metric, edit the skill's permissions")):!!(0,exports.hasInvalidLabels)(e,t)&&new Error("".concat(s.prefix,"One ore more labels provided to ").concat(e," are invalid. The valid labels for ").concat(e," are ").concat(i)):new Error("".concat(s.prefix,"At least one label is required for ").concat(e," metric. Please add one of the following labels: ").concat(i))};exports.validate=l;
|
|
538
|
+
},{"@neurosity/ipk":"ZOGh","../utils/errors":"WDyG"}],"wAkn":[function(require,module,exports) {
|
|
539
|
+
"use strict";var o,e,r,t;function s(o,e,r){return e in o?Object.defineProperty(o,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[e]=r,o}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPlatformHapticMotors=exports.supportsAccel=exports.supportsHaptics=exports.platformConfigByModelVersion=exports.platformFeaturesByModelVersion=exports.HAPTIC_P8=exports.HAPTIC_P7=exports.FEATURE_ACCEL=exports.FEATURE_HAPTICS=exports.MODEL_VERSION_3=exports.MODEL_VERSION_2=exports.MODEL_VERSION_1=void 0,exports.MODEL_VERSION_1="1",exports.MODEL_VERSION_2="2",exports.MODEL_VERSION_3="3",exports.FEATURE_HAPTICS="haptics",exports.FEATURE_ACCEL="accel",exports.HAPTIC_P7="P7",exports.HAPTIC_P8="P8",exports.platformFeaturesByModelVersion=(s(o={},exports.MODEL_VERSION_1,[]),s(o,exports.MODEL_VERSION_2,[exports.FEATURE_HAPTICS,exports.FEATURE_ACCEL]),s(o,exports.MODEL_VERSION_3,[exports.FEATURE_HAPTICS,exports.FEATURE_ACCEL]),o),exports.platformConfigByModelVersion=(s(t={},exports.MODEL_VERSION_1,{}),s(t,exports.MODEL_VERSION_2,{motorByMotorName:(e={},s(e,exports.HAPTIC_P7,[]),s(e,exports.HAPTIC_P8,[]),e)}),s(t,exports.MODEL_VERSION_3,{motorByMotorName:(r={},s(r,exports.HAPTIC_P7,[]),s(r,exports.HAPTIC_P8,[]),r)}),t);var p=function(o){return exports.platformFeaturesByModelVersion[o].includes(exports.FEATURE_HAPTICS)};exports.supportsHaptics=p;var E=function(o){return exports.platformFeaturesByModelVersion[o].includes(exports.FEATURE_ACCEL)};exports.supportsAccel=E;var x=function(o){var e,r=exports.platformConfigByModelVersion[o],t=null!==(e=null==r?void 0:r.motorByMotorName)&&void 0!==e?e:{};return Object.assign({},t)};exports.getPlatformHapticMotors=x;
|
|
540
|
+
},{}],"lLai":[function(require,module,exports) {
|
|
541
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.buzz4_40=exports.buzz3_60=exports.buzz2_80=exports.buzz1_100=exports.longDoubleSharpTick3_60=exports.longDoubleSharpTick2_80=exports.longDoubleSharpTick1_100=exports.longDoubleSharpClickMedium3_60=exports.longDoubleSharpClickMedium2_80=exports.longDoubleSharpClickMedium1_100=exports.longDoubleSharpClickStrong4_30=exports.longDoubleSharpClickStrong3_60=exports.longDoubleSharpClickStrong2_80=exports.longDoubleSharpClickStrong1_100=exports.shortDoubleSharpTick3_60=exports.shortDoubleSharpTick2_80=exports.shortDoubleSharpTick1_100=exports.shortDoubleClickMedium3_60=exports.shortDoubleClickMedium2_80=exports.shortDoubleClickMedium1_100=exports.shortDoubleClickStrong4_30=exports.shortDoubleClickStrong3_60=exports.shortDoubleClickStrong2_80=exports.shortDoubleClickStrong1_100=exports.sharpTick3_60=exports.sharpTick2_80=exports.sharpTick1_100=exports.mediumClick3_60=exports.mediumClick2_80=exports.mediumClick1_100=exports.strongClick4_30=exports.strongClick3_60=exports.strongClick2_80=exports.strongClick1_100=exports.alert1000ms=exports.alert750ms=exports.strongBuzz100=exports.softFuzz60=exports.tripleClick100=exports.doubleClick60=exports.doubleClick100=exports.softBump30=exports.softBump60=exports.softBump100=exports.sharpClick30=exports.sharpClick60=exports.sharpClick100=exports.strongClick30=exports.strongClick60=exports.strongClick100=void 0,exports.transitionRampDownLongSharp1_50_to_0=exports.transitionRampDownShortSmooth2_50_to_0=exports.transitionRampDownShortSmooth1_50_to_0=exports.transitionRampDownMediumSmooth2_50_to_0=exports.transitionRampDownMediumSmooth1_50_to_0=exports.transitionRampDownLongSmooth2_50_to_0=exports.transitionRampDownLongSmooth1_50_to_0=exports.transitionRampUpShortSharp2_0_to_100=exports.transitionRampUpShortSharp1_0_to_100=exports.transitionRampUpMediumSharp2_0_to_100=exports.transitionRampUpMediumSharp1_0_to_100=exports.transitionRampUpLongSharp2_0_to_100=exports.transitionRampUpLongSharp1_0_to_100=exports.transitionRampUpShortSmooth2_0_to_100=exports.transitionRampUpShortSmooth1_0_to_100=exports.transitionRampUpMediumSmooth2_0_to_100=exports.transitionRampUpMediumSmooth1_0_to_100=exports.transitionRampUpLongSmooth2_0_to_100=exports.transitionRampUpLongSmooth1_0_to_100=exports.transitionRampDownShortSharp2_100_to_0=exports.transitionRampDownShortSharp1_100_to_0=exports.transitionRampDownLongMedium2_100_to_0=exports.transitionRampDownLongMedium1_100_to_0=exports.transitionRampDownLongSharp2_100_to_0=exports.transitionRampDownLongSharp1_100_to_0=exports.transitionRampDownShortSmooth2_100_to_0=exports.transitionRampDownShortSmooth1_100_to_0=exports.transitionRampDownMediumSmooth2_100_to_0=exports.transitionRampDownMediumSmooth1_100_to_0=exports.transitionRampDownLongSmooth2_100_to_0=exports.transitionRampDownLongSmooth1_100_to_0=exports.transistionHum6_10=exports.transistionHum5_20=exports.transistionHum4_40=exports.transistionHum3_60=exports.transistionHum2_80=exports.transistionHum1_100=exports.transistionClick6_10=exports.transistionClick5_20=exports.transistionClick4_40=exports.transistionClick3_60=exports.transistionClick2_80=exports.transistionClick1_100=exports.pulsingSharp2_60=exports.pulsingSharp1_100=exports.pulsingMedium2_60=exports.pulsingMedium1_100=exports.pulsingStong2_60=exports.pulsingStong1_100=exports.buzz5_20=void 0,exports.smoothHum5_10=exports.smoothHum4_20=exports.smoothHum3_30=exports.smoothHum2_40=exports.smoothHum1_50=exports.longBuzzForProgrammaticStopping_100=exports.transitionRampUpShortSharp2_0_to_50=exports.transitionRampUpShortSharp1_0_to_50=exports.transitionRampUpMediumSharp2_0_to_50=exports.transitionRampUpMediumSharp1_0_to_50=exports.transitionRampUpLongSharp2_0_to_50=exports.transitionRampUpLongSharp1_0_to_50=exports.transitionRampUpShortSmooth2_0_to_50=exports.transitionRampUpShortSmooth1_0_to_50=exports.transitionRampUpMediumSmooth2_0_to_50=exports.transitionRampUpMediumSmooth1_0_to_50=exports.transitionRampUpLongSmooth2_0_to_50=exports.transitionRampUpLongSmooth1_0_to_50=exports.transitionRampDownShortSharp2_50_to_0=exports.transitionRampDownShortSharp1_50_to_0=exports.transitionRampDownMediumSharp2_50_to_0=exports.transitionRampDownMediumSharp1_50_to_0=exports.transitionRampDownLongSharp2_50_to_0=void 0,exports.strongClick100="strongClick100",exports.strongClick60="strongClick60",exports.strongClick30="strongClick30",exports.sharpClick100="sharpClick100",exports.sharpClick60="sharpClick60",exports.sharpClick30="sharpClick30",exports.softBump100="softBump100",exports.softBump60="softBump60",exports.softBump30="softBump30",exports.doubleClick100="doubleClick100",exports.doubleClick60="doubleClick60",exports.tripleClick100="tripleClick100",exports.softFuzz60="softFuzz60",exports.strongBuzz100="strongBuzz100",exports.alert750ms="alert750ms",exports.alert1000ms="alert1000ms",exports.strongClick1_100="strongClick1_100",exports.strongClick2_80="strongClick2_80",exports.strongClick3_60="strongClick3_60",exports.strongClick4_30="strongClick4_30",exports.mediumClick1_100="mediumClick1_100",exports.mediumClick2_80="mediumClick2_80",exports.mediumClick3_60="mediumClick3_60",exports.sharpTick1_100="sharpTick1_100",exports.sharpTick2_80="sharpTick2_80",exports.sharpTick3_60="sharpTick3_60",exports.shortDoubleClickStrong1_100="shortDoubleClickStrong1_100",exports.shortDoubleClickStrong2_80="shortDoubleClickStrong2_80",exports.shortDoubleClickStrong3_60="shortDoubleClickStrong3_60",exports.shortDoubleClickStrong4_30="shortDoubleClickStrong4_30",exports.shortDoubleClickMedium1_100="shortDoubleClickMedium1_100",exports.shortDoubleClickMedium2_80="shortDoubleClickMedium2_80",exports.shortDoubleClickMedium3_60="shortDoubleClickMedium3_60",exports.shortDoubleSharpTick1_100="shortDoubleSharpTick1_100",exports.shortDoubleSharpTick2_80="shortDoubleSharpTick2_80",exports.shortDoubleSharpTick3_60="shortDoubleSharpTick3_60",exports.longDoubleSharpClickStrong1_100="longDoubleSharpClickStrong1_100",exports.longDoubleSharpClickStrong2_80="longDoubleSharpClickStrong2_80",exports.longDoubleSharpClickStrong3_60="longDoubleSharpClickStrong3_60",exports.longDoubleSharpClickStrong4_30="longDoubleSharpClickStrong4_30",exports.longDoubleSharpClickMedium1_100="longDoubleSharpClickMedium1_100",exports.longDoubleSharpClickMedium2_80="longDoubleSharpClickMedium2_80",exports.longDoubleSharpClickMedium3_60="longDoubleSharpClickMedium3_60",exports.longDoubleSharpTick1_100="longDoubleSharpTick1_100",exports.longDoubleSharpTick2_80="longDoubleSharpTick2_80",exports.longDoubleSharpTick3_60="longDoubleSharpTick3_60",exports.buzz1_100="buzz1_100",exports.buzz2_80="buzz2_80",exports.buzz3_60="buzz3_60",exports.buzz4_40="buzz4_40",exports.buzz5_20="buzz5_20",exports.pulsingStong1_100="pulsingStong1_100",exports.pulsingStong2_60="pulsingStong2_60",exports.pulsingMedium1_100="pulsingMedium1_100",exports.pulsingMedium2_60="pulsingMedium2_60",exports.pulsingSharp1_100="pulsingSharp1_100",exports.pulsingSharp2_60="pulsingSharp2_60",exports.transistionClick1_100="transistionClick1_100",exports.transistionClick2_80="transistionClick2_80",exports.transistionClick3_60="transistionClick3_60",exports.transistionClick4_40="transistionClick4_40",exports.transistionClick5_20="transistionClick5_20",exports.transistionClick6_10="transistionClick6_10",exports.transistionHum1_100="transistionHum1_100",exports.transistionHum2_80="transistionHum2_80",exports.transistionHum3_60="transistionHum3_60",exports.transistionHum4_40="transistionHum4_40",exports.transistionHum5_20="transistionHum5_20",exports.transistionHum6_10="transistionHum6_10",exports.transitionRampDownLongSmooth1_100_to_0="transitionRampDownLongSmooth1_100_to_0",exports.transitionRampDownLongSmooth2_100_to_0="transitionRampDownLongSmooth2_100_to_0",exports.transitionRampDownMediumSmooth1_100_to_0="transitionRampDownMediumSmooth1_100_to_0",exports.transitionRampDownMediumSmooth2_100_to_0="transitionRampDownMediumSmooth2_100_to_0",exports.transitionRampDownShortSmooth1_100_to_0="transitionRampDownShortSmooth1_100_to_0",exports.transitionRampDownShortSmooth2_100_to_0="transitionRampDownShortSmooth2_100_to_0",exports.transitionRampDownLongSharp1_100_to_0="transitionRampDownLongSharp1_100_to_0",exports.transitionRampDownLongSharp2_100_to_0="transitionRampDownLongSharp2_100_to_0",exports.transitionRampDownLongMedium1_100_to_0="transitionRampDownLongMedium1_100_to_0",exports.transitionRampDownLongMedium2_100_to_0="transitionRampDownLongMedium2_100_to_0",exports.transitionRampDownShortSharp1_100_to_0="transitionRampDownShortSharp1_100_to_0",exports.transitionRampDownShortSharp2_100_to_0="transitionRampDownShortSharp2_100_to_0",exports.transitionRampUpLongSmooth1_0_to_100="transitionRampUpLongSmooth1_0_to_100",exports.transitionRampUpLongSmooth2_0_to_100="transitionRampUpLongSmooth2_0_to_100",exports.transitionRampUpMediumSmooth1_0_to_100="transitionRampUpMediumSmooth1_0_to_100",exports.transitionRampUpMediumSmooth2_0_to_100="transitionRampUpMediumSmooth2_0_to_100",exports.transitionRampUpShortSmooth1_0_to_100="transitionRampUpShortSmooth1_0_to_100",exports.transitionRampUpShortSmooth2_0_to_100="transitionRampUpShortSmooth2_0_to_100",exports.transitionRampUpLongSharp1_0_to_100="transitionRampUpLongSharp1_0_to_100",exports.transitionRampUpLongSharp2_0_to_100="transitionRampUpLongSharp2_0_to_100",exports.transitionRampUpMediumSharp1_0_to_100="transitionRampUpMediumSharp1_0_to_100",exports.transitionRampUpMediumSharp2_0_to_100="transitionRampUpMediumSharp2_0_to_100",exports.transitionRampUpShortSharp1_0_to_100="transitionRampUpShortSharp1_0_to_100",exports.transitionRampUpShortSharp2_0_to_100="transitionRampUpShortSharp2_0_to_100",exports.transitionRampDownLongSmooth1_50_to_0="transitionRampDownLongSmooth1_50_to_0",exports.transitionRampDownLongSmooth2_50_to_0="transitionRampDownLongSmooth2_50_to_0",exports.transitionRampDownMediumSmooth1_50_to_0="transitionRampDownMediumSmooth1_50_to_0",exports.transitionRampDownMediumSmooth2_50_to_0="transitionRampDownMediumSmooth2_50_to_0",exports.transitionRampDownShortSmooth1_50_to_0="transitionRampDownShortSmooth1_50_to_0",exports.transitionRampDownShortSmooth2_50_to_0="transitionRampDownShortSmooth2_50_to_0",exports.transitionRampDownLongSharp1_50_to_0="transitionRampDownLongSharp1_50_to_0",exports.transitionRampDownLongSharp2_50_to_0="transitionRampDownLongSharp2_50_to_0",exports.transitionRampDownMediumSharp1_50_to_0="transitionRampDownMediumSharp1_50_to_0",exports.transitionRampDownMediumSharp2_50_to_0="transitionRampDownMediumSharp2_50_to_0",exports.transitionRampDownShortSharp1_50_to_0="transitionRampDownShortSharp1_50_to_0",exports.transitionRampDownShortSharp2_50_to_0="transitionRampDownShortSharp2_50_to_0",exports.transitionRampUpLongSmooth1_0_to_50="transitionRampUpLongSmooth1_0_to_50",exports.transitionRampUpLongSmooth2_0_to_50="transitionRampUpLongSmooth2_0_to_50",exports.transitionRampUpMediumSmooth1_0_to_50="transitionRampUpMediumSmooth1_0_to_50",exports.transitionRampUpMediumSmooth2_0_to_50="transitionRampUpMediumSmooth2_0_to_50",exports.transitionRampUpShortSmooth1_0_to_50="transitionRampUpShortSmooth1_0_to_50",exports.transitionRampUpShortSmooth2_0_to_50="transitionRampUpShortSmooth2_0_to_50",exports.transitionRampUpLongSharp1_0_to_50="transitionRampUpLongSharp1_0_to_50",exports.transitionRampUpLongSharp2_0_to_50="transitionRampUpLongSharp2_0_to_50",exports.transitionRampUpMediumSharp1_0_to_50="transitionRampUpMediumSharp1_0_to_50",exports.transitionRampUpMediumSharp2_0_to_50="transitionRampUpMediumSharp2_0_to_50",exports.transitionRampUpShortSharp1_0_to_50="transitionRampUpShortSharp1_0_to_50",exports.transitionRampUpShortSharp2_0_to_50="transitionRampUpShortSharp2_0_to_50",exports.longBuzzForProgrammaticStopping_100="longBuzzForProgrammaticStopping_100",exports.smoothHum1_50="smoothHum1_50",exports.smoothHum2_40="smoothHum2_40",exports.smoothHum3_30="smoothHum3_30",exports.smoothHum4_20="smoothHum4_20",exports.smoothHum5_10="smoothHum5_10";
|
|
542
|
+
},{}],"xIH5":[function(require,module,exports) {
|
|
543
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(t,i);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,n)}:function(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var r={};if(null!=i)for(var n in i)"default"!==n&&Object.prototype.hasOwnProperty.call(i,n)&&e(r,i,n);return t(r,i),r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.validateOAuthScopeForFunctionName=exports.validateOAuthScopeForAction=void 0;var r=i(require("../utils/errors")),n={"marker/add":"write:brainwave-markers","brainwaves/record":"write:brainwaves","haptics/queue":"write:haptics","training/record":"write:kinesis","training/stop":"write:kinesis","training/stopAll":"write:kinesis","wifi/reset":"write:wifi-settings"},a={accelerometer:"read:accelerometer",brainwaves:"read:brainwaves",calm:"read:calm",focus:"read:focus",kinesis:"read:kinesis",predictions:"read:kinesis",signalQuality:"read:signal-quality",getInfo:"read:devices-info",getSelectedDevice:"read:devices-info",selectDevice:"read:devices-info",onDeviceChange:"read:devices-info",onUserDevicesChange:"read:devices-info",settings:"read:devices-settings",changeSettings:"write:devices-settings",status:"read:devices-status",addDevice:"write:devices-add",removeDevice:"write:devices-remove",transferDevice:"write:devices-remove"};function s(e,t){var i=null!=e?e:{},r=i.oauth,a=i.scopes;if(!r)return[!1,null];var s=a.split(","),o=t.command,u=t.action,d=n["".concat(o,"/").concat(u)];return s.includes(d)?[!1,null]:[!0,c(d)]}function o(e,t){var i=null!=e?e:{},r=i.oauth,n=i.scopes;if(!r)return[!1,null];var s=n.split(","),o=a[t];return s.includes(o)?[!1,null]:[!0,c(o)]}function c(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return new Error("".concat(r.prefix,"You are trying to access data with an OAuth token without access to the following scopes: ").concat(t.join(", "),"."))}exports.validateOAuthScopeForAction=s,exports.validateOAuthScopeForFunctionName=o;
|
|
544
|
+
},{"../utils/errors":"WDyG"}],"EDTP":[function(require,module,exports) {
|
|
545
|
+
"use strict";module.exports=function(r,n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];return r.apply(n,t)}};
|
|
546
|
+
},{}],"S1cf":[function(require,module,exports) {
|
|
547
|
+
"use strict";var r=require("./helpers/bind"),t=Object.prototype.toString;function n(r){return Array.isArray(r)}function e(r){return void 0===r}function o(r){return null!==r&&!e(r)&&null!==r.constructor&&!e(r.constructor)&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r)}function i(r){return"[object ArrayBuffer]"===t.call(r)}function u(r){return"[object FormData]"===t.call(r)}function c(r){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer&&i(r.buffer)}function f(r){return"string"==typeof r}function a(r){return"number"==typeof r}function l(r){return null!==r&&"object"==typeof r}function s(r){if("[object Object]"!==t.call(r))return!1;var n=Object.getPrototypeOf(r);return null===n||n===Object.prototype}function p(r){return"[object Date]"===t.call(r)}function b(r){return"[object File]"===t.call(r)}function y(r){return"[object Blob]"===t.call(r)}function d(r){return"[object Function]"===t.call(r)}function j(r){return l(r)&&d(r.pipe)}function v(r){return"[object URLSearchParams]"===t.call(r)}function m(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function B(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function g(r,t){if(null!=r)if("object"!=typeof r&&(r=[r]),n(r))for(var e=0,o=r.length;e<o;e++)t.call(null,r[e],e,r);else for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.call(null,r[i],i,r)}function A(){var r={};function t(t,e){s(r[e])&&s(t)?r[e]=A(r[e],t):s(t)?r[e]=A({},t):n(t)?r[e]=t.slice():r[e]=t}for(var e=0,o=arguments.length;e<o;e++)g(arguments[e],t);return r}function O(t,n,e){return g(n,function(n,o){t[o]=e&&"function"==typeof n?r(n,e):n}),t}function h(r){return 65279===r.charCodeAt(0)&&(r=r.slice(1)),r}module.exports={isArray:n,isArrayBuffer:i,isBuffer:o,isFormData:u,isArrayBufferView:c,isString:f,isNumber:a,isObject:l,isPlainObject:s,isUndefined:e,isDate:p,isFile:b,isBlob:y,isFunction:d,isStream:j,isURLSearchParams:v,isStandardBrowserEnv:B,forEach:g,merge:A,extend:O,trim:m,stripBOM:h};
|
|
548
|
+
},{"./helpers/bind":"EDTP"}],"H6Qo":[function(require,module,exports) {
|
|
549
|
+
"use strict";var e=require("./../utils");function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}module.exports=function(i,n,t){if(!n)return i;var a;if(t)a=t(n);else if(e.isURLSearchParams(n))a=n.toString();else{var c=[];e.forEach(n,function(i,n){null!=i&&(e.isArray(i)?n+="[]":i=[i],e.forEach(i,function(i){e.isDate(i)?i=i.toISOString():e.isObject(i)&&(i=JSON.stringify(i)),c.push(r(n)+"="+r(i))}))}),a=c.join("&")}if(a){var o=i.indexOf("#");-1!==o&&(i=i.slice(0,o)),i+=(-1===i.indexOf("?")?"?":"&")+a}return i};
|
|
550
|
+
},{"./../utils":"S1cf"}],"rj2i":[function(require,module,exports) {
|
|
551
|
+
"use strict";var n=require("./../utils");function e(){this.handlers=[]}e.prototype.use=function(n,e,t){return this.handlers.push({fulfilled:n,rejected:e,synchronous:!!t&&t.synchronous,runWhen:t?t.runWhen:null}),this.handlers.length-1},e.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},e.prototype.forEach=function(e){n.forEach(this.handlers,function(n){null!==n&&e(n)})},module.exports=e;
|
|
552
|
+
},{"./../utils":"S1cf"}],"M8l6":[function(require,module,exports) {
|
|
553
|
+
"use strict";var e=require("../utils");module.exports=function(t,r){e.forEach(t,function(e,o){o!==r&&o.toUpperCase()===r.toUpperCase()&&(t[r]=e,delete t[o])})};
|
|
554
|
+
},{"../utils":"S1cf"}],"YdsM":[function(require,module,exports) {
|
|
555
|
+
"use strict";module.exports=function(s,e,t,i,n){return s.config=e,t&&(s.code=t),s.request=i,s.response=n,s.isAxiosError=!0,s.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},s};
|
|
556
|
+
},{}],"bIiH":[function(require,module,exports) {
|
|
557
|
+
"use strict";var r=require("./enhanceError");module.exports=function(e,n,o,t,u){var a=new Error(e);return r(a,n,o,t,u)};
|
|
558
|
+
},{"./enhanceError":"YdsM"}],"aS8y":[function(require,module,exports) {
|
|
559
|
+
"use strict";var t=require("./createError");module.exports=function(e,s,u){var a=u.config.validateStatus;u.status&&a&&!a(u.status)?s(t("Request failed with status code "+u.status,u.config,null,u.request,u)):e(u)};
|
|
560
|
+
},{"./createError":"bIiH"}],"dn2M":[function(require,module,exports) {
|
|
561
|
+
"use strict";var e=require("./../utils");module.exports=e.isStandardBrowserEnv()?{write:function(n,t,o,r,i,u){var s=[];s.push(n+"="+encodeURIComponent(t)),e.isNumber(o)&&s.push("expires="+new Date(o).toGMTString()),e.isString(r)&&s.push("path="+r),e.isString(i)&&s.push("domain="+i),!0===u&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};
|
|
562
|
+
},{"./../utils":"S1cf"}],"YZjV":[function(require,module,exports) {
|
|
563
|
+
"use strict";module.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)};
|
|
564
|
+
},{}],"a2Uu":[function(require,module,exports) {
|
|
565
|
+
"use strict";module.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e};
|
|
566
|
+
},{}],"KxkP":[function(require,module,exports) {
|
|
567
|
+
"use strict";var e=require("../helpers/isAbsoluteURL"),r=require("../helpers/combineURLs");module.exports=function(s,u){return s&&!e(u)?r(s,u):u};
|
|
568
|
+
},{"../helpers/isAbsoluteURL":"YZjV","../helpers/combineURLs":"a2Uu"}],"ZeD7":[function(require,module,exports) {
|
|
569
|
+
"use strict";var e=require("./../utils"),t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];module.exports=function(r){var i,o,n,s={};return r?(e.forEach(r.split("\n"),function(r){if(n=r.indexOf(":"),i=e.trim(r.substr(0,n)).toLowerCase(),o=e.trim(r.substr(n+1)),i){if(s[i]&&t.indexOf(i)>=0)return;s[i]="set-cookie"===i?(s[i]?s[i]:[]).concat([o]):s[i]?s[i]+", "+o:o}}),s):s};
|
|
570
|
+
},{"./../utils":"S1cf"}],"w7LF":[function(require,module,exports) {
|
|
571
|
+
"use strict";var t=require("./../utils");module.exports=t.isStandardBrowserEnv()?function(){var r,e=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");function a(t){var r=t;return e&&(o.setAttribute("href",r),r=o.href),o.setAttribute("href",r),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}return r=a(window.location.href),function(e){var o=t.isString(e)?a(e):e;return o.protocol===r.protocol&&o.host===r.host}}():function(){return!0};
|
|
572
|
+
},{"./../utils":"S1cf"}],"mIKj":[function(require,module,exports) {
|
|
573
|
+
"use strict";function t(t){this.message=t}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,module.exports=t;
|
|
574
|
+
},{}],"KRuG":[function(require,module,exports) {
|
|
575
|
+
"use strict";var e=require("./../utils"),r=require("./../core/settle"),t=require("./../helpers/cookies"),n=require("./../helpers/buildURL"),o=require("../core/buildFullPath"),s=require("./../helpers/parseHeaders"),a=require("./../helpers/isURLSameOrigin"),i=require("../core/createError"),u=require("../defaults"),l=require("../cancel/Cancel");module.exports=function(d){return new Promise(function(c,p){var f,m=d.data,g=d.headers,h=d.responseType;function T(){d.cancelToken&&d.cancelToken.unsubscribe(f),d.signal&&d.signal.removeEventListener("abort",f)}e.isFormData(m)&&delete g["Content-Type"];var E=new XMLHttpRequest;if(d.auth){var v=d.auth.username||"",q=d.auth.password?unescape(encodeURIComponent(d.auth.password)):"";g.Authorization="Basic "+btoa(v+":"+q)}var b=o(d.baseURL,d.url);function w(){if(E){var e="getAllResponseHeaders"in E?s(E.getAllResponseHeaders()):null,t={data:h&&"text"!==h&&"json"!==h?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:e,config:d,request:E};r(function(e){c(e),T()},function(e){p(e),T()},t),E=null}}if(E.open(d.method.toUpperCase(),n(b,d.params,d.paramsSerializer),!0),E.timeout=d.timeout,"onloadend"in E?E.onloadend=w:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(w)},E.onabort=function(){E&&(p(i("Request aborted",d,"ECONNABORTED",E)),E=null)},E.onerror=function(){p(i("Network Error",d,null,E)),E=null},E.ontimeout=function(){var e=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",r=d.transitional||u.transitional;d.timeoutErrorMessage&&(e=d.timeoutErrorMessage),p(i(e,d,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",E)),E=null},e.isStandardBrowserEnv()){var R=(d.withCredentials||a(b))&&d.xsrfCookieName?t.read(d.xsrfCookieName):void 0;R&&(g[d.xsrfHeaderName]=R)}"setRequestHeader"in E&&e.forEach(g,function(e,r){void 0===m&&"content-type"===r.toLowerCase()?delete g[r]:E.setRequestHeader(r,e)}),e.isUndefined(d.withCredentials)||(E.withCredentials=!!d.withCredentials),h&&"json"!==h&&(E.responseType=d.responseType),"function"==typeof d.onDownloadProgress&&E.addEventListener("progress",d.onDownloadProgress),"function"==typeof d.onUploadProgress&&E.upload&&E.upload.addEventListener("progress",d.onUploadProgress),(d.cancelToken||d.signal)&&(f=function(e){E&&(p(!e||e&&e.type?new l("canceled"):e),E.abort(),E=null)},d.cancelToken&&d.cancelToken.subscribe(f),d.signal&&(d.signal.aborted?f():d.signal.addEventListener("abort",f))),m||(m=null),E.send(m)})};
|
|
576
|
+
},{"./../utils":"S1cf","./../core/settle":"aS8y","./../helpers/cookies":"dn2M","./../helpers/buildURL":"H6Qo","../core/buildFullPath":"KxkP","./../helpers/parseHeaders":"ZeD7","./../helpers/isURLSameOrigin":"w7LF","../core/createError":"bIiH","../defaults":"BXyq","../cancel/Cancel":"mIKj"}],"BXyq":[function(require,module,exports) {
|
|
577
|
+
var process = require("process");
|
|
578
|
+
var e=require("process"),r=require("./utils"),t=require("./helpers/normalizeHeaderName"),n=require("./core/enhanceError"),i={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var r;return"undefined"!=typeof XMLHttpRequest?r=require("./adapters/xhr"):void 0!==e&&"[object process]"===Object.prototype.toString.call(e)&&(r=require("./adapters/http")),r}function s(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(i){if("SyntaxError"!==i.name)throw i}return(n||JSON.stringify)(e)}var c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:o(),transformRequest:[function(e,n){return t(n,"Accept"),t(n,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(n,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||n&&"application/json"===n["Content-Type"]?(a(n,"application/json"),s(e)):e}],transformResponse:[function(e){var t=this.transitional||c.transitional,i=t&&t.silentJSONParsing,a=t&&t.forcedJSONParsing,o=!i&&"json"===this.responseType;if(o||a&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(o){if("SyntaxError"===s.name)throw n(s,this,"E_JSON_PARSE");throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){c.headers[e]={}}),r.forEach(["post","put","patch"],function(e){c.headers[e]=r.merge(i)}),module.exports=c;
|
|
579
|
+
},{"./utils":"S1cf","./helpers/normalizeHeaderName":"M8l6","./core/enhanceError":"YdsM","./adapters/xhr":"KRuG","./adapters/http":"KRuG","process":"pBGv"}],"woEt":[function(require,module,exports) {
|
|
580
|
+
"use strict";var r=require("./../utils"),e=require("./../defaults");module.exports=function(t,u,i){var s=this||e;return r.forEach(i,function(r){t=r.call(s,t,u)}),t};
|
|
581
|
+
},{"./../utils":"S1cf","./../defaults":"BXyq"}],"V30M":[function(require,module,exports) {
|
|
582
|
+
"use strict";module.exports=function(t){return!(!t||!t.__CANCEL__)};
|
|
583
|
+
},{}],"uz6X":[function(require,module,exports) {
|
|
584
|
+
"use strict";var e=require("./../utils"),a=require("./transformData"),r=require("../cancel/isCancel"),t=require("../defaults"),n=require("../cancel/Cancel");function s(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new n("canceled")}module.exports=function(n){return s(n),n.headers=n.headers||{},n.data=a.call(n,n.data,n.headers,n.transformRequest),n.headers=e.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),e.forEach(["delete","get","head","post","put","patch","common"],function(e){delete n.headers[e]}),(n.adapter||t.adapter)(n).then(function(e){return s(n),e.data=a.call(n,e.data,e.headers,n.transformResponse),e},function(e){return r(e)||(s(n),e&&e.response&&(e.response.data=a.call(n,e.response.data,e.response.headers,n.transformResponse))),Promise.reject(e)})};
|
|
585
|
+
},{"./../utils":"S1cf","./transformData":"woEt","../cancel/isCancel":"V30M","../defaults":"BXyq","../cancel/Cancel":"mIKj"}],"OHvn":[function(require,module,exports) {
|
|
586
|
+
"use strict";var e=require("../utils");module.exports=function(n,t){t=t||{};var i={};function r(n,t){return e.isPlainObject(n)&&e.isPlainObject(t)?e.merge(n,t):e.isPlainObject(t)?e.merge({},t):e.isArray(t)?t.slice():t}function o(i){return e.isUndefined(t[i])?e.isUndefined(n[i])?void 0:r(void 0,n[i]):r(n[i],t[i])}function s(n){if(!e.isUndefined(t[n]))return r(void 0,t[n])}function a(i){return e.isUndefined(t[i])?e.isUndefined(n[i])?void 0:r(void 0,n[i]):r(void 0,t[i])}function d(e){return e in t?r(n[e],t[e]):e in n?r(void 0,n[e]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:d};return e.forEach(Object.keys(n).concat(Object.keys(t)),function(n){var t=c[n]||o,r=t(n);e.isUndefined(r)&&t!==d||(i[n]=r)}),i};
|
|
587
|
+
},{"../utils":"S1cf"}],"xNqU":[function(require,module,exports) {
|
|
588
|
+
module.exports={version:"0.25.0"};
|
|
589
|
+
},{}],"lsvU":[function(require,module,exports) {
|
|
590
|
+
"use strict";var n=require("../env/data").version,e={};["object","boolean","number","function","string","symbol"].forEach(function(n,r){e[n]=function(e){return typeof e===n||"a"+(r<1?"n ":" ")+n}});var r={};function o(n,e,r){if("object"!=typeof n)throw new TypeError("options must be an object");for(var o=Object.keys(n),t=o.length;t-- >0;){var i=o[t],a=e[i];if(a){var s=n[i],u=void 0===s||a(s,i,n);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}}e.transitional=function(e,o,t){function i(e,r){return"[Axios v"+n+"] Transitional option '"+e+"'"+r+(t?". "+t:"")}return function(n,t,a){if(!1===e)throw new Error(i(t," has been removed"+(o?" in "+o:"")));return o&&!r[t]&&(r[t]=!0,console.warn(i(t," has been deprecated since v"+o+" and will be removed in the near future"))),!e||e(n,t,a)}},module.exports={assertOptions:o,validators:e};
|
|
591
|
+
},{"../env/data":"xNqU"}],"OvAf":[function(require,module,exports) {
|
|
592
|
+
"use strict";var t=require("./../utils"),e=require("../helpers/buildURL"),r=require("./InterceptorManager"),o=require("./dispatchRequest"),i=require("./mergeConfig"),n=require("../helpers/validator"),s=n.validators;function a(t){this.defaults=t,this.interceptors={request:new r,response:new r}}a.prototype.request=function(t,e){if("string"==typeof t?(e=e||{}).url=t:e=t||{},!e.url)throw new Error("Provided config url is not valid");(e=i(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&n.assertOptions(r,{silentJSONParsing:s.transitional(s.boolean),forcedJSONParsing:s.transitional(s.boolean),clarifyTimeoutError:s.transitional(s.boolean)},!1);var a=[],u=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,a.unshift(t.fulfilled,t.rejected))});var h,l=[];if(this.interceptors.response.forEach(function(t){l.push(t.fulfilled,t.rejected)}),!u){var f=[o,void 0];for(Array.prototype.unshift.apply(f,a),f=f.concat(l),h=Promise.resolve(e);f.length;)h=h.then(f.shift(),f.shift());return h}for(var d=e;a.length;){var c=a.shift(),p=a.shift();try{d=c(d)}catch(m){p(m);break}}try{h=o(d)}catch(m){return Promise.reject(m)}for(;l.length;)h=h.then(l.shift(),l.shift());return h},a.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=i(this.defaults,t),e(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},t.forEach(["delete","get","head","options"],function(t){a.prototype[t]=function(e,r){return this.request(i(r||{},{method:t,url:e,data:(r||{}).data}))}}),t.forEach(["post","put","patch"],function(t){a.prototype[t]=function(e,r,o){return this.request(i(o||{},{method:t,url:e,data:r}))}}),module.exports=a;
|
|
593
|
+
},{"./../utils":"S1cf","../helpers/buildURL":"H6Qo","./InterceptorManager":"rj2i","./dispatchRequest":"uz6X","./mergeConfig":"OHvn","../helpers/validator":"lsvU"}],"tsWd":[function(require,module,exports) {
|
|
594
|
+
"use strict";var e=require("./Cancel");function n(n){if("function"!=typeof n)throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(e){s=e});var t=this;this.promise.then(function(e){if(t._listeners){var n,s=t._listeners.length;for(n=0;n<s;n++)t._listeners[n](e);t._listeners=null}}),this.promise.then=function(e){var n,s=new Promise(function(e){t.subscribe(e),n=e}).then(e);return s.cancel=function(){t.unsubscribe(n)},s},n(function(n){t.reason||(t.reason=new e(n),s(t.reason))})}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},n.prototype.unsubscribe=function(e){if(this._listeners){var n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}},n.source=function(){var e;return{token:new n(function(n){e=n}),cancel:e}},module.exports=n;
|
|
595
|
+
},{"./Cancel":"mIKj"}],"X8jb":[function(require,module,exports) {
|
|
596
|
+
"use strict";module.exports=function(n){return function(t){return n.apply(null,t)}};
|
|
597
|
+
},{}],"wICU":[function(require,module,exports) {
|
|
598
|
+
"use strict";var r=require("./../utils");module.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError};
|
|
599
|
+
},{"./../utils":"S1cf"}],"nUiQ":[function(require,module,exports) {
|
|
600
|
+
"use strict";var e=require("./utils"),r=require("./helpers/bind"),i=require("./core/Axios"),n=require("./core/mergeConfig"),o=require("./defaults");function u(o){var s=new i(o),t=r(i.prototype.request,s);return e.extend(t,i.prototype,s),e.extend(t,s),t.create=function(e){return u(n(o,e))},t}var s=u(o);s.Axios=i,s.Cancel=require("./cancel/Cancel"),s.CancelToken=require("./cancel/CancelToken"),s.isCancel=require("./cancel/isCancel"),s.VERSION=require("./env/data").version,s.all=function(e){return Promise.all(e)},s.spread=require("./helpers/spread"),s.isAxiosError=require("./helpers/isAxiosError"),module.exports=s,module.exports.default=s;
|
|
601
|
+
},{"./utils":"S1cf","./helpers/bind":"EDTP","./core/Axios":"OvAf","./core/mergeConfig":"OHvn","./defaults":"BXyq","./cancel/Cancel":"mIKj","./cancel/CancelToken":"tsWd","./cancel/isCancel":"V30M","./env/data":"xNqU","./helpers/spread":"X8jb","./helpers/isAxiosError":"wICU"}],"dZBD":[function(require,module,exports) {
|
|
602
|
+
module.exports=require("./lib/axios");
|
|
603
|
+
},{"./lib/axios":"nUiQ"}],"kRnD":[function(require,module,exports) {
|
|
604
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.prodFunctionsBaseUrl=void 0,exports.prodFunctionsBaseUrl="https://us-central1-neurosity-device.cloudfunctions.net";
|
|
605
|
+
},{}],"RIhy":[function(require,module,exports) {
|
|
606
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFunctionsBaseURL=void 0;var e=require("./config");function t(t){if(!t.emulator)return e.prodFunctionsBaseUrl;var r=t.emulatorHost,o=t.emulatorFunctionsPort;return"http://".concat(r,":").concat(o,"/neurosity-device/us-central1")}exports.getFunctionsBaseURL=t;
|
|
607
|
+
},{"./config":"kRnD"}],"MDrB":[function(require,module,exports) {
|
|
608
|
+
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.createOAuthURL=void 0;var t=e(require("axios")),r=require("./utils");function i(e,i){var s=e.clientId,c=e.clientSecret,n=e.responseType,a=e.redirectUri,o=e.scope,u=e.state,l=(0,r.getFunctionsBaseURL)(i);return t.default.get("".concat(l,"/authorize/entry"),{params:Object.assign(Object.assign({client_id:s},c?{client_secret:c}:{}),{response_type:n,redirect_uri:a,scope:o.join(","),state:u,redirect:"false"})}).then(function(e){return"".concat(l).concat(e.data.url)})}exports.createOAuthURL=i;
|
|
609
|
+
},{"axios":"dZBD","./utils":"RIhy"}],"nfg4":[function(require,module,exports) {
|
|
610
|
+
"use strict";var e=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,u){function a(e){try{c(r.next(e))}catch(t){u(t)}}function i(e){try{c(r.throw(e))}catch(t){u(t)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,i)}c((r=r.apply(e,t||[])).next())})},t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getOAuthToken=void 0;var n=t(require("axios")),r=require("./utils");function o(t,o){return e(this,void 0,void 0,regeneratorRuntime.mark(function e(){var u,a,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=(0,r.getFunctionsBaseURL)(o),e.next=3,n.default.post("".concat(u,"/getOAuthRefreshToken"),t);case 3:return a=e.sent,i=a.data,e.abrupt("return",n.default.post("".concat(u,"/token"),{grant_type:"refresh_token",refresh_token:i.data,client_id:t.clientId,client_secret:t.clientSecret}).then(function(e){return JSON.parse(e.data).access_token}));case 6:case"end":return e.stop()}},e)}))}exports.getOAuthToken=o;
|
|
611
|
+
},{"axios":"dZBD","./utils":"RIhy"}],"vsps":[function(require,module,exports) {
|
|
612
|
+
var process = require("process");
|
|
613
|
+
var e=require("process");function o(){return void 0!==e&&null!=e.versions&&null!=e.versions.node}Object.defineProperty(exports,"__esModule",{value:!0}),exports.isNode=void 0,exports.isNode=o;
|
|
614
|
+
},{"process":"pBGv"}],"DCuD":[function(require,module,exports) {
|
|
615
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCloudMetric=void 0;var e=require("rxjs"),r=require("rxjs/operators"),t=require("./whileOnline"),i=require("./subscription");function n(n,s){var o=n.options,u=n.cloudClient,c=n.onDeviceChange,a=n.status,l=s.metric,p=s.labels,b=s.atomic,f=(0,i.validate)(l,p,o);if(f)return(0,e.throwError)(function(){return f});var m=new e.Observable(function(e){var r=(b?[u.metrics.subscribe({metric:l,labels:p,atomic:b})]:p.map(function(e){return u.metrics.subscribe({metric:l,labels:[e],atomic:b})})).map(function(r){return{subscription:r,listener:u.metrics.on(r,function(){e.next.apply(e,arguments)})}});return function(){r.forEach(function(e){var r=e.subscription,t=e.listener;u.metrics.unsubscribe(r,t)})}});return c().pipe((0,r.switchMap)(function(r){return r?m.pipe((0,t.whileOnline)({status$:a(),allowWhileOnSleepMode:!1})):e.EMPTY}))}exports.getCloudMetric=n;
|
|
616
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","./whileOnline":"s7Vt","./subscription":"yLLB"}],"VusC":[function(require,module,exports) {
|
|
617
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMaybeWebWorkerContext=void 0;var e=this,t=function(){return e&&void 0===(null==e?void 0:e.document)};exports.isMaybeWebWorkerContext=t;
|
|
618
|
+
},{}],"ljun":[function(require,module,exports) {
|
|
619
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isWebBluetoothSupported=void 0;var e=require("./isMaybeWebWorkerContext");function o(){var o;return"undefined"!=typeof window&&(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.bluetooth)&&!(0,e.isMaybeWebWorkerContext)()}exports.isWebBluetoothSupported=o;
|
|
620
|
+
},{"./isMaybeWebWorkerContext":"VusC"}],"UDAB":[function(require,module,exports) {
|
|
621
|
+
"use strict";function e(){return Math.floor(1e5+9e5*Math.random())}Object.defineProperty(exports,"__esModule",{value:!0}),exports.create6DigitPin=void 0,exports.create6DigitPin=e;
|
|
622
|
+
},{}],"V73a":[function(require,module,exports) {
|
|
623
|
+
"use strict";function r(r,i){return n(r)||e(r,i)||t()}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function e(r,t){if(Symbol.iterator in Object(r)||"[object Arguments]"===Object.prototype.toString.call(r)){var e=[],n=!0,i=!1,u=void 0;try{for(var o,l=r[Symbol.iterator]();!(n=(o=l.next()).done)&&(e.push(o.value),!t||e.length!==t);n=!0);}catch(c){i=!0,u=c}finally{try{n||null==l.return||l.return()}finally{if(i)throw u}}return e}}function n(r){if(Array.isArray(r))return r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.stitchChunks=void 0;var i=require("rxjs"),u=require("rxjs/operators");function o(t){var e=t.delimiter;return(0,i.pipe)((0,u.scan)(function(t,n){var i=r(t,1)[0]+n;if(!i.includes(e))return[i,""];if(i.endsWith(e))return["",i];var u=i.lastIndexOf(e)+e.length,o=i.slice(0,u);return[i.slice(u),o]},["",""]),(0,u.map)(function(t){return r(t,2)[1].slice(0,-e.length)}),(0,u.filter)(function(r){return!!r.length}))}exports.stitchChunks=o;
|
|
624
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE"}],"iwtf":[function(require,module,exports) {
|
|
625
|
+
"use strict";var N,e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TRANSPORT_TYPE=exports.BLUETOOTH_CONNECTION=void 0,function(N){N.SCANNING="scanning",N.CONNECTED="connected",N.CONNECTING="connecting",N.DISCONNECTING="disconnecting",N.DISCONNECTED="disconnected"}(N=exports.BLUETOOTH_CONNECTION||(exports.BLUETOOTH_CONNECTION={})),function(N){N.WEB="web",N.REACT_NATIVE="reactNative"}(e=exports.TRANSPORT_TYPE||(exports.TRANSPORT_TYPE={}));
|
|
626
|
+
},{}],"jTvL":[function(require,module,exports) {
|
|
627
|
+
"use strict";function e(e){return n(e)||t(e)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function t(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function n(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r<e.length;r++)t[r]=e[r];return t}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=exports.encode=void 0;var o=require("../types"),c=new TextEncoder,i=new TextDecoder("utf-8");function d(r,t){return r===o.TRANSPORT_TYPE.REACT_NATIVE?e(c.encode(t)):c.encode(t)}function u(e,r){return e===o.TRANSPORT_TYPE.REACT_NATIVE?i.decode(new Uint8Array(r)):i.decode(r)}exports.encode=d,exports.decode=u;
|
|
628
|
+
},{"../types":"iwtf"}],"dGLb":[function(require,module,exports) {
|
|
629
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CHARACTERISTIC_UUIDS_TO_NAMES=exports.DEFAULT_ACTION_RESPONSE_TIMEOUT=exports.REACT_NATIVE_MAX_BYTE_SIZE=exports.ANDROID_MAX_MTU=void 0;var e=require("@neurosity/ipk");exports.ANDROID_MAX_MTU=512,exports.REACT_NATIVE_MAX_BYTE_SIZE=512,exports.DEFAULT_ACTION_RESPONSE_TIMEOUT=6e4,exports.CHARACTERISTIC_UUIDS_TO_NAMES=Object.fromEntries(Object.entries(e.BLUETOOTH_CHARACTERISTICS).map(function(e){return e.reverse()}));
|
|
630
|
+
},{"@neurosity/ipk":"ZOGh"}],"Sk7T":[function(require,module,exports) {
|
|
631
|
+
var process = require("process");
|
|
632
|
+
var o=require("process");function t(o){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}var e=("object"===(void 0===o?"undefined":t(o))&&o.env,function(){});module.exports=e;
|
|
633
|
+
},{"process":"pBGv"}],"C39h":[function(require,module,exports) {
|
|
634
|
+
var E="2.0.0",_=256,N=Number.MAX_SAFE_INTEGER||9007199254740991,A=16;module.exports={SEMVER_SPEC_VERSION:E,MAX_LENGTH:_,MAX_SAFE_INTEGER:N,MAX_SAFE_COMPONENT_LENGTH:A};
|
|
635
|
+
},{}],"bhZj":[function(require,module,exports) {
|
|
636
|
+
var E=require("./constants"),I=E.MAX_SAFE_COMPONENT_LENGTH,c=require("./debug");exports=module.exports={};var R=exports.re=[],N=exports.src=[],L=exports.t={},O=0,t=function(E,I,t){var A=O++;c(E,A,I),L[E]=A,N[A]=I,R[A]=new RegExp(I,t?"g":void 0)};t("NUMERICIDENTIFIER","0|[1-9]\\d*"),t("NUMERICIDENTIFIERLOOSE","[0-9]+"),t("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),t("MAINVERSION","(".concat(N[L.NUMERICIDENTIFIER],")\\.")+"(".concat(N[L.NUMERICIDENTIFIER],")\\.")+"(".concat(N[L.NUMERICIDENTIFIER],")")),t("MAINVERSIONLOOSE","(".concat(N[L.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(N[L.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(N[L.NUMERICIDENTIFIERLOOSE],")")),t("PRERELEASEIDENTIFIER","(?:".concat(N[L.NUMERICIDENTIFIER],"|").concat(N[L.NONNUMERICIDENTIFIER],")")),t("PRERELEASEIDENTIFIERLOOSE","(?:".concat(N[L.NUMERICIDENTIFIERLOOSE],"|").concat(N[L.NONNUMERICIDENTIFIER],")")),t("PRERELEASE","(?:-(".concat(N[L.PRERELEASEIDENTIFIER],"(?:\\.").concat(N[L.PRERELEASEIDENTIFIER],")*))")),t("PRERELEASELOOSE","(?:-?(".concat(N[L.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(N[L.PRERELEASEIDENTIFIERLOOSE],")*))")),t("BUILDIDENTIFIER","[0-9A-Za-z-]+"),t("BUILD","(?:\\+(".concat(N[L.BUILDIDENTIFIER],"(?:\\.").concat(N[L.BUILDIDENTIFIER],")*))")),t("FULLPLAIN","v?".concat(N[L.MAINVERSION]).concat(N[L.PRERELEASE],"?").concat(N[L.BUILD],"?")),t("FULL","^".concat(N[L.FULLPLAIN],"$")),t("LOOSEPLAIN","[v=\\s]*".concat(N[L.MAINVERSIONLOOSE]).concat(N[L.PRERELEASELOOSE],"?").concat(N[L.BUILD],"?")),t("LOOSE","^".concat(N[L.LOOSEPLAIN],"$")),t("GTLT","((?:<|>)?=?)"),t("XRANGEIDENTIFIERLOOSE","".concat(N[L.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),t("XRANGEIDENTIFIER","".concat(N[L.NUMERICIDENTIFIER],"|x|X|\\*")),t("XRANGEPLAIN","[v=\\s]*(".concat(N[L.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(N[L.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(N[L.XRANGEIDENTIFIER],")")+"(?:".concat(N[L.PRERELEASE],")?").concat(N[L.BUILD],"?")+")?)?"),t("XRANGEPLAINLOOSE","[v=\\s]*(".concat(N[L.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(N[L.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(N[L.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(N[L.PRERELEASELOOSE],")?").concat(N[L.BUILD],"?")+")?)?"),t("XRANGE","^".concat(N[L.GTLT],"\\s*").concat(N[L.XRANGEPLAIN],"$")),t("XRANGELOOSE","^".concat(N[L.GTLT],"\\s*").concat(N[L.XRANGEPLAINLOOSE],"$")),t("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(I,"})")+"(?:\\.(\\d{1,".concat(I,"}))?")+"(?:\\.(\\d{1,".concat(I,"}))?")+"(?:$|[^\\d])"),t("COERCERTL",N[L.COERCE],!0),t("LONETILDE","(?:~>?)"),t("TILDETRIM","(\\s*)".concat(N[L.LONETILDE],"\\s+"),!0),exports.tildeTrimReplace="$1~",t("TILDE","^".concat(N[L.LONETILDE]).concat(N[L.XRANGEPLAIN],"$")),t("TILDELOOSE","^".concat(N[L.LONETILDE]).concat(N[L.XRANGEPLAINLOOSE],"$")),t("LONECARET","(?:\\^)"),t("CARETTRIM","(\\s*)".concat(N[L.LONECARET],"\\s+"),!0),exports.caretTrimReplace="$1^",t("CARET","^".concat(N[L.LONECARET]).concat(N[L.XRANGEPLAIN],"$")),t("CARETLOOSE","^".concat(N[L.LONECARET]).concat(N[L.XRANGEPLAINLOOSE],"$")),t("COMPARATORLOOSE","^".concat(N[L.GTLT],"\\s*(").concat(N[L.LOOSEPLAIN],")$|^$")),t("COMPARATOR","^".concat(N[L.GTLT],"\\s*(").concat(N[L.FULLPLAIN],")$|^$")),t("COMPARATORTRIM","(\\s*)".concat(N[L.GTLT],"\\s*(").concat(N[L.LOOSEPLAIN],"|").concat(N[L.XRANGEPLAIN],")"),!0),exports.comparatorTrimReplace="$1$2$3",t("HYPHENRANGE","^\\s*(".concat(N[L.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(N[L.XRANGEPLAIN],")")+"\\s*$"),t("HYPHENRANGELOOSE","^\\s*(".concat(N[L.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(N[L.XRANGEPLAINLOOSE],")")+"\\s*$"),t("STAR","(<|>)?=?\\s*\\*"),t("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),t("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
637
|
+
},{"./constants":"C39h","./debug":"Sk7T"}],"gnTI":[function(require,module,exports) {
|
|
638
|
+
function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(t)}var t=["includePrerelease","loose","rtl"],e=function(e){return e?"object"!==o(e)?{loose:!0}:t.filter(function(o){return e[o]}).reduce(function(o,t){return o[t]=!0,o},{}):{}};module.exports=e;
|
|
639
|
+
},{}],"qWqM":[function(require,module,exports) {
|
|
640
|
+
var e=/^[0-9]+$/,r=function(r,t){var n=e.test(r),i=e.test(t);return n&&i&&(r=+r,t=+t),r===t?0:n&&!i?-1:i&&!n?1:r<t?-1:1},t=function(e,t){return r(t,e)};module.exports={compareIdentifiers:r,rcompareIdentifiers:t};
|
|
641
|
+
},{}],"JAyN":[function(require,module,exports) {
|
|
642
|
+
function e(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function r(e,r){for(var i=0;i<r.length;i++){var t=r[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function i(e,i,t){return i&&r(e.prototype,i),t&&r(e,t),e}var t=require("../internal/debug"),s=require("../internal/constants"),n=s.MAX_LENGTH,a=s.MAX_SAFE_INTEGER,o=require("../internal/re"),h=o.re,l=o.t,p=require("../internal/parse-options"),c=require("../internal/identifiers"),u=c.compareIdentifiers,f=function(){function r(i,s){if(e(this,r),s=p(s),i instanceof r){if(i.loose===!!s.loose&&i.includePrerelease===!!s.includePrerelease)return i;i=i.version}else if("string"!=typeof i)throw new TypeError("Invalid Version: ".concat(i));if(i.length>n)throw new TypeError("version is longer than ".concat(n," characters"));t("SemVer",i,s),this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease;var o=i.trim().match(s.loose?h[l.LOOSE]:h[l.FULL]);if(!o)throw new TypeError("Invalid Version: ".concat(i));if(this.raw=i,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r<a)return r}return e}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}return i(r,[{key:"format",value:function(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}},{key:"toString",value:function(){return this.version}},{key:"compare",value:function(e){if(t("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if("string"==typeof e&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}},{key:"compareMain",value:function(e){return e instanceof r||(e=new r(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}},{key:"comparePre",value:function(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var i=0;do{var s=this.prerelease[i],n=e.prerelease[i];if(t("prerelease compare",i,s,n),void 0===s&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===s)return-1;if(s!==n)return u(s,n)}while(++i)}},{key:"compareBuild",value:function(e){e instanceof r||(e=new r(e,this.options));var i=0;do{var s=this.build[i],n=e.build[i];if(t("prerelease compare",i,s,n),void 0===s&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===s)return-1;if(s!==n)return u(s,n)}while(++i)}},{key:"inc",value:function(e,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r),this.inc("pre",r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",r),this.inc("pre",r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var i=this.prerelease.length;--i>=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);-1===i&&this.prerelease.push(0)}r&&(0===u(this.prerelease[0],r)?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),r}();module.exports=f;
|
|
643
|
+
},{"../internal/debug":"Sk7T","../internal/constants":"C39h","../internal/re":"bhZj","../internal/parse-options":"gnTI","../internal/identifiers":"qWqM"}],"skdn":[function(require,module,exports) {
|
|
644
|
+
var e=require("../classes/semver"),r=function(r,n,s){return new e(r,s).compare(new e(n,s))};module.exports=r;
|
|
645
|
+
},{"../classes/semver":"JAyN"}],"A2P2":[function(require,module,exports) {
|
|
646
|
+
var r=require("./compare"),e=function(e,o,u){return r(e,o,u)>=0};module.exports=e;
|
|
647
|
+
},{"./compare":"skdn"}],"rH2Y":[function(require,module,exports) {
|
|
648
|
+
"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.osHasBluetoothSupport=void 0;var t=e(require("semver/functions/gte"));function o(e){return!!e&&(Number(e.modelVersion)>=3&&(!!!(null==e?void 0:e.emulator)&&(0,t.default)(e.osVersion,"16.0.0")))}exports.osHasBluetoothSupport=o;
|
|
649
|
+
},{"semver/functions/gte":"A2P2"}],"ouKb":[function(require,module,exports) {
|
|
650
|
+
"use strict";function e(e){return r(e)||n(e)||t()}function t(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function n(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function r(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function i(e,t){return o(e)||a(e,t)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function a(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,c=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){i=!0,c=s}finally{try{r||null==o.return||o.return()}finally{if(i)throw c}}return n}}function o(e){if(Array.isArray(e))return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}var h=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,c){function a(e){try{s(r.next(e))}catch(t){c(t)}}function o(e){try{s(r.throw(e))}catch(t){c(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,o)}s((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebBluetoothTransport=void 0;var v=require("@neurosity/ipk"),f=require("@neurosity/ipk"),p=require("@neurosity/ipk"),l=require("@neurosity/ipk"),g=require("rxjs"),m=require("rxjs"),b=require("rxjs/operators"),E=require("rxjs/operators"),N=require("rxjs/operators"),w=require("./isWebBluetoothSupported"),O=require("../utils/create6DigitPin"),C=require("../utils/stitch"),y=require("../utils/encoding"),x=require("../types"),T=require("../constants"),k=require("../constants"),R=require("../utils/osHasBluetoothSupport"),A={autoConnect:!0},_=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(s(this,t),this.type=x.TRANSPORT_TYPE.WEB,this.characteristicsByName={},this.connection$=new g.BehaviorSubject(x.BLUETOOTH_CONNECTION.DISCONNECTED),this.pendingActions$=new g.BehaviorSubject([]),this.logs$=new g.ReplaySubject(10),this.onDisconnected$=this._onDisconnected().pipe((0,N.share)()),this.connectionStream$=this.connection$.asObservable().pipe((0,b.filter)(function(e){return!!e}),(0,E.distinctUntilChanged)(),(0,E.shareReplay)(1)),this._isAutoConnectEnabled$=new g.ReplaySubject(1),this.options=Object.assign(Object.assign({},A),n),!(0,w.isWebBluetoothSupported)()){throw this.addLog("Web Bluetooth is not supported"),new Error("Web Bluetooth is not supported")}this._isAutoConnectEnabled$.subscribe(function(t){e.addLog("Auto connect: ".concat(t?"enabled":"disabled"))}),this._isAutoConnectEnabled$.next(this.options.autoConnect),this.connection$.asObservable().subscribe(function(t){e.addLog("connection status is ".concat(t))}),this.onDisconnected$.subscribe(function(){e.connection$.next(x.BLUETOOTH_CONNECTION.DISCONNECTED)})}return d(t,[{key:"_getPairedDevices",value:function(){return h(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.bluetooth.getDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))}},{key:"_autoConnect",value:function(e){var t=this;return this._isAutoConnectEnabled$.pipe((0,b.switchMap)(function(n){return n?(0,g.merge)(e,t.onDisconnected$.pipe((0,b.switchMap)(function(){return e}))):m.NEVER}),(0,b.switchMap)(function(e){return(0,R.osHasBluetoothSupport)(e)?(0,g.of)(e):m.EMPTY}),(0,b.switchMap)(function(e){return h(t,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,c,a,o,s,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.deviceNickname,!this.isConnected()){t.next=4;break}return this.addLog("Auto connect: ".concat(r," is already connected. Skipping auto connect.")),t.abrupt("return");case 4:return t.next=6,this._getPairedDevices().then(function(e){return[null,e]}).catch(function(e){return[e,null]});case 6:if(c=t.sent,a=i(c,2),o=a[0],s=a[1],!o){t.next=12;break}throw new Error("failed to get devices: ".concat(null!==(n=null==o?void 0:o.message)&&void 0!==n?n:o));case 12:if(this.addLog("Auto connect: found ".concat(s.length," devices ").concat(s.map(function(e){return e.name}).join(", "))),u=s.findLast(function(e){return e.name===r})){t.next=16;break}throw new Error("couldn't find selected device in the list of paired devices.");case 16:return this.addLog("Auto connect: ".concat(r," was detected and previously paired")),t.abrupt("return",u);case 18:case"end":return t.stop()}},t,this)}))}),(0,b.tap)(function(){t.connection$.next(x.BLUETOOTH_CONNECTION.SCANNING)}),(0,b.switchMap)(function(e){return S(e)}),(0,b.switchMap)(function(e){return h(t,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.addLog("Advertisement received for ".concat(e.device.name)),t.next=3,this.getServerServiceAndCharacteristics(e.device);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}},t,this)}))}))}},{key:"enableAutoConnect",value:function(e){this._isAutoConnectEnabled$.next(e)}},{key:"addLog",value:function(e){this.logs$.next(e)}},{key:"isConnected",value:function(){return this.connection$.getValue()===x.BLUETOOTH_CONNECTION.CONNECTED}},{key:"connection",value:function(){return this.connectionStream$}},{key:"connect",value:function(e){return h(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requestDevice(e);case 3:return n=t.sent,t.next=6,this.getServerServiceAndCharacteristics(n);case 6:t.next=11;break;case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 11:case"end":return t.stop()}},t,this,[[0,8]])}))}},{key:"requestDevice",value:function(t){return h(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,c;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,this.addLog("Requesting Bluetooth Device..."),r=p.BLUETOOTH_DEVICE_NAME_PREFIXES.map(function(e){return{namePrefix:e}}),i=t?[{name:t}]:r,n.next=6,window.navigator.bluetooth.requestDevice({filters:[].concat(e(i),[{manufacturerData:[{companyIdentifier:l.BLUETOOTH_COMPANY_IDENTIFIER_HEX}]}]),optionalServices:[v.BLUETOOTH_PRIMARY_SERVICE_UUID_HEX]});case 6:return c=n.sent,n.abrupt("return",c);case 10:return n.prev=10,n.t0=n.catch(0),n.abrupt("return",Promise.reject(n.t0));case 13:case"end":return n.stop()}},n,this,[[0,10]])}))}},{key:"getServerServiceAndCharacteristics",value:function(e){return h(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.device=e,this.connection$.getValue()===x.BLUETOOTH_CONNECTION.CONNECTING||this.connection$.next(x.BLUETOOTH_CONNECTION.CONNECTING),t.next=6,e.gatt.connect();case 6:return this.server=t.sent,this.addLog("Getting service..."),t.next=10,this.server.getPrimaryService(v.BLUETOOTH_PRIMARY_SERVICE_UUID_HEX);case 10:return this.service=t.sent,this.addLog("Got service ".concat(this.service.uuid,", getting characteristics...")),t.next=14,this.service.getCharacteristics();case 14:n=t.sent,this.addLog("Got characteristics"),this.characteristicsByName=Object.fromEntries(n.map(function(e){return[k.CHARACTERISTIC_UUIDS_TO_NAMES[e.uuid],e]})),this.connection$.next(x.BLUETOOTH_CONNECTION.CONNECTED),t.next=23;break;case 20:return t.prev=20,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 23:case"end":return t.stop()}},t,this,[[0,20]])}))}},{key:"_onDisconnected",value:function(){var e=this;return this.connection$.asObservable().pipe((0,b.switchMap)(function(t){return t===x.BLUETOOTH_CONNECTION.CONNECTED?L(e.device,"gattserverdisconnected"):m.NEVER}))}},{key:"disconnect",value:function(){var e,t;return h(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:(null===(t=null===(e=null==this?void 0:this.device)||void 0===e?void 0:e.gatt)||void 0===t?void 0:t.connected)&&this.device.gatt.disconnect();case 2:case"end":return n.stop()}},n,this)}))}},{key:"getCharacteristicByName",value:function(e){var t;return h(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",null===(t=this.characteristicsByName)||void 0===t?void 0:t[e]);case 1:case"end":return n.stop()}},n,this)}))}},{key:"subscribeToCharacteristic",value:function(e){var t=this,n=e.characteristicName,r=e.manageNotifications,i=void 0===r||r,c=(0,g.defer)(function(){return t.getCharacteristicByName(n)}).pipe((0,b.switchMap)(function(e){return h(t,void 0,void 0,regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isConnected()||!i){t.next=10;break}return t.prev=1,t.next=4,e.startNotifications();case 4:this.addLog("Started notifications for ".concat(n," characteristic")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),this.addLog("Attemped to stop notifications for ".concat(n," characteristic: ").concat(null!==(r=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==r?r:t.t0));case 10:return t.abrupt("return",e);case 11:case"end":return t.stop()}},t,this,[[1,7]])}))}),(0,b.switchMap)(function(e){return L(e,"characteristicvaluechanged",function(){return h(t,void 0,void 0,regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isConnected()||!i){t.next=10;break}return t.prev=1,t.next=4,e.stopNotifications();case 4:this.addLog("Stopped notifications for ".concat(n," characteristic")),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),this.addLog("Attemped to stop notifications for ".concat(n," characteristic: ").concat(null!==(r=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==r?r:t.t0));case 10:case"end":return t.stop()}},t,this,[[1,7]])}))})}),(0,b.map)(function(e){var r=e.target.value,i=(0,y.decode)(t.type,r);return t.addLog("Received chunk with buffer size of ".concat(r.byteLength," and decoded size ").concat(i.length," for ").concat(n," characteristic: \n").concat(i)),i}),(0,C.stitchChunks)({delimiter:f.BLUETOOTH_CHUNK_DELIMITER}),(0,b.map)(function(e){var r;try{return JSON.parse(e)}catch(i){return t.addLog("Failed to parse JSON for ".concat(n," characteristic. Falling back to unparsed string. ").concat(null!==(r=null==i?void 0:i.message)&&void 0!==r?r:i)),e}}));return this.connection$.pipe((0,b.switchMap)(function(e){return e===x.BLUETOOTH_CONNECTION.CONNECTED?c:m.NEVER}))}},{key:"readCharacteristic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return h(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,c,a,o;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,this.addLog("Reading characteristic: ".concat(e)),n.next=4,this.getCharacteristicByName(e);case 4:if(r=n.sent){n.next=8;break}return this.addLog("Did not fund ".concat(e," characteristic")),n.abrupt("return",Promise.reject("Did not find characteristic by the name: ".concat(e)));case 8:return n.next=10,r.readValue();case 10:return i=n.sent,c=i,a=(0,y.decode)(this.type,c),o=t?JSON.parse(a):a,this.addLog("Received read data from ".concat(e," characteristic: \n").concat(o)),n.abrupt("return",o);case 18:return n.prev=18,n.t0=n.catch(0),n.abrupt("return",Promise.reject("Error reading characteristic: ".concat(n.t0.message)));case 21:case"end":return n.stop()}},n,this,[[0,18]])}))}},{key:"writeCharacteristic",value:function(e,t){return h(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.addLog("Writing characteristic: ".concat(e)),n.next=3,this.getCharacteristicByName(e);case 3:if(r=n.sent){n.next=7;break}return this.addLog("Did not fund ".concat(e," characteristic")),n.abrupt("return",Promise.reject("Did not find characteristic by the name: ".concat(e)));case 7:return i=(0,y.encode)(this.type,t),n.next=10,r.writeValueWithResponse(i);case 10:case"end":return n.stop()}},n,this)}))}},{key:"_addPendingAction",value:function(t){var n=this.pendingActions$.getValue();this.pendingActions$.next([].concat(e(n),[t]))}},{key:"_removePendingAction",value:function(e){var t=this.pendingActions$.getValue();this.pendingActions$.next(t.filter(function(t){return t!==e}))}},{key:"_autoToggleActionNotifications",value:function(e){return h(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i,c=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=!1,i=this.connection$.asObservable().pipe((0,b.switchMap)(function(e){return e===x.BLUETOOTH_CONNECTION.CONNECTED?(0,g.defer)(function(){return c.getCharacteristicByName("actions")}).pipe((0,b.switchMap)(function(e){return n=e,c.pendingActions$})):m.NEVER}),(0,b.tap)(function(e){return h(c,void 0,void 0,regeneratorRuntime.mark(function t(){var i,c,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(a=!!e.length)||r){t.next=12;break}return r=!0,t.prev=3,t.next=6,n.startNotifications();case 6:this.addLog("Started notifications for [actions] characteristic"),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),this.addLog("Attemped to start notifications for [actions] characteristic: ".concat(null!==(i=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==i?i:t.t0));case 12:if(a||!r){t.next=23;break}return r=!1,t.prev=14,t.next=17,n.stopNotifications();case 17:this.addLog("Stopped notifications for actions characteristic"),t.next=23;break;case 20:t.prev=20,t.t1=t.catch(14),this.addLog("Attemped to stop notifications for [actions] characteristic: ".concat(null!==(c=null===t.t1||void 0===t.t1?void 0:t.t1.message)&&void 0!==c?c:t.t1));case 23:case"end":return t.stop()}},t,this,[[3,9],[14,20]])}))})),e.pipe((0,b.switchMap)(function(e){return(0,R.osHasBluetoothSupport)(e)?i:m.EMPTY})).subscribe();case 3:case"end":return t.stop()}},t,this)}))}},{key:"dispatchAction",value:function(e){var t=e.characteristicName,n=e.action;return h(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,i,c,a,o=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.responseRequired,i=void 0!==r&&r,c=n.responseTimeout,a=void 0===c?T.DEFAULT_ACTION_RESPONSE_TIMEOUT:c,e.abrupt("return",new Promise(function(e,r){return h(o,void 0,void 0,regeneratorRuntime.mark(function c(){var o,s,u,d=this;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.getCharacteristicByName(t).catch(function(){r("Did not find characteristic by the name: ".concat(t))});case 2:if(c.sent){c.next=5;break}return c.abrupt("return");case 5:o=(0,O.create6DigitPin)(),s=JSON.stringify(Object.assign({actionId:o},n)),this.addLog("Dispatched action with id ".concat(o)),i&&a?(this._addPendingAction(o),u=(0,g.timer)(a).subscribe(function(){d._removePendingAction(o),r("Action with id ".concat(o," timed out after ").concat(a,"ms"))}),this.subscribeToCharacteristic({characteristicName:t,manageNotifications:!1}).pipe((0,b.filter)(function(e){return(null==e?void 0:e.actionId)===o}),(0,N.take)(1)).subscribe(function(t){u.unsubscribe(),d._removePendingAction(o),e(t)}),this.writeCharacteristic(t,s).catch(function(e){d._removePendingAction(o),r(e.message)})):this.writeCharacteristic(t,s).then(function(){e(null)}).catch(function(e){r(e.message)});case 9:case"end":return c.stop()}},c,this)}))}));case 2:case"end":return e.stop()}},e)}))}}]),t}();function L(e,t,n){var r=this;return(0,m.fromEventPattern)(function(n){e.addEventListener(t,n)},function(i){return h(r,void 0,void 0,regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!n){r.next=3;break}return r.next=3,n();case 3:e.removeEventListener(t,i);case 4:case"end":return r.stop()}},r)}))})}function S(e){return new m.Observable(function(t){var n=new AbortController,r=n.signal,i=e.addEventListener("advertisementreceived",function(e){n.abort(),t.next(e),t.complete()},{once:!0});try{e.watchAdvertisements({signal:r})}catch(c){t.error(c)}return function(){n.abort(),e.removeEventListener("advertisementreceived",i)}})}exports.WebBluetoothTransport=_;
|
|
651
|
+
},{"@neurosity/ipk":"ZOGh","rxjs":"Zr8e","rxjs/operators":"v3iE","./isWebBluetoothSupported":"ljun","../utils/create6DigitPin":"UDAB","../utils/stitch":"V73a","../utils/encoding":"jTvL","../types":"iwtf","../constants":"dGLb","../utils/osHasBluetoothSupport":"rH2Y"}],"FtS5":[function(require,module,exports) {
|
|
652
|
+
"use strict";function e(e){return r(e)||n(e)||t()}function t(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function n(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function r(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}var s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function c(e){try{s(r.next(e))}catch(t){a(t)}}function o(e){try{s(r.throw(e))}catch(t){a(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,o)}s((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReactNativeTransport=void 0;var u=require("@neurosity/ipk"),d=require("@neurosity/ipk"),h=require("@neurosity/ipk"),l=require("rxjs"),v=require("rxjs"),p=require("rxjs/operators"),f=require("rxjs/operators"),g=require("rxjs/operators"),m=require("../utils/create6DigitPin"),E=require("../utils/stitch"),b=require("../utils/encoding"),N=require("../types"),O=require("../constants"),C=require("../constants"),w=require("../constants"),T=require("../constants"),y=require("../utils/osHasBluetoothSupport"),_={autoConnect:!0},R=function(){function t(e){var n=this;if(a(this,t),this.type=N.TRANSPORT_TYPE.REACT_NATIVE,this.characteristicsByName={},this.connection$=new l.BehaviorSubject(N.BLUETOOTH_CONNECTION.DISCONNECTED),this.pendingActions$=new l.BehaviorSubject([]),this.logs$=new l.ReplaySubject(10),this.connectionStream$=this.connection$.asObservable().pipe((0,p.filter)(function(e){return!!e}),(0,f.distinctUntilChanged)(),(0,f.shareReplay)(1)),this._isAutoConnectEnabled$=new l.ReplaySubject(1),!e){var r="React Native transport: missing options.";throw this.addLog(r),new Error(r)}this.options=Object.assign(Object.assign({},_),e);var i=this.options,c=i.BleManager,o=i.bleManagerEmitter,s=i.platform,u=i.autoConnect;if(!c){var d="React Native option: BleManager not provided.";throw this.addLog(d),new Error(d)}if(!o){var h="React Native option: bleManagerEmitter not provided.";throw this.addLog(h),new Error(h)}if(!s){var v="React Native option: platform not provided.";throw this.addLog(v),new Error(v)}this.BleManager=c,this.bleManagerEmitter=o,this.platform=s,this._isAutoConnectEnabled$.next(u),this._isAutoConnectEnabled$.subscribe(function(e){n.addLog("Auto connect: ".concat(e?"enabled":"disabled"))}),this.bleEvents={stopScan$:this._fromEvent("BleManagerStopScan"),discoverPeripheral$:this._fromEvent("BleManagerDiscoverPeripheral"),connectPeripheral$:this._fromEvent("BleManagerConnectPeripheral"),disconnectPeripheral$:this._fromEvent("BleManagerDisconnectPeripheral"),didUpdateValueForCharacteristic$:this._fromEvent("BleManagerDidUpdateValueForCharacteristic"),didUpdateState$:this._fromEvent("BleManagerDidUpdateState")},this.onDisconnected$=this.bleEvents.disconnectPeripheral$.pipe((0,g.share)()),this.BleManager.start({showAlert:!1}).then(function(){n.addLog("BleManger started")}).catch(function(e){var t;n.addLog("BleManger failed to start. ".concat(null!==(t=null==e?void 0:e.message)&&void 0!==t?t:e))}),this.connection$.asObservable().subscribe(function(e){n.addLog("connection status is ".concat(e))}),this.onDisconnected$.subscribe(function(){n.connection$.next(N.BLUETOOTH_CONNECTION.DISCONNECTED)})}return o(t,[{key:"addLog",value:function(e){this.logs$.next(e)}},{key:"isConnected",value:function(){return this.connection$.getValue()===N.BLUETOOTH_CONNECTION.CONNECTED}},{key:"_autoConnect",value:function(e){var t=this,n=this.onDisconnected$.pipe((0,p.switchMap)(function(){return e}));return this._isAutoConnectEnabled$.pipe((0,p.switchMap)(function(t){return t?(0,l.merge)(e,n):v.NEVER}),(0,p.switchMap)(function(e){return(0,y.osHasBluetoothSupport)(e)?t.scan().pipe((0,p.switchMap)(function(t){var n=t.find(function(t){return t.name===(null==e?void 0:e.deviceNickname)});return n?(0,l.of)(n):v.NEVER}),(0,g.distinct)(function(e){return e.id}),(0,g.take)(1)):v.NEVER}),(0,p.switchMap)(function(e){return s(t,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.connect(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}))}},{key:"enableAutoConnect",value:function(e){this._isAutoConnectEnabled$.next(e)}},{key:"connection",value:function(){return this.connectionStream$}},{key:"_fromEvent",value:function(e){var t=this;return(0,v.fromEventPattern)(function(n){t.bleManagerEmitter.addListener(e,n)},function(){t.bleManagerEmitter.removeAllListeners(e)}).pipe((0,g.share)())}},{key:"scan",value:function(e){var t,n,r=this,a=null!==(t=null==e?void 0:e.seconds)&&void 0!==t?t:10,c=null!==(n=null==e?void 0:e.once)&&void 0!==n&&n,o=[u.BLUETOOTH_PRIMARY_SERVICE_UUID_STRING],s={},d=new v.Observable(function(e){var t;try{r.BleManager.scan(o,a,!0,s).then(function(){r.addLog("BleManger scanning ".concat(c?"once":"indefintely")),e.next()})}catch(n){r.addLog("BleManger scanning ".concat(c?"once":"indefintely"," failed. ").concat(null!==(t=null==n?void 0:n.message)&&void 0!==t?t:n)),e.error(n)}return function(){r.BleManager.stopScan()}});return(c?d:(0,l.timer)(0,1e4).pipe((0,p.switchMap)(function(){return d}))).pipe((0,p.tap)(function(){r.connection$.next(N.BLUETOOTH_CONNECTION.SCANNING)}),(0,p.takeUntil)(this.onDisconnected$),(0,p.switchMap)(function(){return r.bleEvents.discoverPeripheral$}),(0,p.filter)(function(e){var t,n,r,i=null!==(r=null!==(n=null===(t=null==e?void 0:e.advertising)||void 0===t?void 0:t.localName)&&void 0!==n?n:e.name)&&void 0!==r?r:"";return!!i&&-1!==h.BLUETOOTH_DEVICE_NAME_PREFIXES.findIndex(function(e){return i.startsWith(e)})}),(0,g.scan)(function(e,t){var n,a,c,o,s,u,d,h,l=null!==(c=null!==(a=null===(n=null==t?void 0:t.advertising)||void 0===n?void 0:n.localName)&&void 0!==a?a:t.name)&&void 0!==c?c:"",v=null===(h=null===(d=(0,b.decode)(r.type,null!==(u=null===(s=null===(o=null==t?void 0:t.advertising)||void 0===o?void 0:o.manufacturerData)||void 0===s?void 0:s.bytes)&&void 0!==u?u:[]))||void 0===d?void 0:d.slice)||void 0===h?void 0:h.call(d,2);return Object.assign(Object.assign({},e),i({},t.id,Object.assign(Object.assign({},t),{name:l,manufactureDataString:v})))},{}),(0,f.distinctUntilChanged)(function(e,t){return JSON.stringify(e)===JSON.stringify(t)}),(0,p.map)(function(e){return Object.values(e)}),(0,g.share)())}},{key:"connect",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,r){return s(n,void 0,void 0,regeneratorRuntime.mark(function n(){var i,a=this;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,e){n.next=4;break}return this.addLog("Peripheral not found"),n.abrupt("return");case 4:return this.connection$.next(N.BLUETOOTH_CONNECTION.CONNECTING),n.next=7,this.BleManager.connect(e.id);case 7:return this.addLog("Getting service..."),n.next=10,this.BleManager.retrieveServices(e.id,[u.BLUETOOTH_PRIMARY_SERVICE_UUID_STRING]);case 10:if(i=n.sent){n.next=15;break}return this.addLog("Could not retreive services"),r(new Error("Could not retreive services")),n.abrupt("return");case 15:if(this.addLog("Got service ".concat(u.BLUETOOTH_PRIMARY_SERVICE_UUID_STRING,", getting characteristics...")),this.device=e,this.characteristicsByName=Object.fromEntries(i.characteristics.map(function(t){return[C.CHARACTERISTIC_UUIDS_TO_NAMES[t.characteristic.toLowerCase()],{characteristicUUID:t.characteristic,serviceUUID:t.service,peripheralId:e.id}]})),this.addLog("Got characteristics."),"android"!==this.platform){n.next=22;break}return n.next=22,this.BleManager.requestMTU(e.id,w.ANDROID_MAX_MTU).then(function(e){a.addLog("Successfully updated Android MTU to ".concat(e," bytes. Requested MTU: ").concat(w.ANDROID_MAX_MTU," bytes."))}).catch(function(e){a.addLog("Failed to set Android MTU of ".concat(w.ANDROID_MAX_MTU," bytes. Error: ").concat(e))});case 22:this.addLog("Successfully connected to peripheral ".concat(e.id)),this.connection$.next(N.BLUETOOTH_CONNECTION.CONNECTED),t(),n.next=30;break;case 27:n.prev=27,n.t0=n.catch(0),r(n.t0);case 30:case"end":return n.stop()}},n,this,[[0,27]])}))}));case 1:case"end":return t.stop()}},t)}))}},{key:"disconnect",value:function(){var e;return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(this.isConnected()&&(null===(e=null==this?void 0:this.device)||void 0===e?void 0:e.id))){t.next=4;break}return t.next=4,this.BleManager.disconnect(this.device.id);case 4:t.next=9;break;case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 9:case"end":return t.stop()}},t,this,[[0,6]])}))}},{key:"getCharacteristicByName",value:function(e){var t;if(!(e in this.characteristicsByName))throw new Error("Characteristic by name ".concat(e," is not found"));return null===(t=this.characteristicsByName)||void 0===t?void 0:t[e]}},{key:"subscribeToCharacteristic",value:function(e){var t=this,n=e.characteristicName,r=e.manageNotifications,i=void 0===r||r;return this.connection$.pipe((0,p.switchMap)(function(e){return e===N.BLUETOOTH_CONNECTION.CONNECTED?(r=t.getCharacteristicByName(n),a=r.peripheralId,c=r.serviceUUID,o=r.characteristicUUID,(0,l.defer)(function(){return s(t,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!i){e.next=10;break}return e.prev=1,e.next=4,this.BleManager.startNotification(a,c,o);case 4:this.addLog("Started notifications for ".concat(n," characteristic")),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this.addLog("Attemped to stop notifications for ".concat(n," characteristic: ").concat(null!==(t=null===e.t0||void 0===e.t0?void 0:e.t0.message)&&void 0!==t?t:e.t0));case 10:case"end":return e.stop()}},e,this,[[1,7]])}))}).pipe((0,p.switchMap)(function(){return t.bleEvents.didUpdateValueForCharacteristic$}),(0,f.finalize)(function(){return s(t,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!i){e.next=10;break}return e.prev=1,e.next=4,this.BleManager.stopNotification(a,c,o);case 4:this.addLog("Stopped notifications for ".concat(n," characteristic")),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this.addLog("Attemped to stop notifications for ".concat(n," characteristic: ").concat(null!==(t=null===e.t0||void 0===e.t0?void 0:e.t0.message)&&void 0!==t?t:e.t0));case 10:case"end":return e.stop()}},e,this,[[1,7]])}))}),(0,p.filter)(function(e){return e.characteristic===o}),(0,p.map)(function(e){var n=e.value;return(0,b.decode)(t.type,n)}),(0,E.stitchChunks)({delimiter:d.BLUETOOTH_CHUNK_DELIMITER}),(0,p.map)(function(e){var r;try{return JSON.parse(e)}catch(i){return t.addLog("Failed to parse JSON for ".concat(n," characteristic. Falling back to unparsed string. ").concat(null!==(r=null==i?void 0:i.message)&&void 0!==r?r:i)),e}}))):v.NEVER;var r,a,c,o}))}},{key:"readCharacteristic",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return s(this,void 0,void 0,regeneratorRuntime.mark(function r(){var i,a,c,o,s,u,d;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.addLog("Reading characteristic: ".concat(e)),i=this.getCharacteristicByName(e),a=i.peripheralId,c=i.serviceUUID,o=i.characteristicUUID){r.next=4;break}return r.abrupt("return",Promise.reject(new Error("Did not find characteristic matching ".concat(e))));case 4:return r.prev=4,r.next=7,this.BleManager.read(a,c,o);case 7:return s=r.sent,u=(0,b.decode)(this.type,s),d=n?JSON.parse(u):u,this.addLog("Received read data from ".concat(e," characteristic: \n").concat(d)),r.abrupt("return",d);case 14:return r.prev=14,r.t0=r.catch(4),r.abrupt("return",Promise.reject(new Error("readCharacteristic ".concat(e," error. ").concat(null!==(t=null===r.t0||void 0===r.t0?void 0:r.t0.message)&&void 0!==t?t:r.t0))));case 17:case"end":return r.stop()}},r,this,[[4,14]])}))}},{key:"writeCharacteristic",value:function(e,t){return s(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,a,c,o;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.addLog("Writing characteristic: ".concat(e)),r=this.getCharacteristicByName(e),i=r.peripheralId,a=r.serviceUUID,c=r.characteristicUUID){n.next=4;break}return n.abrupt("return",Promise.reject(new Error("Did not find characteristic matching ".concat(e))));case 4:return o=(0,b.encode)(this.type,t),n.next=7,this.BleManager.write(i,a,c,o,T.REACT_NATIVE_MAX_BYTE_SIZE);case 7:case"end":return n.stop()}},n,this)}))}},{key:"_addPendingAction",value:function(t){var n=this.pendingActions$.getValue();this.pendingActions$.next([].concat(e(n),[t]))}},{key:"_removePendingAction",value:function(e){var t=this.pendingActions$.getValue();this.pendingActions$.next(t.filter(function(t){return t!==e}))}},{key:"_autoToggleActionNotifications",value:function(e){return s(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=!1,r=this.connection$.asObservable().pipe((0,p.switchMap)(function(e){return e===N.BLUETOOTH_CONNECTION.CONNECTED?i.pendingActions$:v.NEVER}),(0,p.tap)(function(e){return s(i,void 0,void 0,regeneratorRuntime.mark(function t(){var r,i,a,c,o,s,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=this.getCharacteristicByName("actions"),c=a.peripheralId,o=a.serviceUUID,s=a.characteristicUUID,!(u=!!e.length)||n){t.next=13;break}return n=!0,t.prev=4,t.next=7,this.BleManager.startNotification(c,o,s);case 7:this.addLog("Started notifications for [actions] characteristic"),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(4),this.addLog("Attemped to start notifications for [actions] characteristic: ".concat(null!==(r=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==r?r:t.t0));case 13:if(u||!n){t.next=24;break}return n=!1,t.prev=15,t.next=18,this.BleManager.stopNotification(c,o,s);case 18:this.addLog("Stopped notifications for actions characteristic"),t.next=24;break;case 21:t.prev=21,t.t1=t.catch(15),this.addLog("Attemped to stop notifications for [actions] characteristic: ".concat(null!==(i=null===t.t1||void 0===t.t1?void 0:t.t1.message)&&void 0!==i?i:t.t1));case 24:case"end":return t.stop()}},t,this,[[4,10],[15,21]])}))})),e.pipe((0,p.switchMap)(function(e){return(0,y.osHasBluetoothSupport)(e)?r:v.EMPTY})).subscribe();case 3:case"end":return t.stop()}},t,this)}))}},{key:"dispatchAction",value:function(e){var t=e.characteristicName,n=e.action;return s(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,i,a,c,o=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.responseRequired,i=void 0!==r&&r,a=n.responseTimeout,c=void 0===a?O.DEFAULT_ACTION_RESPONSE_TIMEOUT:a,e.abrupt("return",new Promise(function(e,r){return s(o,void 0,void 0,regeneratorRuntime.mark(function a(){var o,s,u,d=this;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:o=(0,m.create6DigitPin)(),s=JSON.stringify(Object.assign({actionId:o},n)),this.addLog("Dispatched action with id ".concat(o)),i&&c?(this._addPendingAction(o),u=(0,l.timer)(c).subscribe(function(){d._removePendingAction(o),r(new Error("Action with id ".concat(o," timed out after ").concat(c,"ms")))}),this.subscribeToCharacteristic({characteristicName:t,manageNotifications:!1}).pipe((0,p.filter)(function(e){return(null==e?void 0:e.actionId)===o}),(0,g.take)(1)).subscribe(function(t){u.unsubscribe(),d._removePendingAction(o),e(t)}),this.writeCharacteristic(t,s).catch(function(e){d._removePendingAction(o),r(e)})):this.writeCharacteristic(t,s).then(function(){e(null)}).catch(function(e){r(e)});case 4:case"end":return a.stop()}},a,this)}))}));case 2:case"end":return e.stop()}},e)}))}}]),t}();exports.ReactNativeTransport=R;
|
|
653
|
+
},{"@neurosity/ipk":"ZOGh","rxjs":"Zr8e","rxjs/operators":"v3iE","../utils/create6DigitPin":"UDAB","../utils/stitch":"V73a","../utils/encoding":"jTvL","../types":"iwtf","../constants":"dGLb","../utils/osHasBluetoothSupport":"rH2Y"}],"Oj1i":[function(require,module,exports) {
|
|
654
|
+
"use strict";function n(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.epoch=exports.bufferToEpoch=exports.addInfo=void 0;var e=require("rxjs"),t=require("rxjs/operators"),r="data",o=256,i=function(n){return n instanceof Object&&n===Object(n)},a=function(n){return"function"==typeof n},u=function(n){return function(e){var t;return Object.assign(Object.assign({},n),{info:Object.assign(Object.assign({},null!==(t=null==n?void 0:n.info)&&void 0!==t?t:{}),e||{})})}},f=function(n){return(0,e.pipe)((0,t.map)(function(e){if(!i(e)||!i(n)&&!a(n))return e;var t=a(n)?n(e):n;return u(e)(t)}))};exports.addInfo=f;var c=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;return n[0][e].map(function(t,r){return n.map(function(n){return n[e][r]})})},p=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.samplingRate,u=void 0===a?o:a,f=i.dataProp,p=void 0===f?r:f;return(0,e.pipe)((0,t.map)(function(e){var t;return n(t={},p,c(e,p)),n(t,"info",Object.assign(Object.assign({},e[0]&&e[0].info?e[0].info:{}),{startTime:e[0].timestamp,samplingRate:e[0].info&&e[0].info.samplingRate?e[0].info.samplingRate:u})),t}))};exports.bufferToEpoch=p;var s=function(n){var o=n.duration,i=n.interval,a=n.samplingRate,u=n.dataProp,f=void 0===u?r:u;return(0,e.pipe)((0,t.bufferCount)(i),(0,t.scan)(function(n,e){return n.concat(e).slice(n.length<o?0:-o)}),(0,t.filter)(function(n){return n.length===o}),(0,exports.bufferToEpoch)({samplingRate:a,dataProp:f}))};exports.epoch=s;
|
|
655
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE"}],"WTrV":[function(require,module,exports) {
|
|
656
|
+
"use strict";function e(e){return n(e)||t(e)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function t(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function n(e){if(Array.isArray(e))return e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.csvBufferToSamples=exports.csvBufferToEpoch=void 0;var o=require("rxjs"),a=require("rxjs/operators"),i=require("../../../utils/pipes"),s=16,u=256;function p(e){var r;return(null==e?void 0:e.samplingRate)||console.warn("Didn't receive a sampling rate, defaulting to ".concat(u)),(0,o.pipe)(c(),(0,i.epoch)({duration:s,interval:s,samplingRate:null!==(r=null==e?void 0:e.samplingRate)&&void 0!==r?r:u}),(0,i.addInfo)({channelNames:e.channelNames,samplingRate:e.samplingRate}))}function c(){return(0,o.pipe)((0,a.mergeMap)(function(e){return(0,o.from)(e)}),(0,a.map)(function(r){var t=e(r),n=t[0];t[1];return{timestamp:n,data:t.slice(2)}}))}exports.csvBufferToEpoch=p,exports.csvBufferToSamples=c;
|
|
657
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","../../../utils/pipes":"Oj1i"}],"fihV":[function(require,module,exports) {
|
|
658
|
+
"use strict";function t(t,i){return n(t)||r(t,i)||e()}function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function r(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,i=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(u){i=!0,s=u}finally{try{n||null==o.return||o.return()}finally{if(i)throw s}}return r}}function n(t){if(Array.isArray(t))return t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),t}var o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function a(t){try{u(n.next(t))}catch(e){s(e)}}function o(t){try{u(n.throw(t))}catch(e){s(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,o)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.BluetoothClient=void 0;var u=require("rxjs"),c=require("rxjs"),h=require("rxjs/operators"),p=require("rxjs/operators"),d=require("./web/WebBluetoothTransport"),f=require("./react-native/ReactNativeTransport"),l=require("./utils/csvBufferToEpoch"),v=require("./types"),b=require("./utils/osHasBluetoothSupport"),w=function(){function e(t){var r=this;i(this,e),this.selectedDevice$=new c.ReplaySubject(1),this.isAuthenticated$=new c.ReplaySubject(1);var n=null!=t?t:{},s=n.transport,a=n.selectedDevice$,o=n.createBluetoothToken;if(!s)throw new Error("No bluetooth transport provided.");this.transport=s,a&&a.subscribe(this.selectedDevice$),this.transport._autoConnect(this.selectedDevice$).subscribe({error:function(t){var e;r.transport.addLog("Auto connect: error -> ".concat(null!==(e=null==t?void 0:t.message)&&void 0!==e?e:t))}}),"function"==typeof o?(this.transport.addLog("Auto authentication enabled"),this._autoAuthenticate(o).subscribe()):this.transport.addLog("Auto authentication not enabled"),this.transport._autoToggleActionNotifications(this.selectedDevice$),this._focus$=this._subscribeWhileAuthenticated("focus"),this._calm$=this._subscribeWhileAuthenticated("calm"),this._accelerometer$=this._subscribeWhileAuthenticated("accelerometer"),this._brainwavesRaw$=this._subscribeWhileAuthenticated("raw"),this._brainwavesRawUnfiltered$=this._subscribeWhileAuthenticated("rawUnfiltered"),this._brainwavesPSD$=this._subscribeWhileAuthenticated("psd"),this._brainwavesPowerByBand$=this._subscribeWhileAuthenticated("powerByBand"),this._signalQuality$=this._subscribeWhileAuthenticated("signalQuality"),this._status$=this._subscribeWhileAuthenticated("status"),this._settings$=this._subscribeWhileAuthenticated("settings"),this._wifiNearbyNetworks$=this._subscribeWhileAuthenticated("wifiNearbyNetworks"),this._wifiConnections$=this._subscribeWhileAuthenticated("wifiConnections")}return a(e,[{key:"_autoAuthenticate",value:function(e){var r=this,n=(0,u.timer)(0,36e5).pipe((0,h.tap)(function(){r.transport.addLog("Auto authentication in progress...")}));return this.selectedDevice$.pipe((0,h.switchMap)(function(i){return(0,b.osHasBluetoothSupport)(i)?r.connection().pipe((0,h.switchMap)(function(t){return t===v.BLUETOOTH_CONNECTION.CONNECTED?n:c.EMPTY}),(0,h.switchMap)(function(){return o(r,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.isAuthenticated();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}),(0,h.tap)(function(n){var i=t(n,1)[0];return o(r,void 0,void 0,regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i){t.next=8;break}return t.next=3,e();case 3:return r=t.sent,t.next=6,this.authenticate(r);case 6:t.next=9;break;case 8:this.transport.addLog("Already authenticated");case 9:case"end":return t.stop()}},t,this)}))})):c.EMPTY}))}},{key:"enableAutoConnect",value:function(t){this.transport.enableAutoConnect(t)}},{key:"_hasBluetoothSupport",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,u.firstValueFrom)(this.selectedDevice$);case 2:return e=t.sent,t.abrupt("return",(0,b.osHasBluetoothSupport)(e));case 4:case"end":return t.stop()}},t,this)}))}},{key:"authenticate",value:function(e){return o(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,s,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._hasBluetoothSupport();case 2:if(r.sent){r.next=7;break}return n="authenticate method: The OS version does not support Bluetooth.",this.transport.addLog(n),r.abrupt("return",Promise.reject(n));case 7:return r.next=9,this.transport.writeCharacteristic("auth",e);case 9:return r.next=11,this.isAuthenticated();case 11:return i=r.sent,s=t(i,1),a=s[0],this.transport.addLog("Authentication ".concat(a?"succeeded":"failed")),this.isAuthenticated$.next(a),r.abrupt("return",i);case 16:case"end":return r.stop()}},r,this)}))}},{key:"isAuthenticated",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,n,i,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.transport.readCharacteristic("auth",!0);case 2:return r=e.sent,n=t(r,2),i=n[0],s=n[1],this.isAuthenticated$.next(i),e.abrupt("return",[i,s]);case 8:case"end":return e.stop()}},e,this)}))}},{key:"scan",value:function(t){if(this.transport instanceof f.ReactNativeTransport)return this.transport.scan(t);if(this.transport instanceof d.WebBluetoothTransport)throw new Error("scan method is compatibly with the React Native transport only");throw new Error("unknown transport")}},{key:"connect",value:function(t){return this.transport instanceof f.ReactNativeTransport?this.transport.connect(t):this.transport instanceof d.WebBluetoothTransport?t?this.transport.connect(t):this.transport.connect():void 0}},{key:"disconnect",value:function(){return this.transport.disconnect()}},{key:"connection",value:function(){return this.transport.connection()}},{key:"logs",value:function(){return this.transport.logs$.asObservable()}},{key:"getDeviceId",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.transport.readCharacteristic("deviceId"));case 1:case"end":return t.stop()}},t,this)}))}},{key:"_withAuthentication",value:function(t){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._hasBluetoothSupport();case 2:if(e.sent){e.next=7;break}return r="The OS version does not support Bluetooth.",this.transport.addLog(r),e.abrupt("return",Promise.reject(r));case 7:return e.next=9,(0,u.firstValueFrom)(this.isAuthenticated$);case 9:if(e.sent){e.next=14;break}return"Authentication required.",this.transport.addLog("Authentication required."),e.abrupt("return",Promise.reject("Authentication required."));case 14:return e.next=16,t();case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}},e,this)}))}},{key:"_subscribeWhileAuthenticated",value:function(t){var e=this;return this.selectedDevice$.pipe((0,h.switchMap)(function(r){return(0,b.osHasBluetoothSupport)(r)?e.isAuthenticated$.pipe((0,p.distinctUntilChanged)(),(0,h.switchMap)(function(r){return r?e.transport.subscribeToCharacteristic({characteristicName:t}):c.EMPTY})):c.EMPTY}),(0,h.share)())}},{key:"focus",value:function(){return this._focus$}},{key:"calm",value:function(){return this._calm$}},{key:"accelerometer",value:function(){return this._accelerometer$}},{key:"brainwaves",value:function(t){var e=this;switch(t){default:case"raw":return(0,u.defer)(function(){return e.getInfo()}).pipe((0,h.switchMap)(function(t){return e._brainwavesRaw$.pipe((0,l.csvBufferToEpoch)(t))}));case"rawUnfiltered":return(0,u.defer)(function(){return e.getInfo()}).pipe((0,h.switchMap)(function(t){return e._brainwavesRawUnfiltered$.pipe((0,l.csvBufferToEpoch)(t))}));case"psd":return this._brainwavesPSD$;case"powerByBand":return this._brainwavesPowerByBand$}}},{key:"signalQuality",value:function(){return this._signalQuality$}},{key:"addMarker",value:function(t){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.dispatchAction({action:"marker",command:"add",message:{timestamp:Date.now(),label:t}});case 2:case"end":return e.stop()}},e,this)}))}},{key:"getInfo",value:function(){return o(this,void 0,void 0,regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._withAuthentication(function(){return(0,u.firstValueFrom)(e.transport.subscribeToCharacteristic({characteristicName:"deviceInfo"}))});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"status",value:function(){return this._status$}},{key:"dispatchAction",value:function(t){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withAuthentication(function(){return r.transport.dispatchAction({characteristicName:"actions",action:t})});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"settings",value:function(){return this._settings$}},{key:"haptics",value:function(t){return this.dispatchAction({action:"haptics",command:"queue",responseRequired:!0,responseTimeout:4e3,message:{effects:t}})}},{key:"wifi",get:function(){var t=this;return{nearbyNetworks:function(){return t._wifiNearbyNetworks$},connections:function(){return t._wifiConnections$},connect:function(e,r){return e?t.dispatchAction({action:"wifi",command:"connect",responseRequired:!0,responseTimeout:12e4,message:{ssid:e,password:null!=r?r:null}}):Promise.reject("Missing ssid")},forgetConnection:function(e){return e?t.dispatchAction({action:"wifi",command:"forget-connection",responseRequired:!0,responseTimeout:15e3,message:{ssid:e}}):Promise.reject("Missing ssid")},reset:function(){return t.dispatchAction({action:"wifi",command:"reset",responseRequired:!0,responseTimeout:3e4,message:{respondOnSuccess:!0}})},speedTest:function(){return t.dispatchAction({action:"wifi",command:"speed-test",responseRequired:!0,responseTimeout:6e4})}}}}]),e}();exports.BluetoothClient=w;
|
|
659
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","./web/WebBluetoothTransport":"ouKb","./react-native/ReactNativeTransport":"FtS5","./utils/csvBufferToEpoch":"WTrV","./types":"iwtf","./utils/osHasBluetoothSupport":"rH2Y"}],"TICO":[function(require,module,exports) {
|
|
660
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),t=this&&this.__exportStar||function(t,r){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(r,o)||e(r,t,o)};Object.defineProperty(exports,"__esModule",{value:!0}),t(require("./BluetoothClient"),exports),t(require("./web/WebBluetoothTransport"),exports),t(require("./react-native/ReactNativeTransport"),exports),t(require("./utils/osHasBluetoothSupport"),exports),t(require("./types/index"),exports);
|
|
661
|
+
},{"./BluetoothClient":"fihV","./web/WebBluetoothTransport":"ouKb","./react-native/ReactNativeTransport":"FtS5","./utils/osHasBluetoothSupport":"rH2Y","./types/index":"iwtf"}],"BZP9":[function(require,module,exports) {
|
|
662
|
+
"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(t,n){return!n||"object"!==e(n)&&"function"!=typeof n?r(t):n}function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return a(e)||s(e,t)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function s(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var u,c=e[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(s){i=!0,o=s}finally{try{n||null==c.return||c.return()}finally{if(i)throw o}}return r}}function a(e){if(Array.isArray(e))return e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}var f=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&("get"in i?t.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),m=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),v=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&f(t,e,r);return m(t,e),t},p=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function c(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(u,c)}s((n=n.apply(e,t||[])).next())})},b=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Notion=exports.Neurosity=void 0;var g=require("rxjs"),C=require("rxjs"),y=require("rxjs/operators"),w=b(require("fast-deep-equal")),O=require("./api/index"),k=require("./api/index"),S=require("./types/streaming"),M=require("./utils/subscription"),_=require("./types/status"),x=v(require("./utils/errors")),E=v(require("./utils/platform")),T=v(require("./utils/hapticEffects")),A=require("./utils/oauth"),D=require("./utils/oauth"),N=require("./api/https/createOAuthURL"),I=require("./api/https/getOAuthToken"),R=require("./utils/is-node"),F=require("./utils/metrics"),P=require("./api/bluetooth"),j=require("./api/bluetooth/types"),L={timesync:!1,autoSelectDevice:!0,streamingMode:S.STREAMING_MODE.WIFI_ONLY,emulator:!1,emulatorHost:"localhost",emulatorAuthPort:9099,emulatorDatabasePort:9e3,emulatorFunctionsPort:5001,emulatorFirestorePort:8080,emulatorOptions:{}},U=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l(this,e),this.streamingMode$=new C.ReplaySubject(1);var r=t.streamingMode,n=t.bluetoothTransport;this.options=Object.freeze(Object.assign(Object.assign({},L),t)),this.cloudClient=new O.CloudClient(this.options),n&&(this.bluetoothClient=new P.BluetoothClient({selectedDevice$:this.onDeviceChange(),createBluetoothToken:this.createBluetoothToken.bind(this),transport:n})),this._initStreamingMode(r,!!n)}return d(e,[{key:"_initStreamingMode",value:function(e,t){var r=[S.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK,S.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK].includes(e),n=!Object.values(S.STREAMING_MODE).includes(e),i=r&&!t;this.isMissingBluetoothTransport=i,!e||n||i?this.streamingMode$.next(S.STREAMING_MODE.WIFI_ONLY):this.streamingMode$.next(e)}},{key:"streamingState",value:function(){var e=this,t=function(e){return[_.STATUS.ONLINE,_.STATUS.UPDATING].includes(e)};return this.streamingMode$.pipe((0,y.switchMap)(function(r){return e.isMissingBluetoothTransport?e.cloudClient.status().pipe((0,y.map)(function(e){var n=e.state;return{connected:t(n),streamingMode:r,activeMode:S.STREAMING_TYPE.WIFI}})):e.onDeviceChange().pipe((0,y.switchMap)(function(n){return n?(0,g.combineLatest)({wifiStatus:e.cloudClient.status(),bluetoothConnection:(null==e?void 0:e.bluetoothClient)?e.bluetoothClient.connection():(0,g.of)(j.BLUETOOTH_CONNECTION.DISCONNECTED)}).pipe((0,y.map)(function(e){var n=e.wifiStatus,i=e.bluetoothConnection===j.BLUETOOTH_CONNECTION.CONNECTED;switch(r){default:case S.STREAMING_MODE.WIFI_ONLY:return{connected:t(n.state),streamingMode:r,activeMode:S.STREAMING_TYPE.WIFI};case S.STREAMING_MODE.WIFI_WITH_BLUETOOTH_FALLBACK:return{connected:t(n.state)||!i?t(n.state):i,streamingMode:r,activeMode:t(n.state)||!i?S.STREAMING_TYPE.WIFI:S.STREAMING_TYPE.BLUETOOTH};case S.STREAMING_MODE.BLUETOOTH_WITH_WIFI_FALLBACK:return{connected:!!i||t(n.state),streamingMode:r,activeMode:i?S.STREAMING_TYPE.BLUETOOTH:S.STREAMING_TYPE.WIFI}}}),(0,y.distinctUntilChanged)(function(e,t){return(0,w.default)(e,t)})):C.EMPTY}))}))}},{key:"_withStreamingModeObservable",value:function(e){var t=e.wifi,r=e.bluetooth;return this.streamingState().pipe((0,y.switchMap)(function(e){switch(e.activeMode){case S.STREAMING_TYPE.WIFI:return t();case S.STREAMING_TYPE.BLUETOOTH:return r();default:return t()}}))}},{key:"_withStreamingModePromise",value:function(e){return p(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n,i,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.wifi,n=e.bluetooth,t.next=3,(0,C.firstValueFrom)(this.streamingState());case 3:i=t.sent,o=i.activeMode,t.t0=o,t.next=t.t0===S.STREAMING_TYPE.WIFI?8:t.t0===S.STREAMING_TYPE.BLUETOOTH?11:14;break;case 8:return t.next=10,r();case 10:return t.abrupt("return",t.sent);case 11:return t.next=13,n();case 13:return t.abrupt("return",t.sent);case 14:return t.next=16,r();case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}},t,this)}))}},{key:"_getCloudMetricDependencies",value:function(){return{options:this.options,cloudClient:this.cloudClient,onDeviceChange:this.onDeviceChange.bind(this),status:this.status.bind(this)}}},{key:"login",value:function(e){return p(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.login(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t,this)}))}},{key:"logout",value:function(){return p(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.logout();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"__getApp",value:function(){return this.cloudClient.__getApp()}},{key:"onAuthStateChanged",value:function(){return this.cloudClient.onAuthStateChanged()}},{key:"addDevice",value:function(e){var t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"addDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.addDevice(e)}},{key:"removeDevice",value:function(e){var t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"removeDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.removeDevice(e)}},{key:"transferDevice",value:function(e){var t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"transferDevice"),2),r=t[0],n=t[1];return r?Promise.reject(n):this.cloudClient.transferDevice(e)}},{key:"onUserDevicesChange",value:function(){var e=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onUserDevicesChange"),2),t=e[0],r=e[1];return t?(0,g.throwError)(function(){return r}):this.cloudClient.onUserDevicesChange()}},{key:"onUserClaimsChange",value:function(){return this.cloudClient.onUserClaimsChange()}},{key:"getDevices",value:function(){return p(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.getDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"selectDevice",value:function(e){return p(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n,i,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=(0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"selectDevice"),n=u(r,2),i=n[0],o=n[1],!i){t.next=3;break}return t.abrupt("return",Promise.reject(o));case 3:return t.next=5,this.cloudClient.selectDevice(e);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}},t,this)}))}},{key:"getSelectedDevice",value:function(){return p(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,r,n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getSelectedDevice"),r=u(t,2),n=r[0],i=r[1],!n){e.next=3;break}return e.abrupt("return",Promise.reject(i));case 3:return e.next=5,this.cloudClient.getSelectedDevice();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}},e,this)}))}},{key:"getInfo",value:function(){return p(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,r,n,i,o=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}return e.abrupt("return",Promise.reject(x.mustSelectDevice));case 4:if(t=(0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"getInfo"),r=u(t,2),n=r[0],i=r[1],!n){e.next=7;break}return e.abrupt("return",Promise.reject(i));case 7:return e.next=9,this._withStreamingModePromise({wifi:function(){return o.cloudClient.getInfo()},bluetooth:function(){return o.bluetoothClient.getInfo()}});case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}},e,this)}))}},{key:"onDeviceChange",value:function(){var e=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"onDeviceChange"),2),t=e[0],r=e[1];return t?(0,g.throwError)(function(){return r}):this.cloudClient.onDeviceChange()}},{key:"disconnect",value:function(){return p(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._withStreamingModePromise({wifi:function(){return t.cloudClient.disconnect()},bluetooth:function(){return t.bluetoothClient.disconnect()}});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e,this)}))}},{key:"dispatchAction",value:function(e){return p(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n,i,o,c=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(x.mustSelectDevice));case 4:if(r=(0,D.validateOAuthScopeForAction)(this.cloudClient.userClaims,e),n=u(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this._withStreamingModePromise({wifi:function(){return c.cloudClient.dispatchAction(e)},bluetooth:function(){return c.bluetoothClient.dispatchAction(e)}});case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)}))}},{key:"addMarker",value:function(e){return p(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}throw x.mustSelectDevice;case 4:if(e){t.next=6;break}throw new Error("".concat(x.prefix,"A label is required for addMarker"));case 6:return t.next=8,this._withStreamingModePromise({wifi:function(){return r.cloudClient.dispatchAction({command:"marker",action:"add",message:{label:e,timestamp:r.cloudClient.timestamp}})},bluetooth:function(){return r.bluetoothClient.addMarker(e)}});case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}},t,this)}))}},{key:"haptics",value:function(e){var t;return p(this,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,o,u,c,s,a=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n="haptics",r.next=3,this.cloudClient.didSelectDevice();case 3:if(r.sent){r.next=5;break}return r.abrupt("return",Promise.reject(x.mustSelectDevice));case 5:return r.next=7,this.getSelectedDevice();case 7:if(r.t1=t=r.sent,r.t0=null===r.t1,r.t0){r.next=11;break}r.t0=void 0===t;case 11:if(!r.t0){r.next=15;break}r.t2=void 0,r.next=16;break;case 15:r.t2=t.modelVersion;case 16:if(i=r.t2,E.supportsHaptics(i)){r.next=20;break}return r.abrupt("return",Promise.reject(x.metricNotSupportedByModel(n,i)));case 20:o=E.getPlatformHapticMotors(i),r.t3=regeneratorRuntime.keys(e);case 22:if((r.t4=r.t3()).done){r.next=33;break}if(u=r.t4.value,Object.keys(o).includes(u)){r.next=26;break}return r.abrupt("return",Promise.reject(x.locationNotFound(u,i)));case 26:if(c=e[u],7,!(c.length>7)){r.next=30;break}return r.abrupt("return",Promise.reject(x.exceededMaxItems(7)));case 30:o[u]=c,r.next=22;break;case 33:return s={command:n,action:"queue",responseRequired:!0,responseTimeout:1e3,message:{effects:o}},r.next=36,this._withStreamingModePromise({wifi:function(){return a.cloudClient.dispatchAction(s)},bluetooth:function(){return a.bluetoothClient.dispatchAction(s)}});case 36:return r.abrupt("return",r.sent);case 37:case"end":return r.stop()}},r,this)}))}},{key:"getHapticEffects",value:function(){return T}},{key:"accelerometer",value:function(){var e=this,t="accelerometer",r=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,g.throwError)(function(){return i}):this.onDeviceChange().pipe((0,y.switchMap)(function(r){var n=(null==r?void 0:r.modelVersion)||E.MODEL_VERSION_1;return E.supportsAccel(n)?e._withStreamingModeObservable({wifi:function(){return(0,F.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,M.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.accelerometer()}}):(0,g.throwError)(function(){return x.metricNotSupportedByModel(t,n)})}))}},{key:"brainwaves",value:function(e){var t=this,r=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"brainwaves"),2),n=r[0],i=r[1];return n?(0,g.throwError)(function(){return i}):this._withStreamingModeObservable({wifi:function(){return(0,F.getCloudMetric)(t._getCloudMetricDependencies(),{metric:"brainwaves",labels:e?[e]:[],atomic:!1})},bluetooth:function(){return t.bluetoothClient.brainwaves(e)}})}},{key:"calm",value:function(){var e=this,t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"calm"),2),r=t[0],n=t[1];return r?(0,g.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return(0,F.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["calm"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.calm()}})}},{key:"signalQuality",value:function(){var e=this,t="signalQuality",r=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,t),2),n=r[0],i=r[1];return n?(0,g.throwError)(function(){return i}):this._withStreamingModeObservable({wifi:function(){return(0,F.getCloudMetric)(e._getCloudMetricDependencies(),{metric:t,labels:(0,M.getLabels)(t),atomic:!0})},bluetooth:function(){return e.bluetoothClient.signalQuality()}})}},{key:"settings",value:function(){var e=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"settings"),2),t=e[0],r=e[1];return t?(0,g.throwError)(function(){return r}):this.cloudClient.observeNamespace("settings")}},{key:"focus",value:function(){var e=this,t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"focus"),2),r=t[0],n=t[1];return r?(0,g.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return(0,F.getCloudMetric)(e._getCloudMetricDependencies(),{metric:"awareness",labels:["focus"],atomic:!1})},bluetooth:function(){return e.bluetoothClient.focus()}})}},{key:"kinesis",value:function(e){var t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"kinesis"),2),r=t[0],n=t[1];return r?(0,g.throwError)(function(){return n}):(0,F.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"kinesis",labels:e?[e]:[],atomic:!1})}},{key:"predictions",value:function(e){var t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"predictions"),2),r=t[0],n=t[1];return r?(0,g.throwError)(function(){return n}):(0,F.getCloudMetric)(this._getCloudMetricDependencies(),{metric:"predictions",labels:e?[e]:[],atomic:!1})}},{key:"status",value:function(){var e=this,t=u((0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"status"),2),r=t[0],n=t[1];return r?(0,g.throwError)(function(){return n}):this._withStreamingModeObservable({wifi:function(){return e.cloudClient.status()},bluetooth:function(){return e.bluetoothClient.status()}})}},{key:"changeSettings",value:function(e){return p(this,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n,i,o;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.cloudClient.didSelectDevice();case 2:if(t.sent){t.next=4;break}return t.abrupt("return",Promise.reject(x.mustSelectDevice));case 4:if(r=(0,A.validateOAuthScopeForFunctionName)(this.cloudClient.userClaims,"changeSettings"),n=u(r,2),i=n[0],o=n[1],!i){t.next=7;break}return t.abrupt("return",Promise.reject(o));case 7:return t.next=9,this.cloudClient.changeSettings(e);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}},t,this)}))}},{key:"goOffline",value:function(){this.cloudClient.goOffline()}},{key:"goOnline",value:function(){this.cloudClient.goOnline()}},{key:"createAccount",value:function(e){return this.cloudClient.createAccount(e)}},{key:"deleteAccount",value:function(){return this.cloudClient.deleteAccount()}},{key:"createBluetoothToken",value:function(){return this.cloudClient.createBluetoothToken()}},{key:"createCustomToken",value:function(){return this.cloudClient.createCustomToken()}},{key:"getTimesyncOffset",value:function(){return this.options.timesync||console.warn("getTimesyncOffset() requires options.timesync to be true."),this.options.timesync?this.cloudClient.getTimesyncOffset():0}},{key:"createOAuthURL",value:function(e){return R.isNode?(0,N.createOAuthURL)(e,this.options):Promise.reject(new Error("".concat(x.prefix,"the createOAuthURL method must be used on the server side (node.js) for security reasons.")))}},{key:"getOAuthToken",value:function(e){return R.isNode?(0,I.getOAuthToken)(e,this.options):Promise.reject(new Error("".concat(x.prefix,"the getOAuthToken method must be used on the server side (node.js) for security reasons.")))}},{key:"removeOAuthAccess",value:function(){return this.cloudClient.removeOAuthAccess()}},{key:"onUserExperiments",value:function(){return this.cloudClient.onUserExperiments()}},{key:"deleteUserExperiment",value:function(e){return this.cloudClient.deleteUserExperiment(e)}},{key:"bluetooth",get:function(){return null==this?void 0:this.bluetoothClient}},{key:"training",get:function(){var e=this;return{record:function(t){return p(e,void 0,void 0,regeneratorRuntime.mark(function e(){var r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw x.mustSelectDevice;case 4:return r=this.cloudClient.user&&"uid"in this.cloudClient.user?this.cloudClient.user.uid:null,n=Object.assign(Object.assign({fit:!1,baseline:!1,timestamp:this.cloudClient.timestamp},t),{userId:r}),e.next=8,this.cloudClient.actions.dispatch({command:"training",action:"record",message:n});case 8:case"end":return e.stop()}},e,this)}))},stop:function(t){return p(e,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw x.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stop",message:Object.assign({},t)});case 6:case"end":return e.stop()}},e,this)}))},stopAll:function(){return p(e,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cloudClient.didSelectDevice();case 2:if(e.sent){e.next=4;break}throw x.mustSelectDevice;case 4:return e.next=6,this.cloudClient.actions.dispatch({command:"training",action:"stopAll",message:{}});case 6:case"end":return e.stop()}},e,this)}))}}}}]),e}();exports.Neurosity=U,U.credentialWithLink=k.credentialWithLink,U.createUser=O.createUser,U.SERVER_TIMESTAMP=k.SERVER_TIMESTAMP;var q=function(e){function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l(this,r),e=t(this,n(r).call(this,i)),console.log("The Notion class is deprecated and will be removed in the next version of the SDK. Please use the Neurosity class instead. e.g. new Notion() => new Neurosity()"),e}return i(r,U),r}();exports.Notion=q;
|
|
663
|
+
},{"rxjs":"Zr8e","rxjs/operators":"v3iE","fast-deep-equal":"jIGR","./api/index":"LXvB","./types/streaming":"rekm","./utils/subscription":"yLLB","./types/status":"Ttuy","./utils/errors":"WDyG","./utils/platform":"wAkn","./utils/hapticEffects":"lLai","./utils/oauth":"xIH5","./api/https/createOAuthURL":"MDrB","./api/https/getOAuthToken":"nfg4","./utils/is-node":"vsps","./utils/metrics":"DCuD","./api/bluetooth":"TICO","./api/bluetooth/types":"iwtf"}],"QCba":[function(require,module,exports) {
|
|
664
|
+
"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),t=this&&this.__exportStar||function(t,r){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||e(r,t,i)};Object.defineProperty(exports,"__esModule",{value:!0}),t(require("./Neurosity"),exports),t(require("./api/bluetooth"),exports);
|
|
665
|
+
},{"./Neurosity":"BZP9","./api/bluetooth":"TICO"}]},{},["QCba"], null)
|
|
666
|
+
//# sourceMappingURL=/neurosity.js.map
|