bt-core-app 2.2.38 → 2.2.40

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.
Files changed (29) hide show
  1. package/dist/bt-core/core/node_modules/@firebase/app/dist/esm/index.esm.mjs +577 -0
  2. package/dist/bt-core/core/node_modules/@firebase/component/dist/esm/index.esm.mjs +275 -0
  3. package/dist/bt-core/core/node_modules/@firebase/installations/dist/esm/index.esm.mjs +763 -0
  4. package/dist/bt-core/core/node_modules/@firebase/logger/dist/esm/index.esm.mjs +101 -0
  5. package/dist/bt-core/core/node_modules/@firebase/messaging/dist/esm/index.esm.mjs +1278 -0
  6. package/dist/bt-core/core/node_modules/@firebase/util/dist/index.esm.mjs +444 -0
  7. package/dist/bt-core/core/node_modules/@firebase/util/dist/postinstall.mjs +5 -0
  8. package/dist/bt-core/core/node_modules/@mdi/js/mdi.mjs +60 -59
  9. package/dist/bt-core/core/node_modules/firebase/app/dist/esm/index.esm.mjs +32 -0
  10. package/dist/bt-core/core/node_modules/idb/build/index.mjs +58 -0
  11. package/dist/bt-core/core/node_modules/idb/build/wrap-idb-value.mjs +101 -0
  12. package/dist/components/BT-Blade-Steps.vue.mjs +2 -2
  13. package/dist/components/BT-Blade-Steps.vue2.mjs +4 -4
  14. package/dist/components/BT-Firebase-Notification.vue.d.ts +2 -0
  15. package/dist/components/BT-Firebase-Notification.vue.mjs +106 -0
  16. package/dist/components/BT-Firebase-Notification.vue2.mjs +4 -0
  17. package/dist/components.mjs +18 -16
  18. package/dist/composables/devices.d.ts +1 -0
  19. package/dist/composables/devices.mjs +12 -7
  20. package/dist/composables/firebase.d.ts +29 -0
  21. package/dist/composables/firebase.mjs +80 -0
  22. package/dist/composables/icons.mjs +58 -57
  23. package/dist/composables.mjs +200 -195
  24. package/dist/core.d.ts +2 -0
  25. package/dist/core2.mjs +89 -88
  26. package/dist/index-components.d.ts +2 -1
  27. package/dist/index-composables.d.ts +3 -1
  28. package/dist/style.css +1 -1
  29. package/package.json +2 -1
