@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
228 lines (226 loc) • 6.98 kB
JavaScript
/**
* WARNING: This file is intended to be used within MySheerID.
* This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID.
*/
/**
* VERSION: 2.154.0-alpha.1
* BUILD_TIMESTAMP: 1763401584959
* BUILD_DATE: Mon Nov 17 2025 17:46:24 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d
*/
import { i as x, h as I, j as a, x as L, y as f, P as j, z as M, Y as R, a as t, a9 as T, k as l, _ as P, B as y, D as A, $ as D, H as O, c as p, E as F, f as _, J as V, K as k, M as z, N as B, m as H, V as G, o as W } from "../_mysheerid-preview.js";
import { L as c } from "./LicensedProfessionalOrganizationComponent-D-jfKTb1.js";
const K = {
LICENSED_COSMETOLOGIST: "Licensed Cosmetologist",
LICENSED_REAL_ESTATE_AGENT: "Licensed Real Estate Agent",
VETERINARIAN: "Veterinarian",
CHILD_CARE_WORKER: "Child Care Worker",
LIBRARIAN: "Librarian",
INTERIOR_DESIGNER: "Interior Designer",
ARCHITECT: "Architect",
GENERAL_CONTRACTOR: "General Contractor",
NUTRITION_PROFESSIONAL: "Nutrition Professional"
}, w = ({
intl: C,
verificationService: e
}) => {
const o = e.viewModel, { fieldValidationErrors: n } = e, u = e.verificationResponse, b = I(u), E = o.localeChoice.value, h = f(), d = (s, r) => {
const m = W(
o,
(N) => {
N[s] = r;
}
);
e.updateViewModel(m);
}, i = (s) => s ? C.formatHTMLMessage({ id: s, defaultMessage: K[s] }) : "", g = () => {
const s = u.availableStatuses, r = [];
if (s)
for (const m of s)
r.push({
value: m,
label: i(m)
});
return r;
};
return /* @__PURE__ */ a.jsxs(
L,
{
verificationService: e,
step: u.currentStep,
children: [
/* @__PURE__ */ a.jsx(
j,
{
verificationService: e,
classNameIdentifier: "licensed-professional"
}
),
/* @__PURE__ */ a.jsx(M, { verificationService: e }),
/* @__PURE__ */ a.jsx(
R,
{
verificationService: e,
disabled: t("country")?.disabled
}
),
/* @__PURE__ */ a.jsx(
T,
{
segmentId: "licensed-professional",
value: {
value: o.statuses ? o.statuses[0] : "",
label: o.statuses ? i(o.statuses[0]) : ""
},
isErrored: !!n.statuses,
options: g(),
disabled: t("statuses")?.disabled,
onChange: (s) => {
const r = s ? [s.value] : [];
d("statuses", r), l(
"statuses",
s ? s.value : "",
e
);
}
}
),
/* @__PURE__ */ a.jsx(
c,
{
isErrored: !!n.organization,
onChange: (s) => {
P(s, e), l("organization", s, e);
},
value: e.viewModel.organization,
verificationService: e,
disabled: t("organization")?.disabled
}
),
/* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ a.jsx(
y,
{
value: o.firstName,
isErrored: !!n.firstName,
disabled: t("firstName")?.disabled,
onChange: (s) => {
d("firstName", s), l("firstName", s, e);
}
}
),
/* @__PURE__ */ a.jsx(
A,
{
value: o.lastName,
isErrored: !!n.lastName,
disabled: t("lastName")?.disabled,
onChange: (s) => {
d("lastName", s), l("lastName", s, e);
}
}
)
] }),
/* @__PURE__ */ a.jsx(
D,
{
errorId: n.birthDate,
locale: E,
onChange: (s) => {
d("birthDate", s), l("birthDate", s, e);
},
value: o.birthDate,
disabled: t("birthDate")?.disabled
}
),
/* @__PURE__ */ a.jsx(
O,
{
isErrored: !!n.postalCode,
onChange: (s) => {
d("postalCode", s), l("postalCode", s, e);
},
value: o.postalCode,
disabled: t("postalCode")?.disabled,
explanation: /* @__PURE__ */ a.jsx(
p,
{
id: "postalCodeExplanation",
defaultMessage: "Use the location on file with your licensing body"
}
)
}
),
/* @__PURE__ */ a.jsx(
F,
{
value: o.email,
isErrored: !!n.email,
explanation: /* @__PURE__ */ a.jsx(
p,
{
id: "emailExplanation",
defaultMessage: "Needed to send you your unique code"
}
),
onChange: (s) => {
d("email", s), l("email", s, e);
},
onKeyDown: (s) => _(s),
disabled: t("email")?.disabled
}
),
e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
V,
{
isRequired: !!e.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!n.phoneNumber,
onChange: (s) => {
d("phoneNumber", s), l("phoneNumber", s, e);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: t("phoneNumber")?.disabled
}
) : null,
h.customFormFields.map((s) => /* @__PURE__ */ a.jsx(k, { config: s, verificationService: e })),
/* @__PURE__ */ a.jsx(
z,
{
verificationService: e,
isErrored: !!n.marketConsentValue,
onChange: (s) => {
d("metadata", {
...e.viewModel.metadata,
marketConsentValue: s
}), l("marketConsentValue", s, e);
},
viewModel: o,
disabled: t("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ a.jsx(B, { verificationService: e, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ a.jsx(
H,
{
step: G.collectLicensedProfessionalPersonalInfo,
verificationService: e,
viewModel: o,
failedInstantMatch: b,
buttonText: /* @__PURE__ */ a.jsx(
p,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Licensed Professional Status"
}
)
}
)
]
}
);
}, J = x(
w
);
export {
J as default
};