@magiclabs.ai/magicbook-client 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/design-request.d.ts +1 -1
- package/index.d.ts +1 -0
- package/magicbook-client.js +143 -138
- package/magicbook-client.umd.cjs +3 -3
- package/models/design-request/image.d.ts +1 -0
- package/package.json +1 -1
package/data/design-request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const states: readonly ["new", "ingesting", "submitted", "
|
|
1
|
+
export declare const states: readonly ["new", "ingesting", "submitted", "storyboarding", "storyboarding succeeded", "designing", "designing succeeded", "layouting", "layouting succeeded", "embellishing", "embellishing succeeded", "polishing", "polishing succeeded", "ready", "error"];
|
|
2
2
|
export declare const occasions: readonly ["baby", "birthday", "default", "everyday", "family", "kids", "life-stories", "portfolio", "school-memories", "seasonal-holidays", "special-celebrations", "sports-and-hobbies", "travel", "wedding", "year-in-review"];
|
|
3
3
|
export declare const styles: {
|
|
4
4
|
1005: {
|
package/index.d.ts
CHANGED
package/magicbook-client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (e, t, s) => (
|
|
4
|
-
function
|
|
1
|
+
var Ve = Object.defineProperty;
|
|
2
|
+
var We = (e, t, s) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var h = (e, t, s) => (We(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
+
function Ge(e, t, s) {
|
|
5
5
|
const n = t.pop() || "", r = t.reduce(
|
|
6
6
|
(o, i) => o[i] = o[i] || {},
|
|
7
7
|
e
|
|
@@ -13,25 +13,25 @@ function Se(e, t) {
|
|
|
13
13
|
typeof e[s] == "object" && typeof t[s] == "object" ? Se(e[s], t[s]) : e[s] = t[s];
|
|
14
14
|
}), e;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Xe(e) {
|
|
17
17
|
return e.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Oe(e) {
|
|
20
20
|
return Object.keys(e).map((t) => {
|
|
21
|
-
const s =
|
|
22
|
-
s.includes("_") && (e[s] = e[t], delete e[t]);
|
|
21
|
+
const s = Xe(t);
|
|
22
|
+
s.includes("_") && (e[s] = e[t], delete e[t]), typeof e[s] == "object" && (e[s] = Oe(e[s]));
|
|
23
23
|
}), e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Qe(e) {
|
|
26
26
|
return e.replace(/([-_][a-z])/g, (t) => t.toUpperCase().replace("-", "").replace("_", ""));
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Ae(e) {
|
|
29
29
|
return Object.keys(e).map((t) => {
|
|
30
|
-
const s =
|
|
31
|
-
s !== t && (e[s] = e[t], delete e[t]);
|
|
30
|
+
const s = Qe(t);
|
|
31
|
+
s !== t && (e[s] = e[t], delete e[t]), typeof e[s] == "object" && (e[s] = Ae(e[s]));
|
|
32
32
|
}), e;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Te(e, t) {
|
|
35
35
|
return function() {
|
|
36
36
|
return e.apply(t, arguments);
|
|
37
37
|
};
|
|
@@ -43,12 +43,12 @@ const { toString: Ze } = Object.prototype, { getPrototypeOf: ne } = Object, M =
|
|
|
43
43
|
function Ye(e) {
|
|
44
44
|
return e !== null && !B(e) && e.constructor !== null && !B(e.constructor) && E(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const xe = A("ArrayBuffer");
|
|
47
47
|
function qe(e) {
|
|
48
48
|
let t;
|
|
49
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
49
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && xe(e.buffer), t;
|
|
50
50
|
}
|
|
51
|
-
const et = $("string"), E = $("function"),
|
|
51
|
+
const et = $("string"), E = $("function"), ke = $("number"), J = (e) => e !== null && typeof e == "object", tt = (e) => e === !0 || e === !1, I = (e) => {
|
|
52
52
|
if (M(e) !== "object")
|
|
53
53
|
return !1;
|
|
54
54
|
const t = ne(e);
|
|
@@ -72,7 +72,7 @@ function D(e, t, { allOwnKeys: s = !1 } = {}) {
|
|
|
72
72
|
c = o[n], t.call(null, e[c], c, e);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ve(e, t) {
|
|
76
76
|
t = t.toLowerCase();
|
|
77
77
|
const s = Object.keys(e);
|
|
78
78
|
let n = s.length, r;
|
|
@@ -81,10 +81,10 @@ function ke(e, t) {
|
|
|
81
81
|
return r;
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const _e = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), Ne = (e) => !B(e) && e !== _e;
|
|
85
85
|
function q() {
|
|
86
|
-
const { caseless: e } =
|
|
87
|
-
const o = e &&
|
|
86
|
+
const { caseless: e } = Ne(this) && this || {}, t = {}, s = (n, r) => {
|
|
87
|
+
const o = e && ve(t, r) || r;
|
|
88
88
|
I(t[o]) && I(n) ? t[o] = q(t[o], n) : I(n) ? t[o] = q({}, n) : N(n) ? t[o] = n.slice() : t[o] = n;
|
|
89
89
|
};
|
|
90
90
|
for (let n = 0, r = arguments.length; n < r; n++)
|
|
@@ -92,7 +92,7 @@ function q() {
|
|
|
92
92
|
return t;
|
|
93
93
|
}
|
|
94
94
|
const ut = (e, t, s, { allOwnKeys: n } = {}) => (D(t, (r, o) => {
|
|
95
|
-
s && E(r) ? e[o] =
|
|
95
|
+
s && E(r) ? e[o] = Te(r, s) : e[o] = r;
|
|
96
96
|
}, { allOwnKeys: n }), e), ft = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), dt = (e, t, s, n) => {
|
|
97
97
|
e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
98
98
|
value: t.prototype
|
|
@@ -118,7 +118,7 @@ const ut = (e, t, s, { allOwnKeys: n } = {}) => (D(t, (r, o) => {
|
|
|
118
118
|
if (N(e))
|
|
119
119
|
return e;
|
|
120
120
|
let t = e.length;
|
|
121
|
-
if (!
|
|
121
|
+
if (!ke(t))
|
|
122
122
|
return null;
|
|
123
123
|
const s = new Array(t);
|
|
124
124
|
for (; t-- > 0; )
|
|
@@ -142,13 +142,13 @@ const ut = (e, t, s, { allOwnKeys: n } = {}) => (D(t, (r, o) => {
|
|
|
142
142
|
function(s, n, r) {
|
|
143
143
|
return n.toUpperCase() + r;
|
|
144
144
|
}
|
|
145
|
-
), fe = (({ hasOwnProperty: e }) => (t, s) => e.call(t, s))(Object.prototype), St = A("RegExp"),
|
|
145
|
+
), fe = (({ hasOwnProperty: e }) => (t, s) => e.call(t, s))(Object.prototype), St = A("RegExp"), Re = (e, t) => {
|
|
146
146
|
const s = Object.getOwnPropertyDescriptors(e), n = {};
|
|
147
147
|
D(s, (r, o) => {
|
|
148
148
|
t(r, o, e) !== !1 && (n[o] = r);
|
|
149
149
|
}), Object.defineProperties(e, n);
|
|
150
150
|
}, Ot = (e) => {
|
|
151
|
-
|
|
151
|
+
Re(e, (t, s) => {
|
|
152
152
|
if (E(e) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
|
|
153
153
|
return !1;
|
|
154
154
|
const n = e[s];
|
|
@@ -170,11 +170,11 @@ const ut = (e, t, s, { allOwnKeys: n } = {}) => (D(t, (r, o) => {
|
|
|
170
170
|
};
|
|
171
171
|
return N(e) ? n(e) : n(String(e).split(t)), s;
|
|
172
172
|
}, Tt = () => {
|
|
173
|
-
},
|
|
173
|
+
}, xt = (e, t) => (e = +e, Number.isFinite(e) ? e : t), X = "abcdefghijklmnopqrstuvwxyz", de = "0123456789", Ce = {
|
|
174
174
|
DIGIT: de,
|
|
175
175
|
ALPHA: X,
|
|
176
176
|
ALPHA_DIGIT: X + X.toUpperCase() + de
|
|
177
|
-
},
|
|
177
|
+
}, kt = (e = 16, t = Ce.ALPHA_DIGIT) => {
|
|
178
178
|
let s = "";
|
|
179
179
|
const { length: n } = t;
|
|
180
180
|
for (; e--; )
|
|
@@ -201,14 +201,14 @@ const _t = (e) => {
|
|
|
201
201
|
return n;
|
|
202
202
|
};
|
|
203
203
|
return s(e, 0);
|
|
204
|
-
}, Nt = A("AsyncFunction"),
|
|
204
|
+
}, Nt = A("AsyncFunction"), Rt = (e) => e && (J(e) || E(e)) && E(e.then) && E(e.catch), a = {
|
|
205
205
|
isArray: N,
|
|
206
|
-
isArrayBuffer:
|
|
206
|
+
isArrayBuffer: xe,
|
|
207
207
|
isBuffer: Ye,
|
|
208
208
|
isFormData: at,
|
|
209
209
|
isArrayBufferView: qe,
|
|
210
210
|
isString: et,
|
|
211
|
-
isNumber:
|
|
211
|
+
isNumber: ke,
|
|
212
212
|
isBoolean: tt,
|
|
213
213
|
isObject: J,
|
|
214
214
|
isPlainObject: I,
|
|
@@ -239,21 +239,21 @@ const _t = (e) => {
|
|
|
239
239
|
hasOwnProperty: fe,
|
|
240
240
|
hasOwnProp: fe,
|
|
241
241
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
242
|
-
reduceDescriptors:
|
|
242
|
+
reduceDescriptors: Re,
|
|
243
243
|
freezeMethods: Ot,
|
|
244
244
|
toObjectSet: At,
|
|
245
245
|
toCamelCase: Et,
|
|
246
246
|
noop: Tt,
|
|
247
|
-
toFiniteNumber:
|
|
248
|
-
findKey:
|
|
249
|
-
global:
|
|
250
|
-
isContextDefined:
|
|
251
|
-
ALPHABET:
|
|
252
|
-
generateString:
|
|
247
|
+
toFiniteNumber: xt,
|
|
248
|
+
findKey: ve,
|
|
249
|
+
global: _e,
|
|
250
|
+
isContextDefined: Ne,
|
|
251
|
+
ALPHABET: Ce,
|
|
252
|
+
generateString: kt,
|
|
253
253
|
isSpecCompliantForm: vt,
|
|
254
254
|
toJSONObject: _t,
|
|
255
255
|
isAsyncFn: Nt,
|
|
256
|
-
isThenable:
|
|
256
|
+
isThenable: Rt
|
|
257
257
|
};
|
|
258
258
|
function p(e, t, s, n, r) {
|
|
259
259
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), s && (this.config = s), n && (this.request = n), r && (this.response = r);
|
|
@@ -279,7 +279,7 @@ a.inherits(p, Error, {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
const
|
|
282
|
+
const Fe = p.prototype, Be = {};
|
|
283
283
|
[
|
|
284
284
|
"ERR_BAD_OPTION_VALUE",
|
|
285
285
|
"ERR_BAD_OPTION",
|
|
@@ -295,26 +295,26 @@ const Ce = p.prototype, Re = {};
|
|
|
295
295
|
"ERR_INVALID_URL"
|
|
296
296
|
// eslint-disable-next-line func-names
|
|
297
297
|
].forEach((e) => {
|
|
298
|
-
|
|
298
|
+
Be[e] = { value: e };
|
|
299
299
|
});
|
|
300
|
-
Object.defineProperties(p,
|
|
301
|
-
Object.defineProperty(
|
|
300
|
+
Object.defineProperties(p, Be);
|
|
301
|
+
Object.defineProperty(Fe, "isAxiosError", { value: !0 });
|
|
302
302
|
p.from = (e, t, s, n, r, o) => {
|
|
303
|
-
const i = Object.create(
|
|
303
|
+
const i = Object.create(Fe);
|
|
304
304
|
return a.toFlatObject(e, i, function(d) {
|
|
305
305
|
return d !== Error.prototype;
|
|
306
306
|
}, (c) => c !== "isAxiosError"), p.call(i, e.message, t, s, n, r), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
|
|
307
307
|
};
|
|
308
|
-
const
|
|
308
|
+
const Ct = null;
|
|
309
309
|
function ee(e) {
|
|
310
310
|
return a.isPlainObject(e) || a.isArray(e);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function De(e) {
|
|
313
313
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
314
314
|
}
|
|
315
315
|
function ye(e, t, s) {
|
|
316
316
|
return e ? e.concat(t).map(function(r, o) {
|
|
317
|
-
return r =
|
|
317
|
+
return r = De(r), !s && o ? "[" + r + "]" : r;
|
|
318
318
|
}).join(s ? "." : "") : t;
|
|
319
319
|
}
|
|
320
320
|
function Ft(e) {
|
|
@@ -351,10 +351,10 @@ function K(e, t, s) {
|
|
|
351
351
|
if (a.endsWith(m, "{}"))
|
|
352
352
|
m = n ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
353
353
|
else if (a.isArray(f) && Ft(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (S = a.toArray(f)))
|
|
354
|
-
return m =
|
|
354
|
+
return m = De(m), S.forEach(function(U, Ke) {
|
|
355
355
|
!(a.isUndefined(U) || U === null) && t.append(
|
|
356
356
|
// eslint-disable-next-line no-nested-ternary
|
|
357
|
-
i === !0 ? ye([m],
|
|
357
|
+
i === !0 ? ye([m], Ke, o) : i === null ? m : m + "[]",
|
|
358
358
|
l(U)
|
|
359
359
|
);
|
|
360
360
|
}), !1;
|
|
@@ -402,11 +402,11 @@ function he(e) {
|
|
|
402
402
|
function re(e, t) {
|
|
403
403
|
this._pairs = [], e && K(e, this, t);
|
|
404
404
|
}
|
|
405
|
-
const
|
|
406
|
-
|
|
405
|
+
const Le = re.prototype;
|
|
406
|
+
Le.append = function(t, s) {
|
|
407
407
|
this._pairs.push([t, s]);
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
Le.toString = function(t) {
|
|
410
410
|
const s = t ? function(n) {
|
|
411
411
|
return t.call(this, n, he);
|
|
412
412
|
} : he;
|
|
@@ -417,7 +417,7 @@ Be.toString = function(t) {
|
|
|
417
417
|
function Dt(e) {
|
|
418
418
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Ue(e, t, s) {
|
|
421
421
|
if (!t)
|
|
422
422
|
return e;
|
|
423
423
|
const n = s && s.encode || Dt, r = s && s.serialize;
|
|
@@ -482,11 +482,11 @@ class Lt {
|
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
const me = Lt,
|
|
485
|
+
const me = Lt, Ie = {
|
|
486
486
|
silentJSONParsing: !0,
|
|
487
487
|
forcedJSONParsing: !0,
|
|
488
488
|
clarifyTimeoutError: !1
|
|
489
|
-
}, Ut = typeof URLSearchParams < "u" ? URLSearchParams : re, It = typeof FormData < "u" ? FormData : null,
|
|
489
|
+
}, Ut = typeof URLSearchParams < "u" ? URLSearchParams : re, It = typeof FormData < "u" ? FormData : null, Pt = typeof Blob < "u" ? Blob : null, jt = (() => {
|
|
490
490
|
let e;
|
|
491
491
|
return typeof navigator < "u" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
492
492
|
})(), zt = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
@@ -495,9 +495,9 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(),
|
|
|
495
495
|
classes: {
|
|
496
496
|
URLSearchParams: Ut,
|
|
497
497
|
FormData: It,
|
|
498
|
-
Blob:
|
|
498
|
+
Blob: Pt
|
|
499
499
|
},
|
|
500
|
-
isStandardBrowserEnv:
|
|
500
|
+
isStandardBrowserEnv: jt,
|
|
501
501
|
isStandardBrowserWebWorkerEnv: zt,
|
|
502
502
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
503
503
|
};
|
|
@@ -520,7 +520,7 @@ function $t(e) {
|
|
|
520
520
|
o = s[n], t[o] = e[o];
|
|
521
521
|
return t;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Pe(e) {
|
|
524
524
|
function t(s, n, r, o) {
|
|
525
525
|
let i = s[o++];
|
|
526
526
|
const c = Number.isFinite(+i), d = o >= s.length;
|
|
@@ -548,12 +548,12 @@ function Kt(e, t, s) {
|
|
|
548
548
|
return (s || JSON.stringify)(e);
|
|
549
549
|
}
|
|
550
550
|
const V = {
|
|
551
|
-
transitional:
|
|
551
|
+
transitional: Ie,
|
|
552
552
|
adapter: ["xhr", "http"],
|
|
553
553
|
transformRequest: [function(t, s) {
|
|
554
554
|
const n = s.getContentType() || "", r = n.indexOf("application/json") > -1, o = a.isObject(t);
|
|
555
555
|
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
556
|
-
return r && r ? JSON.stringify(
|
|
556
|
+
return r && r ? JSON.stringify(Pe(t)) : t;
|
|
557
557
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
|
|
558
558
|
return t;
|
|
559
559
|
if (a.isArrayBufferView(t))
|
|
@@ -645,8 +645,8 @@ const oe = V, Vt = a.toObjectSet([
|
|
|
645
645
|
function F(e) {
|
|
646
646
|
return e && String(e).trim().toLowerCase();
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
648
|
+
function P(e) {
|
|
649
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(P) : String(e);
|
|
650
650
|
}
|
|
651
651
|
function Gt(e) {
|
|
652
652
|
const t = /* @__PURE__ */ Object.create(null), s = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -691,7 +691,7 @@ class W {
|
|
|
691
691
|
if (!u)
|
|
692
692
|
throw new Error("header name must be a non-empty string");
|
|
693
693
|
const y = a.findKey(r, u);
|
|
694
|
-
(!y || r[y] === void 0 || l === !0 || l === void 0 && r[y] !== !1) && (r[y || d] =
|
|
694
|
+
(!y || r[y] === void 0 || l === !0 || l === void 0 && r[y] !== !1) && (r[y || d] = P(c));
|
|
695
695
|
}
|
|
696
696
|
const i = (c, d) => a.forEach(c, (l, u) => o(l, u, d));
|
|
697
697
|
return a.isPlainObject(t) || t instanceof this.constructor ? i(t, s) : a.isString(t) && (t = t.trim()) && !Xt(t) ? i(Wt(t), s) : t != null && o(s, t, n), this;
|
|
@@ -745,11 +745,11 @@ class W {
|
|
|
745
745
|
return a.forEach(this, (r, o) => {
|
|
746
746
|
const i = a.findKey(n, o);
|
|
747
747
|
if (i) {
|
|
748
|
-
s[i] =
|
|
748
|
+
s[i] = P(r), delete s[o];
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
751
|
const c = t ? Qt(o) : String(o).trim();
|
|
752
|
-
c !== o && delete s[o], s[c] =
|
|
752
|
+
c !== o && delete s[o], s[c] = P(r), n[c] = !0;
|
|
753
753
|
}), this;
|
|
754
754
|
}
|
|
755
755
|
concat(...t) {
|
|
@@ -792,15 +792,15 @@ class W {
|
|
|
792
792
|
W.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
793
793
|
a.freezeMethods(W.prototype);
|
|
794
794
|
a.freezeMethods(W);
|
|
795
|
-
const
|
|
795
|
+
const x = W;
|
|
796
796
|
function Z(e, t) {
|
|
797
|
-
const s = this || oe, n = t || s, r =
|
|
797
|
+
const s = this || oe, n = t || s, r = x.from(n.headers);
|
|
798
798
|
let o = n.data;
|
|
799
799
|
return a.forEach(e, function(c) {
|
|
800
800
|
o = c.call(s, o, r.normalize(), t ? t.status : void 0);
|
|
801
801
|
}), r.normalize(), o;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function je(e) {
|
|
804
804
|
return !!(e && e.__CANCEL__);
|
|
805
805
|
}
|
|
806
806
|
function L(e, t, s) {
|
|
@@ -856,7 +856,7 @@ function es(e) {
|
|
|
856
856
|
function ts(e, t) {
|
|
857
857
|
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
858
858
|
}
|
|
859
|
-
function
|
|
859
|
+
function ze(e, t) {
|
|
860
860
|
return e && !es(t) ? ts(e, t) : t;
|
|
861
861
|
}
|
|
862
862
|
const ss = O.isStandardBrowserEnv ? (
|
|
@@ -932,7 +932,7 @@ function ge(e, t) {
|
|
|
932
932
|
const os = typeof XMLHttpRequest < "u", is = os && function(e) {
|
|
933
933
|
return new Promise(function(s, n) {
|
|
934
934
|
let r = e.data;
|
|
935
|
-
const o =
|
|
935
|
+
const o = x.from(e.headers).normalize(), i = e.responseType;
|
|
936
936
|
let c;
|
|
937
937
|
function d() {
|
|
938
938
|
e.cancelToken && e.cancelToken.unsubscribe(c), e.signal && e.signal.removeEventListener("abort", c);
|
|
@@ -943,12 +943,12 @@ const os = typeof XMLHttpRequest < "u", is = os && function(e) {
|
|
|
943
943
|
const g = e.auth.username || "", f = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
944
944
|
o.set("Authorization", "Basic " + btoa(g + ":" + f));
|
|
945
945
|
}
|
|
946
|
-
const u =
|
|
947
|
-
l.open(e.method.toUpperCase(),
|
|
946
|
+
const u = ze(e.baseURL, e.url);
|
|
947
|
+
l.open(e.method.toUpperCase(), Ue(u, e.params, e.paramsSerializer), !0), l.timeout = e.timeout;
|
|
948
948
|
function y() {
|
|
949
949
|
if (!l)
|
|
950
950
|
return;
|
|
951
|
-
const g =
|
|
951
|
+
const g = x.from(
|
|
952
952
|
"getAllResponseHeaders" in l && l.getAllResponseHeaders()
|
|
953
953
|
), m = {
|
|
954
954
|
data: !i || i === "text" || i === "json" ? l.responseText : l.response,
|
|
@@ -972,7 +972,7 @@ const os = typeof XMLHttpRequest < "u", is = os && function(e) {
|
|
|
972
972
|
n(new p("Network Error", p.ERR_NETWORK, e, l)), l = null;
|
|
973
973
|
}, l.ontimeout = function() {
|
|
974
974
|
let f = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
|
|
975
|
-
const m = e.transitional ||
|
|
975
|
+
const m = e.transitional || Ie;
|
|
976
976
|
e.timeoutErrorMessage && (f = e.timeoutErrorMessage), n(new p(
|
|
977
977
|
f,
|
|
978
978
|
m.clarifyTimeoutError ? p.ETIMEDOUT : p.ECONNABORTED,
|
|
@@ -995,11 +995,11 @@ const os = typeof XMLHttpRequest < "u", is = os && function(e) {
|
|
|
995
995
|
}
|
|
996
996
|
l.send(r || null);
|
|
997
997
|
});
|
|
998
|
-
},
|
|
999
|
-
http:
|
|
998
|
+
}, j = {
|
|
999
|
+
http: Ct,
|
|
1000
1000
|
xhr: is
|
|
1001
1001
|
};
|
|
1002
|
-
a.forEach(
|
|
1002
|
+
a.forEach(j, (e, t) => {
|
|
1003
1003
|
if (e) {
|
|
1004
1004
|
try {
|
|
1005
1005
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1013,27 +1013,27 @@ const as = {
|
|
|
1013
1013
|
e = a.isArray(e) ? e : [e];
|
|
1014
1014
|
const { length: t } = e;
|
|
1015
1015
|
let s, n;
|
|
1016
|
-
for (let r = 0; r < t && (s = e[r], !(n = a.isString(s) ?
|
|
1016
|
+
for (let r = 0; r < t && (s = e[r], !(n = a.isString(s) ? j[s.toLowerCase()] : s)); r++)
|
|
1017
1017
|
;
|
|
1018
1018
|
if (!n)
|
|
1019
1019
|
throw n === !1 ? new p(
|
|
1020
1020
|
`Adapter ${s} is not supported by the environment`,
|
|
1021
1021
|
"ERR_NOT_SUPPORT"
|
|
1022
1022
|
) : new Error(
|
|
1023
|
-
a.hasOwnProp(
|
|
1023
|
+
a.hasOwnProp(j, s) ? `Adapter '${s}' is not available in the build` : `Unknown adapter '${s}'`
|
|
1024
1024
|
);
|
|
1025
1025
|
if (!a.isFunction(n))
|
|
1026
1026
|
throw new TypeError("adapter is not a function");
|
|
1027
1027
|
return n;
|
|
1028
1028
|
},
|
|
1029
|
-
adapters:
|
|
1029
|
+
adapters: j
|
|
1030
1030
|
};
|
|
1031
1031
|
function Y(e) {
|
|
1032
1032
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1033
1033
|
throw new L(null, e);
|
|
1034
1034
|
}
|
|
1035
1035
|
function be(e) {
|
|
1036
|
-
return Y(e), e.headers =
|
|
1036
|
+
return Y(e), e.headers = x.from(e.headers), e.data = Z.call(
|
|
1037
1037
|
e,
|
|
1038
1038
|
e.transformRequest
|
|
1039
1039
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), as.getAdapter(e.adapter || oe.adapter)(e).then(function(n) {
|
|
@@ -1041,16 +1041,16 @@ function be(e) {
|
|
|
1041
1041
|
e,
|
|
1042
1042
|
e.transformResponse,
|
|
1043
1043
|
n
|
|
1044
|
-
), n.headers =
|
|
1044
|
+
), n.headers = x.from(n.headers), n;
|
|
1045
1045
|
}, function(n) {
|
|
1046
|
-
return
|
|
1046
|
+
return je(n) || (Y(e), n && n.response && (n.response.data = Z.call(
|
|
1047
1047
|
e,
|
|
1048
1048
|
e.transformResponse,
|
|
1049
1049
|
n.response
|
|
1050
|
-
), n.response.headers =
|
|
1050
|
+
), n.response.headers = x.from(n.response.headers))), Promise.reject(n);
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
const we = (e) => e instanceof
|
|
1053
|
+
const we = (e) => e instanceof x ? e.toJSON() : e;
|
|
1054
1054
|
function _(e, t) {
|
|
1055
1055
|
t = t || {};
|
|
1056
1056
|
const s = {};
|
|
@@ -1116,7 +1116,7 @@ function _(e, t) {
|
|
|
1116
1116
|
a.isUndefined(w) && y !== c || (s[u] = w);
|
|
1117
1117
|
}), s;
|
|
1118
1118
|
}
|
|
1119
|
-
const
|
|
1119
|
+
const He = "1.4.0", ie = {};
|
|
1120
1120
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1121
1121
|
ie[e] = function(n) {
|
|
1122
1122
|
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -1125,7 +1125,7 @@ const Pe = "1.4.0", ie = {};
|
|
|
1125
1125
|
const Ee = {};
|
|
1126
1126
|
ie.transitional = function(t, s, n) {
|
|
1127
1127
|
function r(o, i) {
|
|
1128
|
-
return "[Axios v" +
|
|
1128
|
+
return "[Axios v" + He + "] Transitional option '" + o + "'" + i + (n ? ". " + n : "");
|
|
1129
1129
|
}
|
|
1130
1130
|
return (o, i, c) => {
|
|
1131
1131
|
if (t === !1)
|
|
@@ -1161,7 +1161,7 @@ function ls(e, t, s) {
|
|
|
1161
1161
|
const te = {
|
|
1162
1162
|
assertOptions: ls,
|
|
1163
1163
|
validators: ie
|
|
1164
|
-
},
|
|
1164
|
+
}, k = te.validators;
|
|
1165
1165
|
class H {
|
|
1166
1166
|
constructor(t) {
|
|
1167
1167
|
this.defaults = t, this.interceptors = {
|
|
@@ -1181,14 +1181,14 @@ class H {
|
|
|
1181
1181
|
typeof t == "string" ? (s = s || {}, s.url = t) : s = t || {}, s = _(this.defaults, s);
|
|
1182
1182
|
const { transitional: n, paramsSerializer: r, headers: o } = s;
|
|
1183
1183
|
n !== void 0 && te.assertOptions(n, {
|
|
1184
|
-
silentJSONParsing:
|
|
1185
|
-
forcedJSONParsing:
|
|
1186
|
-
clarifyTimeoutError:
|
|
1184
|
+
silentJSONParsing: k.transitional(k.boolean),
|
|
1185
|
+
forcedJSONParsing: k.transitional(k.boolean),
|
|
1186
|
+
clarifyTimeoutError: k.transitional(k.boolean)
|
|
1187
1187
|
}, !1), r != null && (a.isFunction(r) ? s.paramsSerializer = {
|
|
1188
1188
|
serialize: r
|
|
1189
1189
|
} : te.assertOptions(r, {
|
|
1190
|
-
encode:
|
|
1191
|
-
serialize:
|
|
1190
|
+
encode: k.function,
|
|
1191
|
+
serialize: k.function
|
|
1192
1192
|
}, !0)), s.method = (s.method || this.defaults.method || "get").toLowerCase();
|
|
1193
1193
|
let i;
|
|
1194
1194
|
i = o && a.merge(
|
|
@@ -1199,7 +1199,7 @@ class H {
|
|
|
1199
1199
|
(f) => {
|
|
1200
1200
|
delete o[f];
|
|
1201
1201
|
}
|
|
1202
|
-
), s.headers =
|
|
1202
|
+
), s.headers = x.concat(i, o);
|
|
1203
1203
|
const c = [];
|
|
1204
1204
|
let d = !0;
|
|
1205
1205
|
this.interceptors.request.forEach(function(m) {
|
|
@@ -1238,8 +1238,8 @@ class H {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
getUri(t) {
|
|
1240
1240
|
t = _(this.defaults, t);
|
|
1241
|
-
const s =
|
|
1242
|
-
return
|
|
1241
|
+
const s = ze(t.baseURL, t.url);
|
|
1242
|
+
return Ue(s, t.params, t.paramsSerializer);
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
@@ -1413,18 +1413,18 @@ Object.entries(se).forEach(([e, t]) => {
|
|
|
1413
1413
|
se[t] = e;
|
|
1414
1414
|
});
|
|
1415
1415
|
const ds = se;
|
|
1416
|
-
function
|
|
1417
|
-
const t = new z(e), s =
|
|
1416
|
+
function Me(e) {
|
|
1417
|
+
const t = new z(e), s = Te(z.prototype.request, t);
|
|
1418
1418
|
return a.extend(s, z.prototype, t, { allOwnKeys: !0 }), a.extend(s, t, null, { allOwnKeys: !0 }), s.create = function(r) {
|
|
1419
|
-
return
|
|
1419
|
+
return Me(_(e, r));
|
|
1420
1420
|
}, s;
|
|
1421
1421
|
}
|
|
1422
|
-
const b =
|
|
1422
|
+
const b = Me(oe);
|
|
1423
1423
|
b.Axios = z;
|
|
1424
1424
|
b.CanceledError = L;
|
|
1425
1425
|
b.CancelToken = cs;
|
|
1426
|
-
b.isCancel =
|
|
1427
|
-
b.VERSION =
|
|
1426
|
+
b.isCancel = je;
|
|
1427
|
+
b.VERSION = He;
|
|
1428
1428
|
b.toFormData = K;
|
|
1429
1429
|
b.AxiosError = p;
|
|
1430
1430
|
b.Cancel = b.CanceledError;
|
|
@@ -1434,46 +1434,47 @@ b.all = function(t) {
|
|
|
1434
1434
|
b.spread = us;
|
|
1435
1435
|
b.isAxiosError = fs;
|
|
1436
1436
|
b.mergeConfig = _;
|
|
1437
|
-
b.AxiosHeaders =
|
|
1438
|
-
b.formToJSON = (e) =>
|
|
1437
|
+
b.AxiosHeaders = x;
|
|
1438
|
+
b.formToJSON = (e) => Pe(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1439
1439
|
b.HttpStatusCode = ds;
|
|
1440
1440
|
b.default = b;
|
|
1441
1441
|
const le = b;
|
|
1442
1442
|
function ce({ needsToken: e = !0, options: t }) {
|
|
1443
1443
|
let s = {};
|
|
1444
|
-
return e &&
|
|
1444
|
+
return e && Ge(s, ["headers", "Authorization"], "Bearer TOKEN"), t && (s = Se(s, t)), s;
|
|
1445
1445
|
}
|
|
1446
1446
|
async function ue({ url: e, needsToken: t, options: s }) {
|
|
1447
1447
|
return await le.get(e, ce({ needsToken: t, options: s }));
|
|
1448
1448
|
}
|
|
1449
|
-
async function
|
|
1449
|
+
async function $e({ url: e, needsToken: t, options: s, payload: n = {} }) {
|
|
1450
1450
|
return await le.post(e, n, ce({ needsToken: t, options: s }));
|
|
1451
1451
|
}
|
|
1452
1452
|
async function ys({ url: e, needsToken: t, options: s, payload: n }) {
|
|
1453
1453
|
return await le.put(e, n, ce({ needsToken: t, options: s }));
|
|
1454
1454
|
}
|
|
1455
|
-
async function
|
|
1455
|
+
async function R(e) {
|
|
1456
1456
|
try {
|
|
1457
1457
|
return await e();
|
|
1458
1458
|
} catch (t) {
|
|
1459
1459
|
return Promise.reject(t);
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
const
|
|
1462
|
+
const C = "https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls", hs = "1000";
|
|
1463
1463
|
async function ms(e, t) {
|
|
1464
|
-
return
|
|
1465
|
-
async () => await
|
|
1464
|
+
return R(
|
|
1465
|
+
async () => await $e({ url: `${C}/api/v1/images/book/${e}`, payload: t })
|
|
1466
1466
|
);
|
|
1467
1467
|
}
|
|
1468
1468
|
class ps {
|
|
1469
1469
|
constructor(t) {
|
|
1470
1470
|
h(this, "parentId");
|
|
1471
1471
|
h(this, "images");
|
|
1472
|
-
this
|
|
1472
|
+
h(this, "length");
|
|
1473
|
+
this.parentId = t, this.images = [], this.length = this.images.length;
|
|
1473
1474
|
}
|
|
1474
1475
|
async add(t) {
|
|
1475
|
-
return this.images.push(t), await ms(this.parentId, new gs(t)), new Promise((s) => {
|
|
1476
|
-
s(this.
|
|
1476
|
+
return this.images.push(t), this.length = this.images.length, await ms(this.parentId, new gs(t)), new Promise((s) => {
|
|
1477
|
+
s(this.length);
|
|
1477
1478
|
});
|
|
1478
1479
|
}
|
|
1479
1480
|
}
|
|
@@ -1495,12 +1496,16 @@ const Ls = [
|
|
|
1495
1496
|
"new",
|
|
1496
1497
|
"ingesting",
|
|
1497
1498
|
"submitted",
|
|
1498
|
-
"waiting for storyboard",
|
|
1499
1499
|
"storyboarding",
|
|
1500
|
-
"
|
|
1501
|
-
"design initialized",
|
|
1502
|
-
"waiting for design",
|
|
1500
|
+
"storyboarding succeeded",
|
|
1503
1501
|
"designing",
|
|
1502
|
+
"designing succeeded",
|
|
1503
|
+
"layouting",
|
|
1504
|
+
"layouting succeeded",
|
|
1505
|
+
"embellishing",
|
|
1506
|
+
"embellishing succeeded",
|
|
1507
|
+
"polishing",
|
|
1508
|
+
"polishing succeeded",
|
|
1504
1509
|
"ready",
|
|
1505
1510
|
"error"
|
|
1506
1511
|
], bs = [
|
|
@@ -1519,7 +1524,7 @@ const Ls = [
|
|
|
1519
1524
|
"travel",
|
|
1520
1525
|
"wedding",
|
|
1521
1526
|
"year-in-review"
|
|
1522
|
-
],
|
|
1527
|
+
], Je = {
|
|
1523
1528
|
1005: { slug: "modern-black-sfly" },
|
|
1524
1529
|
1101: { slug: "bon-voyage-sfly" },
|
|
1525
1530
|
1103: { slug: "fun-in-the-sun-sfly" },
|
|
@@ -1680,8 +1685,8 @@ const Ls = [
|
|
|
1680
1685
|
6097: { slug: "boho-wedding-sfly" },
|
|
1681
1686
|
6098: { slug: "black-and-white-rustic-sfly" },
|
|
1682
1687
|
6099: { slug: "bright-color-pop-sfly" }
|
|
1683
|
-
}, ws = ["8x8", "10x10", "12x12", "8x11", "11x8", "11x14"], Es = ["sc", "hc", "pl"], Ss = ["sp", "sl", "dl"], Os = ["low", "medium", "high"], As = ["best", "most", "all"], Ts = ["none", "few", "lots"],
|
|
1684
|
-
class
|
|
1688
|
+
}, ws = ["8x8", "10x10", "12x12", "8x11", "11x8", "11x14"], Es = ["sc", "hc", "pl"], Ss = ["sp", "sl", "dl"], Os = ["low", "medium", "high"], As = ["best", "most", "all"], Ts = ["none", "few", "lots"], xs = ["none", "few", "lots"];
|
|
1689
|
+
class ks {
|
|
1685
1690
|
constructor(t) {
|
|
1686
1691
|
h(this, "occasion");
|
|
1687
1692
|
h(this, "style");
|
|
@@ -1701,11 +1706,11 @@ class G {
|
|
|
1701
1706
|
h(this, "state");
|
|
1702
1707
|
h(this, "title");
|
|
1703
1708
|
h(this, "design_request");
|
|
1704
|
-
this.id = t.id, this.state = t.state, this.title = t.title, this.design_request = new
|
|
1709
|
+
this.id = t.id, this.state = t.state, this.title = t.title, this.design_request = new ks(t.design_request);
|
|
1705
1710
|
}
|
|
1706
1711
|
}
|
|
1707
1712
|
function vs(e) {
|
|
1708
|
-
const t =
|
|
1713
|
+
const t = Je[e.style].slug, s = Oe({ ...e });
|
|
1709
1714
|
return s.style = t, new G({
|
|
1710
1715
|
id: e.parentId,
|
|
1711
1716
|
state: "new",
|
|
@@ -1714,29 +1719,29 @@ function vs(e) {
|
|
|
1714
1719
|
});
|
|
1715
1720
|
}
|
|
1716
1721
|
async function _s(e, t) {
|
|
1717
|
-
return
|
|
1718
|
-
const s = await ue({ url: `${
|
|
1719
|
-
return
|
|
1722
|
+
return R(async () => {
|
|
1723
|
+
const s = await ue({ url: `${C}/api/v1/designoptions/booksize/${e}/imagecount/${t}` });
|
|
1724
|
+
return Ae(s.data);
|
|
1720
1725
|
});
|
|
1721
1726
|
}
|
|
1722
1727
|
async function Ns(e) {
|
|
1723
|
-
return
|
|
1724
|
-
async () => new G((await
|
|
1728
|
+
return R(
|
|
1729
|
+
async () => new G((await $e({ url: `${C}/api/v1/books`, payload: e })).data)
|
|
1725
1730
|
);
|
|
1726
1731
|
}
|
|
1727
|
-
async function
|
|
1728
|
-
return
|
|
1729
|
-
async () => new G((await ue({ url: `${
|
|
1732
|
+
async function Rs(e) {
|
|
1733
|
+
return R(
|
|
1734
|
+
async () => new G((await ue({ url: `${C}/api/v1/books/${e}` })).data)
|
|
1730
1735
|
);
|
|
1731
1736
|
}
|
|
1732
|
-
async function
|
|
1733
|
-
return
|
|
1734
|
-
async () => new G((await ys({ url: `${
|
|
1737
|
+
async function Cs(e) {
|
|
1738
|
+
return R(
|
|
1739
|
+
async () => new G((await ys({ url: `${C}/api/v1/books/${e.id}`, payload: e })).data)
|
|
1735
1740
|
);
|
|
1736
1741
|
}
|
|
1737
1742
|
async function Fs(e) {
|
|
1738
|
-
return
|
|
1739
|
-
async () => (await ue({ url: `${
|
|
1743
|
+
return R(
|
|
1744
|
+
async () => (await ue({ url: `${C}/api/v1/books/${e}/format/galleon` })).data
|
|
1740
1745
|
);
|
|
1741
1746
|
}
|
|
1742
1747
|
class Bs {
|
|
@@ -1753,13 +1758,13 @@ class Bs {
|
|
|
1753
1758
|
h(this, "embellishmentLevel");
|
|
1754
1759
|
h(this, "textStickerLevel");
|
|
1755
1760
|
h(this, "images");
|
|
1756
|
-
this.parentId = t, this.title = (s == null ? void 0 : s.title) || "", this.occasion = (s == null ? void 0 : s.occasion) || bs[0], this.style = (s == null ? void 0 : s.style) || parseInt(Object.keys(
|
|
1761
|
+
this.parentId = t, this.title = (s == null ? void 0 : s.title) || "", this.occasion = (s == null ? void 0 : s.occasion) || bs[0], this.style = (s == null ? void 0 : s.style) || parseInt(Object.keys(Je)[0]), this.bookSize = (s == null ? void 0 : s.bookSize) || ws[0], this.coverType = (s == null ? void 0 : s.coverType) || Es[0], this.pageType = (s == null ? void 0 : s.pageType) || Ss[0], this.imageDensity = (s == null ? void 0 : s.imageDensity) || Os[0], this.imageFiltering = (s == null ? void 0 : s.imageFiltering) || As[0], this.embellishmentLevel = (s == null ? void 0 : s.embellishmentLevel) || Ts[0], this.textStickerLevel = (s == null ? void 0 : s.textStickerLevel) || xs[0], this.images = new ps(t);
|
|
1757
1762
|
}
|
|
1758
1763
|
async getOptions(t) {
|
|
1759
1764
|
return await _s(this.bookSize, t);
|
|
1760
1765
|
}
|
|
1761
1766
|
async submit(t) {
|
|
1762
|
-
return t && Object.assign(this, t), await
|
|
1767
|
+
return t && Object.assign(this, t), await Cs(vs(this)), this.getProgress(), this;
|
|
1763
1768
|
}
|
|
1764
1769
|
async getJSON() {
|
|
1765
1770
|
return await Fs(this.parentId);
|
|
@@ -1767,7 +1772,7 @@ class Bs {
|
|
|
1767
1772
|
async getProgress() {
|
|
1768
1773
|
let t = "";
|
|
1769
1774
|
const s = setInterval(async () => {
|
|
1770
|
-
const n = (await
|
|
1775
|
+
const n = (await Rs(this.parentId)).state;
|
|
1771
1776
|
if (t !== n) {
|
|
1772
1777
|
t = n;
|
|
1773
1778
|
const r = new CustomEvent("MagicBook.designRequestUpdated", {
|
|
@@ -1803,6 +1808,6 @@ export {
|
|
|
1803
1808
|
bs as occasions,
|
|
1804
1809
|
Ss as pageTypes,
|
|
1805
1810
|
Ls as states,
|
|
1806
|
-
|
|
1807
|
-
|
|
1811
|
+
Je as styles,
|
|
1812
|
+
xs as textStickerLevels
|
|
1808
1813
|
};
|
package/magicbook-client.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(g,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(g=typeof globalThis<"u"?globalThis:g||self,S(g["magicbook-client"]={}))})(this,function(g){"use strict";var Bn=Object.defineProperty;var Dn=(g,S,N)=>S in g?Bn(g,S,{enumerable:!0,configurable:!0,writable:!0,value:N}):g[S]=N;var h=(g,S,N)=>(Dn(g,typeof S!="symbol"?S+"":S,N),N);function S(e,t,n){const s=t.pop()||"",r=t.reduce((i,o)=>i[o]=i[o]||{},e);r[s]=n}function N(e,t){return Object.keys(t).map(n=>{typeof e[n]=="object"&&typeof t[n]=="object"?N(e[n],t[n]):e[n]=t[n]}),e}function nt(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function st(e){return Object.keys(e).map(t=>{const n=nt(t);n.includes("_")&&(e[n]=e[t],delete e[t])}),e}function rt(e){return e.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace("-","").replace("_",""))}function it(e){return Object.keys(e).map(t=>{const n=rt(t);n!==t&&(e[n]=e[t],delete e[t])}),e}function me(e,t){return function(){return e.apply(t,arguments)}}const{toString:ot}=Object.prototype,{getPrototypeOf:Y}=Object,P=(e=>t=>{const n=ot.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),T=e=>(e=e.toLowerCase(),t=>P(t)===e),z=e=>t=>typeof t===e,{isArray:C}=Array,L=z("undefined");function at(e){return e!==null&&!L(e)&&e.constructor!==null&&!L(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const pe=T("ArrayBuffer");function lt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&pe(e.buffer),t}const ct=z("string"),O=z("function"),ge=z("number"),H=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,M=e=>{if(P(e)!=="object")return!1;const t=Y(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ft=T("Date"),dt=T("File"),yt=T("Blob"),ht=T("FileList"),mt=e=>H(e)&&O(e.pipe),pt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=P(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},gt=T("URLSearchParams"),bt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function U(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),C(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(s=0;s<o;s++)c=i[s],t.call(null,e[c],c,e)}}function be(e,t){t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const we=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ee=e=>!L(e)&&e!==we;function q(){const{caseless:e}=Ee(this)&&this||{},t={},n=(s,r)=>{const i=e&&be(t,r)||r;M(t[i])&&M(s)?t[i]=q(t[i],s):M(s)?t[i]=q({},s):C(s)?t[i]=s.slice():t[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&U(arguments[s],n);return t}const wt=(e,t,n,{allOwnKeys:s}={})=>(U(t,(r,i)=>{n&&O(r)?e[i]=me(r,n):e[i]=r},{allOwnKeys:s}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),St=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Ot=(e,t,n,s)=>{let r,i,o;const c={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)o=r[i],(!s||s(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Y(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},At=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Tt=e=>{if(!e)return null;if(C(e))return e;let t=e.length;if(!ge(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},kt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Y(Uint8Array)),vt=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=s.next())&&!r.done;){const i=r.value;t.call(e,i[0],i[1])}},_t=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Nt=T("HTMLFormElement"),xt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),Se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ct=T("RegExp"),Oe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};U(n,(r,i)=>{t(r,i,e)!==!1&&(s[i]=r)}),Object.defineProperties(e,s)},Rt=e=>{Oe(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(O(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ft=(e,t)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return C(e)?s(e):s(String(e).split(t)),n},Bt=()=>{},Dt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),ee="abcdefghijklmnopqrstuvwxyz",Ae="0123456789",Te={DIGIT:Ae,ALPHA:ee,ALPHA_DIGIT:ee+ee.toUpperCase()+Ae},Lt=(e=16,t=Te.ALPHA_DIGIT)=>{let n="";const{length:s}=t;for(;e--;)n+=t[Math.random()*s|0];return n};function Ut(e){return!!(e&&O(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const It=e=>{const t=new Array(10),n=(s,r)=>{if(H(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[r]=s;const i=C(s)?[]:{};return U(s,(o,c)=>{const d=n(o,r+1);!L(d)&&(i[c]=d)}),t[r]=void 0,i}}return s};return n(e,0)},jt=T("AsyncFunction"),a={isArray:C,isArrayBuffer:pe,isBuffer:at,isFormData:pt,isArrayBufferView:lt,isString:ct,isNumber:ge,isBoolean:ut,isObject:H,isPlainObject:M,isUndefined:L,isDate:ft,isFile:dt,isBlob:yt,isRegExp:Ct,isFunction:O,isStream:mt,isURLSearchParams:gt,isTypedArray:kt,isFileList:ht,forEach:U,merge:q,extend:wt,trim:bt,stripBOM:Et,inherits:St,toFlatObject:Ot,kindOf:P,kindOfTest:T,endsWith:At,toArray:Tt,forEachEntry:vt,matchAll:_t,isHTMLForm:Nt,hasOwnProperty:Se,hasOwnProp:Se,reduceDescriptors:Oe,freezeMethods:Rt,toObjectSet:Ft,toCamelCase:xt,noop:Bt,toFiniteNumber:Dt,findKey:be,global:we,isContextDefined:Ee,ALPHABET:Te,generateString:Lt,isSpecCompliantForm:Ut,toJSONObject:It,isAsyncFn:jt,isThenable:e=>e&&(H(e)||O(e))&&O(e.then)&&O(e.catch)};function p(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r)}a.inherits(p,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ke=p.prototype,ve={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ve[e]={value:e}}),Object.defineProperties(p,ve),Object.defineProperty(ke,"isAxiosError",{value:!0}),p.from=(e,t,n,s,r,i)=>{const o=Object.create(ke);return a.toFlatObject(e,o,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),p.call(o,e.message,t,n,s,r),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Pt=null;function te(e){return a.isPlainObject(e)||a.isArray(e)}function _e(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ne(e,t,n){return e?e.concat(t).map(function(r,i){return r=_e(r),!n&&i?"["+r+"]":r}).join(n?".":""):t}function zt(e){return a.isArray(e)&&!e.some(te)}const Ht=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function $(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,_){return!a.isUndefined(_[m])});const s=n.metaTokens,r=n.visitor||u,i=n.dots,o=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!d&&a.isBlob(f))throw new p("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,m,_){let A=f;if(f&&!_&&typeof f=="object"){if(a.endsWith(m,"{}"))m=s?m:m.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&zt(f)||(a.isFileList(f)||a.endsWith(m,"[]"))&&(A=a.toArray(f)))return m=_e(m),A.forEach(function(Z,Fn){!(a.isUndefined(Z)||Z===null)&&t.append(o===!0?Ne([m],Fn,i):o===null?m:m+"[]",l(Z))}),!1}return te(f)?!0:(t.append(Ne(_,m,i),l(f)),!1)}const y=[],E=Object.assign(Ht,{defaultVisitor:u,convertValue:l,isVisitable:te});function b(f,m){if(!a.isUndefined(f)){if(y.indexOf(f)!==-1)throw Error("Circular reference detected in "+m.join("."));y.push(f),a.forEach(f,function(A,D){(!(a.isUndefined(A)||A===null)&&r.call(t,A,a.isString(D)?D.trim():D,m,E))===!0&&b(A,m?m.concat(D):[D])}),y.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return b(e),t}function xe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function ne(e,t){this._pairs=[],e&&$(e,this,t)}const Ce=ne.prototype;Ce.append=function(t,n){this._pairs.push([t,n])},Ce.toString=function(t){const n=t?function(s){return t.call(this,s,xe)}:xe;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Mt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Re(e,t,n){if(!t)return e;const s=n&&n.encode||Mt,r=n&&n.serialize;let i;if(r?i=r(t,n):i=a.isURLSearchParams(t)?t.toString():new ne(t,n).toString(s),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class $t{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Fe=$t,Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jt=typeof URLSearchParams<"u"?URLSearchParams:ne,Kt=typeof FormData<"u"?FormData:null,Vt=typeof Blob<"u"?Blob:null,Wt=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Gt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),k={isBrowser:!0,classes:{URLSearchParams:Jt,FormData:Kt,Blob:Vt},isStandardBrowserEnv:Wt,isStandardBrowserWebWorkerEnv:Gt,protocols:["http","https","file","blob","url","data"]};function Xt(e,t){return $(e,new k.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,i){return k.isNode&&a.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Qt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Zt(e){const t={},n=Object.keys(e);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],t[i]=e[i];return t}function De(e){function t(n,s,r,i){let o=n[i++];const c=Number.isFinite(+o),d=i>=n.length;return o=!o&&a.isArray(r)?r.length:o,d?(a.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!c):((!r[o]||!a.isObject(r[o]))&&(r[o]=[]),t(n,s,r[o],i)&&a.isArray(r[o])&&(r[o]=Zt(r[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(s,r)=>{t(Qt(s),r,n,0)}),n}return null}const Yt={"Content-Type":void 0};function qt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const J={transitional:Be,adapter:["xhr","http"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r&&r?JSON.stringify(De(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Xt(t,this.formSerializer).toString();if((c=a.isFileList(t))||s.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return $(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),qt(t)):t}],transformResponse:[function(t){const n=this.transitional||J.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&a.isString(t)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?p.from(c,p.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:k.classes.FormData,Blob:k.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){J.headers[t]={}}),a.forEach(["post","put","patch"],function(t){J.headers[t]=a.merge(Yt)});const se=J,en=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tn=e=>{const t={};let n,s,r;return e&&e.split(`
|
|
2
|
-
`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||t[n]&&en[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},
|
|
3
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[Le]=this[Le]={accessors:{}}).accessors,r=this.prototype;function i(o){const c=I(o);s[c]||(on(r,o),s[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}}V.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.freezeMethods(V.prototype),a.freezeMethods(V);const v=V;function ie(e,t){const n=this||se,s=t||n,r=v.from(s.headers);let i=s.data;return a.forEach(e,function(c){i=c.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Ue(e){return!!(e&&e.__CANCEL__)}function j(e,t,n){p.call(this,e??"canceled",p.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(j,p,{__CANCEL__:!0});function an(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new p("Request failed with status code "+n.status,[p.ERR_BAD_REQUEST,p.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const ln=k.isStandardBrowserEnv?function(){return{write:function(n,s,r,i,o,c){const d=[];d.push(n+"="+encodeURIComponent(s)),a.isNumber(r)&&d.push("expires="+new Date(r).toGMTString()),a.isString(i)&&d.push("path="+i),a.isString(o)&&d.push("domain="+o),c===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function cn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function un(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ie(e,t){return e&&!cn(t)?un(e,t):t}const fn=k.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function r(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=r(window.location.href),function(o){const c=a.isString(o)?r(o):o;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}();function dn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yn(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(d){const l=Date.now(),u=s[i];o||(o=l),n[r]=d,s[r]=l;let y=i,E=0;for(;y!==r;)E+=n[y++],y=y%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),l-o<t)return;const b=u&&l-u;return b?Math.round(E*1e3/b):void 0}}function je(e,t){let n=0;const s=yn(50,250);return r=>{const i=r.loaded,o=r.lengthComputable?r.total:void 0,c=i-n,d=s(c),l=i<=o;n=i;const u={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:d||void 0,estimated:d&&o&&l?(o-i)/d:void 0,event:r};u[t?"download":"upload"]=!0,e(u)}}const W={http:Pt,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){let r=e.data;const i=v.from(e.headers).normalize(),o=e.responseType;let c;function d(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}a.isFormData(r)&&(k.isStandardBrowserEnv||k.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const b=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(b+":"+f))}const u=Ie(e.baseURL,e.url);l.open(e.method.toUpperCase(),Re(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function y(){if(!l)return;const b=v.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),m={data:!o||o==="text"||o==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:b,config:e,request:l};an(function(A){n(A),d()},function(A){s(A),d()},m),l=null}if("onloadend"in l?l.onloadend=y:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(y)},l.onabort=function(){l&&(s(new p("Request aborted",p.ECONNABORTED,e,l)),l=null)},l.onerror=function(){s(new p("Network Error",p.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let f=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||Be;e.timeoutErrorMessage&&(f=e.timeoutErrorMessage),s(new p(f,m.clarifyTimeoutError?p.ETIMEDOUT:p.ECONNABORTED,e,l)),l=null},k.isStandardBrowserEnv){const b=(e.withCredentials||fn(u))&&e.xsrfCookieName&&ln.read(e.xsrfCookieName);b&&i.set(e.xsrfHeaderName,b)}r===void 0&&i.setContentType(null),"setRequestHeader"in l&&a.forEach(i.toJSON(),function(f,m){l.setRequestHeader(m,f)}),a.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&o!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",je(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",je(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=b=>{l&&(s(!b||b.type?new j(null,e,l):b),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const E=dn(u);if(E&&k.protocols.indexOf(E)===-1){s(new p("Unsupported protocol "+E+":",p.ERR_BAD_REQUEST,e));return}l.send(r||null)})}};a.forEach(W,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const hn={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,s;for(let r=0;r<t&&(n=e[r],!(s=a.isString(n)?W[n.toLowerCase()]:n));r++);if(!s)throw s===!1?new p(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(W,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:W};function oe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new j(null,e)}function Pe(e){return oe(e),e.headers=v.from(e.headers),e.data=ie.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hn.getAdapter(e.adapter||se.adapter)(e).then(function(s){return oe(e),s.data=ie.call(e,e.transformResponse,s),s.headers=v.from(s.headers),s},function(s){return Ue(s)||(oe(e),s&&s.response&&(s.response.data=ie.call(e,e.transformResponse,s.response),s.response.headers=v.from(s.response.headers))),Promise.reject(s)})}const ze=e=>e instanceof v?e.toJSON():e;function R(e,t){t=t||{};const n={};function s(l,u,y){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:y},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function r(l,u,y){if(a.isUndefined(u)){if(!a.isUndefined(l))return s(void 0,l,y)}else return s(l,u,y)}function i(l,u){if(!a.isUndefined(u))return s(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return s(void 0,l)}else return s(void 0,u)}function c(l,u,y){if(y in t)return s(l,u);if(y in e)return s(void 0,l)}const d={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u)=>r(ze(l),ze(u),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(u){const y=d[u]||r,E=y(e[u],t[u],u);a.isUndefined(E)&&y!==c||(n[u]=E)}),n}const He="1.4.0",ae={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ae[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Me={};ae.transitional=function(t,n,s){function r(i,o){return"[Axios v"+He+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,c)=>{if(t===!1)throw new p(r(o," has been removed"+(n?" in "+n:"")),p.ERR_DEPRECATED);return n&&!Me[o]&&(Me[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function mn(e,t,n){if(typeof e!="object")throw new p("options must be an object",p.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const i=s[r],o=t[i];if(o){const c=e[i],d=c===void 0||o(c,i,e);if(d!==!0)throw new p("option "+i+" must be "+d,p.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new p("Unknown option "+i,p.ERR_BAD_OPTION)}}const le={assertOptions:mn,validators:ae},x=le.validators;class G{constructor(t){this.defaults=t,this.interceptors={request:new Fe,response:new Fe}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=R(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&le.assertOptions(s,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:le.assertOptions(r,{encode:x.function,serialize:x.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&a.merge(i.common,i[n.method]),o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=v.concat(o,i);const c=[];let d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(d=d&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,y=0,E;if(!d){const f=[Pe.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,l),E=f.length,u=Promise.resolve(n);y<E;)u=u.then(f[y++],f[y++]);return u}E=c.length;let b=n;for(y=0;y<E;){const f=c[y++],m=c[y++];try{b=f(b)}catch(_){m.call(this,_);break}}try{u=Pe.call(this,b)}catch(f){return Promise.reject(f)}for(y=0,E=l.length;y<E;)u=u.then(l[y++],l[y++]);return u}getUri(t){t=R(this.defaults,t);const n=Ie(t.baseURL,t.url);return Re(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){G.prototype[t]=function(n,s){return this.request(R(s||{},{method:t,url:n,data:(s||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(s){return function(i,o,c){return this.request(R(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}G.prototype[t]=n(),G.prototype[t+"Form"]=n(!0)});const X=G;class ce{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(c=>{s.subscribe(c),i=c}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},t(function(i,o,c){s.reason||(s.reason=new j(i,o,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ce(function(r){t=r}),cancel:t}}}const pn=ce;function gn(e){return function(n){return e.apply(null,n)}}function bn(e){return a.isObject(e)&&e.isAxiosError===!0}const ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ue).forEach(([e,t])=>{ue[t]=e});const wn=ue;function $e(e){const t=new X(e),n=me(X.prototype.request,t);return a.extend(n,X.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return $e(R(e,r))},n}const w=$e(se);w.Axios=X,w.CanceledError=j,w.CancelToken=pn,w.isCancel=Ue,w.VERSION=He,w.toFormData=$,w.AxiosError=p,w.Cancel=w.CanceledError,w.all=function(t){return Promise.all(t)},w.spread=gn,w.isAxiosError=bn,w.mergeConfig=R,w.AxiosHeaders=v,w.formToJSON=e=>De(a.isHTMLForm(e)?new FormData(e):e),w.HttpStatusCode=wn,w.default=w;const fe=w;function de({needsToken:e=!0,options:t}){let n={};return e&&S(n,["headers","Authorization"],"Bearer TOKEN"),t&&(n=N(n,t)),n}async function ye({url:e,needsToken:t,options:n}){return await fe.get(e,de({needsToken:t,options:n}))}async function Je({url:e,needsToken:t,options:n,payload:s={}}){return await fe.post(e,s,de({needsToken:t,options:n}))}async function En({url:e,needsToken:t,options:n,payload:s}){return await fe.put(e,s,de({needsToken:t,options:n}))}async function F(e){try{return await e()}catch(t){return Promise.reject(t)}}const B="https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls",Sn="1000";async function On(e,t){return F(async()=>await Je({url:`${B}/api/v1/images/book/${e}`,payload:t}))}class Ke{constructor(t){h(this,"parentId");h(this,"images");this.parentId=t,this.images=[]}async add(t){return this.images.push(t),await On(this.parentId,new Ve(t)),new Promise(n=>{n(this.images.length)})}}class Ve{constructor(t){h(this,"handle");h(this,"url");h(this,"width");h(this,"height");h(this,"orientation");h(this,"taken_at");h(this,"camera_make");h(this,"camera");h(this,"filename");this.handle=t.handle,this.url=t.url,this.width=t.width,this.height=t.height,this.orientation=t.rotation,this.taken_at=t.captureTime,this.camera_make=t.cameraMake,this.camera=t.cameraModel,this.filename=t.filename}}const An=["new","ingesting","submitted","waiting for storyboard","storyboarding","waiting for initialize design","design initialized","waiting for design","designing","ready","error"],We=["baby","birthday","default","everyday","family","kids","life-stories","portfolio","school-memories","seasonal-holidays","special-celebrations","sports-and-hobbies","travel","wedding","year-in-review"],he={1005:{slug:"modern-black-sfly"},1101:{slug:"bon-voyage-sfly"},1103:{slug:"fun-in-the-sun-sfly"},1201:{slug:"modern-wedding-sfly"},3001:{slug:"digiscrap-sfly"},4034:{slug:"travel-snapshots-sfly"},4035:{slug:"vintage-travel-sfly"},5017:{slug:"natural-neutrals-sfly"},5033:{slug:"chalkboard-chic-sfly"},5079:{slug:"hello-spring-sfly"},5082:{slug:"familygram-sfly"},5085:{slug:"best-day-ever-sfly"},5091:{slug:"little-love-sfly"},5118:{slug:"a-year-in-color-sfly"},5120:{slug:"milestone-anniversaries-sfly"},5121:{slug:"the-travel-bug-sfly"},5122:{slug:"modern-white-sfly"},5127:{slug:"outdoor-wedding-sfly"},5134:{slug:"classic-wedding-sfly"},5138:{slug:"kraft-pop-sfly"},5142:{slug:"simply-black-sfly"},5144:{slug:"autumn-memories-sfly"},5146:{slug:"everyday-sentiments-sfly"},5149:{slug:"everyday-happiness-sfly"},5150:{slug:"its-a-girl-thing-sfly"},5155:{slug:"made-with-love-sfly"},5157:{slug:"high-school-memories-sfly"},5161:{slug:"rustic-wedding-sfly"},5165:{slug:"life-is-grand-sfly"},5167:{slug:"adventure-awaits-sfly"},5168:{slug:"disney-adventure-sfly"},5171:{slug:"world-travel-sfly"},5174:{slug:"hello-summer-sfly"},5183:{slug:"everything-sports-sfly"},5188:{slug:"everyday-watercolor-sfly"},5189:{slug:"holiday-memories-sfly"},5213:{slug:"love-and-thanks-sfly"},5218:{slug:"babys-first-year-sfly"},5219:{slug:"usa-travel-sfly"},5220:{slug:"vintage-wedding-sfly"},5226:{slug:"love-you-because-sfly"},5228:{slug:"reunion-sfly"},5238:{slug:"whimsy-chalkboard-sfly"},5242:{slug:"modern-indigo-sfly"},5250:{slug:"family-yearbook-sfly"},5255:{slug:"elegant-wedding-sfly"},5258:{slug:"family-vacation-sfly"},5259:{slug:"beach-travel-sfly"},5261:{slug:"sparkle-and-shine-sfly"},5262:{slug:"welcome-baby-sfly"},5265:{slug:"vivid-watercolor-sfly"},5266:{slug:"what-i-love-about-you-sfly"},5272:{slug:"love-grows-sfly"},5274:{slug:"painted-seasons-sfly"},5278:{slug:"vintage-disney-sfly"},5292:{slug:"modern-grey-sfly"},5297:{slug:"modern-love-story-sfly"},5299:{slug:"modern-travel-sfly"},5304:{slug:"beach-wedding-sfly"},5305:{slug:"rustic-farmhouse-sfly"},5308:{slug:"tropical-travel-sfly"},6e3:{slug:"travel-abroad-sfly"},6001:{slug:"everyday-rustic-sfly"},6002:{slug:"simply-modern-sfly"},6003:{slug:"modern-baby-sfly"},6004:{slug:"modern-photo-album-sfly"},6005:{slug:"travel-adventures-sfly"},6006:{slug:"watercolor-year-in-review-sfly"},6007:{slug:"beach-bliss-sfly"},6008:{slug:"simply-gray-sfly"},6009:{slug:"family-favorites-by-lure-design-sfly"},6010:{slug:"travel-gallery-sfly"},6011:{slug:"our-wedding-day-sfly"},6012:{slug:"chic-celebrations-by-float-paperie-sfly"},6013:{slug:"simply-bold-type-sfly"},6014:{slug:"colorful-florals-by-potts-design-sfly"},6015:{slug:"softly-rustic-sfly"},6016:{slug:"ombre-watercolor-sfly"},6017:{slug:"forever-love-by-with-merriment-sfly"},6018:{slug:"colorful-memories-by-britt-bass-sfly"},6019:{slug:"celebrate-family-by-float-paperie-sfly"},6020:{slug:"disney-family-adventures-sfly"},6021:{slug:"everyday-neutrals-sfly"},6022:{slug:"colorful-childhood-sfly"},6023:{slug:"everyday-indigo-sfly"},6024:{slug:"shimmer-and-shine-sfly"},6025:{slug:"summertime-fun-sfly"},6026:{slug:"pet-lover-sfly"},6027:{slug:"modern-wedding-story-sfly"},6028:{slug:"family-blessings-by-potts-design-sfly"},6030:{slug:"outdoor-adventures-by-sarah-hawkins-designs-sfly"},6031:{slug:"travel-memories-sfly"},6032:{slug:"tropical-travels-sfly"},6033:{slug:"everyday-chalkboard-by-potts-design-sfly"},6034:{slug:"classic-disney-sfly"},6035:{slug:"cheerful-color-sfly"},6036:{slug:"colorful-birthday-sfly"},6038:{slug:"classic-baby-sfly"},6039:{slug:"bold-year-in-review-by-float-paperie-sfly"},6040:{slug:"colorfully-fun-sfly"},6041:{slug:"colorful-year-in-review-by-sarah-hawkins-designs-sfly"},6042:{slug:"gilded-wedding-sfly"},6043:{slug:"road-trip-travel-by-sarah-hawkins-designs-sfly"},6044:{slug:"rustic-gilded-wedding-sfly"},6045:{slug:"elegantly-scripted-year-in-review-sfly"},6047:{slug:"2020-what-a-year-sfly"},6057:{slug:"best-mom-ever-sfly"},6052:{slug:"celebration-of-life-by-sarah-hawkins-designs-sfly"},6054:{slug:"colorful-school-days-by-float-paperie-sfly"},6051:{slug:"love-is-all-we-need-sfly"},6058:{slug:"graduation-celebration-sfly"},6056:{slug:"our-wedding-day-guestbook-sfly"},6055:{slug:"muted-everyday-abstract-sfly"},6046:{slug:"winter-memories-by-sarah-hawkins-design-sfly"},6053:{slug:"best-dad-ever-sfly"},6050:{slug:"watercolor-greenery-by-sarah-hawkins-designs-sfly"},6063:{slug:"watercolor-floral-wedding-by-kim-thoa-sfly"},6060:{slug:"watercolor-baby-girl-sfly"},6059:{slug:"watercolor-baby-boy-sfly"},6048:{slug:"simple-elegant-wedding-sfly"},6049:{slug:"gilded-wedding-guestbook-sfly"},6037:{slug:"everyday-fairytale-by-jenny-romanski-sfly"},6061:{slug:"best-grandparents-ever-sfly"},6068:{slug:"winter-getaway-sfly"},6067:{slug:"national-parks-travel-by-eiman-design-co-sfly"},6065:{slug:"go-sports-by-lure-design-sfly"},6066:{slug:"elegant-wedding-greenery-by-kim-thoa-sfly"},6064:{slug:"boho-travel-by-umaiana-studio-sfly"},6071:{slug:"modern-dark-neutrals-sfly"},6072:{slug:"modern-light-neutrals-sfly"},6073:{slug:"modern-celebrations-sfly"},6074:{slug:"bright-and-bold-kids-year-in-review-by-sarah-hawkins-designs-sfly"},6085:{slug:"classic-school-yearbook-sfly"},6084:{slug:"colorful-elementary-school-yearbook-sfly"},5402:{slug:"everyday-recipes-by-slightly-stationery-sfly"},6083:{slug:"school-days-yearbook-sfly"},6082:{slug:"the-story-of-me-sfly"},6086:{slug:"whimsical-recipes-by-slightly-stationery-sfly"},6101:{slug:"babys-first-sfly"},6103:{slug:"classic-recipes-sfly"},6104:{slug:"elevated-rustic-sfly"},6105:{slug:"boho-summer-sfly"},6116:{slug:"boho-baby-sfly"},6117:{slug:"simply-gallery-sfly"},6118:{slug:"this-is-love-sfly"},6120:{slug:"wedding-gallery-sfly"},6121:{slug:"watercolorwashes-sfly"},6124:{slug:"graduation-photo-album-sfly"},6125:{slug:"modern-year-in-review-photo-album-sfly"},6126:{slug:"black-white-photo-album-sfly"},6132:{slug:"travel-journal-sfly"},6133:{slug:"rustic-gallery-sfly"},6137:{slug:"summer-adventures-sfly"},6075:{slug:"together-again-sfly"},6078:{slug:"everyday-boho-by-umaiana-studio-sfly"},6089:{slug:"colorful-gradients-sfly"},6096:{slug:"simply-scrapbook-sfly"},6097:{slug:"boho-wedding-sfly"},6098:{slug:"black-and-white-rustic-sfly"},6099:{slug:"bright-color-pop-sfly"}},Ge=["8x8","10x10","12x12","8x11","11x8","11x14"],Xe=["sc","hc","pl"],Qe=["sp","sl","dl"],Ze=["low","medium","high"],Ye=["best","most","all"],qe=["none","few","lots"],et=["none","few","lots"];class Tn{constructor(t){h(this,"occasion");h(this,"style");h(this,"book_size");h(this,"cover_type");h(this,"page_type");h(this,"image_density");h(this,"image_filtering");h(this,"embellishment_level");h(this,"text_sticker_level");this.occasion=t.occasion,this.style=t.style,this.book_size=t.book_size,this.cover_type=t.cover_type,this.page_type=t.page_type,this.image_density=t.image_density,this.image_filtering=t.image_filtering,this.embellishment_level=t.embellishment_level,this.text_sticker_level=t.text_sticker_level}}class Q{constructor(t){h(this,"id");h(this,"state");h(this,"title");h(this,"design_request");this.id=t.id,this.state=t.state,this.title=t.title,this.design_request=new Tn(t.design_request)}}function kn(e){const t=he[e.style].slug,n=st({...e});return n.style=t,new Q({id:e.parentId,state:"new",title:e.title,design_request:n})}async function vn(e,t){return F(async()=>{const n=await ye({url:`${B}/api/v1/designoptions/booksize/${e}/imagecount/${t}`});return it(n.data)})}async function _n(e){return F(async()=>new Q((await Je({url:`${B}/api/v1/books`,payload:e})).data))}async function Nn(e){return F(async()=>new Q((await ye({url:`${B}/api/v1/books/${e}`})).data))}async function xn(e){return F(async()=>new Q((await En({url:`${B}/api/v1/books/${e.id}`,payload:e})).data))}async function Cn(e){return F(async()=>(await ye({url:`${B}/api/v1/books/${e}/format/galleon`})).data)}class tt{constructor(t,n){h(this,"parentId");h(this,"title");h(this,"occasion");h(this,"style");h(this,"bookSize");h(this,"coverType");h(this,"pageType");h(this,"imageDensity");h(this,"imageFiltering");h(this,"embellishmentLevel");h(this,"textStickerLevel");h(this,"images");this.parentId=t,this.title=(n==null?void 0:n.title)||"",this.occasion=(n==null?void 0:n.occasion)||We[0],this.style=(n==null?void 0:n.style)||parseInt(Object.keys(he)[0]),this.bookSize=(n==null?void 0:n.bookSize)||Ge[0],this.coverType=(n==null?void 0:n.coverType)||Xe[0],this.pageType=(n==null?void 0:n.pageType)||Qe[0],this.imageDensity=(n==null?void 0:n.imageDensity)||Ze[0],this.imageFiltering=(n==null?void 0:n.imageFiltering)||Ye[0],this.embellishmentLevel=(n==null?void 0:n.embellishmentLevel)||qe[0],this.textStickerLevel=(n==null?void 0:n.textStickerLevel)||et[0],this.images=new Ke(t)}async getOptions(t){return await vn(this.bookSize,t)}async submit(t){return t&&Object.assign(this,t),await xn(kn(this)),this.getProgress(),this}async getJSON(){return await Cn(this.parentId)}async getProgress(){let t="";const n=setInterval(async()=>{const s=(await Nn(this.parentId)).state;if(t!==s){t=s;const r=new CustomEvent("MagicBook.designRequestUpdated",{detail:{state:s}});window.dispatchEvent(r),["error","ready"].includes(s)&&clearInterval(n)}},Sn)}}class Rn{constructor(t){h(this,"apiKey");this.apiKey=t}async createDesignRequest(t){const n=await _n();return new tt(n.id,t)}}g.DesignRequest=tt,g.ImageServer=Ve,g.Images=Ke,g.MagicBookClient=Rn,g.bookSizes=Ge,g.coverTypes=Xe,g.embellishmentLevels=qe,g.imageDensities=Ze,g.imageFilterings=Ye,g.occasions=We,g.pageTypes=Qe,g.states=An,g.styles=he,g.textStickerLevels=et,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(g,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(g=typeof globalThis<"u"?globalThis:g||self,S(g["magicbook-client"]={}))})(this,function(g){"use strict";var Bn=Object.defineProperty;var Dn=(g,S,N)=>S in g?Bn(g,S,{enumerable:!0,configurable:!0,writable:!0,value:N}):g[S]=N;var h=(g,S,N)=>(Dn(g,typeof S!="symbol"?S+"":S,N),N);function S(e,t,n){const s=t.pop()||"",r=t.reduce((i,o)=>i[o]=i[o]||{},e);r[s]=n}function N(e,t){return Object.keys(t).map(n=>{typeof e[n]=="object"&&typeof t[n]=="object"?N(e[n],t[n]):e[n]=t[n]}),e}function rt(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}function me(e){return Object.keys(e).map(t=>{const n=rt(t);n.includes("_")&&(e[n]=e[t],delete e[t]),typeof e[n]=="object"&&(e[n]=me(e[n]))}),e}function it(e){return e.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace("-","").replace("_",""))}function pe(e){return Object.keys(e).map(t=>{const n=it(t);n!==t&&(e[n]=e[t],delete e[t]),typeof e[n]=="object"&&(e[n]=pe(e[n]))}),e}function ge(e,t){return function(){return e.apply(t,arguments)}}const{toString:ot}=Object.prototype,{getPrototypeOf:Y}=Object,j=(e=>t=>{const n=ot.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),T=e=>(e=e.toLowerCase(),t=>j(t)===e),z=e=>t=>typeof t===e,{isArray:R}=Array,L=z("undefined");function at(e){return e!==null&&!L(e)&&e.constructor!==null&&!L(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const be=T("ArrayBuffer");function lt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&be(e.buffer),t}const ct=z("string"),O=z("function"),we=z("number"),H=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,M=e=>{if(j(e)!=="object")return!1;const t=Y(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ft=T("Date"),dt=T("File"),yt=T("Blob"),ht=T("FileList"),mt=e=>H(e)&&O(e.pipe),pt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=j(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},gt=T("URLSearchParams"),bt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function U(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),R(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(s=0;s<o;s++)c=i[s],t.call(null,e[c],c,e)}}function Ee(e,t){t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const Se=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Oe=e=>!L(e)&&e!==Se;function q(){const{caseless:e}=Oe(this)&&this||{},t={},n=(s,r)=>{const i=e&&Ee(t,r)||r;M(t[i])&&M(s)?t[i]=q(t[i],s):M(s)?t[i]=q({},s):R(s)?t[i]=s.slice():t[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&U(arguments[s],n);return t}const wt=(e,t,n,{allOwnKeys:s}={})=>(U(t,(r,i)=>{n&&O(r)?e[i]=ge(r,n):e[i]=r},{allOwnKeys:s}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),St=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Ot=(e,t,n,s)=>{let r,i,o;const c={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)o=r[i],(!s||s(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Y(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},At=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Tt=e=>{if(!e)return null;if(R(e))return e;let t=e.length;if(!we(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},kt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Y(Uint8Array)),vt=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=s.next())&&!r.done;){const i=r.value;t.call(e,i[0],i[1])}},_t=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Nt=T("HTMLFormElement"),xt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),Ae=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Rt=T("RegExp"),Te=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};U(n,(r,i)=>{t(r,i,e)!==!1&&(s[i]=r)}),Object.defineProperties(e,s)},Ct=e=>{Te(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(O(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ft=(e,t)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return R(e)?s(e):s(String(e).split(t)),n},Bt=()=>{},Dt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),ee="abcdefghijklmnopqrstuvwxyz",ke="0123456789",ve={DIGIT:ke,ALPHA:ee,ALPHA_DIGIT:ee+ee.toUpperCase()+ke},Lt=(e=16,t=ve.ALPHA_DIGIT)=>{let n="";const{length:s}=t;for(;e--;)n+=t[Math.random()*s|0];return n};function Ut(e){return!!(e&&O(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const It=e=>{const t=new Array(10),n=(s,r)=>{if(H(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[r]=s;const i=R(s)?[]:{};return U(s,(o,c)=>{const d=n(o,r+1);!L(d)&&(i[c]=d)}),t[r]=void 0,i}}return s};return n(e,0)},Pt=T("AsyncFunction"),a={isArray:R,isArrayBuffer:be,isBuffer:at,isFormData:pt,isArrayBufferView:lt,isString:ct,isNumber:we,isBoolean:ut,isObject:H,isPlainObject:M,isUndefined:L,isDate:ft,isFile:dt,isBlob:yt,isRegExp:Rt,isFunction:O,isStream:mt,isURLSearchParams:gt,isTypedArray:kt,isFileList:ht,forEach:U,merge:q,extend:wt,trim:bt,stripBOM:Et,inherits:St,toFlatObject:Ot,kindOf:j,kindOfTest:T,endsWith:At,toArray:Tt,forEachEntry:vt,matchAll:_t,isHTMLForm:Nt,hasOwnProperty:Ae,hasOwnProp:Ae,reduceDescriptors:Te,freezeMethods:Ct,toObjectSet:Ft,toCamelCase:xt,noop:Bt,toFiniteNumber:Dt,findKey:Ee,global:Se,isContextDefined:Oe,ALPHABET:ve,generateString:Lt,isSpecCompliantForm:Ut,toJSONObject:It,isAsyncFn:Pt,isThenable:e=>e&&(H(e)||O(e))&&O(e.then)&&O(e.catch)};function p(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r)}a.inherits(p,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const _e=p.prototype,Ne={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ne[e]={value:e}}),Object.defineProperties(p,Ne),Object.defineProperty(_e,"isAxiosError",{value:!0}),p.from=(e,t,n,s,r,i)=>{const o=Object.create(_e);return a.toFlatObject(e,o,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),p.call(o,e.message,t,n,s,r),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const jt=null;function te(e){return a.isPlainObject(e)||a.isArray(e)}function xe(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,n){return e?e.concat(t).map(function(r,i){return r=xe(r),!n&&i?"["+r+"]":r}).join(n?".":""):t}function zt(e){return a.isArray(e)&&!e.some(te)}const Ht=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function $(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,_){return!a.isUndefined(_[m])});const s=n.metaTokens,r=n.visitor||u,i=n.dots,o=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!d&&a.isBlob(f))throw new p("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,m,_){let A=f;if(f&&!_&&typeof f=="object"){if(a.endsWith(m,"{}"))m=s?m:m.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&zt(f)||(a.isFileList(f)||a.endsWith(m,"[]"))&&(A=a.toArray(f)))return m=xe(m),A.forEach(function(Z,Fn){!(a.isUndefined(Z)||Z===null)&&t.append(o===!0?Re([m],Fn,i):o===null?m:m+"[]",l(Z))}),!1}return te(f)?!0:(t.append(Re(_,m,i),l(f)),!1)}const y=[],E=Object.assign(Ht,{defaultVisitor:u,convertValue:l,isVisitable:te});function b(f,m){if(!a.isUndefined(f)){if(y.indexOf(f)!==-1)throw Error("Circular reference detected in "+m.join("."));y.push(f),a.forEach(f,function(A,D){(!(a.isUndefined(A)||A===null)&&r.call(t,A,a.isString(D)?D.trim():D,m,E))===!0&&b(A,m?m.concat(D):[D])}),y.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function ne(e,t){this._pairs=[],e&&$(e,this,t)}const Fe=ne.prototype;Fe.append=function(t,n){this._pairs.push([t,n])},Fe.toString=function(t){const n=t?function(s){return t.call(this,s,Ce)}:Ce;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Mt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,n){if(!t)return e;const s=n&&n.encode||Mt,r=n&&n.serialize;let i;if(r?i=r(t,n):i=a.isURLSearchParams(t)?t.toString():new ne(t,n).toString(s),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class $t{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(s){s!==null&&t(s)})}}const De=$t,Le={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jt=typeof URLSearchParams<"u"?URLSearchParams:ne,Kt=typeof FormData<"u"?FormData:null,Vt=typeof Blob<"u"?Blob:null,Wt=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Gt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),k={isBrowser:!0,classes:{URLSearchParams:Jt,FormData:Kt,Blob:Vt},isStandardBrowserEnv:Wt,isStandardBrowserWebWorkerEnv:Gt,protocols:["http","https","file","blob","url","data"]};function Xt(e,t){return $(e,new k.classes.URLSearchParams,Object.assign({visitor:function(n,s,r,i){return k.isNode&&a.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Qt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Zt(e){const t={},n=Object.keys(e);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],t[i]=e[i];return t}function Ue(e){function t(n,s,r,i){let o=n[i++];const c=Number.isFinite(+o),d=i>=n.length;return o=!o&&a.isArray(r)?r.length:o,d?(a.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!c):((!r[o]||!a.isObject(r[o]))&&(r[o]=[]),t(n,s,r[o],i)&&a.isArray(r[o])&&(r[o]=Zt(r[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(s,r)=>{t(Qt(s),r,n,0)}),n}return null}const Yt={"Content-Type":void 0};function qt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const J={transitional:Le,adapter:["xhr","http"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r&&r?JSON.stringify(Ue(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Xt(t,this.formSerializer).toString();if((c=a.isFileList(t))||s.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return $(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),qt(t)):t}],transformResponse:[function(t){const n=this.transitional||J.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&a.isString(t)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?p.from(c,p.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:k.classes.FormData,Blob:k.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){J.headers[t]={}}),a.forEach(["post","put","patch"],function(t){J.headers[t]=a.merge(Yt)});const se=J,en=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tn=e=>{const t={};let n,s,r;return e&&e.split(`
|
|
2
|
+
`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||t[n]&&en[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},Ie=Symbol("internals");function I(e){return e&&String(e).trim().toLowerCase()}function K(e){return e===!1||e==null?e:a.isArray(e)?e.map(K):String(e)}function nn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const sn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function re(e,t,n,s,r){if(a.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!a.isString(t)){if(a.isString(s))return t.indexOf(s)!==-1;if(a.isRegExp(s))return s.test(t)}}function rn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function on(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,i,o){return this[s].call(this,t,r,i,o)},configurable:!0})})}class V{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function i(c,d,l){const u=I(d);if(!u)throw new Error("header name must be a non-empty string");const y=a.findKey(r,u);(!y||r[y]===void 0||l===!0||l===void 0&&r[y]!==!1)&&(r[y||d]=K(c))}const o=(c,d)=>a.forEach(c,(l,u)=>i(l,u,d));return a.isPlainObject(t)||t instanceof this.constructor?o(t,n):a.isString(t)&&(t=t.trim())&&!sn(t)?o(tn(t),n):t!=null&&i(n,t,s),this}get(t,n){if(t=I(t),t){const s=a.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return nn(r);if(a.isFunction(n))return n.call(this,r,s);if(a.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=I(t),t){const s=a.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||re(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function i(o){if(o=I(o),o){const c=a.findKey(s,o);c&&(!n||re(s,s[c],c,n))&&(delete s[c],r=!0)}}return a.isArray(t)?t.forEach(i):i(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!t||re(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){const n=this,s={};return a.forEach(this,(r,i)=>{const o=a.findKey(s,i);if(o){n[o]=K(r),delete n[i];return}const c=t?rn(i):String(i).trim();c!==i&&delete n[i],n[c]=K(r),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&a.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[Ie]=this[Ie]={accessors:{}}).accessors,r=this.prototype;function i(o){const c=I(o);s[c]||(on(r,o),s[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}}V.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.freezeMethods(V.prototype),a.freezeMethods(V);const v=V;function ie(e,t){const n=this||se,s=t||n,r=v.from(s.headers);let i=s.data;return a.forEach(e,function(c){i=c.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Pe(e){return!!(e&&e.__CANCEL__)}function P(e,t,n){p.call(this,e??"canceled",p.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(P,p,{__CANCEL__:!0});function an(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new p("Request failed with status code "+n.status,[p.ERR_BAD_REQUEST,p.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const ln=k.isStandardBrowserEnv?function(){return{write:function(n,s,r,i,o,c){const d=[];d.push(n+"="+encodeURIComponent(s)),a.isNumber(r)&&d.push("expires="+new Date(r).toGMTString()),a.isString(i)&&d.push("path="+i),a.isString(o)&&d.push("domain="+o),c===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function cn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function un(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function je(e,t){return e&&!cn(t)?un(e,t):t}const fn=k.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function r(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=r(window.location.href),function(o){const c=a.isString(o)?r(o):o;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}();function dn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yn(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(d){const l=Date.now(),u=s[i];o||(o=l),n[r]=d,s[r]=l;let y=i,E=0;for(;y!==r;)E+=n[y++],y=y%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),l-o<t)return;const b=u&&l-u;return b?Math.round(E*1e3/b):void 0}}function ze(e,t){let n=0;const s=yn(50,250);return r=>{const i=r.loaded,o=r.lengthComputable?r.total:void 0,c=i-n,d=s(c),l=i<=o;n=i;const u={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:d||void 0,estimated:d&&o&&l?(o-i)/d:void 0,event:r};u[t?"download":"upload"]=!0,e(u)}}const W={http:jt,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,s){let r=e.data;const i=v.from(e.headers).normalize(),o=e.responseType;let c;function d(){e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}a.isFormData(r)&&(k.isStandardBrowserEnv||k.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let l=new XMLHttpRequest;if(e.auth){const b=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(b+":"+f))}const u=je(e.baseURL,e.url);l.open(e.method.toUpperCase(),Be(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function y(){if(!l)return;const b=v.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),m={data:!o||o==="text"||o==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:b,config:e,request:l};an(function(A){n(A),d()},function(A){s(A),d()},m),l=null}if("onloadend"in l?l.onloadend=y:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(y)},l.onabort=function(){l&&(s(new p("Request aborted",p.ECONNABORTED,e,l)),l=null)},l.onerror=function(){s(new p("Network Error",p.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let f=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||Le;e.timeoutErrorMessage&&(f=e.timeoutErrorMessage),s(new p(f,m.clarifyTimeoutError?p.ETIMEDOUT:p.ECONNABORTED,e,l)),l=null},k.isStandardBrowserEnv){const b=(e.withCredentials||fn(u))&&e.xsrfCookieName&&ln.read(e.xsrfCookieName);b&&i.set(e.xsrfHeaderName,b)}r===void 0&&i.setContentType(null),"setRequestHeader"in l&&a.forEach(i.toJSON(),function(f,m){l.setRequestHeader(m,f)}),a.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&o!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",ze(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",ze(e.onUploadProgress)),(e.cancelToken||e.signal)&&(c=b=>{l&&(s(!b||b.type?new P(null,e,l):b),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));const E=dn(u);if(E&&k.protocols.indexOf(E)===-1){s(new p("Unsupported protocol "+E+":",p.ERR_BAD_REQUEST,e));return}l.send(r||null)})}};a.forEach(W,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const hn={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,s;for(let r=0;r<t&&(n=e[r],!(s=a.isString(n)?W[n.toLowerCase()]:n));r++);if(!s)throw s===!1?new p(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(W,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:W};function oe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new P(null,e)}function He(e){return oe(e),e.headers=v.from(e.headers),e.data=ie.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hn.getAdapter(e.adapter||se.adapter)(e).then(function(s){return oe(e),s.data=ie.call(e,e.transformResponse,s),s.headers=v.from(s.headers),s},function(s){return Pe(s)||(oe(e),s&&s.response&&(s.response.data=ie.call(e,e.transformResponse,s.response),s.response.headers=v.from(s.response.headers))),Promise.reject(s)})}const Me=e=>e instanceof v?e.toJSON():e;function C(e,t){t=t||{};const n={};function s(l,u,y){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:y},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function r(l,u,y){if(a.isUndefined(u)){if(!a.isUndefined(l))return s(void 0,l,y)}else return s(l,u,y)}function i(l,u){if(!a.isUndefined(u))return s(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return s(void 0,l)}else return s(void 0,u)}function c(l,u,y){if(y in t)return s(l,u);if(y in e)return s(void 0,l)}const d={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u)=>r(Me(l),Me(u),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(u){const y=d[u]||r,E=y(e[u],t[u],u);a.isUndefined(E)&&y!==c||(n[u]=E)}),n}const $e="1.4.0",ae={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ae[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Je={};ae.transitional=function(t,n,s){function r(i,o){return"[Axios v"+$e+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,c)=>{if(t===!1)throw new p(r(o," has been removed"+(n?" in "+n:"")),p.ERR_DEPRECATED);return n&&!Je[o]&&(Je[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function mn(e,t,n){if(typeof e!="object")throw new p("options must be an object",p.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const i=s[r],o=t[i];if(o){const c=e[i],d=c===void 0||o(c,i,e);if(d!==!0)throw new p("option "+i+" must be "+d,p.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new p("Unknown option "+i,p.ERR_BAD_OPTION)}}const le={assertOptions:mn,validators:ae},x=le.validators;class G{constructor(t){this.defaults=t,this.interceptors={request:new De,response:new De}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=C(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&le.assertOptions(s,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean)},!1),r!=null&&(a.isFunction(r)?n.paramsSerializer={serialize:r}:le.assertOptions(r,{encode:x.function,serialize:x.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&a.merge(i.common,i[n.method]),o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=v.concat(o,i);const c=[];let d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(d=d&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,y=0,E;if(!d){const f=[He.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,l),E=f.length,u=Promise.resolve(n);y<E;)u=u.then(f[y++],f[y++]);return u}E=c.length;let b=n;for(y=0;y<E;){const f=c[y++],m=c[y++];try{b=f(b)}catch(_){m.call(this,_);break}}try{u=He.call(this,b)}catch(f){return Promise.reject(f)}for(y=0,E=l.length;y<E;)u=u.then(l[y++],l[y++]);return u}getUri(t){t=C(this.defaults,t);const n=je(t.baseURL,t.url);return Be(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){G.prototype[t]=function(n,s){return this.request(C(s||{},{method:t,url:n,data:(s||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(s){return function(i,o,c){return this.request(C(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}G.prototype[t]=n(),G.prototype[t+"Form"]=n(!0)});const X=G;class ce{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(c=>{s.subscribe(c),i=c}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},t(function(i,o,c){s.reason||(s.reason=new P(i,o,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ce(function(r){t=r}),cancel:t}}}const pn=ce;function gn(e){return function(n){return e.apply(null,n)}}function bn(e){return a.isObject(e)&&e.isAxiosError===!0}const ue={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ue).forEach(([e,t])=>{ue[t]=e});const wn=ue;function Ke(e){const t=new X(e),n=ge(X.prototype.request,t);return a.extend(n,X.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Ke(C(e,r))},n}const w=Ke(se);w.Axios=X,w.CanceledError=P,w.CancelToken=pn,w.isCancel=Pe,w.VERSION=$e,w.toFormData=$,w.AxiosError=p,w.Cancel=w.CanceledError,w.all=function(t){return Promise.all(t)},w.spread=gn,w.isAxiosError=bn,w.mergeConfig=C,w.AxiosHeaders=v,w.formToJSON=e=>Ue(a.isHTMLForm(e)?new FormData(e):e),w.HttpStatusCode=wn,w.default=w;const fe=w;function de({needsToken:e=!0,options:t}){let n={};return e&&S(n,["headers","Authorization"],"Bearer TOKEN"),t&&(n=N(n,t)),n}async function ye({url:e,needsToken:t,options:n}){return await fe.get(e,de({needsToken:t,options:n}))}async function Ve({url:e,needsToken:t,options:n,payload:s={}}){return await fe.post(e,s,de({needsToken:t,options:n}))}async function En({url:e,needsToken:t,options:n,payload:s}){return await fe.put(e,s,de({needsToken:t,options:n}))}async function F(e){try{return await e()}catch(t){return Promise.reject(t)}}const B="https://zrrpg8wwbe.execute-api.us-east-1.amazonaws.com/sfly-sls",Sn="1000";async function On(e,t){return F(async()=>await Ve({url:`${B}/api/v1/images/book/${e}`,payload:t}))}class We{constructor(t){h(this,"parentId");h(this,"images");h(this,"length");this.parentId=t,this.images=[],this.length=this.images.length}async add(t){return this.images.push(t),this.length=this.images.length,await On(this.parentId,new Ge(t)),new Promise(n=>{n(this.length)})}}class Ge{constructor(t){h(this,"handle");h(this,"url");h(this,"width");h(this,"height");h(this,"orientation");h(this,"taken_at");h(this,"camera_make");h(this,"camera");h(this,"filename");this.handle=t.handle,this.url=t.url,this.width=t.width,this.height=t.height,this.orientation=t.rotation,this.taken_at=t.captureTime,this.camera_make=t.cameraMake,this.camera=t.cameraModel,this.filename=t.filename}}const An=["new","ingesting","submitted","storyboarding","storyboarding succeeded","designing","designing succeeded","layouting","layouting succeeded","embellishing","embellishing succeeded","polishing","polishing succeeded","ready","error"],Xe=["baby","birthday","default","everyday","family","kids","life-stories","portfolio","school-memories","seasonal-holidays","special-celebrations","sports-and-hobbies","travel","wedding","year-in-review"],he={1005:{slug:"modern-black-sfly"},1101:{slug:"bon-voyage-sfly"},1103:{slug:"fun-in-the-sun-sfly"},1201:{slug:"modern-wedding-sfly"},3001:{slug:"digiscrap-sfly"},4034:{slug:"travel-snapshots-sfly"},4035:{slug:"vintage-travel-sfly"},5017:{slug:"natural-neutrals-sfly"},5033:{slug:"chalkboard-chic-sfly"},5079:{slug:"hello-spring-sfly"},5082:{slug:"familygram-sfly"},5085:{slug:"best-day-ever-sfly"},5091:{slug:"little-love-sfly"},5118:{slug:"a-year-in-color-sfly"},5120:{slug:"milestone-anniversaries-sfly"},5121:{slug:"the-travel-bug-sfly"},5122:{slug:"modern-white-sfly"},5127:{slug:"outdoor-wedding-sfly"},5134:{slug:"classic-wedding-sfly"},5138:{slug:"kraft-pop-sfly"},5142:{slug:"simply-black-sfly"},5144:{slug:"autumn-memories-sfly"},5146:{slug:"everyday-sentiments-sfly"},5149:{slug:"everyday-happiness-sfly"},5150:{slug:"its-a-girl-thing-sfly"},5155:{slug:"made-with-love-sfly"},5157:{slug:"high-school-memories-sfly"},5161:{slug:"rustic-wedding-sfly"},5165:{slug:"life-is-grand-sfly"},5167:{slug:"adventure-awaits-sfly"},5168:{slug:"disney-adventure-sfly"},5171:{slug:"world-travel-sfly"},5174:{slug:"hello-summer-sfly"},5183:{slug:"everything-sports-sfly"},5188:{slug:"everyday-watercolor-sfly"},5189:{slug:"holiday-memories-sfly"},5213:{slug:"love-and-thanks-sfly"},5218:{slug:"babys-first-year-sfly"},5219:{slug:"usa-travel-sfly"},5220:{slug:"vintage-wedding-sfly"},5226:{slug:"love-you-because-sfly"},5228:{slug:"reunion-sfly"},5238:{slug:"whimsy-chalkboard-sfly"},5242:{slug:"modern-indigo-sfly"},5250:{slug:"family-yearbook-sfly"},5255:{slug:"elegant-wedding-sfly"},5258:{slug:"family-vacation-sfly"},5259:{slug:"beach-travel-sfly"},5261:{slug:"sparkle-and-shine-sfly"},5262:{slug:"welcome-baby-sfly"},5265:{slug:"vivid-watercolor-sfly"},5266:{slug:"what-i-love-about-you-sfly"},5272:{slug:"love-grows-sfly"},5274:{slug:"painted-seasons-sfly"},5278:{slug:"vintage-disney-sfly"},5292:{slug:"modern-grey-sfly"},5297:{slug:"modern-love-story-sfly"},5299:{slug:"modern-travel-sfly"},5304:{slug:"beach-wedding-sfly"},5305:{slug:"rustic-farmhouse-sfly"},5308:{slug:"tropical-travel-sfly"},6e3:{slug:"travel-abroad-sfly"},6001:{slug:"everyday-rustic-sfly"},6002:{slug:"simply-modern-sfly"},6003:{slug:"modern-baby-sfly"},6004:{slug:"modern-photo-album-sfly"},6005:{slug:"travel-adventures-sfly"},6006:{slug:"watercolor-year-in-review-sfly"},6007:{slug:"beach-bliss-sfly"},6008:{slug:"simply-gray-sfly"},6009:{slug:"family-favorites-by-lure-design-sfly"},6010:{slug:"travel-gallery-sfly"},6011:{slug:"our-wedding-day-sfly"},6012:{slug:"chic-celebrations-by-float-paperie-sfly"},6013:{slug:"simply-bold-type-sfly"},6014:{slug:"colorful-florals-by-potts-design-sfly"},6015:{slug:"softly-rustic-sfly"},6016:{slug:"ombre-watercolor-sfly"},6017:{slug:"forever-love-by-with-merriment-sfly"},6018:{slug:"colorful-memories-by-britt-bass-sfly"},6019:{slug:"celebrate-family-by-float-paperie-sfly"},6020:{slug:"disney-family-adventures-sfly"},6021:{slug:"everyday-neutrals-sfly"},6022:{slug:"colorful-childhood-sfly"},6023:{slug:"everyday-indigo-sfly"},6024:{slug:"shimmer-and-shine-sfly"},6025:{slug:"summertime-fun-sfly"},6026:{slug:"pet-lover-sfly"},6027:{slug:"modern-wedding-story-sfly"},6028:{slug:"family-blessings-by-potts-design-sfly"},6030:{slug:"outdoor-adventures-by-sarah-hawkins-designs-sfly"},6031:{slug:"travel-memories-sfly"},6032:{slug:"tropical-travels-sfly"},6033:{slug:"everyday-chalkboard-by-potts-design-sfly"},6034:{slug:"classic-disney-sfly"},6035:{slug:"cheerful-color-sfly"},6036:{slug:"colorful-birthday-sfly"},6038:{slug:"classic-baby-sfly"},6039:{slug:"bold-year-in-review-by-float-paperie-sfly"},6040:{slug:"colorfully-fun-sfly"},6041:{slug:"colorful-year-in-review-by-sarah-hawkins-designs-sfly"},6042:{slug:"gilded-wedding-sfly"},6043:{slug:"road-trip-travel-by-sarah-hawkins-designs-sfly"},6044:{slug:"rustic-gilded-wedding-sfly"},6045:{slug:"elegantly-scripted-year-in-review-sfly"},6047:{slug:"2020-what-a-year-sfly"},6057:{slug:"best-mom-ever-sfly"},6052:{slug:"celebration-of-life-by-sarah-hawkins-designs-sfly"},6054:{slug:"colorful-school-days-by-float-paperie-sfly"},6051:{slug:"love-is-all-we-need-sfly"},6058:{slug:"graduation-celebration-sfly"},6056:{slug:"our-wedding-day-guestbook-sfly"},6055:{slug:"muted-everyday-abstract-sfly"},6046:{slug:"winter-memories-by-sarah-hawkins-design-sfly"},6053:{slug:"best-dad-ever-sfly"},6050:{slug:"watercolor-greenery-by-sarah-hawkins-designs-sfly"},6063:{slug:"watercolor-floral-wedding-by-kim-thoa-sfly"},6060:{slug:"watercolor-baby-girl-sfly"},6059:{slug:"watercolor-baby-boy-sfly"},6048:{slug:"simple-elegant-wedding-sfly"},6049:{slug:"gilded-wedding-guestbook-sfly"},6037:{slug:"everyday-fairytale-by-jenny-romanski-sfly"},6061:{slug:"best-grandparents-ever-sfly"},6068:{slug:"winter-getaway-sfly"},6067:{slug:"national-parks-travel-by-eiman-design-co-sfly"},6065:{slug:"go-sports-by-lure-design-sfly"},6066:{slug:"elegant-wedding-greenery-by-kim-thoa-sfly"},6064:{slug:"boho-travel-by-umaiana-studio-sfly"},6071:{slug:"modern-dark-neutrals-sfly"},6072:{slug:"modern-light-neutrals-sfly"},6073:{slug:"modern-celebrations-sfly"},6074:{slug:"bright-and-bold-kids-year-in-review-by-sarah-hawkins-designs-sfly"},6085:{slug:"classic-school-yearbook-sfly"},6084:{slug:"colorful-elementary-school-yearbook-sfly"},5402:{slug:"everyday-recipes-by-slightly-stationery-sfly"},6083:{slug:"school-days-yearbook-sfly"},6082:{slug:"the-story-of-me-sfly"},6086:{slug:"whimsical-recipes-by-slightly-stationery-sfly"},6101:{slug:"babys-first-sfly"},6103:{slug:"classic-recipes-sfly"},6104:{slug:"elevated-rustic-sfly"},6105:{slug:"boho-summer-sfly"},6116:{slug:"boho-baby-sfly"},6117:{slug:"simply-gallery-sfly"},6118:{slug:"this-is-love-sfly"},6120:{slug:"wedding-gallery-sfly"},6121:{slug:"watercolorwashes-sfly"},6124:{slug:"graduation-photo-album-sfly"},6125:{slug:"modern-year-in-review-photo-album-sfly"},6126:{slug:"black-white-photo-album-sfly"},6132:{slug:"travel-journal-sfly"},6133:{slug:"rustic-gallery-sfly"},6137:{slug:"summer-adventures-sfly"},6075:{slug:"together-again-sfly"},6078:{slug:"everyday-boho-by-umaiana-studio-sfly"},6089:{slug:"colorful-gradients-sfly"},6096:{slug:"simply-scrapbook-sfly"},6097:{slug:"boho-wedding-sfly"},6098:{slug:"black-and-white-rustic-sfly"},6099:{slug:"bright-color-pop-sfly"}},Qe=["8x8","10x10","12x12","8x11","11x8","11x14"],Ze=["sc","hc","pl"],Ye=["sp","sl","dl"],qe=["low","medium","high"],et=["best","most","all"],tt=["none","few","lots"],nt=["none","few","lots"];class Tn{constructor(t){h(this,"occasion");h(this,"style");h(this,"book_size");h(this,"cover_type");h(this,"page_type");h(this,"image_density");h(this,"image_filtering");h(this,"embellishment_level");h(this,"text_sticker_level");this.occasion=t.occasion,this.style=t.style,this.book_size=t.book_size,this.cover_type=t.cover_type,this.page_type=t.page_type,this.image_density=t.image_density,this.image_filtering=t.image_filtering,this.embellishment_level=t.embellishment_level,this.text_sticker_level=t.text_sticker_level}}class Q{constructor(t){h(this,"id");h(this,"state");h(this,"title");h(this,"design_request");this.id=t.id,this.state=t.state,this.title=t.title,this.design_request=new Tn(t.design_request)}}function kn(e){const t=he[e.style].slug,n=me({...e});return n.style=t,new Q({id:e.parentId,state:"new",title:e.title,design_request:n})}async function vn(e,t){return F(async()=>{const n=await ye({url:`${B}/api/v1/designoptions/booksize/${e}/imagecount/${t}`});return pe(n.data)})}async function _n(e){return F(async()=>new Q((await Ve({url:`${B}/api/v1/books`,payload:e})).data))}async function Nn(e){return F(async()=>new Q((await ye({url:`${B}/api/v1/books/${e}`})).data))}async function xn(e){return F(async()=>new Q((await En({url:`${B}/api/v1/books/${e.id}`,payload:e})).data))}async function Rn(e){return F(async()=>(await ye({url:`${B}/api/v1/books/${e}/format/galleon`})).data)}class st{constructor(t,n){h(this,"parentId");h(this,"title");h(this,"occasion");h(this,"style");h(this,"bookSize");h(this,"coverType");h(this,"pageType");h(this,"imageDensity");h(this,"imageFiltering");h(this,"embellishmentLevel");h(this,"textStickerLevel");h(this,"images");this.parentId=t,this.title=(n==null?void 0:n.title)||"",this.occasion=(n==null?void 0:n.occasion)||Xe[0],this.style=(n==null?void 0:n.style)||parseInt(Object.keys(he)[0]),this.bookSize=(n==null?void 0:n.bookSize)||Qe[0],this.coverType=(n==null?void 0:n.coverType)||Ze[0],this.pageType=(n==null?void 0:n.pageType)||Ye[0],this.imageDensity=(n==null?void 0:n.imageDensity)||qe[0],this.imageFiltering=(n==null?void 0:n.imageFiltering)||et[0],this.embellishmentLevel=(n==null?void 0:n.embellishmentLevel)||tt[0],this.textStickerLevel=(n==null?void 0:n.textStickerLevel)||nt[0],this.images=new We(t)}async getOptions(t){return await vn(this.bookSize,t)}async submit(t){return t&&Object.assign(this,t),await xn(kn(this)),this.getProgress(),this}async getJSON(){return await Rn(this.parentId)}async getProgress(){let t="";const n=setInterval(async()=>{const s=(await Nn(this.parentId)).state;if(t!==s){t=s;const r=new CustomEvent("MagicBook.designRequestUpdated",{detail:{state:s}});window.dispatchEvent(r),["error","ready"].includes(s)&&clearInterval(n)}},Sn)}}class Cn{constructor(t){h(this,"apiKey");this.apiKey=t}async createDesignRequest(t){const n=await _n();return new st(n.id,t)}}g.DesignRequest=st,g.ImageServer=Ge,g.Images=We,g.MagicBookClient=Cn,g.bookSizes=Qe,g.coverTypes=Ze,g.embellishmentLevels=tt,g.imageDensities=qe,g.imageFilterings=et,g.occasions=Xe,g.pageTypes=Ye,g.states=An,g.styles=he,g.textStickerLevels=nt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED