@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
207 lines (205 loc) • 7.98 kB
JavaScript
/**
* VERSION: 2.154.0-alpha.1
* BUILD_TIMESTAMP: 1763401626706
* BUILD_DATE: Mon Nov 17 2025 17:47:06 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d
*/
import { e as M, am as C, an as y, ao as w, j as e, t as R, A as E, R as S, v as F, C as I, O as T, ap as _, aq as k, ar as D } from "./es6-OV3Jb0XZ.js";
import h from "react";
import { FormattedHTMLMessage as s } from "react-intl";
const g = (t, i = "_top") => {
window.open(t, i).focus();
}, U = () => {
switch (T().restApi.serviceUrl) {
case "https://services.sheerid.com":
return "https://shr-id.com";
default:
return "https://aa-preview.sheerid.net";
}
}, z = ({ verificationService: t }) => {
const { verificationResponse: i, programId: r, viewModel: x } = t, { verificationId: a, redirectUrl: m } = i, { config: u } = t.programTheme, c = h.useRef(null), b = !!m, l = i.rewardCode || "{rewardCode}", p = u.offerType === "noCode", { rewardDisplay: f } = u, j = !p && !!f.length, n = M(
C
) || i.consumerInfoState, N = n === "consumerNotFound" || n === "consumerFoundNewFieldsAvailable", d = y(x, i), v = () => {
_(k.SUCCESS_REDIRECT_CLICKED, {
programId: r,
locale: d,
verificationId: a
}), g(D(d, r, a), "_blank");
};
return h.useEffect(() => {
c.current && (c.current.innerHTML = "", w(
c.current,
`${U()}/affinity/${d}/${r}/${a}`
));
}, [c, r, a, d]), /* @__PURE__ */ e.jsxs("div", { id: "sid-step-success", className: "sid-success-container sid-l-container", role: "region", children: [
/* @__PURE__ */ e.jsxs("div", { className: "sid-header sid-l-horz-center sid-l-space-top-md", children: [
/* @__PURE__ */ e.jsx("div", { className: "sid-success-logo-container sid-l-horz-center", children: /* @__PURE__ */ e.jsx(
R,
{
verificationService: t,
fallbackLogo: /* @__PURE__ */ e.jsx(
"img",
{
className: "sid-success-logo-default sid-l-lead-image",
alt: "",
src: "https://assets-resources.sheerid.com/common/images/2018/icons/circle-check.svg"
}
)
}
) }),
/* @__PURE__ */ e.jsx(E, { align: "center", children: /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.title",
defaultMessage: "Success! You've been verified.",
tagName: "h1"
}
) }),
/* @__PURE__ */ e.jsx("div", { className: "sid-header__subtitle sid-l-horz-center", children: /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.subtitle",
defaultMessage: "You are now eligible for this special offer.",
tagName: "p"
}
) })
] }),
j && /* @__PURE__ */ e.jsx("div", { className: "sid-l-horz-center sid-reward-container sid-l-space-top-md", children: f.map((o) => o !== S.TEXT ? /* @__PURE__ */ e.jsx(
"img",
{
className: "sid-l-space-top-md sid-barcode",
alt: l,
src: F(a, "rewardCode", o)
},
o
) : /* @__PURE__ */ e.jsxs("div", { children: [
/* @__PURE__ */ e.jsx(
"div",
{
className: "sid-reward-code sid-l-space-top-md sid-h-jumbo-text sid-l-horz-center",
role: "region",
children: l
}
),
/* @__PURE__ */ e.jsx("div", { className: "sid-l-space-top-md sid-h-bold-text sid-l-horz-center", children: /* @__PURE__ */ e.jsx(
I,
{
textToCopy: l,
notificationText: /* @__PURE__ */ e.jsx(s, { id: "copied", defaultMessage: "Copied" }),
children: /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.copyCouponCode",
defaultMessage: "Copy coupon code"
}
)
}
) })
] }, o)) }),
/* @__PURE__ */ e.jsx(
"div",
{
className: `sid-footer sid-success-footer sid-l-horz-center ${p ? "sid-l-space-top-md" : "sid-l-space-top-lg"}`,
children: /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.emailNotification",
defaultMessage: "We have sent you a confirmation email. Look for the email from verify@sheerid.com.",
tagName: "p"
}
)
}
),
b ? /* @__PURE__ */ e.jsx("div", { className: "sid-submit sid-success-submit sid-l-space-top-md", children: /* @__PURE__ */ e.jsx(
"button",
{
type: "button",
onClick: () => g(m),
className: "sid-btn sid-success-redirect-btn sid-btn--dark",
children: /* @__PURE__ */ e.jsx(s, { id: "step.success.redirectButtonText", defaultMessage: "Continue" })
}
) }) : "",
/* @__PURE__ */ e.jsx(
"div",
{
className: "sid-footer sid-success-verification-only-footer sid-l-horz-center sid-l-space-top-lg sid-h-small-text",
role: "contentinfo",
children: /* @__PURE__ */ e.jsx(s, { id: "companyName", defaultMessage: "{Company}", children: (o) => /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.verificationOnly",
defaultMessage: `
SheerID handles verification only.
Now that you've been approved, please direct all questions about the
promotion terms to {companyName} customer service.
`,
values: { companyName: o },
tagName: "p"
}
) })
}
),
t.programTheme.affinityProgramEnabled && /* @__PURE__ */ e.jsx(
"div",
{
ref: c,
id: "sid-affinity-iframe",
className: "sid-affinity-container sid-l-full-width sid-l-space-top-lg"
}
),
N && /* @__PURE__ */ e.jsxs("div", { className: "sid-remember-me-footer-container", children: [
/* @__PURE__ */ e.jsx("div", { className: "sid-remember-me-title", children: n === "consumerNotFound" ? /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.rememberMe.consumerNotFound.title",
defaultMessage: "Save your info for 1-click verification"
}
) : /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.rememberMe.consumerFound.title",
defaultMessage: "Update Your Profile"
}
) }),
/* @__PURE__ */ e.jsx("div", { className: "sid-remember-me-description", children: n === "consumerNotFound" ? /* @__PURE__ */ e.jsx(s, { id: "companyName", defaultMessage: "{Company}", children: (o) => /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.rememberMe.consumerNotFound.description",
defaultMessage: "Get faster access to future offers with {companyName} and other brands using SheerID's Remember Me service.",
values: { companyName: o }
}
) }) : /* @__PURE__ */ e.jsx(s, { id: "companyName", defaultMessage: "{Company}", children: (o) => /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.rememberMe.consumerFound.description",
defaultMessage: "Save new info for future offers with {companyName} and other brands using SheerID's Remember Me service.",
values: { companyName: o }
}
) }) }),
/* @__PURE__ */ e.jsx(
"button",
{
type: "button",
onClick: v,
className: "sid-btn sid-remember-me-redirect-btn",
children: n === "consumerNotFound" ? /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.rememberMe.consumerNotFound.button",
defaultMessage: "Enroll Now"
}
) : /* @__PURE__ */ e.jsx(
s,
{
id: "step.success.rememberMe.consumerFound.button",
defaultMessage: "Save to Remember Me"
}
)
}
)
] })
] });
}, $ = z;
export {
$ as default
};