@expofp/loader 1.0.44 → 1.0.46
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/{downloadZip-CKCMYGtc.js → downloadZip-DMgeO3fU.js} +2 -2
- package/dist/{downloadZip-CKCMYGtc.js.map → downloadZip-DMgeO3fU.js.map} +1 -1
- package/dist/importJson.d.ts +2 -0
- package/dist/index.js +245 -353
- package/dist/index.js.map +1 -1
- package/dist/makeOffline-1iGrM4gF.js +157 -0
- package/dist/makeOffline-1iGrM4gF.js.map +1 -0
- package/dist/{makeOfflineBundle-BXfViegK.js → makeOfflineBundle-g0Y3sA2l.js} +2 -2
- package/dist/{makeOfflineBundle-BXfViegK.js.map → makeOfflineBundle-g0Y3sA2l.js.map} +1 -1
- package/dist/mutateManifest.d.ts +1 -1
- package/dist/resolve.d.ts +5 -12
- package/dist/resolvers/legacyAssetUrlsResolver.d.ts +6 -0
- package/dist/resolvers/legacyDataResolver.d.ts +1 -2
- package/dist/returnCachedRef.d.ts +1 -0
- package/package.json +1 -1
- package/dist/makeOffline-CttQujH7.js +0 -154
- package/dist/makeOffline-CttQujH7.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,166 +1,85 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function J(e) {
|
|
2
|
+
return i("assetResolver resolveRef:", e), l(e);
|
|
3
3
|
}
|
|
4
|
-
const
|
|
4
|
+
const U = {
|
|
5
5
|
schema: "asset",
|
|
6
|
-
resolveRef: async (e) =>
|
|
6
|
+
resolveRef: async (e) => J(e),
|
|
7
7
|
offlineMethod: "localizeRef"
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
let d;
|
|
10
|
+
const B = /* @__PURE__ */ new WeakSet(), g = new Function("url", 'return import(url, { with: { type: "json" } });');
|
|
11
|
+
async function f(e, t) {
|
|
12
|
+
var r, o;
|
|
13
|
+
if (d === void 0 && !t.forceFetch)
|
|
14
|
+
try {
|
|
15
|
+
await g(e), d = !1;
|
|
16
|
+
} catch {
|
|
17
|
+
i("importJson: dynamic import not available, falling back to fetch"), d = !0;
|
|
18
|
+
}
|
|
19
|
+
let n;
|
|
20
|
+
return !d && !t.forceFetch ? (n = (await g(e)).default, (r = t.importCallback) == null || r.call(t, e, "json")) : (i("importJson: fetch", e), n = await N(e, t.refCache), (o = t.importCallback) == null || o.call(t, e, "json")), B.has(n) || u(n), n;
|
|
21
|
+
}
|
|
22
|
+
async function N(e, t) {
|
|
23
|
+
const n = "__loadJson__" + e;
|
|
24
|
+
if (t.has(n))
|
|
25
|
+
return t.get(n);
|
|
26
|
+
const r = (async function() {
|
|
27
|
+
const a = await fetch(e);
|
|
28
|
+
if (!a.ok)
|
|
29
|
+
throw new Error(`Failed to fetch JSON from ${e}`);
|
|
30
|
+
return await a.json();
|
|
31
|
+
})();
|
|
32
|
+
return t.set(n, r), r;
|
|
33
|
+
}
|
|
34
|
+
async function h(e, t, n) {
|
|
35
|
+
if (t.has(e))
|
|
36
|
+
return t.get(e);
|
|
37
|
+
const r = n().then((o) => (u(o), o));
|
|
38
|
+
return t.set(e, r), r;
|
|
39
|
+
}
|
|
40
|
+
const T = {
|
|
9
41
|
schema: "bundle-assets",
|
|
10
|
-
// canResolve(ref: string) {
|
|
11
|
-
// return canResolveRefSchema(ref, SCHEMA_PREFIX_BASE);
|
|
12
|
-
// },
|
|
13
42
|
async resolveRef(e, t) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
throw new Error(`Failed to fetch ref from ${e}`);
|
|
21
|
-
(c = t.fetchCallback) == null || c.call(t, r, "json");
|
|
22
|
-
const i = await s.json(), h = r.substring(0, r.lastIndexOf("/") + 1), f = i.map((u) => ({
|
|
23
|
-
$ref: `asset+${h}${u}`
|
|
43
|
+
i("bundleAssetsResolver resolveRef:", e);
|
|
44
|
+
const n = l(e);
|
|
45
|
+
return h(e, t.refCache, async () => {
|
|
46
|
+
const r = await f(n, t), o = n.substring(0, n.lastIndexOf("/") + 1);
|
|
47
|
+
return r.map((s) => ({
|
|
48
|
+
$ref: `asset+${o}${s}`
|
|
24
49
|
}));
|
|
25
|
-
return d(f), f;
|
|
26
50
|
});
|
|
27
|
-
return (a = t.refCache) == null || a.set(e, n), n;
|
|
28
51
|
},
|
|
29
|
-
// async *makeOfflineRef(ref: string) {
|
|
30
|
-
// log('bundleAssetsResolver makeOfflineRef:', ref);
|
|
31
|
-
// if (!this.canResolve(ref)) throw new Error(`Unexpected ref: ${ref}`);
|
|
32
|
-
// // const refData = deepFreeze(await this.resolveRef(ref));
|
|
33
|
-
// // yield* makeOfflineInternal(refData);
|
|
34
|
-
// const url = parseRefValue(ref);
|
|
35
|
-
// const targetFilePath = makeTargetPathFromUrl(url);
|
|
36
|
-
// // alert(targetFilePath)
|
|
37
|
-
// yield { url, targetFilePath };
|
|
38
|
-
// return { $ref: `bundle-assets:${targetFilePath}`, [STOP_RESOLVING]: true };
|
|
39
|
-
// },
|
|
40
|
-
// async *makeOfflineRef2(ref: string) {
|
|
41
|
-
// const url = parseRefValue(ref);
|
|
42
|
-
// const targetFilePath = makeTargetPathFromUrl(url);
|
|
43
|
-
// yield { url, targetFilePath };
|
|
44
|
-
// return `bundle-assets:${targetFilePath}`;
|
|
45
|
-
// },
|
|
46
52
|
offlineMethod: "localizeRef"
|
|
47
|
-
|
|
48
|
-
// log('bundleAssetsResolver makeOfflineRef:', ref);
|
|
49
|
-
// if (!this.canResolve(ref)) throw new Error(`Unexpected ref: ${ref}`);
|
|
50
|
-
// const url = getUrlFromRef(ref);
|
|
51
|
-
// // objects data may be changed by further processing
|
|
52
|
-
// const refData = deepClone(await this.resolveRef(ref));
|
|
53
|
-
// const targetFilePath = makeTargetPathFromUrl(url);
|
|
54
|
-
// const data = yield* makeOfflineInternal(refData);
|
|
55
|
-
// yield { data, targetFilePath };
|
|
56
|
-
// return { $ref: targetFilePath, [STOP_RESOLVING]: true };
|
|
57
|
-
// },
|
|
58
|
-
}, U = "https://efp-runtime.expofp.com/", W = {
|
|
53
|
+
}, C = "https://efp-runtime.expofp.com/", S = {
|
|
59
54
|
schema: "expo-runtime-branch",
|
|
60
|
-
// canResolve(ref: string) {
|
|
61
|
-
// return canResolveRefSchema(ref, SCHEMA);
|
|
62
|
-
// },
|
|
63
55
|
async resolveRef(e, t) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
const f = [`${U}branches/${r}.json`];
|
|
71
|
-
let c;
|
|
72
|
-
for (const v of f) {
|
|
73
|
-
l("Fetching HTTP:", v);
|
|
74
|
-
const m = await fetch(v);
|
|
75
|
-
if (m.ok) {
|
|
76
|
-
(h = t.fetchCallback) == null || h.call(t, v, "json"), c = await m.json();
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (!c)
|
|
81
|
-
throw new Error(`Failed to fetch release from ${e}`);
|
|
82
|
-
const u = {
|
|
83
|
-
$ref: `expo-runtime+https://efp-runtime.expofp.com/releases/${c}/`
|
|
84
|
-
};
|
|
85
|
-
d(u), s(u);
|
|
86
|
-
} catch (f) {
|
|
87
|
-
i(f);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
return (a = t.refCache) == null || a.set(e, n), n;
|
|
56
|
+
i("expoRuntimeBranchResolver resolveRef:", e);
|
|
57
|
+
const n = l(e), r = `${C}branches/${n}.json`;
|
|
58
|
+
return h(e, t.refCache, async () => ({
|
|
59
|
+
$ref: `expo-runtime+https://efp-runtime.expofp.com/releases/${await f(r, t)}/`
|
|
60
|
+
}));
|
|
91
61
|
},
|
|
92
|
-
// async *makeOfflineRef(ref: string) {
|
|
93
|
-
// log('expoRuntimeBranchResolver makeOfflineRef:', ref);
|
|
94
|
-
// if (!this.canResolve(ref)) throw new Error(`Unexpected ref: ${ref}`);
|
|
95
|
-
// const value = parseRefValue(ref);
|
|
96
|
-
// const refData = deepClone(await this.resolveRef(ref));
|
|
97
|
-
// const targetFilePath = makeUniqueJsonTargetPathFromString(value, SCHEMA_PREFIX_BASE);
|
|
98
|
-
// const data = yield* makeOfflineInternal(refData);
|
|
99
|
-
// yield { data: data, targetFilePath };
|
|
100
|
-
// return { $ref: targetFilePath, [STOP_RESOLVING]: true };
|
|
101
|
-
// },
|
|
102
|
-
// async *makeOfflineRef2(ref: string) {
|
|
103
|
-
// const refData = deepClone(await this.resolveRef(ref));
|
|
104
|
-
// const targetFilePath = makeUniqueJsonTargetPathFromString(ref);
|
|
105
|
-
// const data = yield* makeOfflineInternal(refData);
|
|
106
|
-
// yield { data, targetFilePath };
|
|
107
|
-
// return targetFilePath;
|
|
108
|
-
// },
|
|
109
62
|
offlineMethod: "resolveRef"
|
|
110
|
-
},
|
|
63
|
+
}, D = {
|
|
111
64
|
schema: "expo-runtime-get-branch",
|
|
112
|
-
// canResolve(ref: string) {
|
|
113
|
-
// return canResolveRefSchema(ref, SCHEMA);
|
|
114
|
-
// },
|
|
115
65
|
async resolveRef(e, t) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const r = w(e), n = `https://${r}.expofp.com/get-branch`;
|
|
120
|
-
l("Fetching HTTP:", n);
|
|
121
|
-
const o = fetch(n).then(async (i) => {
|
|
122
|
-
var u;
|
|
123
|
-
if (!i.ok)
|
|
124
|
-
throw new Error(`Failed to fetch ref from ${e}`);
|
|
125
|
-
(u = t.fetchCallback) == null || u.call(t, n, "json");
|
|
126
|
-
const f = (await i.json()).branch;
|
|
127
|
-
if (!f)
|
|
128
|
-
throw new Error(`Invalid response when fetching branch for expo ${r}`);
|
|
129
|
-
const c = { $ref: `expo-runtime-branch:${f}` };
|
|
130
|
-
return d(c), c;
|
|
131
|
-
});
|
|
132
|
-
return (s = t.refCache) == null || s.set(e, o), o;
|
|
66
|
+
i("expoRuntimeGetBranchResolver resolveRef:", e);
|
|
67
|
+
const r = `https://${l(e)}.expofp.com/get-branch`;
|
|
68
|
+
return f(r, t);
|
|
133
69
|
},
|
|
134
|
-
// async *makeOfflineRef(ref: string) {
|
|
135
|
-
// log('expoRuntimeBranchResolver makeOfflineRef:', ref);
|
|
136
|
-
// if (!this.canResolve(ref)) throw new Error(`Unexpected ref: ${ref}`);
|
|
137
|
-
// const value = parseRefValue(ref);
|
|
138
|
-
// const refData = deepClone(await this.resolveRef(ref));
|
|
139
|
-
// const targetFilePath = makeUniqueJsonTargetPathFromString(value, SCHEMA_PREFIX_BASE);
|
|
140
|
-
// const data = yield* makeOfflineInternal(refData);
|
|
141
|
-
// yield { data: data, targetFilePath };
|
|
142
|
-
// return { $ref: targetFilePath, [STOP_RESOLVING]: true };
|
|
143
|
-
// },
|
|
144
|
-
// async *makeOfflineRef2(ref: string) {
|
|
145
|
-
// const refData = deepClone(await this.resolveRef(ref));
|
|
146
|
-
// const targetFilePath = makeUniqueJsonTargetPathFromString(ref);
|
|
147
|
-
// const data = yield* makeOfflineInternal(refData);
|
|
148
|
-
// yield { data, targetFilePath };
|
|
149
|
-
// return targetFilePath;
|
|
150
|
-
// },
|
|
151
70
|
offlineMethod: "resolveRef"
|
|
152
|
-
},
|
|
71
|
+
}, W = {
|
|
153
72
|
schema: "expo-runtime",
|
|
154
73
|
// canResolve(ref: string) {
|
|
155
74
|
// return canResolveRefSchema(ref, SCHEMA);
|
|
156
75
|
// },
|
|
157
76
|
async resolveRef(e) {
|
|
158
|
-
|
|
159
|
-
const t =
|
|
77
|
+
i("expoRuntimeResolver resolveRef:", e);
|
|
78
|
+
const t = l(e), n = {
|
|
160
79
|
entry: { $ref: `asset+${t}expofp.js` },
|
|
161
80
|
assets: { $ref: `bundle-assets+${t}bundle.json` }
|
|
162
81
|
};
|
|
163
|
-
return
|
|
82
|
+
return u(n), n;
|
|
164
83
|
},
|
|
165
84
|
// async *makeOfflineRef(ref: string) {
|
|
166
85
|
// log('expoRuntimeResolver makeOfflineRef:', ref);
|
|
@@ -180,55 +99,43 @@ const D = {
|
|
|
180
99
|
// return targetFilePath;
|
|
181
100
|
// },
|
|
182
101
|
offlineMethod: "resolveRef"
|
|
183
|
-
},
|
|
102
|
+
}, P = {
|
|
184
103
|
canResolve(e) {
|
|
185
104
|
return e.startsWith("http://") || e.startsWith("https://") || e.startsWith("./");
|
|
186
105
|
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if ((n = t.refCache) != null && n.has(e))
|
|
191
|
-
return t.refCache.get(e);
|
|
192
|
-
l("Fetching HTTP ref:", e);
|
|
193
|
-
const r = fetch(e).then(async (a) => {
|
|
194
|
-
var i;
|
|
195
|
-
if (!a.ok)
|
|
196
|
-
throw new Error(`Failed to fetch ref from ${e}`);
|
|
197
|
-
(i = t.fetchCallback) == null || i.call(t, e, "json");
|
|
198
|
-
const s = await a.json();
|
|
199
|
-
return d(s), s;
|
|
200
|
-
});
|
|
201
|
-
return (o = t.refCache) == null || o.set(e, r), r;
|
|
106
|
+
resolveRef(e, t) {
|
|
107
|
+
if (i("httpResolver resolveRef:", e), !this.canResolve(e)) throw new Error(`Unexpected ref in httpResolver: ${e}`);
|
|
108
|
+
return f(e, t);
|
|
202
109
|
},
|
|
203
110
|
offlineMethod: "resolveRef"
|
|
204
111
|
};
|
|
205
|
-
async function
|
|
206
|
-
const { globalVar:
|
|
207
|
-
I() ? (await
|
|
208
|
-
() => globalThis[
|
|
209
|
-
r,
|
|
112
|
+
async function $(e, t = {}) {
|
|
113
|
+
const { globalVar: n, timeoutMs: r = 1e4, pollIntervalMs: o = 10 } = t;
|
|
114
|
+
I() ? (await z(e), n && await E(() => window[n], n, r, o)) : (await L(e), n && await E(
|
|
115
|
+
() => globalThis[n],
|
|
210
116
|
n,
|
|
117
|
+
r,
|
|
211
118
|
o
|
|
212
119
|
));
|
|
213
120
|
}
|
|
214
121
|
function I() {
|
|
215
122
|
return typeof window < "u" && typeof document < "u";
|
|
216
123
|
}
|
|
217
|
-
function
|
|
218
|
-
return new Promise((t,
|
|
219
|
-
const
|
|
220
|
-
|
|
124
|
+
function z(e) {
|
|
125
|
+
return new Promise((t, n) => {
|
|
126
|
+
const r = document.createElement("script");
|
|
127
|
+
r.src = e, r.async = !0;
|
|
221
128
|
const o = () => {
|
|
222
|
-
|
|
129
|
+
r.onload = null, r.onerror = null;
|
|
223
130
|
};
|
|
224
|
-
|
|
131
|
+
r.onload = () => {
|
|
225
132
|
o(), t();
|
|
226
|
-
},
|
|
227
|
-
o(),
|
|
228
|
-
}, document.head.appendChild(
|
|
133
|
+
}, r.onerror = () => {
|
|
134
|
+
o(), n(new Error(`Failed to load script: ${e}`));
|
|
135
|
+
}, document.head.appendChild(r);
|
|
229
136
|
});
|
|
230
137
|
}
|
|
231
|
-
async function
|
|
138
|
+
async function L(e) {
|
|
232
139
|
if (typeof fetch != "function")
|
|
233
140
|
throw new Error(
|
|
234
141
|
"loadAndWaitGlobal: fetch is not available. Use Node 18+ or provide a global fetch."
|
|
@@ -236,100 +143,86 @@ async function z(e) {
|
|
|
236
143
|
const t = await fetch(e);
|
|
237
144
|
if (!t.ok)
|
|
238
145
|
throw new Error(`Failed to load script in Node (HTTP ${t.status}): ${e}`);
|
|
239
|
-
const
|
|
240
|
-
globalThis.window = globalThis, (0, eval)(
|
|
146
|
+
const n = await t.text();
|
|
147
|
+
globalThis.window = globalThis, (0, eval)(n);
|
|
241
148
|
}
|
|
242
|
-
function
|
|
149
|
+
function E(e, t, n, r) {
|
|
243
150
|
return new Promise((o, a) => {
|
|
244
|
-
const s = Date.now(),
|
|
151
|
+
const s = Date.now(), c = () => {
|
|
245
152
|
try {
|
|
246
153
|
if (e() !== void 0)
|
|
247
|
-
return
|
|
154
|
+
return o();
|
|
248
155
|
} catch {
|
|
249
156
|
}
|
|
250
|
-
if (Date.now() - s >=
|
|
251
|
-
return
|
|
252
|
-
setTimeout(
|
|
157
|
+
if (Date.now() - s >= n)
|
|
158
|
+
return a(new Error(`Timed out after ${n} ms waiting for global "${t}"`));
|
|
159
|
+
setTimeout(c, r);
|
|
253
160
|
};
|
|
254
|
-
|
|
161
|
+
c();
|
|
255
162
|
});
|
|
256
163
|
}
|
|
257
|
-
const
|
|
258
|
-
schema: "legacy-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
return t.refCache.get(e);
|
|
264
|
-
const r = (async () => {
|
|
265
|
-
var E, C, _;
|
|
266
|
-
const a = w(e), s = `${a}version.js`;
|
|
164
|
+
const G = {
|
|
165
|
+
schema: "legacy-asset-urls",
|
|
166
|
+
resolveRef(e, t) {
|
|
167
|
+
return i("legacyAssetUrlsResolver resolveRef:", e), h(e, t.refCache, async () => {
|
|
168
|
+
var y, v;
|
|
169
|
+
const n = l(e), r = `${n}version.js`;
|
|
267
170
|
try {
|
|
268
|
-
await
|
|
171
|
+
await $(r, { globalVar: "__fpDataVersion", timeoutMs: 3e4 }), (y = t.importCallback) == null || y.call(t, r, "script");
|
|
269
172
|
} catch {
|
|
270
|
-
console.warn(`Could not load version.js at ${
|
|
173
|
+
console.warn(`Could not load version.js at ${r}, proceeding without it`);
|
|
271
174
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const p = await fetch(f);
|
|
278
|
-
if (p.ok)
|
|
279
|
-
h = await p.json();
|
|
280
|
-
else
|
|
281
|
-
throw new Error(`Could not load files.json from ${a}files.json?v=${i}`);
|
|
282
|
-
})(),
|
|
283
|
-
O(c, { globalVar: "__data" })
|
|
284
|
-
// injectAndWaitForGlobal(`${dataUrlBase}data.js?v=${version}`, '__data'),
|
|
285
|
-
// injectAndWaitForGlobal(`${dataUrlBase}fp.svg.js?v=${version}`, '__fp'),
|
|
286
|
-
]), (C = t.fetchCallback) == null || C.call(t, f, "json"), (_ = t.fetchCallback) == null || _.call(t, c, "script");
|
|
287
|
-
const u = globalThis.__data || {}, m = [...h, "data.js"].reduce((b, p) => (b[p] = { $ref: `asset+${a}${p}?v=${i}` }, b), {}), R = {
|
|
288
|
-
_to_remove_for_offline_to_work_dataUrlBase: a,
|
|
289
|
-
// dataFiles: dataFiles.reduce((map, file) => {
|
|
290
|
-
// map[file] = { $ref: `asset+${dataUrlBase}${file}?v=${version}` };
|
|
291
|
-
// return map;
|
|
292
|
-
// }, {} as Record<string, { $ref: string }>),
|
|
293
|
-
legacyAssetUrls: { ...m, ...H(a, u) }
|
|
294
|
-
};
|
|
295
|
-
return d(R), R;
|
|
296
|
-
})();
|
|
297
|
-
return (o = t.refCache) == null || o.set(e, r), r;
|
|
175
|
+
const o = globalThis.__fpDataVersion || (+/* @__PURE__ */ new Date()).toString(), a = `${n}files.json?v=${o}`, s = `${n}data.js?v=${o}`, c = f(a, t), j = $(s, { globalVar: "__data" });
|
|
176
|
+
(v = t.importCallback) == null || v.call(t, s, "script"), await Promise.all([c, j]);
|
|
177
|
+
const A = await c, M = globalThis.__data || {};
|
|
178
|
+
return { ...[...A, "data.js"].reduce((b, R) => (b[R] = { $ref: `asset+${n}${R}?v=${o}` }, b), {}), ...V(n, M) };
|
|
179
|
+
});
|
|
298
180
|
},
|
|
299
181
|
offlineMethod: "resolveRef"
|
|
300
182
|
};
|
|
301
|
-
function
|
|
302
|
-
const
|
|
303
|
-
function
|
|
304
|
-
typeof o == "string" && o.length > 0 &&
|
|
183
|
+
function V(e, t) {
|
|
184
|
+
const n = /* @__PURE__ */ new Set();
|
|
185
|
+
function r(o) {
|
|
186
|
+
typeof o == "string" && o.length > 0 && n.add(o);
|
|
305
187
|
}
|
|
306
|
-
return
|
|
188
|
+
return r(t.logo), t.exhibitors.forEach((o) => {
|
|
307
189
|
var a;
|
|
308
|
-
|
|
190
|
+
r(o.logo), (a = o.gallery) == null || a.forEach((s) => r(s));
|
|
309
191
|
}), t.events.forEach((o) => {
|
|
310
192
|
var a;
|
|
311
|
-
|
|
312
|
-
|
|
193
|
+
r(o.logoFile), (a = o.speakers) == null || a.forEach((s) => {
|
|
194
|
+
r(s.photoFile);
|
|
313
195
|
});
|
|
314
|
-
}), Array.from(
|
|
196
|
+
}), Array.from(n).reduce((o, a) => (o[a] = { $ref: `asset+${e}${a}` }, o), {});
|
|
315
197
|
}
|
|
316
|
-
const
|
|
198
|
+
const Z = {
|
|
199
|
+
schema: "legacy-data",
|
|
200
|
+
resolveRef(e, t) {
|
|
201
|
+
return i("legacyDataResolver resolveRef:", e), h(e, t.refCache, async () => {
|
|
202
|
+
const n = l(e);
|
|
203
|
+
return {
|
|
204
|
+
_to_remove_for_offline_to_work_dataUrlBase: n,
|
|
205
|
+
legacyAssetUrls: { $ref: `legacy-asset-urls+${n}` }
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
offlineMethod: "resolveRef"
|
|
210
|
+
}, H = [
|
|
211
|
+
P,
|
|
212
|
+
T,
|
|
213
|
+
U,
|
|
214
|
+
W,
|
|
317
215
|
S,
|
|
318
|
-
B,
|
|
319
216
|
D,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
!r || r.refCache === "global" ? n = V : (r == null ? void 0 : r.refCache) === "temp" ? n = /* @__PURE__ */ new Map() : (r == null ? void 0 : r.refCache) === "disable" ? n = void 0 : n = r == null ? void 0 : r.refCache;
|
|
330
|
-
const o = {
|
|
331
|
-
refCache: n,
|
|
332
|
-
fetchCallback: r == null ? void 0 : r.fetchCallback
|
|
217
|
+
Z,
|
|
218
|
+
G
|
|
219
|
+
], x = /* @__PURE__ */ new Map();
|
|
220
|
+
async function m(e, t, n) {
|
|
221
|
+
i("Resolving:", t, "of", e, n), typeof window < "u" && (window.__lastResolveObject = e);
|
|
222
|
+
const r = {
|
|
223
|
+
importCallback: n == null ? void 0 : n.importCallback,
|
|
224
|
+
refCache: (n == null ? void 0 : n.refCache) || x,
|
|
225
|
+
forceFetch: !!(n != null && n.forceFetch)
|
|
333
226
|
};
|
|
334
227
|
if (typeof t != "string")
|
|
335
228
|
throw new Error(`Invalid JSON Pointer (not a string): ${t}`);
|
|
@@ -337,145 +230,145 @@ async function $(e, t, r) {
|
|
|
337
230
|
throw new Error(`Invalid JSON Pointer: ${t}`);
|
|
338
231
|
if (t.length > 1 && t.endsWith("/"))
|
|
339
232
|
throw new Error(`Invalid JSON Pointer: ${t}`);
|
|
340
|
-
let
|
|
341
|
-
if (t === "/" ?
|
|
233
|
+
let o;
|
|
234
|
+
if (t === "/" ? o = [] : o = t.substring(1).split("/"), o.some((a) => a.length === 0))
|
|
342
235
|
throw new Error(`Invalid JSON Pointer (empty part): ${t}`);
|
|
343
|
-
if (
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
await
|
|
236
|
+
if (n != null && n.mutate) {
|
|
237
|
+
o.unshift("root");
|
|
238
|
+
const a = { root: e };
|
|
239
|
+
await O(a, o, 0, r), ee(e, a.root);
|
|
347
240
|
} else
|
|
348
|
-
return await
|
|
241
|
+
return await k(e, o, 0, r);
|
|
349
242
|
}
|
|
350
|
-
async function
|
|
351
|
-
const o = t[
|
|
352
|
-
if (await
|
|
243
|
+
async function O(e, t, n, r) {
|
|
244
|
+
const o = t[n];
|
|
245
|
+
if (await K(e, o, r), n != t.length - 1) {
|
|
353
246
|
if (e[o] === null || typeof e[o] != "object")
|
|
354
247
|
throw new Error(
|
|
355
|
-
`Cannot resolve path, encountered non-object at part '${t.slice(1).join("/")}', index ${
|
|
248
|
+
`Cannot resolve path, encountered non-object at part '${t.slice(1).join("/")}', index ${n - 1}'`
|
|
356
249
|
);
|
|
357
|
-
return await
|
|
250
|
+
return await O(e[o], t, n + 1, r);
|
|
358
251
|
}
|
|
359
252
|
}
|
|
360
|
-
async function
|
|
361
|
-
|
|
362
|
-
let
|
|
363
|
-
const o = await
|
|
253
|
+
async function K(e, t, n) {
|
|
254
|
+
i("resolveObjectMutate:", e, t);
|
|
255
|
+
let r = e[t];
|
|
256
|
+
const o = await p(r, n);
|
|
364
257
|
o !== void 0 && (e[t] = o);
|
|
365
258
|
}
|
|
366
|
-
async function
|
|
367
|
-
if (
|
|
368
|
-
return await
|
|
259
|
+
async function k(e, t, n, r) {
|
|
260
|
+
if (n === t.length)
|
|
261
|
+
return await p(e, r);
|
|
369
262
|
if (e === null || typeof e != "object")
|
|
370
263
|
throw new Error(
|
|
371
|
-
`Cannot resolve path, encountered non-object at part '${t.join("/")}', index ${
|
|
264
|
+
`Cannot resolve path, encountered non-object at part '${t.join("/")}', index ${n}'`
|
|
372
265
|
);
|
|
373
|
-
const o = t[
|
|
266
|
+
const o = t[n];
|
|
374
267
|
let a = e[o];
|
|
375
|
-
return a === void 0 && (a = (await
|
|
268
|
+
return a === void 0 && (a = (await p(e, r))[o]), await k(a, t, n + 1, r);
|
|
376
269
|
}
|
|
377
|
-
async function
|
|
378
|
-
|
|
379
|
-
let
|
|
270
|
+
async function p(e, t) {
|
|
271
|
+
i("resolveObject:", e);
|
|
272
|
+
let n = e;
|
|
380
273
|
do {
|
|
381
|
-
if (typeof
|
|
382
|
-
return
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
if (
|
|
386
|
-
throw new Error(`No resolver found for ref: ${
|
|
387
|
-
return
|
|
274
|
+
if (typeof n != "object" || n === null || !("$ref" in n))
|
|
275
|
+
return n;
|
|
276
|
+
const r = H.filter((a) => F(a, n.$ref));
|
|
277
|
+
if (r.length === 0) {
|
|
278
|
+
if (n.$ref)
|
|
279
|
+
throw new Error(`No resolver found for ref: ${n.$ref}`);
|
|
280
|
+
return u(n), n;
|
|
388
281
|
}
|
|
389
|
-
if (
|
|
390
|
-
throw new Error(`Multiple resolvers can resolve ref: ${
|
|
391
|
-
const o = await
|
|
392
|
-
|
|
282
|
+
if (r.length > 1)
|
|
283
|
+
throw new Error(`Multiple resolvers can resolve ref: ${n.$ref}`);
|
|
284
|
+
const o = await q(r[0], n.$ref, t);
|
|
285
|
+
n = Y(o, n);
|
|
393
286
|
} while (!0);
|
|
394
287
|
}
|
|
395
|
-
async function
|
|
396
|
-
if (!
|
|
288
|
+
async function q(e, t, n) {
|
|
289
|
+
if (!F(e, t))
|
|
397
290
|
throw new Error(`Unexpected ref: ${t}`);
|
|
398
|
-
return e.resolveRef(t,
|
|
291
|
+
return e.resolveRef(t, n);
|
|
399
292
|
}
|
|
400
|
-
function
|
|
293
|
+
function F(e, t) {
|
|
401
294
|
if (e.canResolve)
|
|
402
295
|
return e.canResolve(t);
|
|
403
296
|
if (e.schema)
|
|
404
|
-
return
|
|
297
|
+
return Q(t, e.schema);
|
|
405
298
|
throw new Error("Resolver is missing canResolve method and schema property");
|
|
406
299
|
}
|
|
407
|
-
function
|
|
408
|
-
const
|
|
409
|
-
for (const
|
|
410
|
-
if (e.startsWith(
|
|
300
|
+
function Q(e, t) {
|
|
301
|
+
const n = [`${t}+`, `${t}:`];
|
|
302
|
+
for (const r of n)
|
|
303
|
+
if (e.startsWith(r))
|
|
411
304
|
return !0;
|
|
412
305
|
return !1;
|
|
413
306
|
}
|
|
414
|
-
function
|
|
307
|
+
function l(e) {
|
|
415
308
|
if (e.startsWith("http://") || e.startsWith("https://"))
|
|
416
309
|
return e;
|
|
417
|
-
const t = e.indexOf("+http://"),
|
|
310
|
+
const t = e.indexOf("+http://"), n = e.indexOf("+https://");
|
|
418
311
|
if (t !== -1)
|
|
419
312
|
return e.substring(t + 1);
|
|
420
|
-
if (r !== -1)
|
|
421
|
-
return e.substring(r + 1);
|
|
422
|
-
const n = e.indexOf(":");
|
|
423
313
|
if (n !== -1)
|
|
424
314
|
return e.substring(n + 1);
|
|
315
|
+
const r = e.indexOf(":");
|
|
316
|
+
if (r !== -1)
|
|
317
|
+
return e.substring(r + 1);
|
|
425
318
|
throw new Error(`Error getting URL from: ${e}, no valid prefix found`);
|
|
426
319
|
}
|
|
427
|
-
typeof window < "u" && (window.__debugResolve = async function(t,
|
|
320
|
+
typeof window < "u" && (window.__debugResolve = async function(t, n, r) {
|
|
428
321
|
let o, a, s;
|
|
429
|
-
return typeof t == "string" ? (o = window.__lastResolveObject, a = t, s =
|
|
322
|
+
return typeof t == "string" ? (o = window.__lastResolveObject, a = t, s = n) : (o = t, a = n, s = r), await m(o, a, s);
|
|
430
323
|
});
|
|
431
|
-
function
|
|
432
|
-
return async (t, ...
|
|
324
|
+
function w(e) {
|
|
325
|
+
return async (t, ...n) => {
|
|
433
326
|
try {
|
|
434
|
-
const a = (await import(await
|
|
435
|
-
return a(t, ...
|
|
436
|
-
} catch (
|
|
437
|
-
throw console.error("efp-loader", `Error when trying to import and call "${e}":`,
|
|
327
|
+
const a = (await import(await m(t, "/runtime/entry")))[e];
|
|
328
|
+
return a(t, ...n);
|
|
329
|
+
} catch (r) {
|
|
330
|
+
throw console.error("efp-loader", `Error when trying to import and call "${e}":`, r), r;
|
|
438
331
|
}
|
|
439
332
|
};
|
|
440
333
|
}
|
|
441
|
-
function
|
|
334
|
+
function i(...e) {
|
|
442
335
|
globalThis.__EFP_LOADER_DEBUG__ && console.debug("efp-loader", ...e);
|
|
443
336
|
}
|
|
444
|
-
function
|
|
337
|
+
function u(e) {
|
|
445
338
|
if (e === null || typeof e != "object") return e;
|
|
446
339
|
Object.freeze(e);
|
|
447
340
|
for (const t of Object.keys(e)) {
|
|
448
|
-
const
|
|
449
|
-
typeof
|
|
341
|
+
const n = e[t];
|
|
342
|
+
typeof n == "object" && n !== null && !Object.isFrozen(n) && u(n);
|
|
450
343
|
}
|
|
451
344
|
return e;
|
|
452
345
|
}
|
|
453
|
-
function
|
|
346
|
+
function _(e) {
|
|
454
347
|
return "structuredClone" in globalThis ? globalThis.structuredClone(e) : JSON.parse(JSON.stringify(e));
|
|
455
348
|
}
|
|
456
|
-
function
|
|
349
|
+
function X(e) {
|
|
457
350
|
if (typeof document > "u") return;
|
|
458
351
|
const t = document.createElement("link");
|
|
459
352
|
t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
|
|
460
353
|
}
|
|
461
|
-
function
|
|
354
|
+
function Y(e, t) {
|
|
462
355
|
if (e === t) return;
|
|
463
356
|
if (t === null || typeof t != "object")
|
|
464
357
|
throw new Error("Cannot merge non-object source");
|
|
465
358
|
if (Array.isArray(t))
|
|
466
359
|
throw new Error("Cannot merge arrays");
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
360
|
+
const n = Object.keys(t).filter((o) => o !== "$ref");
|
|
361
|
+
if (n.length === 0) return _(e);
|
|
469
362
|
if (Array.isArray(e))
|
|
470
363
|
throw new Error("Cannot merge into arrays");
|
|
471
364
|
if (e === null || typeof e != "object")
|
|
472
365
|
throw new Error("Cannot merge into non-object target");
|
|
473
|
-
const
|
|
474
|
-
for (const o of
|
|
475
|
-
|
|
476
|
-
return
|
|
366
|
+
const r = _({ ...e });
|
|
367
|
+
for (const o of n)
|
|
368
|
+
r[o] = t[o];
|
|
369
|
+
return r;
|
|
477
370
|
}
|
|
478
|
-
function
|
|
371
|
+
function ee(e, t) {
|
|
479
372
|
if (e !== t) {
|
|
480
373
|
if (t === null || typeof t != "object")
|
|
481
374
|
throw new Error("Cannot replace with non-object source");
|
|
@@ -485,58 +378,57 @@ function Y(e, t) {
|
|
|
485
378
|
if (!Array.isArray(t))
|
|
486
379
|
throw new Error("replaceObjectFields does not support mixing arrays and objects");
|
|
487
380
|
e.length = 0;
|
|
488
|
-
for (const
|
|
489
|
-
e.push(
|
|
381
|
+
for (const n of t)
|
|
382
|
+
e.push(n);
|
|
490
383
|
return;
|
|
491
384
|
}
|
|
492
|
-
for (const
|
|
493
|
-
|
|
494
|
-
for (const
|
|
495
|
-
e[
|
|
385
|
+
for (const n of Object.keys(e))
|
|
386
|
+
n in t || delete e[n];
|
|
387
|
+
for (const n of Object.keys(t))
|
|
388
|
+
e[n] = t[n];
|
|
496
389
|
}
|
|
497
390
|
}
|
|
498
|
-
async function
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
await $(e, n, r);
|
|
391
|
+
async function te(e, t, n) {
|
|
392
|
+
n = n || {};
|
|
393
|
+
for (const r of t)
|
|
394
|
+
await m(e, r, { ...n, mutate: !0 });
|
|
503
395
|
}
|
|
504
|
-
typeof window < "u" && (window.__debugMutateManifest =
|
|
505
|
-
async function
|
|
506
|
-
const { makeOfflineBundle: t } = await import("./makeOfflineBundle-
|
|
396
|
+
typeof window < "u" && (window.__debugMutateManifest = te);
|
|
397
|
+
async function ne(e) {
|
|
398
|
+
const { makeOfflineBundle: t } = await import("./makeOfflineBundle-g0Y3sA2l.js");
|
|
507
399
|
return await t(e);
|
|
508
400
|
}
|
|
509
|
-
async function
|
|
510
|
-
const { downloadZip: t } = await import("./downloadZip-
|
|
401
|
+
async function re(e) {
|
|
402
|
+
const { downloadZip: t } = await import("./downloadZip-DMgeO3fU.js");
|
|
511
403
|
return await t(e);
|
|
512
404
|
}
|
|
513
|
-
async function
|
|
514
|
-
const { makeOffline: t } = await import("./makeOffline-
|
|
515
|
-
for await (const
|
|
516
|
-
"data" in
|
|
517
|
-
console.info("Offline data: ",
|
|
405
|
+
async function oe(e) {
|
|
406
|
+
const { makeOffline: t } = await import("./makeOffline-1iGrM4gF.js"), n = await t(e);
|
|
407
|
+
for await (const r of (await n).files)
|
|
408
|
+
"data" in r ? console.info(`🗳️ Put ${r.targetFilePath} <=`, r.data) : "url" in r && console.info(`🗳️ Download ${r.targetFilePath} <= ${r.url}`);
|
|
409
|
+
console.info("Offline data: ", n.manifest);
|
|
518
410
|
}
|
|
519
|
-
typeof window < "u" && (window.__debugDownloadZip =
|
|
520
|
-
const
|
|
521
|
-
async function
|
|
522
|
-
return await
|
|
411
|
+
typeof window < "u" && (window.__debugDownloadZip = re, window.__debugMakeOfflineBundle = ne, window.__debugLogOfflineManifestFiles = oe);
|
|
412
|
+
const ie = w("mount"), le = w("load"), ce = w("initialize");
|
|
413
|
+
async function fe(e, t, ...n) {
|
|
414
|
+
return await w(e)(t, ...n);
|
|
523
415
|
}
|
|
524
|
-
|
|
416
|
+
X("https://efp-runtime.expofp.com/");
|
|
525
417
|
export {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
l,
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
418
|
+
Y as a,
|
|
419
|
+
q as b,
|
|
420
|
+
F as c,
|
|
421
|
+
fe as callFunction_Experimental,
|
|
422
|
+
_ as d,
|
|
423
|
+
re as downloadZip,
|
|
424
|
+
ce as initialize,
|
|
425
|
+
i as l,
|
|
426
|
+
le as load,
|
|
427
|
+
ne as makeOfflineBundle,
|
|
428
|
+
ie as mount,
|
|
429
|
+
te as mutateManifest,
|
|
430
|
+
l as p,
|
|
431
|
+
H as r,
|
|
432
|
+
m as resolve
|
|
541
433
|
};
|
|
542
434
|
//# sourceMappingURL=index.js.map
|