@graffiticode/l0179-view 0.1.3 → 0.1.4
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/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, S as t, _ as n, a as r, b as i, d as a, f as o, g as s, h as c, i as l, n as u, p as d, s as f, u as p, v as m, x as h, y as g } from "./scoring-
|
|
1
|
+
import { C as e, S as t, _ as n, a as r, b as i, d as a, f as o, g as s, h as c, i as l, n as u, p as d, s as f, u as p, v as m, x as h, y as g } from "./scoring-QgX_ajUB.js";
|
|
2
2
|
import _, { createContext as v, useCallback as y, useContext as b, useDebugValue as x, useEffect as S, useLayoutEffect as C, useMemo as ee, useReducer as w, useRef as T, useState as E } from "react";
|
|
3
3
|
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
4
4
|
import te from "react-dom/client";
|
|
@@ -14718,7 +14718,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14718
14718
|
e.done || t.delete(e.value);
|
|
14719
14719
|
}
|
|
14720
14720
|
return t.set(n, r), r;
|
|
14721
|
-
}, D_ = (e, t) => e && e.values.get(t), O_ = (e, t, n) => e ? E_(e, e.values, t, n) : n, k_ = (e, t) => e && e.formats.get(t), A_ = (e, t, n) => e ? E_(e, e.formats, t, n) : n, j_ = ({ env: t, name: r, graph: i, cache: l }) => {
|
|
14721
|
+
}, D_ = (e, t) => e && e.values.get(t), O_ = (e, t, n) => e ? E_(e, e.values, t, n) : n, k_ = (e, t) => e && e.formats.get(t), A_ = (e, t, n) => e ? E_(e, e.formats, t, n) : n, j_ = /^#(VALUE!|NUM!|DIV\/0!|NAME\?|NAME!|REF!|N\/A|NULL!)$/, M_ = ({ env: t, name: r, graph: i, cache: l }) => {
|
|
14722
14722
|
let u = t.cells[r], f = u?.text || "", g = u?.format || "", _ = {
|
|
14723
14723
|
formula: f,
|
|
14724
14724
|
val: f,
|
|
@@ -14741,7 +14741,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14741
14741
|
error: `Undefined name${e.length > 1 ? "s" : ""}: ${e.join(", ")}`
|
|
14742
14742
|
};
|
|
14743
14743
|
}
|
|
14744
|
-
let u =
|
|
14744
|
+
let u = I_({
|
|
14745
14745
|
env: t,
|
|
14746
14746
|
startCell: r,
|
|
14747
14747
|
graph: i
|
|
@@ -14798,7 +14798,16 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14798
14798
|
};
|
|
14799
14799
|
return;
|
|
14800
14800
|
}
|
|
14801
|
-
t = v.decode(t),
|
|
14801
|
+
if (t = v.decode(t), typeof t == "string" && j_.test(t)) {
|
|
14802
|
+
_ = {
|
|
14803
|
+
..._,
|
|
14804
|
+
val: t,
|
|
14805
|
+
type: "error",
|
|
14806
|
+
error: `${t} returned by the formula`
|
|
14807
|
+
};
|
|
14808
|
+
return;
|
|
14809
|
+
}
|
|
14810
|
+
_ = P_(g) && c(String(t)) ? {
|
|
14802
14811
|
..._,
|
|
14803
14812
|
val: String(t),
|
|
14804
14813
|
type: "date"
|
|
@@ -14817,7 +14826,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14817
14826
|
console.log("parse error: " + e.stack);
|
|
14818
14827
|
}
|
|
14819
14828
|
return _;
|
|
14820
|
-
},
|
|
14829
|
+
}, N_ = (e) => (typeof e == "string" ? e : String(e || "")).replace(/* @__PURE__ */ RegExp("\\{\\{", "g"), "[[").replace(/* @__PURE__ */ RegExp("\\}\\}", "g"), "]]"), P_ = (e) => e && [
|
|
14821
14830
|
"MM/DD/YYYY",
|
|
14822
14831
|
"DD/MM/YYYY",
|
|
14823
14832
|
"YYYY-MM-DD",
|
|
@@ -14828,13 +14837,13 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14828
14837
|
"MMM DD, YYYY",
|
|
14829
14838
|
"DD MMM YYYY",
|
|
14830
14839
|
"date"
|
|
14831
|
-
].some((t) => e.toLowerCase().includes(t.toLowerCase())),
|
|
14840
|
+
].some((t) => e.toLowerCase().includes(t.toLowerCase())), F_ = ({ env: n, name: r, cache: a }) => {
|
|
14832
14841
|
let s = n.cells[r] || {}, c = a && T_(s);
|
|
14833
14842
|
if (a) {
|
|
14834
14843
|
let e = k_(a, c);
|
|
14835
14844
|
if (e !== void 0) return e;
|
|
14836
14845
|
}
|
|
14837
|
-
let l = s.val, u = s.type || "text", d = s.format || "", f = l, p =
|
|
14846
|
+
let l = s.val, u = s.type || "text", d = s.format || "", f = l, p = P_(d);
|
|
14838
14847
|
if ((u === "date" || p) && l) {
|
|
14839
14848
|
let e = typeof l == "string" ? parseFloat(l) : l;
|
|
14840
14849
|
if (!isNaN(e)) {
|
|
@@ -14872,11 +14881,11 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14872
14881
|
console.log("parse error: " + e.stack);
|
|
14873
14882
|
}
|
|
14874
14883
|
return a ? A_(a, c, f) : f;
|
|
14875
|
-
},
|
|
14884
|
+
}, I_ = ({ env: e, startCell: t, graph: n }) => n ? __(n, t) : g_(h_(e.cells), t), L_ = ({ cells: e, graph: t, changed: n, cache: r }) => {
|
|
14876
14885
|
let i = [...n], a = v_(t, i), { order: o, cyclic: s } = y_(t, [...i, ...a]), c = { ...e }, l = new Set(i), u = /* @__PURE__ */ new Set(), d = { cells: c }, f = (e) => {
|
|
14877
14886
|
let n = c[e];
|
|
14878
14887
|
if (n === void 0) return;
|
|
14879
|
-
let i =
|
|
14888
|
+
let i = M_({
|
|
14880
14889
|
env: d,
|
|
14881
14890
|
name: e,
|
|
14882
14891
|
graph: t,
|
|
@@ -14893,7 +14902,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14893
14902
|
cells: c,
|
|
14894
14903
|
changed: [...u]
|
|
14895
14904
|
};
|
|
14896
|
-
},
|
|
14905
|
+
}, R_ = (e) => {
|
|
14897
14906
|
let t = {};
|
|
14898
14907
|
for (let n of Object.keys(e)) {
|
|
14899
14908
|
let { text: r, val: i, formula: a, assess: o } = e[n];
|
|
@@ -14904,13 +14913,13 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14904
14913
|
});
|
|
14905
14914
|
}
|
|
14906
14915
|
return t;
|
|
14907
|
-
},
|
|
14916
|
+
}, z_ = (e, t, n) => {
|
|
14908
14917
|
let r = {}, i = { cells: e };
|
|
14909
14918
|
for (let a of t) {
|
|
14910
14919
|
let t = e[a];
|
|
14911
14920
|
t && (r[a] = {
|
|
14912
14921
|
text: t.text,
|
|
14913
|
-
formattedValue:
|
|
14922
|
+
formattedValue: F_({
|
|
14914
14923
|
env: i,
|
|
14915
14924
|
name: a,
|
|
14916
14925
|
cache: n
|
|
@@ -14918,10 +14927,10 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14918
14927
|
});
|
|
14919
14928
|
}
|
|
14920
14929
|
return r;
|
|
14921
|
-
},
|
|
14930
|
+
}, B_ = (e) => {
|
|
14922
14931
|
let { row: t, col: n, name: r, background: i, "background-color": a, backgroundColor: o, lastFocusedCell: s, score: c } = e, l = a || o;
|
|
14923
14932
|
return t <= 1 || n <= 1 ? null : c !== void 0 && r !== s && (c.isValid === !0 && "#efe" || "#fee") || l || i || null;
|
|
14924
|
-
},
|
|
14933
|
+
}, V_ = (e, t) => {
|
|
14925
14934
|
if (!e) return t;
|
|
14926
14935
|
if (!t) return e;
|
|
14927
14936
|
if (e.includes("px") || t.includes("px")) return t;
|
|
@@ -14932,7 +14941,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14932
14941
|
"right"
|
|
14933
14942
|
] : e.split(",").map((e) => e.trim().toLowerCase()), r = n(e), i = n(t), a = [.../* @__PURE__ */ new Set([...r, ...i])];
|
|
14934
14943
|
return a.includes("top") && a.includes("bottom") && a.includes("left") && a.includes("right") ? "all" : a.join(",");
|
|
14935
|
-
},
|
|
14944
|
+
}, H_ = (e) => {
|
|
14936
14945
|
let t = e.data.interaction?.hideMenu || !1;
|
|
14937
14946
|
return new Ul({ view(n) {
|
|
14938
14947
|
let r = document.createElement("div"), i = te.createRoot(r);
|
|
@@ -14957,7 +14966,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14957
14966
|
}
|
|
14958
14967
|
};
|
|
14959
14968
|
} });
|
|
14960
|
-
},
|
|
14969
|
+
}, U_ = ({ doc: e, cells: t }) => {
|
|
14961
14970
|
let n = [];
|
|
14962
14971
|
return t.forEach(({ from: e, to: t, color: r, textColor: i, fontWeight: a, border: o, borderClass: s }) => {
|
|
14963
14972
|
n.push(Tp.node(e, t, {
|
|
@@ -14970,13 +14979,13 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
14970
14979
|
class: s || ""
|
|
14971
14980
|
}));
|
|
14972
14981
|
}), Op.create(e, n);
|
|
14973
|
-
},
|
|
14982
|
+
}, W_ = (e, t) => {
|
|
14974
14983
|
if (t === null) return !1;
|
|
14975
14984
|
let n = e.doc.resolve(t);
|
|
14976
14985
|
for (let e = n.depth; e > 0; e--) if (n.node(e).type.name === "table_header") return !0;
|
|
14977
14986
|
return !1;
|
|
14978
|
-
},
|
|
14979
|
-
let { doc: n, selection: r } = e, i = r.$anchor, a =
|
|
14987
|
+
}, G_ = (e, t) => {
|
|
14988
|
+
let { doc: n, selection: r } = e, i = r.$anchor, a = Z_(i);
|
|
14980
14989
|
if (!a) return null;
|
|
14981
14990
|
let o = n.nodeAt(a.pos), s = X.get(o), c = s.width, l = s.height, u = i.pos - a.pos - 1, d = -1;
|
|
14982
14991
|
for (let e = 0; e < s.map.length; e++) if (s.map[e] <= u && (e === s.map.length - 1 || s.map[e + 1] > u)) {
|
|
@@ -15009,21 +15018,21 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15009
15018
|
if (n < s.map.length) return s.map[n] + a.pos + 1;
|
|
15010
15019
|
}
|
|
15011
15020
|
return s.map[s.map.length - 1] + a.pos + 1;
|
|
15012
|
-
},
|
|
15013
|
-
let r =
|
|
15021
|
+
}, K_ = (e) => (t, n) => {
|
|
15022
|
+
let r = G_(t, e);
|
|
15014
15023
|
if (r !== null && n) {
|
|
15015
15024
|
let e = t.tr, i = e.doc.resolve(r), a = G.near(i);
|
|
15016
15025
|
return n(e.setSelection(a)), !0;
|
|
15017
15026
|
}
|
|
15018
15027
|
return !1;
|
|
15019
|
-
},
|
|
15020
|
-
let a =
|
|
15028
|
+
}, q_ = (e, t, n, r, i) => {
|
|
15029
|
+
let a = Y_(e, t), o = i?.data?.interaction?.cells, s = l({
|
|
15021
15030
|
cells: n.cells,
|
|
15022
15031
|
validation: r,
|
|
15023
15032
|
interactionCells: o
|
|
15024
15033
|
}), { doc: c, selection: u } = t, { lastFocusedCell: d } = n, f = i?.data?.focus, p = [], m = [], h = [];
|
|
15025
15034
|
a.forEach((e) => {
|
|
15026
|
-
let t =
|
|
15035
|
+
let t = B_({
|
|
15027
15036
|
...e,
|
|
15028
15037
|
lastFocusedCell: d,
|
|
15029
15038
|
score: s[e.name]?.score
|
|
@@ -15077,7 +15086,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15077
15086
|
borderClass: ""
|
|
15078
15087
|
};
|
|
15079
15088
|
};
|
|
15080
|
-
return
|
|
15089
|
+
return U_({
|
|
15081
15090
|
doc: c,
|
|
15082
15091
|
cells: a.map((e) => {
|
|
15083
15092
|
let t = u.anchor > e.from && u.anchor < e.to, { styleStr: n, borderClass: r } = g(e, t), i = p[e.row] && p[e.row][e.col], a = m[e.row] && m[e.row][e.col], o = h[e.row] && h[e.row][e.col];
|
|
@@ -15092,10 +15101,10 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15092
15101
|
};
|
|
15093
15102
|
})
|
|
15094
15103
|
});
|
|
15095
|
-
},
|
|
15104
|
+
}, J_ = (e) => e.type.name === "table_cell" || e.type.name === "table_header", Y_ = (e, t) => {
|
|
15096
15105
|
let { doc: n } = t, r = [], i = 0, a = 0;
|
|
15097
15106
|
return n.descendants((t, n) => {
|
|
15098
|
-
if (t.type.name === "table_row" && (i++, a = 0),
|
|
15107
|
+
if (t.type.name === "table_row" && (i++, a = 0), J_(t)) {
|
|
15099
15108
|
a++;
|
|
15100
15109
|
let o = t.attrs.name, s = e && o && e.cells[o]?.text || t.textContent, c = e && o && e.cells[o]?.val, l = e && o && e.cells[o]?.formula, u = e && o && e.cells[o]?.type || "text";
|
|
15101
15110
|
r.push({
|
|
@@ -15121,7 +15130,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15121
15130
|
});
|
|
15122
15131
|
}
|
|
15123
15132
|
}), r;
|
|
15124
|
-
},
|
|
15133
|
+
}, X_ = new Gs({
|
|
15125
15134
|
nodes: Cm.spec.nodes.append(qm({
|
|
15126
15135
|
tableGroup: "block",
|
|
15127
15136
|
cellContent: "paragraph",
|
|
@@ -15279,7 +15288,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15279
15288
|
}
|
|
15280
15289
|
})),
|
|
15281
15290
|
marks: {}
|
|
15282
|
-
}),
|
|
15291
|
+
}), Z_ = (e) => {
|
|
15283
15292
|
for (let t = e.depth; t > 0; t--) {
|
|
15284
15293
|
let n = e.node(t);
|
|
15285
15294
|
if (n.type.name === "table") return {
|
|
@@ -15288,46 +15297,46 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15288
15297
|
};
|
|
15289
15298
|
}
|
|
15290
15299
|
return null;
|
|
15291
|
-
},
|
|
15292
|
-
let { $from: t } = e.selection, n =
|
|
15300
|
+
}, Q_ = (e) => {
|
|
15301
|
+
let { $from: t } = e.selection, n = Z_(t);
|
|
15293
15302
|
return n ? n.pos : null;
|
|
15294
|
-
},
|
|
15295
|
-
let t = e.slice(0, 1), n = e.slice(1), r =
|
|
15303
|
+
}, $_ = "_ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""), ev = (e) => {
|
|
15304
|
+
let t = e.slice(0, 1), n = e.slice(1), r = $_.indexOf(t);
|
|
15296
15305
|
return {
|
|
15297
15306
|
row: +n,
|
|
15298
15307
|
col: r
|
|
15299
15308
|
};
|
|
15300
|
-
},
|
|
15301
|
-
let n =
|
|
15309
|
+
}, tv = ({ state: e, name: t }) => {
|
|
15310
|
+
let n = Q_(e), r = e.doc.nodeAt(n), i = X.get(r), { row: a, col: o } = ev(t), s = a * i.width + o, c = i.map[s] + n + 1;
|
|
15302
15311
|
return {
|
|
15303
15312
|
node: e.doc.nodeAt(c),
|
|
15304
15313
|
pos: c
|
|
15305
15314
|
};
|
|
15306
|
-
},
|
|
15307
|
-
let { row: n, col: r } =
|
|
15308
|
-
return
|
|
15315
|
+
}, nv = ({ state: e, name: t }) => {
|
|
15316
|
+
let { row: n, col: r } = ev(t), i = n === 0 && n + 1 || n;
|
|
15317
|
+
return tv({
|
|
15309
15318
|
state: e,
|
|
15310
|
-
name: `${
|
|
15319
|
+
name: `${$_[r === 0 && r + 1 || r]}${i}`
|
|
15311
15320
|
});
|
|
15312
|
-
},
|
|
15321
|
+
}, rv = (e, t) => {
|
|
15313
15322
|
let { state: n, dispatch: r } = e, i = n.tr;
|
|
15314
15323
|
i.setMeta("systemFormatting", !0);
|
|
15315
15324
|
for (let { name: e, text: r } of t) {
|
|
15316
|
-
let { pos: t, node: a } =
|
|
15325
|
+
let { pos: t, node: a } = tv({
|
|
15317
15326
|
state: n,
|
|
15318
15327
|
name: e
|
|
15319
15328
|
});
|
|
15320
|
-
if (!a || !
|
|
15329
|
+
if (!a || !J_(a)) continue;
|
|
15321
15330
|
let o = i.mapping.map(t + 1), s = i.mapping.map(t + a.nodeSize - 1), c = r && n.schema.node("paragraph", null, n.schema.text(r)) || n.schema.node("paragraph");
|
|
15322
15331
|
i.replaceWith(o, s, c);
|
|
15323
15332
|
}
|
|
15324
15333
|
i.docChanged && r(i);
|
|
15325
|
-
},
|
|
15326
|
-
let { state: i, dispatch: a } = e, { pos: o, node: s } =
|
|
15334
|
+
}, iv = (e, t, n, r = !1) => {
|
|
15335
|
+
let { state: i, dispatch: a } = e, { pos: o, node: s } = tv({
|
|
15327
15336
|
state: i,
|
|
15328
15337
|
name: t
|
|
15329
15338
|
});
|
|
15330
|
-
if (!s || !
|
|
15339
|
+
if (!s || !J_(s)) {
|
|
15331
15340
|
console.error("Invalid cell position or node type: " + JSON.stringify(s, null, 2));
|
|
15332
15341
|
return;
|
|
15333
15342
|
}
|
|
@@ -15337,7 +15346,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15337
15346
|
d.setSelection(G.create(d.doc, e + n.length));
|
|
15338
15347
|
}
|
|
15339
15348
|
a(d);
|
|
15340
|
-
},
|
|
15349
|
+
}, av = (e) => new Ul({
|
|
15341
15350
|
view(t) {
|
|
15342
15351
|
let n = (n) => {
|
|
15343
15352
|
let r = n.shiftKey, i = n.metaKey || n.ctrlKey;
|
|
@@ -15519,7 +15528,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15519
15528
|
t.setMeta("focusChanged", !0), t.setMeta("headerClick", !0), c(t);
|
|
15520
15529
|
}
|
|
15521
15530
|
}
|
|
15522
|
-
let { pos: n, node: i } =
|
|
15531
|
+
let { pos: n, node: i } = nv({
|
|
15523
15532
|
state: s,
|
|
15524
15533
|
name: t
|
|
15525
15534
|
});
|
|
@@ -15568,13 +15577,13 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15568
15577
|
return !1;
|
|
15569
15578
|
},
|
|
15570
15579
|
beforeinput(e, t) {
|
|
15571
|
-
return
|
|
15580
|
+
return ov(e.state) ? (t.preventDefault(), !0) : !1;
|
|
15572
15581
|
},
|
|
15573
15582
|
keydown(e, t) {
|
|
15574
15583
|
let { state: n, dispatch: r } = e;
|
|
15575
|
-
if (
|
|
15576
|
-
if (t.preventDefault(), t.key === "Tab") return
|
|
15577
|
-
let { pos: e } =
|
|
15584
|
+
if (ov(n)) {
|
|
15585
|
+
if (t.preventDefault(), t.key === "Tab") return K_(t.shiftKey ? -1 : 1)(n, r), !0;
|
|
15586
|
+
let { pos: e } = tv({
|
|
15578
15587
|
state: n,
|
|
15579
15588
|
name: "B2"
|
|
15580
15589
|
});
|
|
@@ -15590,7 +15599,7 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15590
15599
|
"ArrowLeft",
|
|
15591
15600
|
"ArrowRight"
|
|
15592
15601
|
].includes(t.key)) {
|
|
15593
|
-
let e = n.selection.$anchor, r =
|
|
15602
|
+
let e = n.selection.$anchor, r = Z_(e);
|
|
15594
15603
|
if (r) {
|
|
15595
15604
|
let i = n.doc.nodeAt(r.pos), a = X.get(i), o = a.width, s = e.pos - r.pos - 1, c = -1;
|
|
15596
15605
|
for (let e = 0; e < a.map.length; e++) if (a.map[e] <= s && (e === a.map.length - 1 || a.map[e + 1] > s)) {
|
|
@@ -15609,16 +15618,16 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15609
15618
|
return !1;
|
|
15610
15619
|
},
|
|
15611
15620
|
paste(e, t) {
|
|
15612
|
-
return
|
|
15621
|
+
return ov(e.state) ? (t.preventDefault(), !0) : !1;
|
|
15613
15622
|
},
|
|
15614
15623
|
cut(e, t) {
|
|
15615
|
-
return
|
|
15624
|
+
return ov(e.state) ? (t.preventDefault(), !0) : !1;
|
|
15616
15625
|
}
|
|
15617
15626
|
}
|
|
15618
15627
|
},
|
|
15619
15628
|
filterTransaction(e, t) {
|
|
15620
15629
|
if (e.getMeta("_headerRedirect")) return !0;
|
|
15621
|
-
if (e.steps.length > 0 &&
|
|
15630
|
+
if (e.steps.length > 0 && ov(t)) return e.steps.every((e) => e.toJSON().stepType === "setSelection");
|
|
15622
15631
|
if (e.selectionSet) {
|
|
15623
15632
|
let t = e.selection.$anchor;
|
|
15624
15633
|
if (t) {
|
|
@@ -15632,11 +15641,11 @@ var t_ = ({ className: e, editorView: t, hideMenu: n = !1 }) => n ? null : /* @_
|
|
|
15632
15641
|
return !0;
|
|
15633
15642
|
}
|
|
15634
15643
|
});
|
|
15635
|
-
function
|
|
15644
|
+
function ov(e) {
|
|
15636
15645
|
let { selection: t } = e;
|
|
15637
|
-
return
|
|
15646
|
+
return W_(e, t.$anchor.pos);
|
|
15638
15647
|
}
|
|
15639
|
-
function
|
|
15648
|
+
function sv(e) {
|
|
15640
15649
|
let { selection: t } = e, n = e.doc.resolve(t.$anchor.pos);
|
|
15641
15650
|
for (let e = n.depth; e > 0; e--) {
|
|
15642
15651
|
let t = n.node(e);
|
|
@@ -15644,19 +15653,19 @@ function ov(e) {
|
|
|
15644
15653
|
}
|
|
15645
15654
|
return !1;
|
|
15646
15655
|
}
|
|
15647
|
-
var
|
|
15656
|
+
var cv = (e) => new Ul({
|
|
15648
15657
|
props: { handleDOMEvents: {
|
|
15649
15658
|
beforeinput(t, n) {
|
|
15650
|
-
return
|
|
15659
|
+
return sv(t.state) ? (n.preventDefault(), e?.showTooltip(n), !0) : !1;
|
|
15651
15660
|
},
|
|
15652
15661
|
input(e, t) {
|
|
15653
|
-
return
|
|
15662
|
+
return sv(e.state) ? (t.preventDefault(), !0) : !1;
|
|
15654
15663
|
},
|
|
15655
15664
|
keypress(t, n) {
|
|
15656
|
-
return
|
|
15665
|
+
return sv(t.state) ? (n.preventDefault(), e?.showTooltip(n), !0) : !1;
|
|
15657
15666
|
},
|
|
15658
15667
|
keydown(t, n) {
|
|
15659
|
-
if (
|
|
15668
|
+
if (sv(t.state)) {
|
|
15660
15669
|
let t = [
|
|
15661
15670
|
"ArrowUp",
|
|
15662
15671
|
"ArrowDown",
|
|
@@ -15697,20 +15706,20 @@ var sv = (e) => new Ul({
|
|
|
15697
15706
|
return !1;
|
|
15698
15707
|
},
|
|
15699
15708
|
paste(t, n) {
|
|
15700
|
-
return
|
|
15709
|
+
return sv(t.state) ? (n.preventDefault(), e?.showTooltip(n), !0) : !1;
|
|
15701
15710
|
},
|
|
15702
15711
|
cut(t, n) {
|
|
15703
|
-
return
|
|
15712
|
+
return sv(t.state) ? (n.preventDefault(), e?.showTooltip(n), !0) : !1;
|
|
15704
15713
|
},
|
|
15705
15714
|
drop(t, n) {
|
|
15706
|
-
return
|
|
15715
|
+
return sv(t.state) ? (n.preventDefault(), e?.showTooltip(n), !0) : !1;
|
|
15707
15716
|
}
|
|
15708
15717
|
} },
|
|
15709
15718
|
filterTransaction(e, t) {
|
|
15710
15719
|
if (e.getMeta("systemFormatting")) return !0;
|
|
15711
15720
|
if (e.steps.length > 0) for (let n of e.steps) {
|
|
15712
15721
|
let e = n.toJSON();
|
|
15713
|
-
if (e.stepType !== "setSelection" &&
|
|
15722
|
+
if (e.stepType !== "setSelection" && sv(t)) return !1;
|
|
15714
15723
|
if (e.stepType === "replace" && e.from !== void 0) {
|
|
15715
15724
|
let n = t.doc.resolve(e.from);
|
|
15716
15725
|
for (let e = n.depth; e > 0; e--) {
|
|
@@ -15721,7 +15730,7 @@ var sv = (e) => new Ul({
|
|
|
15721
15730
|
}
|
|
15722
15731
|
return !0;
|
|
15723
15732
|
}
|
|
15724
|
-
}),
|
|
15733
|
+
}), lv = (e) => {
|
|
15725
15734
|
let t = !1, n = new Ul({
|
|
15726
15735
|
view(r) {
|
|
15727
15736
|
return { update(r) {
|
|
@@ -15734,7 +15743,7 @@ var sv = (e) => new Ul({
|
|
|
15734
15743
|
let n = o.cells || {}, r = Object.keys(n);
|
|
15735
15744
|
r.length > 0 && e.apply({
|
|
15736
15745
|
type: "update",
|
|
15737
|
-
args: { cells:
|
|
15746
|
+
args: { cells: z_(n, r, o.cache) }
|
|
15738
15747
|
});
|
|
15739
15748
|
}
|
|
15740
15749
|
let s = { ...o.cells }, { columns: c, cells: l, rows: u } = e.data.interaction;
|
|
@@ -15769,17 +15778,17 @@ var sv = (e) => new Ul({
|
|
|
15769
15778
|
if (o.dirtyCells.forEach((e) => {
|
|
15770
15779
|
s[e] = {
|
|
15771
15780
|
...s[e],
|
|
15772
|
-
...
|
|
15781
|
+
...M_({
|
|
15773
15782
|
env: { cells: s },
|
|
15774
15783
|
name: e,
|
|
15775
15784
|
cache: o.cache
|
|
15776
15785
|
})
|
|
15777
15786
|
};
|
|
15778
|
-
let t =
|
|
15787
|
+
let t = N_(F_({
|
|
15779
15788
|
env: { cells: s },
|
|
15780
15789
|
name: e,
|
|
15781
15790
|
cache: o.cache
|
|
15782
|
-
})), { node: n } =
|
|
15791
|
+
})), { node: n } = tv({
|
|
15783
15792
|
state: r.state,
|
|
15784
15793
|
name: e
|
|
15785
15794
|
});
|
|
@@ -15787,26 +15796,26 @@ var sv = (e) => new Ul({
|
|
|
15787
15796
|
name: e,
|
|
15788
15797
|
text: t
|
|
15789
15798
|
});
|
|
15790
|
-
}), d.length &&
|
|
15791
|
-
let e = o.focusedCell, t =
|
|
15799
|
+
}), d.length && rv(r, d), o.focusedCell) {
|
|
15800
|
+
let e = o.focusedCell, t = N_(o.cells[e]?.text || ""), { node: n } = tv({
|
|
15792
15801
|
state: r.state,
|
|
15793
15802
|
name: e
|
|
15794
15803
|
});
|
|
15795
|
-
n.type.name === "table_cell" && t !== n.textContent &&
|
|
15804
|
+
n.type.name === "table_cell" && t !== n.textContent && iv(r, e, t, !0);
|
|
15796
15805
|
}
|
|
15797
15806
|
} };
|
|
15798
15807
|
},
|
|
15799
15808
|
state: {
|
|
15800
15809
|
init(r, i) {
|
|
15801
15810
|
t = !1;
|
|
15802
|
-
let a = n.getState(i), o =
|
|
15811
|
+
let a = n.getState(i), o = Y_(a, i), s = {};
|
|
15803
15812
|
for (let e of o) e.row > 1 && e.col > 1 && (s[e.name] = {
|
|
15804
15813
|
...e,
|
|
15805
15814
|
deps: []
|
|
15806
15815
|
});
|
|
15807
15816
|
let c = [];
|
|
15808
15817
|
for (let e of o) e.row > 1 && e.col > 1 && e.text && c.push(e.name);
|
|
15809
|
-
let l = p_(s), u = C_(), d =
|
|
15818
|
+
let l = p_(s), u = C_(), d = L_({
|
|
15810
15819
|
cells: s,
|
|
15811
15820
|
graph: l,
|
|
15812
15821
|
changed: c,
|
|
@@ -15828,7 +15837,7 @@ var sv = (e) => new Ul({
|
|
|
15828
15837
|
cells: f,
|
|
15829
15838
|
graph: l,
|
|
15830
15839
|
cache: u
|
|
15831
|
-
}, m =
|
|
15840
|
+
}, m = q_(a, i, p, e.data?.validation || null, e);
|
|
15832
15841
|
return {
|
|
15833
15842
|
...p,
|
|
15834
15843
|
decorations: m
|
|
@@ -15844,7 +15853,7 @@ var sv = (e) => new Ul({
|
|
|
15844
15853
|
...r,
|
|
15845
15854
|
lastHeaderClick: Date.now()
|
|
15846
15855
|
}), t.getMeta("focusChanged") || t.getMeta("focusCleared") || t.getMeta("headerClick")) {
|
|
15847
|
-
let t = n.getState(a), { validation: i } = e.data, o =
|
|
15856
|
+
let t = n.getState(a), { validation: i } = e.data, o = q_(t, a, r, i, e);
|
|
15848
15857
|
return {
|
|
15849
15858
|
...r,
|
|
15850
15859
|
decorations: o
|
|
@@ -15855,7 +15864,7 @@ var sv = (e) => new Ul({
|
|
|
15855
15864
|
if (u && r.cells[u]) {
|
|
15856
15865
|
let e = r.cells[u], t = r.graph;
|
|
15857
15866
|
m_(t, u, e.text || "", r.cells);
|
|
15858
|
-
let n =
|
|
15867
|
+
let n = L_({
|
|
15859
15868
|
cells: r.cells,
|
|
15860
15869
|
graph: t,
|
|
15861
15870
|
changed: [u],
|
|
@@ -15884,7 +15893,7 @@ var sv = (e) => new Ul({
|
|
|
15884
15893
|
lastFocusedCell: c.attrs.name,
|
|
15885
15894
|
focusedCell: c.attrs.name
|
|
15886
15895
|
};
|
|
15887
|
-
let n =
|
|
15896
|
+
let n = R_(r.cells);
|
|
15888
15897
|
if (e.apply({
|
|
15889
15898
|
type: "response",
|
|
15890
15899
|
args: { cells: n }
|
|
@@ -15892,7 +15901,7 @@ var sv = (e) => new Ul({
|
|
|
15892
15901
|
let t = [u, ...r.cells[u]?.deps || []];
|
|
15893
15902
|
e.apply({
|
|
15894
15903
|
type: "update",
|
|
15895
|
-
args: { cells:
|
|
15904
|
+
args: { cells: z_(r.cells, t, r.cache) }
|
|
15896
15905
|
});
|
|
15897
15906
|
}
|
|
15898
15907
|
c.attrs.name && !t.getMeta("syntheticFocus") && e.apply({
|
|
@@ -15902,7 +15911,7 @@ var sv = (e) => new Ul({
|
|
|
15902
15911
|
name: c.attrs.name
|
|
15903
15912
|
}
|
|
15904
15913
|
});
|
|
15905
|
-
} else if (
|
|
15914
|
+
} else if (J_(c) && c.attrs?.name) {
|
|
15906
15915
|
let e = c.attrs.name, t = c.textContent.trim();
|
|
15907
15916
|
r = {
|
|
15908
15917
|
...r,
|
|
@@ -15913,7 +15922,7 @@ var sv = (e) => new Ul({
|
|
|
15913
15922
|
...r.cells,
|
|
15914
15923
|
[e]: {
|
|
15915
15924
|
...r.cells[e],
|
|
15916
|
-
...
|
|
15925
|
+
...M_({
|
|
15917
15926
|
env: r,
|
|
15918
15927
|
name: e
|
|
15919
15928
|
}),
|
|
@@ -15927,7 +15936,7 @@ var sv = (e) => new Ul({
|
|
|
15927
15936
|
...r,
|
|
15928
15937
|
decorations: o.decorations.map(t.mapping, t.doc)
|
|
15929
15938
|
};
|
|
15930
|
-
let d = n.getState(a), f = e.data?.validation || null, p =
|
|
15939
|
+
let d = n.getState(a), f = e.data?.validation || null, p = q_(d, a, r, f, e);
|
|
15931
15940
|
return {
|
|
15932
15941
|
...r,
|
|
15933
15942
|
decorations: p
|
|
@@ -16001,7 +16010,7 @@ var sv = (e) => new Ul({
|
|
|
16001
16010
|
}
|
|
16002
16011
|
});
|
|
16003
16012
|
return n;
|
|
16004
|
-
},
|
|
16013
|
+
}, uv = ({ col: e, row: t, attrs: n, colsAttrs: r }) => {
|
|
16005
16014
|
r ||= {};
|
|
16006
16015
|
let i = t[e], a = e === "_" && [40] || (r[e]?.width ? [r[e].width] : null), o = i?.attrs?.["background-color"] || r[e]?.["background-color"] || n?.["background-color"], { text: s } = i || {}, c = [{
|
|
16007
16016
|
type: "paragraph",
|
|
@@ -16037,39 +16046,39 @@ var sv = (e) => new Ul({
|
|
|
16037
16046
|
},
|
|
16038
16047
|
content: c
|
|
16039
16048
|
};
|
|
16040
|
-
},
|
|
16049
|
+
}, dv = ({ cols: e, row: t, attrs: n, colsAttrs: r }) => ({
|
|
16041
16050
|
type: "table_row",
|
|
16042
|
-
content: e.map((e) =>
|
|
16051
|
+
content: e.map((e) => uv({
|
|
16043
16052
|
col: e,
|
|
16044
16053
|
row: t,
|
|
16045
16054
|
attrs: n,
|
|
16046
16055
|
colsAttrs: r
|
|
16047
16056
|
}))
|
|
16048
|
-
}),
|
|
16057
|
+
}), fv = ({ cols: e, rows: t, attrs: n, colsAttrs: r }) => ({
|
|
16049
16058
|
type: "table",
|
|
16050
|
-
content: t.map((t, i) =>
|
|
16059
|
+
content: t.map((t, i) => dv({
|
|
16051
16060
|
cols: e,
|
|
16052
16061
|
row: t,
|
|
16053
16062
|
colsAttrs: r,
|
|
16054
16063
|
attrs: n[i]
|
|
16055
16064
|
}))
|
|
16056
|
-
}),
|
|
16065
|
+
}), pv = ({ cols: e, rows: t, colsAttrs: n, rowsAttrs: r }) => ({
|
|
16057
16066
|
type: "doc",
|
|
16058
|
-
content: [{ ...
|
|
16067
|
+
content: [{ ...fv({
|
|
16059
16068
|
cols: e,
|
|
16060
16069
|
rows: t,
|
|
16061
|
-
attrs:
|
|
16070
|
+
attrs: mv({
|
|
16062
16071
|
rows: t,
|
|
16063
16072
|
rowsAttrs: r
|
|
16064
16073
|
}),
|
|
16065
16074
|
colsAttrs: n
|
|
16066
16075
|
}) }]
|
|
16067
|
-
}),
|
|
16076
|
+
}), mv = ({ rows: e, rowsAttrs: t }) => {
|
|
16068
16077
|
let n = [];
|
|
16069
16078
|
return e.forEach((e, r) => {
|
|
16070
16079
|
n[r] === void 0 && (n[r] = {}), t && t[r] && (n[r] = { ...t[r] });
|
|
16071
16080
|
}), n;
|
|
16072
|
-
},
|
|
16081
|
+
}, hv = (e, t, n, r, i) => {
|
|
16073
16082
|
if (e === 0 && t === "_") return {
|
|
16074
16083
|
type: "th",
|
|
16075
16084
|
text: "",
|
|
@@ -16086,7 +16095,7 @@ var sv = (e) => new Ul({
|
|
|
16086
16095
|
attrs: { readonly: "true" }
|
|
16087
16096
|
};
|
|
16088
16097
|
if (e !== 0 && t !== "_") {
|
|
16089
|
-
let a = n[`${t}${e}`] || {}, o = r && r[t] || {}, s = i && i[e] || {}, { text: c, ...l } = a, u = s?.border, d = o?.border, f = l?.border || a.attrs?.border, p =
|
|
16098
|
+
let a = n[`${t}${e}`] || {}, o = r && r[t] || {}, s = i && i[e] || {}, { text: c, ...l } = a, u = s?.border, d = o?.border, f = l?.border || a.attrs?.border, p = V_(V_(u, d), f), { border: m, ...h } = s, { border: g, ..._ } = o, { border: v, ...y } = l, { border: b, ...x } = a.attrs || {}, S = {
|
|
16090
16099
|
...h,
|
|
16091
16100
|
..._,
|
|
16092
16101
|
...y,
|
|
@@ -16116,10 +16125,10 @@ var sv = (e) => new Ul({
|
|
|
16116
16125
|
};
|
|
16117
16126
|
}
|
|
16118
16127
|
return {};
|
|
16119
|
-
},
|
|
16128
|
+
}, gv = ({ type: e, columns: t, cells: n, rows: r }) => {
|
|
16120
16129
|
if (!n || Object.keys(n).length === 0) return null;
|
|
16121
16130
|
let { x: i, y: a } = Object.keys(n).reduce((e, t) => {
|
|
16122
|
-
let n =
|
|
16131
|
+
let n = $_.indexOf(t.slice(0, 1)), r = +t.slice(1);
|
|
16123
16132
|
return {
|
|
16124
16133
|
x: n > e.x && n || e.x,
|
|
16125
16134
|
y: r > e.y && r || e.y
|
|
@@ -16130,13 +16139,13 @@ var sv = (e) => new Ul({
|
|
|
16130
16139
|
});
|
|
16131
16140
|
switch (e) {
|
|
16132
16141
|
case "table": {
|
|
16133
|
-
let e = Array.apply(null, Array(i + 1)).map((e, t) =>
|
|
16142
|
+
let e = Array.apply(null, Array(i + 1)).map((e, t) => $_[t]);
|
|
16134
16143
|
return {
|
|
16135
|
-
doc:
|
|
16144
|
+
doc: pv({
|
|
16136
16145
|
cols: e,
|
|
16137
16146
|
rows: Array.apply(null, Array(a + 1)).map((i, a) => e.reduce((e, i) => ({
|
|
16138
16147
|
...e,
|
|
16139
|
-
[i]:
|
|
16148
|
+
[i]: hv(a, i, n || {}, t, r)
|
|
16140
16149
|
}), {})),
|
|
16141
16150
|
colsAttrs: t,
|
|
16142
16151
|
rowsAttrs: r
|
|
@@ -16150,7 +16159,7 @@ var sv = (e) => new Ul({
|
|
|
16150
16159
|
}
|
|
16151
16160
|
default: return null;
|
|
16152
16161
|
}
|
|
16153
|
-
},
|
|
16162
|
+
}, _v = ({ state: e, onEditorViewChange: t = void 0 }) => {
|
|
16154
16163
|
let { type: n, columns: r, cells: i, rows: a } = e.data.interaction, [o, s] = E(null), [c, l] = E({
|
|
16155
16164
|
visible: !1,
|
|
16156
16165
|
x: 0,
|
|
@@ -16176,7 +16185,7 @@ var sv = (e) => new Ul({
|
|
|
16176
16185
|
visible: !1
|
|
16177
16186
|
}));
|
|
16178
16187
|
}, 4e3);
|
|
16179
|
-
} }, d =
|
|
16188
|
+
} }, d = lv(e), f = H_(e), p = [
|
|
16180
16189
|
zh(),
|
|
16181
16190
|
$h(),
|
|
16182
16191
|
Jg(),
|
|
@@ -16186,34 +16195,34 @@ var sv = (e) => new Ul({
|
|
|
16186
16195
|
}),
|
|
16187
16196
|
Im({
|
|
16188
16197
|
...Og,
|
|
16189
|
-
Tab:
|
|
16190
|
-
"Shift-Tab":
|
|
16191
|
-
Enter:
|
|
16198
|
+
Tab: K_(1),
|
|
16199
|
+
"Shift-Tab": K_(-1),
|
|
16200
|
+
Enter: K_(1)
|
|
16192
16201
|
}),
|
|
16193
16202
|
f,
|
|
16194
|
-
|
|
16195
|
-
|
|
16203
|
+
av(e),
|
|
16204
|
+
cv(u),
|
|
16196
16205
|
d
|
|
16197
16206
|
], m = T(null);
|
|
16198
16207
|
return S(() => {
|
|
16199
16208
|
if (!m.current) return;
|
|
16200
16209
|
let e;
|
|
16201
16210
|
if (i && Object.keys(i).length > 0) {
|
|
16202
|
-
let t =
|
|
16211
|
+
let t = gv({
|
|
16203
16212
|
type: n,
|
|
16204
16213
|
columns: r,
|
|
16205
16214
|
cells: i,
|
|
16206
16215
|
rows: a
|
|
16207
16216
|
});
|
|
16208
16217
|
e = t ? Vl.fromJSON({
|
|
16209
|
-
schema:
|
|
16218
|
+
schema: X_,
|
|
16210
16219
|
plugins: p
|
|
16211
16220
|
}, t) : Vl.create({
|
|
16212
|
-
schema:
|
|
16221
|
+
schema: X_,
|
|
16213
16222
|
plugins: p
|
|
16214
16223
|
});
|
|
16215
16224
|
} else e = Vl.create({
|
|
16216
|
-
schema:
|
|
16225
|
+
schema: X_,
|
|
16217
16226
|
plugins: p
|
|
16218
16227
|
});
|
|
16219
16228
|
let o = dh(e);
|
|
@@ -16230,7 +16239,7 @@ var sv = (e) => new Ul({
|
|
|
16230
16239
|
};
|
|
16231
16240
|
}, []), S(() => {
|
|
16232
16241
|
if (o && i) {
|
|
16233
|
-
let e =
|
|
16242
|
+
let e = gv({
|
|
16234
16243
|
type: n,
|
|
16235
16244
|
columns: r,
|
|
16236
16245
|
cells: i,
|
|
@@ -16238,18 +16247,18 @@ var sv = (e) => new Ul({
|
|
|
16238
16247
|
});
|
|
16239
16248
|
if (!e) {
|
|
16240
16249
|
let e = Vl.create({
|
|
16241
|
-
schema:
|
|
16250
|
+
schema: X_,
|
|
16242
16251
|
plugins: p
|
|
16243
16252
|
});
|
|
16244
16253
|
o.updateState(e);
|
|
16245
16254
|
return;
|
|
16246
16255
|
}
|
|
16247
16256
|
let t = Vl.fromJSON({
|
|
16248
|
-
schema:
|
|
16257
|
+
schema: X_,
|
|
16249
16258
|
plugins: p
|
|
16250
16259
|
}, e);
|
|
16251
16260
|
o.updateState(t);
|
|
16252
|
-
let { pos: s } =
|
|
16261
|
+
let { pos: s } = tv({
|
|
16253
16262
|
state: t,
|
|
16254
16263
|
name: "A1"
|
|
16255
16264
|
});
|
|
@@ -16269,7 +16278,7 @@ var sv = (e) => new Ul({
|
|
|
16269
16278
|
x: c.x,
|
|
16270
16279
|
y: c.y
|
|
16271
16280
|
})] });
|
|
16272
|
-
},
|
|
16281
|
+
}, vv = ({ state: e }) => e.data.interaction?.type === "table" ? /* @__PURE__ */ O(_v, { state: e }) : /* @__PURE__ */ O("div", {}), yv = () => /* @__PURE__ */ k("svg", {
|
|
16273
16282
|
viewBox: "0 0 18 18",
|
|
16274
16283
|
width: "16",
|
|
16275
16284
|
height: "16",
|
|
@@ -16298,7 +16307,7 @@ var sv = (e) => new Ul({
|
|
|
16298
16307
|
fill: "currentColor"
|
|
16299
16308
|
})
|
|
16300
16309
|
]
|
|
16301
|
-
}),
|
|
16310
|
+
}), bv = ({ sheets: e, activeId: t, onSelect: n, showMenu: r, showTabs: i }) => {
|
|
16302
16311
|
let [a, o] = E(!1), s = T(null), c = T(null), [l, u] = E(null), d = () => {
|
|
16303
16312
|
let e = c.current?.getBoundingClientRect();
|
|
16304
16313
|
if (!e) return;
|
|
@@ -16340,7 +16349,7 @@ var sv = (e) => new Ul({
|
|
|
16340
16349
|
onClick: () => {
|
|
16341
16350
|
a || d(), o((e) => !e);
|
|
16342
16351
|
},
|
|
16343
|
-
children: /* @__PURE__ */ O(
|
|
16352
|
+
children: /* @__PURE__ */ O(yv, {})
|
|
16344
16353
|
}), a && /* @__PURE__ */ O("ul", {
|
|
16345
16354
|
className: "gc-sheet-menu-list",
|
|
16346
16355
|
role: "menu",
|
|
@@ -16381,19 +16390,19 @@ var sv = (e) => new Ul({
|
|
|
16381
16390
|
};
|
|
16382
16391
|
//#endregion
|
|
16383
16392
|
//#region src/components/form/Form.tsx
|
|
16384
|
-
function
|
|
16393
|
+
function xv(...e) {
|
|
16385
16394
|
return e.filter(Boolean).join(" ");
|
|
16386
16395
|
}
|
|
16387
|
-
function
|
|
16396
|
+
function Sv(e, t) {
|
|
16388
16397
|
return /* @__PURE__ */ O("div", {
|
|
16389
16398
|
className: "flex flex-col gap-2",
|
|
16390
16399
|
children: e.map((e, n) => /* @__PURE__ */ O("div", {
|
|
16391
|
-
className:
|
|
16400
|
+
className: xv("rounded-md p-3 border text-sm", t === "dark" ? "bg-red-900/50 border-red-700 text-red-200" : "bg-red-50 border-red-200 text-red-800"),
|
|
16392
16401
|
children: e.message
|
|
16393
16402
|
}, n))
|
|
16394
16403
|
});
|
|
16395
16404
|
}
|
|
16396
|
-
function
|
|
16405
|
+
function Cv(e) {
|
|
16397
16406
|
return Array.isArray(e?.sheets) && e.sheets.length ? e.sheets.map((t) => {
|
|
16398
16407
|
let n = f(e.cells, t.id);
|
|
16399
16408
|
if (!Object.keys(n).length) return t;
|
|
@@ -16415,14 +16424,14 @@ function Sv(e) {
|
|
|
16415
16424
|
...e?.hideMenu === void 0 ? {} : { hideMenu: e.hideMenu }
|
|
16416
16425
|
}];
|
|
16417
16426
|
}
|
|
16418
|
-
var
|
|
16419
|
-
let t = typeof e.data == "object" && e.data !== null ? e.data.theme : void 0, n = e.data?.interaction, r = ee(() =>
|
|
16427
|
+
var wv = ({ state: e }) => {
|
|
16428
|
+
let t = typeof e.data == "object" && e.data !== null ? e.data.theme : void 0, n = e.data?.interaction, r = ee(() => Cv(n), [n]), i = r.length > 1, [a, o] = E(r[0]?.id), [s, c] = E(() => [r[0]?.id]), l = r.some((e) => e.id === a) ? a : r[0]?.id, u = (e) => {
|
|
16420
16429
|
o(e), c((t) => t.includes(e) ? t : [...t, e]);
|
|
16421
16430
|
};
|
|
16422
|
-
if (Array.isArray(e.errors) && e.errors.length > 0) return
|
|
16431
|
+
if (Array.isArray(e.errors) && e.errors.length > 0) return Sv(e.errors, t);
|
|
16423
16432
|
let d = n?.hideSheetMenu !== !0, f = n?.showSheetTabs === void 0 ? i : n.showSheetTabs === !0;
|
|
16424
16433
|
return /* @__PURE__ */ k("div", {
|
|
16425
|
-
className:
|
|
16434
|
+
className: xv("rounded-md font-mono flex flex-col gap-4 p-4"),
|
|
16426
16435
|
children: [(e.data?.title || e.data?.instructions) && /* @__PURE__ */ k("div", {
|
|
16427
16436
|
className: "instruction-panel mb-4 p-4 border border-gray-200 rounded-none font-sans",
|
|
16428
16437
|
style: { fontFamily: "Arial, sans-serif" },
|
|
@@ -16453,8 +16462,8 @@ var Cv = ({ state: e }) => {
|
|
|
16453
16462
|
className: "gc-sheet-area",
|
|
16454
16463
|
children: [r.map((t) => s.includes(t.id) || t.id === l ? /* @__PURE__ */ O("div", {
|
|
16455
16464
|
style: t.id === l ? void 0 : { display: "none" },
|
|
16456
|
-
children: /* @__PURE__ */ O(
|
|
16457
|
-
}, t.id) : null), /* @__PURE__ */ O(
|
|
16465
|
+
children: /* @__PURE__ */ O(vv, { state: Tv(e, t, i) })
|
|
16466
|
+
}, t.id) : null), /* @__PURE__ */ O(bv, {
|
|
16458
16467
|
sheets: r.map((e) => ({
|
|
16459
16468
|
id: e.id,
|
|
16460
16469
|
name: e.name || e.id
|
|
@@ -16467,7 +16476,7 @@ var Cv = ({ state: e }) => {
|
|
|
16467
16476
|
})]
|
|
16468
16477
|
});
|
|
16469
16478
|
};
|
|
16470
|
-
function
|
|
16479
|
+
function Tv(e, t, n) {
|
|
16471
16480
|
return {
|
|
16472
16481
|
...e,
|
|
16473
16482
|
data: {
|
|
@@ -16497,21 +16506,21 @@ function wv(e, t, n) {
|
|
|
16497
16506
|
}
|
|
16498
16507
|
//#endregion
|
|
16499
16508
|
//#region src/components/form/reduce.ts
|
|
16500
|
-
var
|
|
16509
|
+
var Ev = (e, t) => ({
|
|
16501
16510
|
...e,
|
|
16502
16511
|
text: t?.text,
|
|
16503
16512
|
formattedValue: t?.formattedValue
|
|
16504
|
-
}),
|
|
16513
|
+
}), Dv = (e, t) => {
|
|
16505
16514
|
let n = { ...e || {} };
|
|
16506
|
-
for (let e of Object.keys(t)) n[e] =
|
|
16515
|
+
for (let e of Object.keys(t)) n[e] = Ev(n[e], t[e]);
|
|
16507
16516
|
return n;
|
|
16508
|
-
},
|
|
16517
|
+
}, Ov = (e, { type: t, args: n }) => {
|
|
16509
16518
|
if (t !== "update" || !n?.cells || !e?.interaction) return;
|
|
16510
16519
|
let { sheetId: r } = n;
|
|
16511
16520
|
if (r && Array.isArray(e.interaction.sheets)) {
|
|
16512
16521
|
let t = e.interaction.sheets.map((e) => e.id === r ? {
|
|
16513
16522
|
...e,
|
|
16514
|
-
cells:
|
|
16523
|
+
cells: Dv(e.cells, n.cells)
|
|
16515
16524
|
} : e);
|
|
16516
16525
|
return {
|
|
16517
16526
|
...e,
|
|
@@ -16526,13 +16535,13 @@ var Tv = (e, t) => ({
|
|
|
16526
16535
|
...e,
|
|
16527
16536
|
interaction: {
|
|
16528
16537
|
...e.interaction,
|
|
16529
|
-
cells:
|
|
16538
|
+
cells: Dv(e.interaction.cells, n.cells)
|
|
16530
16539
|
}
|
|
16531
16540
|
};
|
|
16532
|
-
},
|
|
16533
|
-
function
|
|
16534
|
-
if (
|
|
16535
|
-
|
|
16541
|
+
}, kv = { exports: {} }, Av = {}, jv;
|
|
16542
|
+
function Mv() {
|
|
16543
|
+
if (jv) return Av;
|
|
16544
|
+
jv = 1;
|
|
16536
16545
|
var e = _;
|
|
16537
16546
|
function t(e, t) {
|
|
16538
16547
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
@@ -16569,11 +16578,11 @@ function jv() {
|
|
|
16569
16578
|
return t();
|
|
16570
16579
|
}
|
|
16571
16580
|
var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? l : s;
|
|
16572
|
-
return
|
|
16581
|
+
return Av.useSyncExternalStore = e.useSyncExternalStore === void 0 ? u : e.useSyncExternalStore, Av;
|
|
16573
16582
|
}
|
|
16574
|
-
var
|
|
16575
|
-
function
|
|
16576
|
-
return
|
|
16583
|
+
var Nv = {}, Pv;
|
|
16584
|
+
function Fv() {
|
|
16585
|
+
return Pv || (Pv = 1, process.env.NODE_ENV !== "production" && function() {
|
|
16577
16586
|
function e(e, t) {
|
|
16578
16587
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
16579
16588
|
}
|
|
@@ -16616,120 +16625,120 @@ function Pv() {
|
|
|
16616
16625
|
}
|
|
16617
16626
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
16618
16627
|
var i = _, a = typeof Object.is == "function" ? Object.is : e, o = i.useState, s = i.useEffect, c = i.useLayoutEffect, l = i.useDebugValue, u = !1, d = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : t;
|
|
16619
|
-
|
|
16620
|
-
}()),
|
|
16628
|
+
Nv.useSyncExternalStore = i.useSyncExternalStore === void 0 ? f : i.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
16629
|
+
}()), Nv;
|
|
16621
16630
|
}
|
|
16622
|
-
|
|
16623
|
-
var
|
|
16624
|
-
function
|
|
16631
|
+
kv.exports = process.env.NODE_ENV === "production" ? Mv() : Fv();
|
|
16632
|
+
var Iv = kv.exports, Lv = 0, Rv = 1, zv = 2, Bv = 3, Vv = Object.prototype.hasOwnProperty;
|
|
16633
|
+
function Hv(e, t) {
|
|
16625
16634
|
var n, r;
|
|
16626
16635
|
if (e === t) return !0;
|
|
16627
16636
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
16628
16637
|
if (n === Date) return e.getTime() === t.getTime();
|
|
16629
16638
|
if (n === RegExp) return e.toString() === t.toString();
|
|
16630
16639
|
if (n === Array) {
|
|
16631
|
-
if ((r = e.length) === t.length) for (; r-- &&
|
|
16640
|
+
if ((r = e.length) === t.length) for (; r-- && Hv(e[r], t[r]););
|
|
16632
16641
|
return r === -1;
|
|
16633
16642
|
}
|
|
16634
16643
|
if (!n || typeof e == "object") {
|
|
16635
|
-
for (n in r = 0, e) if (
|
|
16644
|
+
for (n in r = 0, e) if (Vv.call(e, n) && ++r && !Vv.call(t, n) || !(n in t) || !Hv(e[n], t[n])) return !1;
|
|
16636
16645
|
return Object.keys(t).length === r;
|
|
16637
16646
|
}
|
|
16638
16647
|
}
|
|
16639
16648
|
return e !== e && t !== t;
|
|
16640
16649
|
}
|
|
16641
|
-
var
|
|
16650
|
+
var Uv = /* @__PURE__ */ new WeakMap(), Wv = () => {}, Gv = void 0, Kv = Object, $ = (e) => e === Gv, qv = (e) => typeof e == "function", Jv = (e, t) => ({
|
|
16642
16651
|
...e,
|
|
16643
16652
|
...t
|
|
16644
|
-
}),
|
|
16645
|
-
let n =
|
|
16653
|
+
}), Yv = (e) => qv(e.then), Xv = {}, Zv = {}, Qv = "undefined", $v = typeof window != Qv, ey = typeof document != Qv, ty = $v && "Deno" in window, ny = () => $v && typeof window.requestAnimationFrame != Qv, ry = (e, t) => {
|
|
16654
|
+
let n = Uv.get(e);
|
|
16646
16655
|
return [
|
|
16647
|
-
() => !$(t) && e.get(t) ||
|
|
16656
|
+
() => !$(t) && e.get(t) || Xv,
|
|
16648
16657
|
(r) => {
|
|
16649
16658
|
if (!$(t)) {
|
|
16650
16659
|
let i = e.get(t);
|
|
16651
|
-
t in
|
|
16660
|
+
t in Zv || (Zv[t] = i), n[5](t, Jv(i, r), i || Xv);
|
|
16652
16661
|
}
|
|
16653
16662
|
},
|
|
16654
16663
|
n[6],
|
|
16655
|
-
() => !$(t) && t in
|
|
16664
|
+
() => !$(t) && t in Zv ? Zv[t] : !$(t) && e.get(t) || Xv
|
|
16656
16665
|
];
|
|
16657
|
-
},
|
|
16658
|
-
let e =
|
|
16666
|
+
}, iy = !0, ay = () => iy, [oy, sy] = $v && window.addEventListener ? [window.addEventListener.bind(window), window.removeEventListener.bind(window)] : [Wv, Wv], cy = () => {
|
|
16667
|
+
let e = ey && document.visibilityState;
|
|
16659
16668
|
return $(e) || e !== "hidden";
|
|
16660
|
-
},
|
|
16661
|
-
|
|
16662
|
-
}),
|
|
16669
|
+
}, ly = (e) => (ey && document.addEventListener("visibilitychange", e), oy("focus", e), () => {
|
|
16670
|
+
ey && document.removeEventListener("visibilitychange", e), sy("focus", e);
|
|
16671
|
+
}), uy = (e) => {
|
|
16663
16672
|
let t = () => {
|
|
16664
|
-
|
|
16673
|
+
iy = !0, e();
|
|
16665
16674
|
}, n = () => {
|
|
16666
|
-
|
|
16675
|
+
iy = !1;
|
|
16667
16676
|
};
|
|
16668
|
-
return
|
|
16669
|
-
|
|
16677
|
+
return oy("online", t), oy("offline", n), () => {
|
|
16678
|
+
sy("online", t), sy("offline", n);
|
|
16670
16679
|
};
|
|
16671
|
-
}, uy = {
|
|
16672
|
-
isOnline: iy,
|
|
16673
|
-
isVisible: sy
|
|
16674
16680
|
}, dy = {
|
|
16675
|
-
|
|
16676
|
-
|
|
16677
|
-
}, fy =
|
|
16678
|
-
|
|
16679
|
-
|
|
16680
|
-
|
|
16681
|
-
|
|
16682
|
-
|
|
16683
|
-
|
|
16681
|
+
isOnline: ay,
|
|
16682
|
+
isVisible: cy
|
|
16683
|
+
}, fy = {
|
|
16684
|
+
initFocus: ly,
|
|
16685
|
+
initReconnect: uy
|
|
16686
|
+
}, py = !_.useId, my = !$v || ty, hy = (e) => ny() ? window.requestAnimationFrame(e) : setTimeout(e, 1), gy = my ? S : C, _y = typeof navigator < "u" && navigator.connection, vy = !my && _y && (["slow-2g", "2g"].includes(_y.effectiveType) || _y.saveData), yy = /* @__PURE__ */ new WeakMap(), by = (e) => Kv.prototype.toString.call(e), xy = (e, t) => e === `[object ${t}]`, Sy = 0, Cy = (e) => {
|
|
16687
|
+
let t = typeof e, n = by(e), r = xy(n, "Date"), i = xy(n, "RegExp"), a = xy(n, "Object"), o, s;
|
|
16688
|
+
if (Kv(e) === e && !r && !i) {
|
|
16689
|
+
if (o = yy.get(e), o) return o;
|
|
16690
|
+
if (o = ++Sy + "~", yy.set(e, o), Array.isArray(e)) {
|
|
16691
|
+
for (o = "@", s = 0; s < e.length; s++) o += Cy(e[s]) + ",";
|
|
16692
|
+
yy.set(e, o);
|
|
16684
16693
|
}
|
|
16685
16694
|
if (a) {
|
|
16686
16695
|
o = "#";
|
|
16687
|
-
let t =
|
|
16688
|
-
for (; !$(s = t.pop());) $(e[s]) || (o += s + ":" +
|
|
16689
|
-
|
|
16696
|
+
let t = Kv.keys(e).sort();
|
|
16697
|
+
for (; !$(s = t.pop());) $(e[s]) || (o += s + ":" + Cy(e[s]) + ",");
|
|
16698
|
+
yy.set(e, o);
|
|
16690
16699
|
}
|
|
16691
16700
|
} else o = r ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
|
|
16692
16701
|
return o;
|
|
16693
|
-
},
|
|
16694
|
-
if (
|
|
16702
|
+
}, wy = (e) => {
|
|
16703
|
+
if (qv(e)) try {
|
|
16695
16704
|
e = e();
|
|
16696
16705
|
} catch {
|
|
16697
16706
|
e = "";
|
|
16698
16707
|
}
|
|
16699
16708
|
let t = e;
|
|
16700
|
-
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ?
|
|
16701
|
-
},
|
|
16702
|
-
async function
|
|
16703
|
-
let [t, n, r, i] = e, a =
|
|
16709
|
+
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? Cy(e) : "", [e, t];
|
|
16710
|
+
}, Ty = 0, Ey = () => ++Ty;
|
|
16711
|
+
async function Dy(...e) {
|
|
16712
|
+
let [t, n, r, i] = e, a = Jv({
|
|
16704
16713
|
populateCache: !0,
|
|
16705
16714
|
throwOnError: !0
|
|
16706
16715
|
}, typeof i == "boolean" ? { revalidate: i } : i || {}), o = a.populateCache, s = a.rollbackOnError, c = a.optimisticData, l = (e) => typeof s == "function" ? s(e) : s !== !1, u = a.throwOnError;
|
|
16707
|
-
if (
|
|
16716
|
+
if (qv(n)) {
|
|
16708
16717
|
let e = n, r = [], i = t.keys();
|
|
16709
16718
|
for (let n of i) !/^\$(inf|sub)\$/.test(n) && e(t.get(n)._k) && r.push(n);
|
|
16710
16719
|
return Promise.all(r.map(d));
|
|
16711
16720
|
}
|
|
16712
16721
|
return d(n);
|
|
16713
16722
|
async function d(n) {
|
|
16714
|
-
let [i] =
|
|
16723
|
+
let [i] = wy(n);
|
|
16715
16724
|
if (!i) return;
|
|
16716
|
-
let [s, d] =
|
|
16725
|
+
let [s, d] = ry(t, i), [f, p, m, h] = Uv.get(t), g = () => {
|
|
16717
16726
|
let e = f[i];
|
|
16718
|
-
return (
|
|
16727
|
+
return (qv(a.revalidate) ? a.revalidate(s().data, n) : a.revalidate !== !1) && (delete m[i], delete h[i], e && e[0]) ? e[0](zv).then(() => s().data) : s().data;
|
|
16719
16728
|
};
|
|
16720
16729
|
if (e.length < 3) return g();
|
|
16721
|
-
let _ = r, v, y = !1, b =
|
|
16730
|
+
let _ = r, v, y = !1, b = Ey();
|
|
16722
16731
|
p[i] = [b, 0];
|
|
16723
16732
|
let x = !$(c), S = s(), C = S.data, ee = S._c, w = $(ee) ? C : ee;
|
|
16724
|
-
if (x && (c =
|
|
16733
|
+
if (x && (c = qv(c) ? c(w, C) : c, d({
|
|
16725
16734
|
data: c,
|
|
16726
16735
|
_c: w
|
|
16727
|
-
})),
|
|
16736
|
+
})), qv(_)) try {
|
|
16728
16737
|
_ = _(w);
|
|
16729
16738
|
} catch (e) {
|
|
16730
16739
|
v = e, y = !0;
|
|
16731
16740
|
}
|
|
16732
|
-
if (_ &&
|
|
16741
|
+
if (_ && Yv(_)) {
|
|
16733
16742
|
if (_ = await _.catch((e) => {
|
|
16734
16743
|
v = e, y = !0;
|
|
16735
16744
|
}), b !== p[i][0]) {
|
|
@@ -16738,19 +16747,19 @@ async function Ey(...e) {
|
|
|
16738
16747
|
}
|
|
16739
16748
|
y && x && l(v) && (o = !0, d({
|
|
16740
16749
|
data: w,
|
|
16741
|
-
_c:
|
|
16750
|
+
_c: Gv
|
|
16742
16751
|
}));
|
|
16743
16752
|
}
|
|
16744
|
-
if (o && !y && (
|
|
16753
|
+
if (o && !y && (qv(o) ? d({
|
|
16745
16754
|
data: o(_, w),
|
|
16746
|
-
error:
|
|
16747
|
-
_c:
|
|
16755
|
+
error: Gv,
|
|
16756
|
+
_c: Gv
|
|
16748
16757
|
}) : d({
|
|
16749
16758
|
data: _,
|
|
16750
|
-
error:
|
|
16751
|
-
_c:
|
|
16752
|
-
})), p[i][1] =
|
|
16753
|
-
d({ _c:
|
|
16759
|
+
error: Gv,
|
|
16760
|
+
_c: Gv
|
|
16761
|
+
})), p[i][1] = Ey(), Promise.resolve(g()).then(() => {
|
|
16762
|
+
d({ _c: Gv });
|
|
16754
16763
|
}), y) {
|
|
16755
16764
|
if (u) throw v;
|
|
16756
16765
|
return;
|
|
@@ -16758,11 +16767,11 @@ async function Ey(...e) {
|
|
|
16758
16767
|
return _;
|
|
16759
16768
|
}
|
|
16760
16769
|
}
|
|
16761
|
-
var
|
|
16770
|
+
var Oy = (e, t) => {
|
|
16762
16771
|
for (let n in e) e[n][0] && e[n][0](t);
|
|
16763
|
-
},
|
|
16764
|
-
if (!
|
|
16765
|
-
let n =
|
|
16772
|
+
}, ky = (e, t) => {
|
|
16773
|
+
if (!Uv.has(e)) {
|
|
16774
|
+
let n = Jv(fy, t), r = /* @__PURE__ */ Object.create(null), i = Dy.bind(Gv, e), a = Wv, o = /* @__PURE__ */ Object.create(null), s = (e, t) => {
|
|
16766
16775
|
let n = o[e] || [];
|
|
16767
16776
|
return o[e] = n, n.push(t), () => n.splice(n.indexOf(t), 1);
|
|
16768
16777
|
}, c = (t, n, r) => {
|
|
@@ -16770,7 +16779,7 @@ var Dy = (e, t) => {
|
|
|
16770
16779
|
let i = o[t];
|
|
16771
16780
|
if (i) for (let e of i) e(n, r);
|
|
16772
16781
|
}, l = () => {
|
|
16773
|
-
if (!
|
|
16782
|
+
if (!Uv.has(e) && (Uv.set(e, [
|
|
16774
16783
|
r,
|
|
16775
16784
|
/* @__PURE__ */ Object.create(null),
|
|
16776
16785
|
/* @__PURE__ */ Object.create(null),
|
|
@@ -16778,10 +16787,10 @@ var Dy = (e, t) => {
|
|
|
16778
16787
|
i,
|
|
16779
16788
|
c,
|
|
16780
16789
|
s
|
|
16781
|
-
]), !
|
|
16782
|
-
let t = n.initFocus(setTimeout.bind(
|
|
16790
|
+
]), !my)) {
|
|
16791
|
+
let t = n.initFocus(setTimeout.bind(Gv, Oy.bind(Gv, r, Lv))), i = n.initReconnect(setTimeout.bind(Gv, Oy.bind(Gv, r, Rv)));
|
|
16783
16792
|
a = () => {
|
|
16784
|
-
t && t(), i && i(),
|
|
16793
|
+
t && t(), i && i(), Uv.delete(e);
|
|
16785
16794
|
};
|
|
16786
16795
|
}
|
|
16787
16796
|
};
|
|
@@ -16792,39 +16801,39 @@ var Dy = (e, t) => {
|
|
|
16792
16801
|
a
|
|
16793
16802
|
];
|
|
16794
16803
|
}
|
|
16795
|
-
return [e,
|
|
16796
|
-
},
|
|
16804
|
+
return [e, Uv.get(e)[4]];
|
|
16805
|
+
}, Ay = (e, t, n, r, i) => {
|
|
16797
16806
|
let a = n.errorRetryCount, o = i.retryCount, s = ~~((Math.random() + .5) * (1 << (o < 8 ? o : 8))) * n.errorRetryInterval;
|
|
16798
16807
|
!$(a) && o > a || setTimeout(r, s, i);
|
|
16799
|
-
},
|
|
16800
|
-
onLoadingSlow:
|
|
16801
|
-
onSuccess:
|
|
16802
|
-
onError:
|
|
16803
|
-
onErrorRetry:
|
|
16804
|
-
onDiscarded:
|
|
16808
|
+
}, jy = Hv, [My, Ny] = ky(/* @__PURE__ */ new Map()), Py = Jv({
|
|
16809
|
+
onLoadingSlow: Wv,
|
|
16810
|
+
onSuccess: Wv,
|
|
16811
|
+
onError: Wv,
|
|
16812
|
+
onErrorRetry: Ay,
|
|
16813
|
+
onDiscarded: Wv,
|
|
16805
16814
|
revalidateOnFocus: !0,
|
|
16806
16815
|
revalidateOnReconnect: !0,
|
|
16807
16816
|
revalidateIfStale: !0,
|
|
16808
16817
|
shouldRetryOnError: !0,
|
|
16809
|
-
errorRetryInterval:
|
|
16818
|
+
errorRetryInterval: vy ? 1e4 : 5e3,
|
|
16810
16819
|
focusThrottleInterval: 5e3,
|
|
16811
16820
|
dedupingInterval: 2e3,
|
|
16812
|
-
loadingTimeout:
|
|
16813
|
-
compare:
|
|
16821
|
+
loadingTimeout: vy ? 5e3 : 3e3,
|
|
16822
|
+
compare: jy,
|
|
16814
16823
|
isPaused: () => !1,
|
|
16815
|
-
cache:
|
|
16816
|
-
mutate:
|
|
16824
|
+
cache: My,
|
|
16825
|
+
mutate: Ny,
|
|
16817
16826
|
fallback: {}
|
|
16818
|
-
},
|
|
16819
|
-
let n =
|
|
16827
|
+
}, dy), Fy = (e, t) => {
|
|
16828
|
+
let n = Jv(e, t);
|
|
16820
16829
|
if (t) {
|
|
16821
16830
|
let { use: r, fallback: i } = e, { use: a, fallback: o } = t;
|
|
16822
|
-
r && a && (n.use = r.concat(a)), i && o && (n.fallback =
|
|
16831
|
+
r && a && (n.use = r.concat(a)), i && o && (n.fallback = Jv(i, o));
|
|
16823
16832
|
}
|
|
16824
16833
|
return n;
|
|
16825
|
-
},
|
|
16826
|
-
|
|
16827
|
-
},
|
|
16834
|
+
}, Iy = v({}), Ly = "$inf$", Ry = $v && window.__SWR_DEVTOOLS_USE__, zy = Ry ? window.__SWR_DEVTOOLS_USE__ : [], By = () => {
|
|
16835
|
+
Ry && (window.__SWR_DEVTOOLS_REACT__ = _);
|
|
16836
|
+
}, Vy = (e) => qv(e[1]) ? [
|
|
16828
16837
|
e[0],
|
|
16829
16838
|
e[1],
|
|
16830
16839
|
e[2] || {}
|
|
@@ -16832,27 +16841,27 @@ var Dy = (e, t) => {
|
|
|
16832
16841
|
e[0],
|
|
16833
16842
|
null,
|
|
16834
16843
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
16835
|
-
],
|
|
16836
|
-
let e = b(
|
|
16837
|
-
return ee(() =>
|
|
16838
|
-
},
|
|
16839
|
-
let [r] =
|
|
16840
|
-
if (r.startsWith(
|
|
16844
|
+
], Hy = () => {
|
|
16845
|
+
let e = b(Iy);
|
|
16846
|
+
return ee(() => Jv(Py, e), [e]);
|
|
16847
|
+
}, Uy = zy.concat((e) => (t, n, r) => e(t, n && ((...e) => {
|
|
16848
|
+
let [r] = wy(t), [, , , i] = Uv.get(My);
|
|
16849
|
+
if (r.startsWith(Ly)) return n(...e);
|
|
16841
16850
|
let a = i[r];
|
|
16842
16851
|
return $(a) ? n(...e) : (delete i[r], a);
|
|
16843
|
-
}), r)),
|
|
16844
|
-
let n =
|
|
16852
|
+
}), r)), Wy = (e) => function(...t) {
|
|
16853
|
+
let n = Hy(), [r, i, a] = Vy(t), o = Fy(n, a), s = e, { use: c } = o, l = (c || []).concat(Uy);
|
|
16845
16854
|
for (let e = l.length; e--;) s = l[e](s);
|
|
16846
16855
|
return s(r, i || o.fetcher || null, o);
|
|
16847
|
-
},
|
|
16856
|
+
}, Gy = (e, t, n) => {
|
|
16848
16857
|
let r = t[e] || (t[e] = []);
|
|
16849
16858
|
return r.push(n), () => {
|
|
16850
16859
|
let e = r.indexOf(n);
|
|
16851
16860
|
e >= 0 && (r[e] = r[r.length - 1], r.pop());
|
|
16852
16861
|
};
|
|
16853
16862
|
};
|
|
16854
|
-
|
|
16855
|
-
var
|
|
16863
|
+
By();
|
|
16864
|
+
var Ky = _.use || ((e) => {
|
|
16856
16865
|
switch (e.status) {
|
|
16857
16866
|
case "pending": throw e;
|
|
16858
16867
|
case "fulfilled": return e.value;
|
|
@@ -16863,8 +16872,8 @@ var Gy = _.use || ((e) => {
|
|
|
16863
16872
|
e.status = "rejected", e.reason = t;
|
|
16864
16873
|
}), e;
|
|
16865
16874
|
}
|
|
16866
|
-
}),
|
|
16867
|
-
let { cache: r, compare: i, suspense: a, fallbackData: o, revalidateOnMount: s, revalidateIfStale: c, refreshInterval: l, refreshWhenHidden: u, refreshWhenOffline: d, keepPreviousData: f, strictServerPrefetchWarning: p } = n, [m, h, g, _] =
|
|
16875
|
+
}), qy = { dedupe: !0 }, Jy = Promise.resolve(Gv), Yy = () => Wv, Xy = Wy((e, t, n) => {
|
|
16876
|
+
let { cache: r, compare: i, suspense: a, fallbackData: o, revalidateOnMount: s, revalidateIfStale: c, refreshInterval: l, refreshWhenHidden: u, refreshWhenOffline: d, keepPreviousData: f, strictServerPrefetchWarning: p } = n, [m, h, g, _] = Uv.get(r), [v, b] = wy(e), S = T(!1), C = T(!1), w = T(v), E = T(t), D = T(n), O = () => D.current, k = () => O().isVisible() && O().isOnline(), [te, ne, A, re] = ry(r, v), ie = T({}).current, ae = $(o) ? $(n.fallback) ? Gv : n.fallback[v] : o, oe = (e, t) => {
|
|
16868
16877
|
for (let n in ie) {
|
|
16869
16878
|
let r = n;
|
|
16870
16879
|
if (r === "data") {
|
|
@@ -16874,7 +16883,7 @@ var Gy = _.use || ((e) => {
|
|
|
16874
16883
|
return !0;
|
|
16875
16884
|
}, se = !S.current, ce = ee(() => {
|
|
16876
16885
|
let e = te(), n = re(), r = (e) => {
|
|
16877
|
-
let n =
|
|
16886
|
+
let n = Jv(e);
|
|
16878
16887
|
return delete n._k, v && t && !O().isPaused() && (se && !$(s) ? s : $($(ae) ? n.data : ae) || c) ? {
|
|
16879
16888
|
isValidating: !0,
|
|
16880
16889
|
isLoading: !0,
|
|
@@ -16885,16 +16894,16 @@ var Gy = _.use || ((e) => {
|
|
|
16885
16894
|
let e = r(te());
|
|
16886
16895
|
return oe(e, o) ? (o.data = e.data, o.isLoading = e.isLoading, o.isValidating = e.isValidating, o.error = e.error, o) : (o = e, e);
|
|
16887
16896
|
}, () => a];
|
|
16888
|
-
}, [r, v]), le =
|
|
16897
|
+
}, [r, v]), le = Iv.useSyncExternalStore(y((e) => A(v, (t, n) => {
|
|
16889
16898
|
oe(n, t) || e();
|
|
16890
|
-
}), [r, v]), ce[0], ce[1]), ue = m[v] && m[v].length > 0, de = le.data, fe = $(de) ? ae &&
|
|
16891
|
-
!
|
|
16899
|
+
}), [r, v]), ce[0], ce[1]), ue = m[v] && m[v].length > 0, de = le.data, fe = $(de) ? ae && Yv(ae) ? Ky(ae) : ae : de, pe = le.error, me = T(fe), he = f ? $(de) ? $(me.current) ? fe : me.current : de : fe, ge = v && $(fe), _e = T(null);
|
|
16900
|
+
!my && Iv.useSyncExternalStore(Yy, () => (_e.current = !1, _e), () => (_e.current = !0, _e));
|
|
16892
16901
|
let ve = _e.current;
|
|
16893
16902
|
p && ve && !a && ge && console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
|
|
16894
16903
|
let ye = !v || !t || O().isPaused() || ue && !$(pe) ? !1 : se && !$(s) ? s : a ? !$(fe) && c : $(fe) || c, be = se && ye, xe = $(le.isValidating) ? be : le.isValidating, j = $(le.isLoading) ? be : le.isLoading, Se = y(async (e) => {
|
|
16895
16904
|
let t = E.current;
|
|
16896
16905
|
if (!v || !t || C.current || O().isPaused()) return !1;
|
|
16897
|
-
let r, a, o = !0, s = e || {}, c = !g[v] || !s.dedupe, l = () =>
|
|
16906
|
+
let r, a, o = !0, s = e || {}, c = !g[v] || !s.dedupe, l = () => py ? !C.current && v === w.current && S.current : v === w.current, u = {
|
|
16898
16907
|
isValidating: !1,
|
|
16899
16908
|
isLoading: !1
|
|
16900
16909
|
}, d = () => {
|
|
@@ -16907,8 +16916,8 @@ var Gy = _.use || ((e) => {
|
|
|
16907
16916
|
try {
|
|
16908
16917
|
if (c && (ne(p), n.loadingTimeout && $(te().data) && setTimeout(() => {
|
|
16909
16918
|
o && l() && O().onLoadingSlow(v, n);
|
|
16910
|
-
}, n.loadingTimeout), g[v] = [t(b),
|
|
16911
|
-
u.error =
|
|
16919
|
+
}, n.loadingTimeout), g[v] = [t(b), Ey()]), [r, a] = g[v], r = await r, c && setTimeout(f, n.dedupingInterval), !g[v] || g[v][1] !== a) return c && l() && O().onDiscarded(v), !1;
|
|
16920
|
+
u.error = Gv;
|
|
16912
16921
|
let e = h[v];
|
|
16913
16922
|
if (!$(e) && (a <= e[0] || a <= e[1] || e[1] === 0)) return d(), c && l() && O().onDiscarded(v), !1;
|
|
16914
16923
|
let s = te().data;
|
|
@@ -16916,43 +16925,43 @@ var Gy = _.use || ((e) => {
|
|
|
16916
16925
|
} catch (e) {
|
|
16917
16926
|
f();
|
|
16918
16927
|
let t = O(), { shouldRetryOnError: n } = t;
|
|
16919
|
-
t.isPaused() || (u.error = e, c && l() && (t.onError(e, v, t), (n === !0 ||
|
|
16928
|
+
t.isPaused() || (u.error = e, c && l() && (t.onError(e, v, t), (n === !0 || qv(n) && n(e)) && (!O().revalidateOnFocus || !O().revalidateOnReconnect || k()) && t.onErrorRetry(e, v, t, (e) => {
|
|
16920
16929
|
let t = m[v];
|
|
16921
|
-
t && t[0] && t[0](
|
|
16930
|
+
t && t[0] && t[0](Bv, e);
|
|
16922
16931
|
}, {
|
|
16923
16932
|
retryCount: (s.retryCount || 0) + 1,
|
|
16924
16933
|
dedupe: !0
|
|
16925
16934
|
})));
|
|
16926
16935
|
}
|
|
16927
16936
|
return o = !1, d(), !0;
|
|
16928
|
-
}, [v, r]), Ce = y((...e) =>
|
|
16929
|
-
if (
|
|
16937
|
+
}, [v, r]), Ce = y((...e) => Dy(r, w.current, ...e), []);
|
|
16938
|
+
if (gy(() => {
|
|
16930
16939
|
E.current = t, D.current = n, $(de) || (me.current = de);
|
|
16931
|
-
}),
|
|
16940
|
+
}), gy(() => {
|
|
16932
16941
|
if (!v) return;
|
|
16933
|
-
let e = Se.bind(
|
|
16942
|
+
let e = Se.bind(Gv, qy), t = 0;
|
|
16934
16943
|
O().revalidateOnFocus && (t = Date.now() + O().focusThrottleInterval);
|
|
16935
|
-
let n =
|
|
16936
|
-
if (n ==
|
|
16944
|
+
let n = Gy(v, m, (n, r = {}) => {
|
|
16945
|
+
if (n == Lv) {
|
|
16937
16946
|
let n = Date.now();
|
|
16938
16947
|
O().revalidateOnFocus && n > t && k() && (t = n + O().focusThrottleInterval, e());
|
|
16939
|
-
} else if (n ==
|
|
16948
|
+
} else if (n == Rv) O().revalidateOnReconnect && k() && e();
|
|
16940
16949
|
else {
|
|
16941
|
-
if (n ==
|
|
16942
|
-
if (n ==
|
|
16950
|
+
if (n == zv) return Se();
|
|
16951
|
+
if (n == Bv) return Se(r);
|
|
16943
16952
|
}
|
|
16944
16953
|
});
|
|
16945
|
-
return C.current = !1, w.current = v, S.current = !0, ne({ _k: b }), ye && (g[v] || ($(fe) ||
|
|
16954
|
+
return C.current = !1, w.current = v, S.current = !0, ne({ _k: b }), ye && (g[v] || ($(fe) || my ? e() : hy(e))), () => {
|
|
16946
16955
|
C.current = !0, n();
|
|
16947
16956
|
};
|
|
16948
|
-
}, [v]),
|
|
16957
|
+
}, [v]), gy(() => {
|
|
16949
16958
|
let e;
|
|
16950
16959
|
function t() {
|
|
16951
|
-
let t =
|
|
16960
|
+
let t = qv(l) ? l(te().data) : l;
|
|
16952
16961
|
t && e !== -1 && (e = setTimeout(n, t));
|
|
16953
16962
|
}
|
|
16954
16963
|
function n() {
|
|
16955
|
-
!te().error && (u || O().isVisible()) && (d || O().isOnline()) ? Se(
|
|
16964
|
+
!te().error && (u || O().isVisible()) && (d || O().isOnline()) ? Se(qy).then(t) : t();
|
|
16956
16965
|
}
|
|
16957
16966
|
return t(), () => {
|
|
16958
16967
|
e &&= (clearTimeout(e), -1);
|
|
@@ -16963,12 +16972,12 @@ var Gy = _.use || ((e) => {
|
|
|
16963
16972
|
d,
|
|
16964
16973
|
v
|
|
16965
16974
|
]), x(he), a) {
|
|
16966
|
-
if (!
|
|
16975
|
+
if (!py && my && ge) throw Error("Fallback data is required when using Suspense in SSR.");
|
|
16967
16976
|
ge && (E.current = t, D.current = n, C.current = !1);
|
|
16968
16977
|
let e = _[v];
|
|
16969
|
-
if (
|
|
16970
|
-
let r = ge ? Se(
|
|
16971
|
-
!$(he) && ge && (r.status = "fulfilled", r.value = !0),
|
|
16978
|
+
if (Ky(!$(e) && ge ? Ce(e) : Jy), !$(pe) && ge) throw pe;
|
|
16979
|
+
let r = ge ? Se(qy) : Jy;
|
|
16980
|
+
!$(he) && ge && (r.status = "fulfilled", r.value = !0), Ky(r);
|
|
16972
16981
|
}
|
|
16973
16982
|
return {
|
|
16974
16983
|
mutate: Ce,
|
|
@@ -16986,15 +16995,15 @@ var Gy = _.use || ((e) => {
|
|
|
16986
16995
|
}
|
|
16987
16996
|
};
|
|
16988
16997
|
});
|
|
16989
|
-
function
|
|
16998
|
+
function Zy() {
|
|
16990
16999
|
return window.document.location.host.indexOf("localhost") === 0 ? "http://localhost:3100" : "https://api.graffiticode.org";
|
|
16991
17000
|
}
|
|
16992
|
-
var
|
|
16993
|
-
let { status: n, error: r, data: i } = await (await fetch(`${
|
|
17001
|
+
var Qy = async ({ accessToken: e, id: t }) => {
|
|
17002
|
+
let { status: n, error: r, data: i } = await (await fetch(`${Zy()}/data?id=${t}`, { headers: { Authorization: e || "" } })).json();
|
|
16994
17003
|
if (n !== "success") throw Error(`failed to get data ${t}: ${r?.message}`);
|
|
16995
17004
|
return i;
|
|
16996
|
-
},
|
|
16997
|
-
let r = await (await fetch(`${
|
|
17005
|
+
}, $y = async ({ accessToken: e, id: t, data: n }) => {
|
|
17006
|
+
let r = await (await fetch(`${Zy()}/compile`, {
|
|
16998
17007
|
method: "POST",
|
|
16999
17008
|
headers: {
|
|
17000
17009
|
"Content-Type": "application/json",
|
|
@@ -17008,18 +17017,18 @@ var Zy = async ({ accessToken: e, id: t }) => {
|
|
|
17008
17017
|
})).json();
|
|
17009
17018
|
if (r.status !== "success") throw Error(`failed to post compile ${t}: ${r.error?.message}`);
|
|
17010
17019
|
return r.data;
|
|
17011
|
-
},
|
|
17020
|
+
}, eb = async ({ accessToken: e, id: t, data: n }) => {
|
|
17012
17021
|
let r = Object.keys(n).length > 0 ? 1 : 2;
|
|
17013
|
-
return t = t.split("+").slice(0, r).join("+"), await
|
|
17022
|
+
return t = t.split("+").slice(0, r).join("+"), await $y({
|
|
17014
17023
|
accessToken: e,
|
|
17015
17024
|
id: t,
|
|
17016
17025
|
data: n
|
|
17017
17026
|
});
|
|
17018
|
-
},
|
|
17027
|
+
}, tb = async ({ accessToken: e, id: t }) => await Qy({
|
|
17019
17028
|
accessToken: e,
|
|
17020
17029
|
id: t
|
|
17021
|
-
}),
|
|
17022
|
-
function
|
|
17030
|
+
}), nb = /* @__PURE__ */ new Set(["update", "response"]), rb = /* @__PURE__ */ new Set(["init", "loaded"]);
|
|
17031
|
+
function ib(e) {
|
|
17023
17032
|
return e && typeof e == "object" && Array.isArray(e.errors) ? {
|
|
17024
17033
|
data: e.data ?? null,
|
|
17025
17034
|
errors: e.errors
|
|
@@ -17028,10 +17037,10 @@ function rb(e) {
|
|
|
17028
17037
|
errors: []
|
|
17029
17038
|
};
|
|
17030
17039
|
}
|
|
17031
|
-
function
|
|
17040
|
+
function ab(e, t) {
|
|
17032
17041
|
return t.length > 0 || !(e == null || typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0);
|
|
17033
17042
|
}
|
|
17034
|
-
function
|
|
17043
|
+
function ob(e, { type: t, args: n }) {
|
|
17035
17044
|
switch (t) {
|
|
17036
17045
|
case "init": return { ...n };
|
|
17037
17046
|
case "compiled":
|
|
@@ -17048,22 +17057,22 @@ function ab(e, { type: t, args: n }) {
|
|
|
17048
17057
|
default: return console.error(`Unimplemented action type: ${t}`), e;
|
|
17049
17058
|
}
|
|
17050
17059
|
}
|
|
17051
|
-
var
|
|
17060
|
+
var sb = (e, t) => {
|
|
17052
17061
|
if (e === t) return !0;
|
|
17053
17062
|
if (typeof e != typeof t || e === null || t === null || typeof e != "object" || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
17054
|
-
if (Array.isArray(e)) return e.length === t.length && e.every((e, n) =>
|
|
17063
|
+
if (Array.isArray(e)) return e.length === t.length && e.every((e, n) => sb(e, t[n]));
|
|
17055
17064
|
let n = Object.keys(e);
|
|
17056
|
-
return n.length === Object.keys(t).length && n.every((n) => Object.prototype.hasOwnProperty.call(t, n) &&
|
|
17057
|
-
},
|
|
17058
|
-
let i = e ? e(n.data, r) : void 0, a = i === void 0 ?
|
|
17059
|
-
return a === n.data ||
|
|
17065
|
+
return n.length === Object.keys(t).length && n.every((n) => Object.prototype.hasOwnProperty.call(t, n) && sb(e[n], t[n]));
|
|
17066
|
+
}, cb = (e, t) => (n, r) => {
|
|
17067
|
+
let i = e ? e(n.data, r) : void 0, a = i === void 0 ? ob(n.data, r) : i;
|
|
17068
|
+
return a === n.data || sb(a, n.data) ? n : {
|
|
17060
17069
|
data: a,
|
|
17061
|
-
renderData: t === "live" ||
|
|
17062
|
-
compileSeq: n.compileSeq + +!!
|
|
17070
|
+
renderData: t === "live" || rb.has(r.type) ? a : n.renderData,
|
|
17071
|
+
compileSeq: n.compileSeq + +!!nb.has(r.type),
|
|
17063
17072
|
version: n.version + 1
|
|
17064
17073
|
};
|
|
17065
|
-
},
|
|
17066
|
-
let [r] = E(() => new URLSearchParams(window.location.search)), [i] = E(r.get("id") ?? void 0), [a] = E(r.get("access_token") ?? void 0), [o] = E(r.get("origin") ?? void 0), [s, c] = E([]), l = ee(() =>
|
|
17074
|
+
}, lb = ({ Form: e, reduce: t, formModel: n = "live" }) => {
|
|
17075
|
+
let [r] = E(() => new URLSearchParams(window.location.search)), [i] = E(r.get("id") ?? void 0), [a] = E(r.get("access_token") ?? void 0), [o] = E(r.get("origin") ?? void 0), [s, c] = E([]), l = ee(() => cb(t, n), [t, n]), [u, d] = w(l, void 0, () => ({
|
|
17067
17076
|
data: {},
|
|
17068
17077
|
renderData: {},
|
|
17069
17078
|
compileSeq: 0,
|
|
@@ -17086,17 +17095,17 @@ var ob = (e, t) => {
|
|
|
17086
17095
|
data: f
|
|
17087
17096
|
}, o);
|
|
17088
17097
|
}, [h]);
|
|
17089
|
-
let g =
|
|
17098
|
+
let g = Xy(i ? {
|
|
17090
17099
|
accessToken: a,
|
|
17091
17100
|
id: i
|
|
17092
|
-
} : null,
|
|
17101
|
+
} : null, tb, {
|
|
17093
17102
|
revalidateOnFocus: !1,
|
|
17094
17103
|
revalidateOnReconnect: !1,
|
|
17095
17104
|
revalidateIfStale: !1
|
|
17096
17105
|
});
|
|
17097
17106
|
S(() => {
|
|
17098
17107
|
if (g.data === void 0) return;
|
|
17099
|
-
let e =
|
|
17108
|
+
let e = ib(g.data);
|
|
17100
17109
|
d({
|
|
17101
17110
|
type: "loaded",
|
|
17102
17111
|
args: e.data
|
|
@@ -17113,13 +17122,13 @@ var ob = (e, t) => {
|
|
|
17113
17122
|
let t = !1;
|
|
17114
17123
|
return (async () => {
|
|
17115
17124
|
try {
|
|
17116
|
-
let n = await
|
|
17125
|
+
let n = await eb({
|
|
17117
17126
|
accessToken: a,
|
|
17118
17127
|
id: i,
|
|
17119
17128
|
data: f
|
|
17120
17129
|
});
|
|
17121
17130
|
if (t || e !== _.current) return;
|
|
17122
|
-
let r =
|
|
17131
|
+
let r = ib(n);
|
|
17123
17132
|
d({
|
|
17124
17133
|
type: "compiled",
|
|
17125
17134
|
args: r.data
|
|
@@ -17131,14 +17140,14 @@ var ob = (e, t) => {
|
|
|
17131
17140
|
t = !0;
|
|
17132
17141
|
};
|
|
17133
17142
|
}, [m]);
|
|
17134
|
-
let v =
|
|
17143
|
+
let v = ab(p, []) ? p : f, b = ee(() => ({
|
|
17135
17144
|
data: v,
|
|
17136
17145
|
errors: s,
|
|
17137
17146
|
apply: d
|
|
17138
17147
|
}), [v, s]), x = y(() => g.mutate(), [g]);
|
|
17139
|
-
return
|
|
17148
|
+
return ab(f, s) ? /* @__PURE__ */ O(e, { state: b }) : g.error ? /* @__PURE__ */ k("div", {
|
|
17140
17149
|
role: "alert",
|
|
17141
|
-
style:
|
|
17150
|
+
style: ub,
|
|
17142
17151
|
children: [
|
|
17143
17152
|
/* @__PURE__ */ O("p", {
|
|
17144
17153
|
style: {
|
|
@@ -17156,7 +17165,7 @@ var ob = (e, t) => {
|
|
|
17156
17165
|
}),
|
|
17157
17166
|
/* @__PURE__ */ O("button", {
|
|
17158
17167
|
type: "button",
|
|
17159
|
-
style:
|
|
17168
|
+
style: db,
|
|
17160
17169
|
onClick: x,
|
|
17161
17170
|
children: "Retry"
|
|
17162
17171
|
})
|
|
@@ -17164,10 +17173,10 @@ var ob = (e, t) => {
|
|
|
17164
17173
|
}) : g.isLoading ? /* @__PURE__ */ O("div", {
|
|
17165
17174
|
role: "status",
|
|
17166
17175
|
"aria-live": "polite",
|
|
17167
|
-
style:
|
|
17176
|
+
style: ub,
|
|
17168
17177
|
children: "Loading…"
|
|
17169
17178
|
}) : /* @__PURE__ */ O("div", {});
|
|
17170
|
-
},
|
|
17179
|
+
}, ub = {
|
|
17171
17180
|
display: "flex",
|
|
17172
17181
|
flexDirection: "column",
|
|
17173
17182
|
alignItems: "center",
|
|
@@ -17176,7 +17185,7 @@ var ob = (e, t) => {
|
|
|
17176
17185
|
padding: "24px",
|
|
17177
17186
|
textAlign: "center",
|
|
17178
17187
|
font: "14px/1.4 system-ui, sans-serif"
|
|
17179
|
-
},
|
|
17188
|
+
}, db = {
|
|
17180
17189
|
padding: "6px 14px",
|
|
17181
17190
|
border: "1px solid #888",
|
|
17182
17191
|
borderRadius: "4px",
|
|
@@ -17184,6 +17193,6 @@ var ob = (e, t) => {
|
|
|
17184
17193
|
cursor: "pointer"
|
|
17185
17194
|
};
|
|
17186
17195
|
//#endregion
|
|
17187
|
-
export {
|
|
17196
|
+
export { wv as Form, lb as View, u as getCellsValidation, Ov as reduce, l as scoreCells };
|
|
17188
17197
|
|
|
17189
17198
|
//# sourceMappingURL=index.js.map
|