@progressive-development/pd-spa-helper 0.4.0 → 0.5.1
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/PdSpaHelper.d.ts.map +1 -1
- package/dist/{src/PdSpaHelper.js → PdSpaHelper.js} +16 -17
- package/dist/defaultpage/default-confirm-popup.d.ts.map +1 -1
- package/dist/{src/defaultpage → defaultpage}/default-confirm-popup.js +4 -5
- package/dist/defaultpage/default-dialog-popup.d.ts.map +1 -1
- package/dist/{src/defaultpage → defaultpage}/default-dialog-popup.js +4 -5
- package/dist/{src/defaultpage → defaultpage}/default-login.js +2 -3
- package/dist/defaultpage/default-popup.d.ts.map +1 -1
- package/dist/{src/defaultpage → defaultpage}/default-popup.js +1 -1
- package/dist/{src/defaultpage → defaultpage}/default-step-address.js +5 -6
- package/dist/{src/defaultpage → defaultpage}/default-step-summary.js +6 -7
- package/dist/{src/defaultpage → defaultpage}/default-view-page.js +2 -3
- package/dist/{src/defaultpage → defaultpage}/default-wizard-step.js +4 -5
- package/dist/defaultpage/default-wizard.d.ts.map +1 -1
- package/dist/{src/defaultpage → defaultpage}/default-wizard.js +7 -8
- package/dist/generated/locale-wrapper/be-wrapper.d.ts +15 -1
- package/dist/generated/locale-wrapper/be-wrapper.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/be-wrapper.js +17 -0
- package/dist/generated/locale-wrapper/de-wrapper.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/de-wrapper.js +17 -0
- package/dist/generated/locale-wrapper/en-wrapper.d.ts +15 -1
- package/dist/generated/locale-wrapper/en-wrapper.d.ts.map +1 -1
- package/dist/generated/locale-wrapper/en-wrapper.js +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -21
- package/dist/pd-panel-viewer.js +10 -12
- package/dist/pd-panel.js +2 -3
- package/dist/{src/popup → popup}/wizard-close-popup.js +3 -5
- package/dist/{src/popup → popup}/wizard-reload-popup.js +3 -5
- package/dist/{src/router → router}/AppMain.js +4 -5
- package/dist/{src/service-provider → service-provider}/firebase/auth.js +1 -4
- package/dist/{src/service-provider → service-provider}/firebase/firestorage-client.js +1 -1
- package/dist/{src/service-provider → service-provider}/firebase/firestore-client.js +1 -1
- package/dist/{src/service-provider → service-provider}/firebase/functions-client.js +1 -1
- package/dist/{src/service-provider → service-provider}/firebase/messagingFirebaseClient.js +2 -2
- package/dist/{src/service-provider → service-provider}/service-provider-impl.js +1 -2
- package/dist/{src/store → store}/mini-rx.store.js +1 -1
- package/dist/{src/store → store}/spa-app-effects.js +2 -2
- package/dist/{src/store → store}/spa-app-selector.js +1 -1
- package/dist/stories/pd-loading-state.stories.d.ts +3 -3
- package/dist/stories/pd-toast.stories.d.ts +3 -3
- package/dist/tmpown/pd-loading-state.d.ts.map +1 -1
- package/dist/{src/tmpown → tmpown}/pd-loading-state.js +6 -8
- package/dist/tmpown/pd-login.d.ts.map +1 -1
- package/dist/{src/tmpown → tmpown}/pd-login.js +6 -7
- package/dist/tmpown/pd-panel-viewer.d.ts.map +1 -1
- package/dist/{src/tmpown → tmpown}/pd-toast.js +5 -7
- package/package.json +29 -23
- package/dist/node_modules/@firebase/app/dist/esm/index.esm2017.js +0 -749
- package/dist/node_modules/@firebase/auth/dist/esm2017/index-68602d24.js +0 -6265
- package/dist/node_modules/@firebase/component/dist/esm/index.esm2017.js +0 -341
- package/dist/node_modules/@firebase/firestore/dist/index.esm2017.js +0 -10250
- package/dist/node_modules/@firebase/functions/dist/index.esm2017.js +0 -513
- package/dist/node_modules/@firebase/installations/dist/esm/index.esm2017.js +0 -863
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm2017.js +0 -122
- package/dist/node_modules/@firebase/messaging/dist/esm/index.esm2017.js +0 -1019
- package/dist/node_modules/@firebase/storage/dist/index.esm2017.js +0 -2042
- package/dist/node_modules/@firebase/util/dist/index.esm2017.js +0 -931
- package/dist/node_modules/@firebase/webchannel-wrapper/dist/bloom-blob/esm/bloom_blob_es2018.js +0 -417
- package/dist/node_modules/@firebase/webchannel-wrapper/dist/webchannel-blob/esm/webchannel_blob_es2018.js +0 -2155
- package/dist/node_modules/@lit/reactive-element/decorators/custom-element.js +0 -14
- package/dist/node_modules/@lit/reactive-element/decorators/property.js +0 -20
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +0 -7
- package/dist/node_modules/@progressive-development/pd-dialog/pd-popup-dialog.js +0 -5
- package/dist/node_modules/@progressive-development/pd-dialog/pd-popup.js +0 -2
- package/dist/node_modules/@progressive-development/pd-dialog/src/PdPopup.js +0 -113
- package/dist/node_modules/@progressive-development/pd-dialog/src/PdPopupDialog.js +0 -189
- package/dist/node_modules/@progressive-development/pd-forms/pd-button.js +0 -2
- package/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +0 -2
- package/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +0 -2
- package/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +0 -2
- package/dist/node_modules/@progressive-development/pd-forms/pd-input.js +0 -2
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +0 -86
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +0 -34
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +0 -227
- package/dist/node_modules/@progressive-development/pd-forms/src/PdButton.js +0 -194
- package/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +0 -167
- package/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +0 -92
- package/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +0 -108
- package/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +0 -79
- package/dist/node_modules/@progressive-development/pd-forms/src/generated/locale/be.js +0 -11
- package/dist/node_modules/@progressive-development/pd-forms/src/generated/locale/en.js +0 -11
- package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +0 -152
- package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +0 -64
- package/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +0 -4
- package/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +0 -596
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/be.js +0 -15
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/de.js +0 -15
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/en.js +0 -15
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-contact/pd-contact.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-contact/src/PdContact.js +0 -567
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/pd-collapse.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/pd-edit-content.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/src/PdCollapse.js +0 -136
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/src/PdEditContent.js +0 -224
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-dialog/pd-popup.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-dialog/src/PdPopup.js +0 -113
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-checkbox.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-input.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-radio-group.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +0 -86
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +0 -34
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +0 -229
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdCheckbox.js +0 -230
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +0 -167
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +0 -92
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +0 -108
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +0 -79
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdRadioGroup.js +0 -72
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +0 -152
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +0 -64
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +0 -4
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +0 -596
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-price/pd-pricetable.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-price/src/PdPricetable.js +0 -149
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/fecha/lib/fecha.js +0 -200
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/directive.js +0 -27
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/directives/class-map.js +0 -36
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/lit-html.js +0 -242
- package/dist/node_modules/@progressive-development/pd-order/dist/pd-order-contacts.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/pd-order-summary.js +0 -2
- package/dist/node_modules/@progressive-development/pd-order/dist/src/PdOrderContacts.js +0 -192
- package/dist/node_modules/@progressive-development/pd-order/dist/src/PdOrderSummary.js +0 -243
- package/dist/node_modules/@progressive-development/pd-page/pd-footer.js +0 -2
- package/dist/node_modules/@progressive-development/pd-page/pd-menu.js +0 -2
- package/dist/node_modules/@progressive-development/pd-page/src/PdFooter.js +0 -141
- package/dist/node_modules/@progressive-development/pd-page/src/PdMenu.js +0 -450
- package/dist/node_modules/@progressive-development/pd-shared-styles/src/shared-color-styles.js +0 -30
- package/dist/node_modules/@progressive-development/pd-shared-styles/src/shared-font-styles.js +0 -32
- package/dist/node_modules/@progressive-development/pd-wizard/pd-wizard.js +0 -2
- package/dist/node_modules/@progressive-development/pd-wizard/src/PdSteps.js +0 -191
- package/dist/node_modules/@progressive-development/pd-wizard/src/PdWizard.js +0 -280
- package/dist/node_modules/firebase/app/dist/esm/index.esm.js +0 -35
- package/dist/node_modules/idb/build/index.js +0 -81
- package/dist/node_modules/idb/build/wrap-idb-value.js +0 -148
- package/dist/node_modules/lit/node_modules/lit-html/directive.js +0 -27
- package/dist/node_modules/lit/node_modules/lit-html/directives/class-map.js +0 -36
- package/dist/node_modules/lit/node_modules/lit-html/lit-html.js +0 -242
- package/dist/node_modules/lit-element-router/lit-element-router.js +0 -131
- package/dist/node_modules/lit-element-router/utility/router-utility.js +0 -36
- package/dist/node_modules/mini-rx-store/index.esm.js +0 -458
- package/dist/node_modules/pwa-helpers/media-query.js +0 -17
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -100
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -147
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -139
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js +0 -159
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +0 -52
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/catchError.js +0 -28
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js +0 -27
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/filter.js +0 -13
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/map.js +0 -13
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js +0 -26
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/tap.js +0 -36
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/withLatestFrom.js +0 -43
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -18
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js +0 -11
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -6
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -14
- package/dist/node_modules/rxjs/dist/esm5/internal/util/args.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -9
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -13
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -8
- package/dist/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js +0 -23
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -6
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js +0 -6
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -6
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js +0 -8
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isIterable.js +0 -8
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isPromise.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js +0 -46
- package/dist/node_modules/rxjs/dist/esm5/internal/util/lift.js +0 -22
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -17
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -11
- package/dist/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js +0 -6
- package/dist/pd-spa-helper.d.ts +0 -1
- package/dist/pd-spa-helper.d.ts.map +0 -1
- package/dist/src/generated/locale-wrapper/be-wrapper.js +0 -15
- package/dist/src/generated/locale-wrapper/de-wrapper.js +0 -13
- package/dist/src/generated/locale-wrapper/en-wrapper.js +0 -15
- /package/dist/{src/generated → generated}/locales/be.js +0 -0
- /package/dist/{src/generated → generated}/locales/de.js +0 -0
- /package/dist/{src/generated → generated}/locales/en.js +0 -0
- /package/dist/{src/helper → helper}/helper-utils.js +0 -0
- /package/dist/{src/model → model}/spa-model.js +0 -0
- /package/dist/{src/service-provider → service-provider}/mock/auth.js +0 -0
- /package/dist/{src/service-provider → service-provider}/mock/function-client.js +0 -0
- /package/dist/{src/service-provider → service-provider}/mock/storage-client.js +0 -0
- /package/dist/{src/service-provider → service-provider}/service-provider-model.js +0 -0
- /package/dist/{src/store → store}/indexDB.js +0 -0
- /package/dist/{src/store → store}/spa-app-actions.js +0 -0
- /package/dist/{src/store → store}/spa-app-reducer.js +0 -0
|
@@ -1,931 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* @license
|
|
19
|
-
* Copyright 2017 Google LLC
|
|
20
|
-
*
|
|
21
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
-
* you may not use this file except in compliance with the License.
|
|
23
|
-
* You may obtain a copy of the License at
|
|
24
|
-
*
|
|
25
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
-
*
|
|
27
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
-
* See the License for the specific language governing permissions and
|
|
31
|
-
* limitations under the License.
|
|
32
|
-
*/
|
|
33
|
-
const stringToByteArray$1 = function(str) {
|
|
34
|
-
const out = [];
|
|
35
|
-
let p = 0;
|
|
36
|
-
for (let i = 0; i < str.length; i++) {
|
|
37
|
-
let c = str.charCodeAt(i);
|
|
38
|
-
if (c < 128) {
|
|
39
|
-
out[p++] = c;
|
|
40
|
-
} else if (c < 2048) {
|
|
41
|
-
out[p++] = c >> 6 | 192;
|
|
42
|
-
out[p++] = c & 63 | 128;
|
|
43
|
-
} else if ((c & 64512) === 55296 && i + 1 < str.length && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
44
|
-
c = 65536 + ((c & 1023) << 10) + (str.charCodeAt(++i) & 1023);
|
|
45
|
-
out[p++] = c >> 18 | 240;
|
|
46
|
-
out[p++] = c >> 12 & 63 | 128;
|
|
47
|
-
out[p++] = c >> 6 & 63 | 128;
|
|
48
|
-
out[p++] = c & 63 | 128;
|
|
49
|
-
} else {
|
|
50
|
-
out[p++] = c >> 12 | 224;
|
|
51
|
-
out[p++] = c >> 6 & 63 | 128;
|
|
52
|
-
out[p++] = c & 63 | 128;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return out;
|
|
56
|
-
};
|
|
57
|
-
const byteArrayToString = function(bytes) {
|
|
58
|
-
const out = [];
|
|
59
|
-
let pos = 0, c = 0;
|
|
60
|
-
while (pos < bytes.length) {
|
|
61
|
-
const c1 = bytes[pos++];
|
|
62
|
-
if (c1 < 128) {
|
|
63
|
-
out[c++] = String.fromCharCode(c1);
|
|
64
|
-
} else if (c1 > 191 && c1 < 224) {
|
|
65
|
-
const c2 = bytes[pos++];
|
|
66
|
-
out[c++] = String.fromCharCode((c1 & 31) << 6 | c2 & 63);
|
|
67
|
-
} else if (c1 > 239 && c1 < 365) {
|
|
68
|
-
const c2 = bytes[pos++];
|
|
69
|
-
const c3 = bytes[pos++];
|
|
70
|
-
const c4 = bytes[pos++];
|
|
71
|
-
const u = ((c1 & 7) << 18 | (c2 & 63) << 12 | (c3 & 63) << 6 | c4 & 63) - 65536;
|
|
72
|
-
out[c++] = String.fromCharCode(55296 + (u >> 10));
|
|
73
|
-
out[c++] = String.fromCharCode(56320 + (u & 1023));
|
|
74
|
-
} else {
|
|
75
|
-
const c2 = bytes[pos++];
|
|
76
|
-
const c3 = bytes[pos++];
|
|
77
|
-
out[c++] = String.fromCharCode((c1 & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return out.join("");
|
|
81
|
-
};
|
|
82
|
-
const base64 = {
|
|
83
|
-
/**
|
|
84
|
-
* Maps bytes to characters.
|
|
85
|
-
*/
|
|
86
|
-
byteToCharMap_: null,
|
|
87
|
-
/**
|
|
88
|
-
* Maps characters to bytes.
|
|
89
|
-
*/
|
|
90
|
-
charToByteMap_: null,
|
|
91
|
-
/**
|
|
92
|
-
* Maps bytes to websafe characters.
|
|
93
|
-
* @private
|
|
94
|
-
*/
|
|
95
|
-
byteToCharMapWebSafe_: null,
|
|
96
|
-
/**
|
|
97
|
-
* Maps websafe characters to bytes.
|
|
98
|
-
* @private
|
|
99
|
-
*/
|
|
100
|
-
charToByteMapWebSafe_: null,
|
|
101
|
-
/**
|
|
102
|
-
* Our default alphabet, shared between
|
|
103
|
-
* ENCODED_VALS and ENCODED_VALS_WEBSAFE
|
|
104
|
-
*/
|
|
105
|
-
ENCODED_VALS_BASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
|
|
106
|
-
/**
|
|
107
|
-
* Our default alphabet. Value 64 (=) is special; it means "nothing."
|
|
108
|
-
*/
|
|
109
|
-
get ENCODED_VALS() {
|
|
110
|
-
return this.ENCODED_VALS_BASE + "+/=";
|
|
111
|
-
},
|
|
112
|
-
/**
|
|
113
|
-
* Our websafe alphabet.
|
|
114
|
-
*/
|
|
115
|
-
get ENCODED_VALS_WEBSAFE() {
|
|
116
|
-
return this.ENCODED_VALS_BASE + "-_.";
|
|
117
|
-
},
|
|
118
|
-
/**
|
|
119
|
-
* Whether this browser supports the atob and btoa functions. This extension
|
|
120
|
-
* started at Mozilla but is now implemented by many browsers. We use the
|
|
121
|
-
* ASSUME_* variables to avoid pulling in the full useragent detection library
|
|
122
|
-
* but still allowing the standard per-browser compilations.
|
|
123
|
-
*
|
|
124
|
-
*/
|
|
125
|
-
HAS_NATIVE_SUPPORT: typeof atob === "function",
|
|
126
|
-
/**
|
|
127
|
-
* Base64-encode an array of bytes.
|
|
128
|
-
*
|
|
129
|
-
* @param input An array of bytes (numbers with
|
|
130
|
-
* value in [0, 255]) to encode.
|
|
131
|
-
* @param webSafe Boolean indicating we should use the
|
|
132
|
-
* alternative alphabet.
|
|
133
|
-
* @return The base64 encoded string.
|
|
134
|
-
*/
|
|
135
|
-
encodeByteArray(input, webSafe) {
|
|
136
|
-
if (!Array.isArray(input)) {
|
|
137
|
-
throw Error("encodeByteArray takes an array as a parameter");
|
|
138
|
-
}
|
|
139
|
-
this.init_();
|
|
140
|
-
const byteToCharMap = webSafe ? this.byteToCharMapWebSafe_ : this.byteToCharMap_;
|
|
141
|
-
const output = [];
|
|
142
|
-
for (let i = 0; i < input.length; i += 3) {
|
|
143
|
-
const byte1 = input[i];
|
|
144
|
-
const haveByte2 = i + 1 < input.length;
|
|
145
|
-
const byte2 = haveByte2 ? input[i + 1] : 0;
|
|
146
|
-
const haveByte3 = i + 2 < input.length;
|
|
147
|
-
const byte3 = haveByte3 ? input[i + 2] : 0;
|
|
148
|
-
const outByte1 = byte1 >> 2;
|
|
149
|
-
const outByte2 = (byte1 & 3) << 4 | byte2 >> 4;
|
|
150
|
-
let outByte3 = (byte2 & 15) << 2 | byte3 >> 6;
|
|
151
|
-
let outByte4 = byte3 & 63;
|
|
152
|
-
if (!haveByte3) {
|
|
153
|
-
outByte4 = 64;
|
|
154
|
-
if (!haveByte2) {
|
|
155
|
-
outByte3 = 64;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]);
|
|
159
|
-
}
|
|
160
|
-
return output.join("");
|
|
161
|
-
},
|
|
162
|
-
/**
|
|
163
|
-
* Base64-encode a string.
|
|
164
|
-
*
|
|
165
|
-
* @param input A string to encode.
|
|
166
|
-
* @param webSafe If true, we should use the
|
|
167
|
-
* alternative alphabet.
|
|
168
|
-
* @return The base64 encoded string.
|
|
169
|
-
*/
|
|
170
|
-
encodeString(input, webSafe) {
|
|
171
|
-
if (this.HAS_NATIVE_SUPPORT && !webSafe) {
|
|
172
|
-
return btoa(input);
|
|
173
|
-
}
|
|
174
|
-
return this.encodeByteArray(stringToByteArray$1(input), webSafe);
|
|
175
|
-
},
|
|
176
|
-
/**
|
|
177
|
-
* Base64-decode a string.
|
|
178
|
-
*
|
|
179
|
-
* @param input to decode.
|
|
180
|
-
* @param webSafe True if we should use the
|
|
181
|
-
* alternative alphabet.
|
|
182
|
-
* @return string representing the decoded value.
|
|
183
|
-
*/
|
|
184
|
-
decodeString(input, webSafe) {
|
|
185
|
-
if (this.HAS_NATIVE_SUPPORT && !webSafe) {
|
|
186
|
-
return atob(input);
|
|
187
|
-
}
|
|
188
|
-
return byteArrayToString(this.decodeStringToByteArray(input, webSafe));
|
|
189
|
-
},
|
|
190
|
-
/**
|
|
191
|
-
* Base64-decode a string.
|
|
192
|
-
*
|
|
193
|
-
* In base-64 decoding, groups of four characters are converted into three
|
|
194
|
-
* bytes. If the encoder did not apply padding, the input length may not
|
|
195
|
-
* be a multiple of 4.
|
|
196
|
-
*
|
|
197
|
-
* In this case, the last group will have fewer than 4 characters, and
|
|
198
|
-
* padding will be inferred. If the group has one or two characters, it decodes
|
|
199
|
-
* to one byte. If the group has three characters, it decodes to two bytes.
|
|
200
|
-
*
|
|
201
|
-
* @param input Input to decode.
|
|
202
|
-
* @param webSafe True if we should use the web-safe alphabet.
|
|
203
|
-
* @return bytes representing the decoded value.
|
|
204
|
-
*/
|
|
205
|
-
decodeStringToByteArray(input, webSafe) {
|
|
206
|
-
this.init_();
|
|
207
|
-
const charToByteMap = webSafe ? this.charToByteMapWebSafe_ : this.charToByteMap_;
|
|
208
|
-
const output = [];
|
|
209
|
-
for (let i = 0; i < input.length; ) {
|
|
210
|
-
const byte1 = charToByteMap[input.charAt(i++)];
|
|
211
|
-
const haveByte2 = i < input.length;
|
|
212
|
-
const byte2 = haveByte2 ? charToByteMap[input.charAt(i)] : 0;
|
|
213
|
-
++i;
|
|
214
|
-
const haveByte3 = i < input.length;
|
|
215
|
-
const byte3 = haveByte3 ? charToByteMap[input.charAt(i)] : 64;
|
|
216
|
-
++i;
|
|
217
|
-
const haveByte4 = i < input.length;
|
|
218
|
-
const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;
|
|
219
|
-
++i;
|
|
220
|
-
if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {
|
|
221
|
-
throw new DecodeBase64StringError();
|
|
222
|
-
}
|
|
223
|
-
const outByte1 = byte1 << 2 | byte2 >> 4;
|
|
224
|
-
output.push(outByte1);
|
|
225
|
-
if (byte3 !== 64) {
|
|
226
|
-
const outByte2 = byte2 << 4 & 240 | byte3 >> 2;
|
|
227
|
-
output.push(outByte2);
|
|
228
|
-
if (byte4 !== 64) {
|
|
229
|
-
const outByte3 = byte3 << 6 & 192 | byte4;
|
|
230
|
-
output.push(outByte3);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return output;
|
|
235
|
-
},
|
|
236
|
-
/**
|
|
237
|
-
* Lazy static initialization function. Called before
|
|
238
|
-
* accessing any of the static map variables.
|
|
239
|
-
* @private
|
|
240
|
-
*/
|
|
241
|
-
init_() {
|
|
242
|
-
if (!this.byteToCharMap_) {
|
|
243
|
-
this.byteToCharMap_ = {};
|
|
244
|
-
this.charToByteMap_ = {};
|
|
245
|
-
this.byteToCharMapWebSafe_ = {};
|
|
246
|
-
this.charToByteMapWebSafe_ = {};
|
|
247
|
-
for (let i = 0; i < this.ENCODED_VALS.length; i++) {
|
|
248
|
-
this.byteToCharMap_[i] = this.ENCODED_VALS.charAt(i);
|
|
249
|
-
this.charToByteMap_[this.byteToCharMap_[i]] = i;
|
|
250
|
-
this.byteToCharMapWebSafe_[i] = this.ENCODED_VALS_WEBSAFE.charAt(i);
|
|
251
|
-
this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[i]] = i;
|
|
252
|
-
if (i >= this.ENCODED_VALS_BASE.length) {
|
|
253
|
-
this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)] = i;
|
|
254
|
-
this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)] = i;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
class DecodeBase64StringError extends Error {
|
|
261
|
-
constructor() {
|
|
262
|
-
super(...arguments);
|
|
263
|
-
this.name = "DecodeBase64StringError";
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
const base64Encode = function(str) {
|
|
267
|
-
const utf8Bytes = stringToByteArray$1(str);
|
|
268
|
-
return base64.encodeByteArray(utf8Bytes, true);
|
|
269
|
-
};
|
|
270
|
-
const base64urlEncodeWithoutPadding = function(str) {
|
|
271
|
-
return base64Encode(str).replace(/\./g, "");
|
|
272
|
-
};
|
|
273
|
-
const base64Decode = function(str) {
|
|
274
|
-
try {
|
|
275
|
-
return base64.decodeString(str, true);
|
|
276
|
-
} catch (e) {
|
|
277
|
-
console.error("base64Decode failed: ", e);
|
|
278
|
-
}
|
|
279
|
-
return null;
|
|
280
|
-
};
|
|
281
|
-
/**
|
|
282
|
-
* @license
|
|
283
|
-
* Copyright 2022 Google LLC
|
|
284
|
-
*
|
|
285
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
286
|
-
* you may not use this file except in compliance with the License.
|
|
287
|
-
* You may obtain a copy of the License at
|
|
288
|
-
*
|
|
289
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
290
|
-
*
|
|
291
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
292
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
293
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
294
|
-
* See the License for the specific language governing permissions and
|
|
295
|
-
* limitations under the License.
|
|
296
|
-
*/
|
|
297
|
-
function getGlobal() {
|
|
298
|
-
if (typeof self !== "undefined") {
|
|
299
|
-
return self;
|
|
300
|
-
}
|
|
301
|
-
if (typeof window !== "undefined") {
|
|
302
|
-
return window;
|
|
303
|
-
}
|
|
304
|
-
if (typeof global !== "undefined") {
|
|
305
|
-
return global;
|
|
306
|
-
}
|
|
307
|
-
throw new Error("Unable to locate global object.");
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* @license
|
|
311
|
-
* Copyright 2022 Google LLC
|
|
312
|
-
*
|
|
313
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
314
|
-
* you may not use this file except in compliance with the License.
|
|
315
|
-
* You may obtain a copy of the License at
|
|
316
|
-
*
|
|
317
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
318
|
-
*
|
|
319
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
320
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
321
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
322
|
-
* See the License for the specific language governing permissions and
|
|
323
|
-
* limitations under the License.
|
|
324
|
-
*/
|
|
325
|
-
const getDefaultsFromGlobal = () => getGlobal().__FIREBASE_DEFAULTS__;
|
|
326
|
-
const getDefaultsFromEnvVariable = () => {
|
|
327
|
-
if (typeof process === "undefined" || typeof process.env === "undefined") {
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__;
|
|
331
|
-
if (defaultsJsonString) {
|
|
332
|
-
return JSON.parse(defaultsJsonString);
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
const getDefaultsFromCookie = () => {
|
|
336
|
-
if (typeof document === "undefined") {
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
let match;
|
|
340
|
-
try {
|
|
341
|
-
match = document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/);
|
|
342
|
-
} catch (e) {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
const decoded = match && base64Decode(match[1]);
|
|
346
|
-
return decoded && JSON.parse(decoded);
|
|
347
|
-
};
|
|
348
|
-
const getDefaults = () => {
|
|
349
|
-
try {
|
|
350
|
-
return getDefaultsFromGlobal() || getDefaultsFromEnvVariable() || getDefaultsFromCookie();
|
|
351
|
-
} catch (e) {
|
|
352
|
-
console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
const getDefaultEmulatorHost = (productName) => {
|
|
357
|
-
var _a, _b;
|
|
358
|
-
return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName];
|
|
359
|
-
};
|
|
360
|
-
const getDefaultEmulatorHostnameAndPort = (productName) => {
|
|
361
|
-
const host = getDefaultEmulatorHost(productName);
|
|
362
|
-
if (!host) {
|
|
363
|
-
return void 0;
|
|
364
|
-
}
|
|
365
|
-
const separatorIndex = host.lastIndexOf(":");
|
|
366
|
-
if (separatorIndex <= 0 || separatorIndex + 1 === host.length) {
|
|
367
|
-
throw new Error(`Invalid host ${host} with no separate hostname and port!`);
|
|
368
|
-
}
|
|
369
|
-
const port = parseInt(host.substring(separatorIndex + 1), 10);
|
|
370
|
-
if (host[0] === "[") {
|
|
371
|
-
return [host.substring(1, separatorIndex - 1), port];
|
|
372
|
-
} else {
|
|
373
|
-
return [host.substring(0, separatorIndex), port];
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
const getDefaultAppConfig = () => {
|
|
377
|
-
var _a;
|
|
378
|
-
return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config;
|
|
379
|
-
};
|
|
380
|
-
const getExperimentalSetting = (name) => {
|
|
381
|
-
var _a;
|
|
382
|
-
return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a[`_${name}`];
|
|
383
|
-
};
|
|
384
|
-
/**
|
|
385
|
-
* @license
|
|
386
|
-
* Copyright 2017 Google LLC
|
|
387
|
-
*
|
|
388
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
389
|
-
* you may not use this file except in compliance with the License.
|
|
390
|
-
* You may obtain a copy of the License at
|
|
391
|
-
*
|
|
392
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
393
|
-
*
|
|
394
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
395
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
396
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
397
|
-
* See the License for the specific language governing permissions and
|
|
398
|
-
* limitations under the License.
|
|
399
|
-
*/
|
|
400
|
-
class Deferred {
|
|
401
|
-
constructor() {
|
|
402
|
-
this.reject = () => {
|
|
403
|
-
};
|
|
404
|
-
this.resolve = () => {
|
|
405
|
-
};
|
|
406
|
-
this.promise = new Promise((resolve, reject) => {
|
|
407
|
-
this.resolve = resolve;
|
|
408
|
-
this.reject = reject;
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
413
|
-
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
414
|
-
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
415
|
-
*/
|
|
416
|
-
wrapCallback(callback) {
|
|
417
|
-
return (error, value) => {
|
|
418
|
-
if (error) {
|
|
419
|
-
this.reject(error);
|
|
420
|
-
} else {
|
|
421
|
-
this.resolve(value);
|
|
422
|
-
}
|
|
423
|
-
if (typeof callback === "function") {
|
|
424
|
-
this.promise.catch(() => {
|
|
425
|
-
});
|
|
426
|
-
if (callback.length === 1) {
|
|
427
|
-
callback(error);
|
|
428
|
-
} else {
|
|
429
|
-
callback(error, value);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* @license
|
|
437
|
-
* Copyright 2021 Google LLC
|
|
438
|
-
*
|
|
439
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
440
|
-
* you may not use this file except in compliance with the License.
|
|
441
|
-
* You may obtain a copy of the License at
|
|
442
|
-
*
|
|
443
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
444
|
-
*
|
|
445
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
446
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
447
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
448
|
-
* See the License for the specific language governing permissions and
|
|
449
|
-
* limitations under the License.
|
|
450
|
-
*/
|
|
451
|
-
function createMockUserToken(token, projectId) {
|
|
452
|
-
if (token.uid) {
|
|
453
|
-
throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');
|
|
454
|
-
}
|
|
455
|
-
const header = {
|
|
456
|
-
alg: "none",
|
|
457
|
-
type: "JWT"
|
|
458
|
-
};
|
|
459
|
-
const project = projectId || "demo-project";
|
|
460
|
-
const iat = token.iat || 0;
|
|
461
|
-
const sub = token.sub || token.user_id;
|
|
462
|
-
if (!sub) {
|
|
463
|
-
throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");
|
|
464
|
-
}
|
|
465
|
-
const payload = Object.assign({
|
|
466
|
-
// Set all required fields to decent defaults
|
|
467
|
-
iss: `https://securetoken.google.com/${project}`,
|
|
468
|
-
aud: project,
|
|
469
|
-
iat,
|
|
470
|
-
exp: iat + 3600,
|
|
471
|
-
auth_time: iat,
|
|
472
|
-
sub,
|
|
473
|
-
user_id: sub,
|
|
474
|
-
firebase: {
|
|
475
|
-
sign_in_provider: "custom",
|
|
476
|
-
identities: {}
|
|
477
|
-
}
|
|
478
|
-
}, token);
|
|
479
|
-
const signature = "";
|
|
480
|
-
return [
|
|
481
|
-
base64urlEncodeWithoutPadding(JSON.stringify(header)),
|
|
482
|
-
base64urlEncodeWithoutPadding(JSON.stringify(payload)),
|
|
483
|
-
signature
|
|
484
|
-
].join(".");
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* @license
|
|
488
|
-
* Copyright 2017 Google LLC
|
|
489
|
-
*
|
|
490
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
491
|
-
* you may not use this file except in compliance with the License.
|
|
492
|
-
* You may obtain a copy of the License at
|
|
493
|
-
*
|
|
494
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
495
|
-
*
|
|
496
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
497
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
498
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
499
|
-
* See the License for the specific language governing permissions and
|
|
500
|
-
* limitations under the License.
|
|
501
|
-
*/
|
|
502
|
-
function getUA() {
|
|
503
|
-
if (typeof navigator !== "undefined" && typeof navigator["userAgent"] === "string") {
|
|
504
|
-
return navigator["userAgent"];
|
|
505
|
-
} else {
|
|
506
|
-
return "";
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
function isMobileCordova() {
|
|
510
|
-
return typeof window !== "undefined" && // @ts-ignore Setting up an broadly applicable index signature for Window
|
|
511
|
-
// just to deal with this case would probably be a bad idea.
|
|
512
|
-
!!(window["cordova"] || window["phonegap"] || window["PhoneGap"]) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA());
|
|
513
|
-
}
|
|
514
|
-
function isNode() {
|
|
515
|
-
var _a;
|
|
516
|
-
const forceEnvironment = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.forceEnvironment;
|
|
517
|
-
if (forceEnvironment === "node") {
|
|
518
|
-
return true;
|
|
519
|
-
} else if (forceEnvironment === "browser") {
|
|
520
|
-
return false;
|
|
521
|
-
}
|
|
522
|
-
try {
|
|
523
|
-
return Object.prototype.toString.call(global.process) === "[object process]";
|
|
524
|
-
} catch (e) {
|
|
525
|
-
return false;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
function isCloudflareWorker() {
|
|
529
|
-
return typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers";
|
|
530
|
-
}
|
|
531
|
-
function isBrowserExtension() {
|
|
532
|
-
const runtime = typeof chrome === "object" ? chrome.runtime : typeof browser === "object" ? browser.runtime : void 0;
|
|
533
|
-
return typeof runtime === "object" && runtime.id !== void 0;
|
|
534
|
-
}
|
|
535
|
-
function isReactNative() {
|
|
536
|
-
return typeof navigator === "object" && navigator["product"] === "ReactNative";
|
|
537
|
-
}
|
|
538
|
-
function isIE() {
|
|
539
|
-
const ua = getUA();
|
|
540
|
-
return ua.indexOf("MSIE ") >= 0 || ua.indexOf("Trident/") >= 0;
|
|
541
|
-
}
|
|
542
|
-
function isSafari() {
|
|
543
|
-
return !isNode() && !!navigator.userAgent && navigator.userAgent.includes("Safari") && !navigator.userAgent.includes("Chrome");
|
|
544
|
-
}
|
|
545
|
-
function isIndexedDBAvailable() {
|
|
546
|
-
try {
|
|
547
|
-
return typeof indexedDB === "object";
|
|
548
|
-
} catch (e) {
|
|
549
|
-
return false;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
function validateIndexedDBOpenable() {
|
|
553
|
-
return new Promise((resolve, reject) => {
|
|
554
|
-
try {
|
|
555
|
-
let preExist = true;
|
|
556
|
-
const DB_CHECK_NAME = "validate-browser-context-for-indexeddb-analytics-module";
|
|
557
|
-
const request = self.indexedDB.open(DB_CHECK_NAME);
|
|
558
|
-
request.onsuccess = () => {
|
|
559
|
-
request.result.close();
|
|
560
|
-
if (!preExist) {
|
|
561
|
-
self.indexedDB.deleteDatabase(DB_CHECK_NAME);
|
|
562
|
-
}
|
|
563
|
-
resolve(true);
|
|
564
|
-
};
|
|
565
|
-
request.onupgradeneeded = () => {
|
|
566
|
-
preExist = false;
|
|
567
|
-
};
|
|
568
|
-
request.onerror = () => {
|
|
569
|
-
var _a;
|
|
570
|
-
reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || "");
|
|
571
|
-
};
|
|
572
|
-
} catch (error) {
|
|
573
|
-
reject(error);
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
function areCookiesEnabled() {
|
|
578
|
-
if (typeof navigator === "undefined" || !navigator.cookieEnabled) {
|
|
579
|
-
return false;
|
|
580
|
-
}
|
|
581
|
-
return true;
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* @license
|
|
585
|
-
* Copyright 2017 Google LLC
|
|
586
|
-
*
|
|
587
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
588
|
-
* you may not use this file except in compliance with the License.
|
|
589
|
-
* You may obtain a copy of the License at
|
|
590
|
-
*
|
|
591
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
592
|
-
*
|
|
593
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
594
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
595
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
596
|
-
* See the License for the specific language governing permissions and
|
|
597
|
-
* limitations under the License.
|
|
598
|
-
*/
|
|
599
|
-
const ERROR_NAME = "FirebaseError";
|
|
600
|
-
class FirebaseError extends Error {
|
|
601
|
-
constructor(code, message, customData) {
|
|
602
|
-
super(message);
|
|
603
|
-
this.code = code;
|
|
604
|
-
this.customData = customData;
|
|
605
|
-
this.name = ERROR_NAME;
|
|
606
|
-
Object.setPrototypeOf(this, FirebaseError.prototype);
|
|
607
|
-
if (Error.captureStackTrace) {
|
|
608
|
-
Error.captureStackTrace(this, ErrorFactory.prototype.create);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
class ErrorFactory {
|
|
613
|
-
constructor(service, serviceName, errors) {
|
|
614
|
-
this.service = service;
|
|
615
|
-
this.serviceName = serviceName;
|
|
616
|
-
this.errors = errors;
|
|
617
|
-
}
|
|
618
|
-
create(code, ...data) {
|
|
619
|
-
const customData = data[0] || {};
|
|
620
|
-
const fullCode = `${this.service}/${code}`;
|
|
621
|
-
const template = this.errors[code];
|
|
622
|
-
const message = template ? replaceTemplate(template, customData) : "Error";
|
|
623
|
-
const fullMessage = `${this.serviceName}: ${message} (${fullCode}).`;
|
|
624
|
-
const error = new FirebaseError(fullCode, fullMessage, customData);
|
|
625
|
-
return error;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
function replaceTemplate(template, data) {
|
|
629
|
-
return template.replace(PATTERN, (_, key) => {
|
|
630
|
-
const value = data[key];
|
|
631
|
-
return value != null ? String(value) : `<${key}?>`;
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
const PATTERN = /\{\$([^}]+)}/g;
|
|
635
|
-
function isEmpty(obj) {
|
|
636
|
-
for (const key in obj) {
|
|
637
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
638
|
-
return false;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
return true;
|
|
642
|
-
}
|
|
643
|
-
function deepEqual(a, b) {
|
|
644
|
-
if (a === b) {
|
|
645
|
-
return true;
|
|
646
|
-
}
|
|
647
|
-
const aKeys = Object.keys(a);
|
|
648
|
-
const bKeys = Object.keys(b);
|
|
649
|
-
for (const k of aKeys) {
|
|
650
|
-
if (!bKeys.includes(k)) {
|
|
651
|
-
return false;
|
|
652
|
-
}
|
|
653
|
-
const aProp = a[k];
|
|
654
|
-
const bProp = b[k];
|
|
655
|
-
if (isObject(aProp) && isObject(bProp)) {
|
|
656
|
-
if (!deepEqual(aProp, bProp)) {
|
|
657
|
-
return false;
|
|
658
|
-
}
|
|
659
|
-
} else if (aProp !== bProp) {
|
|
660
|
-
return false;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
for (const k of bKeys) {
|
|
664
|
-
if (!aKeys.includes(k)) {
|
|
665
|
-
return false;
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
return true;
|
|
669
|
-
}
|
|
670
|
-
function isObject(thing) {
|
|
671
|
-
return thing !== null && typeof thing === "object";
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* @license
|
|
675
|
-
* Copyright 2017 Google LLC
|
|
676
|
-
*
|
|
677
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
678
|
-
* you may not use this file except in compliance with the License.
|
|
679
|
-
* You may obtain a copy of the License at
|
|
680
|
-
*
|
|
681
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
682
|
-
*
|
|
683
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
684
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
685
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
686
|
-
* See the License for the specific language governing permissions and
|
|
687
|
-
* limitations under the License.
|
|
688
|
-
*/
|
|
689
|
-
function querystring(querystringParams) {
|
|
690
|
-
const params = [];
|
|
691
|
-
for (const [key, value] of Object.entries(querystringParams)) {
|
|
692
|
-
if (Array.isArray(value)) {
|
|
693
|
-
value.forEach((arrayVal) => {
|
|
694
|
-
params.push(encodeURIComponent(key) + "=" + encodeURIComponent(arrayVal));
|
|
695
|
-
});
|
|
696
|
-
} else {
|
|
697
|
-
params.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
return params.length ? "&" + params.join("&") : "";
|
|
701
|
-
}
|
|
702
|
-
function querystringDecode(querystring2) {
|
|
703
|
-
const obj = {};
|
|
704
|
-
const tokens = querystring2.replace(/^\?/, "").split("&");
|
|
705
|
-
tokens.forEach((token) => {
|
|
706
|
-
if (token) {
|
|
707
|
-
const [key, value] = token.split("=");
|
|
708
|
-
obj[decodeURIComponent(key)] = decodeURIComponent(value);
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
return obj;
|
|
712
|
-
}
|
|
713
|
-
function extractQuerystring(url) {
|
|
714
|
-
const queryStart = url.indexOf("?");
|
|
715
|
-
if (!queryStart) {
|
|
716
|
-
return "";
|
|
717
|
-
}
|
|
718
|
-
const fragmentStart = url.indexOf("#", queryStart);
|
|
719
|
-
return url.substring(queryStart, fragmentStart > 0 ? fragmentStart : void 0);
|
|
720
|
-
}
|
|
721
|
-
function createSubscribe(executor, onNoObservers) {
|
|
722
|
-
const proxy = new ObserverProxy(executor, onNoObservers);
|
|
723
|
-
return proxy.subscribe.bind(proxy);
|
|
724
|
-
}
|
|
725
|
-
class ObserverProxy {
|
|
726
|
-
/**
|
|
727
|
-
* @param executor Function which can make calls to a single Observer
|
|
728
|
-
* as a proxy.
|
|
729
|
-
* @param onNoObservers Callback when count of Observers goes to zero.
|
|
730
|
-
*/
|
|
731
|
-
constructor(executor, onNoObservers) {
|
|
732
|
-
this.observers = [];
|
|
733
|
-
this.unsubscribes = [];
|
|
734
|
-
this.observerCount = 0;
|
|
735
|
-
this.task = Promise.resolve();
|
|
736
|
-
this.finalized = false;
|
|
737
|
-
this.onNoObservers = onNoObservers;
|
|
738
|
-
this.task.then(() => {
|
|
739
|
-
executor(this);
|
|
740
|
-
}).catch((e) => {
|
|
741
|
-
this.error(e);
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
next(value) {
|
|
745
|
-
this.forEachObserver((observer) => {
|
|
746
|
-
observer.next(value);
|
|
747
|
-
});
|
|
748
|
-
}
|
|
749
|
-
error(error) {
|
|
750
|
-
this.forEachObserver((observer) => {
|
|
751
|
-
observer.error(error);
|
|
752
|
-
});
|
|
753
|
-
this.close(error);
|
|
754
|
-
}
|
|
755
|
-
complete() {
|
|
756
|
-
this.forEachObserver((observer) => {
|
|
757
|
-
observer.complete();
|
|
758
|
-
});
|
|
759
|
-
this.close();
|
|
760
|
-
}
|
|
761
|
-
/**
|
|
762
|
-
* Subscribe function that can be used to add an Observer to the fan-out list.
|
|
763
|
-
*
|
|
764
|
-
* - We require that no event is sent to a subscriber synchronously to their
|
|
765
|
-
* call to subscribe().
|
|
766
|
-
*/
|
|
767
|
-
subscribe(nextOrObserver, error, complete) {
|
|
768
|
-
let observer;
|
|
769
|
-
if (nextOrObserver === void 0 && error === void 0 && complete === void 0) {
|
|
770
|
-
throw new Error("Missing Observer.");
|
|
771
|
-
}
|
|
772
|
-
if (implementsAnyMethods(nextOrObserver, [
|
|
773
|
-
"next",
|
|
774
|
-
"error",
|
|
775
|
-
"complete"
|
|
776
|
-
])) {
|
|
777
|
-
observer = nextOrObserver;
|
|
778
|
-
} else {
|
|
779
|
-
observer = {
|
|
780
|
-
next: nextOrObserver,
|
|
781
|
-
error,
|
|
782
|
-
complete
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
if (observer.next === void 0) {
|
|
786
|
-
observer.next = noop;
|
|
787
|
-
}
|
|
788
|
-
if (observer.error === void 0) {
|
|
789
|
-
observer.error = noop;
|
|
790
|
-
}
|
|
791
|
-
if (observer.complete === void 0) {
|
|
792
|
-
observer.complete = noop;
|
|
793
|
-
}
|
|
794
|
-
const unsub = this.unsubscribeOne.bind(this, this.observers.length);
|
|
795
|
-
if (this.finalized) {
|
|
796
|
-
this.task.then(() => {
|
|
797
|
-
try {
|
|
798
|
-
if (this.finalError) {
|
|
799
|
-
observer.error(this.finalError);
|
|
800
|
-
} else {
|
|
801
|
-
observer.complete();
|
|
802
|
-
}
|
|
803
|
-
} catch (e) {
|
|
804
|
-
}
|
|
805
|
-
return;
|
|
806
|
-
});
|
|
807
|
-
}
|
|
808
|
-
this.observers.push(observer);
|
|
809
|
-
return unsub;
|
|
810
|
-
}
|
|
811
|
-
// Unsubscribe is synchronous - we guarantee that no events are sent to
|
|
812
|
-
// any unsubscribed Observer.
|
|
813
|
-
unsubscribeOne(i) {
|
|
814
|
-
if (this.observers === void 0 || this.observers[i] === void 0) {
|
|
815
|
-
return;
|
|
816
|
-
}
|
|
817
|
-
delete this.observers[i];
|
|
818
|
-
this.observerCount -= 1;
|
|
819
|
-
if (this.observerCount === 0 && this.onNoObservers !== void 0) {
|
|
820
|
-
this.onNoObservers(this);
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
forEachObserver(fn) {
|
|
824
|
-
if (this.finalized) {
|
|
825
|
-
return;
|
|
826
|
-
}
|
|
827
|
-
for (let i = 0; i < this.observers.length; i++) {
|
|
828
|
-
this.sendOne(i, fn);
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
// Call the Observer via one of it's callback function. We are careful to
|
|
832
|
-
// confirm that the observe has not been unsubscribed since this asynchronous
|
|
833
|
-
// function had been queued.
|
|
834
|
-
sendOne(i, fn) {
|
|
835
|
-
this.task.then(() => {
|
|
836
|
-
if (this.observers !== void 0 && this.observers[i] !== void 0) {
|
|
837
|
-
try {
|
|
838
|
-
fn(this.observers[i]);
|
|
839
|
-
} catch (e) {
|
|
840
|
-
if (typeof console !== "undefined" && console.error) {
|
|
841
|
-
console.error(e);
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
});
|
|
846
|
-
}
|
|
847
|
-
close(err) {
|
|
848
|
-
if (this.finalized) {
|
|
849
|
-
return;
|
|
850
|
-
}
|
|
851
|
-
this.finalized = true;
|
|
852
|
-
if (err !== void 0) {
|
|
853
|
-
this.finalError = err;
|
|
854
|
-
}
|
|
855
|
-
this.task.then(() => {
|
|
856
|
-
this.observers = void 0;
|
|
857
|
-
this.onNoObservers = void 0;
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
function implementsAnyMethods(obj, methods) {
|
|
862
|
-
if (typeof obj !== "object" || obj === null) {
|
|
863
|
-
return false;
|
|
864
|
-
}
|
|
865
|
-
for (const method of methods) {
|
|
866
|
-
if (method in obj && typeof obj[method] === "function") {
|
|
867
|
-
return true;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
return false;
|
|
871
|
-
}
|
|
872
|
-
function noop() {
|
|
873
|
-
}
|
|
874
|
-
/**
|
|
875
|
-
* @license
|
|
876
|
-
* Copyright 2021 Google LLC
|
|
877
|
-
*
|
|
878
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
879
|
-
* you may not use this file except in compliance with the License.
|
|
880
|
-
* You may obtain a copy of the License at
|
|
881
|
-
*
|
|
882
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
883
|
-
*
|
|
884
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
885
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
886
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
887
|
-
* See the License for the specific language governing permissions and
|
|
888
|
-
* limitations under the License.
|
|
889
|
-
*/
|
|
890
|
-
function getModularInstance(service) {
|
|
891
|
-
if (service && service._delegate) {
|
|
892
|
-
return service._delegate;
|
|
893
|
-
} else {
|
|
894
|
-
return service;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
export {
|
|
898
|
-
DecodeBase64StringError,
|
|
899
|
-
Deferred,
|
|
900
|
-
ErrorFactory,
|
|
901
|
-
FirebaseError,
|
|
902
|
-
areCookiesEnabled,
|
|
903
|
-
base64,
|
|
904
|
-
base64Decode,
|
|
905
|
-
base64Encode,
|
|
906
|
-
base64urlEncodeWithoutPadding,
|
|
907
|
-
createMockUserToken,
|
|
908
|
-
createSubscribe,
|
|
909
|
-
deepEqual,
|
|
910
|
-
extractQuerystring,
|
|
911
|
-
getDefaultAppConfig,
|
|
912
|
-
getDefaultEmulatorHost,
|
|
913
|
-
getDefaultEmulatorHostnameAndPort,
|
|
914
|
-
getDefaults,
|
|
915
|
-
getExperimentalSetting,
|
|
916
|
-
getGlobal,
|
|
917
|
-
getModularInstance,
|
|
918
|
-
getUA,
|
|
919
|
-
isBrowserExtension,
|
|
920
|
-
isCloudflareWorker,
|
|
921
|
-
isEmpty,
|
|
922
|
-
isIE,
|
|
923
|
-
isIndexedDBAvailable,
|
|
924
|
-
isMobileCordova,
|
|
925
|
-
isNode,
|
|
926
|
-
isReactNative,
|
|
927
|
-
isSafari,
|
|
928
|
-
querystring,
|
|
929
|
-
querystringDecode,
|
|
930
|
-
validateIndexedDBOpenable
|
|
931
|
-
};
|