@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
308 lines (306 loc) • 10.3 kB
JavaScript
/**
* VERSION: 2.113.0-alpha.0
* BUILD_TIMESTAMP: 1750184680813
* BUILD_DATE: Tue Jun 17 2025 18:24:40 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 896154e79f58fffa6d52f3ed37f2db760a63df88
*/
import { k as _, j as s, M as U, m as Y, al as $, E as F, f as l, u as t, N as G, w as X, a1 as Z, ab as J, av as Q, ap as S, aw as v, a3 as ee, O as ae, T as se, a4 as oe, W as le, n as ne, X as te, a5 as de, Y as re, Z as me, _ as ie, o as pe, V as ue, aa as be, ax as Ce } from "./es6-B9qAIX4x.js";
import ge from "react";
import { injectIntl as xe, FormattedHTMLMessage as r } from "react-intl";
import { u as he } from "./useCollectFieldsEndpoint-Df4fm8kA.js";
import { u as Me, E as Ee } from "./useEmailFirstExperiment-BOHCZCqy.js";
const Ie = {
AT: "gbrNummer",
ES: "numeroColegiado",
DK: "autorisationsId",
CH: "globalLocationNumber",
IE: "registrationNumber",
GB: "registrationNumber"
}, k = (i) => {
const a = Ie[i] || "registrationNumber";
return {
labelKey: `step.collectMedicalPersonalInfo.${a}Label`,
explanationKey: `step.collectMedicalPersonalInfo.${a}Explanation`
};
}, je = ({
intl: i,
verificationService: a
}) => {
var C, g, x, h, M, E, I, j, N, f, y, P, c;
const o = a.viewModel, { fieldValidationErrors: n } = a, m = a.verificationResponse, R = _(m), L = G(), D = o.localeChoice.value, d = (e, W) => {
const A = be(o, e, W);
a.updateViewModel(A);
}, { isFieldOptional: w } = he({
verificationId: m.verificationId,
currentStep: m.currentStep,
viewModel: o
}), p = w("memberId"), {
isEmailUpTop: u,
isEmailValidationLoading: T,
showFormFields: K,
emailLookupResponse: b,
emailOnBlur: O,
emailOnKeyDown: V,
handleResendClick: B,
showEmailLookupResponseMessages: z,
enableFormFields: H,
handleOnClickProceedHere: q
} = Me(
a.programId,
o.email,
a.verificationResponse.segment
);
return ge.useEffect(() => {
p ? a.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : a.updateViewModel(
{ fieldsToSkipValidation: ["memberId"] },
{ partial: !0 }
);
}, [p]), /* @__PURE__ */ s.jsxs(
U,
{
verificationService: a,
step: m.currentStep,
children: [
/* @__PURE__ */ s.jsx(
Y,
{
verificationService: a,
classNameIdentifier: "medical-personal-info"
}
),
// #region email-first-experiment
u && /* @__PURE__ */ s.jsxs("div", { className: "email-input-wrapper", children: [
T && /* @__PURE__ */ s.jsx("div", { className: "email-input-wrapper-frame", children: /* @__PURE__ */ s.jsx("div", { className: "transform-scale", children: /* @__PURE__ */ s.jsx($, {}) }) }),
/* @__PURE__ */ s.jsx(
F,
{
value: o.email,
isErrored: !!n.email,
explanation: /* @__PURE__ */ s.jsx(
r,
{
id: "emailExplanation",
defaultMessage: "Personal email address is recommended"
}
),
onChange: (e) => {
d("email", e), t("email", e, a);
},
onKeyDown: V,
onBlur: O,
disabled: (C = l("email")) == null ? void 0 : C.disabled
}
)
] }),
z && b && /* @__PURE__ */ s.jsx(
Ee,
{
emailLookupResponse: b,
onResendClick: B,
onHandleClickLink: q
}
),
K && /* @__PURE__ */ s.jsxs("div", { className: H || !u ? "" : "sid-disable-elements", children: [
/* @__PURE__ */ s.jsx(X, { verificationService: a }),
/* @__PURE__ */ s.jsx(
Z,
{
verificationService: a,
disabled: (g = l("country")) == null ? void 0 : g.disabled
}
),
/* @__PURE__ */ s.jsx(
J,
{
segmentId: "medical",
value: {
value: o.status,
label: S(
i,
o.status,
Ce
)
},
isErrored: !!n.status,
options: Q(i, m.availableStatuses),
disabled: (x = l("status")) == null ? void 0 : x.disabled,
onChange: (e) => {
d("status", e ? e.value : ""), t(
"status",
e ? e.value : "",
a
);
}
}
),
/* @__PURE__ */ s.jsx(
v,
{
isErrored: !!n.organization,
onChange: (e) => {
ee(e, a), t("organization", e, a);
},
value: a.viewModel.organization,
verificationService: a,
disabled: (h = l("organization")) == null ? void 0 : h.disabled
}
),
/* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ s.jsx(
ae,
{
value: o.firstName,
isErrored: !!n.firstName,
disabled: (M = l("firstName")) == null ? void 0 : M.disabled,
onChange: (e) => {
d("firstName", e), t("firstName", e, a);
}
}
),
/* @__PURE__ */ s.jsx(
se,
{
value: o.lastName,
isErrored: !!n.lastName,
disabled: (E = l("lastName")) == null ? void 0 : E.disabled,
onChange: (e) => {
d("lastName", e), t("lastName", e, a);
}
}
)
] }),
/* @__PURE__ */ s.jsx(
oe,
{
errorId: n.birthDate,
locale: D,
disabled: (I = l("birthDate")) == null ? void 0 : I.disabled,
onChange: (e) => {
d("birthDate", e), t("birthDate", e, a);
},
value: o.birthDate
}
),
/* @__PURE__ */ s.jsx(
le,
{
isErrored: !!n.postalCode,
onChange: (e) => {
d("postalCode", e), t("postalCode", e, a);
},
value: o.postalCode,
disabled: (j = l("postalCode")) == null ? void 0 : j.disabled,
explanation: /* @__PURE__ */ s.jsx(
r,
{
id: "postalCodeExplanation",
defaultMessage: "Use the location on file with your licensing body"
}
)
}
),
!u && /* @__PURE__ */ s.jsx(
F,
{
value: o.email,
isErrored: !!n.email,
explanation: /* @__PURE__ */ s.jsx(
r,
{
id: "emailExplanation",
defaultMessage: "Needed to send you your unique code"
}
),
onChange: (e) => {
d("email", e), t("email", e, a);
},
onKeyDown: (e) => ne(e),
disabled: (N = l("email")) == null ? void 0 : N.disabled
}
),
a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
te,
{
isRequired: !!a.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!n.phoneNumber,
onChange: (e) => {
d("phoneNumber", e), t("phoneNumber", e, a);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: (f = l("phoneNumber")) == null ? void 0 : f.disabled
}
) : null,
p && /* @__PURE__ */ s.jsx(
de,
{
value: o.memberId,
isErrored: !!n.memberId,
isRequired: (y = l("memberId")) == null ? void 0 : y.requireIfOptional,
disabled: (P = l("memberId")) == null ? void 0 : P.disabled,
onChange: (e) => {
d("memberId", e), t("memberId", e, a);
},
explanation: /* @__PURE__ */ s.jsx(
r,
{
id: k(o.country).explanationKey,
defaultMessage: "Your Professional Membership Registration Number"
}
),
label: /* @__PURE__ */ s.jsx(
r,
{
id: k(o.country).labelKey,
defaultMessage: "Registration Number"
}
)
}
),
L.customFormFields.map((e) => /* @__PURE__ */ s.jsx(re, { config: e, verificationService: a })),
/* @__PURE__ */ s.jsx(
me,
{
verificationService: a,
isErrored: !!n.marketConsentValue,
onChange: (e) => {
d("metadata", {
...a.viewModel.metadata,
marketConsentValue: e
}), t(
"marketConsentValue",
e,
a
);
},
viewModel: o,
disabled: (c = l("marketConsentValue")) == null ? void 0 : c.disabled
}
),
/* @__PURE__ */ s.jsx(ie, { verificationService: a, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ s.jsx(
pe,
{
step: ue.collectMedicalProfessionalPersonalInfo,
verificationService: a,
viewModel: o,
failedInstantMatch: R,
buttonText: /* @__PURE__ */ s.jsx(
r,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Medical Professional Status"
}
)
}
)
] })
]
}
);
}, Fe = xe(
je
);
export {
Fe as default
};