@frak-labs/components 1.0.12 → 1.0.13
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/cdn/Banner.BM-XicfW.js +183 -0
- package/cdn/ButtonShare.DsCfkEG1.js +1 -0
- package/cdn/ButtonWallet.BQt3QmKr.js +40 -0
- package/cdn/{GiftIcon.DT1i36Fm.js → GiftIcon.DcyE1R1V.js} +1 -1
- package/cdn/OpenInAppButton.BIfTfSWS.js +1 -0
- package/cdn/PostPurchase.Bcnzehoo.js +89 -0
- package/cdn/actions-CMPlZ7CH.CJIqArwi.js +1 -0
- package/cdn/clientReady.ClcVd4_w.js +1 -0
- package/cdn/components.js +1 -1
- package/cdn/defaults.CIT5-NpH.js +58 -0
- package/cdn/embeddedWallet.BXl45f3Y.js +1 -0
- package/cdn/loader.js +1 -154
- package/cdn/rewards.CW3JGWuC.js +1 -0
- package/cdn/sharedBaseCss.css.BDzFcWnD.js +154 -0
- package/cdn/sharingPage.BjReoj_N.js +1 -0
- package/cdn/sharingPageProducts.BoDmfrdn.js +1 -0
- package/cdn/styleManager.Cun1-fKi.js +1 -0
- package/cdn/useGlobalComponents.DqV5lr6s.js +1 -0
- package/cdn/useLightDomStyles.BsQue5kI.js +1 -0
- package/cdn/useReward.CcsZ70zp.js +1 -0
- package/dist/{GiftIcon-BEzYdiux.js → GiftIcon-BhL0bhVu.js} +10 -4
- package/dist/banner.d.ts +1 -16
- package/dist/banner.js +24 -8
- package/dist/buttonShare.d.ts +3 -11
- package/dist/buttonShare.js +6 -6
- package/dist/buttonWallet.d.ts +1 -7
- package/dist/buttonWallet.js +3 -3
- package/dist/i18n/defaults.d.ts +3 -2
- package/dist/i18n/defaults.js +5 -5
- package/dist/openInApp.d.ts +1 -5
- package/dist/openInApp.js +2 -2
- package/dist/postPurchase.d.ts +1 -19
- package/dist/postPurchase.js +5 -5
- package/dist/{rewards-VoZGH2Ko.js → rewards-BtPHdGcI.js} +4 -3
- package/dist/{useGlobalComponents-CZ7Sh2tZ.js → useGlobalComponents-Da9LDlRy.js} +1 -1
- package/dist/{useLightDomStyles-DphuQhvx.js → useLightDomStyles-DRkTVy4s.js} +1 -1
- package/dist/{usePlacement-4PoDbn2X.js → usePlacement-NZOjZ6IR.js} +6 -14
- package/dist/{useReward-BGgymGoH.js → useReward-B-yZ7nhY.js} +1 -1
- package/package.json +7 -6
- package/cdn/Banner.CgCiMrqn.js +0 -167
- package/cdn/ButtonShare.BiOpzkRY.js +0 -1
- package/cdn/ButtonWallet.Mmrku6ws.js +0 -40
- package/cdn/OpenInAppButton.D1UzTuHx.js +0 -1
- package/cdn/PostPurchase.Cvx1TI64.js +0 -89
- package/cdn/defaults.kWEdCyGS.js +0 -58
- package/cdn/embeddedWallet.BS-9u4Be.js +0 -1
- package/cdn/rewards.CIu9qbmI.js +0 -1
- package/cdn/useGlobalComponents.BC6Jgzg5.js +0 -1
- package/cdn/useLightDomStyles.imPXuAtf.js +0 -1
- package/cdn/useReward.BAmvPaVu.js +0 -1
- /package/cdn/{replay-V6FXES7X.BoL9fAjx.js → replay-V6FXES7X.efKsNT6s.js} +0 -0
- /package/dist/{embeddedWallet-By3_p5Xc.js → embeddedWallet-CxgyuwtP.js} +0 -0
package/dist/i18n/defaults.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Language } from "@frak-labs/core-sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/i18n/defaults.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Shape of the built-in copy for every SDK Web Component. Declared explicitly
|
|
@@ -26,7 +25,9 @@ type ComponentCopy = {
|
|
|
26
25
|
ariaLabel: string;
|
|
27
26
|
};
|
|
28
27
|
banner: {
|
|
29
|
-
/** Referral title used when an estimated reward is available (carries the `{REWARD}` token). */
|
|
28
|
+
/** Referral title used when an estimated reward is available (carries the `{REWARD}` token). */
|
|
29
|
+
referralTitleReward: string;
|
|
30
|
+
/** Referral title used when no reward could be resolved. */
|
|
30
31
|
referralTitle: string;
|
|
31
32
|
referralDescription: string;
|
|
32
33
|
referralCta: string;
|
package/dist/i18n/defaults.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
const componentDefaults = {
|
|
16
16
|
en: {
|
|
17
|
-
buttonShare: { text: "Share
|
|
17
|
+
buttonShare: { text: "Share & earn {REWARD}!" },
|
|
18
18
|
postPurchase: {
|
|
19
19
|
refereeText: "You just earned {REWARD}! Share with friends to earn even more.",
|
|
20
20
|
refereeNoRewardText: "You just earned a reward! Share with friends to earn even more.",
|
|
@@ -29,7 +29,7 @@ const componentDefaults = {
|
|
|
29
29
|
},
|
|
30
30
|
buttonWallet: { ariaLabel: "Open wallet" },
|
|
31
31
|
banner: {
|
|
32
|
-
referralTitleReward: "Earn {REWARD} on purchases
|
|
32
|
+
referralTitleReward: "Earn {REWARD} on purchases",
|
|
33
33
|
referralTitle: "You've been referred!",
|
|
34
34
|
referralDescription: "Earn rewards after your purchase via the Frak partner app.",
|
|
35
35
|
referralCta: "Got it",
|
|
@@ -40,7 +40,7 @@ const componentDefaults = {
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
fr: {
|
|
43
|
-
buttonShare: { text: "Partagez et gagnez !" },
|
|
43
|
+
buttonShare: { text: "Partagez et gagnez {REWARD} !" },
|
|
44
44
|
postPurchase: {
|
|
45
45
|
refereeText: "Vous venez de gagner {REWARD} ! Partagez avec vos amis pour gagner encore plus.",
|
|
46
46
|
refereeNoRewardText: "Vous venez de gagner une récompense ! Partagez avec vos amis pour gagner encore plus.",
|
|
@@ -53,9 +53,9 @@ const componentDefaults = {
|
|
|
53
53
|
text: "Ouvrir dans l'app",
|
|
54
54
|
ariaLabel: "Ouvrir dans l'app Frak Wallet"
|
|
55
55
|
},
|
|
56
|
-
buttonWallet: { ariaLabel: "Ouvrir le
|
|
56
|
+
buttonWallet: { ariaLabel: "Ouvrir le porte-monnaie" },
|
|
57
57
|
banner: {
|
|
58
|
-
referralTitleReward: "Gagnez {REWARD} sur vos achats
|
|
58
|
+
referralTitleReward: "Gagnez {REWARD} sur vos achats",
|
|
59
59
|
referralTitle: "Vous avez été parrainé !",
|
|
60
60
|
referralDescription: "Gagnez des récompenses après votre achat via l'application partenaire Frak.",
|
|
61
61
|
referralCta: "J'ai compris",
|
package/dist/openInApp.d.ts
CHANGED
|
@@ -45,11 +45,7 @@ type OpenInAppButtonProps = {
|
|
|
45
45
|
* <frak-open-in-app classname="button button-primary"></frak-open-in-app>
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
declare function OpenInAppButton({
|
|
49
|
-
placement: placementId,
|
|
50
|
-
text,
|
|
51
|
-
classname
|
|
52
|
-
}: OpenInAppButtonProps): import("preact").JSX.Element | null;
|
|
48
|
+
declare function OpenInAppButton({ placement: placementId, text, classname }: OpenInAppButtonProps): import("preact").JSX.Element | null;
|
|
53
49
|
//#endregion
|
|
54
50
|
//#region src/components/OpenInAppButton/index.d.ts
|
|
55
51
|
/**
|
package/dist/openInApp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
1
|
+
import { i as useLang, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-NZOjZ6IR.js";
|
|
2
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DRkTVy4s.js";
|
|
3
3
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
4
4
|
import { DEEP_LINK_SCHEME, isMobile, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
|
|
5
5
|
import { useMemo } from "preact/hooks";
|
package/dist/postPurchase.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SharingPageProduct } from "@frak-labs/core-sdk";
|
|
2
|
-
|
|
3
2
|
//#region src/components/PostPurchase/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Props for the {@link PostPurchase} component.
|
|
@@ -125,24 +124,7 @@ type PostPurchaseProps = {
|
|
|
125
124
|
* ></frak-post-purchase>
|
|
126
125
|
* ```
|
|
127
126
|
*/
|
|
128
|
-
declare function PostPurchase({
|
|
129
|
-
customerId,
|
|
130
|
-
orderId,
|
|
131
|
-
token,
|
|
132
|
-
sharingUrl,
|
|
133
|
-
merchantId,
|
|
134
|
-
placement: placementId,
|
|
135
|
-
classname,
|
|
136
|
-
variant: forcedVariant,
|
|
137
|
-
badgeText: propBadgeText,
|
|
138
|
-
referrerText: propReferrerText,
|
|
139
|
-
refereeText: propRefereeText,
|
|
140
|
-
ctaText: propCtaText,
|
|
141
|
-
preview,
|
|
142
|
-
previewVariant,
|
|
143
|
-
products,
|
|
144
|
-
imageUrl: propImageUrl
|
|
145
|
-
}: PostPurchaseProps): import("preact").JSX.Element | null;
|
|
127
|
+
declare function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, placement: placementId, classname, variant: forcedVariant, badgeText: propBadgeText, referrerText: propReferrerText, refereeText: propRefereeText, ctaText: propCtaText, preview, previewVariant, products, imageUrl: propImageUrl }: PostPurchaseProps): import("preact").JSX.Element | null;
|
|
146
128
|
//#endregion
|
|
147
129
|
//#region src/components/PostPurchase/index.d.ts
|
|
148
130
|
/**
|
package/dist/postPurchase.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as sanitizeProductList, i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useGlobalComponents } from "./useGlobalComponents-
|
|
3
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
4
|
-
import { i as y, n as T, r as b } from "./rewards-
|
|
1
|
+
import { c as sanitizeProductList, i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-NZOjZ6IR.js";
|
|
2
|
+
import { t as useGlobalComponents } from "./useGlobalComponents-Da9LDlRy.js";
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DRkTVy4s.js";
|
|
4
|
+
import { i as y, n as T, r as b } from "./rewards-BtPHdGcI.js";
|
|
5
5
|
import { componentDefaults } from "./i18n/defaults.js";
|
|
6
|
-
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-
|
|
6
|
+
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-BhL0bhVu.js";
|
|
7
7
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
8
8
|
import { getMerchantInformation, getUserReferralStatus, trackPurchaseStatus } from "@frak-labs/core-sdk/actions";
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../core/dist/getCurrencyAmountKey-
|
|
1
|
+
//#region ../core/dist/getCurrencyAmountKey-C-1W-BRg.js
|
|
2
2
|
const e = {
|
|
3
3
|
eur: `fr-FR`,
|
|
4
4
|
usd: `en-US`,
|
|
@@ -48,11 +48,12 @@ function a(e, t, n) {
|
|
|
48
48
|
}
|
|
49
49
|
return o;
|
|
50
50
|
}
|
|
51
|
-
const o = new Set([
|
|
51
|
+
const o = /* @__PURE__ */ new Set([
|
|
52
52
|
`gt`,
|
|
53
53
|
`gte`,
|
|
54
54
|
`between`
|
|
55
|
-
])
|
|
55
|
+
]);
|
|
56
|
+
const s = /* @__PURE__ */ new Set([`gt`, `gte`]);
|
|
56
57
|
function c(e) {
|
|
57
58
|
let t = a(e, `purchase.amount`, o);
|
|
58
59
|
return t.length > 0 ? Math.min(...t) : void 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as subscribeSdkConfig } from "./usePlacement-
|
|
1
|
+
import { a as subscribeSdkConfig } from "./usePlacement-NZOjZ6IR.js";
|
|
2
2
|
import { sdkConfigStore } from "@frak-labs/core-sdk";
|
|
3
3
|
import { useSyncExternalStore } from "preact/compat";
|
|
4
4
|
//#region src/hooks/useGlobalComponents.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import register from "preact-custom-element";
|
|
2
2
|
import * as coreSdkIndex from "@frak-labs/core-sdk";
|
|
3
|
-
import { decompressJsonFromB64, deleteQueryParamCaseInsensitive, getQueryParamCaseInsensitive, sdkConfigStore, setupClient, trackEvent, withCache } from "@frak-labs/core-sdk";
|
|
3
|
+
import { decompressJsonFromB64, deleteQueryParamCaseInsensitive, detectPageLanguage, getQueryParamCaseInsensitive, sdkConfigStore, setupClient, trackEvent, withCache } from "@frak-labs/core-sdk";
|
|
4
4
|
import * as coreSdkActions from "@frak-labs/core-sdk/actions";
|
|
5
5
|
import { displaySharingPage } from "@frak-labs/core-sdk/actions";
|
|
6
6
|
import { useCallback, useEffect, useState } from "preact/hooks";
|
|
@@ -365,24 +365,16 @@ function subscribeSdkConfig(onStoreChange) {
|
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/hooks/useLang.ts
|
|
367
367
|
/**
|
|
368
|
-
* Detect a supported language from the browser, defaulting to English.
|
|
369
|
-
* Only `en` / `fr` are recognised — anything else falls back to `en`.
|
|
370
|
-
*/
|
|
371
|
-
function detectBrowserLang() {
|
|
372
|
-
if (typeof navigator === "undefined") return "en";
|
|
373
|
-
return navigator.language?.split("-")[0] === "fr" ? "fr" : "en";
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
368
|
* Resolve the active display language for the Web Components.
|
|
377
369
|
*
|
|
378
370
|
* Precedence: resolved SDK/backend config `lang` (driven by `metadata.lang`
|
|
379
|
-
* or the backend `/resolve` response) →
|
|
380
|
-
* `useSyncExternalStore` with a bare-string
|
|
381
|
-
* dispatch only re-renders the component when
|
|
382
|
-
* changes (see `@/i18n/defaults`).
|
|
371
|
+
* or the backend `/resolve` response) → page `<html lang>` → browser
|
|
372
|
+
* language → `en`. Backed by `useSyncExternalStore` with a bare-string
|
|
373
|
+
* snapshot, so a `frak:config` dispatch only re-renders the component when
|
|
374
|
+
* the resolved language actually changes (see `@/i18n/defaults`).
|
|
383
375
|
*/
|
|
384
376
|
function useLang() {
|
|
385
|
-
return useSyncExternalStore(subscribeSdkConfig, () => sdkConfigStore.getConfig().lang ??
|
|
377
|
+
return useSyncExternalStore(subscribeSdkConfig, () => sdkConfigStore.getConfig().lang ?? detectPageLanguage() ?? "en");
|
|
386
378
|
}
|
|
387
379
|
//#endregion
|
|
388
380
|
//#region src/styles/sharedCss.ts
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "1.0.
|
|
14
|
+
"version": "1.0.13",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"clean": "rimraf cdn dist",
|
|
85
85
|
"build": "tsdown",
|
|
86
86
|
"build:watch": "tsdown --watch",
|
|
87
|
-
"typecheck": "
|
|
87
|
+
"typecheck": "tsc --noEmit",
|
|
88
88
|
"test": "vitest",
|
|
89
89
|
"test:ui": "vitest --ui",
|
|
90
90
|
"test:coverage": "vitest --coverage",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"publish": "echo 'Publishing components...'"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@frak-labs/core-sdk": "1.2.
|
|
95
|
+
"@frak-labs/core-sdk": "1.2.1",
|
|
96
96
|
"@frak-labs/frame-connector": "0.2.0",
|
|
97
97
|
"preact": "^10.29.0",
|
|
98
98
|
"preact-custom-element": "^4.6.0",
|
|
@@ -108,15 +108,16 @@
|
|
|
108
108
|
"@types/jsdom": "^28.0.0",
|
|
109
109
|
"@types/node": "^25.6.0",
|
|
110
110
|
"@types/preact-custom-element": "^4.0.4",
|
|
111
|
-
"@
|
|
111
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
112
|
+
"@vanilla-extract/css": "^1.21.1",
|
|
112
113
|
"@vanilla-extract/integration": "^8.0.10",
|
|
113
|
-
"@vanilla-extract/vite-plugin": "^5.2.1",
|
|
114
114
|
"@vanilla-extract/sprinkles": "^1.6.5",
|
|
115
|
+
"@vanilla-extract/vite-plugin": "^5.2.4",
|
|
115
116
|
"@vitest/coverage-v8": "^4.1.0",
|
|
116
117
|
"@vitest/ui": "^4.1.0",
|
|
117
118
|
"jsdom": "^29.0.0",
|
|
118
119
|
"tsdown": "^0.22.0",
|
|
119
|
-
"typescript": "^6.0.
|
|
120
|
+
"typescript": "^6.0.3",
|
|
120
121
|
"vitest": "^4.1.4"
|
|
121
122
|
}
|
|
122
123
|
}
|
package/cdn/Banner.CgCiMrqn.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import{T as e,b as t,f as n,h as r,s as i,u as a}from"./loader.js";import{a as o,d as s,f as c,h as l,l as u,m as d,n as ee,p as f,s as te,t as p,u as m}from"./defaults.kWEdCyGS.js";import{a as h,i as g,n as _,r as v,t as y}from"./GiftIcon.DT1i36Fm.js";import{t as b}from"./useGlobalComponents.BC6Jgzg5.js";import{t as ne}from"./useLightDomStyles.imPXuAtf.js";import{r as x}from"./rewards.CIu9qbmI.js";import{t as re}from"./useReward.BAmvPaVu.js";const S=`@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
2
|
-
from {
|
|
3
|
-
opacity: 0;
|
|
4
|
-
transform: translateY(-4px);
|
|
5
|
-
}
|
|
6
|
-
to {
|
|
7
|
-
opacity: 1;
|
|
8
|
-
transform: translateY(0);
|
|
9
|
-
}
|
|
10
|
-
}`,C=`.inAppBanner_container__1ibpiy70 {
|
|
11
|
-
position: fixed;
|
|
12
|
-
top: max(8px, env(safe-area-inset-top));
|
|
13
|
-
left: 16px;
|
|
14
|
-
right: 16px;
|
|
15
|
-
z-index: 1000;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: 4px;
|
|
19
|
-
padding: 12px 16px;
|
|
20
|
-
padding-right: 32px;
|
|
21
|
-
border-radius: 12px;
|
|
22
|
-
background-color: #000000cc;
|
|
23
|
-
backdrop-filter: blur(12px);
|
|
24
|
-
-webkit-backdrop-filter: blur(12px);
|
|
25
|
-
color: var(--text-onAction__pbq4ak6);
|
|
26
|
-
animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
|
|
27
|
-
}
|
|
28
|
-
.inAppBanner_header__1ibpiy71 {
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
gap: 8px;
|
|
32
|
-
}
|
|
33
|
-
.inAppBanner_iconWrapper__1ibpiy72 {
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
width: 20px;
|
|
36
|
-
height: 20px;
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
color: var(--text-onAction__pbq4ak6);
|
|
41
|
-
}
|
|
42
|
-
.inAppBanner_title__1ibpiy73 {
|
|
43
|
-
margin: 0;
|
|
44
|
-
padding: 0;
|
|
45
|
-
font-size: 16px;
|
|
46
|
-
font-weight: 500;
|
|
47
|
-
line-height: 26px;
|
|
48
|
-
color: var(--text-onAction__pbq4ak6);
|
|
49
|
-
}
|
|
50
|
-
.inAppBanner_body__1ibpiy74 {
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-wrap: wrap;
|
|
53
|
-
align-items: baseline;
|
|
54
|
-
gap: 0 4px;
|
|
55
|
-
}
|
|
56
|
-
.inAppBanner_description__1ibpiy75 {
|
|
57
|
-
margin: 0;
|
|
58
|
-
padding: 0;
|
|
59
|
-
font-size: 14px;
|
|
60
|
-
color: var(--text-onAction__pbq4ak6);
|
|
61
|
-
line-height: 22px;
|
|
62
|
-
opacity: 0.96;
|
|
63
|
-
}
|
|
64
|
-
.inAppBanner_cta__1ibpiy76 {
|
|
65
|
-
all: unset;
|
|
66
|
-
display: inline-flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
gap: 4px;
|
|
69
|
-
color: #2bb2ff;
|
|
70
|
-
font-size: 14px;
|
|
71
|
-
font-weight: 600;
|
|
72
|
-
text-decoration: underline;
|
|
73
|
-
text-underline-offset: 2px;
|
|
74
|
-
cursor: pointer;
|
|
75
|
-
}
|
|
76
|
-
.inAppBanner_cta__1ibpiy76:focus-visible {
|
|
77
|
-
outline: 2px solid #2bb2ff;
|
|
78
|
-
outline-offset: 2px;
|
|
79
|
-
border-radius: 4px;
|
|
80
|
-
}
|
|
81
|
-
.inAppBanner_closeButton__1ibpiy77 {
|
|
82
|
-
all: unset;
|
|
83
|
-
position: absolute;
|
|
84
|
-
top: 8px;
|
|
85
|
-
right: 8px;
|
|
86
|
-
width: 28px;
|
|
87
|
-
height: 28px;
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
justify-content: center;
|
|
91
|
-
border-radius: 9999px;
|
|
92
|
-
color: #ffffff99;
|
|
93
|
-
cursor: pointer;
|
|
94
|
-
}
|
|
95
|
-
.inAppBanner_closeButton__1ibpiy77:focus-visible {
|
|
96
|
-
outline: 2px solid var(--text-onAction__pbq4ak6);
|
|
97
|
-
outline-offset: 2px;
|
|
98
|
-
}`;var w=`inAppBanner_body__1ibpiy74`,T=`inAppBanner_closeButton__1ibpiy77`,E=`inAppBanner_container__1ibpiy70`,D=`inAppBanner_cta__1ibpiy76`,O=`inAppBanner_description__1ibpiy75`,k=`inAppBanner_header__1ibpiy71`,A=`inAppBanner_iconWrapper__1ibpiy72`,j=`inAppBanner_title__1ibpiy73`;S+C;function M({title:e,description:t,cta:n,dismissLabel:r,onAction:i,onDismiss:a,className:o,classNames:s}){return d(`div`,{className:`${E}${o?` ${o}`:``}`,role:`alert`,children:[d(`div`,{className:k,children:[d(`span`,{className:`${A}${s?.icon?` ${s.icon}`:``}`,children:d(_,{width:20,height:20})}),d(`p`,{className:`${j}${s?.title?` ${s.title}`:``}`,children:e})]}),d(`div`,{className:w,children:[d(`p`,{className:`${O}${s?.description?` ${s.description}`:``}`,children:t}),d(`button`,{type:`button`,className:`${D}${s?.cta?` ${s.cta}`:``}`,onClick:i,children:[n,d(g,{width:14,height:14})]})]}),d(`button`,{type:`button`,className:`${T}${s?.close?` ${s.close}`:``}`,onClick:a,"aria-label":r,children:d(h,{width:16,height:16})})]})}var ie=`Banner_frakLogo__1gnumzi9`,ae=`Banner_iconSvg__1gnumzi1`,oe=`Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0`,se=`Banner_referralBody__1gnumzi5`,ce=`Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0`,le=`Banner_referralDescription__1gnumzi7 reset_base__1831jhd0`,ue=`Banner_referralIconWrapper__1gnumzi3`,N=`Banner_referralImage__1gnumzi4`,P=`Banner_referralTitle__1gnumzi6 reset_base__1831jhd0`;const F=S+C+`.Banner_rootBase__1gnumzi0 {
|
|
99
|
-
position: relative;
|
|
100
|
-
display: flex;
|
|
101
|
-
animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
|
|
102
|
-
}
|
|
103
|
-
.Banner_iconSvg__1gnumzi1 {
|
|
104
|
-
width: 100%;
|
|
105
|
-
height: 100%;
|
|
106
|
-
}
|
|
107
|
-
.Banner_referral__1gnumzi2 {
|
|
108
|
-
flex-direction: row;
|
|
109
|
-
align-items: center;
|
|
110
|
-
gap: 16px;
|
|
111
|
-
padding: 16px;
|
|
112
|
-
background-color: #ffffff;
|
|
113
|
-
color: var(--text-primary__pbq4ak0);
|
|
114
|
-
border: 1px solid var(--border-default__pbq4akv);
|
|
115
|
-
border-radius: 12px;
|
|
116
|
-
}
|
|
117
|
-
.Banner_referralIconWrapper__1gnumzi3 {
|
|
118
|
-
flex-shrink: 0;
|
|
119
|
-
align-self: flex-start;
|
|
120
|
-
display: flex;
|
|
121
|
-
align-items: center;
|
|
122
|
-
justify-content: center;
|
|
123
|
-
width: 40px;
|
|
124
|
-
height: 40px;
|
|
125
|
-
overflow: hidden;
|
|
126
|
-
}
|
|
127
|
-
.Banner_referralImage__1gnumzi4 {
|
|
128
|
-
max-width: 100%;
|
|
129
|
-
max-height: 100%;
|
|
130
|
-
width: auto;
|
|
131
|
-
height: auto;
|
|
132
|
-
object-fit: contain;
|
|
133
|
-
display: block;
|
|
134
|
-
}
|
|
135
|
-
.Banner_referralBody__1gnumzi5 {
|
|
136
|
-
flex: 1;
|
|
137
|
-
min-width: 0;
|
|
138
|
-
}
|
|
139
|
-
.Banner_referralTitle__1gnumzi6 {
|
|
140
|
-
font-size: 16px;
|
|
141
|
-
font-weight: 600;
|
|
142
|
-
color: var(--text-primary__pbq4ak0);
|
|
143
|
-
line-height: 22px;
|
|
144
|
-
}
|
|
145
|
-
.Banner_referralDescription__1gnumzi7 {
|
|
146
|
-
margin-bottom: 8px;
|
|
147
|
-
font-size: 14px;
|
|
148
|
-
color: #979797;
|
|
149
|
-
line-height: 22px;
|
|
150
|
-
}
|
|
151
|
-
.Banner_referralCta__1gnumzi8 {
|
|
152
|
-
display: inline-block;
|
|
153
|
-
padding: 8px 16px;
|
|
154
|
-
border: 1px solid #000000;
|
|
155
|
-
border-radius: 9999px;
|
|
156
|
-
color: var(--text-primary__pbq4ak0);
|
|
157
|
-
font-size: 10px;
|
|
158
|
-
font-weight: 700;
|
|
159
|
-
line-height: 12px;
|
|
160
|
-
text-transform: uppercase;
|
|
161
|
-
}
|
|
162
|
-
.Banner_frakLogo__1gnumzi9 {
|
|
163
|
-
position: absolute;
|
|
164
|
-
right: 16px;
|
|
165
|
-
bottom: 12px;
|
|
166
|
-
pointer-events: none;
|
|
167
|
-
}`;function I({placement:l,classname:h=``,interaction:g,referralTitle:_,referralDescription:S,referralCta:C,inappTitle:w,inappDescription:T,inappCta:E,imageUrl:D,preview:O,previewMode:k,allowInappRedirect:A}){let j=!!O,I=o(),L=k===`inapp`?`inapp`:`referral`,R=A===!0||A===`true`,z=ee(l),{shouldRender:B,isHidden:V,isClientReady:H}=te();ne(`frak-banner`,l,z?.components?.banner?.css,F,e);let[U,W]=s(!1),[G,K]=s(()=>j?L:R&&r?`inapp`:null),q=u(null);f(()=>{j&&K(L)},[j,L]);let{reward:J}=re(G===`referral`&&H,g,`referee`),[Y,de]=s(null);f(()=>{let e=window.FrakSetup?.client;G!==`inapp`||j||!H||!e||i(e).then(e=>de(e)).catch(()=>{})},[G,j,H]),f(()=>{j||!G||U||q.current!==G&&H&&(t(window.FrakSetup?.client,`banner_impression`,{placement:l,variant:G,has_reward:G===`referral`?!!J:void 0}),q.current=G)},[G,U,H,j,l]),f(()=>{if(j||G===`inapp`)return;let e=()=>K(`referral`);return window.addEventListener(a,e),()=>window.removeEventListener(a,e)},[j,G]);let X=c(async()=>{if(j)return;if(t(window.FrakSetup?.client,`banner_resolved`,{placement:l,variant:G??`referral`,outcome:`clicked`}),G===`referral`){W(!0);return}let e=Y;if(!e&&window.FrakSetup?.client)try{e=await i(window.FrakSetup?.client)}catch{}let r=window.location.href;if(e){let t=new URL(r);t.searchParams.set(`fmt`,e),r=t.toString()}n(r)},[j,G,Y,l]),fe=c(()=>{j||(t(window.FrakSetup?.client,`banner_resolved`,{placement:l,variant:G??`referral`,outcome:`dismissed`}),W(!0))},[j,G,l]),pe=b(),Z=z?.components?.banner??pe?.banner,Q=D??Z?.imageUrl,$=m(()=>{let e=p[I].banner;if(G===`referral`){let t=J?e.referralTitleReward:e.referralTitle;return{title:x(_??Z?.referralTitle??t,J),description:x(S??Z?.referralDescription??e.referralDescription,J),cta:C??Z?.referralCta??e.referralCta}}return{title:x(w??Z?.inappTitle??e.inappTitle,void 0),description:x(T??Z?.inappDescription??e.inappDescription,void 0),cta:E??Z?.inappCta??e.inappCta}},[I,G,J,Z,_,S,C,w,T,E]);if(!G||!j&&(!B||V||U))return null;let me=[oe,`frak-banner`,`frak-banner--${G}`,h].filter(Boolean).join(` `);return G===`inapp`?d(M,{title:$.title,description:$.description,cta:$.cta,dismissLabel:p[I].banner.dismissLabel,onAction:X,onDismiss:fe,className:[`frak-banner`,`frak-banner--inapp`,h].filter(Boolean).join(` `),classNames:{icon:`frak-banner__icon`,title:`frak-banner__title`,description:`frak-banner__description`,cta:`frak-banner__cta`,close:`frak-banner__close`}}):d(`div`,{class:me,role:`alert`,children:[d(`div`,{class:`${ue} frak-banner__icon`,children:Q?d(`img`,{src:Q,alt:``,class:N}):d(y,{class:ae})}),d(`div`,{class:`${se} frak-banner__text`,children:[d(`p`,{class:`${P} frak-banner__title`,children:$.title}),d(`p`,{class:`${le} frak-banner__description`,children:$.description}),d(`button`,{type:`button`,class:`${ce} frak-banner__cta`,onClick:X,children:$.cta})]}),d(v,{class:`${ie} frak-banner__logo`,width:42,height:24})]})}l(I,`frak-banner`,[`placement`,`classname`,`interaction`,`referralTitle`,`referralDescription`,`referralCta`,`inappTitle`,`inappDescription`,`inappCta`,`preview`,`previewMode`,`imageUrl`,`allowInappRedirect`],{shadow:!1});export{I as Banner};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,i as t}from"./loader.js";import{a as n,f as r,h as i,m as a,n as o,s,t as c,u as l}from"./defaults.kWEdCyGS.js";import{t as u}from"./useGlobalComponents.BC6Jgzg5.js";import{t as d}from"./useLightDomStyles.imPXuAtf.js";import{r as f}from"./rewards.CIu9qbmI.js";import{t as p}from"./useReward.BAmvPaVu.js";import{t as m}from"./embeddedWallet.BS-9u4Be.js";function h({placement:i,text:h,classname:g=``,noRewardText:_,targetInteraction:v,clickAction:y,preview:b}){let x=!!b,S=n(),C=o(i),w=u(),T=C?.components?.buttonShare??w?.buttonShare;d(`frak-button-share`,i,T?.css);let E=l(()=>C?.targetInteraction===void 0?v:C.targetInteraction,[C?.targetInteraction,v]),D=T?.text??h??c[S].buttonShare.text,O=T?.noRewardText??_,k=l(()=>D.includes(`{REWARD}`),[D]),A=l(()=>T?.clickAction??y??`sharing-page`,[T?.clickAction,y]),{shouldRender:j,isHidden:M,isClientReady:N}=s(),{reward:P}=p(k&&N,E),F=l(()=>k?P?f(D,P):O??f(D,void 0):D,[k,D,O,P]),I=r(()=>{if(!x){if(e(window.FrakSetup.client,`share_button_clicked`,{placement:i,target_interaction:E,has_reward:!!P,click_action:A}),A===`embedded-wallet`){m(E,i);return}t(E,i)}},[x,A,E,i,P]);if(!x&&(!j||M))return null;let L=[`button`,`button__fadeIn`,g].filter(Boolean).join(` `);return a(`button`,{type:`button`,disabled:!x&&!N,class:L,onClick:I,children:F})}i(h,`frak-button-share`,[`text`,`placement`,`classname`,`clickAction`,`noRewardText`,`targetInteraction`,`preview`],{shadow:!1});export{h as ButtonShare};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{a as e,d as t,g as n,h as r,m as i,n as a,p as o,r as s,s as c,t as l,u}from"./defaults.kWEdCyGS.js";import{t as d}from"./useReward.BAmvPaVu.js";import{t as f}from"./embeddedWallet.BS-9u4Be.js";function p(e){return i(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[i(`title`,{children:`Gift icon`}),i(`path`,{d:`m23.14 14v11.43h-18.29v-11.43m9.14 11.43v-17.14m0 0h-5.14c-0.76 0-1.48-0.3-2.02-0.84s-0.84-1.26-0.84-2.020.3-1.480.84-2.02 1.26-0.84 2.02-0.84c4 0 5.14 5.71 5.14 5.71zm0 0h5.14c0.76 0 1.48-0.3 2.02-0.84s0.84-1.260.84-2.02-0.3-1.48-0.84-2.02-1.26-0.84-2.02-0.84c-4 0-5.14 5.71-5.14 5.71zm-11.43 0h22.86v5.71h-22.86z`,stroke:`#fff`,"stroke-linecap":`round`,"stroke-linejoin":`round`})]})}function m(){`vibrate`in navigator&&navigator.vibrate(10)}function h(e,t){m(),f(e,t)}function g({placement:r,classname:f=``,useReward:m,targetInteraction:g}){let _=e(),v=a(r),y=u(()=>v?.targetInteraction===void 0?g:v.targetInteraction,[v?.targetInteraction,g]),b=u(()=>m===!0,[m]),{shouldRender:x,isHidden:S,isClientReady:C}=c(),{reward:w}=d(b&&C,y),[T,E]=t(`right`);if(o(()=>{let e=v?.components?.buttonWallet?.position,t=window.FrakSetup?.modalWalletConfig?.metadata?.position;E(e??t??`right`)},[v?.components?.buttonWallet?.position]),!x||S)return null;let D=[`button`,`button__fadeIn`,T===`left`?`button__left`:`button__right`,f].filter(Boolean).join(` `);return i(n,{children:[i(`style`,{children:s(`
|
|
2
|
-
.button {
|
|
3
|
-
all: unset;
|
|
4
|
-
position: fixed;
|
|
5
|
-
bottom: 20px;
|
|
6
|
-
z-index: 2000000;
|
|
7
|
-
display: flex;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
align-items: center;
|
|
10
|
-
background-color: #3e557e;
|
|
11
|
-
width: 45px;
|
|
12
|
-
height: 45px;
|
|
13
|
-
border-radius: 50%;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
text-align: center;
|
|
16
|
-
font-size: 24px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.button__left {
|
|
20
|
-
left: 20px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.button__right {
|
|
24
|
-
right: 20px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.reward {
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: -4px;
|
|
30
|
-
right: 27px;
|
|
31
|
-
padding: 2px 3px;
|
|
32
|
-
border-radius: 5px;
|
|
33
|
-
background: #ff3f3f;
|
|
34
|
-
font-size: 9px;
|
|
35
|
-
color: #fff;
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
white-space: nowrap;
|
|
38
|
-
line-height: 9px;
|
|
39
|
-
}
|
|
40
|
-
`,v?.components?.buttonWallet?.css)}),i(`button`,{type:`button`,"aria-label":l[_].buttonWallet.ariaLabel,part:`button`,disabled:!C,class:D,onClick:()=>{h(y,r)},children:[i(p,{}),w&&i(`span`,{class:`reward`,children:w})]})]})}r(g,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{g as ButtonWallet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,d as t,m as n,p as r}from"./loader.js";import{a as i,h as a,m as o,n as s,s as c,t as l,u}from"./defaults.kWEdCyGS.js";import{t as d}from"./useLightDomStyles.imPXuAtf.js";function f(t=`wallet`,i){let a=window.FrakSetup?.client;a&&e(a,`open_in_app_clicked`,{path:t,placement:i}),n(`${r}${t}`,{onFallback:()=>{a&&e(a,`app_not_installed`,{path:t,placement:i})}})}function p(){return{isMobile:u(()=>t(),[])}}function m({placement:e,text:t,classname:n=``}){let r=i(),a=s(e),{shouldRender:u,isHidden:m,isClientReady:h}=c(),{isMobile:g}=p();d(`frak-open-in-app`,e,a?.components?.openInApp?.css);let _=a?.components?.openInApp?.text??t??l[r].openInApp.text;if(!g||!u||m)return null;let v=()=>{f(void 0,e)},y=[`button`,`button__fadeIn`,n].filter(Boolean).join(` `);return o(`button`,{type:`button`,"aria-label":l[r].openInApp.ariaLabel,disabled:!h,class:y,onClick:v,children:_})}a(m,`frak-open-in-app`,[`text`,`placement`,`classname`],{shadow:!1});export{m as OpenInAppButton};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import{S as e,T as t,a as n,b as r,c as i,i as a,o,r as ee,x as s}from"./loader.js";import{a as c,d as l,f as te,h as u,l as ne,m as d,n as f,p,s as m,t as h,u as g}from"./defaults.kWEdCyGS.js";import{r as re,t as ie}from"./GiftIcon.DT1i36Fm.js";import{t as ae}from"./useGlobalComponents.BC6Jgzg5.js";import{t as oe}from"./useLightDomStyles.imPXuAtf.js";import{i as se,n as _,r as v}from"./rewards.CIu9qbmI.js";var y=`PostPurchase_card__5fv5lh0`,ce=`PostPurchase_cardLayout__5fv5lh1`,b=`PostPurchase_cardLeft__5fv5lh2`,x=`PostPurchase_cardRight__5fv5lh3`,S=`PostPurchase_cta__5fv5lh6 sharedBaseCss_buttonReset__7cswil0`,le=`PostPurchase_customImage__5fv5lha`,ue=`PostPurchase_frakLogo__5fv5lhb`,de=`PostPurchase_giftIcon__5fv5lh8`,fe=`PostPurchase_icon__5fv5lh7`,pe=`PostPurchase_imageWrapper__5fv5lh9`,me=`PostPurchase_message__5fv5lh5`;function he(e,t,n){let r=e?.isReferred?`referee`:`referrer`,i=_(t.rewards,{targetInteraction:`purchase`,currency:n,audience:r});if(!i)return null;let{campaign:a}=i,o=e?.isReferred&&a.referee?`referee`:`referrer`;return{variant:o,reward:o===`referee`?a.referee:a.referrer,merchantDomain:t.onChainMetadata.domain}}function C({customerId:u,orderId:_,token:C,sharingUrl:ge,merchantId:w,placement:T,classname:E=``,variant:D,badgeText:O,referrerText:k,refereeText:A,ctaText:j,preview:M,previewVariant:N,products:P,imageUrl:F}){let I=!!M,{shouldRender:L,isHidden:R,isClientReady:z}=m(),B=f(T),V=c();oe(`frak-post-purchase`,T,B?.components?.postPurchase?.css,`.PostPurchase_card__5fv5lh0 {
|
|
2
|
-
padding: 16px;
|
|
3
|
-
border-radius: 12px;
|
|
4
|
-
background-color: var(--surface-background__pbq4akc);
|
|
5
|
-
border: 1px solid var(--border-default__pbq4akv);
|
|
6
|
-
}
|
|
7
|
-
.PostPurchase_cardLayout__5fv5lh1 {
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
align-items: center;
|
|
11
|
-
gap: 32px;
|
|
12
|
-
}
|
|
13
|
-
.PostPurchase_cardLeft__5fv5lh2 {
|
|
14
|
-
flex-grow: 1;
|
|
15
|
-
min-width: 0;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: 8px;
|
|
19
|
-
}
|
|
20
|
-
.PostPurchase_cardRight__5fv5lh3 {
|
|
21
|
-
flex-shrink: 0;
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
align-items: flex-end;
|
|
25
|
-
gap: 8px;
|
|
26
|
-
text-align: right;
|
|
27
|
-
}
|
|
28
|
-
.PostPurchase_badge__5fv5lh4 {
|
|
29
|
-
align-self: flex-start;
|
|
30
|
-
background-color: #FFF534;
|
|
31
|
-
border-radius: 4px;
|
|
32
|
-
padding: 4px 8px;
|
|
33
|
-
font-size: 12px;
|
|
34
|
-
font-weight: 600;
|
|
35
|
-
line-height: 12px;
|
|
36
|
-
color: var(--text-primary__pbq4ak0);
|
|
37
|
-
}
|
|
38
|
-
.PostPurchase_message__5fv5lh5 {
|
|
39
|
-
margin: 0;
|
|
40
|
-
font-size: 16px;
|
|
41
|
-
line-height: 22px;
|
|
42
|
-
color: var(--text-primary__pbq4ak0);
|
|
43
|
-
font-weight: 600;
|
|
44
|
-
}
|
|
45
|
-
.PostPurchase_cta__5fv5lh6 {
|
|
46
|
-
display: inline-flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
gap: 4px;
|
|
50
|
-
padding: 12px 16px;
|
|
51
|
-
border-radius: 9999px;
|
|
52
|
-
background-color: var(--text-primary__pbq4ak0);
|
|
53
|
-
color: var(--text-onAction__pbq4ak6);
|
|
54
|
-
font-size: 12px;
|
|
55
|
-
font-weight: bold;
|
|
56
|
-
text-transform: uppercase;
|
|
57
|
-
}
|
|
58
|
-
.PostPurchase_cta__5fv5lh6:disabled {
|
|
59
|
-
opacity: 0.7;
|
|
60
|
-
cursor: default;
|
|
61
|
-
}
|
|
62
|
-
.PostPurchase_icon__5fv5lh7 {
|
|
63
|
-
margin: -2px 0;
|
|
64
|
-
}
|
|
65
|
-
.PostPurchase_giftIcon__5fv5lh8 {
|
|
66
|
-
display: block;
|
|
67
|
-
flex-shrink: 0;
|
|
68
|
-
}
|
|
69
|
-
.PostPurchase_imageWrapper__5fv5lh9 {
|
|
70
|
-
flex-shrink: 0;
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
width: 80px;
|
|
75
|
-
height: 80px;
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
}
|
|
78
|
-
.PostPurchase_customImage__5fv5lha {
|
|
79
|
-
max-width: 100%;
|
|
80
|
-
max-height: 100%;
|
|
81
|
-
width: auto;
|
|
82
|
-
height: auto;
|
|
83
|
-
object-fit: contain;
|
|
84
|
-
display: block;
|
|
85
|
-
}
|
|
86
|
-
.PostPurchase_frakLogo__5fv5lhb {
|
|
87
|
-
display: block;
|
|
88
|
-
margin-left: auto;
|
|
89
|
-
}`,t);let[H,_e]=l(null),[U,W]=l(!1);p(()=>{I||!z||!u||!_||!C||n({customerId:u,orderId:_,token:C,merchantId:w}).catch(()=>{})},[I,z,u,_,C,w]),p(()=>{if(I||!z||U)return;let t=window.FrakSetup?.client;t&&Promise.all([o(t),i(t)]).then(([e,n])=>{W(!0),_e(he(e,n,t.config.metadata?.currency))}).catch(t=>{if(t instanceof e&&t.code===s.configError){W(!0);return}})},[I,z,U]);let G=ne(null),K=D??H?.variant??(I?N??`referrer`:void 0),q=ge??H?.merchantDomain,J=g(()=>{if(!H?.reward)return;let e=window.FrakSetup?.client?.config?.metadata?.currency;return se(H.reward,e)},[H?.reward]),ve=ae(),Y=B?.components?.postPurchase??ve?.postPurchase,X=O??Y?.badgeText,Z=F??Y?.imageUrl,Q=g(()=>{let e=h[V].postPurchase;return{message:K===`referee`?J?v(A??Y?.refereeText??e.refereeText,J):A??Y?.refereeNoRewardText??e.refereeNoRewardText:J?v(k??Y?.referrerText??e.referrerText,J):k??Y?.referrerNoRewardText??e.referrerNoRewardText,cta:J?v(j??Y?.ctaText??e.ctaText,J):j??Y?.ctaNoRewardText??e.ctaNoRewardText}},[V,K,J,Y,k,A,j]);p(()=>{K&&G.current!==K&&z&&(!I&&(!L||R)||(r(window.FrakSetup?.client,`post_purchase_impression`,{placement:T,variant:K,has_reward:!!H?.reward}),G.current=K))},[K,L,R,z,I,T,H?.reward]);let $=g(()=>ee(P),[P]),ye=te(()=>{K&&(r(window.FrakSetup?.client,`post_purchase_clicked`,{placement:T,variant:K}),a(void 0,T,{link:q,products:$}))},[K,T,q,$]);return!K||!I&&(!L||R||!H)?null:d(`div`,{className:[y,E].filter(Boolean).join(` `),children:d(`div`,{class:ce,children:[d(`div`,{class:b,children:[X&&d(`span`,{class:`PostPurchase_badge__5fv5lh4`,children:X}),d(`p`,{class:me,children:Q.message}),d(`button`,{type:`button`,className:`${S} button`,disabled:!I&&!z,onClick:I?void 0:ye,children:[Q.cta,d(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:`${fe} button`,children:d(`path`,{d:`M13.9 11.14C13.99 11.05 14.15 11.11 14.15 11.24V11.64C14.15 13.05 12.63 14.19 10.75 14.19C8.87 14.19 7.34 13.05 7.34 11.64V11.24C7.34 11.11 7.51 11.05 7.59 11.14C8.35 11.93 9.48 12.43 10.75 12.43C12.01 12.43 13.15 11.93 13.9 11.14ZM1.85 9.65C1.85 9.51 2.01 9.44 2.1 9.54C2.85 10.32 3.99 10.82 5.25 10.82C5.52 10.82 5.79 10.8 6.04 10.76C6.26 10.72 6.47 10.88 6.47 11.1V12.17C6.47 12.32 6.37 12.45 6.22 12.48C5.92 12.55 5.59 12.59 5.25 12.59C3.37 12.59 1.85 11.45 1.85 10.04V9.65ZM10.75 6.21C12.63 6.21 14.15 7.35 14.15 8.75C14.15 10.16 12.63 11.3 10.75 11.3C8.87 11.3 7.34 10.16 7.34 8.75C7.34 7.35 8.87 6.21 10.75 6.21ZM1.85 6.85C1.85 6.71 2.01 6.65 2.1 6.74C2.85 7.53 3.99 8.03 5.25 8.03C5.52 8.03 5.79 8 6.04 7.96C6.26 7.92 6.47 8.09 6.47 8.3V9.37C6.47 9.52 6.37 9.65 6.22 9.69C5.92 9.75 5.59 9.79 5.25 9.79C3.37 9.79 1.85 8.65 1.85 7.24V6.85ZM5.25 1.81C7.13 1.81 8.66 2.95 8.66 4.36C8.66 5.76 7.13 6.9 5.25 6.9C3.37 6.9 1.85 5.76 1.85 4.36C1.85 2.95 3.37 1.81 5.25 1.81Z`,fill:`currentColor`})})]})]}),d(`div`,{class:x,children:[Z?d(`span`,{class:pe,children:d(`img`,{src:Z,alt:``,class:le})}):d(ie,{className:de,width:80,height:80}),d(re,{className:ue,width:42,height:24})]})]})})}u(C,`frak-post-purchase`,[`customerId`,`orderId`,`token`,`sharingUrl`,`merchantId`,`placement`,`classname`,`variant`,`badgeText`,`referrerText`,`refereeText`,`ctaText`,`products`,`preview`,`previewVariant`,`imageUrl`],{shadow:!1});export{C as PostPurchase};
|