@@ -0,0 +1,275 @@
1
+ import { Deferred as h } from "../../../util/dist/index.esm.mjs";
2
+ class I {
3
+ /**
4
+ *
5
+ * @param name The public service name, e.g. app, auth, firestore, database
6
+ * @param instanceFactory Service factory responsible for creating the public interface
7
+ * @param type whether the service provided by the component is public or private
8
+ */
9
+ constructor(e, t, n) {
10
+ this.name = e, this.instanceFactory = t, this.type = n, this.multipleInstances = !1, this.serviceProps = {}, this.instantiationMode = "LAZY", this.onInstanceCreated = null;
11
+ }
12
+ setInstantiationMode(e) {
13
+ return this.instantiationMode = e, this;
14
+ }
15
+ setMultipleInstances(e) {
16
+ return this.multipleInstances = e, this;
17
+ }
18
+ setServiceProps(e) {
19
+ return this.serviceProps = e, this;
20
+ }
21
+ setInstanceCreatedCallback(e) {
22
+ return this.onInstanceCreated = e, this;
23
+ }
24
+ }
25
+ /**
26
+ * @license
27
+ * Copyright 2019 Google LLC
28
+ *
29
+ * Licensed under the Apache License, Version 2.0 (the "License");
30
+ * you may not use this file except in compliance with the License.
31
+ * You may obtain a copy of the License at
32
+ *
33
+ * http://www.apache.org/licenses/LICENSE-2.0
34
+ *
35
+ * Unless required by applicable law or agreed to in writing, software
36
+ * distributed under the License is distributed on an "AS IS" BASIS,
37
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38
+ * See the License for the specific language governing permissions and
39
+ * limitations under the License.
40
+ */
41
+ const a = "[DEFAULT]";
42
+ /**
43
+ * @license
44
+ * Copyright 2019 Google LLC
45
+ *
46
+ * Licensed under the Apache License, Version 2.0 (the "License");
47
+ * you may not use this file except in compliance with the License.
48
+ * You may obtain a copy of the License at
49
+ *
50
+ * http://www.apache.org/licenses/LICENSE-2.0
51
+ *
52
+ * Unless required by applicable law or agreed to in writing, software
53
+ * distributed under the License is distributed on an "AS IS" BASIS,
54
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55
+ * See the License for the specific language governing permissions and
56
+ * limitations under the License.
57
+ */
58
+ class l {
59
+ constructor(e, t) {
60
+ this.name = e, this.container = t, this.component = null, this.instances = /* @__PURE__ */ new Map(), this.instancesDeferred = /* @__PURE__ */ new Map(), this.instancesOptions = /* @__PURE__ */ new Map(), this.onInitCallbacks = /* @__PURE__ */ new Map();
61
+ }
62
+ /**
63
+ * @param identifier A provider can provide multiple instances of a service
64
+ * if this.component.multipleInstances is true.
65
+ */
66
+ get(e) {
67
+ const t = this.normalizeInstanceIdentifier(e);
68
+ if (!this.instancesDeferred.has(t)) {
69
+ const n = new h();
70
+ if (this.instancesDeferred.set(t, n), this.isInitialized(t) || this.shouldAutoInitialize())
71
+ try {
72
+ const i = this.getOrInitializeService({
73
+ instanceIdentifier: t
74
+ });
75
+ i && n.resolve(i);
76
+ } catch {
77
+ }
78
+ }
79
+ return this.instancesDeferred.get(t).promise;
80
+ }
81
+ getImmediate(e) {
82
+ const t = this.normalizeInstanceIdentifier(e == null ? void 0 : e.identifier), n = (e == null ? void 0 : e.optional) ?? !1;
83
+ if (this.isInitialized(t) || this.shouldAutoInitialize())
84
+ try {
85
+ return this.getOrInitializeService({
86
+ instanceIdentifier: t
87
+ });
88
+ } catch (i) {
89
+ if (n)
90
+ return null;
91
+ throw i;
92
+ }
93
+ else {
94
+ if (n)
95
+ return null;
96
+ throw Error(`Service ${this.name} is not available`);
97
+ }
98
+ }
99
+ getComponent() {
100
+ return this.component;
101
+ }
102
+ setComponent(e) {
103
+ if (e.name !== this.name)
104
+ throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);
105
+ if (this.component)
106
+ throw Error(`Component for ${this.name} has already been provided`);
107
+ if (this.component = e, !!this.shouldAutoInitialize()) {
108
+ if (f(e))
109
+ try {
110
+ this.getOrInitializeService({ instanceIdentifier: a });
111
+ } catch {
112
+ }
113
+ for (const [t, n] of this.instancesDeferred.entries()) {
114
+ const i = this.normalizeInstanceIdentifier(t);
115
+ try {
116
+ const r = this.getOrInitializeService({
117
+ instanceIdentifier: i
118
+ });
119
+ n.resolve(r);
120
+ } catch {
121
+ }
122
+ }
123
+ }
124
+ }
125
+ clearInstance(e = a) {
126
+ this.instancesDeferred.delete(e), this.instancesOptions.delete(e), this.instances.delete(e);
127
+ }
128
+ // app.delete() will call this method on every provider to delete the services
129
+ // TODO: should we mark the provider as deleted?
130
+ async delete() {
131
+ const e = Array.from(this.instances.values());
132
+ await Promise.all([
133
+ ...e.filter((t) => "INTERNAL" in t).map((t) => t.INTERNAL.delete()),
134
+ ...e.filter((t) => "_delete" in t).map((t) => t._delete())
135
+ ]);
136
+ }
137
+ isComponentSet() {
138
+ return this.component != null;
139
+ }
140
+ isInitialized(e = a) {
141
+ return this.instances.has(e);
142
+ }
143
+ getOptions(e = a) {
144
+ return this.instancesOptions.get(e) || {};
145
+ }
146
+ initialize(e = {}) {
147
+ const { options: t = {} } = e, n = this.normalizeInstanceIdentifier(e.instanceIdentifier);
148
+ if (this.isInitialized(n))
149
+ throw Error(`${this.name}(${n}) has already been initialized`);
150
+ if (!this.isComponentSet())
151
+ throw Error(`Component ${this.name} has not been registered yet`);
152
+ const i = this.getOrInitializeService({
153
+ instanceIdentifier: n,
154
+ options: t
155
+ });
156
+ for (const [r, o] of this.instancesDeferred.entries()) {
157
+ const c = this.normalizeInstanceIdentifier(r);
158
+ n === c && o.resolve(i);
159
+ }
160
+ return i;
161
+ }
162
+ /**
163
+ *
164
+ * @param callback - a function that will be invoked after the provider has been initialized by calling provider.initialize().
165
+ * The function is invoked SYNCHRONOUSLY, so it should not execute any longrunning tasks in order to not block the program.
166
+ *
167
+ * @param identifier An optional instance identifier
168
+ * @returns a function to unregister the callback
169
+ */
170
+ onInit(e, t) {
171
+ const n = this.normalizeInstanceIdentifier(t), i = this.onInitCallbacks.get(n) ?? /* @__PURE__ */ new Set();
172
+ i.add(e), this.onInitCallbacks.set(n, i);
173
+ const r = this.instances.get(n);
174
+ return r && e(r, n), () => {
175
+ i.delete(e);
176
+ };
177
+ }
178
+ /**
179
+ * Invoke onInit callbacks synchronously
180
+ * @param instance the service instance`
181
+ */
182
+ invokeOnInitCallbacks(e, t) {
183
+ const n = this.onInitCallbacks.get(t);
184
+ if (n)
185
+ for (const i of n)
186
+ try {
187
+ i(e, t);
188
+ } catch {
189
+ }
190
+ }
191
+ getOrInitializeService({ instanceIdentifier: e, options: t = {} }) {
192
+ let n = this.instances.get(e);
193
+ if (!n && this.component && (n = this.component.instanceFactory(this.container, {
194
+ instanceIdentifier: d(e),
195
+ options: t
196
+ }), this.instances.set(e, n), this.instancesOptions.set(e, t), this.invokeOnInitCallbacks(n, e), this.component.onInstanceCreated))
197
+ try {
198
+ this.component.onInstanceCreated(this.container, e, n);
199
+ } catch {
200
+ }
201
+ return n || null;
202
+ }
203
+ normalizeInstanceIdentifier(e = a) {
204
+ return this.component ? this.component.multipleInstances ? e : a : e;
205
+ }
206
+ shouldAutoInitialize() {
207
+ return !!this.component && this.component.instantiationMode !== "EXPLICIT";
208
+ }
209
+ }
210
+ function d(s) {
211
+ return s === a ? void 0 : s;
212
+ }
213
+ function f(s) {
214
+ return s.instantiationMode === "EAGER";
215
+ }
216
+ /**
217
+ * @license
218
+ * Copyright 2019 Google LLC
219
+ *
220
+ * Licensed under the Apache License, Version 2.0 (the "License");
221
+ * you may not use this file except in compliance with the License.
222
+ * You may obtain a copy of the License at
223
+ *
224
+ * http://www.apache.org/licenses/LICENSE-2.0
225
+ *
226
+ * Unless required by applicable law or agreed to in writing, software
227
+ * distributed under the License is distributed on an "AS IS" BASIS,
228
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
229
+ * See the License for the specific language governing permissions and
230
+ * limitations under the License.
231
+ */
232
+ class u {
233
+ constructor(e) {
234
+ this.name = e, this.providers = /* @__PURE__ */ new Map();
235
+ }
236
+ /**
237
+ *
238
+ * @param component Component being added
239
+ * @param overwrite When a component with the same name has already been registered,
240
+ * if overwrite is true: overwrite the existing component with the new component and create a new
241
+ * provider with the new component. It can be useful in tests where you want to use different mocks
242
+ * for different tests.
243
+ * if overwrite is false: throw an exception
244
+ */
245
+ addComponent(e) {
246
+ const t = this.getProvider(e.name);
247
+ if (t.isComponentSet())
248
+ throw new Error(`Component ${e.name} has already been registered with ${this.name}`);
249
+ t.setComponent(e);
250
+ }
251
+ addOrOverwriteComponent(e) {
252
+ this.getProvider(e.name).isComponentSet() && this.providers.delete(e.name), this.addComponent(e);
253
+ }
254
+ /**
255
+ * getProvider provides a type safe interface where it can only be called with a field name
256
+ * present in NameServiceMapping interface.
257
+ *
258
+ * Firebase SDKs providing services should extend NameServiceMapping interface to register
259
+ * themselves.
260
+ */
261
+ getProvider(e) {
262
+ if (this.providers.has(e))
263
+ return this.providers.get(e);
264
+ const t = new l(e, this);
265
+ return this.providers.set(e, t), t;
266
+ }
267
+ getProviders() {
268
+ return Array.from(this.providers.values());
269
+ }
270
+ }
271
+ export {
272
+ I as Component,
273
+ u as ComponentContainer,
274
+ l as Provider
275
+ };