@aikaara/chat-sdk 1.5.4 → 1.5.5
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/{AikaaraLinkButton-DsJc3CEK.mjs → AikaaraLinkButton-B-Hg4pN2.mjs} +1 -1
- package/dist/{AikaaraLinkButton-CBAy6ItK.cjs → AikaaraLinkButton-Cu9jSZv5.cjs} +1 -1
- package/dist/{MountTenant-BEaYaZMk.cjs → MountTenant-CNCe6O7V.cjs} +16 -16
- package/dist/{MountTenant-DcEbdQPG.mjs → MountTenant-DAXqSVy4.mjs} +260 -226
- package/dist/cdn/aikaara-chat.iife.js +23 -23
- package/dist/headless.cjs +1 -1
- package/dist/headless.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -1
|
@@ -11966,6 +11966,34 @@ function Ah(s) {
|
|
|
11966
11966
|
};
|
|
11967
11967
|
}
|
|
11968
11968
|
const Ih = "^[A-Z]{4}[0-9]{5}[A-Z]$", Th = "^[A-Z]{4}0[A-Z0-9]{6}$", Ch = {
|
|
11969
|
+
id: "house-property",
|
|
11970
|
+
title: "House Property",
|
|
11971
|
+
icon: "🏠",
|
|
11972
|
+
dataPath: "hpDetails[]",
|
|
11973
|
+
repeatable: { maxCount: 2, labelTemplate: "Property {index}" },
|
|
11974
|
+
entryIcon: "🏠",
|
|
11975
|
+
fields: [
|
|
11976
|
+
{ id: "rentalIncome", type: "number", label: "Rental Income", currency: "₹", min: 0 },
|
|
11977
|
+
{ id: "propertyTax", type: "number", label: "Municipal Taxes", currency: "₹", min: 0 },
|
|
11978
|
+
{
|
|
11979
|
+
id: "homeLoanDetails",
|
|
11980
|
+
type: "group",
|
|
11981
|
+
title: "Home Loan Details",
|
|
11982
|
+
fields: [
|
|
11983
|
+
{ id: "lenderName", type: "text", label: "Bank / Institute Name", required: !0 },
|
|
11984
|
+
{ id: "sanctionDate", type: "date", label: "Loan Sanction Date", format: "DD/MM/YYYY", required: !0 },
|
|
11985
|
+
{ id: "loanAccountNumber", type: "text", label: "Loan Account No.", required: !0 },
|
|
11986
|
+
{ id: "totalLoanAmount", type: "number", label: "Total Loan Amount", currency: "₹", min: 0 },
|
|
11987
|
+
{ id: "outstandingAmount", type: "number", label: "Outstanding Loan", currency: "₹", min: 0 },
|
|
11988
|
+
// No max: the ₹2,00,000 figure is a *deduction* cap applied by the
|
|
11989
|
+
// return, not a limit on what the taxpayer actually paid. Capping the
|
|
11990
|
+
// input rejected real values (this payload has ₹2,21,200).
|
|
11991
|
+
{ id: "homeLoanInterest", type: "number", label: "Interest Paid", currency: "₹", min: 0 }
|
|
11992
|
+
]
|
|
11993
|
+
}
|
|
11994
|
+
],
|
|
11995
|
+
submitLabel: "Save"
|
|
11996
|
+
}, Oh = {
|
|
11969
11997
|
id: "salary-hra",
|
|
11970
11998
|
title: "Salary / HRA / Allowances",
|
|
11971
11999
|
icon: "💰",
|
|
@@ -12001,7 +12029,7 @@ const Ih = "^[A-Z]{4}[0-9]{5}[A-Z]$", Th = "^[A-Z]{4}0[A-Z0-9]{6}$", Ch = {
|
|
|
12001
12029
|
}
|
|
12002
12030
|
],
|
|
12003
12031
|
submitLabel: "Save"
|
|
12004
|
-
},
|
|
12032
|
+
}, Ph = {
|
|
12005
12033
|
id: "other-sources",
|
|
12006
12034
|
title: "Income from Other Sources",
|
|
12007
12035
|
icon: "💵",
|
|
@@ -12027,7 +12055,7 @@ const Ih = "^[A-Z]{4}[0-9]{5}[A-Z]$", Th = "^[A-Z]{4}0[A-Z0-9]{6}$", Ch = {
|
|
|
12027
12055
|
}
|
|
12028
12056
|
],
|
|
12029
12057
|
submitLabel: "Save"
|
|
12030
|
-
},
|
|
12058
|
+
}, Mh = {
|
|
12031
12059
|
id: "crypto-income",
|
|
12032
12060
|
title: "Crypto Income",
|
|
12033
12061
|
icon: "🪙",
|
|
@@ -12044,7 +12072,7 @@ const Ih = "^[A-Z]{4}[0-9]{5}[A-Z]$", Th = "^[A-Z]{4}0[A-Z0-9]{6}$", Ch = {
|
|
|
12044
12072
|
}
|
|
12045
12073
|
],
|
|
12046
12074
|
submitLabel: "Save"
|
|
12047
|
-
},
|
|
12075
|
+
}, Rh = {
|
|
12048
12076
|
id: "business-profession",
|
|
12049
12077
|
title: "Business / Profession",
|
|
12050
12078
|
icon: "💼",
|
|
@@ -12084,7 +12112,7 @@ const Ih = "^[A-Z]{4}[0-9]{5}[A-Z]$", Th = "^[A-Z]{4}0[A-Z0-9]{6}$", Ch = {
|
|
|
12084
12112
|
}
|
|
12085
12113
|
],
|
|
12086
12114
|
submitLabel: "Save"
|
|
12087
|
-
},
|
|
12115
|
+
}, Lh = {
|
|
12088
12116
|
id: "bank-details",
|
|
12089
12117
|
title: "Personal / Bank Details",
|
|
12090
12118
|
icon: "🏦",
|
|
@@ -12119,22 +12147,22 @@ const Ih = "^[A-Z]{4}[0-9]{5}[A-Z]$", Th = "^[A-Z]{4}0[A-Z0-9]{6}$", Ch = {
|
|
|
12119
12147
|
// },
|
|
12120
12148
|
],
|
|
12121
12149
|
submitLabel: "Save"
|
|
12122
|
-
},
|
|
12123
|
-
Ch,
|
|
12124
|
-
Mh,
|
|
12150
|
+
}, Nh = [
|
|
12125
12151
|
Oh,
|
|
12152
|
+
Rh,
|
|
12126
12153
|
Ph,
|
|
12127
|
-
|
|
12154
|
+
Mh,
|
|
12155
|
+
Ch,
|
|
12156
|
+
Lh
|
|
12128
12157
|
// Hidden for now — re-enable to restore the full set:
|
|
12129
12158
|
// capitalGains,
|
|
12130
12159
|
// agriculturalIncome,
|
|
12131
12160
|
// exemptIncome,
|
|
12132
|
-
// houseProperty,
|
|
12133
12161
|
// deductions,
|
|
12134
12162
|
// taxPaidTds,
|
|
12135
12163
|
// haveAQuestion,
|
|
12136
12164
|
];
|
|
12137
|
-
function
|
|
12165
|
+
function jh(s, e) {
|
|
12138
12166
|
const t = s || {}, r = {
|
|
12139
12167
|
userId: Yt(e.userId),
|
|
12140
12168
|
assessmentYear: e.assessmentYear,
|
|
@@ -12157,9 +12185,9 @@ function Nh(s, e) {
|
|
|
12157
12185
|
amount: Ie(t.immovableAssetCost)
|
|
12158
12186
|
};
|
|
12159
12187
|
Object.values(a).some((u) => u !== void 0) && (r.immovableAsset = [a]);
|
|
12160
|
-
const l = nn(t.hpDetails,
|
|
12188
|
+
const l = nn(t.hpDetails, Uh);
|
|
12161
12189
|
l.length && (r.hpDetails = l);
|
|
12162
|
-
const c = nn(t.salaryDetails,
|
|
12190
|
+
const c = nn(t.salaryDetails, Bh);
|
|
12163
12191
|
if (c.length) {
|
|
12164
12192
|
r.salaryIncome = c;
|
|
12165
12193
|
const u = nn(t.salaryDetails, (p) => ({
|
|
@@ -12172,13 +12200,13 @@ function Nh(s, e) {
|
|
|
12172
12200
|
}
|
|
12173
12201
|
return zr(r);
|
|
12174
12202
|
}
|
|
12175
|
-
function
|
|
12203
|
+
function Uh(s) {
|
|
12176
12204
|
const e = {
|
|
12177
12205
|
loanType: "HOME_LOAN",
|
|
12178
12206
|
loanTakenFrom: Pe(s.loanTakenFrom),
|
|
12179
12207
|
bankOrInstituteName: Pe(s.lenderName),
|
|
12180
12208
|
loanAccountNo: Pe(s.loanAccountNumber),
|
|
12181
|
-
loanSanctionDate:
|
|
12209
|
+
loanSanctionDate: Wh(s.sanctionDate),
|
|
12182
12210
|
totalLoanAmount: Ie(s.totalLoanAmount),
|
|
12183
12211
|
interest: Ie(s.homeLoanInterest)
|
|
12184
12212
|
}, t = Object.entries(e).some(([r, o]) => r !== "loanType" && o !== void 0);
|
|
@@ -12199,7 +12227,7 @@ function jh(s) {
|
|
|
12199
12227
|
loanDetails: t ? [e] : void 0
|
|
12200
12228
|
};
|
|
12201
12229
|
}
|
|
12202
|
-
function
|
|
12230
|
+
function Bh(s) {
|
|
12203
12231
|
return {
|
|
12204
12232
|
grossSalaryIncome: Ie(s.grossSalary),
|
|
12205
12233
|
salary: Ie(s.basicSalary),
|
|
@@ -12215,7 +12243,7 @@ function Uh(s) {
|
|
|
12215
12243
|
}
|
|
12216
12244
|
};
|
|
12217
12245
|
}
|
|
12218
|
-
function
|
|
12246
|
+
function Dh(s, e) {
|
|
12219
12247
|
const t = [];
|
|
12220
12248
|
for (const r of s) {
|
|
12221
12249
|
const o = Pe(r.employerName), n = Pe(r.employerTan), i = Ie(r.grossSalary), a = Ie(r.basicSalary), l = Ie(r.totalTdsDeposited);
|
|
@@ -12234,7 +12262,7 @@ function Bh(s, e) {
|
|
|
12234
12262
|
salary: t
|
|
12235
12263
|
} : null;
|
|
12236
12264
|
}
|
|
12237
|
-
function
|
|
12265
|
+
function $h(s, e) {
|
|
12238
12266
|
const t = Pe(s.aadhaarNumber), r = Pe(s.bankAccountNumber), o = Pe(s.bankIfscCode);
|
|
12239
12267
|
return t === void 0 && r === void 0 && o === void 0 ? null : {
|
|
12240
12268
|
userId: Yt(e.userId),
|
|
@@ -12243,7 +12271,7 @@ function Dh(s, e) {
|
|
|
12243
12271
|
bankDetails: [{ bankAccountNumber: r, bankIfscCode: o }]
|
|
12244
12272
|
};
|
|
12245
12273
|
}
|
|
12246
|
-
function
|
|
12274
|
+
function Fh(s, e) {
|
|
12247
12275
|
return {
|
|
12248
12276
|
userId: Yt(e.userId),
|
|
12249
12277
|
assessmentYear: e.assessmentYear,
|
|
@@ -12254,7 +12282,7 @@ function $h(s, e) {
|
|
|
12254
12282
|
familyPension: Ie(s.familyPension) ?? 0
|
|
12255
12283
|
};
|
|
12256
12284
|
}
|
|
12257
|
-
function
|
|
12285
|
+
function qh(s, e) {
|
|
12258
12286
|
const t = Ie(s.cryptoSellPrice), r = Ie(s.cryptoPurchasePrice);
|
|
12259
12287
|
return t === void 0 && r === void 0 ? null : {
|
|
12260
12288
|
userId: Yt(e.userId),
|
|
@@ -12263,7 +12291,7 @@ function Fh(s, e) {
|
|
|
12263
12291
|
vdaSellCost: t ?? 0
|
|
12264
12292
|
};
|
|
12265
12293
|
}
|
|
12266
|
-
function
|
|
12294
|
+
function Hh(s, e) {
|
|
12267
12295
|
const t = (o, n, i, a) => {
|
|
12268
12296
|
const l = Pe(s[o]), c = Pe(s[n]), u = Ie(s[i]), h = Ie(s[a]);
|
|
12269
12297
|
return l === void 0 && c === void 0 && u === void 0 && h === void 0 ? null : {
|
|
@@ -12300,7 +12328,7 @@ function Pe(s) {
|
|
|
12300
12328
|
function lo(s) {
|
|
12301
12329
|
return s === !0 || s === !1 ? s : void 0;
|
|
12302
12330
|
}
|
|
12303
|
-
function
|
|
12331
|
+
function Wh(s) {
|
|
12304
12332
|
const e = Pe(s);
|
|
12305
12333
|
if (e)
|
|
12306
12334
|
return e.includes("T") ? e : /^\d{4}-\d{2}-\d{2}$/.test(e) ? `${e}T00:00:00Z` : e;
|
|
@@ -12326,10 +12354,10 @@ function zr(s) {
|
|
|
12326
12354
|
}
|
|
12327
12355
|
return s;
|
|
12328
12356
|
}
|
|
12329
|
-
function
|
|
12357
|
+
function zh(s) {
|
|
12330
12358
|
const e = s && typeof s == "object" ? s : {}, t = {}, r = De(e.employers), o = De(e.taxPaid?.onSalary);
|
|
12331
12359
|
r.length && (t.salaryDetails = r.map((h) => {
|
|
12332
|
-
const p = on(h.salary), b = on(h.perquisites), d = on(h.profitsInLieuOfSalaryType), g = p + b + d, y =
|
|
12360
|
+
const p = on(h.salary), b = on(h.perquisites), d = on(h.profitsInLieuOfSalaryType), g = p + b + d, y = Gh(h.allowance);
|
|
12333
12361
|
return {
|
|
12334
12362
|
employerName: Re(h.employerName),
|
|
12335
12363
|
employerTan: Re(h.employerTAN),
|
|
@@ -12340,7 +12368,7 @@ function Wh(s) {
|
|
|
12340
12368
|
leaveTravelAllowance: y.lta,
|
|
12341
12369
|
leaveEncashment: y.leaveEncashment,
|
|
12342
12370
|
anyOtherAllowance: y.other,
|
|
12343
|
-
totalTdsDeposited:
|
|
12371
|
+
totalTdsDeposited: Kh(h, o, r) ?? Ne(h.totalTdsDeposited)
|
|
12344
12372
|
};
|
|
12345
12373
|
}));
|
|
12346
12374
|
const n = De(e.houseProperties);
|
|
@@ -12351,7 +12379,7 @@ function Wh(s) {
|
|
|
12351
12379
|
loanTakenFrom: Re(b?.loanTakenFrom),
|
|
12352
12380
|
lenderName: Re(b?.bankOrInstituteName),
|
|
12353
12381
|
loanAccountNumber: Re(b?.loanAccountNo),
|
|
12354
|
-
sanctionDate:
|
|
12382
|
+
sanctionDate: Vh(b?.loanSanctionDate),
|
|
12355
12383
|
totalLoanAmount: Ne(b?.totalLoanAmount),
|
|
12356
12384
|
outstandingAmount: Ne(b?.loanOutstandingAmount),
|
|
12357
12385
|
homeLoanInterest: g,
|
|
@@ -12400,10 +12428,16 @@ function Wh(s) {
|
|
|
12400
12428
|
const u = De(e.bankDetails)[0];
|
|
12401
12429
|
return u && (t.bankAccountNumber = Re(u.accountNumber), t.bankIfscCode = Re(u.ifsCode)), Rl(t);
|
|
12402
12430
|
}
|
|
12431
|
+
function Vh(s) {
|
|
12432
|
+
const e = Re(s);
|
|
12433
|
+
if (!e) return;
|
|
12434
|
+
const t = /^(\d{4}-\d{2}-\d{2})/.exec(e);
|
|
12435
|
+
return t ? t[1] : e;
|
|
12436
|
+
}
|
|
12403
12437
|
function on(s) {
|
|
12404
12438
|
return De(s).reduce((e, t) => e + (Ne(t.taxableAmount) ?? 0), 0);
|
|
12405
12439
|
}
|
|
12406
|
-
function
|
|
12440
|
+
function Kh(s, e, t) {
|
|
12407
12441
|
if (!e.length) return;
|
|
12408
12442
|
const r = Re(s.employerTAN)?.trim().toUpperCase();
|
|
12409
12443
|
if (r) {
|
|
@@ -12418,7 +12452,7 @@ function zh(s, e, t) {
|
|
|
12418
12452
|
if (t.length === 1 && e.length === 1)
|
|
12419
12453
|
return Ne(e[0].totalTdsDeposited);
|
|
12420
12454
|
}
|
|
12421
|
-
function
|
|
12455
|
+
function Gh(s) {
|
|
12422
12456
|
const e = De(s);
|
|
12423
12457
|
if (!e.length) return {};
|
|
12424
12458
|
let t, r, o, n;
|
|
@@ -12473,23 +12507,23 @@ function sn() {
|
|
|
12473
12507
|
return console.warn(
|
|
12474
12508
|
"[smart-edit] API disabled: window.__aikaara_runtime__.getChatJwt is missing — the chat was not mounted via the SDK mountFromSlug path."
|
|
12475
12509
|
), null;
|
|
12476
|
-
const t = s.__aikaara_descriptor__ ?? {}, r =
|
|
12510
|
+
const t = s.__aikaara_descriptor__ ?? {}, r = rd(t);
|
|
12477
12511
|
if (!r)
|
|
12478
12512
|
return console.warn(
|
|
12479
12513
|
"[smart-edit] API disabled: could not resolve a TaxBuddy API host from the descriptor (cloud / upload / pan / leader endpoints)."
|
|
12480
12514
|
), null;
|
|
12481
|
-
const o =
|
|
12515
|
+
const o = nd(e.slug), n = typeof o?.tenantJwt == "string" ? o.tenantJwt : "", i = e.getChatJwt, a = async () => n || await i(), l = (o && o.userId != null && o.userId !== "" ? String(o.userId) : od(e.identity)) || void 0;
|
|
12482
12516
|
return console.info("[smart-edit] API config — base:", r, "· userId:", l ?? "(none)"), {
|
|
12483
12517
|
baseUrl: r,
|
|
12484
12518
|
getToken: a,
|
|
12485
|
-
headers:
|
|
12486
|
-
assessmentYear: t.itr?.assessmentYear ||
|
|
12519
|
+
headers: id(t.auth?.headers),
|
|
12520
|
+
assessmentYear: t.itr?.assessmentYear || sd(),
|
|
12487
12521
|
isRevised: "N",
|
|
12488
12522
|
userId: l,
|
|
12489
12523
|
submitUrl: t.itr?.automationSubmitUrl || void 0
|
|
12490
12524
|
};
|
|
12491
12525
|
}
|
|
12492
|
-
async function
|
|
12526
|
+
async function Yh(s) {
|
|
12493
12527
|
const e = await s.getToken(), t = s.userId;
|
|
12494
12528
|
if (!t)
|
|
12495
12529
|
throw new Error(
|
|
@@ -12507,11 +12541,11 @@ async function Kh(s) {
|
|
|
12507
12541
|
const o = await r.text().catch(() => "");
|
|
12508
12542
|
throw new Error(`[smart-edit] GET /itr/latest-itr → ${r.status} ${o.slice(0, 200)}`);
|
|
12509
12543
|
}
|
|
12510
|
-
return
|
|
12544
|
+
return zh(Ao(await r.json().catch(() => ({}))));
|
|
12511
12545
|
}
|
|
12512
|
-
async function
|
|
12546
|
+
async function Jh(s, e) {
|
|
12513
12547
|
const t = await s.getToken(), r = s.userId, o = {
|
|
12514
|
-
...
|
|
12548
|
+
...jh(e, {
|
|
12515
12549
|
userId: r,
|
|
12516
12550
|
assessmentYear: s.assessmentYear,
|
|
12517
12551
|
isRevised: s.isRevised
|
|
@@ -12535,19 +12569,19 @@ async function Gh(s, e) {
|
|
|
12535
12569
|
}
|
|
12536
12570
|
return Ao(await a.json().catch(() => ({})));
|
|
12537
12571
|
}
|
|
12538
|
-
async function
|
|
12572
|
+
async function Qh(s, e) {
|
|
12539
12573
|
return ur(s, `${s.baseUrl}/itr/v1/automation/salary`, e);
|
|
12540
12574
|
}
|
|
12541
|
-
async function
|
|
12575
|
+
async function Xh(s, e) {
|
|
12542
12576
|
return ur(s, `${s.baseUrl}/itr/v1/automation/bank-aadhaar`, e);
|
|
12543
12577
|
}
|
|
12544
|
-
async function
|
|
12578
|
+
async function Zh(s, e) {
|
|
12545
12579
|
return ur(s, s.submitUrl || `${s.baseUrl}/itr/v1/automation/data`, e);
|
|
12546
12580
|
}
|
|
12547
|
-
async function
|
|
12581
|
+
async function ed(s, e) {
|
|
12548
12582
|
return ur(s, s.submitUrl || `${s.baseUrl}/itr/v1/automation/data`, e);
|
|
12549
12583
|
}
|
|
12550
|
-
async function
|
|
12584
|
+
async function td(s, e) {
|
|
12551
12585
|
return ur(s, `${s.baseUrl}/itr/v1/automation/vda`, e);
|
|
12552
12586
|
}
|
|
12553
12587
|
async function ur(s, e, t) {
|
|
@@ -12565,7 +12599,7 @@ async function ur(s, e, t) {
|
|
|
12565
12599
|
}
|
|
12566
12600
|
return Ao(await n.json().catch(() => ({})));
|
|
12567
12601
|
}
|
|
12568
|
-
function
|
|
12602
|
+
function rd(s) {
|
|
12569
12603
|
const e = [
|
|
12570
12604
|
s.cloud?.listEndpoint,
|
|
12571
12605
|
s.cloud?.downloadEndpoint,
|
|
@@ -12583,7 +12617,7 @@ function ed(s) {
|
|
|
12583
12617
|
}
|
|
12584
12618
|
return null;
|
|
12585
12619
|
}
|
|
12586
|
-
function
|
|
12620
|
+
function nd(s) {
|
|
12587
12621
|
if (!s || typeof localStorage > "u") return null;
|
|
12588
12622
|
try {
|
|
12589
12623
|
const e = localStorage.getItem(`aikaara_sso:${s}`);
|
|
@@ -12594,7 +12628,7 @@ function td(s) {
|
|
|
12594
12628
|
return null;
|
|
12595
12629
|
}
|
|
12596
12630
|
}
|
|
12597
|
-
function
|
|
12631
|
+
function id(s) {
|
|
12598
12632
|
const e = {};
|
|
12599
12633
|
if (!s) return e;
|
|
12600
12634
|
const t = /^(authorization|content-type|accept)$/i;
|
|
@@ -12602,7 +12636,7 @@ function rd(s) {
|
|
|
12602
12636
|
!t.test(r) && typeof o == "string" && (e[r] = o);
|
|
12603
12637
|
return e;
|
|
12604
12638
|
}
|
|
12605
|
-
function
|
|
12639
|
+
function od(s) {
|
|
12606
12640
|
if (!s) return;
|
|
12607
12641
|
const e = s.userId ?? s.id ?? s.ext_uid ?? s.extUid;
|
|
12608
12642
|
return e == null || e === "" ? void 0 : String(e);
|
|
@@ -12614,11 +12648,11 @@ function Ao(s) {
|
|
|
12614
12648
|
}
|
|
12615
12649
|
return {};
|
|
12616
12650
|
}
|
|
12617
|
-
function
|
|
12651
|
+
function sd() {
|
|
12618
12652
|
const s = /* @__PURE__ */ new Date(), e = s.getMonth() >= 3 ? s.getFullYear() : s.getFullYear() - 1;
|
|
12619
12653
|
return `${e}-${e + 1}`;
|
|
12620
12654
|
}
|
|
12621
|
-
class
|
|
12655
|
+
class ad {
|
|
12622
12656
|
client;
|
|
12623
12657
|
panel;
|
|
12624
12658
|
bubble;
|
|
@@ -12757,11 +12791,11 @@ class od {
|
|
|
12757
12791
|
*/
|
|
12758
12792
|
async openSmartEdit() {
|
|
12759
12793
|
const e = this.ensureSmartEditModal();
|
|
12760
|
-
e.open({ schemas:
|
|
12794
|
+
e.open({ schemas: Nh, data: {} });
|
|
12761
12795
|
const t = sn();
|
|
12762
12796
|
if (!(!t || !t.baseUrl))
|
|
12763
12797
|
try {
|
|
12764
|
-
const r = await
|
|
12798
|
+
const r = await Yh(t);
|
|
12765
12799
|
e.setData(r);
|
|
12766
12800
|
} catch (r) {
|
|
12767
12801
|
console.warn("[smart-edit] fetch failed", r), this.errorBanner.show(
|
|
@@ -12794,19 +12828,19 @@ class od {
|
|
|
12794
12828
|
const o = { userId: r.userId, assessmentYear: r.assessmentYear };
|
|
12795
12829
|
try {
|
|
12796
12830
|
if (e === "salary-hra") {
|
|
12797
|
-
const n = Array.isArray(t.salaryDetails) ? t.salaryDetails : [], i =
|
|
12798
|
-
i && await
|
|
12831
|
+
const n = Array.isArray(t.salaryDetails) ? t.salaryDetails : [], i = Dh(n, o);
|
|
12832
|
+
i && await Qh(r, i);
|
|
12799
12833
|
} else if (e === "bank-details") {
|
|
12800
|
-
const n =
|
|
12801
|
-
n && await
|
|
12834
|
+
const n = $h(t, o);
|
|
12835
|
+
n && await Xh(r, n);
|
|
12802
12836
|
} else if (e === "other-sources")
|
|
12803
|
-
await
|
|
12837
|
+
await Zh(r, Fh(t, o));
|
|
12804
12838
|
else if (e === "business-profession") {
|
|
12805
|
-
const n =
|
|
12806
|
-
n && await
|
|
12839
|
+
const n = Hh(t, o);
|
|
12840
|
+
n && await ed(r, n);
|
|
12807
12841
|
} else if (e === "crypto-income") {
|
|
12808
|
-
const n =
|
|
12809
|
-
n && await
|
|
12842
|
+
const n = qh(t, o);
|
|
12843
|
+
n && await td(r, n);
|
|
12810
12844
|
}
|
|
12811
12845
|
} catch (n) {
|
|
12812
12846
|
console.warn("[smart-edit] section save failed", e, n), this.errorBanner.show("Failed to save. Please try again.", 4e3);
|
|
@@ -12826,7 +12860,7 @@ class od {
|
|
|
12826
12860
|
return;
|
|
12827
12861
|
}
|
|
12828
12862
|
try {
|
|
12829
|
-
await
|
|
12863
|
+
await Jh(t, e);
|
|
12830
12864
|
} catch (r) {
|
|
12831
12865
|
console.warn("[smart-edit] save failed", r), this.errorBanner.show(
|
|
12832
12866
|
"Failed to save your ITR details. Please try again.",
|
|
@@ -12842,7 +12876,7 @@ class od {
|
|
|
12842
12876
|
}, 200)));
|
|
12843
12877
|
}
|
|
12844
12878
|
}
|
|
12845
|
-
class
|
|
12879
|
+
class ld extends HTMLElement {
|
|
12846
12880
|
shadow;
|
|
12847
12881
|
controller = null;
|
|
12848
12882
|
_config = {};
|
|
@@ -13111,7 +13145,7 @@ class sd extends HTMLElement {
|
|
|
13111
13145
|
}
|
|
13112
13146
|
async initController() {
|
|
13113
13147
|
const e = this.getConfig(), t = e.transport ?? "aikaara";
|
|
13114
|
-
(t === "aikaara" || t === "dual") && (!e.baseUrl || !e.userToken) || (this.controller?.disconnect(), this.controller = new
|
|
13148
|
+
(t === "aikaara" || t === "dual") && (!e.baseUrl || !e.userToken) || (this.controller?.disconnect(), this.controller = new ad(e, this.shadow, {
|
|
13115
13149
|
uploadAdapter: this._config.uploadAdapter,
|
|
13116
13150
|
historyAdapter: this._config.historyAdapter
|
|
13117
13151
|
}), await this.controller.connect());
|
|
@@ -13131,7 +13165,7 @@ class sd extends HTMLElement {
|
|
|
13131
13165
|
}
|
|
13132
13166
|
}
|
|
13133
13167
|
}
|
|
13134
|
-
class
|
|
13168
|
+
class cd extends HTMLElement {
|
|
13135
13169
|
shadow;
|
|
13136
13170
|
constructor() {
|
|
13137
13171
|
super(), this.shadow = this.attachShadow({ mode: "open" });
|
|
@@ -13184,12 +13218,12 @@ class ad extends HTMLElement {
|
|
|
13184
13218
|
t && (t.innerHTML = e);
|
|
13185
13219
|
}
|
|
13186
13220
|
}
|
|
13187
|
-
const
|
|
13221
|
+
const ud = [
|
|
13188
13222
|
{ id: "edit-itr", label: "Edit ITR Details", icon: "edit" }
|
|
13189
13223
|
];
|
|
13190
|
-
class
|
|
13224
|
+
class hd extends HTMLElement {
|
|
13191
13225
|
shadow;
|
|
13192
|
-
actions =
|
|
13226
|
+
actions = ud;
|
|
13193
13227
|
menuOpen = !1;
|
|
13194
13228
|
outsideClickHandler = null;
|
|
13195
13229
|
static get observedAttributes() {
|
|
@@ -13415,7 +13449,7 @@ class cd extends HTMLElement {
|
|
|
13415
13449
|
this.setAttribute("status", e);
|
|
13416
13450
|
}
|
|
13417
13451
|
}
|
|
13418
|
-
const
|
|
13452
|
+
const dd = /<\s*(br|i|b|em|strong|small|sub|sup|p|div|span|ul|ol|li|a|img|code|pre)\b/i, fd = /&(quot|apos|amp|lt|gt|nbsp|#\d+|#x[0-9a-f]+);/i, pd = {
|
|
13419
13453
|
""": '"',
|
|
13420
13454
|
"'": "'",
|
|
13421
13455
|
"<": "<",
|
|
@@ -13423,14 +13457,14 @@ const ud = /<\s*(br|i|b|em|strong|small|sub|sup|p|div|span|ul|ol|li|a|img|code|p
|
|
|
13423
13457
|
"&": "&",
|
|
13424
13458
|
" ": " "
|
|
13425
13459
|
};
|
|
13426
|
-
function
|
|
13427
|
-
return s.replace(/&(quot|apos|lt|gt|nbsp);/gi, (e) =>
|
|
13460
|
+
function md(s) {
|
|
13461
|
+
return s.replace(/&(quot|apos|lt|gt|nbsp);/gi, (e) => pd[e.toLowerCase()] ?? e).replace(/&#(\d+);/g, (e, t) => String.fromCharCode(parseInt(t, 10))).replace(/&#x([0-9a-f]+);/gi, (e, t) => String.fromCharCode(parseInt(t, 16))).replace(/&/gi, "&");
|
|
13428
13462
|
}
|
|
13429
13463
|
function qt(s) {
|
|
13430
|
-
if (
|
|
13464
|
+
if (dd.test(s))
|
|
13431
13465
|
return s;
|
|
13432
|
-
const e =
|
|
13433
|
-
let t =
|
|
13466
|
+
const e = fd.test(s) ? md(s) : s;
|
|
13467
|
+
let t = gd(e);
|
|
13434
13468
|
return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, (r, o, n) => `<pre><code>${n.trim()}</code></pre>`), t = t.replace(/`([^`]+)`/g, "<code>$1</code>"), t = t.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/\*(.+?)\*/g, "<em>$1</em>"), t = t.replace(
|
|
13435
13469
|
/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
|
|
13436
13470
|
'<a href="$2" target="_self" rel="noopener noreferrer">$1</a>'
|
|
@@ -13442,7 +13476,7 @@ function qt(s) {
|
|
|
13442
13476
|
}
|
|
13443
13477
|
), t = t.replace(/\n/g, "<br>"), t;
|
|
13444
13478
|
}
|
|
13445
|
-
function
|
|
13479
|
+
function gd(s) {
|
|
13446
13480
|
const e = {
|
|
13447
13481
|
"&": "&",
|
|
13448
13482
|
"<": "<",
|
|
@@ -13452,7 +13486,7 @@ function pd(s) {
|
|
|
13452
13486
|
};
|
|
13453
13487
|
return s.replace(/[&<>"']/g, (t) => e[t]);
|
|
13454
13488
|
}
|
|
13455
|
-
const
|
|
13489
|
+
const bd = /* @__PURE__ */ new Set([
|
|
13456
13490
|
"p",
|
|
13457
13491
|
"br",
|
|
13458
13492
|
"hr",
|
|
@@ -13487,7 +13521,7 @@ const md = /* @__PURE__ */ new Set([
|
|
|
13487
13521
|
"tr",
|
|
13488
13522
|
"th",
|
|
13489
13523
|
"td"
|
|
13490
|
-
]),
|
|
13524
|
+
]), yd = {
|
|
13491
13525
|
a: /* @__PURE__ */ new Set(["href", "target", "rel"]),
|
|
13492
13526
|
img: /* @__PURE__ */ new Set(["src", "alt", "width", "height"]),
|
|
13493
13527
|
code: /* @__PURE__ */ new Set(["class"]),
|
|
@@ -13504,12 +13538,12 @@ function Ll(s) {
|
|
|
13504
13538
|
for (const t of e)
|
|
13505
13539
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
13506
13540
|
const r = t, o = r.tagName.toLowerCase();
|
|
13507
|
-
if (!
|
|
13541
|
+
if (!bd.has(o)) {
|
|
13508
13542
|
const a = document.createTextNode(r.textContent || "");
|
|
13509
13543
|
s.replaceChild(a, t);
|
|
13510
13544
|
continue;
|
|
13511
13545
|
}
|
|
13512
|
-
const n =
|
|
13546
|
+
const n = yd[o] || /* @__PURE__ */ new Set(), i = Array.from(r.attributes);
|
|
13513
13547
|
for (const a of i)
|
|
13514
13548
|
n.has(a.name) || r.removeAttribute(a.name);
|
|
13515
13549
|
if (r.hasAttribute("href")) {
|
|
@@ -13519,7 +13553,7 @@ function Ll(s) {
|
|
|
13519
13553
|
Ll(t);
|
|
13520
13554
|
}
|
|
13521
13555
|
}
|
|
13522
|
-
function
|
|
13556
|
+
function vd(s, e = {}) {
|
|
13523
13557
|
const { width: t = 600, height: r = 700, closeOnTypes: o } = e, n = Math.round(window.screenX + (window.outerWidth - t) / 2), i = Math.round(window.screenY + (window.outerHeight - r) / 2), a = window.open(
|
|
13524
13558
|
s,
|
|
13525
13559
|
"aikaara_popup",
|
|
@@ -13537,7 +13571,7 @@ function bd(s, e = {}) {
|
|
|
13537
13571
|
}, 500);
|
|
13538
13572
|
return a;
|
|
13539
13573
|
}
|
|
13540
|
-
function
|
|
13574
|
+
function wd(s) {
|
|
13541
13575
|
const e = Date.now() - s.getTime(), t = Math.round(e / 1e3);
|
|
13542
13576
|
if (t < 5) return "just now";
|
|
13543
13577
|
if (t < 60) return `${t}s ago`;
|
|
@@ -13548,7 +13582,7 @@ function yd(s) {
|
|
|
13548
13582
|
const n = Math.round(o / 24);
|
|
13549
13583
|
return n === 1 ? "Yesterday" : n < 7 ? `${n} d ago` : s.toLocaleDateString(void 0, { month: "short", day: "2-digit" });
|
|
13550
13584
|
}
|
|
13551
|
-
class
|
|
13585
|
+
class _d extends HTMLElement {
|
|
13552
13586
|
shadow;
|
|
13553
13587
|
container;
|
|
13554
13588
|
welcomeMessage = "";
|
|
@@ -13801,7 +13835,7 @@ class vd extends HTMLElement {
|
|
|
13801
13835
|
if (n.role === "user") {
|
|
13802
13836
|
const i = n.metadata?.attributes?.action;
|
|
13803
13837
|
if (i) {
|
|
13804
|
-
const a =
|
|
13838
|
+
const a = kd(i);
|
|
13805
13839
|
if (i.message_id && t.set(i.message_id, a), Object.keys(a).length > 0)
|
|
13806
13840
|
for (let l = o - 1; l >= 0; l--) {
|
|
13807
13841
|
const c = e[l];
|
|
@@ -13939,7 +13973,7 @@ class vd extends HTMLElement {
|
|
|
13939
13973
|
case "date":
|
|
13940
13974
|
return r;
|
|
13941
13975
|
case "relative":
|
|
13942
|
-
return
|
|
13976
|
+
return wd(t);
|
|
13943
13977
|
case "time-24":
|
|
13944
13978
|
return t.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit", hour12: !1 });
|
|
13945
13979
|
case "time-seconds":
|
|
@@ -13965,7 +13999,7 @@ class vd extends HTMLElement {
|
|
|
13965
13999
|
return;
|
|
13966
14000
|
}
|
|
13967
14001
|
if (o === "popup") {
|
|
13968
|
-
|
|
14002
|
+
vd(e);
|
|
13969
14003
|
return;
|
|
13970
14004
|
}
|
|
13971
14005
|
const n = this.getOrCreateModal(), i = r?.title ?? t ?? "Link";
|
|
@@ -13973,7 +14007,7 @@ class vd extends HTMLElement {
|
|
|
13973
14007
|
requestAnimationFrame(() => n.show?.(e, i));
|
|
13974
14008
|
return;
|
|
13975
14009
|
}
|
|
13976
|
-
const a =
|
|
14010
|
+
const a = xd(e), l = Nl(r.fetch.url, a), c = {
|
|
13977
14011
|
accept: "application/json",
|
|
13978
14012
|
...r.fetch.headers ?? {}
|
|
13979
14013
|
}, u = r.fetch.authHeader ?? "session";
|
|
@@ -14019,7 +14053,7 @@ class vd extends HTMLElement {
|
|
|
14019
14053
|
return e || (e = document.createElement("aikaara-link-modal"), document.body.appendChild(e)), e;
|
|
14020
14054
|
}
|
|
14021
14055
|
}
|
|
14022
|
-
function
|
|
14056
|
+
function kd(s) {
|
|
14023
14057
|
const e = /* @__PURE__ */ new Set(["message_id", "formAction", "requestType"]), t = {};
|
|
14024
14058
|
for (const [r, o] of Object.entries(s))
|
|
14025
14059
|
e.has(r) || (Array.isArray(o) && o.every((n) => typeof n == "string") ? t[r] = o : typeof o == "string" && (t[r] = [o]));
|
|
@@ -14029,7 +14063,7 @@ function zs(s, e) {
|
|
|
14029
14063
|
const t = e.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
14030
14064
|
return new RegExp("^" + t.replace(/\*/g, ".*").replace(/\?/g, ".") + "$", "i").test(s);
|
|
14031
14065
|
}
|
|
14032
|
-
function
|
|
14066
|
+
function xd(s) {
|
|
14033
14067
|
try {
|
|
14034
14068
|
const e = new URL(s), t = {};
|
|
14035
14069
|
return e.searchParams.forEach((r, o) => {
|
|
@@ -14052,7 +14086,7 @@ function co(s, e) {
|
|
|
14052
14086
|
}
|
|
14053
14087
|
return s;
|
|
14054
14088
|
}
|
|
14055
|
-
class
|
|
14089
|
+
class Sd extends HTMLElement {
|
|
14056
14090
|
shadow;
|
|
14057
14091
|
templatePayload = null;
|
|
14058
14092
|
attachments = [];
|
|
@@ -14168,7 +14202,7 @@ class kd extends HTMLElement {
|
|
|
14168
14202
|
renderAttachments() {
|
|
14169
14203
|
return this.attachments.length ? `<div class="attachments">${this.attachments.map(
|
|
14170
14204
|
(t) => `<a class="attachment" href="${Vs(t.fileUrl)}" target="_blank" rel="noopener noreferrer">
|
|
14171
|
-
📎 ${
|
|
14205
|
+
📎 ${Ed(t.fileName)}
|
|
14172
14206
|
</a>`
|
|
14173
14207
|
).join("")}</div>` : "";
|
|
14174
14208
|
}
|
|
@@ -14176,10 +14210,10 @@ class kd extends HTMLElement {
|
|
|
14176
14210
|
function Vs(s) {
|
|
14177
14211
|
return String(s).replace(/[&<>"']/g, (e) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[e]);
|
|
14178
14212
|
}
|
|
14179
|
-
function
|
|
14213
|
+
function Ed(s) {
|
|
14180
14214
|
return String(s).replace(/[&<>]/g, (e) => ({ "&": "&", "<": "<", ">": ">" })[e]);
|
|
14181
14215
|
}
|
|
14182
|
-
class
|
|
14216
|
+
class Ad extends HTMLElement {
|
|
14183
14217
|
shadow;
|
|
14184
14218
|
textarea;
|
|
14185
14219
|
sendBtn;
|
|
@@ -14330,7 +14364,7 @@ class Sd extends HTMLElement {
|
|
|
14330
14364
|
this.textarea.style.height = "auto", this.textarea.style.height = Math.min(this.textarea.scrollHeight, 120) + "px";
|
|
14331
14365
|
}
|
|
14332
14366
|
}
|
|
14333
|
-
class
|
|
14367
|
+
class Id extends HTMLElement {
|
|
14334
14368
|
shadow;
|
|
14335
14369
|
constructor() {
|
|
14336
14370
|
super(), this.shadow = this.attachShadow({ mode: "open" });
|
|
@@ -14379,7 +14413,7 @@ class Ed extends HTMLElement {
|
|
|
14379
14413
|
this.removeAttribute("visible");
|
|
14380
14414
|
}
|
|
14381
14415
|
}
|
|
14382
|
-
class
|
|
14416
|
+
class Td extends HTMLElement {
|
|
14383
14417
|
shadow;
|
|
14384
14418
|
bubble;
|
|
14385
14419
|
constructor() {
|
|
@@ -14444,7 +14478,7 @@ class Ad extends HTMLElement {
|
|
|
14444
14478
|
this.bubble?.classList.remove("cursor");
|
|
14445
14479
|
}
|
|
14446
14480
|
}
|
|
14447
|
-
class
|
|
14481
|
+
class Cd extends HTMLElement {
|
|
14448
14482
|
shadow;
|
|
14449
14483
|
container;
|
|
14450
14484
|
dismissTimer = null;
|
|
@@ -14517,7 +14551,7 @@ function jl(s) {
|
|
|
14517
14551
|
});
|
|
14518
14552
|
return an.set(s, t), t;
|
|
14519
14553
|
}
|
|
14520
|
-
function
|
|
14554
|
+
function Od(s, e = 5e3) {
|
|
14521
14555
|
return new Promise((t, r) => {
|
|
14522
14556
|
const o = setTimeout(() => r(new Error(`Custom element <${s}> not registered within ${e}ms`)), e);
|
|
14523
14557
|
customElements.whenDefined(s).then(() => {
|
|
@@ -14525,14 +14559,14 @@ function Td(s, e = 5e3) {
|
|
|
14525
14559
|
});
|
|
14526
14560
|
});
|
|
14527
14561
|
}
|
|
14528
|
-
const
|
|
14562
|
+
const Pd = {
|
|
14529
14563
|
"aikaara-template-payment-link": () => import("./AikaaraPaymentLink-CL4O6gbc.mjs").then(({ registerAikaaraPaymentLink: s }) => s())
|
|
14530
14564
|
};
|
|
14531
|
-
function
|
|
14565
|
+
function Md(s) {
|
|
14532
14566
|
const e = `template:${s}`, t = window.__aikaara_descriptor__?.components?.[e];
|
|
14533
14567
|
return t && t.kind === "iife-element" ? { render: t.tag, scriptUrl: t.scriptUrl, props: t.props } : window.__aikaara_descriptor__?.templates?.[s];
|
|
14534
14568
|
}
|
|
14535
|
-
class
|
|
14569
|
+
class Rd extends HTMLElement {
|
|
14536
14570
|
shadow;
|
|
14537
14571
|
payloadData = null;
|
|
14538
14572
|
innerMessage = "";
|
|
@@ -14556,7 +14590,7 @@ class Pd extends HTMLElement {
|
|
|
14556
14590
|
this.render(), this.addEventListener("template-action", (e) => {
|
|
14557
14591
|
const t = e.detail, r = this.getAttribute("message-id");
|
|
14558
14592
|
if (r && t?.attributes?.action) {
|
|
14559
|
-
const o =
|
|
14593
|
+
const o = jd(t.attributes.action);
|
|
14560
14594
|
if (Object.keys(o).length > 0)
|
|
14561
14595
|
try {
|
|
14562
14596
|
localStorage.setItem(`aikaara_form:${r}`, JSON.stringify(o));
|
|
@@ -14632,8 +14666,8 @@ class Pd extends HTMLElement {
|
|
|
14632
14666
|
<slot></slot>
|
|
14633
14667
|
`; this.firstChild; ) this.removeChild(this.firstChild);
|
|
14634
14668
|
if (!e) return;
|
|
14635
|
-
const r = t ?
|
|
14636
|
-
if (n && !customElements.get(o) ? n().then(() => this.render()).catch((i) => console.warn(`[aikaara-template-renderer] native template ${o} failed to load`, i)) : r?.scriptUrl && !customElements.get(o) && jl(r.scriptUrl).then(() =>
|
|
14669
|
+
const r = t ? Md(t) : void 0, o = r?.render ?? (t ? `aikaara-template-${t}` : `aikaara-template-${e}`), n = Pd[o];
|
|
14670
|
+
if (n && !customElements.get(o) ? n().then(() => this.render()).catch((i) => console.warn(`[aikaara-template-renderer] native template ${o} failed to load`, i)) : r?.scriptUrl && !customElements.get(o) && jl(r.scriptUrl).then(() => Od(o)).then(() => this.render()).catch((i) => console.warn(`[aikaara-template-renderer] failed to lazy-load ${r.scriptUrl}`, i)), customElements.get(o)) {
|
|
14637
14671
|
const i = document.createElement(o);
|
|
14638
14672
|
if (r?.props) {
|
|
14639
14673
|
for (const [a, l] of Object.entries(r.props))
|
|
@@ -14720,7 +14754,7 @@ class Pd extends HTMLElement {
|
|
|
14720
14754
|
*/
|
|
14721
14755
|
mountLinkButton(e) {
|
|
14722
14756
|
const t = this.renderGen;
|
|
14723
|
-
import("./AikaaraLinkButton-
|
|
14757
|
+
import("./AikaaraLinkButton-B-Hg4pN2.mjs").then(({ registerAikaaraLinkButton: r, AikaaraLinkButton: o }) => {
|
|
14724
14758
|
if (t !== this.renderGen) return;
|
|
14725
14759
|
r();
|
|
14726
14760
|
const n = document.createElement("aikaara-link-button");
|
|
@@ -14729,7 +14763,7 @@ class Pd extends HTMLElement {
|
|
|
14729
14763
|
url: e.url ?? "",
|
|
14730
14764
|
openLinkInNewTab: e.openLinkInNewTab,
|
|
14731
14765
|
orderId: e.orderId,
|
|
14732
|
-
extra:
|
|
14766
|
+
extra: Nd(e),
|
|
14733
14767
|
messageId: this.getAttribute("message-id") ?? void 0
|
|
14734
14768
|
}), this.appendChild(n);
|
|
14735
14769
|
});
|
|
@@ -14739,26 +14773,26 @@ class Pd extends HTMLElement {
|
|
|
14739
14773
|
t.setPayload(e), this.appendChild(t);
|
|
14740
14774
|
}
|
|
14741
14775
|
}
|
|
14742
|
-
const
|
|
14776
|
+
const Ld = /* @__PURE__ */ new Set([
|
|
14743
14777
|
"type",
|
|
14744
14778
|
"url",
|
|
14745
14779
|
"name",
|
|
14746
14780
|
"openLinkInNewTab",
|
|
14747
14781
|
"orderId"
|
|
14748
14782
|
]);
|
|
14749
|
-
function
|
|
14783
|
+
function Nd(s) {
|
|
14750
14784
|
const e = {};
|
|
14751
14785
|
for (const [t, r] of Object.entries(s))
|
|
14752
|
-
|
|
14786
|
+
Ld.has(t) || (e[t] = r);
|
|
14753
14787
|
return e;
|
|
14754
14788
|
}
|
|
14755
|
-
function
|
|
14789
|
+
function jd(s) {
|
|
14756
14790
|
const e = /* @__PURE__ */ new Set(["message_id", "formAction", "requestType", "serviceType"]), t = {};
|
|
14757
14791
|
for (const [r, o] of Object.entries(s))
|
|
14758
14792
|
e.has(r) || (Array.isArray(o) && o.every((n) => typeof n == "string") ? t[r] = o : typeof o == "string" && (t[r] = [o]));
|
|
14759
14793
|
return t;
|
|
14760
14794
|
}
|
|
14761
|
-
class
|
|
14795
|
+
class Ud extends HTMLElement {
|
|
14762
14796
|
shadow;
|
|
14763
14797
|
static get observedAttributes() {
|
|
14764
14798
|
return ["text", "subtext"];
|
|
@@ -14807,7 +14841,7 @@ class Nd extends HTMLElement {
|
|
|
14807
14841
|
function Ks(s) {
|
|
14808
14842
|
return String(s).replace(/[&<>]/g, (e) => ({ "&": "&", "<": "<", ">": ">" })[e]);
|
|
14809
14843
|
}
|
|
14810
|
-
class
|
|
14844
|
+
class Bd extends HTMLElement {
|
|
14811
14845
|
shadow;
|
|
14812
14846
|
data = null;
|
|
14813
14847
|
selected = /* @__PURE__ */ new Set();
|
|
@@ -15032,7 +15066,7 @@ function Ct(s) {
|
|
|
15032
15066
|
function ln(s) {
|
|
15033
15067
|
return String(s).replace(/[&<>"']/g, (e) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[e]);
|
|
15034
15068
|
}
|
|
15035
|
-
class
|
|
15069
|
+
class Dd extends HTMLElement {
|
|
15036
15070
|
shadow;
|
|
15037
15071
|
data = null;
|
|
15038
15072
|
constructor() {
|
|
@@ -15101,14 +15135,14 @@ class Ud extends HTMLElement {
|
|
|
15101
15135
|
button:hover { background: var(--aikaara-submit-hover-bg, var(--aikaara-primary-hover, #4f46e5)); }
|
|
15102
15136
|
button:disabled { opacity: var(--aikaara-submit-disabled-opacity, 0.5); cursor: not-allowed; }
|
|
15103
15137
|
</style>
|
|
15104
|
-
<button type="button">${
|
|
15138
|
+
<button type="button">${$d(e)}</button>
|
|
15105
15139
|
`, this.shadow.querySelector("button").addEventListener("click", () => this.handleClick());
|
|
15106
15140
|
}
|
|
15107
15141
|
}
|
|
15108
|
-
function
|
|
15142
|
+
function $d(s) {
|
|
15109
15143
|
return String(s).replace(/[&<>]/g, (e) => ({ "&": "&", "<": "<", ">": ">" })[e]);
|
|
15110
15144
|
}
|
|
15111
|
-
class
|
|
15145
|
+
class Fd extends HTMLElement {
|
|
15112
15146
|
shadow;
|
|
15113
15147
|
data = null;
|
|
15114
15148
|
dismissed = !1;
|
|
@@ -15200,7 +15234,7 @@ class Dd extends HTMLElement {
|
|
|
15200
15234
|
function cn(s) {
|
|
15201
15235
|
return String(s).replace(/[&<>]/g, (e) => ({ "&": "&", "<": "<", ">": ">" })[e]);
|
|
15202
15236
|
}
|
|
15203
|
-
class
|
|
15237
|
+
class qd extends HTMLElement {
|
|
15204
15238
|
shadow;
|
|
15205
15239
|
data = null;
|
|
15206
15240
|
_value = "";
|
|
@@ -15307,7 +15341,7 @@ function er(s) {
|
|
|
15307
15341
|
(e) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[e]
|
|
15308
15342
|
);
|
|
15309
15343
|
}
|
|
15310
|
-
class
|
|
15344
|
+
class Hd extends HTMLElement {
|
|
15311
15345
|
static get observedAttributes() {
|
|
15312
15346
|
return ["slug", "user-id", "user-name", "user-token", "department-id", "config-base", "api-key"];
|
|
15313
15347
|
}
|
|
@@ -15361,7 +15395,7 @@ class Fd extends HTMLElement {
|
|
|
15361
15395
|
const l = Object.keys(n).length > 0 ? n : void 0;
|
|
15362
15396
|
return this.mountInflight = (async () => {
|
|
15363
15397
|
try {
|
|
15364
|
-
this.mounted = await
|
|
15398
|
+
this.mounted = await Ef({
|
|
15365
15399
|
container: this,
|
|
15366
15400
|
slug: e,
|
|
15367
15401
|
configBase: this.getAttribute("config-base") ?? void 0,
|
|
@@ -15390,7 +15424,7 @@ class Fd extends HTMLElement {
|
|
|
15390
15424
|
})(), this.mountInflight;
|
|
15391
15425
|
}
|
|
15392
15426
|
}
|
|
15393
|
-
class
|
|
15427
|
+
class Wd extends HTMLElement {
|
|
15394
15428
|
shadow;
|
|
15395
15429
|
root = null;
|
|
15396
15430
|
iframe = null;
|
|
@@ -15507,7 +15541,7 @@ class qd extends HTMLElement {
|
|
|
15507
15541
|
});
|
|
15508
15542
|
}
|
|
15509
15543
|
}
|
|
15510
|
-
const
|
|
15544
|
+
const zd = [
|
|
15511
15545
|
{ label: "Self-filing guidance" },
|
|
15512
15546
|
{ label: "Smart tax suggestions" },
|
|
15513
15547
|
{ label: "Auto-fetch 26AS / AIS" },
|
|
@@ -15515,7 +15549,7 @@ const Hd = [
|
|
|
15515
15549
|
{ label: "Dedicated tax expert" },
|
|
15516
15550
|
{ label: "End-to-end filing" },
|
|
15517
15551
|
{ label: "Document handling" }
|
|
15518
|
-
],
|
|
15552
|
+
], Vd = [
|
|
15519
15553
|
{
|
|
15520
15554
|
label: "DIY",
|
|
15521
15555
|
match: ["DIY", "DIY_SALARY"],
|
|
@@ -15538,11 +15572,11 @@ const Hd = [
|
|
|
15538
15572
|
features: [!0, !0, !0, !0, !0, !0, !0]
|
|
15539
15573
|
}
|
|
15540
15574
|
];
|
|
15541
|
-
class
|
|
15575
|
+
class Kd extends HTMLElement {
|
|
15542
15576
|
shadow;
|
|
15543
15577
|
data = null;
|
|
15544
|
-
columns =
|
|
15545
|
-
features =
|
|
15578
|
+
columns = Vd;
|
|
15579
|
+
features = zd;
|
|
15546
15580
|
constructor() {
|
|
15547
15581
|
super(), this.shadow = this.attachShadow({ mode: "open" });
|
|
15548
15582
|
}
|
|
@@ -15675,7 +15709,7 @@ function un(s) {
|
|
|
15675
15709
|
(e) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[e]
|
|
15676
15710
|
);
|
|
15677
15711
|
}
|
|
15678
|
-
class
|
|
15712
|
+
class Gd extends HTMLElement {
|
|
15679
15713
|
shadow;
|
|
15680
15714
|
root = null;
|
|
15681
15715
|
schemas = [];
|
|
@@ -15766,7 +15800,7 @@ class Vd extends HTMLElement {
|
|
|
15766
15800
|
`;
|
|
15767
15801
|
const r = this.shadow.querySelector(".modal-body"), o = this.schemas.map(
|
|
15768
15802
|
(i) => `
|
|
15769
|
-
<button class="chip" type="button" data-section-id="${
|
|
15803
|
+
<button class="chip" type="button" data-section-id="${Jd(i.id)}">
|
|
15770
15804
|
<span class="chip-icon">${i.icon ?? "📄"}</span>
|
|
15771
15805
|
<span class="chip-label">${Ys(i.title)}</span>
|
|
15772
15806
|
</button>`
|
|
@@ -15799,7 +15833,7 @@ class Vd extends HTMLElement {
|
|
|
15799
15833
|
e.classList.remove("view-picker"), e.classList.add("view-form");
|
|
15800
15834
|
const t = this.schemas.find((n) => n.id === this.activeSectionId), r = this.shadow.querySelector(".modal-header");
|
|
15801
15835
|
r.innerHTML = `
|
|
15802
|
-
<button class="icon-btn back-btn" type="button" aria-label="Back">${
|
|
15836
|
+
<button class="icon-btn back-btn" type="button" aria-label="Back">${Yd}</button>
|
|
15803
15837
|
<div class="modal-title">${Ys(t?.title ?? "Edit")}</div>
|
|
15804
15838
|
<button class="icon-btn close-btn" type="button" aria-label="Close">${Gs}</button>
|
|
15805
15839
|
`;
|
|
@@ -15975,14 +16009,14 @@ class Vd extends HTMLElement {
|
|
|
15975
16009
|
`;
|
|
15976
16010
|
}
|
|
15977
16011
|
}
|
|
15978
|
-
const Gs = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',
|
|
15979
|
-
function
|
|
16012
|
+
const Gs = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>', Yd = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>';
|
|
16013
|
+
function Jd(s) {
|
|
15980
16014
|
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
15981
16015
|
}
|
|
15982
16016
|
function Ys(s) {
|
|
15983
16017
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
15984
16018
|
}
|
|
15985
|
-
class
|
|
16019
|
+
class Qd extends HTMLElement {
|
|
15986
16020
|
shadow;
|
|
15987
16021
|
schema = null;
|
|
15988
16022
|
value = {};
|
|
@@ -16438,33 +16472,33 @@ function wt(s) {
|
|
|
16438
16472
|
function Ge(s) {
|
|
16439
16473
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
16440
16474
|
}
|
|
16441
|
-
function
|
|
16475
|
+
function Xd() {
|
|
16442
16476
|
const s = [
|
|
16443
|
-
["aikaara-chat-widget",
|
|
16444
|
-
["aikaara-chat-bubble",
|
|
16445
|
-
["aikaara-chat-header",
|
|
16446
|
-
["aikaara-message-list",
|
|
16447
|
-
["aikaara-message-bubble",
|
|
16448
|
-
["aikaara-chat-input",
|
|
16449
|
-
["aikaara-typing-indicator",
|
|
16450
|
-
["aikaara-streaming-message",
|
|
16451
|
-
["aikaara-error-banner",
|
|
16452
|
-
["aikaara-template-renderer",
|
|
16453
|
-
["aikaara-system-pill",
|
|
16454
|
-
["aikaara-option-list",
|
|
16455
|
-
["aikaara-submit-action",
|
|
16456
|
-
["aikaara-modal-action",
|
|
16457
|
-
["aikaara-text-input",
|
|
16458
|
-
["aikaara-chat",
|
|
16459
|
-
["aikaara-link-modal",
|
|
16460
|
-
["aikaara-compare-plans",
|
|
16461
|
-
["aikaara-smart-edit-modal",
|
|
16462
|
-
["aikaara-schema-form",
|
|
16477
|
+
["aikaara-chat-widget", ld],
|
|
16478
|
+
["aikaara-chat-bubble", cd],
|
|
16479
|
+
["aikaara-chat-header", hd],
|
|
16480
|
+
["aikaara-message-list", _d],
|
|
16481
|
+
["aikaara-message-bubble", Sd],
|
|
16482
|
+
["aikaara-chat-input", Ad],
|
|
16483
|
+
["aikaara-typing-indicator", Id],
|
|
16484
|
+
["aikaara-streaming-message", Td],
|
|
16485
|
+
["aikaara-error-banner", Cd],
|
|
16486
|
+
["aikaara-template-renderer", Rd],
|
|
16487
|
+
["aikaara-system-pill", Ud],
|
|
16488
|
+
["aikaara-option-list", Bd],
|
|
16489
|
+
["aikaara-submit-action", Dd],
|
|
16490
|
+
["aikaara-modal-action", Fd],
|
|
16491
|
+
["aikaara-text-input", qd],
|
|
16492
|
+
["aikaara-chat", Hd],
|
|
16493
|
+
["aikaara-link-modal", Wd],
|
|
16494
|
+
["aikaara-compare-plans", Kd],
|
|
16495
|
+
["aikaara-smart-edit-modal", Gd],
|
|
16496
|
+
["aikaara-schema-form", Qd]
|
|
16463
16497
|
];
|
|
16464
16498
|
for (const [e, t] of s)
|
|
16465
16499
|
customElements.get(e) || customElements.define(e, t);
|
|
16466
16500
|
}
|
|
16467
|
-
|
|
16501
|
+
Xd();
|
|
16468
16502
|
function mr(s, e, t = "") {
|
|
16469
16503
|
if (!e) return t;
|
|
16470
16504
|
const r = e.split(".");
|
|
@@ -16490,7 +16524,7 @@ function Js(s) {
|
|
|
16490
16524
|
async function Wt(s) {
|
|
16491
16525
|
return typeof s == "function" ? await s() : s;
|
|
16492
16526
|
}
|
|
16493
|
-
class
|
|
16527
|
+
class Zd {
|
|
16494
16528
|
constructor(e, t) {
|
|
16495
16529
|
this.descriptor = e, this.sessionToken = t;
|
|
16496
16530
|
}
|
|
@@ -16541,10 +16575,10 @@ class Qd {
|
|
|
16541
16575
|
return this.cache = { token: h, requestId: b, fullName: d, userId: g, expiresAt: y }, this.cache;
|
|
16542
16576
|
}
|
|
16543
16577
|
}
|
|
16544
|
-
async function
|
|
16578
|
+
async function ef(s) {
|
|
16545
16579
|
const e = {};
|
|
16546
16580
|
for (const t of s.spec) {
|
|
16547
|
-
const r = await
|
|
16581
|
+
const r = await tf(t, s.providers);
|
|
16548
16582
|
if (r !== void 0 && r !== "")
|
|
16549
16583
|
e[t.name] = r;
|
|
16550
16584
|
else {
|
|
@@ -16557,11 +16591,11 @@ async function Xd(s) {
|
|
|
16557
16591
|
}
|
|
16558
16592
|
return e;
|
|
16559
16593
|
}
|
|
16560
|
-
async function
|
|
16594
|
+
async function tf(s, e) {
|
|
16561
16595
|
const t = s.key ?? s.name;
|
|
16562
16596
|
switch (s.source) {
|
|
16563
16597
|
case "cookie":
|
|
16564
|
-
return
|
|
16598
|
+
return rf(t);
|
|
16565
16599
|
case "localStorage":
|
|
16566
16600
|
return gr(() => window.localStorage.getItem(t) ?? void 0);
|
|
16567
16601
|
case "sessionStorage":
|
|
@@ -16569,7 +16603,7 @@ async function Zd(s, e) {
|
|
|
16569
16603
|
case "url_param":
|
|
16570
16604
|
return gr(() => new URL(window.location.href).searchParams.get(t) ?? void 0);
|
|
16571
16605
|
case "header_meta":
|
|
16572
|
-
return gr(() => document.querySelector(`meta[name="${
|
|
16606
|
+
return gr(() => document.querySelector(`meta[name="${nf(t)}"]`)?.content ?? void 0);
|
|
16573
16607
|
case "callback": {
|
|
16574
16608
|
const r = e?.[s.name];
|
|
16575
16609
|
if (!r) return;
|
|
@@ -16580,7 +16614,7 @@ async function Zd(s, e) {
|
|
|
16580
16614
|
return;
|
|
16581
16615
|
}
|
|
16582
16616
|
}
|
|
16583
|
-
function
|
|
16617
|
+
function rf(s) {
|
|
16584
16618
|
if (typeof document > "u") return;
|
|
16585
16619
|
const e = encodeURIComponent(s), t = document.cookie ? document.cookie.split("; ") : [];
|
|
16586
16620
|
for (const r of t) {
|
|
@@ -16602,11 +16636,11 @@ function gr(s) {
|
|
|
16602
16636
|
return;
|
|
16603
16637
|
}
|
|
16604
16638
|
}
|
|
16605
|
-
function
|
|
16639
|
+
function nf(s) {
|
|
16606
16640
|
return s.replace(/["\\]/g, "\\$&");
|
|
16607
16641
|
}
|
|
16608
|
-
const
|
|
16609
|
-
class
|
|
16642
|
+
const of = 1800;
|
|
16643
|
+
class sf {
|
|
16610
16644
|
constructor(e) {
|
|
16611
16645
|
this.opts = e, this.cache = this.loadCache();
|
|
16612
16646
|
}
|
|
@@ -16635,7 +16669,7 @@ class nf {
|
|
|
16635
16669
|
throw new Error(
|
|
16636
16670
|
"[aikaara-chat-sdk] SsoExchangeAdapter.exchange() requires descriptor.sso.collect; v2 partner-token flow should be handled by TokenDiscoveryReader instead."
|
|
16637
16671
|
);
|
|
16638
|
-
const e = await
|
|
16672
|
+
const e = await ef({
|
|
16639
16673
|
spec: this.opts.descriptor.collect,
|
|
16640
16674
|
providers: this.opts.providers
|
|
16641
16675
|
}), t = JSON.stringify({ credentials: e }), r = {
|
|
@@ -16673,7 +16707,7 @@ class nf {
|
|
|
16673
16707
|
return this.cache = u, this.persistCache(u), u;
|
|
16674
16708
|
}
|
|
16675
16709
|
computeExpiry() {
|
|
16676
|
-
const e = this.opts.descriptor.cacheTtlSec ??
|
|
16710
|
+
const e = this.opts.descriptor.cacheTtlSec ?? of;
|
|
16677
16711
|
if (!(!this.opts.descriptor.cacheKey || e <= 0))
|
|
16678
16712
|
return Date.now() + e * 1e3;
|
|
16679
16713
|
}
|
|
@@ -16706,8 +16740,8 @@ class nf {
|
|
|
16706
16740
|
}
|
|
16707
16741
|
}
|
|
16708
16742
|
}
|
|
16709
|
-
const
|
|
16710
|
-
async function
|
|
16743
|
+
const af = 3e4, lf = 2e3, cf = 100;
|
|
16744
|
+
async function uf(s) {
|
|
16711
16745
|
const { descriptor: e } = s, t = e.tokenSourceConfig ?? {};
|
|
16712
16746
|
switch (e.tokenSource) {
|
|
16713
16747
|
case "init": {
|
|
@@ -16716,37 +16750,37 @@ async function lf(s) {
|
|
|
16716
16750
|
return { token: s.initToken, source: "init" };
|
|
16717
16751
|
}
|
|
16718
16752
|
case "query": {
|
|
16719
|
-
const r = typeof t.key == "string" && t.key ? t.key : "token", o =
|
|
16753
|
+
const r = typeof t.key == "string" && t.key ? t.key : "token", o = df(r);
|
|
16720
16754
|
if (!o) throw new Xe("query", `?${r}= not present`);
|
|
16721
16755
|
return { token: o, source: "query" };
|
|
16722
16756
|
}
|
|
16723
16757
|
case "hash": {
|
|
16724
|
-
const r = typeof t.key == "string" && t.key ? t.key : "token", o =
|
|
16758
|
+
const r = typeof t.key == "string" && t.key ? t.key : "token", o = ff(r);
|
|
16725
16759
|
if (!o) throw new Xe("hash", `#${r}= not present`);
|
|
16726
16760
|
return { token: o, source: "hash" };
|
|
16727
16761
|
}
|
|
16728
16762
|
case "postmsg": {
|
|
16729
|
-
const r = typeof t.type == "string" ? t.type : "", o = typeof t.key == "string" && t.key ? t.key : "token", n =
|
|
16730
|
-
return { token: await
|
|
16763
|
+
const r = typeof t.type == "string" ? t.type : "", o = typeof t.key == "string" && t.key ? t.key : "token", n = yf(typeof t.origins == "string" ? t.origins : ""), i = typeof t.timeoutMs == "number" && t.timeoutMs > 0 ? t.timeoutMs : af;
|
|
16764
|
+
return { token: await bf({ type: r, key: o, origins: n, timeoutMs: i }), source: "postmsg" };
|
|
16731
16765
|
}
|
|
16732
16766
|
case "cookie": {
|
|
16733
16767
|
const r = typeof t.name == "string" && t.name ? t.name : "";
|
|
16734
16768
|
if (!r) throw new Xe("cookie", "cookie.name not configured");
|
|
16735
|
-
const o =
|
|
16769
|
+
const o = pf(r);
|
|
16736
16770
|
if (!o) throw new Xe("cookie", `cookie "${r}" not set`);
|
|
16737
16771
|
return { token: o, source: "cookie" };
|
|
16738
16772
|
}
|
|
16739
16773
|
case "storage": {
|
|
16740
16774
|
const r = t.store === "session" ? "session" : "local", o = typeof t.key == "string" && t.key ? t.key : "", n = typeof t.path == "string" ? t.path : "";
|
|
16741
16775
|
if (!o) throw new Xe("storage", "storage.key not configured");
|
|
16742
|
-
const i =
|
|
16776
|
+
const i = mf(r, o, n);
|
|
16743
16777
|
if (!i) throw new Xe("storage", `${r}Storage["${o}"] not set`);
|
|
16744
16778
|
return { token: i, source: "storage" };
|
|
16745
16779
|
}
|
|
16746
16780
|
case "global": {
|
|
16747
16781
|
const r = typeof t.path == "string" ? t.path : "";
|
|
16748
16782
|
if (!r) throw new Xe("global", "global.path not configured");
|
|
16749
|
-
const o = typeof t.timeoutMs == "number" && t.timeoutMs > 0 ? t.timeoutMs :
|
|
16783
|
+
const o = typeof t.timeoutMs == "number" && t.timeoutMs > 0 ? t.timeoutMs : lf, n = typeof t.intervalMs == "number" && t.intervalMs > 0 ? t.intervalMs : cf, i = await gf(r, o, n);
|
|
16750
16784
|
if (!i) throw new Xe("global", `window.${r} not present`);
|
|
16751
16785
|
return { token: i, source: "global" };
|
|
16752
16786
|
}
|
|
@@ -16759,7 +16793,7 @@ async function lf(s) {
|
|
|
16759
16793
|
}
|
|
16760
16794
|
}
|
|
16761
16795
|
}
|
|
16762
|
-
class
|
|
16796
|
+
class hf {
|
|
16763
16797
|
constructor(e) {
|
|
16764
16798
|
this.opts = e;
|
|
16765
16799
|
}
|
|
@@ -16770,7 +16804,7 @@ class cf {
|
|
|
16770
16804
|
/** Resolve the token. Returns cache if present. */
|
|
16771
16805
|
async get() {
|
|
16772
16806
|
if (this.cached) return this.cached;
|
|
16773
|
-
const e = await
|
|
16807
|
+
const e = await uf(this.opts);
|
|
16774
16808
|
return this.cached = e, e;
|
|
16775
16809
|
}
|
|
16776
16810
|
/**
|
|
@@ -16787,7 +16821,7 @@ class Xe extends Error {
|
|
|
16787
16821
|
super(`[aikaara-chat-sdk] token-discovery (${e}): ${t}`), this.source = e, this.name = "TokenDiscoveryError";
|
|
16788
16822
|
}
|
|
16789
16823
|
}
|
|
16790
|
-
function
|
|
16824
|
+
function df(s) {
|
|
16791
16825
|
if (!(typeof window > "u"))
|
|
16792
16826
|
try {
|
|
16793
16827
|
const e = window.location.search.slice(1);
|
|
@@ -16801,7 +16835,7 @@ function uf(s) {
|
|
|
16801
16835
|
return;
|
|
16802
16836
|
}
|
|
16803
16837
|
}
|
|
16804
|
-
function
|
|
16838
|
+
function ff(s) {
|
|
16805
16839
|
if (!(typeof window > "u"))
|
|
16806
16840
|
try {
|
|
16807
16841
|
const e = window.location.hash.replace(/^#/, "");
|
|
@@ -16810,7 +16844,7 @@ function hf(s) {
|
|
|
16810
16844
|
return;
|
|
16811
16845
|
}
|
|
16812
16846
|
}
|
|
16813
|
-
function
|
|
16847
|
+
function pf(s) {
|
|
16814
16848
|
if (typeof document > "u") return;
|
|
16815
16849
|
const e = encodeURIComponent(s), t = document.cookie ? document.cookie.split("; ") : [];
|
|
16816
16850
|
for (const r of t) {
|
|
@@ -16825,7 +16859,7 @@ function df(s) {
|
|
|
16825
16859
|
}
|
|
16826
16860
|
}
|
|
16827
16861
|
}
|
|
16828
|
-
function
|
|
16862
|
+
function mf(s, e, t) {
|
|
16829
16863
|
if (!(typeof window > "u"))
|
|
16830
16864
|
try {
|
|
16831
16865
|
const o = (s === "session" ? window.sessionStorage : window.localStorage).getItem(e);
|
|
@@ -16843,7 +16877,7 @@ function ff(s, e, t) {
|
|
|
16843
16877
|
return;
|
|
16844
16878
|
}
|
|
16845
16879
|
}
|
|
16846
|
-
async function
|
|
16880
|
+
async function gf(s, e, t) {
|
|
16847
16881
|
if (typeof window > "u") return;
|
|
16848
16882
|
const r = Date.now() + e;
|
|
16849
16883
|
for (; Date.now() < r; ) {
|
|
@@ -16858,7 +16892,7 @@ async function pf(s, e, t) {
|
|
|
16858
16892
|
await new Promise((n) => setTimeout(n, t));
|
|
16859
16893
|
}
|
|
16860
16894
|
}
|
|
16861
|
-
function
|
|
16895
|
+
function bf(s) {
|
|
16862
16896
|
return new Promise((e, t) => {
|
|
16863
16897
|
if (typeof window > "u") {
|
|
16864
16898
|
t(new Xe("postmsg", "no window"));
|
|
@@ -16880,7 +16914,7 @@ function mf(s) {
|
|
|
16880
16914
|
window.addEventListener("message", n);
|
|
16881
16915
|
});
|
|
16882
16916
|
}
|
|
16883
|
-
function
|
|
16917
|
+
function yf(s) {
|
|
16884
16918
|
return s ? s.split(/[,\s]+/).map((e) => e.trim()).filter(Boolean) : [];
|
|
16885
16919
|
}
|
|
16886
16920
|
function Ul(s, e) {
|
|
@@ -16894,7 +16928,7 @@ function Ul(s, e) {
|
|
|
16894
16928
|
return;
|
|
16895
16929
|
return r;
|
|
16896
16930
|
}
|
|
16897
|
-
function
|
|
16931
|
+
function vf() {
|
|
16898
16932
|
const s = typeof crypto < "u" ? crypto : null;
|
|
16899
16933
|
if (s?.randomUUID) return s.randomUUID();
|
|
16900
16934
|
if (s?.getRandomValues) {
|
|
@@ -16908,9 +16942,9 @@ function bf() {
|
|
|
16908
16942
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
16909
16943
|
});
|
|
16910
16944
|
}
|
|
16911
|
-
const
|
|
16945
|
+
const wf = "aikaara_chat:requestId";
|
|
16912
16946
|
function Io(s, e, t) {
|
|
16913
|
-
const r = `${
|
|
16947
|
+
const r = `${wf}:${s}:${e}`;
|
|
16914
16948
|
return t ? `${r}:${t}` : r;
|
|
16915
16949
|
}
|
|
16916
16950
|
function Bl(s, e, t) {
|
|
@@ -16920,13 +16954,13 @@ function Bl(s, e, t) {
|
|
|
16920
16954
|
return null;
|
|
16921
16955
|
}
|
|
16922
16956
|
}
|
|
16923
|
-
function
|
|
16957
|
+
function _f(s, e, t, r) {
|
|
16924
16958
|
try {
|
|
16925
16959
|
localStorage.setItem(Io(s, e, r), t);
|
|
16926
16960
|
} catch {
|
|
16927
16961
|
}
|
|
16928
16962
|
}
|
|
16929
|
-
function
|
|
16963
|
+
function Af(s, e, t) {
|
|
16930
16964
|
try {
|
|
16931
16965
|
localStorage.removeItem(Io(s, e, t));
|
|
16932
16966
|
} catch {
|
|
@@ -16975,7 +17009,7 @@ async function uo(s, e, t = "before-chat") {
|
|
|
16975
17009
|
_ = x;
|
|
16976
17010
|
break;
|
|
16977
17011
|
}
|
|
16978
|
-
if (y = x.status, w = await x.text().catch(() => ""), m < c.length &&
|
|
17012
|
+
if (y = x.status, w = await x.text().catch(() => ""), m < c.length && kf(y, w)) {
|
|
16979
17013
|
const E = c[m++];
|
|
16980
17014
|
console.warn(
|
|
16981
17015
|
`[aikaara-chat-sdk] preflight #${u} ${b} ${p} → ${y} (transient). Retry #${m} in ${E}ms.`
|
|
@@ -17029,7 +17063,7 @@ async function uo(s, e, t = "before-chat") {
|
|
|
17029
17063
|
}
|
|
17030
17064
|
return { captured: l };
|
|
17031
17065
|
}
|
|
17032
|
-
async function
|
|
17066
|
+
async function If(s) {
|
|
17033
17067
|
const e = s.steps ?? [];
|
|
17034
17068
|
return e.some((r) => r.trigger === "on-method-select") ? (await uo(
|
|
17035
17069
|
e,
|
|
@@ -17045,7 +17079,7 @@ async function Ef(s) {
|
|
|
17045
17079
|
"on-method-select"
|
|
17046
17080
|
)).captured : {};
|
|
17047
17081
|
}
|
|
17048
|
-
function
|
|
17082
|
+
function kf(s, e) {
|
|
17049
17083
|
if (s === 503 || s === 504 || s === 502) return !0;
|
|
17050
17084
|
if (s === 401 || s === 403) return e.trim().length === 0;
|
|
17051
17085
|
if (s === 500) {
|
|
@@ -17071,7 +17105,7 @@ async function Dl(s, e) {
|
|
|
17071
17105
|
return r;
|
|
17072
17106
|
}
|
|
17073
17107
|
function $l(s, e) {
|
|
17074
|
-
return s.replace("{projectId}", e).replace("{uuid}",
|
|
17108
|
+
return s.replace("{projectId}", e).replace("{uuid}", vf().replace(/-/g, ""));
|
|
17075
17109
|
}
|
|
17076
17110
|
function Fl(s) {
|
|
17077
17111
|
const e = s._preload;
|
|
@@ -17083,7 +17117,7 @@ function Fl(s) {
|
|
|
17083
17117
|
);
|
|
17084
17118
|
t.length !== 0 && Promise.allSettled(t.map((r) => jl(r)));
|
|
17085
17119
|
}
|
|
17086
|
-
async function
|
|
17120
|
+
async function xf(s) {
|
|
17087
17121
|
const e = {
|
|
17088
17122
|
...s.config ?? (s.configUrl ? await Dl(s.configUrl, s.configHeaders) : {}),
|
|
17089
17123
|
...s.overrides ?? {}
|
|
@@ -17093,7 +17127,7 @@ async function _f(s) {
|
|
|
17093
17127
|
if ((t === "tiledesk" || t === "dual") && !r)
|
|
17094
17128
|
throw new Error("mount: descriptor.tiledesk is required for tiledesk/dual transport");
|
|
17095
17129
|
const o = r?.projectId ?? "", n = s.identity.userId, i = s.conversationScope || void 0, a = s.forceNewConversation ? null : Bl(n, o, i), l = r?.requestIdTemplate ?? "support-group-{projectId}-{uuid}", c = s.conversationId ?? a ?? $l(l, o);
|
|
17096
|
-
(s.conversationId || !a || s.forceNewConversation) && o &&
|
|
17130
|
+
(s.conversationId || !a || s.forceNewConversation) && o && _f(n, o, c, i);
|
|
17097
17131
|
const u = await s.tokenProvider(), h = s.tokenProvider, p = s.historyTokenProvider ?? h, b = r ? {
|
|
17098
17132
|
mqttEndpoint: r.mqttEndpoint,
|
|
17099
17133
|
jwtToken: u,
|
|
@@ -17181,13 +17215,13 @@ async function _f(s) {
|
|
|
17181
17215
|
}
|
|
17182
17216
|
};
|
|
17183
17217
|
}
|
|
17184
|
-
function
|
|
17218
|
+
function Sf(s) {
|
|
17185
17219
|
if (typeof s != "string") return s;
|
|
17186
17220
|
const e = document.querySelector(s);
|
|
17187
17221
|
if (!e) throw new Error(`mountFromSlug: container "${s}" not found`);
|
|
17188
17222
|
return e;
|
|
17189
17223
|
}
|
|
17190
|
-
async function
|
|
17224
|
+
async function Ef(s) {
|
|
17191
17225
|
const e = (s.configBase ?? "https://api.aikaara.com").replace(/\/$/, ""), t = `${e}/api/v1/widget_configs/${encodeURIComponent(s.slug)}`;
|
|
17192
17226
|
let r = null;
|
|
17193
17227
|
try {
|
|
@@ -17237,7 +17271,7 @@ async function xf(s) {
|
|
|
17237
17271
|
let i = null, a = s.user.id, l = s.user.name, c = "", u = s.user.token, h = null;
|
|
17238
17272
|
const p = await Wt(s.user.token).catch(() => ""), b = typeof p == "string" && p.length > 0;
|
|
17239
17273
|
if (!b && o.sso?.tokenSource) {
|
|
17240
|
-
h = new
|
|
17274
|
+
h = new hf({
|
|
17241
17275
|
descriptor: {
|
|
17242
17276
|
provider: o.sso.provider,
|
|
17243
17277
|
flow: o.sso.flow,
|
|
@@ -17254,7 +17288,7 @@ async function xf(s) {
|
|
|
17254
17288
|
u = async () => (await h.get()).token, s.user.identity && !s.user.identity.partnerToken && (s.user.identity.partnerToken = I.token);
|
|
17255
17289
|
} else if (!b && o.sso && o.sso.collect && o.sso.collect.length > 0) {
|
|
17256
17290
|
const I = `${e}/api/v1/projects/by-slug/${encodeURIComponent(s.slug)}/sso_exchange`;
|
|
17257
|
-
i = await new
|
|
17291
|
+
i = await new sf({
|
|
17258
17292
|
descriptor: o.sso,
|
|
17259
17293
|
providers: s.user.credentialProviders,
|
|
17260
17294
|
exchangeUrl: I
|
|
@@ -17276,7 +17310,7 @@ async function xf(s) {
|
|
|
17276
17310
|
}
|
|
17277
17311
|
I.captured.userId && (a = I.captured.userId), I.captured.requestId && (g = I.captured.requestId);
|
|
17278
17312
|
}
|
|
17279
|
-
const y = new
|
|
17313
|
+
const y = new Zd(o.auth, u);
|
|
17280
17314
|
if (d) {
|
|
17281
17315
|
const I = o.tiledesk?.projectId ?? "", O = I ? Bl(a, I) : null, P = o.tiledesk?.requestIdTemplate ?? "support-group-{projectId}-{uuid}", j = O ?? (I ? $l(P, I) : "");
|
|
17282
17316
|
y.prime(d, { requestId: j, fullName: l });
|
|
@@ -17307,8 +17341,8 @@ async function xf(s) {
|
|
|
17307
17341
|
fieldName: x.fieldName,
|
|
17308
17342
|
extraFields: x.extraFields,
|
|
17309
17343
|
headers: async () => ({ authorization: await v() })
|
|
17310
|
-
}) : void 0), S = await
|
|
17311
|
-
container:
|
|
17344
|
+
}) : void 0), S = await xf({
|
|
17345
|
+
container: Sf(s.container),
|
|
17312
17346
|
config: o,
|
|
17313
17347
|
// SSO-issued Aikaara user token, used by the ActionCable transport.
|
|
17314
17348
|
// Tiledesk-only widgets ignore this; falls back to `userId` inside `mount`.
|
|
@@ -17364,50 +17398,50 @@ async function xf(s) {
|
|
|
17364
17398
|
}
|
|
17365
17399
|
export {
|
|
17366
17400
|
To as A,
|
|
17367
|
-
|
|
17401
|
+
Ef as B,
|
|
17368
17402
|
ql as C,
|
|
17369
|
-
|
|
17403
|
+
xf as D,
|
|
17370
17404
|
Qs as E,
|
|
17371
17405
|
Ol as F,
|
|
17372
|
-
|
|
17373
|
-
|
|
17374
|
-
|
|
17375
|
-
|
|
17376
|
-
|
|
17377
|
-
|
|
17406
|
+
If as G,
|
|
17407
|
+
vd as H,
|
|
17408
|
+
Hd as I,
|
|
17409
|
+
Kd as J,
|
|
17410
|
+
Wd as K,
|
|
17411
|
+
Fd as L,
|
|
17378
17412
|
ec as M,
|
|
17379
|
-
|
|
17380
|
-
|
|
17381
|
-
|
|
17382
|
-
|
|
17383
|
-
|
|
17384
|
-
|
|
17413
|
+
Bd as N,
|
|
17414
|
+
Qd as O,
|
|
17415
|
+
Gd as P,
|
|
17416
|
+
Dd as Q,
|
|
17417
|
+
Ud as R,
|
|
17418
|
+
Zd as S,
|
|
17385
17419
|
ph as T,
|
|
17386
|
-
|
|
17387
|
-
|
|
17388
|
-
|
|
17420
|
+
Rd as U,
|
|
17421
|
+
qd as V,
|
|
17422
|
+
cd as a,
|
|
17389
17423
|
wh as b,
|
|
17390
|
-
|
|
17391
|
-
|
|
17392
|
-
|
|
17393
|
-
|
|
17394
|
-
|
|
17395
|
-
|
|
17396
|
-
|
|
17397
|
-
|
|
17424
|
+
hd as c,
|
|
17425
|
+
Ad as d,
|
|
17426
|
+
ld as e,
|
|
17427
|
+
Cd as f,
|
|
17428
|
+
Sd as g,
|
|
17429
|
+
_d as h,
|
|
17430
|
+
Td as i,
|
|
17431
|
+
Id as j,
|
|
17398
17432
|
Zl as k,
|
|
17399
17433
|
Xl as l,
|
|
17400
17434
|
tc as m,
|
|
17401
|
-
|
|
17435
|
+
sf as n,
|
|
17402
17436
|
Xe as o,
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17406
|
-
|
|
17437
|
+
hf as p,
|
|
17438
|
+
Af as q,
|
|
17439
|
+
Xd as r,
|
|
17440
|
+
ef as s,
|
|
17407
17441
|
Pl as t,
|
|
17408
17442
|
Sh as u,
|
|
17409
17443
|
Ah as v,
|
|
17410
|
-
|
|
17444
|
+
uf as w,
|
|
17411
17445
|
yh as x,
|
|
17412
17446
|
bh as y,
|
|
17413
17447
|
gh as z
|