@frontify/fondue 12.0.0-beta.16 → 12.0.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/RichTextEditor/Plugins/CheckboxListPlugin/CheckboxListButton/CheckboxListToolbarButton.es.js +8 -8
- package/dist/components/RichTextEditor/Plugins/CheckboxListPlugin/CheckboxListButton/CheckboxListToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +4 -2
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +32 -27
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +13 -6
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/index.d.ts +1 -0
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.d.ts +2 -0
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +38 -0
- package/dist/components/RichTextEditor/Plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -0
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Slider/Slider.es.js.map +1 -1
- package/dist/index.cjs.js +10 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.umd.js +10 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/node_modules/@udecode/plate-core/dist/index.es.es.js +1482 -0
- package/dist/node_modules/@udecode/plate-core/dist/index.es.es.js.map +1 -0
- package/dist/node_modules/@udecode/plate-floating/dist/index.es.es.js +21 -0
- package/dist/node_modules/@udecode/plate-floating/dist/index.es.es.js.map +1 -0
- package/dist/node_modules/@udecode/zustood/dist/index.es.es.js +439 -0
- package/dist/node_modules/@udecode/zustood/dist/index.es.es.js.map +1 -0
- package/dist/node_modules/@udecode/zustood/node_modules/react-tracked/dist/index.modern.es.js +21 -0
- package/dist/node_modules/@udecode/zustood/node_modules/react-tracked/dist/index.modern.es.js.map +1 -0
- package/dist/node_modules/hotkeys-js/dist/hotkeys.esm.es.js +275 -0
- package/dist/node_modules/hotkeys-js/dist/hotkeys.esm.es.js.map +1 -0
- package/dist/node_modules/jotai/esm/index.es.js +418 -0
- package/dist/node_modules/jotai/esm/index.es.js.map +1 -0
- package/dist/node_modules/proxy-compare/dist/index.modern.es.js +74 -0
- package/dist/node_modules/proxy-compare/dist/index.modern.es.js.map +1 -0
- package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.es.js +7 -0
- package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.es.js.map +1 -0
- package/dist/node_modules/zustand/esm/index.es.js +62 -0
- package/dist/node_modules/zustand/esm/index.es.js.map +1 -0
- package/dist/node_modules/zustand/esm/middleware.es.js +219 -0
- package/dist/node_modules/zustand/esm/middleware.es.js.map +1 -0
- package/dist/node_modules/zustand/esm/vanilla.es.js +26 -0
- package/dist/node_modules/zustand/esm/vanilla.es.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { useState as pt, useEffect as N, useRef as Et, createElement as St, createContext as At, useContext as rt, useReducer as wt, useDebugValue as ht, useCallback as Mt } from "react";
|
|
2
|
+
const _ = Symbol(), it = (s) => !!s[_], et = (s) => !s[_].c, C = (s) => {
|
|
3
|
+
var f;
|
|
4
|
+
const { b: d, c: l } = s[_];
|
|
5
|
+
l && (l(), (f = mt.get(d)) == null || f());
|
|
6
|
+
}, U = (s, f) => {
|
|
7
|
+
const d = s[_].o, l = f[_].o;
|
|
8
|
+
return d === l || s === l || it(d) && U(d, f);
|
|
9
|
+
}, nt = (s, f) => {
|
|
10
|
+
const d = {
|
|
11
|
+
b: s,
|
|
12
|
+
o: f,
|
|
13
|
+
c: null
|
|
14
|
+
}, l = new Promise((a) => {
|
|
15
|
+
d.c = () => {
|
|
16
|
+
d.c = null, a();
|
|
17
|
+
}, f.finally(d.c);
|
|
18
|
+
});
|
|
19
|
+
return l[_] = d, l;
|
|
20
|
+
}, mt = /* @__PURE__ */ new WeakMap(), b = (s) => "init" in s, F = "r", j = "w", T = "c", G = "s", ot = "h", Ot = "n", gt = "l", Dt = "a", Rt = "m", _t = (s) => {
|
|
21
|
+
const f = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new Map();
|
|
22
|
+
let a, w;
|
|
23
|
+
if (({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && (a = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set()), s)
|
|
24
|
+
for (const [e, t] of s) {
|
|
25
|
+
const n = {
|
|
26
|
+
v: t,
|
|
27
|
+
r: 0,
|
|
28
|
+
y: !0,
|
|
29
|
+
d: /* @__PURE__ */ new Map()
|
|
30
|
+
};
|
|
31
|
+
({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && (Object.freeze(n), b(e) || console.warn("Found initial value for derived atom which can cause unexpected behavior", e)), f.set(e, n);
|
|
32
|
+
}
|
|
33
|
+
const A = /* @__PURE__ */ new WeakMap(), h = (e, t, n) => {
|
|
34
|
+
let o = A.get(t);
|
|
35
|
+
o || (o = /* @__PURE__ */ new Map(), A.set(t, o)), n.then(() => {
|
|
36
|
+
o.get(e) === n && (o.delete(e), o.size || A.delete(t));
|
|
37
|
+
}), o.set(e, n);
|
|
38
|
+
}, D = (e) => {
|
|
39
|
+
const t = /* @__PURE__ */ new Set(), n = A.get(e);
|
|
40
|
+
return n && (A.delete(e), n.forEach((o, r) => {
|
|
41
|
+
C(o), t.add(r);
|
|
42
|
+
})), t;
|
|
43
|
+
}, M = /* @__PURE__ */ new WeakMap(), m = (e) => {
|
|
44
|
+
let t = M.get(e);
|
|
45
|
+
return t || (t = /* @__PURE__ */ new Map(), M.set(e, t)), t;
|
|
46
|
+
}, p = (e, t) => {
|
|
47
|
+
if (e) {
|
|
48
|
+
const n = m(e);
|
|
49
|
+
let o = n.get(t);
|
|
50
|
+
return o || (o = p(e.p, t), o && "p" in o && et(o.p) && (o = void 0), o && n.set(t, o)), o;
|
|
51
|
+
}
|
|
52
|
+
return f.get(t);
|
|
53
|
+
}, E = (e, t, n) => {
|
|
54
|
+
if (({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && Object.freeze(n), e)
|
|
55
|
+
m(e).set(t, n);
|
|
56
|
+
else {
|
|
57
|
+
const o = f.get(t);
|
|
58
|
+
f.set(t, n), l.has(t) || l.set(t, o);
|
|
59
|
+
}
|
|
60
|
+
}, S = (e, t = /* @__PURE__ */ new Map(), n) => {
|
|
61
|
+
if (!n)
|
|
62
|
+
return t;
|
|
63
|
+
const o = /* @__PURE__ */ new Map();
|
|
64
|
+
let r = !1;
|
|
65
|
+
return n.forEach((i) => {
|
|
66
|
+
var c;
|
|
67
|
+
const u = ((c = p(e, i)) == null ? void 0 : c.r) || 0;
|
|
68
|
+
o.set(i, u), t.get(i) !== u && (r = !0);
|
|
69
|
+
}), t.size === o.size && !r ? t : o;
|
|
70
|
+
}, P = (e, t, n, o, r) => {
|
|
71
|
+
const i = p(e, t);
|
|
72
|
+
if (i) {
|
|
73
|
+
if (r && (!("p" in i) || !U(i.p, r)))
|
|
74
|
+
return i;
|
|
75
|
+
"p" in i && C(i.p);
|
|
76
|
+
}
|
|
77
|
+
const c = {
|
|
78
|
+
v: n,
|
|
79
|
+
r: (i == null ? void 0 : i.r) || 0,
|
|
80
|
+
y: !0,
|
|
81
|
+
d: S(e, i == null ? void 0 : i.d, o)
|
|
82
|
+
};
|
|
83
|
+
let u = !(i != null && i.y);
|
|
84
|
+
return !i || !("v" in i) || !Object.is(i.v, n) ? (u = !0, ++c.r, c.d.has(t) && (c.d = new Map(c.d).set(t, c.r))) : c.d !== i.d && (c.d.size !== i.d.size || !Array.from(c.d.keys()).every((g) => i.d.has(g))) && (u = !0, Promise.resolve().then(() => {
|
|
85
|
+
y(e);
|
|
86
|
+
})), i && !u ? i : (E(e, t, c), c);
|
|
87
|
+
}, $ = (e, t, n, o, r) => {
|
|
88
|
+
const i = p(e, t);
|
|
89
|
+
if (i) {
|
|
90
|
+
if (r && (!("p" in i) || !U(i.p, r)))
|
|
91
|
+
return i;
|
|
92
|
+
"p" in i && C(i.p);
|
|
93
|
+
}
|
|
94
|
+
const c = {
|
|
95
|
+
e: n,
|
|
96
|
+
r: ((i == null ? void 0 : i.r) || 0) + 1,
|
|
97
|
+
y: !0,
|
|
98
|
+
d: S(e, i == null ? void 0 : i.d, o)
|
|
99
|
+
};
|
|
100
|
+
return E(e, t, c), c;
|
|
101
|
+
}, H = (e, t, n, o) => {
|
|
102
|
+
const r = p(e, t);
|
|
103
|
+
if (r && "p" in r) {
|
|
104
|
+
if (U(r.p, n))
|
|
105
|
+
return r.y ? r : { ...r, y: !0 };
|
|
106
|
+
C(r.p);
|
|
107
|
+
}
|
|
108
|
+
h(e, t, n);
|
|
109
|
+
const i = {
|
|
110
|
+
p: n,
|
|
111
|
+
r: ((r == null ? void 0 : r.r) || 0) + 1,
|
|
112
|
+
y: !0,
|
|
113
|
+
d: S(e, r == null ? void 0 : r.d, o)
|
|
114
|
+
};
|
|
115
|
+
return E(e, t, i), i;
|
|
116
|
+
}, v = (e, t, n, o) => {
|
|
117
|
+
if (n instanceof Promise) {
|
|
118
|
+
const r = nt(n, n.then((i) => {
|
|
119
|
+
P(e, t, i, o, r);
|
|
120
|
+
}).catch((i) => {
|
|
121
|
+
if (i instanceof Promise)
|
|
122
|
+
return it(i) ? i.then(() => {
|
|
123
|
+
R(e, t, !0);
|
|
124
|
+
}) : i;
|
|
125
|
+
$(e, t, i, o, r);
|
|
126
|
+
}));
|
|
127
|
+
return H(e, t, r, o);
|
|
128
|
+
}
|
|
129
|
+
return P(e, t, n, o);
|
|
130
|
+
}, st = (e, t) => {
|
|
131
|
+
const n = p(e, t);
|
|
132
|
+
if (n) {
|
|
133
|
+
const o = {
|
|
134
|
+
...n,
|
|
135
|
+
y: !1
|
|
136
|
+
};
|
|
137
|
+
E(e, t, o);
|
|
138
|
+
} else
|
|
139
|
+
({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && console.warn("[Bug] could not invalidate non existing atom", t);
|
|
140
|
+
}, R = (e, t, n) => {
|
|
141
|
+
if (!n) {
|
|
142
|
+
const r = p(e, t);
|
|
143
|
+
if (r) {
|
|
144
|
+
if (r.y && "p" in r && !et(r.p))
|
|
145
|
+
return r;
|
|
146
|
+
if (r.d.forEach((i, c) => {
|
|
147
|
+
if (c !== t)
|
|
148
|
+
if (!d.has(c))
|
|
149
|
+
R(e, c);
|
|
150
|
+
else {
|
|
151
|
+
const u = p(e, c);
|
|
152
|
+
u && !u.y && R(e, c);
|
|
153
|
+
}
|
|
154
|
+
}), Array.from(r.d).every(([i, c]) => {
|
|
155
|
+
const u = p(e, i);
|
|
156
|
+
return u && !("p" in u) && u.r === c;
|
|
157
|
+
}))
|
|
158
|
+
return r.y ? r : { ...r, y: !0 };
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const o = /* @__PURE__ */ new Set();
|
|
162
|
+
try {
|
|
163
|
+
const r = t.read((i) => {
|
|
164
|
+
o.add(i);
|
|
165
|
+
const c = i === t ? p(e, i) : R(e, i);
|
|
166
|
+
if (c) {
|
|
167
|
+
if ("e" in c)
|
|
168
|
+
throw c.e;
|
|
169
|
+
if ("p" in c)
|
|
170
|
+
throw c.p;
|
|
171
|
+
return c.v;
|
|
172
|
+
}
|
|
173
|
+
if (b(i))
|
|
174
|
+
return i.init;
|
|
175
|
+
throw new Error("no atom init");
|
|
176
|
+
});
|
|
177
|
+
return v(e, t, r, o);
|
|
178
|
+
} catch (r) {
|
|
179
|
+
if (r instanceof Promise) {
|
|
180
|
+
const i = nt(r, r);
|
|
181
|
+
return H(e, t, i, o);
|
|
182
|
+
}
|
|
183
|
+
return $(e, t, r, o);
|
|
184
|
+
}
|
|
185
|
+
}, J = (e, t) => R(t, e), ut = (e, t) => {
|
|
186
|
+
let n = d.get(t);
|
|
187
|
+
return n || (n = z(e, t)), n;
|
|
188
|
+
}, B = (e, t) => !t.l.size && (!t.t.size || t.t.size === 1 && t.t.has(e)), dt = (e, t) => {
|
|
189
|
+
const n = d.get(t);
|
|
190
|
+
n && B(t, n) && I(e, t);
|
|
191
|
+
}, x = (e, t) => {
|
|
192
|
+
const n = d.get(t);
|
|
193
|
+
n == null || n.t.forEach((o) => {
|
|
194
|
+
o !== t && (st(e, o), x(e, o));
|
|
195
|
+
});
|
|
196
|
+
}, K = (e, t, n) => {
|
|
197
|
+
let o = !0;
|
|
198
|
+
const r = (u, g) => {
|
|
199
|
+
const O = R(e, u);
|
|
200
|
+
if ("e" in O)
|
|
201
|
+
throw O.e;
|
|
202
|
+
if ("p" in O) {
|
|
203
|
+
if (g != null && g.unstable_promise)
|
|
204
|
+
return O.p.then(() => {
|
|
205
|
+
const V = p(e, u);
|
|
206
|
+
return V && "p" in V && V.p === O.p ? new Promise((k) => setTimeout(k)).then(() => r(u, g)) : r(u, g);
|
|
207
|
+
});
|
|
208
|
+
throw ({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && console.info("Reading pending atom state in write operation. We throw a promise for now.", u), O.p;
|
|
209
|
+
}
|
|
210
|
+
if ("v" in O)
|
|
211
|
+
return O.v;
|
|
212
|
+
throw ({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && console.warn("[Bug] no value found while reading atom in write operation. This is probably a bug.", u), new Error("no value found");
|
|
213
|
+
}, i = (u, g) => {
|
|
214
|
+
let O;
|
|
215
|
+
if (u === t) {
|
|
216
|
+
if (!b(u))
|
|
217
|
+
throw new Error("atom not writable");
|
|
218
|
+
D(u).forEach((tt) => {
|
|
219
|
+
tt !== e && v(tt, u, g);
|
|
220
|
+
});
|
|
221
|
+
const k = p(e, u), at = v(e, u, g);
|
|
222
|
+
k !== at && x(e, u);
|
|
223
|
+
} else
|
|
224
|
+
O = K(e, u, g);
|
|
225
|
+
return o || y(e), O;
|
|
226
|
+
}, c = t.write(r, i, n);
|
|
227
|
+
return o = !1, c;
|
|
228
|
+
}, L = (e, t, n) => {
|
|
229
|
+
const o = K(n, e, t);
|
|
230
|
+
return y(n), o;
|
|
231
|
+
}, ft = (e) => !!e.write, z = (e, t, n) => {
|
|
232
|
+
const o = {
|
|
233
|
+
t: new Set(n && [n]),
|
|
234
|
+
l: /* @__PURE__ */ new Set()
|
|
235
|
+
};
|
|
236
|
+
if (d.set(t, o), ({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && w.add(t), R(void 0, t).d.forEach((i, c) => {
|
|
237
|
+
const u = d.get(c);
|
|
238
|
+
u ? u.t.add(t) : c !== t && z(e, c, t);
|
|
239
|
+
}), ft(t) && t.onMount) {
|
|
240
|
+
const i = (u) => L(t, u, e), c = t.onMount(i);
|
|
241
|
+
e = void 0, c && (o.u = c);
|
|
242
|
+
}
|
|
243
|
+
return o;
|
|
244
|
+
}, I = (e, t) => {
|
|
245
|
+
var n;
|
|
246
|
+
const o = (n = d.get(t)) == null ? void 0 : n.u;
|
|
247
|
+
o && o(), d.delete(t), ({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && w.delete(t);
|
|
248
|
+
const r = p(e, t);
|
|
249
|
+
r ? ("p" in r && C(r.p), r.d.forEach((i, c) => {
|
|
250
|
+
if (c !== t) {
|
|
251
|
+
const u = d.get(c);
|
|
252
|
+
u && (u.t.delete(t), B(c, u) && I(e, c));
|
|
253
|
+
}
|
|
254
|
+
})) : ({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && console.warn("[Bug] could not find atom state to unmount", t);
|
|
255
|
+
}, Q = (e, t, n, o) => {
|
|
256
|
+
const r = new Set(n.d.keys());
|
|
257
|
+
o == null || o.forEach((i, c) => {
|
|
258
|
+
if (r.has(c)) {
|
|
259
|
+
r.delete(c);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const u = d.get(c);
|
|
263
|
+
u && (u.t.delete(t), B(c, u) && I(e, c));
|
|
264
|
+
}), r.forEach((i) => {
|
|
265
|
+
const c = d.get(i);
|
|
266
|
+
c ? c.t.add(t) : d.has(t) && z(e, i, t);
|
|
267
|
+
});
|
|
268
|
+
}, y = (e) => {
|
|
269
|
+
if (e) {
|
|
270
|
+
m(e).forEach((n, o) => {
|
|
271
|
+
const r = f.get(o);
|
|
272
|
+
if (n !== r) {
|
|
273
|
+
const i = d.get(o);
|
|
274
|
+
i == null || i.l.forEach((c) => c(e));
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
for (; l.size; ) {
|
|
280
|
+
const t = Array.from(l);
|
|
281
|
+
l.clear(), t.forEach(([n, o]) => {
|
|
282
|
+
const r = p(void 0, n);
|
|
283
|
+
if (r && r.d !== (o == null ? void 0 : o.d) && Q(void 0, n, r, o == null ? void 0 : o.d), o && !o.y && (r == null ? void 0 : r.y))
|
|
284
|
+
return;
|
|
285
|
+
const i = d.get(n);
|
|
286
|
+
i == null || i.l.forEach((c) => c());
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && a.forEach((t) => t());
|
|
290
|
+
}, lt = (e) => {
|
|
291
|
+
m(e).forEach((n, o) => {
|
|
292
|
+
const r = f.get(o);
|
|
293
|
+
(!r || n.r > r.r || n.y !== r.y || n.r === r.r && n.d !== r.d) && (f.set(o, n), n.d !== (r == null ? void 0 : r.d) && Q(e, o, n, r == null ? void 0 : r.d));
|
|
294
|
+
});
|
|
295
|
+
}, X = (e, t) => {
|
|
296
|
+
t && lt(t), y(void 0);
|
|
297
|
+
}, Y = (e, t, n) => {
|
|
298
|
+
const r = ut(n, e).l;
|
|
299
|
+
return r.add(t), () => {
|
|
300
|
+
r.delete(t), dt(n, e);
|
|
301
|
+
};
|
|
302
|
+
}, Z = (e, t) => {
|
|
303
|
+
for (const [n, o] of e)
|
|
304
|
+
b(n) && (v(t, n, o), x(t, n));
|
|
305
|
+
y(t);
|
|
306
|
+
};
|
|
307
|
+
return ({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" ? {
|
|
308
|
+
[F]: J,
|
|
309
|
+
[j]: L,
|
|
310
|
+
[T]: X,
|
|
311
|
+
[G]: Y,
|
|
312
|
+
[ot]: Z,
|
|
313
|
+
[Ot]: (e) => (a.add(e), () => {
|
|
314
|
+
a.delete(e);
|
|
315
|
+
}),
|
|
316
|
+
[gt]: () => w.values(),
|
|
317
|
+
[Dt]: (e) => f.get(e),
|
|
318
|
+
[Rt]: (e) => d.get(e)
|
|
319
|
+
} : {
|
|
320
|
+
[F]: J,
|
|
321
|
+
[j]: L,
|
|
322
|
+
[T]: X,
|
|
323
|
+
[G]: Y,
|
|
324
|
+
[ot]: Z
|
|
325
|
+
};
|
|
326
|
+
}, ct = (s, f) => ({ s: f ? f(s).SECRET_INTERNAL_store : _t(s) }), W = /* @__PURE__ */ new Map(), q = (s) => (W.has(s) || W.set(s, At(ct())), W.get(s)), vt = ({
|
|
327
|
+
children: s,
|
|
328
|
+
initialValues: f,
|
|
329
|
+
scope: d,
|
|
330
|
+
unstable_createStore: l,
|
|
331
|
+
unstable_enableVersionedWrite: a
|
|
332
|
+
}) => {
|
|
333
|
+
const [w, A] = pt({});
|
|
334
|
+
N(() => {
|
|
335
|
+
const M = h.current;
|
|
336
|
+
M.w && (M.s[T](null, w), delete w.p, M.v = w);
|
|
337
|
+
}, [w]);
|
|
338
|
+
const h = Et();
|
|
339
|
+
if (!h.current) {
|
|
340
|
+
const M = ct(f, l);
|
|
341
|
+
if (a) {
|
|
342
|
+
let m = 0;
|
|
343
|
+
M.w = (p) => {
|
|
344
|
+
A((E) => {
|
|
345
|
+
const S = m ? E : { p: E };
|
|
346
|
+
return p(S), S;
|
|
347
|
+
});
|
|
348
|
+
}, M.v = w, M.r = (p) => {
|
|
349
|
+
++m, p(), --m;
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
h.current = M;
|
|
353
|
+
}
|
|
354
|
+
const D = q(d);
|
|
355
|
+
return St(D.Provider, {
|
|
356
|
+
value: h.current
|
|
357
|
+
}, s);
|
|
358
|
+
};
|
|
359
|
+
let Pt = 0;
|
|
360
|
+
function Vt(s, f) {
|
|
361
|
+
const d = `atom${++Pt}`, l = {
|
|
362
|
+
toString: () => d
|
|
363
|
+
};
|
|
364
|
+
return typeof s == "function" ? l.read = s : (l.init = s, l.read = (a) => a(l), l.write = (a, w, A) => w(l, typeof A == "function" ? A(a(l)) : A)), f && (l.write = f), l;
|
|
365
|
+
}
|
|
366
|
+
function yt(s, f) {
|
|
367
|
+
const d = q(f), l = rt(d), { s: a, v: w } = l, A = (E) => {
|
|
368
|
+
const S = a[F](s, E);
|
|
369
|
+
if (({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && !S.y)
|
|
370
|
+
throw new Error("should not be invalidated");
|
|
371
|
+
if ("e" in S)
|
|
372
|
+
throw S.e;
|
|
373
|
+
if ("p" in S)
|
|
374
|
+
throw S.p;
|
|
375
|
+
if ("v" in S)
|
|
376
|
+
return S.v;
|
|
377
|
+
throw new Error("no atom value");
|
|
378
|
+
}, [[h, D, M], m] = wt((E, S) => {
|
|
379
|
+
const P = A(S);
|
|
380
|
+
return Object.is(E[1], P) && E[2] === s ? E : [S, P, s];
|
|
381
|
+
}, w, (E) => {
|
|
382
|
+
const S = A(E);
|
|
383
|
+
return [E, S, s];
|
|
384
|
+
});
|
|
385
|
+
let p = D;
|
|
386
|
+
return M !== s && (m(h), p = A(h)), N(() => {
|
|
387
|
+
const { v: E } = l;
|
|
388
|
+
E && a[T](s, E);
|
|
389
|
+
const S = a[G](s, m, E);
|
|
390
|
+
return m(E), S;
|
|
391
|
+
}, [a, s, l]), N(() => {
|
|
392
|
+
a[T](s, h);
|
|
393
|
+
}), ht(p), p;
|
|
394
|
+
}
|
|
395
|
+
function Ct(s, f) {
|
|
396
|
+
const d = q(f), { s: l, w: a } = rt(d);
|
|
397
|
+
return Mt((A) => {
|
|
398
|
+
if (({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && !("write" in s))
|
|
399
|
+
throw new Error("not writable atom");
|
|
400
|
+
const h = (D) => l[j](s, A, D);
|
|
401
|
+
return a ? a(h) : h();
|
|
402
|
+
}, [l, a, s]);
|
|
403
|
+
}
|
|
404
|
+
function bt(s, f) {
|
|
405
|
+
return "scope" in s && (console.warn("atom.scope is deprecated. Please do useAtom(atom, scope) instead."), f = s.scope), [
|
|
406
|
+
yt(s, f),
|
|
407
|
+
Ct(s, f)
|
|
408
|
+
];
|
|
409
|
+
}
|
|
410
|
+
export {
|
|
411
|
+
vt as Provider,
|
|
412
|
+
q as SECRET_INTERNAL_getScopeContext,
|
|
413
|
+
Vt as atom,
|
|
414
|
+
bt as useAtom,
|
|
415
|
+
yt as useAtomValue,
|
|
416
|
+
Ct as useSetAtom
|
|
417
|
+
};
|
|
418
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../node_modules/jotai/esm/index.mjs"],"sourcesContent":["import { createContext, useState, useEffect, useRef, createElement, useContext, useReducer, useDebugValue, useCallback } from 'react';\n\nconst SUSPENSE_PROMISE = Symbol();\nconst isSuspensePromise = (promise) => !!promise[SUSPENSE_PROMISE];\nconst isSuspensePromiseAlreadyCancelled = (suspensePromise) => !suspensePromise[SUSPENSE_PROMISE].c;\nconst cancelSuspensePromise = (suspensePromise) => {\n var _a;\n const { b: basePromise, c: cancelPromise } = suspensePromise[SUSPENSE_PROMISE];\n if (cancelPromise) {\n cancelPromise();\n (_a = promiseAbortMap.get(basePromise)) == null ? void 0 : _a();\n }\n};\nconst isEqualSuspensePromise = (oldSuspensePromise, newSuspensePromise) => {\n const oldOriginalPromise = oldSuspensePromise[SUSPENSE_PROMISE].o;\n const newOriginalPromise = newSuspensePromise[SUSPENSE_PROMISE].o;\n return oldOriginalPromise === newOriginalPromise || oldSuspensePromise === newOriginalPromise || isSuspensePromise(oldOriginalPromise) && isEqualSuspensePromise(oldOriginalPromise, newSuspensePromise);\n};\nconst createSuspensePromise = (basePromise, promise) => {\n const suspensePromiseExtra = {\n b: basePromise,\n o: promise,\n c: null\n };\n const suspensePromise = new Promise((resolve) => {\n suspensePromiseExtra.c = () => {\n suspensePromiseExtra.c = null;\n resolve();\n };\n promise.finally(suspensePromiseExtra.c);\n });\n suspensePromise[SUSPENSE_PROMISE] = suspensePromiseExtra;\n return suspensePromise;\n};\nconst promiseAbortMap = /* @__PURE__ */ new WeakMap();\nconst registerPromiseAbort = (basePromise, abort) => {\n promiseAbortMap.set(basePromise, abort);\n};\n\nconst hasInitialValue = (atom) => \"init\" in atom;\nconst READ_ATOM = \"r\";\nconst WRITE_ATOM = \"w\";\nconst COMMIT_ATOM = \"c\";\nconst SUBSCRIBE_ATOM = \"s\";\nconst RESTORE_ATOMS = \"h\";\nconst DEV_SUBSCRIBE_STATE = \"n\";\nconst DEV_GET_MOUNTED_ATOMS = \"l\";\nconst DEV_GET_ATOM_STATE = \"a\";\nconst DEV_GET_MOUNTED = \"m\";\nconst createStore = (initialValues) => {\n const committedAtomStateMap = /* @__PURE__ */ new WeakMap();\n const mountedMap = /* @__PURE__ */ new WeakMap();\n const pendingMap = /* @__PURE__ */ new Map();\n let stateListeners;\n let mountedAtoms;\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n stateListeners = /* @__PURE__ */ new Set();\n mountedAtoms = /* @__PURE__ */ new Set();\n }\n if (initialValues) {\n for (const [atom, value] of initialValues) {\n const atomState = {\n v: value,\n r: 0,\n y: true,\n d: /* @__PURE__ */ new Map()\n };\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n Object.freeze(atomState);\n if (!hasInitialValue(atom)) {\n console.warn(\n \"Found initial value for derived atom which can cause unexpected behavior\",\n atom\n );\n }\n }\n committedAtomStateMap.set(atom, atomState);\n }\n }\n const suspensePromiseCacheMap = /* @__PURE__ */ new WeakMap();\n const addSuspensePromiseToCache = (version, atom, suspensePromise) => {\n let cache = suspensePromiseCacheMap.get(atom);\n if (!cache) {\n cache = /* @__PURE__ */ new Map();\n suspensePromiseCacheMap.set(atom, cache);\n }\n suspensePromise.then(() => {\n if (cache.get(version) === suspensePromise) {\n cache.delete(version);\n if (!cache.size) {\n suspensePromiseCacheMap.delete(atom);\n }\n }\n });\n cache.set(version, suspensePromise);\n };\n const cancelAllSuspensePromiseInCache = (atom) => {\n const versionSet = /* @__PURE__ */ new Set();\n const cache = suspensePromiseCacheMap.get(atom);\n if (cache) {\n suspensePromiseCacheMap.delete(atom);\n cache.forEach((suspensePromise, version) => {\n cancelSuspensePromise(suspensePromise);\n versionSet.add(version);\n });\n }\n return versionSet;\n };\n const versionedAtomStateMapMap = /* @__PURE__ */ new WeakMap();\n const getVersionedAtomStateMap = (version) => {\n let versionedAtomStateMap = versionedAtomStateMapMap.get(version);\n if (!versionedAtomStateMap) {\n versionedAtomStateMap = /* @__PURE__ */ new Map();\n versionedAtomStateMapMap.set(version, versionedAtomStateMap);\n }\n return versionedAtomStateMap;\n };\n const getAtomState = (version, atom) => {\n if (version) {\n const versionedAtomStateMap = getVersionedAtomStateMap(version);\n let atomState = versionedAtomStateMap.get(atom);\n if (!atomState) {\n atomState = getAtomState(version.p, atom);\n if (atomState && \"p\" in atomState && isSuspensePromiseAlreadyCancelled(atomState.p)) {\n atomState = void 0;\n }\n if (atomState) {\n versionedAtomStateMap.set(atom, atomState);\n }\n }\n return atomState;\n }\n return committedAtomStateMap.get(atom);\n };\n const setAtomState = (version, atom, atomState) => {\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n Object.freeze(atomState);\n }\n if (version) {\n const versionedAtomStateMap = getVersionedAtomStateMap(version);\n versionedAtomStateMap.set(atom, atomState);\n } else {\n const prevAtomState = committedAtomStateMap.get(atom);\n committedAtomStateMap.set(atom, atomState);\n if (!pendingMap.has(atom)) {\n pendingMap.set(atom, prevAtomState);\n }\n }\n };\n const createReadDependencies = (version, prevReadDependencies = /* @__PURE__ */ new Map(), dependencies) => {\n if (!dependencies) {\n return prevReadDependencies;\n }\n const readDependencies = /* @__PURE__ */ new Map();\n let changed = false;\n dependencies.forEach((atom) => {\n var _a;\n const revision = ((_a = getAtomState(version, atom)) == null ? void 0 : _a.r) || 0;\n readDependencies.set(atom, revision);\n if (prevReadDependencies.get(atom) !== revision) {\n changed = true;\n }\n });\n if (prevReadDependencies.size === readDependencies.size && !changed) {\n return prevReadDependencies;\n }\n return readDependencies;\n };\n const setAtomValue = (version, atom, value, dependencies, suspensePromise) => {\n const atomState = getAtomState(version, atom);\n if (atomState) {\n if (suspensePromise && (!(\"p\" in atomState) || !isEqualSuspensePromise(atomState.p, suspensePromise))) {\n return atomState;\n }\n if (\"p\" in atomState) {\n cancelSuspensePromise(atomState.p);\n }\n }\n const nextAtomState = {\n v: value,\n r: (atomState == null ? void 0 : atomState.r) || 0,\n y: true,\n d: createReadDependencies(version, atomState == null ? void 0 : atomState.d, dependencies)\n };\n let changed = !(atomState == null ? void 0 : atomState.y);\n if (!atomState || !(\"v\" in atomState) || !Object.is(atomState.v, value)) {\n changed = true;\n ++nextAtomState.r;\n if (nextAtomState.d.has(atom)) {\n nextAtomState.d = new Map(nextAtomState.d).set(atom, nextAtomState.r);\n }\n } else if (nextAtomState.d !== atomState.d && (nextAtomState.d.size !== atomState.d.size || !Array.from(nextAtomState.d.keys()).every((a) => atomState.d.has(a)))) {\n changed = true;\n Promise.resolve().then(() => {\n flushPending(version);\n });\n }\n if (atomState && !changed) {\n return atomState;\n }\n setAtomState(version, atom, nextAtomState);\n return nextAtomState;\n };\n const setAtomReadError = (version, atom, error, dependencies, suspensePromise) => {\n const atomState = getAtomState(version, atom);\n if (atomState) {\n if (suspensePromise && (!(\"p\" in atomState) || !isEqualSuspensePromise(atomState.p, suspensePromise))) {\n return atomState;\n }\n if (\"p\" in atomState) {\n cancelSuspensePromise(atomState.p);\n }\n }\n const nextAtomState = {\n e: error,\n r: ((atomState == null ? void 0 : atomState.r) || 0) + 1,\n y: true,\n d: createReadDependencies(version, atomState == null ? void 0 : atomState.d, dependencies)\n };\n setAtomState(version, atom, nextAtomState);\n return nextAtomState;\n };\n const setAtomSuspensePromise = (version, atom, suspensePromise, dependencies) => {\n const atomState = getAtomState(version, atom);\n if (atomState && \"p\" in atomState) {\n if (isEqualSuspensePromise(atomState.p, suspensePromise)) {\n if (!atomState.y) {\n return { ...atomState, y: true };\n }\n return atomState;\n }\n cancelSuspensePromise(atomState.p);\n }\n addSuspensePromiseToCache(version, atom, suspensePromise);\n const nextAtomState = {\n p: suspensePromise,\n r: ((atomState == null ? void 0 : atomState.r) || 0) + 1,\n y: true,\n d: createReadDependencies(version, atomState == null ? void 0 : atomState.d, dependencies)\n };\n setAtomState(version, atom, nextAtomState);\n return nextAtomState;\n };\n const setAtomPromiseOrValue = (version, atom, promiseOrValue, dependencies) => {\n if (promiseOrValue instanceof Promise) {\n const suspensePromise = createSuspensePromise(\n promiseOrValue,\n promiseOrValue.then((value) => {\n setAtomValue(version, atom, value, dependencies, suspensePromise);\n }).catch((e) => {\n if (e instanceof Promise) {\n if (isSuspensePromise(e)) {\n return e.then(() => {\n readAtomState(version, atom, true);\n });\n }\n return e;\n }\n setAtomReadError(version, atom, e, dependencies, suspensePromise);\n })\n );\n return setAtomSuspensePromise(\n version,\n atom,\n suspensePromise,\n dependencies\n );\n }\n return setAtomValue(\n version,\n atom,\n promiseOrValue,\n dependencies\n );\n };\n const setAtomInvalidated = (version, atom) => {\n const atomState = getAtomState(version, atom);\n if (atomState) {\n const nextAtomState = {\n ...atomState,\n y: false\n };\n setAtomState(version, atom, nextAtomState);\n } else if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n console.warn(\"[Bug] could not invalidate non existing atom\", atom);\n }\n };\n const readAtomState = (version, atom, force) => {\n if (!force) {\n const atomState = getAtomState(version, atom);\n if (atomState) {\n if (atomState.y && \"p\" in atomState && !isSuspensePromiseAlreadyCancelled(atomState.p)) {\n return atomState;\n }\n atomState.d.forEach((_, a) => {\n if (a !== atom) {\n if (!mountedMap.has(a)) {\n readAtomState(version, a);\n } else {\n const aState = getAtomState(version, a);\n if (aState && !aState.y) {\n readAtomState(version, a);\n }\n }\n }\n });\n if (Array.from(atomState.d).every(([a, r]) => {\n const aState = getAtomState(version, a);\n return aState && !(\"p\" in aState) && aState.r === r;\n })) {\n if (!atomState.y) {\n return { ...atomState, y: true };\n }\n return atomState;\n }\n }\n }\n const dependencies = /* @__PURE__ */ new Set();\n try {\n const promiseOrValue = atom.read((a) => {\n dependencies.add(a);\n const aState = a === atom ? getAtomState(version, a) : readAtomState(version, a);\n if (aState) {\n if (\"e\" in aState) {\n throw aState.e;\n }\n if (\"p\" in aState) {\n throw aState.p;\n }\n return aState.v;\n }\n if (hasInitialValue(a)) {\n return a.init;\n }\n throw new Error(\"no atom init\");\n });\n return setAtomPromiseOrValue(version, atom, promiseOrValue, dependencies);\n } catch (errorOrPromise) {\n if (errorOrPromise instanceof Promise) {\n const suspensePromise = createSuspensePromise(\n errorOrPromise,\n errorOrPromise\n );\n return setAtomSuspensePromise(\n version,\n atom,\n suspensePromise,\n dependencies\n );\n }\n return setAtomReadError(version, atom, errorOrPromise, dependencies);\n }\n };\n const readAtom = (readingAtom, version) => {\n const atomState = readAtomState(version, readingAtom);\n return atomState;\n };\n const addAtom = (version, addingAtom) => {\n let mounted = mountedMap.get(addingAtom);\n if (!mounted) {\n mounted = mountAtom(version, addingAtom);\n }\n return mounted;\n };\n const canUnmountAtom = (atom, mounted) => !mounted.l.size && (!mounted.t.size || mounted.t.size === 1 && mounted.t.has(atom));\n const delAtom = (version, deletingAtom) => {\n const mounted = mountedMap.get(deletingAtom);\n if (mounted && canUnmountAtom(deletingAtom, mounted)) {\n unmountAtom(version, deletingAtom);\n }\n };\n const invalidateDependents = (version, atom) => {\n const mounted = mountedMap.get(atom);\n mounted == null ? void 0 : mounted.t.forEach((dependent) => {\n if (dependent !== atom) {\n setAtomInvalidated(version, dependent);\n invalidateDependents(version, dependent);\n }\n });\n };\n const writeAtomState = (version, atom, update) => {\n let isSync = true;\n const writeGetter = (a, options) => {\n const aState = readAtomState(version, a);\n if (\"e\" in aState) {\n throw aState.e;\n }\n if (\"p\" in aState) {\n if (options == null ? void 0 : options.unstable_promise) {\n return aState.p.then(() => {\n const s = getAtomState(version, a);\n if (s && \"p\" in s && s.p === aState.p) {\n return new Promise((resolve) => setTimeout(resolve)).then(\n () => writeGetter(a, options)\n );\n }\n return writeGetter(a, options);\n });\n }\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n console.info(\n \"Reading pending atom state in write operation. We throw a promise for now.\",\n a\n );\n }\n throw aState.p;\n }\n if (\"v\" in aState) {\n return aState.v;\n }\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n console.warn(\n \"[Bug] no value found while reading atom in write operation. This is probably a bug.\",\n a\n );\n }\n throw new Error(\"no value found\");\n };\n const setter = (a, v) => {\n let promiseOrVoid2;\n if (a === atom) {\n if (!hasInitialValue(a)) {\n throw new Error(\"atom not writable\");\n }\n const versionSet = cancelAllSuspensePromiseInCache(a);\n versionSet.forEach((cancelledVersion) => {\n if (cancelledVersion !== version) {\n setAtomPromiseOrValue(cancelledVersion, a, v);\n }\n });\n const prevAtomState = getAtomState(version, a);\n const nextAtomState = setAtomPromiseOrValue(version, a, v);\n if (prevAtomState !== nextAtomState) {\n invalidateDependents(version, a);\n }\n } else {\n promiseOrVoid2 = writeAtomState(version, a, v);\n }\n if (!isSync) {\n flushPending(version);\n }\n return promiseOrVoid2;\n };\n const promiseOrVoid = atom.write(writeGetter, setter, update);\n isSync = false;\n return promiseOrVoid;\n };\n const writeAtom = (writingAtom, update, version) => {\n const promiseOrVoid = writeAtomState(version, writingAtom, update);\n flushPending(version);\n return promiseOrVoid;\n };\n const isActuallyWritableAtom = (atom) => !!atom.write;\n const mountAtom = (version, atom, initialDependent) => {\n const mounted = {\n t: new Set(initialDependent && [initialDependent]),\n l: /* @__PURE__ */ new Set()\n };\n mountedMap.set(atom, mounted);\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n mountedAtoms.add(atom);\n }\n const atomState = readAtomState(void 0, atom);\n atomState.d.forEach((_, a) => {\n const aMounted = mountedMap.get(a);\n if (aMounted) {\n aMounted.t.add(atom);\n } else {\n if (a !== atom) {\n mountAtom(version, a, atom);\n }\n }\n });\n if (isActuallyWritableAtom(atom) && atom.onMount) {\n const setAtom = (update) => writeAtom(atom, update, version);\n const onUnmount = atom.onMount(setAtom);\n version = void 0;\n if (onUnmount) {\n mounted.u = onUnmount;\n }\n }\n return mounted;\n };\n const unmountAtom = (version, atom) => {\n var _a;\n const onUnmount = (_a = mountedMap.get(atom)) == null ? void 0 : _a.u;\n if (onUnmount) {\n onUnmount();\n }\n mountedMap.delete(atom);\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n mountedAtoms.delete(atom);\n }\n const atomState = getAtomState(version, atom);\n if (atomState) {\n if (\"p\" in atomState) {\n cancelSuspensePromise(atomState.p);\n }\n atomState.d.forEach((_, a) => {\n if (a !== atom) {\n const mounted = mountedMap.get(a);\n if (mounted) {\n mounted.t.delete(atom);\n if (canUnmountAtom(a, mounted)) {\n unmountAtom(version, a);\n }\n }\n }\n });\n } else if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n console.warn(\"[Bug] could not find atom state to unmount\", atom);\n }\n };\n const mountDependencies = (version, atom, atomState, prevReadDependencies) => {\n const dependencies = new Set(atomState.d.keys());\n prevReadDependencies == null ? void 0 : prevReadDependencies.forEach((_, a) => {\n if (dependencies.has(a)) {\n dependencies.delete(a);\n return;\n }\n const mounted = mountedMap.get(a);\n if (mounted) {\n mounted.t.delete(atom);\n if (canUnmountAtom(a, mounted)) {\n unmountAtom(version, a);\n }\n }\n });\n dependencies.forEach((a) => {\n const mounted = mountedMap.get(a);\n if (mounted) {\n mounted.t.add(atom);\n } else if (mountedMap.has(atom)) {\n mountAtom(version, a, atom);\n }\n });\n };\n const flushPending = (version) => {\n if (version) {\n const versionedAtomStateMap = getVersionedAtomStateMap(version);\n versionedAtomStateMap.forEach((atomState, atom) => {\n const committedAtomState = committedAtomStateMap.get(atom);\n if (atomState !== committedAtomState) {\n const mounted = mountedMap.get(atom);\n mounted == null ? void 0 : mounted.l.forEach((listener) => listener(version));\n }\n });\n return;\n }\n while (pendingMap.size) {\n const pending = Array.from(pendingMap);\n pendingMap.clear();\n pending.forEach(([atom, prevAtomState]) => {\n const atomState = getAtomState(void 0, atom);\n if (atomState && atomState.d !== (prevAtomState == null ? void 0 : prevAtomState.d)) {\n mountDependencies(void 0, atom, atomState, prevAtomState == null ? void 0 : prevAtomState.d);\n }\n if (prevAtomState && !prevAtomState.y && (atomState == null ? void 0 : atomState.y)) {\n return;\n }\n const mounted = mountedMap.get(atom);\n mounted == null ? void 0 : mounted.l.forEach((listener) => listener());\n });\n }\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n stateListeners.forEach((l) => l());\n }\n };\n const commitVersionedAtomStateMap = (version) => {\n const versionedAtomStateMap = getVersionedAtomStateMap(version);\n versionedAtomStateMap.forEach((atomState, atom) => {\n const prevAtomState = committedAtomStateMap.get(atom);\n if (!prevAtomState || atomState.r > prevAtomState.r || atomState.y !== prevAtomState.y || atomState.r === prevAtomState.r && atomState.d !== prevAtomState.d) {\n committedAtomStateMap.set(atom, atomState);\n if (atomState.d !== (prevAtomState == null ? void 0 : prevAtomState.d)) {\n mountDependencies(version, atom, atomState, prevAtomState == null ? void 0 : prevAtomState.d);\n }\n }\n });\n };\n const commitAtom = (_atom, version) => {\n if (version) {\n commitVersionedAtomStateMap(version);\n }\n flushPending(void 0);\n };\n const subscribeAtom = (atom, callback, version) => {\n const mounted = addAtom(version, atom);\n const listeners = mounted.l;\n listeners.add(callback);\n return () => {\n listeners.delete(callback);\n delAtom(version, atom);\n };\n };\n const restoreAtoms = (values, version) => {\n for (const [atom, value] of values) {\n if (hasInitialValue(atom)) {\n setAtomPromiseOrValue(version, atom, value);\n invalidateDependents(version, atom);\n }\n }\n flushPending(version);\n };\n if ((import.meta.env && import.meta.env.MODE) !== \"production\") {\n return {\n [READ_ATOM]: readAtom,\n [WRITE_ATOM]: writeAtom,\n [COMMIT_ATOM]: commitAtom,\n [SUBSCRIBE_ATOM]: subscribeAtom,\n [RESTORE_ATOMS]: restoreAtoms,\n [DEV_SUBSCRIBE_STATE]: (l) => {\n stateListeners.add(l);\n return () => {\n stateListeners.delete(l);\n };\n },\n [DEV_GET_MOUNTED_ATOMS]: () => mountedAtoms.values(),\n [DEV_GET_ATOM_STATE]: (a) => committedAtomStateMap.get(a),\n [DEV_GET_MOUNTED]: (a) => mountedMap.get(a)\n };\n }\n return {\n [READ_ATOM]: readAtom,\n [WRITE_ATOM]: writeAtom,\n [COMMIT_ATOM]: commitAtom,\n [SUBSCRIBE_ATOM]: subscribeAtom,\n [RESTORE_ATOMS]: restoreAtoms\n };\n};\nconst createStoreForExport = (initialValues) => {\n const store = createStore(initialValues);\n const get = (atom) => {\n const atomState = store[READ_ATOM](atom);\n if (\"e\" in atomState) {\n throw atomState.e;\n }\n if (\"p\" in atomState) {\n return void 0;\n }\n return atomState.v;\n };\n const asyncGet = (atom) => new Promise((resolve, reject) => {\n const atomState = store[READ_ATOM](atom);\n if (\"e\" in atomState) {\n reject(atomState.e);\n } else if (\"p\" in atomState) {\n resolve(atomState.p.then(() => asyncGet(atom)));\n } else {\n resolve(atomState.v);\n }\n });\n const set = (atom, update) => store[WRITE_ATOM](atom, update);\n const sub = (atom, callback) => store[SUBSCRIBE_ATOM](atom, callback);\n return {\n get,\n asyncGet,\n set,\n sub,\n SECRET_INTERNAL_store: store\n };\n};\n\nconst createScopeContainer = (initialValues, unstable_createStore) => {\n const store = unstable_createStore ? unstable_createStore(initialValues).SECRET_INTERNAL_store : createStore(initialValues);\n return { s: store };\n};\nconst ScopeContextMap = /* @__PURE__ */ new Map();\nconst getScopeContext = (scope) => {\n if (!ScopeContextMap.has(scope)) {\n ScopeContextMap.set(scope, createContext(createScopeContainer()));\n }\n return ScopeContextMap.get(scope);\n};\n\nconst Provider = ({\n children,\n initialValues,\n scope,\n unstable_createStore,\n unstable_enableVersionedWrite\n}) => {\n const [version, setVersion] = useState({});\n useEffect(() => {\n const scopeContainer = scopeContainerRef.current;\n if (scopeContainer.w) {\n scopeContainer.s[COMMIT_ATOM](null, version);\n delete version.p;\n scopeContainer.v = version;\n }\n }, [version]);\n const scopeContainerRef = useRef();\n if (!scopeContainerRef.current) {\n const scopeContainer = createScopeContainer(\n initialValues,\n unstable_createStore\n );\n if (unstable_enableVersionedWrite) {\n let retrying = 0;\n scopeContainer.w = (write) => {\n setVersion((parentVersion) => {\n const nextVersion = retrying ? parentVersion : { p: parentVersion };\n write(nextVersion);\n return nextVersion;\n });\n };\n scopeContainer.v = version;\n scopeContainer.r = (fn) => {\n ++retrying;\n fn();\n --retrying;\n };\n }\n scopeContainerRef.current = scopeContainer;\n }\n const ScopeContainerContext = getScopeContext(scope);\n return createElement(\n ScopeContainerContext.Provider,\n {\n value: scopeContainerRef.current\n },\n children\n );\n};\n\nlet keyCount = 0;\nfunction atom(read, write) {\n const key = `atom${++keyCount}`;\n const config = {\n toString: () => key\n };\n if (typeof read === \"function\") {\n config.read = read;\n } else {\n config.init = read;\n config.read = (get) => get(config);\n config.write = (get, set, update) => set(config, typeof update === \"function\" ? update(get(config)) : update);\n }\n if (write) {\n config.write = write;\n }\n return config;\n}\n\nfunction useAtomValue(atom, scope) {\n const ScopeContext = getScopeContext(scope);\n const scopeContainer = useContext(ScopeContext);\n const { s: store, v: versionFromProvider } = scopeContainer;\n const getAtomValue = (version2) => {\n const atomState = store[READ_ATOM](atom, version2);\n if ((import.meta.env && import.meta.env.MODE) !== \"production\" && !atomState.y) {\n throw new Error(\"should not be invalidated\");\n }\n if (\"e\" in atomState) {\n throw atomState.e;\n }\n if (\"p\" in atomState) {\n throw atomState.p;\n }\n if (\"v\" in atomState) {\n return atomState.v;\n }\n throw new Error(\"no atom value\");\n };\n const [[version, valueFromReducer, atomFromReducer], rerenderIfChanged] = useReducer(\n (prev, nextVersion) => {\n const nextValue = getAtomValue(nextVersion);\n if (Object.is(prev[1], nextValue) && prev[2] === atom) {\n return prev;\n }\n return [nextVersion, nextValue, atom];\n },\n versionFromProvider,\n (initialVersion) => {\n const initialValue = getAtomValue(initialVersion);\n return [initialVersion, initialValue, atom];\n }\n );\n let value = valueFromReducer;\n if (atomFromReducer !== atom) {\n rerenderIfChanged(version);\n value = getAtomValue(version);\n }\n useEffect(() => {\n const { v: versionFromProvider2 } = scopeContainer;\n if (versionFromProvider2) {\n store[COMMIT_ATOM](atom, versionFromProvider2);\n }\n const unsubscribe = store[SUBSCRIBE_ATOM](\n atom,\n rerenderIfChanged,\n versionFromProvider2\n );\n rerenderIfChanged(versionFromProvider2);\n return unsubscribe;\n }, [store, atom, scopeContainer]);\n useEffect(() => {\n store[COMMIT_ATOM](atom, version);\n });\n useDebugValue(value);\n return value;\n}\n\nfunction useSetAtom(atom, scope) {\n const ScopeContext = getScopeContext(scope);\n const { s: store, w: versionedWrite } = useContext(ScopeContext);\n const setAtom = useCallback(\n (update) => {\n if ((import.meta.env && import.meta.env.MODE) !== \"production\" && !(\"write\" in atom)) {\n throw new Error(\"not writable atom\");\n }\n const write = (version) => store[WRITE_ATOM](atom, update, version);\n return versionedWrite ? versionedWrite(write) : write();\n },\n [store, versionedWrite, atom]\n );\n return setAtom;\n}\n\nfunction useAtom(atom, scope) {\n if (\"scope\" in atom) {\n console.warn(\n \"atom.scope is deprecated. Please do useAtom(atom, scope) instead.\"\n );\n scope = atom.scope;\n }\n return [\n useAtomValue(atom, scope),\n useSetAtom(atom, scope)\n ];\n}\n\nexport { Provider, getScopeContext as SECRET_INTERNAL_getScopeContext, registerPromiseAbort as SECRET_INTERNAL_registerPromiseAbort, atom, createStoreForExport as unstable_createStore, useAtom, useAtomValue, useSetAtom };\n"],"names":[],"mappings":";AAEA,MAAM,IAAmB,OAAM,GACzB,KAAoB,CAAC,MAAY,CAAC,CAAC,EAAQ,IAC3C,KAAoC,CAAC,MAAoB,CAAC,EAAgB,GAAkB,GAC5F,IAAwB,CAAC,MAAoB;AACjD,MAAI;AACJ,QAAM,EAAE,GAAG,GAAa,GAAG,MAAkB,EAAgB;AAC7D,EAAI,KACF,MACC,KAAK,GAAgB,IAAI,CAAW,MAAM,QAAgB;AAE/D,GACM,IAAyB,CAAC,GAAoB,MAAuB;AACzE,QAAM,IAAqB,EAAmB,GAAkB,GAC1D,IAAqB,EAAmB,GAAkB;AAChE,SAAO,MAAuB,KAAsB,MAAuB,KAAsB,GAAkB,CAAkB,KAAK,EAAuB,GAAoB,CAAkB;AACzM,GACM,KAAwB,CAAC,GAAa,MAAY;AACtD,QAAM,IAAuB;AAAA,IAC3B,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACP,GACQ,IAAkB,IAAI,QAAQ,CAAC,MAAY;AAC/C,MAAqB,IAAI,MAAM;AAC7B,QAAqB,IAAI,MACzB;IACN,GACI,EAAQ,QAAQ,EAAqB,CAAC;AAAA,EAC1C,CAAG;AACD,WAAgB,KAAoB,GAC7B;AACT,GACM,KAAkC,oBAAI,WAKtC,IAAkB,CAAC,MAAS,UAAU,GACtC,IAAY,KACZ,IAA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AQ,CAAO;AAClE,WAAO,IAAiB,EAAe,CAAK,IAAI,EAAK;AAAA,EACtD,GACD,CAAC,GAAO,GAAgB,CAAI,CAChC;AAEA;AAEA,YAAiB,GAAM,GAAO;AAC5B,SAAI,WAAW,KACb,SAAQ,KACN,mEACN,GACI,IAAQ,EAAK,QAER;AAAA,IACL,GAAa,GAAM,CAAK;AAAA,IACxB,GAAW,GAAM,CAAK;AAAA,EAC1B;AACA;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const O = Symbol(), m = Symbol(), d = Symbol();
|
|
2
|
+
let S = (e, s) => new Proxy(e, s);
|
|
3
|
+
const w = Object.getPrototypeOf, j = /* @__PURE__ */ new WeakMap(), k = (e) => e && (j.has(e) ? j.get(e) : w(e) === Object.prototype || w(e) === Array.prototype), p = (e) => typeof e == "object" && e !== null, P = /* @__PURE__ */ new WeakMap(), h = (e) => e[d] || e, A = (e, s, c) => {
|
|
4
|
+
if (!k(e))
|
|
5
|
+
return e;
|
|
6
|
+
const n = h(e), f = ((t) => Object.isFrozen(t) || Object.values(Object.getOwnPropertyDescriptors(t)).some((o) => !o.writable))(n);
|
|
7
|
+
let r = c && c.get(n);
|
|
8
|
+
return r && r[1].f === f || (r = ((t, o) => {
|
|
9
|
+
const a = { f: o };
|
|
10
|
+
let g = !1;
|
|
11
|
+
const u = (i, l) => {
|
|
12
|
+
if (!g) {
|
|
13
|
+
let y = a.a.get(t);
|
|
14
|
+
y || (y = /* @__PURE__ */ new Set(), a.a.set(t, y)), l && y.has(O) || y.add(i);
|
|
15
|
+
}
|
|
16
|
+
}, b = { get: (i, l) => l === d ? t : (u(l), A(i[l], a.a, a.c)), has: (i, l) => l === m ? (g = !0, a.a.delete(t), !0) : (u(l), l in i), getOwnPropertyDescriptor: (i, l) => (u(l, !0), Object.getOwnPropertyDescriptor(i, l)), ownKeys: (i) => (u(O), Reflect.ownKeys(i)) };
|
|
17
|
+
return o && (b.set = b.deleteProperty = () => !1), [b, a];
|
|
18
|
+
})(n, f), r[1].p = S(f ? ((t) => {
|
|
19
|
+
let o = P.get(t);
|
|
20
|
+
if (!o) {
|
|
21
|
+
if (Array.isArray(t))
|
|
22
|
+
o = Array.from(t);
|
|
23
|
+
else {
|
|
24
|
+
const a = Object.getOwnPropertyDescriptors(t);
|
|
25
|
+
Object.values(a).forEach((g) => {
|
|
26
|
+
g.configurable = !0;
|
|
27
|
+
}), o = Object.create(w(t), a);
|
|
28
|
+
}
|
|
29
|
+
P.set(t, o);
|
|
30
|
+
}
|
|
31
|
+
return o;
|
|
32
|
+
})(n) : n, r[0]), c && c.set(n, r)), r[1].a = s, r[1].c = c, r[1].p;
|
|
33
|
+
}, D = (e, s) => {
|
|
34
|
+
const c = Reflect.ownKeys(e), n = Reflect.ownKeys(s);
|
|
35
|
+
return c.length !== n.length || c.some((f, r) => f !== n[r]);
|
|
36
|
+
}, K = (e, s, c, n) => {
|
|
37
|
+
if (Object.is(e, s))
|
|
38
|
+
return !1;
|
|
39
|
+
if (!p(e) || !p(s))
|
|
40
|
+
return !0;
|
|
41
|
+
const f = c.get(h(e));
|
|
42
|
+
if (!f)
|
|
43
|
+
return !0;
|
|
44
|
+
if (n) {
|
|
45
|
+
const t = n.get(e);
|
|
46
|
+
if (t && t.n === s)
|
|
47
|
+
return t.g;
|
|
48
|
+
n.set(e, { n: s, g: !1 });
|
|
49
|
+
}
|
|
50
|
+
let r = null;
|
|
51
|
+
for (const t of f) {
|
|
52
|
+
const o = t === O ? D(e, s) : K(e[t], s[t], c, n);
|
|
53
|
+
if (o !== !0 && o !== !1 || (r = o), r)
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
return r === null && (r = !0), n && n.set(e, { n: s, g: r }), r;
|
|
57
|
+
}, x = (e, s) => {
|
|
58
|
+
const c = [], n = /* @__PURE__ */ new WeakSet(), f = (r, t) => {
|
|
59
|
+
if (n.has(r))
|
|
60
|
+
return;
|
|
61
|
+
p(r) && n.add(r);
|
|
62
|
+
const o = p(r) && s.get(h(r));
|
|
63
|
+
o ? o.forEach((a) => {
|
|
64
|
+
f(r[a], t ? [...t, a] : [a]);
|
|
65
|
+
}) : t && c.push(t);
|
|
66
|
+
};
|
|
67
|
+
return f(e), c;
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
x as affectedToPathList,
|
|
71
|
+
A as createProxy,
|
|
72
|
+
K as isChanged
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=index.modern.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.modern.es.js","sources":["../../../../node_modules/proxy-compare/dist/index.modern.js"],"sourcesContent":["const e=Symbol(),t=Symbol(),r=Symbol();let n=(e,t)=>new Proxy(e,t);const o=Object.getPrototypeOf,s=new WeakMap,c=e=>e&&(s.has(e)?s.get(e):o(e)===Object.prototype||o(e)===Array.prototype),l=e=>\"object\"==typeof e&&null!==e,a=new WeakMap,f=e=>e[r]||e,i=(s,l,p)=>{if(!c(s))return s;const y=f(s),u=(e=>Object.isFrozen(e)||Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.writable))(y);let g=p&&p.get(y);return g&&g[1].f===u||(g=((n,o)=>{const s={f:o};let c=!1;const l=(t,r)=>{if(!c){let o=s.a.get(n);o||(o=new Set,s.a.set(n,o)),r&&o.has(e)||o.add(t)}},a={get:(e,t)=>t===r?n:(l(t),i(e[t],s.a,s.c)),has:(e,r)=>r===t?(c=!0,s.a.delete(n),!0):(l(r),r in e),getOwnPropertyDescriptor:(e,t)=>(l(t,!0),Object.getOwnPropertyDescriptor(e,t)),ownKeys:t=>(l(e),Reflect.ownKeys(t))};return o&&(a.set=a.deleteProperty=()=>!1),[a,s]})(y,u),g[1].p=n(u?(e=>{let t=a.get(e);if(!t){if(Array.isArray(e))t=Array.from(e);else{const r=Object.getOwnPropertyDescriptors(e);Object.values(r).forEach(e=>{e.configurable=!0}),t=Object.create(o(e),r)}a.set(e,t)}return t})(y):y,g[0]),p&&p.set(y,g)),g[1].a=l,g[1].c=p,g[1].p},p=(e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((e,t)=>e!==n[t])},y=(t,r,n,o)=>{if(Object.is(t,r))return!1;if(!l(t)||!l(r))return!0;const s=n.get(f(t));if(!s)return!0;if(o){const e=o.get(t);if(e&&e.n===r)return e.g;o.set(t,{n:r,g:!1})}let c=null;for(const l of s){const s=l===e?p(t,r):y(t[l],r[l],n,o);if(!0!==s&&!1!==s||(c=s),c)break}return null===c&&(c=!0),o&&o.set(t,{n:r,g:c}),c},u=e=>!!c(e)&&t in e,g=e=>c(e)&&e[r]||null,b=(e,t=!0)=>{s.set(e,t)},O=(e,t)=>{const r=[],n=new WeakSet,o=(e,s)=>{if(n.has(e))return;l(e)&&n.add(e);const c=l(e)&&t.get(f(e));c?c.forEach(t=>{o(e[t],s?[...s,t]:[t])}):s&&r.push(s)};return o(e),r},w=e=>{n=e};export{O as affectedToPathList,i as createProxy,g as getUntracked,y as isChanged,b as markToTrack,w as replaceNewProxy,u as trackMemo};\n//# sourceMappingURL=index.modern.mjs.map\n"],"names":[],"mappings":"AAAA,MAAM,IAAE,OAAQ,GAAC,IAAE,OAAM,GAAG,IAAE;AAAS,IAAI,IAAE,CAAC,GAAE,MAAI,IAAI,MAAM,GAAE,CAAC;AAAO,MAAC,IAAE,OAAO,gBAAe,IAAE,oBAAI,WAAQ,IAAE,OAAG,KAAI,GAAE,IAAI,CAAC,IAAE,EAAE,IAAI,CAAC,IAAE,EAAE,CAAC,MAAI,OAAO,aAAW,EAAE,CAAC,MAAI,MAAM,YAAW,IAAE,OAAG,AAAU,OAAO,KAAjB,YAAoB,AAAO,MAAP,MAAS,IAAE,oBAAI,WAAQ,IAAE,OAAG,EAAE,MAAI,GAAE,IAAE,CAAC,GAAE,GAAE,MAAI;AAAC,MAAG,CAAC,EAAE,CAAC;AAAE,WAAO;AAAE,QAAM,IAAE,EAAE,CAAC,GAAE,IAAG,QAAG,OAAO,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AAE,EAAC,CAAC,GAAE;AAAC,GAAqE,IAAE,CAAC,GAAE,MAAI;AAAC,QAAM,IAAE,CAAE,GAAC,IAAE,oBAAI,WAAQ,IAAE,CAAC,GAAE,MAAI;AAAC,QAAG,EAAE,IAAI,CAAC;AAAE;AAAO,MAAE,CAAC,KAAG,EAAE,IAAI,CAAC;AAAE,UAAM,IAAE,EAAE,CAAC,KAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AAAE,QAAE,EAAE,QAAQ,OAAG;AAAC,QAAE,EAAE,IAAG,IAAE,CAAC,GAAG,GAAE,CAAC,IAAE,CAAC,CAAC,CAAC;AAAA,IAAC,CAAC,IAAE,KAAG,EAAE,KAAK,CAAC;AAAA,EAAC;AAAE,SAAO,EAAE,CAAC,GAAE;AAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-hotkeys-hook.esm.es.js","sources":["../../../../node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js"],"sourcesContent":["import hotkeys from 'hotkeys-js';\nimport { useRef, useCallback, useEffect } from 'react';\n\n/**\r\n * @deprecated Use isHotkeyPressed instead. Will be removed version 4.\r\n */\n\nfunction useIsHotkeyPressed() {\n return hotkeys.isPressed;\n}\n\nhotkeys.filter = function () {\n return true;\n};\n\nvar tagFilter = function tagFilter(_ref, enableOnTags) {\n var target = _ref.target;\n var targetTagName = target && target.tagName;\n return Boolean(targetTagName && enableOnTags && enableOnTags.includes(targetTagName));\n};\n\nvar isKeyboardEventTriggeredByInput = function isKeyboardEventTriggeredByInput(ev) {\n return tagFilter(ev, ['INPUT', 'TEXTAREA', 'SELECT']);\n};\n\nfunction useHotkeys(keys, callback, options, deps) {\n if (options instanceof Array) {\n deps = options;\n options = undefined;\n }\n\n var _ref2 = options || {},\n enableOnTags = _ref2.enableOnTags,\n filter = _ref2.filter,\n keyup = _ref2.keyup,\n keydown = _ref2.keydown,\n _ref2$filterPreventDe = _ref2.filterPreventDefault,\n filterPreventDefault = _ref2$filterPreventDe === void 0 ? true : _ref2$filterPreventDe,\n _ref2$enabled = _ref2.enabled,\n enabled = _ref2$enabled === void 0 ? true : _ref2$enabled,\n _ref2$enableOnContent = _ref2.enableOnContentEditable,\n enableOnContentEditable = _ref2$enableOnContent === void 0 ? false : _ref2$enableOnContent;\n\n var ref = useRef(null); // The return value of this callback determines if the browsers default behavior is prevented.\n\n var memoisedCallback = useCallback(function (keyboardEvent, hotkeysEvent) {\n var _keyboardEvent$target, _ref$current;\n\n if (filter && !filter(keyboardEvent)) {\n return !filterPreventDefault;\n } // Check whether the hotkeys was triggered inside an input and that input is enabled or if it was triggered by a content editable tag and it is enabled.\n\n\n if (isKeyboardEventTriggeredByInput(keyboardEvent) && !tagFilter(keyboardEvent, enableOnTags) || (_keyboardEvent$target = keyboardEvent.target) != null && _keyboardEvent$target.isContentEditable && !enableOnContentEditable) {\n return true;\n }\n\n if (ref.current === null || document.activeElement === ref.current || (_ref$current = ref.current) != null && _ref$current.contains(document.activeElement)) {\n callback(keyboardEvent, hotkeysEvent);\n return true;\n }\n\n return false;\n }, deps ? [ref, enableOnTags, filter].concat(deps) : [ref, enableOnTags, filter]);\n useEffect(function () {\n if (!enabled) {\n hotkeys.unbind(keys, memoisedCallback);\n return;\n } // In this case keydown is likely undefined, so we set it to false, since hotkeys needs the `keydown` key to have a value.\n\n\n if (keyup && keydown !== true) {\n options.keydown = false;\n }\n\n hotkeys(keys, options || {}, memoisedCallback);\n return function () {\n return hotkeys.unbind(keys, memoisedCallback);\n };\n }, [memoisedCallback, keys, enabled]);\n return ref;\n}\n\nvar isHotkeyPressed = hotkeys.isPressed;\n\nexport { isHotkeyPressed, useHotkeys, useIsHotkeyPressed };\n//# sourceMappingURL=react-hotkeys-hook.esm.js.map\n"],"names":[],"mappings":";;AAWA,EAAQ,SAAS,WAAY;AAC3B,SAAO;AACT;AAsEsB,EAAQ;"}
|