@versini/sassysaint 8.113.1 → 8.115.0
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/chunks/{AboutChangelog.DARG59db.js → AboutChangelog.cYXO6N-J.js} +2 -2
- package/dist/chunks/{AboutEntry.b7SX6WL6.js → AboutEntry.CSQbhWlI.js} +7 -7
- package/dist/chunks/{App.xmJgJehw.js → App.Dma2gxWb.js} +2694 -2705
- package/dist/chunks/{Bubble.Cz0qyoPO.js → Bubble.-CdmiUoI.js} +1 -1
- package/dist/chunks/{ButtonIconDelete.B3ULIUO-.js → ButtonIconDelete.Cgu_no-r.js} +2 -2
- package/dist/chunks/{Chart.C0iTXNld.js → Chart.BrccRt9A.js} +2 -2
- package/dist/chunks/{ChatBubbleAssistant.Oxeqz6_p.js → ChatBubbleAssistant.DDEqvmFC.js} +4 -4
- package/dist/chunks/{ChatBubbleUser.XmPerorZ.js → ChatBubbleUser.CLqjgdS1.js} +3 -3
- package/dist/chunks/{ChatHistoryTable.CPSt_wL_.js → ChatHistoryTable.DDxqwi3_.js} +11 -11
- package/dist/chunks/{HistoryEntry.CkyoLRa6.js → HistoryEntry.CBbnICC8.js} +38 -38
- package/dist/chunks/{LoginEntry.OXFkZEz4.js → LoginEntry.4o6Zyxt5.js} +4 -4
- package/dist/chunks/{LogoEntry.CwNXwlBx.js → LogoEntry.DzrCgR1y.js} +891 -891
- package/dist/chunks/{MemoriesEntry.RiZXtAAL.js → MemoriesEntry.CJenxq81.js} +5 -5
- package/dist/chunks/{ProfileEntry.CrZ2q4i9.js → ProfileEntry.Dtk5OH9L.js} +4 -4
- package/dist/chunks/{SettingsEntry.M3K9Udw1.js → SettingsEntry.DT__txag.js} +21 -21
- package/dist/chunks/{UsageEntry.CN_Db9Wa.js → UsageEntry.D4jX6Ni3.js} +5 -5
- package/dist/chunks/{_baseUniq.f4f4GDt9.js → _baseUniq.j-cbKTIU.js} +1 -1
- package/dist/chunks/{arc.i1gTqq5f.js → arc.s51KKzXf.js} +1 -1
- package/dist/chunks/{architecture-U656AL7Q.BlAWNnCU.js → architecture-U656AL7Q.D9jnBghb.js} +1 -1
- package/dist/chunks/{architectureDiagram-VXUJARFQ.CNiv_XUQ.js → architectureDiagram-VXUJARFQ.BX9cPW0h.js} +4 -4
- package/dist/chunks/{blockDiagram-VD42YOAC.DHyMgxSX.js → blockDiagram-VD42YOAC.D2nIV7_O.js} +5 -5
- package/dist/chunks/{browser.DwvEsO0M.js → browser.BpS7pwYf.js} +1 -1
- package/dist/chunks/{c4Diagram-YG6GDRKO.5rV4UgiI.js → c4Diagram-YG6GDRKO.DXt3lYiA.js} +2 -2
- package/dist/chunks/{channel.Cbuusniv.js → channel.CFOku56s.js} +1 -1
- package/dist/chunks/{chunk-4BX2VUAB.Cr4aulve.js → chunk-4BX2VUAB.BWz_fDS6.js} +1 -1
- package/dist/chunks/{chunk-55IACEB6.BSNVvGBN.js → chunk-55IACEB6.DgiFo5u1.js} +1 -1
- package/dist/chunks/{chunk-B4BG7PRW.f8-M_ha3.js → chunk-B4BG7PRW.D0bHBpBT.js} +4 -4
- package/dist/chunks/{chunk-DI55MBZ5.DHI14tPg.js → chunk-DI55MBZ5.HQmmvdll.js} +3 -3
- package/dist/chunks/{chunk-FMBD7UC4.iTWjW72u.js → chunk-FMBD7UC4.DPxQ7DiM.js} +1 -1
- package/dist/chunks/{chunk-QN33PNHL.D4-2NXjF.js → chunk-QN33PNHL.DaIDraDw.js} +1 -1
- package/dist/chunks/{chunk-QZHKN3VN.CYmGB8Sb.js → chunk-QZHKN3VN.LC7xBEqZ.js} +1 -1
- package/dist/chunks/{chunk-TZMSLE5B.DzMaXodZ.js → chunk-TZMSLE5B.b50h6n9-.js} +1 -1
- package/dist/chunks/{classDiagram-2ON5EDUG.BKKdpvXL.js → classDiagram-2ON5EDUG.BhbvE-K3.js} +2 -2
- package/dist/chunks/{classDiagram-v2-WZHVMYZB.BKKdpvXL.js → classDiagram-v2-WZHVMYZB.BhbvE-K3.js} +2 -2
- package/dist/chunks/{clone.CvyZhqBo.js → clone.Duh8Phbm.js} +1 -1
- package/dist/chunks/{cose-bilkent-S5V4N54A.DkcPIpNo.js → cose-bilkent-S5V4N54A.hI1Ll-gw.js} +2 -2
- package/dist/chunks/{dagre-6UL2VRFP.CYWrglcj.js → dagre-6UL2VRFP._rp-5xrB.js} +5 -5
- package/dist/chunks/{diagram-PSM6KHXK.ammyY8fs.js → diagram-PSM6KHXK.Bo5ENyvC.js} +4 -4
- package/dist/chunks/{diagram-QEK2KX5R.nxakvoUi.js → diagram-QEK2KX5R.7zq18yjt.js} +3 -3
- package/dist/chunks/{diagram-S2PKOQOG.oTHGFvqq.js → diagram-S2PKOQOG.BJxppCOh.js} +3 -3
- package/dist/chunks/{erDiagram-Q2GNP2WA.CLXRUHsa.js → erDiagram-Q2GNP2WA.Cs1J95yg.js} +4 -4
- package/dist/chunks/{flowDiagram-NV44I4VS.Cy7wO5FH.js → flowDiagram-NV44I4VS.CHhgAMP7.js} +5 -5
- package/dist/chunks/{ganttDiagram-JELNMOA3.Cl8zcb3j.js → ganttDiagram-JELNMOA3.B2xNftod.js} +2 -2
- package/dist/chunks/{gitGraph-F6HP7TQM.hNW58gvI.js → gitGraph-F6HP7TQM.KJFqke_C.js} +1 -1
- package/dist/chunks/{gitGraphDiagram-NY62KEGX.CZSlTMsq.js → gitGraphDiagram-NY62KEGX.DX_ee_38.js} +4 -4
- package/dist/chunks/{graph.Caz35JH7.js → graph.CUgUKS08.js} +2 -2
- package/dist/chunks/{index.CvxA-kV5.js → index.B519ew0o.js} +1 -1
- package/dist/chunks/{index.DjSNYDyW.js → index.B8hSJstR.js} +3 -3
- package/dist/chunks/{index.DN476kOD.js → index.BP-52CIm.js} +1 -1
- package/dist/chunks/{index.BviDehsy.js → index.C7y29n02.js} +1 -1
- package/dist/chunks/{index.CQi6BBgd.js → index.Cve2drMf.js} +1 -1
- package/dist/chunks/{index.1cAC-xa5.js → index.DA40TKr6.js} +1 -1
- package/dist/chunks/{index.Db2hh2RQ.js → index.DZU3Dh0n.js} +1 -1
- package/dist/chunks/{index.HA4LNOyl.js → index.DurA77q3.js} +3 -3
- package/dist/chunks/{index.CqmFtr8m.js → index.DxCB1RIc.js} +604 -554
- package/dist/chunks/{info-NVLQJR56.Dc95hvAr.js → info-NVLQJR56.CBxhfRws.js} +1 -1
- package/dist/chunks/{infoDiagram-WHAUD3N6.DkzXHXgE.js → infoDiagram-WHAUD3N6.Q_b5lpx4.js} +2 -2
- package/dist/chunks/{journeyDiagram-XKPGCS4Q.Dm4nCIWT.js → journeyDiagram-XKPGCS4Q.C2MAzQ81.js} +4 -4
- package/dist/chunks/{kanban-definition-3W4ZIXB7.Bw_g7kdo.js → kanban-definition-3W4ZIXB7.D2G7relm.js} +2 -2
- package/dist/chunks/{layout.B2-214jN.js → layout.CXHmnDHE.js} +4 -4
- package/dist/chunks/{mermaid-parser.core.CXlYMeXK.js → mermaid-parser.core.t-ijXLVA.js} +10 -10
- package/dist/chunks/{min.BgoLZ81l.js → min.Db1anaH8.js} +2 -2
- package/dist/chunks/{mindmap-definition-VGOIOE7T.CsFsq1Li.js → mindmap-definition-VGOIOE7T.D0Z0JOgS.js} +4 -4
- package/dist/chunks/{packet-BFZMPI3H.CDcu8fNx.js → packet-BFZMPI3H.BS97JHmr.js} +1 -1
- package/dist/chunks/{pie-7BOR55EZ.ByUouGiC.js → pie-7BOR55EZ.6GPetedW.js} +1 -1
- package/dist/chunks/{pieDiagram-ADFJNKIX.D8CkHMPE.js → pieDiagram-ADFJNKIX.DomEEeYz.js} +4 -4
- package/dist/chunks/{quadrantDiagram-AYHSOK5B.yAWIyAoJ.js → quadrantDiagram-AYHSOK5B.C9Da1XDD.js} +1 -1
- package/dist/chunks/{radar-NHE76QYJ.Bd9UodJQ.js → radar-NHE76QYJ.BgcGDRmW.js} +1 -1
- package/dist/chunks/{rehype-mermaid.CkjpiQg3.js → rehype-mermaid.Dx1B0gAg.js} +33 -33
- package/dist/chunks/{requirementDiagram-UZGBJVZJ.D_fevfp7.js → requirementDiagram-UZGBJVZJ.D5DVZQJF.js} +3 -3
- package/dist/chunks/{sankeyDiagram-TZEHDZUN.BhEOFLc-.js → sankeyDiagram-TZEHDZUN.D1qdX7uU.js} +1 -1
- package/dist/chunks/{sequenceDiagram-WL72ISMW.BHLZnLLI.js → sequenceDiagram-WL72ISMW.BG_L2WY-.js} +3 -3
- package/dist/chunks/{stateDiagram-FKZM4ZOC.CCaljhqc.js → stateDiagram-FKZM4ZOC.B4ID8gfW.js} +4 -4
- package/dist/chunks/{stateDiagram-v2-4FDKWEC3.BIe9xvkt.js → stateDiagram-v2-4FDKWEC3.OKYwCiNm.js} +2 -2
- package/dist/chunks/{timeline-definition-IT6M3QCI.DaPI8uIU.js → timeline-definition-IT6M3QCI.D_oPJBYb.js} +2 -2
- package/dist/chunks/{treemap-KMMF4GRG.Dp5s54-J.js → treemap-KMMF4GRG.BxoeOvUX.js} +1 -1
- package/dist/chunks/{useMarkdown.DZ7gk7QY.js → useMarkdown.B4iPfBGx.js} +942 -874
- package/dist/chunks/{xychartDiagram-PRI3JC2R.CuFnq5R8.js → xychartDiagram-PRI3JC2R.CFF8ELFv.js} +1 -1
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +3 -3
- package/package.json +3 -3
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { jsx as S, jsxs as Ws } from "react/jsx-runtime";
|
|
2
2
|
import * as D from "react";
|
|
3
|
-
import Vs, { createContext as ut, useReducer as Js, useCallback as
|
|
3
|
+
import Vs, { createContext as ut, useReducer as Js, useCallback as Q, useRef as Ys, useEffect as me, useSyncExternalStore as zs, useContext as lt, useState as Xs, useMemo as Tt, Suspense as At, lazy as zt } from "react";
|
|
4
4
|
import $e from "clsx";
|
|
5
|
-
let
|
|
5
|
+
let qi = "standard";
|
|
6
6
|
var g, T = ((g = {})[g.NewChat = 0] = "NewChat", g[g.Prompts = 1] = "Prompts", g[g.Attachment = 2] = "Attachment", g[g.PrivateChat = 3] = "PrivateChat", g[g.Reasoning = 4] = "Reasoning", g[g.Send = 5] = "Send", g[g.Header = 6] = "Header", g[g.Provider = 7] = "Provider", g[g.Logo = 8] = "Logo", g[g.Placeholder = 9] = "Placeholder", g[g.Footer = 10] = "Footer", g);
|
|
7
|
-
let
|
|
7
|
+
let Bi = "user", ji = "assistant", xe = "OpenAI", dt = "Anthropic", ht = "Google", Zs = "Perplexity", Qi = xe, er = [xe, dt, ht], Xt = "gpt-5.2", Zt = "gpt-5-mini", es = "gpt-5-nano", ts = "gpt-4.1-nano", ss = "claude-haiku-4-5", rs = "claude-sonnet-4-5", ns = "gemini-3-flash-preview", is = "gemini-3-pro-preview", as = "sonar", os = "sonar-pro", tr = "gemini-3-pro-image-preview", Wi = { [Xt]: "GPT-5.2", [Zt]: "GPT-5 Mini", [es]: "GPT-5 Nano", [ts]: "GPT-4.1 Nano", [ss]: "Claude Haiku 4.5", [rs]: "Claude Sonnet 4.5", [ns]: "Gemini 3 Flash", [is]: "Gemini 3 Pro", [as]: "Sonar", [os]: "Sonar Pro", [tr]: "Nano Banana Pro" }, cs = { [xe]: [ts, Xt, Zt, es], [dt]: [ss, rs], [ht]: [ns, is], [Zs]: [as, os] }, Vi = "x-diggidy-chat-id", Ji = "timestamp", Yi = "tokenUsage", zi = "Diggidy", Xi = { TOOL: { MEMORIES: "getUserMemories" }, ADDON: { ATTACHMENTS: "addon:attachments", REASONING: "addon:reasoning" } }, Zi = (e) => {
|
|
8
8
|
if (!e || e.length === 0) return [];
|
|
9
9
|
let t = /* @__PURE__ */ new Set();
|
|
10
|
-
for (let s of e) for (let [r, n] of Object.entries(
|
|
10
|
+
for (let s of e) for (let [r, n] of Object.entries(cs)) n.includes(s) && (r === xe || r === dt || r === ht) && t.add(r);
|
|
11
11
|
return er.filter((s) => t.has(s));
|
|
12
|
-
},
|
|
12
|
+
}, sr = (e) => {
|
|
13
13
|
let t = /* @__PURE__ */ new Map();
|
|
14
14
|
if (!e || e.length === 0) return t;
|
|
15
|
-
for (let s of e) for (let [r, n] of Object.entries(
|
|
15
|
+
for (let s of e) for (let [r, n] of Object.entries(cs)) if (n.includes(s)) {
|
|
16
16
|
t.has(r) || t.set(r, []), t.get(r)?.push(s);
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
|
-
},
|
|
21
|
-
for (let t of
|
|
20
|
+
}, ea = (e) => {
|
|
21
|
+
for (let t of sr(e).values()) if (t.length > 1) return !0;
|
|
22
22
|
return !1;
|
|
23
|
-
},
|
|
24
|
-
function
|
|
23
|
+
}, ta = (e, t) => !!e && !!t && t.length !== 0 && t.includes(e);
|
|
24
|
+
function rr(e, t, s) {
|
|
25
25
|
if (!t || Array.isArray(t) && t.length === 0) return !0;
|
|
26
26
|
let r = e instanceof Set ? e : e ? new Set(e) : null;
|
|
27
27
|
return !!r && r.size !== 0 && (typeof t == "string" ? r.has(t) : s?.any === !0 ? t.some((n) => r.has(n)) : t.every((n) => r.has(n)));
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
const
|
|
29
|
+
var sa = "subtle";
|
|
30
|
+
const nr = {
|
|
31
31
|
[T.NewChat]: "fill-[#7A9BC4]",
|
|
32
32
|
[T.Prompts]: "fill-[#B8A4D5]",
|
|
33
33
|
[T.Attachment]: "fill-[#D4B896]",
|
|
@@ -37,7 +37,7 @@ const rr = {
|
|
|
37
37
|
[T.Header]: "text-copy-medium",
|
|
38
38
|
[T.Provider]: "fill-copy-medium",
|
|
39
39
|
[T.Placeholder]: "placeholder:text-copy-medium/70"
|
|
40
|
-
},
|
|
40
|
+
}, ir = {
|
|
41
41
|
[T.NewChat]: "fill-[#91BBED] dark:fill-[#7A9BC4]",
|
|
42
42
|
[T.Prompts]: "fill-[#B89FDC] dark:fill-[#B8A4D5]",
|
|
43
43
|
[T.Attachment]: "fill-[#D7B286] dark:fill-[#D4B896]",
|
|
@@ -65,7 +65,7 @@ var Se = class {
|
|
|
65
65
|
}
|
|
66
66
|
onUnsubscribe() {
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, ar = {
|
|
69
69
|
// We need the wrapper function syntax below instead of direct references to
|
|
70
70
|
// global setTimeout etc.
|
|
71
71
|
//
|
|
@@ -80,14 +80,14 @@ var Se = class {
|
|
|
80
80
|
clearTimeout: (e) => clearTimeout(e),
|
|
81
81
|
setInterval: (e, t) => setInterval(e, t),
|
|
82
82
|
clearInterval: (e) => clearInterval(e)
|
|
83
|
-
},
|
|
83
|
+
}, or = class {
|
|
84
84
|
// We cannot have TimeoutManager<T> as we must instantiate it with a concrete
|
|
85
85
|
// type at app boot; and if we leave that type, then any new timer provider
|
|
86
86
|
// would need to support ReturnType<typeof setTimeout>, which is infeasible.
|
|
87
87
|
//
|
|
88
88
|
// We settle for type safety for the TimeoutProvider type, and accept that
|
|
89
89
|
// this class is unsafe internally to allow for extension.
|
|
90
|
-
#e =
|
|
90
|
+
#e = ar;
|
|
91
91
|
#t = !1;
|
|
92
92
|
setTimeoutProvider(e) {
|
|
93
93
|
process.env.NODE_ENV !== "production" && this.#t && e !== this.#e && console.error(
|
|
@@ -107,20 +107,20 @@ var Se = class {
|
|
|
107
107
|
clearInterval(e) {
|
|
108
108
|
this.#e.clearInterval(e);
|
|
109
109
|
}
|
|
110
|
-
}, re = new
|
|
111
|
-
function
|
|
110
|
+
}, re = new or();
|
|
111
|
+
function cr(e) {
|
|
112
112
|
setTimeout(e, 0);
|
|
113
113
|
}
|
|
114
114
|
var ne = typeof window > "u" || "Deno" in globalThis;
|
|
115
115
|
function U() {
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function ur(e, t) {
|
|
118
118
|
return typeof e == "function" ? e(t) : e;
|
|
119
119
|
}
|
|
120
120
|
function tt(e) {
|
|
121
121
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function us(e, t) {
|
|
124
124
|
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
125
125
|
}
|
|
126
126
|
function te(e, t) {
|
|
@@ -129,7 +129,7 @@ function te(e, t) {
|
|
|
129
129
|
function K(e, t) {
|
|
130
130
|
return typeof e == "function" ? e(t) : e;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function vt(e, t) {
|
|
133
133
|
const {
|
|
134
134
|
type: s = "all",
|
|
135
135
|
exact: r,
|
|
@@ -152,7 +152,7 @@ function At(e, t) {
|
|
|
152
152
|
}
|
|
153
153
|
return !(typeof o == "boolean" && t.isStale() !== o || n && n !== t.state.fetchStatus || i && !i(t));
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Rt(e, t) {
|
|
156
156
|
const { exact: s, status: r, predicate: n, mutationKey: i } = e;
|
|
157
157
|
if (i) {
|
|
158
158
|
if (!t.options.mutationKey)
|
|
@@ -177,18 +177,18 @@ function ie(e) {
|
|
|
177
177
|
function Re(e, t) {
|
|
178
178
|
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? Object.keys(t).every((s) => Re(e[s], t[s])) : !1;
|
|
179
179
|
}
|
|
180
|
-
var
|
|
180
|
+
var lr = Object.prototype.hasOwnProperty;
|
|
181
181
|
function st(e, t) {
|
|
182
182
|
if (e === t)
|
|
183
183
|
return e;
|
|
184
|
-
const s =
|
|
184
|
+
const s = bt(e) && bt(t);
|
|
185
185
|
if (!s && !(rt(e) && rt(t))) return t;
|
|
186
186
|
const n = (s ? e : Object.keys(e)).length, i = s ? t : Object.keys(t), a = i.length, o = s ? new Array(a) : {};
|
|
187
187
|
let c = 0;
|
|
188
188
|
for (let h = 0; h < a; h++) {
|
|
189
189
|
const u = s ? h : i[h], d = e[u], l = t[u];
|
|
190
190
|
if (d === l) {
|
|
191
|
-
o[u] = d, (s ? h < n :
|
|
191
|
+
o[u] = d, (s ? h < n : lr.call(e, u)) && c++;
|
|
192
192
|
continue;
|
|
193
193
|
}
|
|
194
194
|
if (d === null || l === null || typeof d != "object" || typeof l != "object") {
|
|
@@ -208,22 +208,22 @@ function De(e, t) {
|
|
|
208
208
|
return !1;
|
|
209
209
|
return !0;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function bt(e) {
|
|
212
212
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
213
213
|
}
|
|
214
214
|
function rt(e) {
|
|
215
|
-
if (!
|
|
215
|
+
if (!It(e))
|
|
216
216
|
return !1;
|
|
217
217
|
const t = e.constructor;
|
|
218
218
|
if (t === void 0)
|
|
219
219
|
return !0;
|
|
220
220
|
const s = t.prototype;
|
|
221
|
-
return !(!
|
|
221
|
+
return !(!It(s) || !s.hasOwnProperty("isPrototypeOf") || Object.getPrototypeOf(e) !== Object.prototype);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function It(e) {
|
|
224
224
|
return Object.prototype.toString.call(e) === "[object Object]";
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function dr(e) {
|
|
227
227
|
return new Promise((t) => {
|
|
228
228
|
re.setTimeout(t, e);
|
|
229
229
|
});
|
|
@@ -244,24 +244,31 @@ function nt(e, t, s) {
|
|
|
244
244
|
}
|
|
245
245
|
return t;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function hr(e, t, s = 0) {
|
|
248
248
|
const r = [...e, t];
|
|
249
249
|
return s && r.length > s ? r.slice(1) : r;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function fr(e, t, s = 0) {
|
|
252
252
|
const r = [t, ...e];
|
|
253
253
|
return s && r.length > s ? r.slice(0, -1) : r;
|
|
254
254
|
}
|
|
255
255
|
var Ne = /* @__PURE__ */ Symbol();
|
|
256
|
-
function
|
|
256
|
+
function ls(e, t) {
|
|
257
257
|
return process.env.NODE_ENV !== "production" && e.queryFn === Ne && console.error(
|
|
258
258
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
259
259
|
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === Ne ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function pt(e, t) {
|
|
262
262
|
return typeof e == "function" ? e(...t) : !!e;
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
function pr(e, t, s) {
|
|
265
|
+
let r = !1, n;
|
|
266
|
+
return Object.defineProperty(e, "signal", {
|
|
267
|
+
enumerable: !0,
|
|
268
|
+
get: () => (n ??= t(), r || (r = !0, n.aborted ? s() : n.addEventListener("abort", s, { once: !0 })), n)
|
|
269
|
+
}), e;
|
|
270
|
+
}
|
|
271
|
+
var yr = class extends Se {
|
|
265
272
|
#e;
|
|
266
273
|
#t;
|
|
267
274
|
#s;
|
|
@@ -298,7 +305,7 @@ var fr = class extends Se {
|
|
|
298
305
|
isFocused() {
|
|
299
306
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
300
307
|
}
|
|
301
|
-
},
|
|
308
|
+
}, yt = new yr();
|
|
302
309
|
function it() {
|
|
303
310
|
let e, t;
|
|
304
311
|
const s = new Promise((n, i) => {
|
|
@@ -321,13 +328,13 @@ function it() {
|
|
|
321
328
|
}), t(n);
|
|
322
329
|
}, s;
|
|
323
330
|
}
|
|
324
|
-
var
|
|
325
|
-
function
|
|
331
|
+
var mr = cr;
|
|
332
|
+
function Er() {
|
|
326
333
|
let e = [], t = 0, s = (o) => {
|
|
327
334
|
o();
|
|
328
335
|
}, r = (o) => {
|
|
329
336
|
o();
|
|
330
|
-
}, n =
|
|
337
|
+
}, n = mr;
|
|
331
338
|
const i = (o) => {
|
|
332
339
|
t ? e.push(o) : n(() => {
|
|
333
340
|
s(o);
|
|
@@ -381,7 +388,7 @@ function yr() {
|
|
|
381
388
|
}
|
|
382
389
|
};
|
|
383
390
|
}
|
|
384
|
-
var A =
|
|
391
|
+
var A = Er(), gr = class extends Se {
|
|
385
392
|
#e = !0;
|
|
386
393
|
#t;
|
|
387
394
|
#s;
|
|
@@ -412,8 +419,8 @@ var A = yr(), mr = class extends Se {
|
|
|
412
419
|
isOnline() {
|
|
413
420
|
return this.#e;
|
|
414
421
|
}
|
|
415
|
-
}, Ue = new
|
|
416
|
-
function
|
|
422
|
+
}, Ue = new gr();
|
|
423
|
+
function Sr(e) {
|
|
417
424
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
418
425
|
}
|
|
419
426
|
function ds(e) {
|
|
@@ -428,20 +435,20 @@ function hs(e) {
|
|
|
428
435
|
let t = !1, s = 0, r;
|
|
429
436
|
const n = it(), i = () => n.status !== "pending", a = (y) => {
|
|
430
437
|
if (!i()) {
|
|
431
|
-
const
|
|
432
|
-
l(
|
|
438
|
+
const O = new at(y);
|
|
439
|
+
l(O), e.onCancel?.(O);
|
|
433
440
|
}
|
|
434
441
|
}, o = () => {
|
|
435
442
|
t = !0;
|
|
436
443
|
}, c = () => {
|
|
437
444
|
t = !1;
|
|
438
|
-
}, h = () =>
|
|
445
|
+
}, h = () => yt.isFocused() && (e.networkMode === "always" || Ue.isOnline()) && e.canRun(), u = () => ds(e.networkMode) && e.canRun(), d = (y) => {
|
|
439
446
|
i() || (r?.(), n.resolve(y));
|
|
440
447
|
}, l = (y) => {
|
|
441
448
|
i() || (r?.(), n.reject(y));
|
|
442
449
|
}, p = () => new Promise((y) => {
|
|
443
|
-
r = (
|
|
444
|
-
(i() || h()) && y(
|
|
450
|
+
r = (O) => {
|
|
451
|
+
(i() || h()) && y(O);
|
|
445
452
|
}, e.onPause?.();
|
|
446
453
|
}).then(() => {
|
|
447
454
|
r = void 0, i() || e.onContinue?.();
|
|
@@ -449,21 +456,21 @@ function hs(e) {
|
|
|
449
456
|
if (i())
|
|
450
457
|
return;
|
|
451
458
|
let y;
|
|
452
|
-
const
|
|
459
|
+
const O = s === 0 ? e.initialPromise : void 0;
|
|
453
460
|
try {
|
|
454
|
-
y =
|
|
461
|
+
y = O ?? e.fn();
|
|
455
462
|
} catch (b) {
|
|
456
463
|
y = Promise.reject(b);
|
|
457
464
|
}
|
|
458
465
|
Promise.resolve(y).then(d).catch((b) => {
|
|
459
466
|
if (i())
|
|
460
467
|
return;
|
|
461
|
-
const L = e.retry ?? (ne ? 0 : 3), H = e.retryDelay ??
|
|
468
|
+
const L = e.retry ?? (ne ? 0 : 3), H = e.retryDelay ?? Sr, G = typeof H == "function" ? H(s, b) : H, x = L === !0 || typeof L == "number" && s < L || typeof L == "function" && L(s, b);
|
|
462
469
|
if (t || !x) {
|
|
463
470
|
l(b);
|
|
464
471
|
return;
|
|
465
472
|
}
|
|
466
|
-
s++, e.onFail?.(s, b),
|
|
473
|
+
s++, e.onFail?.(s, b), dr(G).then(() => h() ? void 0 : p()).then(() => {
|
|
467
474
|
t ? l(b) : f();
|
|
468
475
|
});
|
|
469
476
|
});
|
|
@@ -498,7 +505,7 @@ var fs = class {
|
|
|
498
505
|
clearGcTimeout() {
|
|
499
506
|
this.#e && (re.clearTimeout(this.#e), this.#e = void 0);
|
|
500
507
|
}
|
|
501
|
-
},
|
|
508
|
+
}, wr = class extends fs {
|
|
502
509
|
#e;
|
|
503
510
|
#t;
|
|
504
511
|
#s;
|
|
@@ -519,7 +526,7 @@ var fs = class {
|
|
|
519
526
|
if (this.options = { ...this.#a, ...e }, this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
520
527
|
const t = _t(this.options);
|
|
521
528
|
t.data !== void 0 && (this.setState(
|
|
522
|
-
|
|
529
|
+
Ot(t.data, t.dataUpdatedAt)
|
|
523
530
|
), this.#e = t);
|
|
524
531
|
}
|
|
525
532
|
}
|
|
@@ -567,7 +574,7 @@ var fs = class {
|
|
|
567
574
|
) : this.state.data === void 0 || this.state.isInvalidated;
|
|
568
575
|
}
|
|
569
576
|
isStaleByTime(e = 0) {
|
|
570
|
-
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !
|
|
577
|
+
return this.state.data === void 0 ? !0 : e === "static" ? !1 : this.state.isInvalidated ? !0 : !us(this.state.dataUpdatedAt, e);
|
|
571
578
|
}
|
|
572
579
|
onFocus() {
|
|
573
580
|
this.observers.find((t) => t.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: !1 }), this.#r?.continue();
|
|
@@ -610,7 +617,7 @@ var fs = class {
|
|
|
610
617
|
get: () => (this.#o = !0, s.signal)
|
|
611
618
|
});
|
|
612
619
|
}, n = () => {
|
|
613
|
-
const o =
|
|
620
|
+
const o = ls(this.options, t), h = (() => {
|
|
614
621
|
const u = {
|
|
615
622
|
client: this.#n,
|
|
616
623
|
queryKey: this.queryKey,
|
|
@@ -721,7 +728,7 @@ var fs = class {
|
|
|
721
728
|
case "success":
|
|
722
729
|
const r = {
|
|
723
730
|
...s,
|
|
724
|
-
...
|
|
731
|
+
...Ot(e.data, e.dataUpdatedAt),
|
|
725
732
|
dataUpdateCount: s.dataUpdateCount + 1,
|
|
726
733
|
...!e.manual && {
|
|
727
734
|
fetchStatus: "idle",
|
|
@@ -740,7 +747,10 @@ var fs = class {
|
|
|
740
747
|
fetchFailureCount: s.fetchFailureCount + 1,
|
|
741
748
|
fetchFailureReason: n,
|
|
742
749
|
fetchStatus: "idle",
|
|
743
|
-
status: "error"
|
|
750
|
+
status: "error",
|
|
751
|
+
// flag existing data as invalidated if we get a background error
|
|
752
|
+
// note that "no data" always means stale so we can set unconditionally here
|
|
753
|
+
isInvalidated: !0
|
|
744
754
|
};
|
|
745
755
|
case "invalidate":
|
|
746
756
|
return {
|
|
@@ -772,7 +782,7 @@ function ps(e, t) {
|
|
|
772
782
|
}
|
|
773
783
|
};
|
|
774
784
|
}
|
|
775
|
-
function
|
|
785
|
+
function Ot(e, t) {
|
|
776
786
|
return {
|
|
777
787
|
data: e,
|
|
778
788
|
dataUpdatedAt: t ?? Date.now(),
|
|
@@ -798,7 +808,7 @@ function _t(e) {
|
|
|
798
808
|
fetchStatus: "idle"
|
|
799
809
|
};
|
|
800
810
|
}
|
|
801
|
-
var
|
|
811
|
+
var Tr = class extends Se {
|
|
802
812
|
constructor(e, t) {
|
|
803
813
|
super(), this.options = t, this.#e = e, this.#i = null, this.#o = it(), this.bindMethods(), this.setOptions(t);
|
|
804
814
|
}
|
|
@@ -823,7 +833,7 @@ var Sr = class extends Se {
|
|
|
823
833
|
this.refetch = this.refetch.bind(this);
|
|
824
834
|
}
|
|
825
835
|
onSubscribe() {
|
|
826
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
836
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), Ct(this.#t, this.options) ? this.#d() : this.updateResult(), this.#S());
|
|
827
837
|
}
|
|
828
838
|
onUnsubscribe() {
|
|
829
839
|
this.hasListeners() || this.destroy();
|
|
@@ -857,7 +867,7 @@ var Sr = class extends Se {
|
|
|
857
867
|
observer: this
|
|
858
868
|
});
|
|
859
869
|
const r = this.hasListeners();
|
|
860
|
-
r &&
|
|
870
|
+
r && Pt(
|
|
861
871
|
this.#t,
|
|
862
872
|
s,
|
|
863
873
|
this.options,
|
|
@@ -868,7 +878,7 @@ var Sr = class extends Se {
|
|
|
868
878
|
}
|
|
869
879
|
getOptimisticResult(e) {
|
|
870
880
|
const t = this.#e.getQueryCache().build(this.#e, e), s = this.createResult(t, e);
|
|
871
|
-
return
|
|
881
|
+
return vr(this, s) && (this.#n = s, this.#a = this.options, this.#r = this.#t.state), s;
|
|
872
882
|
}
|
|
873
883
|
getCurrentResult() {
|
|
874
884
|
return this.#n;
|
|
@@ -919,7 +929,7 @@ var Sr = class extends Se {
|
|
|
919
929
|
);
|
|
920
930
|
if (ne || this.#n.isStale || !tt(e))
|
|
921
931
|
return;
|
|
922
|
-
const s =
|
|
932
|
+
const s = us(this.#n.dataUpdatedAt, e) + 1;
|
|
923
933
|
this.#u = re.setTimeout(() => {
|
|
924
934
|
this.#n.isStale || this.updateResult();
|
|
925
935
|
}, s);
|
|
@@ -929,7 +939,7 @@ var Sr = class extends Se {
|
|
|
929
939
|
}
|
|
930
940
|
#g(e) {
|
|
931
941
|
this.#T(), this.#c = e, !(ne || K(this.options.enabled, this.#t) === !1 || !tt(this.#c) || this.#c === 0) && (this.#l = re.setInterval(() => {
|
|
932
|
-
(this.options.refetchIntervalInBackground ||
|
|
942
|
+
(this.options.refetchIntervalInBackground || yt.isFocused()) && this.#d();
|
|
933
943
|
}, this.#c));
|
|
934
944
|
}
|
|
935
945
|
#S() {
|
|
@@ -945,7 +955,7 @@ var Sr = class extends Se {
|
|
|
945
955
|
const s = this.#t, r = this.options, n = this.#n, i = this.#r, a = this.#a, c = e !== s ? e.state : this.#s, { state: h } = e;
|
|
946
956
|
let u = { ...h }, d = !1, l;
|
|
947
957
|
if (t._optimisticResults) {
|
|
948
|
-
const I = this.hasListeners(), F = !I &&
|
|
958
|
+
const I = this.hasListeners(), F = !I && Ct(e, t), ee = I && Pt(e, s, t, r);
|
|
949
959
|
(F || ee) && (u = {
|
|
950
960
|
...u,
|
|
951
961
|
...ps(h.data, e.options)
|
|
@@ -953,10 +963,10 @@ var Sr = class extends Se {
|
|
|
953
963
|
}
|
|
954
964
|
let { error: p, errorUpdatedAt: f, status: y } = u;
|
|
955
965
|
l = u.data;
|
|
956
|
-
let
|
|
966
|
+
let O = !1;
|
|
957
967
|
if (t.placeholderData !== void 0 && l === void 0 && y === "pending") {
|
|
958
968
|
let I;
|
|
959
|
-
n?.isPlaceholderData && t.placeholderData === a?.placeholderData ? (I = n.data,
|
|
969
|
+
n?.isPlaceholderData && t.placeholderData === a?.placeholderData ? (I = n.data, O = !0) : I = typeof t.placeholderData == "function" ? t.placeholderData(
|
|
960
970
|
this.#f?.state.data,
|
|
961
971
|
this.#f
|
|
962
972
|
) : t.placeholderData, I !== void 0 && (y = "success", l = nt(
|
|
@@ -965,7 +975,7 @@ var Sr = class extends Se {
|
|
|
965
975
|
t
|
|
966
976
|
), d = !0);
|
|
967
977
|
}
|
|
968
|
-
if (t.select && l !== void 0 && !
|
|
978
|
+
if (t.select && l !== void 0 && !O)
|
|
969
979
|
if (n && l === i?.data && t.select === this.#y)
|
|
970
980
|
l = this.#h;
|
|
971
981
|
else
|
|
@@ -998,7 +1008,7 @@ var Sr = class extends Se {
|
|
|
998
1008
|
isPaused: u.fetchStatus === "paused",
|
|
999
1009
|
isPlaceholderData: d,
|
|
1000
1010
|
isRefetchError: H && x,
|
|
1001
|
-
isStale:
|
|
1011
|
+
isStale: mt(e, t),
|
|
1002
1012
|
refetch: this.refetch,
|
|
1003
1013
|
promise: this.#o,
|
|
1004
1014
|
isEnabled: K(t.enabled, e) !== !1
|
|
@@ -1066,29 +1076,29 @@ var Sr = class extends Se {
|
|
|
1066
1076
|
});
|
|
1067
1077
|
}
|
|
1068
1078
|
};
|
|
1069
|
-
function
|
|
1079
|
+
function Ar(e, t) {
|
|
1070
1080
|
return K(t.enabled, e) !== !1 && e.state.data === void 0 && !(e.state.status === "error" && t.retryOnMount === !1);
|
|
1071
1081
|
}
|
|
1072
|
-
function
|
|
1073
|
-
return
|
|
1082
|
+
function Ct(e, t) {
|
|
1083
|
+
return Ar(e, t) || e.state.data !== void 0 && ot(e, t, t.refetchOnMount);
|
|
1074
1084
|
}
|
|
1075
1085
|
function ot(e, t, s) {
|
|
1076
1086
|
if (K(t.enabled, e) !== !1 && te(t.staleTime, e) !== "static") {
|
|
1077
1087
|
const r = typeof s == "function" ? s(e) : s;
|
|
1078
|
-
return r === "always" || r !== !1 &&
|
|
1088
|
+
return r === "always" || r !== !1 && mt(e, t);
|
|
1079
1089
|
}
|
|
1080
1090
|
return !1;
|
|
1081
1091
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return (e !== t || K(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") &&
|
|
1092
|
+
function Pt(e, t, s, r) {
|
|
1093
|
+
return (e !== t || K(r.enabled, e) === !1) && (!s.suspense || e.state.status !== "error") && mt(e, s);
|
|
1084
1094
|
}
|
|
1085
|
-
function
|
|
1095
|
+
function mt(e, t) {
|
|
1086
1096
|
return K(t.enabled, e) !== !1 && e.isStaleByTime(te(t.staleTime, e));
|
|
1087
1097
|
}
|
|
1088
|
-
function
|
|
1098
|
+
function vr(e, t) {
|
|
1089
1099
|
return !De(e.getCurrentResult(), t);
|
|
1090
1100
|
}
|
|
1091
|
-
function
|
|
1101
|
+
function Mt(e) {
|
|
1092
1102
|
return {
|
|
1093
1103
|
onFetch: (t, s) => {
|
|
1094
1104
|
const r = t.options, n = t.fetchOptions?.meta?.fetchMore?.direction, i = t.state.data?.pages || [], a = t.state.data?.pageParams || [];
|
|
@@ -1096,13 +1106,12 @@ function Pt(e) {
|
|
|
1096
1106
|
const h = async () => {
|
|
1097
1107
|
let u = !1;
|
|
1098
1108
|
const d = (f) => {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
}, l = us(t.options, t.fetchOptions), p = async (f, y, _) => {
|
|
1109
|
+
pr(
|
|
1110
|
+
f,
|
|
1111
|
+
() => t.signal,
|
|
1112
|
+
() => u = !0
|
|
1113
|
+
);
|
|
1114
|
+
}, l = ls(t.options, t.fetchOptions), p = async (f, y, O) => {
|
|
1106
1115
|
if (u)
|
|
1107
1116
|
return Promise.reject();
|
|
1108
1117
|
if (y == null && f.pages.length)
|
|
@@ -1112,26 +1121,26 @@ function Pt(e) {
|
|
|
1112
1121
|
client: t.client,
|
|
1113
1122
|
queryKey: t.queryKey,
|
|
1114
1123
|
pageParam: y,
|
|
1115
|
-
direction:
|
|
1124
|
+
direction: O ? "backward" : "forward",
|
|
1116
1125
|
meta: t.options.meta
|
|
1117
1126
|
};
|
|
1118
1127
|
return d(we), we;
|
|
1119
|
-
})(), H = await l(L), { maxPages: G } = t.options, x =
|
|
1128
|
+
})(), H = await l(L), { maxPages: G } = t.options, x = O ? fr : hr;
|
|
1120
1129
|
return {
|
|
1121
1130
|
pages: x(f.pages, H, G),
|
|
1122
1131
|
pageParams: x(f.pageParams, y, G)
|
|
1123
1132
|
};
|
|
1124
1133
|
};
|
|
1125
1134
|
if (n && i.length) {
|
|
1126
|
-
const f = n === "backward", y = f ?
|
|
1135
|
+
const f = n === "backward", y = f ? Rr : kt, O = {
|
|
1127
1136
|
pages: i,
|
|
1128
1137
|
pageParams: a
|
|
1129
|
-
}, b = y(r,
|
|
1130
|
-
o = await p(
|
|
1138
|
+
}, b = y(r, O);
|
|
1139
|
+
o = await p(O, b, f);
|
|
1131
1140
|
} else {
|
|
1132
1141
|
const f = e ?? i.length;
|
|
1133
1142
|
do {
|
|
1134
|
-
const y = c === 0 ? a[0] ?? r.initialPageParam :
|
|
1143
|
+
const y = c === 0 ? a[0] ?? r.initialPageParam : kt(r, o);
|
|
1135
1144
|
if (c > 0 && y == null)
|
|
1136
1145
|
break;
|
|
1137
1146
|
o = await p(o, y), c++;
|
|
@@ -1152,7 +1161,7 @@ function Pt(e) {
|
|
|
1152
1161
|
}
|
|
1153
1162
|
};
|
|
1154
1163
|
}
|
|
1155
|
-
function
|
|
1164
|
+
function kt(e, { pages: t, pageParams: s }) {
|
|
1156
1165
|
const r = t.length - 1;
|
|
1157
1166
|
return t.length > 0 ? e.getNextPageParam(
|
|
1158
1167
|
t[r],
|
|
@@ -1161,10 +1170,10 @@ function Mt(e, { pages: t, pageParams: s }) {
|
|
|
1161
1170
|
s
|
|
1162
1171
|
) : void 0;
|
|
1163
1172
|
}
|
|
1164
|
-
function
|
|
1173
|
+
function Rr(e, { pages: t, pageParams: s }) {
|
|
1165
1174
|
return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, s[0], s) : void 0;
|
|
1166
1175
|
}
|
|
1167
|
-
var
|
|
1176
|
+
var br = class extends fs {
|
|
1168
1177
|
#e;
|
|
1169
1178
|
#t;
|
|
1170
1179
|
#s;
|
|
@@ -1270,34 +1279,50 @@ var vr = class extends fs {
|
|
|
1270
1279
|
), this.#r({ type: "success", data: i }), i;
|
|
1271
1280
|
} catch (i) {
|
|
1272
1281
|
try {
|
|
1273
|
-
|
|
1282
|
+
await this.#s.config.onError?.(
|
|
1274
1283
|
i,
|
|
1275
1284
|
e,
|
|
1276
1285
|
this.state.context,
|
|
1277
1286
|
this,
|
|
1278
1287
|
s
|
|
1279
|
-
)
|
|
1288
|
+
);
|
|
1289
|
+
} catch (a) {
|
|
1290
|
+
Promise.reject(a);
|
|
1291
|
+
}
|
|
1292
|
+
try {
|
|
1293
|
+
await this.options.onError?.(
|
|
1280
1294
|
i,
|
|
1281
1295
|
e,
|
|
1282
1296
|
this.state.context,
|
|
1283
1297
|
s
|
|
1284
|
-
)
|
|
1298
|
+
);
|
|
1299
|
+
} catch (a) {
|
|
1300
|
+
Promise.reject(a);
|
|
1301
|
+
}
|
|
1302
|
+
try {
|
|
1303
|
+
await this.#s.config.onSettled?.(
|
|
1285
1304
|
void 0,
|
|
1286
1305
|
i,
|
|
1287
1306
|
this.state.variables,
|
|
1288
1307
|
this.state.context,
|
|
1289
1308
|
this,
|
|
1290
1309
|
s
|
|
1291
|
-
)
|
|
1310
|
+
);
|
|
1311
|
+
} catch (a) {
|
|
1312
|
+
Promise.reject(a);
|
|
1313
|
+
}
|
|
1314
|
+
try {
|
|
1315
|
+
await this.options.onSettled?.(
|
|
1292
1316
|
void 0,
|
|
1293
1317
|
i,
|
|
1294
1318
|
e,
|
|
1295
1319
|
this.state.context,
|
|
1296
1320
|
s
|
|
1297
|
-
)
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1321
|
+
);
|
|
1322
|
+
} catch (a) {
|
|
1323
|
+
Promise.reject(a);
|
|
1300
1324
|
}
|
|
1325
|
+
throw this.#r({ type: "error", error: i }), i;
|
|
1301
1326
|
} finally {
|
|
1302
1327
|
this.#s.runNext(this);
|
|
1303
1328
|
}
|
|
@@ -1380,7 +1405,7 @@ function ys() {
|
|
|
1380
1405
|
submittedAt: 0
|
|
1381
1406
|
};
|
|
1382
1407
|
}
|
|
1383
|
-
var
|
|
1408
|
+
var Ir = class extends Se {
|
|
1384
1409
|
constructor(e = {}) {
|
|
1385
1410
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#s = 0;
|
|
1386
1411
|
}
|
|
@@ -1388,7 +1413,7 @@ var Rr = class extends Se {
|
|
|
1388
1413
|
#t;
|
|
1389
1414
|
#s;
|
|
1390
1415
|
build(e, t, s) {
|
|
1391
|
-
const r = new
|
|
1416
|
+
const r = new br({
|
|
1392
1417
|
client: e,
|
|
1393
1418
|
mutationCache: this,
|
|
1394
1419
|
mutationId: ++this.#s,
|
|
@@ -1399,7 +1424,7 @@ var Rr = class extends Se {
|
|
|
1399
1424
|
}
|
|
1400
1425
|
add(e) {
|
|
1401
1426
|
this.#e.add(e);
|
|
1402
|
-
const t =
|
|
1427
|
+
const t = _e(e);
|
|
1403
1428
|
if (typeof t == "string") {
|
|
1404
1429
|
const s = this.#t.get(t);
|
|
1405
1430
|
s ? s.push(e) : this.#t.set(t, [e]);
|
|
@@ -1408,7 +1433,7 @@ var Rr = class extends Se {
|
|
|
1408
1433
|
}
|
|
1409
1434
|
remove(e) {
|
|
1410
1435
|
if (this.#e.delete(e)) {
|
|
1411
|
-
const t =
|
|
1436
|
+
const t = _e(e);
|
|
1412
1437
|
if (typeof t == "string") {
|
|
1413
1438
|
const s = this.#t.get(t);
|
|
1414
1439
|
if (s)
|
|
@@ -1421,7 +1446,7 @@ var Rr = class extends Se {
|
|
|
1421
1446
|
this.notify({ type: "removed", mutation: e });
|
|
1422
1447
|
}
|
|
1423
1448
|
canRun(e) {
|
|
1424
|
-
const t =
|
|
1449
|
+
const t = _e(e);
|
|
1425
1450
|
if (typeof t == "string") {
|
|
1426
1451
|
const r = this.#t.get(t)?.find(
|
|
1427
1452
|
(n) => n.state.status === "pending"
|
|
@@ -1431,7 +1456,7 @@ var Rr = class extends Se {
|
|
|
1431
1456
|
return !0;
|
|
1432
1457
|
}
|
|
1433
1458
|
runNext(e) {
|
|
1434
|
-
const t =
|
|
1459
|
+
const t = _e(e);
|
|
1435
1460
|
return typeof t == "string" ? this.#t.get(t)?.find((r) => r !== e && r.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
|
|
1436
1461
|
}
|
|
1437
1462
|
clear() {
|
|
@@ -1447,11 +1472,11 @@ var Rr = class extends Se {
|
|
|
1447
1472
|
find(e) {
|
|
1448
1473
|
const t = { exact: !0, ...e };
|
|
1449
1474
|
return this.getAll().find(
|
|
1450
|
-
(s) =>
|
|
1475
|
+
(s) => Rt(t, s)
|
|
1451
1476
|
);
|
|
1452
1477
|
}
|
|
1453
1478
|
findAll(e = {}) {
|
|
1454
|
-
return this.getAll().filter((t) =>
|
|
1479
|
+
return this.getAll().filter((t) => Rt(e, t));
|
|
1455
1480
|
}
|
|
1456
1481
|
notify(e) {
|
|
1457
1482
|
A.batch(() => {
|
|
@@ -1469,10 +1494,10 @@ var Rr = class extends Se {
|
|
|
1469
1494
|
);
|
|
1470
1495
|
}
|
|
1471
1496
|
};
|
|
1472
|
-
function
|
|
1497
|
+
function _e(e) {
|
|
1473
1498
|
return e.options.scope?.id;
|
|
1474
1499
|
}
|
|
1475
|
-
var
|
|
1500
|
+
var Or = class extends Se {
|
|
1476
1501
|
#e;
|
|
1477
1502
|
#t = void 0;
|
|
1478
1503
|
#s;
|
|
@@ -1526,36 +1551,58 @@ var br = class extends Se {
|
|
|
1526
1551
|
meta: this.options.meta,
|
|
1527
1552
|
mutationKey: this.options.mutationKey
|
|
1528
1553
|
};
|
|
1529
|
-
e?.type === "success"
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
)
|
|
1554
|
+
if (e?.type === "success") {
|
|
1555
|
+
try {
|
|
1556
|
+
this.#n.onSuccess?.(
|
|
1557
|
+
e.data,
|
|
1558
|
+
t,
|
|
1559
|
+
s,
|
|
1560
|
+
r
|
|
1561
|
+
);
|
|
1562
|
+
} catch (n) {
|
|
1563
|
+
Promise.reject(n);
|
|
1564
|
+
}
|
|
1565
|
+
try {
|
|
1566
|
+
this.#n.onSettled?.(
|
|
1567
|
+
e.data,
|
|
1568
|
+
null,
|
|
1569
|
+
t,
|
|
1570
|
+
s,
|
|
1571
|
+
r
|
|
1572
|
+
);
|
|
1573
|
+
} catch (n) {
|
|
1574
|
+
Promise.reject(n);
|
|
1575
|
+
}
|
|
1576
|
+
} else if (e?.type === "error") {
|
|
1577
|
+
try {
|
|
1578
|
+
this.#n.onError?.(
|
|
1579
|
+
e.error,
|
|
1580
|
+
t,
|
|
1581
|
+
s,
|
|
1582
|
+
r
|
|
1583
|
+
);
|
|
1584
|
+
} catch (n) {
|
|
1585
|
+
Promise.reject(n);
|
|
1586
|
+
}
|
|
1587
|
+
try {
|
|
1588
|
+
this.#n.onSettled?.(
|
|
1589
|
+
void 0,
|
|
1590
|
+
e.error,
|
|
1591
|
+
t,
|
|
1592
|
+
s,
|
|
1593
|
+
r
|
|
1594
|
+
);
|
|
1595
|
+
} catch (n) {
|
|
1596
|
+
Promise.reject(n);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1552
1599
|
}
|
|
1553
1600
|
this.listeners.forEach((t) => {
|
|
1554
1601
|
t(this.#t);
|
|
1555
1602
|
});
|
|
1556
1603
|
});
|
|
1557
1604
|
}
|
|
1558
|
-
},
|
|
1605
|
+
}, _r = class extends Se {
|
|
1559
1606
|
constructor(e = {}) {
|
|
1560
1607
|
super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
|
|
1561
1608
|
}
|
|
@@ -1563,7 +1610,7 @@ var br = class extends Se {
|
|
|
1563
1610
|
build(e, t, s) {
|
|
1564
1611
|
const r = t.queryKey, n = t.queryHash ?? ft(r, t);
|
|
1565
1612
|
let i = this.get(n);
|
|
1566
|
-
return i || (i = new
|
|
1613
|
+
return i || (i = new wr({
|
|
1567
1614
|
client: e,
|
|
1568
1615
|
queryKey: r,
|
|
1569
1616
|
queryHash: n,
|
|
@@ -1598,12 +1645,12 @@ var br = class extends Se {
|
|
|
1598
1645
|
find(e) {
|
|
1599
1646
|
const t = { exact: !0, ...e };
|
|
1600
1647
|
return this.getAll().find(
|
|
1601
|
-
(s) =>
|
|
1648
|
+
(s) => vt(t, s)
|
|
1602
1649
|
);
|
|
1603
1650
|
}
|
|
1604
1651
|
findAll(e = {}) {
|
|
1605
1652
|
const t = this.getAll();
|
|
1606
|
-
return Object.keys(e).length > 0 ? t.filter((s) =>
|
|
1653
|
+
return Object.keys(e).length > 0 ? t.filter((s) => vt(e, s)) : t;
|
|
1607
1654
|
}
|
|
1608
1655
|
notify(e) {
|
|
1609
1656
|
A.batch(() => {
|
|
@@ -1626,7 +1673,7 @@ var br = class extends Se {
|
|
|
1626
1673
|
});
|
|
1627
1674
|
});
|
|
1628
1675
|
}
|
|
1629
|
-
},
|
|
1676
|
+
}, Cr = class {
|
|
1630
1677
|
#e;
|
|
1631
1678
|
#t;
|
|
1632
1679
|
#s;
|
|
@@ -1636,10 +1683,10 @@ var br = class extends Se {
|
|
|
1636
1683
|
#o;
|
|
1637
1684
|
#i;
|
|
1638
1685
|
constructor(e = {}) {
|
|
1639
|
-
this.#e = e.queryCache || new
|
|
1686
|
+
this.#e = e.queryCache || new _r(), this.#t = e.mutationCache || new Ir(), this.#s = e.defaultOptions || {}, this.#n = /* @__PURE__ */ new Map(), this.#r = /* @__PURE__ */ new Map(), this.#a = 0;
|
|
1640
1687
|
}
|
|
1641
1688
|
mount() {
|
|
1642
|
-
this.#a++, this.#a === 1 && (this.#o =
|
|
1689
|
+
this.#a++, this.#a === 1 && (this.#o = yt.subscribe(async (e) => {
|
|
1643
1690
|
e && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
1644
1691
|
}), this.#i = Ue.subscribe(async (e) => {
|
|
1645
1692
|
e && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
@@ -1678,7 +1725,7 @@ var br = class extends Se {
|
|
|
1678
1725
|
setQueryData(e, t, s) {
|
|
1679
1726
|
const r = this.defaultQueryOptions({ queryKey: e }), i = this.#e.get(
|
|
1680
1727
|
r.queryHash
|
|
1681
|
-
)?.state.data, a =
|
|
1728
|
+
)?.state.data, a = ur(t, i);
|
|
1682
1729
|
if (a !== void 0)
|
|
1683
1730
|
return this.#e.build(this, r).setData(a, { ...s, manual: !0 });
|
|
1684
1731
|
}
|
|
@@ -1757,13 +1804,13 @@ var br = class extends Se {
|
|
|
1757
1804
|
return this.fetchQuery(e).then(U).catch(U);
|
|
1758
1805
|
}
|
|
1759
1806
|
fetchInfiniteQuery(e) {
|
|
1760
|
-
return e.behavior =
|
|
1807
|
+
return e.behavior = Mt(e.pages), this.fetchQuery(e);
|
|
1761
1808
|
}
|
|
1762
1809
|
prefetchInfiniteQuery(e) {
|
|
1763
1810
|
return this.fetchInfiniteQuery(e).then(U).catch(U);
|
|
1764
1811
|
}
|
|
1765
1812
|
ensureInfiniteQueryData(e) {
|
|
1766
|
-
return e.behavior =
|
|
1813
|
+
return e.behavior = Mt(e.pages), this.ensureQueryData(e);
|
|
1767
1814
|
}
|
|
1768
1815
|
resumePausedMutations() {
|
|
1769
1816
|
return Ue.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
@@ -1836,13 +1883,13 @@ var br = class extends Se {
|
|
|
1836
1883
|
if (!t)
|
|
1837
1884
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1838
1885
|
return t;
|
|
1839
|
-
},
|
|
1886
|
+
}, Pr = ({
|
|
1840
1887
|
client: e,
|
|
1841
1888
|
children: t
|
|
1842
1889
|
}) => (D.useEffect(() => (e.mount(), () => {
|
|
1843
1890
|
e.unmount();
|
|
1844
|
-
}), [e]), /* @__PURE__ */ S(ms.Provider, { value: e, children: t })),
|
|
1845
|
-
function
|
|
1891
|
+
}), [e]), /* @__PURE__ */ S(ms.Provider, { value: e, children: t })), Mr = D.createContext(!1), kr = () => D.useContext(Mr);
|
|
1892
|
+
function $r() {
|
|
1846
1893
|
let e = !1;
|
|
1847
1894
|
return {
|
|
1848
1895
|
clearReset: () => {
|
|
@@ -1854,19 +1901,20 @@ function Mr() {
|
|
|
1854
1901
|
isReset: () => e
|
|
1855
1902
|
};
|
|
1856
1903
|
}
|
|
1857
|
-
var
|
|
1858
|
-
|
|
1859
|
-
|
|
1904
|
+
var Dr = D.createContext($r()), Nr = () => D.useContext(Dr), Ur = (e, t, s) => {
|
|
1905
|
+
const r = s?.state.error && typeof e.throwOnError == "function" ? pt(e.throwOnError, [s.state.error, s]) : e.throwOnError;
|
|
1906
|
+
(e.suspense || e.experimental_prefetchInRender || r) && (t.isReset() || (e.retryOnMount = !1));
|
|
1907
|
+
}, Lr = (e) => {
|
|
1860
1908
|
D.useEffect(() => {
|
|
1861
1909
|
e.clearReset();
|
|
1862
1910
|
}, [e]);
|
|
1863
|
-
},
|
|
1911
|
+
}, Fr = ({
|
|
1864
1912
|
result: e,
|
|
1865
1913
|
errorResetBoundary: t,
|
|
1866
1914
|
throwOnError: s,
|
|
1867
1915
|
query: r,
|
|
1868
1916
|
suspense: n
|
|
1869
|
-
}) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 ||
|
|
1917
|
+
}) => e.isError && !t.isReset() && !e.isFetching && r && (n && e.data === void 0 || pt(s, [e.error, r])), Kr = (e) => {
|
|
1870
1918
|
if (e.suspense) {
|
|
1871
1919
|
const s = (n) => n === "static" ? n : Math.max(n ?? 1e3, 1e3), r = e.staleTime;
|
|
1872
1920
|
e.staleTime = typeof r == "function" ? (...n) => s(r(...n)) : s(r), typeof e.gcTime == "number" && (e.gcTime = Math.max(
|
|
@@ -1874,67 +1922,69 @@ var kr = D.createContext(Mr()), $r = () => D.useContext(kr), Dr = (e, t) => {
|
|
|
1874
1922
|
1e3
|
|
1875
1923
|
));
|
|
1876
1924
|
}
|
|
1877
|
-
},
|
|
1925
|
+
}, Hr = (e, t) => e.isLoading && e.isFetching && !t, Gr = (e, t) => e?.suspense && t.isPending, $t = (e, t, s) => t.fetchOptimistic(e).catch(() => {
|
|
1878
1926
|
s.clearReset();
|
|
1879
1927
|
});
|
|
1880
|
-
function
|
|
1928
|
+
function xr(e, t, s) {
|
|
1881
1929
|
if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
|
|
1882
1930
|
throw new Error(
|
|
1883
1931
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
1884
1932
|
);
|
|
1885
|
-
const r =
|
|
1933
|
+
const r = kr(), n = Nr(), i = V(), a = i.defaultQueryOptions(e);
|
|
1886
1934
|
i.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
1887
1935
|
a
|
|
1888
|
-
)
|
|
1936
|
+
);
|
|
1937
|
+
const o = i.getQueryCache().get(a.queryHash);
|
|
1938
|
+
process.env.NODE_ENV !== "production" && (a.queryFn || console.error(
|
|
1889
1939
|
`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
1890
|
-
)), a._optimisticResults = r ? "isRestoring" : "optimistic",
|
|
1891
|
-
const
|
|
1940
|
+
)), a._optimisticResults = r ? "isRestoring" : "optimistic", Kr(a), Ur(a, n, o), Lr(n);
|
|
1941
|
+
const c = !i.getQueryCache().get(a.queryHash), [h] = D.useState(
|
|
1892
1942
|
() => new t(
|
|
1893
1943
|
i,
|
|
1894
1944
|
a
|
|
1895
1945
|
)
|
|
1896
|
-
),
|
|
1946
|
+
), u = h.getOptimisticResult(a), d = !r && e.subscribed !== !1;
|
|
1897
1947
|
if (D.useSyncExternalStore(
|
|
1898
1948
|
D.useCallback(
|
|
1899
|
-
(
|
|
1900
|
-
const
|
|
1901
|
-
return
|
|
1949
|
+
(l) => {
|
|
1950
|
+
const p = d ? h.subscribe(A.batchCalls(l)) : U;
|
|
1951
|
+
return h.updateResult(), p;
|
|
1902
1952
|
},
|
|
1903
|
-
[
|
|
1953
|
+
[h, d]
|
|
1904
1954
|
),
|
|
1905
|
-
() =>
|
|
1906
|
-
() =>
|
|
1955
|
+
() => h.getCurrentResult(),
|
|
1956
|
+
() => h.getCurrentResult()
|
|
1907
1957
|
), D.useEffect(() => {
|
|
1908
|
-
|
|
1909
|
-
}, [a,
|
|
1910
|
-
throw
|
|
1911
|
-
if (
|
|
1912
|
-
result:
|
|
1958
|
+
h.setOptions(a);
|
|
1959
|
+
}, [a, h]), Gr(a, u))
|
|
1960
|
+
throw $t(a, h, n);
|
|
1961
|
+
if (Fr({
|
|
1962
|
+
result: u,
|
|
1913
1963
|
errorResetBoundary: n,
|
|
1914
1964
|
throwOnError: a.throwOnError,
|
|
1915
|
-
query:
|
|
1965
|
+
query: o,
|
|
1916
1966
|
suspense: a.suspense
|
|
1917
1967
|
}))
|
|
1918
|
-
throw
|
|
1968
|
+
throw u.error;
|
|
1919
1969
|
return i.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
1920
1970
|
a,
|
|
1921
|
-
|
|
1922
|
-
), a.experimental_prefetchInRender && !ne &&
|
|
1971
|
+
u
|
|
1972
|
+
), a.experimental_prefetchInRender && !ne && Hr(u, r) && (c ? (
|
|
1923
1973
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1924
|
-
|
|
1974
|
+
$t(a, h, n)
|
|
1925
1975
|
) : (
|
|
1926
1976
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1927
|
-
|
|
1977
|
+
o?.promise
|
|
1928
1978
|
))?.catch(U).finally(() => {
|
|
1929
|
-
|
|
1930
|
-
}), a.notifyOnChangeProps ?
|
|
1979
|
+
h.updateResult();
|
|
1980
|
+
}), a.notifyOnChangeProps ? u : h.trackResult(u);
|
|
1931
1981
|
}
|
|
1932
1982
|
function X(e, t) {
|
|
1933
|
-
return
|
|
1983
|
+
return xr(e, Tr);
|
|
1934
1984
|
}
|
|
1935
1985
|
function se(e, t) {
|
|
1936
1986
|
const s = V(), [r] = D.useState(
|
|
1937
|
-
() => new
|
|
1987
|
+
() => new Or(
|
|
1938
1988
|
s,
|
|
1939
1989
|
e
|
|
1940
1990
|
)
|
|
@@ -1955,7 +2005,7 @@ function se(e, t) {
|
|
|
1955
2005
|
},
|
|
1956
2006
|
[r]
|
|
1957
2007
|
);
|
|
1958
|
-
if (n.error &&
|
|
2008
|
+
if (n.error && pt(r.options.throwOnError, [n.error]))
|
|
1959
2009
|
throw n.error;
|
|
1960
2010
|
return { ...n, mutate: i, mutateAsync: n.mutate };
|
|
1961
2011
|
}
|
|
@@ -1982,7 +2032,7 @@ const Ae = {
|
|
|
1982
2032
|
NONCE_KEY: "_nonce",
|
|
1983
2033
|
AUTH_TYPE_KEY: "auth_type",
|
|
1984
2034
|
ISSUER: "gizmette.com"
|
|
1985
|
-
},
|
|
2035
|
+
}, qr = `-----BEGIN PUBLIC KEY-----
|
|
1986
2036
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
|
|
1987
2037
|
w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
|
|
1988
2038
|
i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
|
|
@@ -1995,15 +2045,15 @@ awIDAQAB
|
|
|
1995
2045
|
LOGOUT: "logout",
|
|
1996
2046
|
LOGIN: "login",
|
|
1997
2047
|
REFRESH: "refresh"
|
|
1998
|
-
},
|
|
1999
|
-
function
|
|
2048
|
+
}, Dt = new TextEncoder(), ge = new TextDecoder();
|
|
2049
|
+
function Br(...e) {
|
|
2000
2050
|
const t = e.reduce((n, { length: i }) => n + i, 0), s = new Uint8Array(t);
|
|
2001
2051
|
let r = 0;
|
|
2002
2052
|
for (const n of e)
|
|
2003
2053
|
s.set(n, r), r += n.length;
|
|
2004
2054
|
return s;
|
|
2005
2055
|
}
|
|
2006
|
-
function
|
|
2056
|
+
function je(e) {
|
|
2007
2057
|
const t = new Uint8Array(e.length);
|
|
2008
2058
|
for (let s = 0; s < e.length; s++) {
|
|
2009
2059
|
const r = e.charCodeAt(s);
|
|
@@ -2049,7 +2099,7 @@ let ae = class extends Error {
|
|
|
2049
2099
|
constructor(t, s, r = "unspecified", n = "unspecified") {
|
|
2050
2100
|
super(t, { cause: { claim: r, reason: n, payload: s } }), this.claim = r, this.reason = n, this.payload = s;
|
|
2051
2101
|
}
|
|
2052
|
-
},
|
|
2102
|
+
}, Nt = class extends ae {
|
|
2053
2103
|
static code = "ERR_JWT_EXPIRED";
|
|
2054
2104
|
code = "ERR_JWT_EXPIRED";
|
|
2055
2105
|
claim;
|
|
@@ -2059,7 +2109,7 @@ let ae = class extends Error {
|
|
|
2059
2109
|
super(t, { cause: { claim: r, reason: n, payload: s } }), this.claim = r, this.reason = n, this.payload = s;
|
|
2060
2110
|
}
|
|
2061
2111
|
};
|
|
2062
|
-
class
|
|
2112
|
+
class jr extends ae {
|
|
2063
2113
|
static code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
2064
2114
|
code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
2065
2115
|
}
|
|
@@ -2075,7 +2125,7 @@ class Y extends ae {
|
|
|
2075
2125
|
static code = "ERR_JWT_INVALID";
|
|
2076
2126
|
code = "ERR_JWT_INVALID";
|
|
2077
2127
|
}
|
|
2078
|
-
let
|
|
2128
|
+
let Qr = class extends ae {
|
|
2079
2129
|
static code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2080
2130
|
code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
2081
2131
|
constructor(t = "signature verification failed", s) {
|
|
@@ -2083,10 +2133,10 @@ let Br = class extends ae {
|
|
|
2083
2133
|
}
|
|
2084
2134
|
};
|
|
2085
2135
|
const B = (e, t = "algorithm.name") => new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`), le = (e, t) => e.name === t;
|
|
2086
|
-
function
|
|
2136
|
+
function Qe(e) {
|
|
2087
2137
|
return parseInt(e.name.slice(4), 10);
|
|
2088
2138
|
}
|
|
2089
|
-
function
|
|
2139
|
+
function Wr(e) {
|
|
2090
2140
|
switch (e) {
|
|
2091
2141
|
case "ES256":
|
|
2092
2142
|
return "P-256";
|
|
@@ -2098,11 +2148,11 @@ function Qr(e) {
|
|
|
2098
2148
|
throw new Error("unreachable");
|
|
2099
2149
|
}
|
|
2100
2150
|
}
|
|
2101
|
-
function
|
|
2151
|
+
function Vr(e, t) {
|
|
2102
2152
|
if (!e.usages.includes(t))
|
|
2103
2153
|
throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`);
|
|
2104
2154
|
}
|
|
2105
|
-
function
|
|
2155
|
+
function Jr(e, t, s) {
|
|
2106
2156
|
switch (t) {
|
|
2107
2157
|
case "HS256":
|
|
2108
2158
|
case "HS384":
|
|
@@ -2110,7 +2160,7 @@ function Wr(e, t, s) {
|
|
|
2110
2160
|
if (!le(e.algorithm, "HMAC"))
|
|
2111
2161
|
throw B("HMAC");
|
|
2112
2162
|
const r = parseInt(t.slice(2), 10);
|
|
2113
|
-
if (
|
|
2163
|
+
if (Qe(e.algorithm.hash) !== r)
|
|
2114
2164
|
throw B(`SHA-${r}`, "algorithm.hash");
|
|
2115
2165
|
break;
|
|
2116
2166
|
}
|
|
@@ -2120,7 +2170,7 @@ function Wr(e, t, s) {
|
|
|
2120
2170
|
if (!le(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
2121
2171
|
throw B("RSASSA-PKCS1-v1_5");
|
|
2122
2172
|
const r = parseInt(t.slice(2), 10);
|
|
2123
|
-
if (
|
|
2173
|
+
if (Qe(e.algorithm.hash) !== r)
|
|
2124
2174
|
throw B(`SHA-${r}`, "algorithm.hash");
|
|
2125
2175
|
break;
|
|
2126
2176
|
}
|
|
@@ -2130,7 +2180,7 @@ function Wr(e, t, s) {
|
|
|
2130
2180
|
if (!le(e.algorithm, "RSA-PSS"))
|
|
2131
2181
|
throw B("RSA-PSS");
|
|
2132
2182
|
const r = parseInt(t.slice(2), 10);
|
|
2133
|
-
if (
|
|
2183
|
+
if (Qe(e.algorithm.hash) !== r)
|
|
2134
2184
|
throw B(`SHA-${r}`, "algorithm.hash");
|
|
2135
2185
|
break;
|
|
2136
2186
|
}
|
|
@@ -2152,7 +2202,7 @@ function Wr(e, t, s) {
|
|
|
2152
2202
|
case "ES512": {
|
|
2153
2203
|
if (!le(e.algorithm, "ECDSA"))
|
|
2154
2204
|
throw B("ECDSA");
|
|
2155
|
-
const r =
|
|
2205
|
+
const r = Wr(t);
|
|
2156
2206
|
if (e.algorithm.namedCurve !== r)
|
|
2157
2207
|
throw B(r, "algorithm.namedCurve");
|
|
2158
2208
|
break;
|
|
@@ -2160,7 +2210,7 @@ function Wr(e, t, s) {
|
|
|
2160
2210
|
default:
|
|
2161
2211
|
throw new TypeError("CryptoKey does not support this operation");
|
|
2162
2212
|
}
|
|
2163
|
-
|
|
2213
|
+
Vr(e, s);
|
|
2164
2214
|
}
|
|
2165
2215
|
function Ss(e, t, ...s) {
|
|
2166
2216
|
if (s = s.filter(Boolean), s.length > 2) {
|
|
@@ -2169,7 +2219,7 @@ function Ss(e, t, ...s) {
|
|
|
2169
2219
|
} else s.length === 2 ? e += `one of type ${s[0]} or ${s[1]}.` : e += `of type ${s[0]}.`;
|
|
2170
2220
|
return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && t.constructor?.name && (e += ` Received an instance of ${t.constructor.name}`), e;
|
|
2171
2221
|
}
|
|
2172
|
-
const
|
|
2222
|
+
const Yr = (e, ...t) => Ss("Key must be ", e, ...t), ws = (e, t, ...s) => Ss(`Key for the ${e} algorithm must be `, t, ...s), Ts = (e) => {
|
|
2173
2223
|
if (e?.[Symbol.toStringTag] === "CryptoKey")
|
|
2174
2224
|
return !0;
|
|
2175
2225
|
try {
|
|
@@ -2178,7 +2228,7 @@ const Vr = (e, ...t) => Ss("Key must be ", e, ...t), ws = (e, t, ...s) => Ss(`Ke
|
|
|
2178
2228
|
return !1;
|
|
2179
2229
|
}
|
|
2180
2230
|
}, As = (e) => e?.[Symbol.toStringTag] === "KeyObject", vs = (e) => Ts(e) || As(e);
|
|
2181
|
-
function
|
|
2231
|
+
function zr(...e) {
|
|
2182
2232
|
const t = e.filter(Boolean);
|
|
2183
2233
|
if (t.length === 0 || t.length === 1)
|
|
2184
2234
|
return !0;
|
|
@@ -2197,9 +2247,9 @@ function Jr(...e) {
|
|
|
2197
2247
|
}
|
|
2198
2248
|
return !0;
|
|
2199
2249
|
}
|
|
2200
|
-
const
|
|
2250
|
+
const Xr = (e) => typeof e == "object" && e !== null;
|
|
2201
2251
|
function be(e) {
|
|
2202
|
-
if (!
|
|
2252
|
+
if (!Xr(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
2203
2253
|
return !1;
|
|
2204
2254
|
if (Object.getPrototypeOf(e) === null)
|
|
2205
2255
|
return !0;
|
|
@@ -2208,7 +2258,7 @@ function be(e) {
|
|
|
2208
2258
|
t = Object.getPrototypeOf(t);
|
|
2209
2259
|
return Object.getPrototypeOf(e) === t;
|
|
2210
2260
|
}
|
|
2211
|
-
function
|
|
2261
|
+
function Zr(e, t) {
|
|
2212
2262
|
if (e.startsWith("RS") || e.startsWith("PS")) {
|
|
2213
2263
|
const { modulusLength: s } = t.algorithm;
|
|
2214
2264
|
if (typeof s != "number" || s < 2048)
|
|
@@ -2222,7 +2272,7 @@ const We = (e, t) => {
|
|
|
2222
2272
|
if (e[s] !== t[s])
|
|
2223
2273
|
return !1;
|
|
2224
2274
|
return !0;
|
|
2225
|
-
},
|
|
2275
|
+
}, en = (e) => ({ data: e, pos: 0 }), Le = (e) => {
|
|
2226
2276
|
const t = e.data[e.pos++];
|
|
2227
2277
|
if (t & 128) {
|
|
2228
2278
|
const s = t & 127;
|
|
@@ -2238,18 +2288,18 @@ const We = (e, t) => {
|
|
|
2238
2288
|
}, Rs = (e, t) => {
|
|
2239
2289
|
const s = e.data.subarray(e.pos, e.pos + t);
|
|
2240
2290
|
return e.pos += t, s;
|
|
2241
|
-
},
|
|
2291
|
+
}, tn = (e) => {
|
|
2242
2292
|
Fe(e, 6, "Expected algorithm OID");
|
|
2243
2293
|
const t = Le(e);
|
|
2244
2294
|
return Rs(e, t);
|
|
2245
2295
|
};
|
|
2246
|
-
function
|
|
2296
|
+
function sn(e) {
|
|
2247
2297
|
Fe(e, 48, "Invalid SPKI structure"), Le(e), Fe(e, 48, "Expected algorithm identifier");
|
|
2248
2298
|
const t = Le(e);
|
|
2249
2299
|
return { algIdStart: e.pos, algIdLength: t };
|
|
2250
2300
|
}
|
|
2251
|
-
const
|
|
2252
|
-
const t =
|
|
2301
|
+
const rn = (e) => {
|
|
2302
|
+
const t = tn(e);
|
|
2253
2303
|
if (We(t, [43, 101, 110]))
|
|
2254
2304
|
return "X25519";
|
|
2255
2305
|
if (!We(t, [42, 134, 72, 206, 61, 2, 1]))
|
|
@@ -2264,7 +2314,7 @@ const tn = (e) => {
|
|
|
2264
2314
|
if (We(r, i))
|
|
2265
2315
|
return n;
|
|
2266
2316
|
throw new Error("Unsupported named curve");
|
|
2267
|
-
},
|
|
2317
|
+
}, nn = async (e, t, s, r) => {
|
|
2268
2318
|
let n, i;
|
|
2269
2319
|
const a = () => ["verify"], o = () => ["encrypt", "wrapKey"];
|
|
2270
2320
|
switch (s) {
|
|
@@ -2319,15 +2369,15 @@ const tn = (e) => {
|
|
|
2319
2369
|
throw new z('Invalid or unsupported "alg" (Algorithm) value');
|
|
2320
2370
|
}
|
|
2321
2371
|
return crypto.subtle.importKey(e, t, n, r?.extractable ?? !0, i);
|
|
2322
|
-
},
|
|
2323
|
-
const r =
|
|
2372
|
+
}, an = (e, t) => gs(e.replace(t, "")), on = (e, t, s) => {
|
|
2373
|
+
const r = an(e, /(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g);
|
|
2324
2374
|
let n = s;
|
|
2325
2375
|
return t?.startsWith?.("ECDH-ES") && (n ||= {}, n.getNamedCurve = (i) => {
|
|
2326
|
-
const a =
|
|
2327
|
-
return
|
|
2328
|
-
}),
|
|
2376
|
+
const a = en(i);
|
|
2377
|
+
return sn(a), rn(a);
|
|
2378
|
+
}), nn("spki", r, t, n);
|
|
2329
2379
|
};
|
|
2330
|
-
function
|
|
2380
|
+
function cn(e) {
|
|
2331
2381
|
let t, s;
|
|
2332
2382
|
switch (e.kty) {
|
|
2333
2383
|
case "AKP": {
|
|
@@ -2412,18 +2462,18 @@ function an(e) {
|
|
|
2412
2462
|
}
|
|
2413
2463
|
return { algorithm: t, keyUsages: s };
|
|
2414
2464
|
}
|
|
2415
|
-
async function
|
|
2465
|
+
async function un(e) {
|
|
2416
2466
|
if (!e.alg)
|
|
2417
2467
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
2418
|
-
const { algorithm: t, keyUsages: s } =
|
|
2468
|
+
const { algorithm: t, keyUsages: s } = cn(e), r = { ...e };
|
|
2419
2469
|
return r.kty !== "AKP" && delete r.alg, delete r.use, crypto.subtle.importKey("jwk", r, t, e.ext ?? !(e.d || e.priv), e.key_ops ?? s);
|
|
2420
2470
|
}
|
|
2421
|
-
async function
|
|
2471
|
+
async function ln(e, t, s) {
|
|
2422
2472
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
2423
2473
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
2424
|
-
return
|
|
2474
|
+
return on(e, t, s);
|
|
2425
2475
|
}
|
|
2426
|
-
function
|
|
2476
|
+
function dn(e, t, s, r, n) {
|
|
2427
2477
|
if (n.crit !== void 0 && r?.crit === void 0)
|
|
2428
2478
|
throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
2429
2479
|
if (!r || r.crit === void 0)
|
|
@@ -2442,22 +2492,22 @@ function un(e, t, s, r, n) {
|
|
|
2442
2492
|
}
|
|
2443
2493
|
return new Set(r.crit);
|
|
2444
2494
|
}
|
|
2445
|
-
function
|
|
2495
|
+
function hn(e, t) {
|
|
2446
2496
|
if (t !== void 0 && (!Array.isArray(t) || t.some((s) => typeof s != "string")))
|
|
2447
2497
|
throw new TypeError(`"${e}" option must be an array of strings`);
|
|
2448
2498
|
if (t)
|
|
2449
2499
|
return new Set(t);
|
|
2450
2500
|
}
|
|
2451
|
-
const
|
|
2501
|
+
const Et = (e) => be(e) && typeof e.kty == "string", fn = (e) => e.kty !== "oct" && (e.kty === "AKP" && typeof e.priv == "string" || typeof e.d == "string"), pn = (e) => e.kty !== "oct" && e.d === void 0 && e.priv === void 0, yn = (e) => e.kty === "oct" && typeof e.k == "string";
|
|
2452
2502
|
let Ee;
|
|
2453
|
-
const
|
|
2503
|
+
const Ut = async (e, t, s, r = !1) => {
|
|
2454
2504
|
Ee ||= /* @__PURE__ */ new WeakMap();
|
|
2455
2505
|
let n = Ee.get(e);
|
|
2456
2506
|
if (n?.[s])
|
|
2457
2507
|
return n[s];
|
|
2458
|
-
const i = await
|
|
2508
|
+
const i = await un({ ...t, alg: s });
|
|
2459
2509
|
return r && Object.freeze(e), n ? n[s] = i : Ee.set(e, { [s]: i }), i;
|
|
2460
|
-
},
|
|
2510
|
+
}, mn = (e, t) => {
|
|
2461
2511
|
Ee ||= /* @__PURE__ */ new WeakMap();
|
|
2462
2512
|
let s = Ee.get(e);
|
|
2463
2513
|
if (s?.[t])
|
|
@@ -2554,7 +2604,7 @@ const Nt = async (e, t, s, r = !1) => {
|
|
|
2554
2604
|
throw new TypeError("given KeyObject instance cannot be used for this algorithm");
|
|
2555
2605
|
return s ? s[t] = i : Ee.set(e, { [t]: i }), i;
|
|
2556
2606
|
};
|
|
2557
|
-
async function
|
|
2607
|
+
async function En(e, t) {
|
|
2558
2608
|
if (e instanceof Uint8Array || Ts(e))
|
|
2559
2609
|
return e;
|
|
2560
2610
|
if (As(e)) {
|
|
@@ -2562,16 +2612,16 @@ async function yn(e, t) {
|
|
|
2562
2612
|
return e.export();
|
|
2563
2613
|
if ("toCryptoKey" in e && typeof e.toCryptoKey == "function")
|
|
2564
2614
|
try {
|
|
2565
|
-
return
|
|
2615
|
+
return mn(e, t);
|
|
2566
2616
|
} catch (r) {
|
|
2567
2617
|
if (r instanceof TypeError)
|
|
2568
2618
|
throw r;
|
|
2569
2619
|
}
|
|
2570
2620
|
let s = e.export({ format: "jwk" });
|
|
2571
|
-
return
|
|
2621
|
+
return Ut(e, s, t);
|
|
2572
2622
|
}
|
|
2573
|
-
if (
|
|
2574
|
-
return e.k ? ve(e.k) :
|
|
2623
|
+
if (Et(e))
|
|
2624
|
+
return e.k ? ve(e.k) : Ut(e, e, t, !0);
|
|
2575
2625
|
throw new Error("unreachable");
|
|
2576
2626
|
}
|
|
2577
2627
|
const ye = (e) => e?.[Symbol.toStringTag], ct = (e, t, s) => {
|
|
@@ -2617,10 +2667,10 @@ const ye = (e) => e?.[Symbol.toStringTag], ct = (e, t, s) => {
|
|
|
2617
2667
|
throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${r}" when present`);
|
|
2618
2668
|
}
|
|
2619
2669
|
return !0;
|
|
2620
|
-
},
|
|
2670
|
+
}, gn = (e, t, s) => {
|
|
2621
2671
|
if (!(t instanceof Uint8Array)) {
|
|
2622
|
-
if (
|
|
2623
|
-
if (
|
|
2672
|
+
if (Et(t)) {
|
|
2673
|
+
if (yn(t) && ct(e, t, s))
|
|
2624
2674
|
return;
|
|
2625
2675
|
throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');
|
|
2626
2676
|
}
|
|
@@ -2629,17 +2679,17 @@ const ye = (e) => e?.[Symbol.toStringTag], ct = (e, t, s) => {
|
|
|
2629
2679
|
if (t.type !== "secret")
|
|
2630
2680
|
throw new TypeError(`${ye(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
2631
2681
|
}
|
|
2632
|
-
},
|
|
2633
|
-
if (
|
|
2682
|
+
}, Sn = (e, t, s) => {
|
|
2683
|
+
if (Et(t))
|
|
2634
2684
|
switch (s) {
|
|
2635
2685
|
case "decrypt":
|
|
2636
2686
|
case "sign":
|
|
2637
|
-
if (
|
|
2687
|
+
if (fn(t) && ct(e, t, s))
|
|
2638
2688
|
return;
|
|
2639
2689
|
throw new TypeError("JSON Web Key for this operation be a private JWK");
|
|
2640
2690
|
case "encrypt":
|
|
2641
2691
|
case "verify":
|
|
2642
|
-
if (
|
|
2692
|
+
if (pn(t) && ct(e, t, s))
|
|
2643
2693
|
return;
|
|
2644
2694
|
throw new TypeError("JSON Web Key for this operation be a public JWK");
|
|
2645
2695
|
}
|
|
@@ -2662,20 +2712,20 @@ const ye = (e) => e?.[Symbol.toStringTag], ct = (e, t, s) => {
|
|
|
2662
2712
|
throw new TypeError(`${ye(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
2663
2713
|
}
|
|
2664
2714
|
};
|
|
2665
|
-
function
|
|
2715
|
+
function wn(e, t, s) {
|
|
2666
2716
|
switch (e.substring(0, 2)) {
|
|
2667
2717
|
case "A1":
|
|
2668
2718
|
case "A2":
|
|
2669
2719
|
case "di":
|
|
2670
2720
|
case "HS":
|
|
2671
2721
|
case "PB":
|
|
2672
|
-
|
|
2722
|
+
gn(e, t, s);
|
|
2673
2723
|
break;
|
|
2674
2724
|
default:
|
|
2675
|
-
|
|
2725
|
+
Sn(e, t, s);
|
|
2676
2726
|
}
|
|
2677
2727
|
}
|
|
2678
|
-
function
|
|
2728
|
+
function Tn(e, t) {
|
|
2679
2729
|
const s = `SHA-${e.slice(-3)}`;
|
|
2680
2730
|
switch (e) {
|
|
2681
2731
|
case "HS256":
|
|
@@ -2705,25 +2755,25 @@ function Sn(e, t) {
|
|
|
2705
2755
|
throw new z(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
2706
2756
|
}
|
|
2707
2757
|
}
|
|
2708
|
-
async function
|
|
2758
|
+
async function An(e, t, s) {
|
|
2709
2759
|
if (t instanceof Uint8Array) {
|
|
2710
2760
|
if (!e.startsWith("HS"))
|
|
2711
|
-
throw new TypeError(
|
|
2761
|
+
throw new TypeError(Yr(t, "CryptoKey", "KeyObject", "JSON Web Key"));
|
|
2712
2762
|
return crypto.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [s]);
|
|
2713
2763
|
}
|
|
2714
|
-
return
|
|
2764
|
+
return Jr(t, e, s), t;
|
|
2715
2765
|
}
|
|
2716
|
-
async function
|
|
2717
|
-
const n = await
|
|
2718
|
-
|
|
2719
|
-
const i =
|
|
2766
|
+
async function vn(e, t, s, r) {
|
|
2767
|
+
const n = await An(e, t, "verify");
|
|
2768
|
+
Zr(e, n);
|
|
2769
|
+
const i = Tn(e, n.algorithm);
|
|
2720
2770
|
try {
|
|
2721
2771
|
return await crypto.subtle.verify(i, n, s, r);
|
|
2722
2772
|
} catch {
|
|
2723
2773
|
return !1;
|
|
2724
2774
|
}
|
|
2725
2775
|
}
|
|
2726
|
-
async function
|
|
2776
|
+
async function Rn(e, t, s) {
|
|
2727
2777
|
if (!be(e))
|
|
2728
2778
|
throw new M("Flattened JWS must be an object");
|
|
2729
2779
|
if (e.protected === void 0 && e.header === void 0)
|
|
@@ -2744,38 +2794,38 @@ async function An(e, t, s) {
|
|
|
2744
2794
|
} catch {
|
|
2745
2795
|
throw new M("JWS Protected Header is invalid");
|
|
2746
2796
|
}
|
|
2747
|
-
if (!
|
|
2797
|
+
if (!zr(r, e.header))
|
|
2748
2798
|
throw new M("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
2749
2799
|
const n = {
|
|
2750
2800
|
...r,
|
|
2751
2801
|
...e.header
|
|
2752
|
-
}, i =
|
|
2802
|
+
}, i = dn(M, /* @__PURE__ */ new Map([["b64", !0]]), s?.crit, r, n);
|
|
2753
2803
|
let a = !0;
|
|
2754
2804
|
if (i.has("b64") && (a = r.b64, typeof a != "boolean"))
|
|
2755
2805
|
throw new M('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
2756
2806
|
const { alg: o } = n;
|
|
2757
2807
|
if (typeof o != "string" || !o)
|
|
2758
2808
|
throw new M('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
2759
|
-
const c = s &&
|
|
2809
|
+
const c = s && hn("algorithms", s.algorithms);
|
|
2760
2810
|
if (c && !c.has(o))
|
|
2761
|
-
throw new
|
|
2811
|
+
throw new jr('"alg" (Algorithm) Header Parameter value not allowed');
|
|
2762
2812
|
if (a) {
|
|
2763
2813
|
if (typeof e.payload != "string")
|
|
2764
2814
|
throw new M("JWS Payload must be a string");
|
|
2765
2815
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
2766
2816
|
throw new M("JWS Payload must be a string or an Uint8Array instance");
|
|
2767
2817
|
let h = !1;
|
|
2768
|
-
typeof t == "function" && (t = await t(r, e), h = !0),
|
|
2769
|
-
const u =
|
|
2818
|
+
typeof t == "function" && (t = await t(r, e), h = !0), wn(o, t, "verify");
|
|
2819
|
+
const u = Br(e.protected !== void 0 ? je(e.protected) : new Uint8Array(), je("."), typeof e.payload == "string" ? a ? je(e.payload) : Dt.encode(e.payload) : e.payload);
|
|
2770
2820
|
let d;
|
|
2771
2821
|
try {
|
|
2772
2822
|
d = ve(e.signature);
|
|
2773
2823
|
} catch {
|
|
2774
2824
|
throw new M("Failed to base64url decode the signature");
|
|
2775
2825
|
}
|
|
2776
|
-
const l = await
|
|
2777
|
-
if (!await
|
|
2778
|
-
throw new
|
|
2826
|
+
const l = await En(t, o);
|
|
2827
|
+
if (!await vn(o, l, d, u))
|
|
2828
|
+
throw new Qr();
|
|
2779
2829
|
let p;
|
|
2780
2830
|
if (a)
|
|
2781
2831
|
try {
|
|
@@ -2783,22 +2833,22 @@ async function An(e, t, s) {
|
|
|
2783
2833
|
} catch {
|
|
2784
2834
|
throw new M("Failed to base64url decode the payload");
|
|
2785
2835
|
}
|
|
2786
|
-
else typeof e.payload == "string" ? p =
|
|
2836
|
+
else typeof e.payload == "string" ? p = Dt.encode(e.payload) : p = e.payload;
|
|
2787
2837
|
const f = { payload: p };
|
|
2788
2838
|
return e.protected !== void 0 && (f.protectedHeader = r), e.header !== void 0 && (f.unprotectedHeader = e.header), h ? { ...f, key: l } : f;
|
|
2789
2839
|
}
|
|
2790
|
-
async function
|
|
2840
|
+
async function bn(e, t, s) {
|
|
2791
2841
|
if (e instanceof Uint8Array && (e = ge.decode(e)), typeof e != "string")
|
|
2792
2842
|
throw new M("Compact JWS must be a string or Uint8Array");
|
|
2793
2843
|
const { 0: r, 1: n, 2: i, length: a } = e.split(".");
|
|
2794
2844
|
if (a !== 3)
|
|
2795
2845
|
throw new M("Invalid Compact JWS");
|
|
2796
|
-
const o = await
|
|
2846
|
+
const o = await Rn({ payload: n, protected: r, signature: i }, t, s), c = { payload: o.payload, protectedHeader: o.protectedHeader };
|
|
2797
2847
|
return typeof t == "function" ? { ...c, key: o.key } : c;
|
|
2798
2848
|
}
|
|
2799
|
-
const
|
|
2800
|
-
function
|
|
2801
|
-
const t =
|
|
2849
|
+
const In = (e) => Math.floor(e.getTime() / 1e3), bs = 60, Is = bs * 60, gt = Is * 24, On = gt * 7, _n = gt * 365.25, Cn = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;
|
|
2850
|
+
function Lt(e) {
|
|
2851
|
+
const t = Cn.exec(e);
|
|
2802
2852
|
if (!t || t[4] && t[1])
|
|
2803
2853
|
throw new TypeError("Invalid time period format");
|
|
2804
2854
|
const s = parseFloat(t[2]), r = t[3].toLowerCase();
|
|
@@ -2828,21 +2878,21 @@ function Ut(e) {
|
|
|
2828
2878
|
case "day":
|
|
2829
2879
|
case "days":
|
|
2830
2880
|
case "d":
|
|
2831
|
-
n = Math.round(s *
|
|
2881
|
+
n = Math.round(s * gt);
|
|
2832
2882
|
break;
|
|
2833
2883
|
case "week":
|
|
2834
2884
|
case "weeks":
|
|
2835
2885
|
case "w":
|
|
2836
|
-
n = Math.round(s *
|
|
2886
|
+
n = Math.round(s * On);
|
|
2837
2887
|
break;
|
|
2838
2888
|
default:
|
|
2839
|
-
n = Math.round(s *
|
|
2889
|
+
n = Math.round(s * _n);
|
|
2840
2890
|
break;
|
|
2841
2891
|
}
|
|
2842
2892
|
return t[1] === "-" || t[4] === "ago" ? -n : n;
|
|
2843
2893
|
}
|
|
2844
|
-
const
|
|
2845
|
-
function
|
|
2894
|
+
const Ft = (e) => e.includes("/") ? e.toLowerCase() : `application/${e.toLowerCase()}`, Pn = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1;
|
|
2895
|
+
function Mn(e, t, s = {}) {
|
|
2846
2896
|
let r;
|
|
2847
2897
|
try {
|
|
2848
2898
|
r = JSON.parse(ge.decode(t));
|
|
@@ -2851,7 +2901,7 @@ function Cn(e, t, s = {}) {
|
|
|
2851
2901
|
if (!be(r))
|
|
2852
2902
|
throw new Y("JWT Claims Set must be a top-level JSON object");
|
|
2853
2903
|
const { typ: n } = s;
|
|
2854
|
-
if (n && (typeof e.typ != "string" ||
|
|
2904
|
+
if (n && (typeof e.typ != "string" || Ft(e.typ) !== Ft(n)))
|
|
2855
2905
|
throw new q('unexpected "typ" JWT header value', r, "typ", "check_failed");
|
|
2856
2906
|
const { requiredClaims: i = [], issuer: a, subject: o, audience: c, maxTokenAge: h } = s, u = [...i];
|
|
2857
2907
|
h !== void 0 && u.push("iat"), c !== void 0 && u.push("aud"), o !== void 0 && u.push("sub"), a !== void 0 && u.push("iss");
|
|
@@ -2862,12 +2912,12 @@ function Cn(e, t, s = {}) {
|
|
|
2862
2912
|
throw new q('unexpected "iss" claim value', r, "iss", "check_failed");
|
|
2863
2913
|
if (o && r.sub !== o)
|
|
2864
2914
|
throw new q('unexpected "sub" claim value', r, "sub", "check_failed");
|
|
2865
|
-
if (c && !
|
|
2915
|
+
if (c && !Pn(r.aud, typeof c == "string" ? [c] : c))
|
|
2866
2916
|
throw new q('unexpected "aud" claim value', r, "aud", "check_failed");
|
|
2867
2917
|
let d;
|
|
2868
2918
|
switch (typeof s.clockTolerance) {
|
|
2869
2919
|
case "string":
|
|
2870
|
-
d =
|
|
2920
|
+
d = Lt(s.clockTolerance);
|
|
2871
2921
|
break;
|
|
2872
2922
|
case "number":
|
|
2873
2923
|
d = s.clockTolerance;
|
|
@@ -2878,7 +2928,7 @@ function Cn(e, t, s = {}) {
|
|
|
2878
2928
|
default:
|
|
2879
2929
|
throw new TypeError("Invalid clockTolerance option type");
|
|
2880
2930
|
}
|
|
2881
|
-
const { currentDate: l } = s, p =
|
|
2931
|
+
const { currentDate: l } = s, p = In(l || /* @__PURE__ */ new Date());
|
|
2882
2932
|
if ((r.iat !== void 0 || h) && typeof r.iat != "number")
|
|
2883
2933
|
throw new q('"iat" claim must be a number', r, "iat", "invalid");
|
|
2884
2934
|
if (r.nbf !== void 0) {
|
|
@@ -2891,25 +2941,25 @@ function Cn(e, t, s = {}) {
|
|
|
2891
2941
|
if (typeof r.exp != "number")
|
|
2892
2942
|
throw new q('"exp" claim must be a number', r, "exp", "invalid");
|
|
2893
2943
|
if (r.exp <= p - d)
|
|
2894
|
-
throw new
|
|
2944
|
+
throw new Nt('"exp" claim timestamp check failed', r, "exp", "check_failed");
|
|
2895
2945
|
}
|
|
2896
2946
|
if (h) {
|
|
2897
|
-
const f = p - r.iat, y = typeof h == "number" ? h :
|
|
2947
|
+
const f = p - r.iat, y = typeof h == "number" ? h : Lt(h);
|
|
2898
2948
|
if (f - d > y)
|
|
2899
|
-
throw new
|
|
2949
|
+
throw new Nt('"iat" claim timestamp check failed (too far in the past)', r, "iat", "check_failed");
|
|
2900
2950
|
if (f < 0 - d)
|
|
2901
2951
|
throw new q('"iat" claim timestamp check failed (it should be in the past)', r, "iat", "check_failed");
|
|
2902
2952
|
}
|
|
2903
2953
|
return r;
|
|
2904
2954
|
}
|
|
2905
|
-
async function
|
|
2906
|
-
const r = await
|
|
2955
|
+
async function kn(e, t, s) {
|
|
2956
|
+
const r = await bn(e, t, s);
|
|
2907
2957
|
if (r.protectedHeader.crit?.includes("b64") && r.protectedHeader.b64 === !1)
|
|
2908
2958
|
throw new Y("JWTs MUST NOT use unencoded payload");
|
|
2909
|
-
const n = { payload:
|
|
2959
|
+
const n = { payload: Mn(r.protectedHeader, r.payload, s), protectedHeader: r.protectedHeader };
|
|
2910
2960
|
return typeof t == "function" ? { ...n, key: r.key } : n;
|
|
2911
2961
|
}
|
|
2912
|
-
function
|
|
2962
|
+
function $n(e) {
|
|
2913
2963
|
if (typeof e != "string")
|
|
2914
2964
|
throw new Y("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
2915
2965
|
const { 1: t, length: s } = e.split(".");
|
|
@@ -2937,65 +2987,65 @@ function Mn(e) {
|
|
|
2937
2987
|
}
|
|
2938
2988
|
const Ie = async (e) => {
|
|
2939
2989
|
try {
|
|
2940
|
-
const t = $.ALG, s = await
|
|
2941
|
-
return await
|
|
2990
|
+
const t = $.ALG, s = await ln(qr, t);
|
|
2991
|
+
return await kn(e, s, {
|
|
2942
2992
|
issuer: $.ISSUER
|
|
2943
2993
|
});
|
|
2944
2994
|
} catch {
|
|
2945
2995
|
return;
|
|
2946
2996
|
}
|
|
2947
|
-
},
|
|
2997
|
+
}, Dn = (e) => {
|
|
2948
2998
|
try {
|
|
2949
|
-
return
|
|
2999
|
+
return $n(e);
|
|
2950
3000
|
} catch {
|
|
2951
3001
|
return;
|
|
2952
3002
|
}
|
|
2953
3003
|
}, C = [];
|
|
2954
3004
|
for (let e = 0; e < 256; ++e)
|
|
2955
3005
|
C.push((e + 256).toString(16).slice(1));
|
|
2956
|
-
function
|
|
3006
|
+
function Nn(e, t = 0) {
|
|
2957
3007
|
return (C[e[t + 0]] + C[e[t + 1]] + C[e[t + 2]] + C[e[t + 3]] + "-" + C[e[t + 4]] + C[e[t + 5]] + "-" + C[e[t + 6]] + C[e[t + 7]] + "-" + C[e[t + 8]] + C[e[t + 9]] + "-" + C[e[t + 10]] + C[e[t + 11]] + C[e[t + 12]] + C[e[t + 13]] + C[e[t + 14]] + C[e[t + 15]]).toLowerCase();
|
|
2958
3008
|
}
|
|
2959
3009
|
let Ve;
|
|
2960
|
-
const
|
|
2961
|
-
function
|
|
3010
|
+
const Un = new Uint8Array(16);
|
|
3011
|
+
function Ln() {
|
|
2962
3012
|
if (!Ve) {
|
|
2963
3013
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2964
3014
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2965
3015
|
Ve = crypto.getRandomValues.bind(crypto);
|
|
2966
3016
|
}
|
|
2967
|
-
return Ve(
|
|
3017
|
+
return Ve(Un);
|
|
2968
3018
|
}
|
|
2969
|
-
const
|
|
2970
|
-
function
|
|
2971
|
-
if (
|
|
2972
|
-
return
|
|
3019
|
+
const Fn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Kt = { randomUUID: Fn };
|
|
3020
|
+
function Ht(e, t, s) {
|
|
3021
|
+
if (Kt.randomUUID && !e)
|
|
3022
|
+
return Kt.randomUUID();
|
|
2973
3023
|
e = e || {};
|
|
2974
|
-
const r = e.random ?? e.rng?.() ??
|
|
3024
|
+
const r = e.random ?? e.rng?.() ?? Ln();
|
|
2975
3025
|
if (r.length < 16)
|
|
2976
3026
|
throw new Error("Random bytes length must be >= 16");
|
|
2977
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
3027
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Nn(r);
|
|
2978
3028
|
}
|
|
2979
|
-
const
|
|
3029
|
+
const Gt = globalThis.crypto, Kn = (e) => `${Ht()}${Ht()}`.slice(0, e), Hn = (e) => btoa(
|
|
2980
3030
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
2981
3031
|
);
|
|
2982
|
-
async function
|
|
2983
|
-
if (!
|
|
3032
|
+
async function Gn(e) {
|
|
3033
|
+
if (!Gt.subtle)
|
|
2984
3034
|
throw new Error(
|
|
2985
3035
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
2986
3036
|
);
|
|
2987
|
-
const t = new TextEncoder().encode(e), s = await
|
|
2988
|
-
return
|
|
3037
|
+
const t = new TextEncoder().encode(e), s = await Gt.subtle.digest("SHA-256", t);
|
|
3038
|
+
return Hn(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
2989
3039
|
}
|
|
2990
|
-
async function
|
|
2991
|
-
const s =
|
|
3040
|
+
async function xn(e) {
|
|
3041
|
+
const s = Kn(43), r = await Gn(s);
|
|
2992
3042
|
return {
|
|
2993
3043
|
code_verifier: s,
|
|
2994
3044
|
code_challenge: r
|
|
2995
3045
|
};
|
|
2996
3046
|
}
|
|
2997
|
-
const
|
|
2998
|
-
var
|
|
3047
|
+
const Os = ut(null);
|
|
3048
|
+
var qn = Object.defineProperty, Bn = (e, t, s) => t in e ? qn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, Je = (e, t, s) => Bn(e, typeof t != "symbol" ? t + "" : t, s);
|
|
2999
3049
|
try {
|
|
3000
3050
|
window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
|
|
3001
3051
|
version: "8.1.1",
|
|
@@ -3005,7 +3055,7 @@ try {
|
|
|
3005
3055
|
});
|
|
3006
3056
|
} catch {
|
|
3007
3057
|
}
|
|
3008
|
-
function
|
|
3058
|
+
function j(e) {
|
|
3009
3059
|
const t = new Uint8Array(e);
|
|
3010
3060
|
let s = "";
|
|
3011
3061
|
for (const r of t)
|
|
@@ -3018,13 +3068,13 @@ function Ke(e) {
|
|
|
3018
3068
|
a[o] = n.charCodeAt(o);
|
|
3019
3069
|
return i;
|
|
3020
3070
|
}
|
|
3021
|
-
function
|
|
3022
|
-
return
|
|
3071
|
+
function St() {
|
|
3072
|
+
return jn.stubThis(globalThis?.PublicKeyCredential !== void 0 && typeof globalThis.PublicKeyCredential == "function");
|
|
3023
3073
|
}
|
|
3024
|
-
const
|
|
3074
|
+
const jn = {
|
|
3025
3075
|
stubThis: (e) => e
|
|
3026
3076
|
};
|
|
3027
|
-
function
|
|
3077
|
+
function _s(e) {
|
|
3028
3078
|
const { id: t } = e;
|
|
3029
3079
|
return {
|
|
3030
3080
|
...e,
|
|
@@ -3053,7 +3103,7 @@ class k extends Error {
|
|
|
3053
3103
|
}), this.name = n ?? r.name, this.code = s;
|
|
3054
3104
|
}
|
|
3055
3105
|
}
|
|
3056
|
-
function
|
|
3106
|
+
function Qn({ error: e, options: t }) {
|
|
3057
3107
|
const { publicKey: s } = t;
|
|
3058
3108
|
if (!s)
|
|
3059
3109
|
throw Error("options was missing required publicKey property");
|
|
@@ -3139,7 +3189,7 @@ function Bn({ error: e, options: t }) {
|
|
|
3139
3189
|
}
|
|
3140
3190
|
return e;
|
|
3141
3191
|
}
|
|
3142
|
-
class
|
|
3192
|
+
class Wn {
|
|
3143
3193
|
constructor() {
|
|
3144
3194
|
Object.defineProperty(this, "controller", {
|
|
3145
3195
|
enumerable: !0,
|
|
@@ -3163,15 +3213,15 @@ class Qn {
|
|
|
3163
3213
|
}
|
|
3164
3214
|
}
|
|
3165
3215
|
}
|
|
3166
|
-
const Ps = new
|
|
3216
|
+
const Ps = new Wn(), Vn = ["cross-platform", "platform"];
|
|
3167
3217
|
function Ms(e) {
|
|
3168
|
-
if (e && !(
|
|
3218
|
+
if (e && !(Vn.indexOf(e) < 0))
|
|
3169
3219
|
return e;
|
|
3170
3220
|
}
|
|
3171
|
-
async function
|
|
3221
|
+
async function Jn(e) {
|
|
3172
3222
|
!e.optionsJSON && e.challenge && (console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
|
|
3173
3223
|
const { optionsJSON: t, useAutoRegister: s = !1 } = e;
|
|
3174
|
-
if (!
|
|
3224
|
+
if (!St())
|
|
3175
3225
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3176
3226
|
const r = {
|
|
3177
3227
|
...t,
|
|
@@ -3180,14 +3230,14 @@ async function Wn(e) {
|
|
|
3180
3230
|
...t.user,
|
|
3181
3231
|
id: Ke(t.user.id)
|
|
3182
3232
|
},
|
|
3183
|
-
excludeCredentials: t.excludeCredentials?.map(
|
|
3233
|
+
excludeCredentials: t.excludeCredentials?.map(_s)
|
|
3184
3234
|
}, n = {};
|
|
3185
3235
|
s && (n.mediation = "conditional"), n.publicKey = r, n.signal = Ps.createNewAbortSignal();
|
|
3186
3236
|
let i;
|
|
3187
3237
|
try {
|
|
3188
3238
|
i = await navigator.credentials.create(n);
|
|
3189
3239
|
} catch (f) {
|
|
3190
|
-
throw
|
|
3240
|
+
throw Qn({ error: f, options: n });
|
|
3191
3241
|
}
|
|
3192
3242
|
if (!i)
|
|
3193
3243
|
throw new Error("Registration was not completed");
|
|
@@ -3205,23 +3255,23 @@ async function Wn(e) {
|
|
|
3205
3255
|
if (typeof c.getPublicKey == "function")
|
|
3206
3256
|
try {
|
|
3207
3257
|
const f = c.getPublicKey();
|
|
3208
|
-
f !== null && (l =
|
|
3258
|
+
f !== null && (l = j(f));
|
|
3209
3259
|
} catch (f) {
|
|
3210
3260
|
Ye("getPublicKey()", f);
|
|
3211
3261
|
}
|
|
3212
3262
|
let p;
|
|
3213
3263
|
if (typeof c.getAuthenticatorData == "function")
|
|
3214
3264
|
try {
|
|
3215
|
-
p =
|
|
3265
|
+
p = j(c.getAuthenticatorData());
|
|
3216
3266
|
} catch (f) {
|
|
3217
3267
|
Ye("getAuthenticatorData()", f);
|
|
3218
3268
|
}
|
|
3219
3269
|
return {
|
|
3220
3270
|
id: a,
|
|
3221
|
-
rawId:
|
|
3271
|
+
rawId: j(o),
|
|
3222
3272
|
response: {
|
|
3223
|
-
attestationObject:
|
|
3224
|
-
clientDataJSON:
|
|
3273
|
+
attestationObject: j(c.attestationObject),
|
|
3274
|
+
clientDataJSON: j(c.clientDataJSON),
|
|
3225
3275
|
transports: u,
|
|
3226
3276
|
publicKeyAlgorithm: d,
|
|
3227
3277
|
publicKey: l,
|
|
@@ -3236,8 +3286,8 @@ function Ye(e, t) {
|
|
|
3236
3286
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
|
|
3237
3287
|
`, t);
|
|
3238
3288
|
}
|
|
3239
|
-
function
|
|
3240
|
-
if (!
|
|
3289
|
+
function Yn() {
|
|
3290
|
+
if (!St())
|
|
3241
3291
|
return ze.stubThis(new Promise((t) => t(!1)));
|
|
3242
3292
|
const e = globalThis.PublicKeyCredential;
|
|
3243
3293
|
return e?.isConditionalMediationAvailable === void 0 ? ze.stubThis(new Promise((t) => t(!1))) : ze.stubThis(e.isConditionalMediationAvailable());
|
|
@@ -3245,7 +3295,7 @@ function Vn() {
|
|
|
3245
3295
|
const ze = {
|
|
3246
3296
|
stubThis: (e) => e
|
|
3247
3297
|
};
|
|
3248
|
-
function
|
|
3298
|
+
function zn({ error: e, options: t }) {
|
|
3249
3299
|
const { publicKey: s } = t;
|
|
3250
3300
|
if (!s)
|
|
3251
3301
|
throw Error("options was missing required publicKey property");
|
|
@@ -3286,20 +3336,20 @@ function Jn({ error: e, options: t }) {
|
|
|
3286
3336
|
}
|
|
3287
3337
|
return e;
|
|
3288
3338
|
}
|
|
3289
|
-
async function
|
|
3339
|
+
async function Xn(e) {
|
|
3290
3340
|
!e.optionsJSON && e.challenge && (console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."), e = { optionsJSON: e });
|
|
3291
3341
|
const { optionsJSON: t, useBrowserAutofill: s = !1, verifyBrowserAutofillInput: r = !0 } = e;
|
|
3292
|
-
if (!
|
|
3342
|
+
if (!St())
|
|
3293
3343
|
throw new Error("WebAuthn is not supported in this browser");
|
|
3294
3344
|
let n;
|
|
3295
|
-
t.allowCredentials?.length !== 0 && (n = t.allowCredentials?.map(
|
|
3345
|
+
t.allowCredentials?.length !== 0 && (n = t.allowCredentials?.map(_s));
|
|
3296
3346
|
const i = {
|
|
3297
3347
|
...t,
|
|
3298
3348
|
challenge: Ke(t.challenge),
|
|
3299
3349
|
allowCredentials: n
|
|
3300
3350
|
}, a = {};
|
|
3301
3351
|
if (s) {
|
|
3302
|
-
if (!await
|
|
3352
|
+
if (!await Yn())
|
|
3303
3353
|
throw Error("Browser does not support WebAuthn autofill");
|
|
3304
3354
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1 && r)
|
|
3305
3355
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
@@ -3310,19 +3360,19 @@ async function Yn(e) {
|
|
|
3310
3360
|
try {
|
|
3311
3361
|
o = await navigator.credentials.get(a);
|
|
3312
3362
|
} catch (p) {
|
|
3313
|
-
throw
|
|
3363
|
+
throw zn({ error: p, options: a });
|
|
3314
3364
|
}
|
|
3315
3365
|
if (!o)
|
|
3316
3366
|
throw new Error("Authentication was not completed");
|
|
3317
3367
|
const { id: c, rawId: h, response: u, type: d } = o;
|
|
3318
3368
|
let l;
|
|
3319
|
-
return u.userHandle && (l =
|
|
3369
|
+
return u.userHandle && (l = j(u.userHandle)), {
|
|
3320
3370
|
id: c,
|
|
3321
|
-
rawId:
|
|
3371
|
+
rawId: j(h),
|
|
3322
3372
|
response: {
|
|
3323
|
-
authenticatorData:
|
|
3324
|
-
clientDataJSON:
|
|
3325
|
-
signature:
|
|
3373
|
+
authenticatorData: j(u.authenticatorData),
|
|
3374
|
+
clientDataJSON: j(u.clientDataJSON),
|
|
3375
|
+
signature: j(u.signature),
|
|
3326
3376
|
userHandle: l
|
|
3327
3377
|
},
|
|
3328
3378
|
type: d,
|
|
@@ -3345,36 +3395,36 @@ function ks(e, t) {
|
|
|
3345
3395
|
newValue: t
|
|
3346
3396
|
}));
|
|
3347
3397
|
}
|
|
3348
|
-
const
|
|
3398
|
+
const xt = (e, t) => {
|
|
3349
3399
|
const s = JSON.stringify(typeof t == "function" ? t() : t);
|
|
3350
3400
|
window.localStorage.setItem(e, s), ks(e, s);
|
|
3351
|
-
},
|
|
3401
|
+
}, Zn = (e) => {
|
|
3352
3402
|
window.localStorage.removeItem(e), ks(e, null);
|
|
3353
|
-
},
|
|
3403
|
+
}, qt = (e) => window.localStorage.getItem(e), ei = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
3354
3404
|
function Ce({ key: e, initialValue: t }) {
|
|
3355
|
-
const s = zs(
|
|
3405
|
+
const s = zs(ei, () => qt(e)), r = Q((a) => {
|
|
3356
3406
|
try {
|
|
3357
3407
|
const o = typeof a == "function" ? a(JSON.parse(s)) : a;
|
|
3358
|
-
o == null ?
|
|
3408
|
+
o == null ? Zn(e) : xt(e, o);
|
|
3359
3409
|
} catch (o) {
|
|
3360
3410
|
console.warn(o);
|
|
3361
3411
|
}
|
|
3362
3412
|
}, [
|
|
3363
3413
|
e,
|
|
3364
3414
|
s
|
|
3365
|
-
]), n =
|
|
3415
|
+
]), n = Q(() => {
|
|
3366
3416
|
r(t);
|
|
3367
3417
|
}, [
|
|
3368
3418
|
t,
|
|
3369
3419
|
r
|
|
3370
|
-
]), i =
|
|
3420
|
+
]), i = Q(() => {
|
|
3371
3421
|
r(null);
|
|
3372
3422
|
}, [
|
|
3373
3423
|
r
|
|
3374
3424
|
]);
|
|
3375
3425
|
return me(() => {
|
|
3376
3426
|
try {
|
|
3377
|
-
|
|
3427
|
+
qt(e) === null && typeof t < "u" && xt(e, t);
|
|
3378
3428
|
} catch (a) {
|
|
3379
3429
|
console.warn(a);
|
|
3380
3430
|
}
|
|
@@ -3391,30 +3441,30 @@ function Ce({ key: e, initialValue: t }) {
|
|
|
3391
3441
|
const P = [];
|
|
3392
3442
|
for (let e = 0; e < 256; ++e)
|
|
3393
3443
|
P.push((e + 256).toString(16).slice(1));
|
|
3394
|
-
function
|
|
3444
|
+
function ti(e, t = 0) {
|
|
3395
3445
|
return (P[e[t + 0]] + P[e[t + 1]] + P[e[t + 2]] + P[e[t + 3]] + "-" + P[e[t + 4]] + P[e[t + 5]] + "-" + P[e[t + 6]] + P[e[t + 7]] + "-" + P[e[t + 8]] + P[e[t + 9]] + "-" + P[e[t + 10]] + P[e[t + 11]] + P[e[t + 12]] + P[e[t + 13]] + P[e[t + 14]] + P[e[t + 15]]).toLowerCase();
|
|
3396
3446
|
}
|
|
3397
3447
|
let Xe;
|
|
3398
|
-
const
|
|
3399
|
-
function
|
|
3448
|
+
const si = new Uint8Array(16);
|
|
3449
|
+
function ri() {
|
|
3400
3450
|
if (!Xe) {
|
|
3401
3451
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
3402
3452
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
3403
3453
|
Xe = crypto.getRandomValues.bind(crypto);
|
|
3404
3454
|
}
|
|
3405
|
-
return Xe(
|
|
3455
|
+
return Xe(si);
|
|
3406
3456
|
}
|
|
3407
|
-
const
|
|
3457
|
+
const ni = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Bt = { randomUUID: ni };
|
|
3408
3458
|
function Ze(e, t, s) {
|
|
3409
|
-
if (
|
|
3410
|
-
return
|
|
3459
|
+
if (Bt.randomUUID && !e)
|
|
3460
|
+
return Bt.randomUUID();
|
|
3411
3461
|
e = e || {};
|
|
3412
|
-
const r = e.random ?? e.rng?.() ??
|
|
3462
|
+
const r = e.random ?? e.rng?.() ?? ri();
|
|
3413
3463
|
if (r.length < 16)
|
|
3414
3464
|
throw new Error("Random bytes length must be >= 16");
|
|
3415
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
3465
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, ti(r);
|
|
3416
3466
|
}
|
|
3417
|
-
const de = "Your session has expired. For your security, please log in again to continue.",
|
|
3467
|
+
const de = "Your session has expired. For your security, please log in again to continue.", ii = "Your session has been successfully terminated.", et = "Login failed. Please try again.", ai = "Error getting access token, please re-authenticate.", oi = "You forgot to wrap your component in <AuthProvider>.", Pe = "@@auth@@", Te = "LOADING", ke = "LOGIN", $s = "LOGOUT", Oe = "success", W = "failure", Ds = "include", Ns = "POST", Us = "application/json", Me = {
|
|
3418
3468
|
GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
|
|
3419
3469
|
$clientId: String!,
|
|
3420
3470
|
$username: String!,
|
|
@@ -3537,7 +3587,7 @@ const de = "Your session has expired. For your security, please log in again to
|
|
|
3537
3587
|
return { status: W, data: [] };
|
|
3538
3588
|
const { data: o } = await a.json();
|
|
3539
3589
|
return {
|
|
3540
|
-
status:
|
|
3590
|
+
status: Oe,
|
|
3541
3591
|
data: o[t.method]
|
|
3542
3592
|
};
|
|
3543
3593
|
} catch (i) {
|
|
@@ -3563,27 +3613,27 @@ const de = "Your session has expired. For your security, please log in again to
|
|
|
3563
3613
|
return { status: W, data: [] };
|
|
3564
3614
|
const { data: i } = await n.json();
|
|
3565
3615
|
return {
|
|
3566
|
-
status:
|
|
3616
|
+
status: Oe,
|
|
3567
3617
|
data: i || []
|
|
3568
3618
|
};
|
|
3569
3619
|
} catch (n) {
|
|
3570
3620
|
return console.error(n), { status: W, data: [] };
|
|
3571
3621
|
}
|
|
3572
|
-
},
|
|
3622
|
+
}, ci = process.env.NODE_ENV === "production", ui = !ci, Ls = {
|
|
3573
3623
|
isLoading: !0,
|
|
3574
3624
|
isAuthenticated: !1,
|
|
3575
3625
|
user: void 0,
|
|
3576
3626
|
logoutReason: "",
|
|
3577
3627
|
debug: !1,
|
|
3578
3628
|
authenticationType: ""
|
|
3579
|
-
},
|
|
3629
|
+
}, li = (e) => {
|
|
3580
3630
|
try {
|
|
3581
|
-
const t =
|
|
3631
|
+
const t = Dn(e);
|
|
3582
3632
|
return t ? t[$.USER_ID_KEY] : "";
|
|
3583
3633
|
} catch {
|
|
3584
3634
|
return "";
|
|
3585
3635
|
}
|
|
3586
|
-
},
|
|
3636
|
+
}, di = async ({
|
|
3587
3637
|
userId: e,
|
|
3588
3638
|
clientId: t,
|
|
3589
3639
|
domain: s,
|
|
@@ -3608,7 +3658,7 @@ const de = "Your session has expired. For your security, please log in again to
|
|
|
3608
3658
|
status: W
|
|
3609
3659
|
};
|
|
3610
3660
|
}
|
|
3611
|
-
},
|
|
3661
|
+
}, hi = async ({
|
|
3612
3662
|
username: e,
|
|
3613
3663
|
password: t,
|
|
3614
3664
|
clientId: s,
|
|
@@ -3653,7 +3703,7 @@ const de = "Your session has expired. For your security, please log in again to
|
|
|
3653
3703
|
status: !1
|
|
3654
3704
|
};
|
|
3655
3705
|
}
|
|
3656
|
-
},
|
|
3706
|
+
}, fi = async ({
|
|
3657
3707
|
nonce: e,
|
|
3658
3708
|
clientId: t,
|
|
3659
3709
|
code_challenge: s,
|
|
@@ -3671,7 +3721,7 @@ const de = "Your session has expired. For your security, please log in again to
|
|
|
3671
3721
|
}
|
|
3672
3722
|
});
|
|
3673
3723
|
return n?.data?.code ? {
|
|
3674
|
-
status:
|
|
3724
|
+
status: Oe,
|
|
3675
3725
|
data: n.data.code
|
|
3676
3726
|
} : {
|
|
3677
3727
|
status: W,
|
|
@@ -3683,7 +3733,7 @@ const de = "Your session has expired. For your security, please log in again to
|
|
|
3683
3733
|
data: ""
|
|
3684
3734
|
};
|
|
3685
3735
|
}
|
|
3686
|
-
},
|
|
3736
|
+
}, pi = async ({
|
|
3687
3737
|
clientId: e,
|
|
3688
3738
|
userId: t,
|
|
3689
3739
|
nonce: s,
|
|
@@ -3720,7 +3770,7 @@ const de = "Your session has expired. For your security, please log in again to
|
|
|
3720
3770
|
};
|
|
3721
3771
|
}
|
|
3722
3772
|
};
|
|
3723
|
-
class
|
|
3773
|
+
class yi {
|
|
3724
3774
|
constructor(t = null, s = null) {
|
|
3725
3775
|
Je(this, "refreshTokenPromise", null), Je(this, "accessToken"), Je(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = s || "";
|
|
3726
3776
|
}
|
|
@@ -3753,7 +3803,7 @@ class fi {
|
|
|
3753
3803
|
}) {
|
|
3754
3804
|
const a = await Ie(this.refreshToken);
|
|
3755
3805
|
if (a && a.payload[$.USER_ID_KEY] !== "") {
|
|
3756
|
-
const o = await
|
|
3806
|
+
const o = await pi({
|
|
3757
3807
|
endpoint: t,
|
|
3758
3808
|
clientId: s,
|
|
3759
3809
|
userId: r,
|
|
@@ -3763,7 +3813,7 @@ class fi {
|
|
|
3763
3813
|
domain: i
|
|
3764
3814
|
});
|
|
3765
3815
|
return o.status ? (this.accessToken = o.accessToken, this.refreshToken = o.refreshToken, {
|
|
3766
|
-
status:
|
|
3816
|
+
status: Oe,
|
|
3767
3817
|
newAccessToken: o.accessToken,
|
|
3768
3818
|
newRefreshToken: o.refreshToken
|
|
3769
3819
|
}) : {
|
|
@@ -3776,7 +3826,7 @@ class fi {
|
|
|
3776
3826
|
}
|
|
3777
3827
|
}
|
|
3778
3828
|
const pe = () => {
|
|
3779
|
-
throw new Error(
|
|
3829
|
+
throw new Error(oi);
|
|
3780
3830
|
}, Fs = ut({
|
|
3781
3831
|
isAuthenticated: !1,
|
|
3782
3832
|
isLoading: !1,
|
|
@@ -3788,18 +3838,18 @@ const pe = () => {
|
|
|
3788
3838
|
loginWithPasskey: pe,
|
|
3789
3839
|
logoutReason: "",
|
|
3790
3840
|
authenticationType: ""
|
|
3791
|
-
}),
|
|
3841
|
+
}), mi = () => ({
|
|
3792
3842
|
...lt(Fs)
|
|
3793
|
-
}),
|
|
3843
|
+
}), Ei = (e) => Q(
|
|
3794
3844
|
(...t) => {
|
|
3795
3845
|
e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
|
|
3796
3846
|
},
|
|
3797
3847
|
[e]
|
|
3798
|
-
),
|
|
3848
|
+
), gi = Vs.createContext({
|
|
3799
3849
|
state: Ls,
|
|
3800
3850
|
dispatch: () => {
|
|
3801
3851
|
}
|
|
3802
|
-
}),
|
|
3852
|
+
}), Si = (e, t) => t?.type === Te ? {
|
|
3803
3853
|
...e,
|
|
3804
3854
|
isLoading: t.payload.isLoading
|
|
3805
3855
|
} : t?.type === ke ? {
|
|
@@ -3816,31 +3866,31 @@ const pe = () => {
|
|
|
3816
3866
|
user: void 0,
|
|
3817
3867
|
authenticationType: "",
|
|
3818
3868
|
logoutReason: t.payload.logoutReason
|
|
3819
|
-
} : e,
|
|
3820
|
-
const t =
|
|
3821
|
-
return /* @__PURE__ */ S(
|
|
3822
|
-
},
|
|
3869
|
+
} : e, wi = ({ children: e }) => {
|
|
3870
|
+
const t = mi();
|
|
3871
|
+
return /* @__PURE__ */ S(Os.Provider, { value: t, children: e });
|
|
3872
|
+
}, jt = ({
|
|
3823
3873
|
children: e,
|
|
3824
3874
|
sessionExpiration: t,
|
|
3825
3875
|
clientId: s,
|
|
3826
3876
|
domain: r = "",
|
|
3827
3877
|
debug: n = !1,
|
|
3828
|
-
endpoint: i =
|
|
3878
|
+
endpoint: i = ui ? "https://auth.gizmette.local.com:3003" : "https://mylogin.gizmette.com/auth"
|
|
3829
3879
|
}) => {
|
|
3830
|
-
const [a, o] = Js(
|
|
3880
|
+
const [a, o] = Js(Si, {
|
|
3831
3881
|
...Ls,
|
|
3832
3882
|
debug: n
|
|
3833
|
-
}), c =
|
|
3883
|
+
}), c = Ei(n), h = Ys(!1), [u, d, , l] = Ce({
|
|
3834
3884
|
key: `${Pe}::${s}::@@user@@`
|
|
3835
3885
|
}), [p, f, , y] = Ce({
|
|
3836
3886
|
key: `${Pe}::${s}::@@access@@`
|
|
3837
|
-
}), [
|
|
3887
|
+
}), [O, b, , L] = Ce(
|
|
3838
3888
|
{
|
|
3839
3889
|
key: `${Pe}::${s}::@@refresh@@`
|
|
3840
3890
|
}
|
|
3841
3891
|
), [H, G, , x] = Ce({
|
|
3842
3892
|
key: `${Pe}::${s}::@@nonce@@`
|
|
3843
|
-
}), we = new
|
|
3893
|
+
}), we = new yi(p, O), N = Q(() => {
|
|
3844
3894
|
c("removeLocalStorage: removing local storage"), l(), y(), L(), x();
|
|
3845
3895
|
}, [
|
|
3846
3896
|
y,
|
|
@@ -3848,7 +3898,7 @@ const pe = () => {
|
|
|
3848
3898
|
x,
|
|
3849
3899
|
L,
|
|
3850
3900
|
c
|
|
3851
|
-
]), I =
|
|
3901
|
+
]), I = Q(
|
|
3852
3902
|
(m) => {
|
|
3853
3903
|
c(
|
|
3854
3904
|
"removeStateAndLocalStorage: removing state and local storage with reason: ",
|
|
@@ -3861,13 +3911,13 @@ const pe = () => {
|
|
|
3861
3911
|
}), N(), o({ type: Te, payload: { isLoading: !1 } });
|
|
3862
3912
|
},
|
|
3863
3913
|
[N, c]
|
|
3864
|
-
), F =
|
|
3914
|
+
), F = Q(
|
|
3865
3915
|
async (m) => {
|
|
3866
3916
|
c("invalidateAndLogout: invalidating and logging out");
|
|
3867
|
-
const { user:
|
|
3917
|
+
const { user: _ } = a, E = _?.userId || li(u);
|
|
3868
3918
|
E || c(
|
|
3869
3919
|
"invalidateAndLogout: user cannot be identified, logging out without userId"
|
|
3870
|
-
), await
|
|
3920
|
+
), await di({
|
|
3871
3921
|
userId: E,
|
|
3872
3922
|
clientId: s,
|
|
3873
3923
|
domain: r,
|
|
@@ -3910,26 +3960,26 @@ const pe = () => {
|
|
|
3910
3960
|
h.current = !0;
|
|
3911
3961
|
};
|
|
3912
3962
|
}, [a.isLoading, u, F, c]);
|
|
3913
|
-
const ee = async (m,
|
|
3963
|
+
const ee = async (m, _) => {
|
|
3914
3964
|
o({ type: Te, payload: { isLoading: !0 } }), N();
|
|
3915
3965
|
const E = Ze();
|
|
3916
3966
|
G(E), c("login: Logging in with password");
|
|
3917
|
-
const { code_verifier: ce, code_challenge:
|
|
3967
|
+
const { code_verifier: ce, code_challenge: Qs } = await xn(), wt = await fi({
|
|
3918
3968
|
endpoint: i,
|
|
3919
3969
|
nonce: E,
|
|
3920
3970
|
clientId: s,
|
|
3921
|
-
code_challenge:
|
|
3971
|
+
code_challenge: Qs
|
|
3922
3972
|
});
|
|
3923
|
-
if (
|
|
3924
|
-
const ue = await
|
|
3973
|
+
if (wt.status) {
|
|
3974
|
+
const ue = await hi({
|
|
3925
3975
|
endpoint: i,
|
|
3926
3976
|
username: m,
|
|
3927
|
-
password:
|
|
3977
|
+
password: _,
|
|
3928
3978
|
clientId: s,
|
|
3929
3979
|
sessionExpiration: t,
|
|
3930
3980
|
nonce: E,
|
|
3931
3981
|
type: Ae.CODE,
|
|
3932
|
-
code:
|
|
3982
|
+
code: wt.data,
|
|
3933
3983
|
code_verifier: ce,
|
|
3934
3984
|
domain: r,
|
|
3935
3985
|
ua: navigator.userAgent
|
|
@@ -3948,11 +3998,11 @@ const pe = () => {
|
|
|
3948
3998
|
}
|
|
3949
3999
|
return !1;
|
|
3950
4000
|
}, oe = async (m) => {
|
|
3951
|
-
m?.preventDefault(), await F(
|
|
4001
|
+
m?.preventDefault(), await F(ii);
|
|
3952
4002
|
}, xs = async () => {
|
|
3953
|
-
const { isAuthenticated: m, user:
|
|
4003
|
+
const { isAuthenticated: m, user: _ } = a;
|
|
3954
4004
|
try {
|
|
3955
|
-
if (m &&
|
|
4005
|
+
if (m && _ && _.userId) {
|
|
3956
4006
|
if (p) {
|
|
3957
4007
|
c("getAccessToken");
|
|
3958
4008
|
const ce = await Ie(p);
|
|
@@ -3963,7 +4013,7 @@ const pe = () => {
|
|
|
3963
4013
|
const E = await we.refreshtoken({
|
|
3964
4014
|
endpoint: i,
|
|
3965
4015
|
clientId: s,
|
|
3966
|
-
userId:
|
|
4016
|
+
userId: _.userId,
|
|
3967
4017
|
nonce: H,
|
|
3968
4018
|
domain: r
|
|
3969
4019
|
});
|
|
@@ -3977,11 +4027,11 @@ const pe = () => {
|
|
|
3977
4027
|
} catch {
|
|
3978
4028
|
return c(
|
|
3979
4029
|
"getAccessToken: exception occurred, invalidating and logging out"
|
|
3980
|
-
), await F(
|
|
4030
|
+
), await F(ai), "";
|
|
3981
4031
|
}
|
|
3982
4032
|
}, qs = () => a.isAuthenticated && u ? u : "", Bs = async () => {
|
|
3983
4033
|
const { user: m } = a;
|
|
3984
|
-
let
|
|
4034
|
+
let _ = await fe({
|
|
3985
4035
|
endpoint: i,
|
|
3986
4036
|
accessToken: p,
|
|
3987
4037
|
clientId: s,
|
|
@@ -3992,12 +4042,12 @@ const pe = () => {
|
|
|
3992
4042
|
username: m?.username
|
|
3993
4043
|
}
|
|
3994
4044
|
});
|
|
3995
|
-
if (
|
|
4045
|
+
if (_.status)
|
|
3996
4046
|
try {
|
|
3997
|
-
const E = await
|
|
3998
|
-
optionsJSON:
|
|
4047
|
+
const E = await Jn({
|
|
4048
|
+
optionsJSON: _.data
|
|
3999
4049
|
});
|
|
4000
|
-
return
|
|
4050
|
+
return _ = await fe({
|
|
4001
4051
|
endpoint: i,
|
|
4002
4052
|
accessToken: p,
|
|
4003
4053
|
clientId: s,
|
|
@@ -4008,7 +4058,7 @@ const pe = () => {
|
|
|
4008
4058
|
username: m?.username,
|
|
4009
4059
|
registration: E
|
|
4010
4060
|
}
|
|
4011
|
-
}), !!(
|
|
4061
|
+
}), !!(_.status && _.data.length > 0);
|
|
4012
4062
|
} catch {
|
|
4013
4063
|
return await fe({
|
|
4014
4064
|
endpoint: i,
|
|
@@ -4024,24 +4074,24 @@ const pe = () => {
|
|
|
4024
4074
|
}), !1;
|
|
4025
4075
|
}
|
|
4026
4076
|
return !1;
|
|
4027
|
-
},
|
|
4077
|
+
}, js = async () => {
|
|
4028
4078
|
o({ type: Te, payload: { isLoading: !0 } }), N();
|
|
4029
4079
|
const m = Ze();
|
|
4030
4080
|
G(m), c("loginWithPasskey");
|
|
4031
|
-
const
|
|
4081
|
+
const _ = Ze();
|
|
4032
4082
|
let E = await fe({
|
|
4033
4083
|
endpoint: i,
|
|
4034
4084
|
accessToken: p,
|
|
4035
4085
|
clientId: s,
|
|
4036
4086
|
type: he.GET_AUTHENTICATION_OPTIONS,
|
|
4037
4087
|
params: {
|
|
4038
|
-
id:
|
|
4088
|
+
id: _,
|
|
4039
4089
|
clientId: s
|
|
4040
4090
|
}
|
|
4041
4091
|
});
|
|
4042
4092
|
if (E.status)
|
|
4043
4093
|
try {
|
|
4044
|
-
const ce = await
|
|
4094
|
+
const ce = await Xn({
|
|
4045
4095
|
optionsJSON: E.data
|
|
4046
4096
|
});
|
|
4047
4097
|
return E = await fe({
|
|
@@ -4051,14 +4101,14 @@ const pe = () => {
|
|
|
4051
4101
|
type: he.VERIFY_AUTHENTICATION,
|
|
4052
4102
|
params: {
|
|
4053
4103
|
clientId: s,
|
|
4054
|
-
id:
|
|
4104
|
+
id: _,
|
|
4055
4105
|
authentication: ce,
|
|
4056
4106
|
nonce: m,
|
|
4057
4107
|
domain: r,
|
|
4058
4108
|
sessionExpiration: t,
|
|
4059
4109
|
ua: navigator.userAgent
|
|
4060
4110
|
}
|
|
4061
|
-
}), E.data.status ===
|
|
4111
|
+
}), E.data.status === Oe ? (d(E.data.idToken), f(E.data.accessToken), b(E.data.refreshToken), o({
|
|
4062
4112
|
type: ke,
|
|
4063
4113
|
payload: {
|
|
4064
4114
|
authenticationType: Ae.PASSKEY,
|
|
@@ -4077,7 +4127,7 @@ const pe = () => {
|
|
|
4077
4127
|
type: he.VERIFY_AUTHENTICATION,
|
|
4078
4128
|
params: {
|
|
4079
4129
|
clientId: s,
|
|
4080
|
-
id:
|
|
4130
|
+
id: _,
|
|
4081
4131
|
authentication: {},
|
|
4082
4132
|
nonce: m,
|
|
4083
4133
|
domain: r,
|
|
@@ -4087,7 +4137,7 @@ const pe = () => {
|
|
|
4087
4137
|
}
|
|
4088
4138
|
return !1;
|
|
4089
4139
|
};
|
|
4090
|
-
return /* @__PURE__ */ S(
|
|
4140
|
+
return /* @__PURE__ */ S(gi.Provider, { value: { state: a, dispatch: o }, children: /* @__PURE__ */ S(
|
|
4091
4141
|
Fs.Provider,
|
|
4092
4142
|
{
|
|
4093
4143
|
value: {
|
|
@@ -4097,9 +4147,9 @@ const pe = () => {
|
|
|
4097
4147
|
getAccessToken: xs,
|
|
4098
4148
|
getIdToken: qs,
|
|
4099
4149
|
registeringForPasskey: Bs,
|
|
4100
|
-
loginWithPasskey:
|
|
4150
|
+
loginWithPasskey: js
|
|
4101
4151
|
},
|
|
4102
|
-
children: /* @__PURE__ */ S(
|
|
4152
|
+
children: /* @__PURE__ */ S(wi, { children: e })
|
|
4103
4153
|
}
|
|
4104
4154
|
) });
|
|
4105
4155
|
};
|
|
@@ -4112,12 +4162,12 @@ try {
|
|
|
4112
4162
|
});
|
|
4113
4163
|
} catch {
|
|
4114
4164
|
}
|
|
4115
|
-
const
|
|
4116
|
-
const e = lt(
|
|
4165
|
+
const Ti = () => {
|
|
4166
|
+
const e = lt(Os);
|
|
4117
4167
|
if (!e)
|
|
4118
4168
|
throw new Error("useAuth must be used within an AuthHookProvider");
|
|
4119
4169
|
return e;
|
|
4120
|
-
},
|
|
4170
|
+
}, oa = "I'm having trouble right now. Please try again later.", ca = "action-search", ua = "action-sort", la = "action-toggle-prompt", da = "action-reset-prompt", ha = "sassy-saint-", fa = "search", pa = "sort", ya = "sort-timestamp", ma = "sort-token-usage", Ea = "sort-memory-direction", ga = "sort-memory-column", Sa = "favorites-only", wa = "keyword-match-all", Ta = "usage-view-mode", Aa = "usage-time-range", va = "usage-selected-month", Ra = "private-disclosure", ba = "reasoning-disclosure", Ia = "chat-id", Oa = "sassysaint-oled-mode", _a = "sassysaint-full-screen", Qt = "data-oled-mode", Wt = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Ca = 20, Pa = 30, Ma = "av-prompt", ka = "av-prompt-editable", $a = "size-5 sm:size-4", Da = 30, Na = 15, Ua = 130, La = 160, Fa = 16, Ka = 24, Ha = 16, Ga = 76, Ks = process.env.NODE_ENV === "production", He = !Ks, Hs = He ? "gizmette.local.com" : "gizmette.com", Ai = async () => {
|
|
4121
4171
|
const e = {
|
|
4122
4172
|
/**
|
|
4123
4173
|
* A boolean value that indicates the application would like to receive the
|
|
@@ -4160,7 +4210,7 @@ const Si = () => {
|
|
|
4160
4210
|
e
|
|
4161
4211
|
);
|
|
4162
4212
|
});
|
|
4163
|
-
},
|
|
4213
|
+
}, vi = (e, t, s) => t ? Object.keys(t).map((r) => /* @__PURE__ */ S("dl", { className: "my-0", children: /* @__PURE__ */ Ws("div", { className: "flex items-center justify-between", children: [
|
|
4164
4214
|
/* @__PURE__ */ S(
|
|
4165
4215
|
"dt",
|
|
4166
4216
|
{
|
|
@@ -4181,14 +4231,14 @@ const Si = () => {
|
|
|
4181
4231
|
children: t[r]
|
|
4182
4232
|
}
|
|
4183
4233
|
)
|
|
4184
|
-
] }) }, `${e}-${r}`)) : null,
|
|
4234
|
+
] }) }, `${e}-${r}`)) : null, Ri = ({
|
|
4185
4235
|
isAuthenticated: e,
|
|
4186
4236
|
extraClass: t,
|
|
4187
4237
|
oledMode: s
|
|
4188
4238
|
}) => $e("px-4", "flex-1 overflow-y-auto", e ? "pt-0" : "pt-10", t, {
|
|
4189
4239
|
"bg-surface-darker/95 dark:bg-surface-darker": s,
|
|
4190
4240
|
"bg-surface-darker": !s
|
|
4191
|
-
}),
|
|
4241
|
+
}), bi = ({
|
|
4192
4242
|
extraClass: e,
|
|
4193
4243
|
fullScreen: t
|
|
4194
4244
|
} = {}) => $e(
|
|
@@ -4201,7 +4251,7 @@ const Si = () => {
|
|
|
4201
4251
|
"md:max-w-svw": t
|
|
4202
4252
|
},
|
|
4203
4253
|
e
|
|
4204
|
-
),
|
|
4254
|
+
), Ii = () => !!window?.__VERSINI_DIGGIDY_TAURI__, Oi = ({
|
|
4205
4255
|
autoClose: e = 3e3,
|
|
4206
4256
|
containerId: t,
|
|
4207
4257
|
position: s = "top-center",
|
|
@@ -4225,9 +4275,9 @@ const Si = () => {
|
|
|
4225
4275
|
theme: c,
|
|
4226
4276
|
transition: h,
|
|
4227
4277
|
icon: u
|
|
4228
|
-
}),
|
|
4278
|
+
}), _i = (e, t) => t === "ready" && !!e && e.length > 0, Ci = (e) => {
|
|
4229
4279
|
e ? document.documentElement.setAttribute(Qt, "true") : document.documentElement.removeAttribute(Qt);
|
|
4230
|
-
},
|
|
4280
|
+
}, Pi = new Intl.DateTimeFormat("en-US", {
|
|
4231
4281
|
year: "numeric",
|
|
4232
4282
|
month: "short",
|
|
4233
4283
|
day: "2-digit",
|
|
@@ -4235,11 +4285,11 @@ const Si = () => {
|
|
|
4235
4285
|
minute: "2-digit",
|
|
4236
4286
|
hour12: !0
|
|
4237
4287
|
});
|
|
4238
|
-
function
|
|
4239
|
-
const t = typeof e == "string" ? new Date(parseInt(e, 10)) : new Date(e), s =
|
|
4288
|
+
function Mi(e) {
|
|
4289
|
+
const t = typeof e == "string" ? new Date(parseInt(e, 10)) : new Date(e), s = Pi.formatToParts(t), r = (n) => s.find((i) => i.type === n)?.value ?? "";
|
|
4240
4290
|
return `${r("month")} ${r("day")}, ${r("year")} - ${r("hour")}:${r("minute")} ${r("dayPeriod")}`;
|
|
4241
4291
|
}
|
|
4242
|
-
const
|
|
4292
|
+
const xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, DOMAIN: Hs, applyOledMode: Ci, canEvaluateModels: _i, formatTimestamp: Mi, getCurrentGeoLocation: Ai, getLayoutPaddingClass: bi, getMessageContaintWrapperClass: Ri, isDev: He, isProd: Ks, isTauri: Ii, renderDataAsList: vi, toastOptions: Oi }, Symbol.toStringTag, { value: "Module" })), w = {
|
|
4243
4293
|
GET_LOCATION: `query GetLocation($latitude: Float!, $longitude: Float!) {
|
|
4244
4294
|
location(latitude: $latitude, longitude: $longitude) {
|
|
4245
4295
|
country
|
|
@@ -4571,12 +4621,12 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4571
4621
|
schema: w.RESTORE_MEMORY,
|
|
4572
4622
|
method: "restoreMemory"
|
|
4573
4623
|
}
|
|
4574
|
-
},
|
|
4624
|
+
}, ki = process.env.PUBLIC_SASSY_API_SERVER_URL, Ge = async ({
|
|
4575
4625
|
query: e,
|
|
4576
4626
|
data: t,
|
|
4577
4627
|
headers: s = {},
|
|
4578
4628
|
...r
|
|
4579
|
-
}) => await fetch(`${
|
|
4629
|
+
}) => await fetch(`${ki}/graphql`, {
|
|
4580
4630
|
method: "POST",
|
|
4581
4631
|
credentials: "include",
|
|
4582
4632
|
headers: {
|
|
@@ -4621,7 +4671,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4621
4671
|
} catch (s) {
|
|
4622
4672
|
throw console.error(s), s;
|
|
4623
4673
|
}
|
|
4624
|
-
},
|
|
4674
|
+
}, qa = async ({
|
|
4625
4675
|
provider: e,
|
|
4626
4676
|
model: t,
|
|
4627
4677
|
accessToken: s,
|
|
@@ -4636,7 +4686,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4636
4686
|
type: R.SET_USER_PREFERENCES,
|
|
4637
4687
|
params: n
|
|
4638
4688
|
});
|
|
4639
|
-
},
|
|
4689
|
+
}, Ba = async ({
|
|
4640
4690
|
plan: e,
|
|
4641
4691
|
accessToken: t,
|
|
4642
4692
|
username: s
|
|
@@ -4657,13 +4707,13 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4657
4707
|
USAGE: "usage",
|
|
4658
4708
|
USER_MEMORIES: "userMemories",
|
|
4659
4709
|
EXPIRED_MEMORIES: "expiredMemories"
|
|
4660
|
-
},
|
|
4710
|
+
}, ja = () => X({
|
|
4661
4711
|
queryKey: [v.CAPABILITIES],
|
|
4662
4712
|
queryFn: async () => await Z({
|
|
4663
4713
|
type: R.GET_SERVER_CAPABILITIES,
|
|
4664
4714
|
noAuth: !0
|
|
4665
4715
|
})
|
|
4666
|
-
}),
|
|
4716
|
+
}), Qa = () => X({
|
|
4667
4717
|
queryKey: [v.CHANGELOGS],
|
|
4668
4718
|
queryFn: async () => await Z({
|
|
4669
4719
|
type: R.GET_CHANGELOGS,
|
|
@@ -4672,7 +4722,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4672
4722
|
client: !0
|
|
4673
4723
|
}
|
|
4674
4724
|
})
|
|
4675
|
-
}),
|
|
4725
|
+
}), $i = ({
|
|
4676
4726
|
user: e,
|
|
4677
4727
|
getAccessToken: t
|
|
4678
4728
|
}) => X({
|
|
@@ -4684,7 +4734,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4684
4734
|
type: R.GET_USER_PREFERENCES,
|
|
4685
4735
|
getAccessToken: t
|
|
4686
4736
|
})
|
|
4687
|
-
}),
|
|
4737
|
+
}), Wa = ({
|
|
4688
4738
|
user: e,
|
|
4689
4739
|
getAccessToken: t
|
|
4690
4740
|
}) => X({
|
|
@@ -4696,7 +4746,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4696
4746
|
type: R.GET_CHATS_STATS,
|
|
4697
4747
|
getAccessToken: t
|
|
4698
4748
|
})
|
|
4699
|
-
}),
|
|
4749
|
+
}), Va = ({
|
|
4700
4750
|
user: e,
|
|
4701
4751
|
searchString: t,
|
|
4702
4752
|
sortDirection: s,
|
|
@@ -4737,7 +4787,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4737
4787
|
type: R.GET_CHATS,
|
|
4738
4788
|
getAccessToken: n
|
|
4739
4789
|
})
|
|
4740
|
-
}),
|
|
4790
|
+
}), Ja = ({
|
|
4741
4791
|
chatId: e,
|
|
4742
4792
|
getAccessToken: t,
|
|
4743
4793
|
enabled: s = !0
|
|
@@ -4749,7 +4799,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4749
4799
|
type: R.GET_CHAT,
|
|
4750
4800
|
getAccessToken: t
|
|
4751
4801
|
})
|
|
4752
|
-
}),
|
|
4802
|
+
}), Ya = ({
|
|
4753
4803
|
getAccessToken: e
|
|
4754
4804
|
}) => {
|
|
4755
4805
|
const t = V();
|
|
@@ -4773,7 +4823,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4773
4823
|
t.invalidateQueries({ queryKey: [v.CHATS, r.userId] });
|
|
4774
4824
|
}
|
|
4775
4825
|
});
|
|
4776
|
-
},
|
|
4826
|
+
}, za = ({
|
|
4777
4827
|
getAccessToken: e
|
|
4778
4828
|
}) => {
|
|
4779
4829
|
const t = V();
|
|
@@ -4790,7 +4840,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4790
4840
|
t.invalidateQueries({ queryKey: [v.CHATS, r.userId] });
|
|
4791
4841
|
}
|
|
4792
4842
|
});
|
|
4793
|
-
},
|
|
4843
|
+
}, Xa = ({
|
|
4794
4844
|
getAccessToken: e
|
|
4795
4845
|
}) => {
|
|
4796
4846
|
const t = V();
|
|
@@ -4807,7 +4857,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4807
4857
|
t.invalidateQueries({ queryKey: [v.CHATS, r.userId] });
|
|
4808
4858
|
}
|
|
4809
4859
|
});
|
|
4810
|
-
},
|
|
4860
|
+
}, Za = ({
|
|
4811
4861
|
user: e,
|
|
4812
4862
|
month: t,
|
|
4813
4863
|
year: s = (/* @__PURE__ */ new Date()).getFullYear().toString(),
|
|
@@ -4829,7 +4879,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4829
4879
|
type: R.GET_USAGE,
|
|
4830
4880
|
getAccessToken: i
|
|
4831
4881
|
})
|
|
4832
|
-
}),
|
|
4882
|
+
}), eo = ({
|
|
4833
4883
|
user: e,
|
|
4834
4884
|
query: t,
|
|
4835
4885
|
getAccessToken: s,
|
|
@@ -4842,7 +4892,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4842
4892
|
type: R.GET_USER_MEMORIES,
|
|
4843
4893
|
getAccessToken: s
|
|
4844
4894
|
})
|
|
4845
|
-
}),
|
|
4895
|
+
}), to = ({
|
|
4846
4896
|
getAccessToken: e
|
|
4847
4897
|
}) => {
|
|
4848
4898
|
const t = V();
|
|
@@ -4866,7 +4916,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4866
4916
|
});
|
|
4867
4917
|
}
|
|
4868
4918
|
});
|
|
4869
|
-
},
|
|
4919
|
+
}, so = ({
|
|
4870
4920
|
getAccessToken: e
|
|
4871
4921
|
}) => {
|
|
4872
4922
|
const t = V();
|
|
@@ -4890,7 +4940,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4890
4940
|
});
|
|
4891
4941
|
}
|
|
4892
4942
|
});
|
|
4893
|
-
},
|
|
4943
|
+
}, ro = ({
|
|
4894
4944
|
getAccessToken: e
|
|
4895
4945
|
}) => {
|
|
4896
4946
|
const t = V();
|
|
@@ -4909,7 +4959,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4909
4959
|
});
|
|
4910
4960
|
}
|
|
4911
4961
|
});
|
|
4912
|
-
},
|
|
4962
|
+
}, no = ({
|
|
4913
4963
|
getAccessToken: e
|
|
4914
4964
|
}) => {
|
|
4915
4965
|
const t = V();
|
|
@@ -4928,7 +4978,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4928
4978
|
});
|
|
4929
4979
|
}
|
|
4930
4980
|
});
|
|
4931
|
-
},
|
|
4981
|
+
}, io = ({
|
|
4932
4982
|
user: e,
|
|
4933
4983
|
query: t,
|
|
4934
4984
|
getAccessToken: s,
|
|
@@ -4941,7 +4991,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4941
4991
|
type: R.GET_EXPIRED_MEMORIES,
|
|
4942
4992
|
getAccessToken: s
|
|
4943
4993
|
})
|
|
4944
|
-
}),
|
|
4994
|
+
}), ao = ({
|
|
4945
4995
|
getAccessToken: e
|
|
4946
4996
|
}) => {
|
|
4947
4997
|
const t = V();
|
|
@@ -5003,20 +5053,20 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5003
5053
|
}
|
|
5004
5054
|
}, Gs = ut(
|
|
5005
5055
|
void 0
|
|
5006
|
-
),
|
|
5056
|
+
), Vt = {
|
|
5007
5057
|
capabilities: /* @__PURE__ */ new Set(),
|
|
5008
5058
|
allowedModels: [],
|
|
5009
5059
|
version: null,
|
|
5010
5060
|
status: "idle"
|
|
5011
|
-
},
|
|
5061
|
+
}, Di = ({
|
|
5012
5062
|
user: e,
|
|
5013
5063
|
getAccessToken: t,
|
|
5014
5064
|
children: s
|
|
5015
5065
|
}) => {
|
|
5016
|
-
const [r, n] = Xs(
|
|
5066
|
+
const [r, n] = Xs(Vt), i = Tt(
|
|
5017
5067
|
() => e ? `entitlements:${e}` : null,
|
|
5018
5068
|
[e]
|
|
5019
|
-
), a =
|
|
5069
|
+
), a = Q(() => {
|
|
5020
5070
|
if (!i)
|
|
5021
5071
|
return !1;
|
|
5022
5072
|
try {
|
|
@@ -5038,7 +5088,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5038
5088
|
me(() => {
|
|
5039
5089
|
r.status === "idle" && a();
|
|
5040
5090
|
}, [a, r.status]);
|
|
5041
|
-
const o =
|
|
5091
|
+
const o = $i({ user: e, getAccessToken: t });
|
|
5042
5092
|
me(() => {
|
|
5043
5093
|
o.isLoading && r.status === "idle" && n((d) => ({ ...d, status: "loading" }));
|
|
5044
5094
|
}, [o.isLoading, r.status]), me(() => {
|
|
@@ -5067,7 +5117,7 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5067
5117
|
} catch {
|
|
5068
5118
|
}
|
|
5069
5119
|
}, [o.data, i]);
|
|
5070
|
-
const c =
|
|
5120
|
+
const c = Q(
|
|
5071
5121
|
(d) => {
|
|
5072
5122
|
const l = d?.entitlements;
|
|
5073
5123
|
if (l && (n({
|
|
@@ -5089,16 +5139,16 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5089
5139
|
}
|
|
5090
5140
|
},
|
|
5091
5141
|
[i]
|
|
5092
|
-
), h =
|
|
5093
|
-
if (n(
|
|
5142
|
+
), h = Q(() => {
|
|
5143
|
+
if (n(Vt), i)
|
|
5094
5144
|
try {
|
|
5095
5145
|
sessionStorage.removeItem(i);
|
|
5096
5146
|
} catch {
|
|
5097
5147
|
}
|
|
5098
|
-
}, [i]), u =
|
|
5148
|
+
}, [i]), u = Tt(
|
|
5099
5149
|
() => ({
|
|
5100
5150
|
...r,
|
|
5101
|
-
check: (d, l) => r.status !== "ready" ? !1 :
|
|
5151
|
+
check: (d, l) => r.status !== "ready" ? !1 : rr(r.capabilities, d, { any: l?.any }),
|
|
5102
5152
|
loadFromProfile: c,
|
|
5103
5153
|
reset: h
|
|
5104
5154
|
}),
|
|
@@ -5106,34 +5156,34 @@ const Ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5106
5156
|
);
|
|
5107
5157
|
return /* @__PURE__ */ S(Gs.Provider, { value: u, children: s });
|
|
5108
5158
|
};
|
|
5109
|
-
function
|
|
5159
|
+
function oo() {
|
|
5110
5160
|
const e = lt(Gs);
|
|
5111
5161
|
if (!e)
|
|
5112
5162
|
throw new Error("useEntitlements must be used within EntitlementsProvider");
|
|
5113
5163
|
return e;
|
|
5114
5164
|
}
|
|
5115
|
-
const
|
|
5165
|
+
const Ni = new URL(document.location.href).searchParams, Jt = !!Ni.get("debug") || !1, Ui = zt(() => import(
|
|
5116
5166
|
/* webpackChunkName: "LazyApp" */
|
|
5117
|
-
"./App.
|
|
5118
|
-
).then((e) => e.App)),
|
|
5167
|
+
"./App.Dma2gxWb.js"
|
|
5168
|
+
).then((e) => e.App)), Li = zt(
|
|
5119
5169
|
() => import(
|
|
5120
5170
|
/* webpackChunkName: "LazyLogin" */
|
|
5121
|
-
"./LoginEntry.
|
|
5171
|
+
"./LoginEntry.4o6Zyxt5.js"
|
|
5122
5172
|
)
|
|
5123
|
-
),
|
|
5173
|
+
), Fi = new Cr(), Yt = ({
|
|
5124
5174
|
isComponent: e,
|
|
5125
5175
|
headerHeight: t
|
|
5126
5176
|
}) => {
|
|
5127
|
-
const { isAuthenticated: s, isLoading: r, user: n, getAccessToken: i } =
|
|
5128
|
-
return r ? /* @__PURE__ */ S("div", {}) : s ? /* @__PURE__ */ S(
|
|
5129
|
-
|
|
5177
|
+
const { isAuthenticated: s, isLoading: r, user: n, getAccessToken: i } = Ti();
|
|
5178
|
+
return r ? /* @__PURE__ */ S("div", {}) : s ? /* @__PURE__ */ S(At, { fallback: /* @__PURE__ */ S("div", {}), children: /* @__PURE__ */ S(Pr, { client: Fi, children: /* @__PURE__ */ S(
|
|
5179
|
+
Di,
|
|
5130
5180
|
{
|
|
5131
5181
|
user: n?.username,
|
|
5132
5182
|
getAccessToken: i,
|
|
5133
|
-
children: /* @__PURE__ */ S(
|
|
5183
|
+
children: /* @__PURE__ */ S(Ui, { isComponent: e, headerHeight: t })
|
|
5134
5184
|
}
|
|
5135
|
-
) }) }) : /* @__PURE__ */ S(
|
|
5136
|
-
},
|
|
5185
|
+
) }) }) : /* @__PURE__ */ S(At, { fallback: /* @__PURE__ */ S("div", {}), children: /* @__PURE__ */ S(Li, {}) });
|
|
5186
|
+
}, Ki = ({
|
|
5137
5187
|
isComponent: e = !1,
|
|
5138
5188
|
headerHeight: t = 0,
|
|
5139
5189
|
domain: s = Hs,
|
|
@@ -5142,112 +5192,112 @@ const $i = new URL(document.location.href).searchParams, Vt = !!$i.get("debug")
|
|
|
5142
5192
|
`==> [${Date.now()}] Bootstrapping SassySaint Client with props: `,
|
|
5143
5193
|
{ isComponent: e, domain: s, headerHeight: t, extraProps: r }
|
|
5144
5194
|
), He ? /* @__PURE__ */ S(
|
|
5145
|
-
|
|
5195
|
+
jt,
|
|
5146
5196
|
{
|
|
5147
|
-
clientId:
|
|
5197
|
+
clientId: Wt,
|
|
5148
5198
|
domain: s,
|
|
5149
|
-
debug:
|
|
5199
|
+
debug: Jt,
|
|
5150
5200
|
endpoint: process.env.PUBLIC_AUTH_SERVER_URL,
|
|
5151
|
-
children: /* @__PURE__ */ S(
|
|
5201
|
+
children: /* @__PURE__ */ S(Yt, { isComponent: e, headerHeight: t })
|
|
5152
5202
|
}
|
|
5153
|
-
) : /* @__PURE__ */ S(
|
|
5154
|
-
|
|
5203
|
+
) : /* @__PURE__ */ S(jt, { clientId: Wt, domain: s, debug: Jt, children: /* @__PURE__ */ S(Yt, { isComponent: e, headerHeight: t }) })), co = ({ domain: e, headerHeight: t }) => /* @__PURE__ */ S(
|
|
5204
|
+
Ki,
|
|
5155
5205
|
{
|
|
5156
5206
|
isComponent: !0,
|
|
5157
5207
|
domain: e,
|
|
5158
5208
|
headerHeight: t,
|
|
5159
|
-
extraProps: [
|
|
5209
|
+
extraProps: [nr, ir]
|
|
5160
5210
|
}
|
|
5161
5211
|
);
|
|
5162
5212
|
export {
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5213
|
+
da as ACTION_RESET_PROMPT,
|
|
5214
|
+
ca as ACTION_SEARCH,
|
|
5215
|
+
ua as ACTION_SORT,
|
|
5216
|
+
la as ACTION_TOGGLE_PROMPT,
|
|
5217
|
+
$a as DEFAULT_ICON_ACTION_SIZE,
|
|
5218
|
+
T as E,
|
|
5219
|
+
oa as ERROR_MESSAGE,
|
|
5220
|
+
Xi as F,
|
|
5221
|
+
Pa as INFINITE_SCROLL_LIMIT,
|
|
5222
|
+
Ca as INFINITE_SCROLL_THRESHOLD,
|
|
5223
|
+
Fa as INPUT_BOTTOM_OFFSET,
|
|
5224
|
+
Ga as INPUT_BOTTOM_OFFSET_EXTRA,
|
|
5225
|
+
Ha as INPUT_BOTTOM_OFFSET_IPAD,
|
|
5226
|
+
Ka as INPUT_BOTTOM_OFFSET_IPHONE,
|
|
5227
|
+
Ia as LOCAL_STORAGE_CHAT_ID,
|
|
5228
|
+
Sa as LOCAL_STORAGE_FAVORITES_ONLY,
|
|
5229
|
+
_a as LOCAL_STORAGE_FULL_SCREEN,
|
|
5230
|
+
wa as LOCAL_STORAGE_KEYWORD_MATCH_ALL,
|
|
5231
|
+
Oa as LOCAL_STORAGE_OLED_MODE,
|
|
5232
|
+
ha as LOCAL_STORAGE_PREFIX,
|
|
5233
|
+
Ra as LOCAL_STORAGE_PRIVATE_DISCLOSURE,
|
|
5234
|
+
ba as LOCAL_STORAGE_REASONING_DISCLOSURE,
|
|
5235
|
+
fa as LOCAL_STORAGE_SEARCH,
|
|
5236
|
+
pa as LOCAL_STORAGE_SORT,
|
|
5237
|
+
ga as LOCAL_STORAGE_SORT_MEMORY_COLUMN,
|
|
5238
|
+
Ea as LOCAL_STORAGE_SORT_MEMORY_DIRECTION,
|
|
5239
|
+
ya as LOCAL_STORAGE_SORT_TIMESTAMP,
|
|
5240
|
+
ma as LOCAL_STORAGE_SORT_TOKEN_USAGE,
|
|
5241
|
+
va as LOCAL_STORAGE_USAGE_SELECTED_MONTH,
|
|
5242
|
+
Aa as LOCAL_STORAGE_USAGE_TIME_RANGE,
|
|
5243
|
+
Ta as LOCAL_STORAGE_USAGE_VIEW_MODE,
|
|
5244
|
+
Ma as PROMPT_CLASSNAME,
|
|
5245
|
+
ka as PROMPT_EDITABLE_AREA_CLASSNAME,
|
|
5246
|
+
Qi as R,
|
|
5197
5247
|
R as SERVICE_TYPES,
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5248
|
+
co as SassySaint,
|
|
5249
|
+
Na as UI_BUTTON_SCROLL_BUFFER,
|
|
5250
|
+
Ua as UI_DEFAULT_MAIN_HEIGHT,
|
|
5251
|
+
La as UI_DEFAULT_MAIN_HEIGHT_IPHONE,
|
|
5252
|
+
Da as UI_FOOTER_BUFFER,
|
|
5253
|
+
Yi as V,
|
|
5254
|
+
sr as W,
|
|
5255
|
+
ta as X,
|
|
5256
|
+
sa as Z,
|
|
5206
5257
|
xe as a,
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5258
|
+
Ci as applyOledMode,
|
|
5259
|
+
zi as b,
|
|
5260
|
+
Wi as c,
|
|
5261
|
+
_i as canEvaluateModels,
|
|
5262
|
+
qi as e,
|
|
5263
|
+
Mi as formatTimestamp,
|
|
5264
|
+
Ai as getCurrentGeoLocation,
|
|
5265
|
+
bi as getLayoutPaddingClass,
|
|
5266
|
+
Ri as getMessageContaintWrapperClass,
|
|
5215
5267
|
J as graphQLRequest,
|
|
5216
5268
|
dt as i,
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
T as r,
|
|
5224
|
-
Ti as renderDataAsList,
|
|
5269
|
+
Ii as isTauri,
|
|
5270
|
+
ea as j,
|
|
5271
|
+
Ti as n,
|
|
5272
|
+
Bi as n$1,
|
|
5273
|
+
ji as o,
|
|
5274
|
+
vi as renderDataAsList,
|
|
5225
5275
|
ht as s,
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5276
|
+
ki as serverUrl,
|
|
5277
|
+
qa as setNewProvider,
|
|
5278
|
+
Ba as setUserPlan,
|
|
5229
5279
|
Ae as st,
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5280
|
+
Qa as useChangelogs,
|
|
5281
|
+
Ja as useChat,
|
|
5282
|
+
Va as useChatsHistory,
|
|
5283
|
+
Za as useChatsUsage,
|
|
5284
|
+
ro as useDeleteAllActiveMemories,
|
|
5285
|
+
no as useDeleteAllExpiredMemories,
|
|
5286
|
+
za as useDeleteChat,
|
|
5287
|
+
so as useDeleteMemory,
|
|
5288
|
+
oo as useEntitlements,
|
|
5289
|
+
io as useExpiredMemories,
|
|
5240
5290
|
V as useQueryClient,
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5291
|
+
ao as useRestoreMemory,
|
|
5292
|
+
Ya as useSaveChat,
|
|
5293
|
+
ja as useServerCapabilities,
|
|
5294
|
+
Xa as useToggleFavoriteChat,
|
|
5295
|
+
to as useUpdateMemory,
|
|
5296
|
+
Wa as useUserChatStats,
|
|
5297
|
+
eo as useUserMemories,
|
|
5298
|
+
$i as useUserPreferences,
|
|
5299
|
+
xa as utilities,
|
|
5250
5300
|
Vi as v,
|
|
5251
|
-
|
|
5252
|
-
|
|
5301
|
+
Zi as x,
|
|
5302
|
+
Ji as y
|
|
5253
5303
|
};
|