@frak-labs/components 1.0.10 → 1.0.11-beta.ea740bc7

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.
Files changed (48) hide show
  1. package/cdn/Banner.coM5U8Uq.js +167 -0
  2. package/cdn/ButtonShare.C8i7dA4y.js +1 -0
  3. package/cdn/ButtonWallet.Cx3kvVYi.js +40 -0
  4. package/cdn/GiftIcon.QppqMfWS.js +1 -0
  5. package/cdn/OpenInAppButton.D1UzTuHx.js +1 -0
  6. package/cdn/PostPurchase.UrtKR-ZF.js +89 -0
  7. package/cdn/components.js +1 -1
  8. package/cdn/defaults.kWEdCyGS.js +58 -0
  9. package/cdn/embeddedWallet.CDUxjdX2.js +1 -0
  10. package/cdn/loader.js +1 -1
  11. package/cdn/replay-V6FXES7X.CNozpSRg.js +1 -0
  12. package/cdn/rewards.B6IAemE2.js +1 -0
  13. package/cdn/useGlobalComponents.BC6Jgzg5.js +1 -0
  14. package/cdn/useLightDomStyles.imPXuAtf.js +1 -0
  15. package/cdn/useReward.IXcdcQPk.js +1 -0
  16. package/dist/banner.d.ts +1 -1
  17. package/dist/banner.js +20 -15
  18. package/dist/buttonShare.d.ts +3 -1
  19. package/dist/buttonShare.js +11 -9
  20. package/dist/buttonWallet.js +5 -3
  21. package/dist/i18n/defaults.d.ts +54 -0
  22. package/dist/i18n/defaults.js +70 -0
  23. package/dist/openInApp.d.ts +4 -2
  24. package/dist/openInApp.js +7 -5
  25. package/dist/postPurchase.d.ts +1 -1
  26. package/dist/postPurchase.js +25 -14
  27. package/dist/rewards-B5VmlrcI.js +145 -0
  28. package/dist/useGlobalComponents-CZ7Sh2tZ.js +17 -0
  29. package/dist/{useLightDomStyles-DPKMhggr.js → useLightDomStyles-DphuQhvx.js} +1 -1
  30. package/dist/{usePlacement-DTN6H6vW.js → usePlacement-4PoDbn2X.js} +54 -12
  31. package/dist/useReward-DD2mMUN0.js +39 -0
  32. package/package.json +9 -3
  33. package/cdn/Banner.De5nN3cX.js +0 -167
  34. package/cdn/ButtonShare.DHSekTjv.js +0 -1
  35. package/cdn/ButtonWallet.Cvp_1Tx2.js +0 -40
  36. package/cdn/GiftIcon.DnSW4dJQ.js +0 -1
  37. package/cdn/OpenInAppButton.CpO_E-l-.js +0 -1
  38. package/cdn/PostPurchase.CuO1kjaz.js +0 -89
  39. package/cdn/embeddedWallet.BS-9u4Be.js +0 -1
  40. package/cdn/formatReward.DNFkBh_E.js +0 -1
  41. package/cdn/replay-V6FXES7X.BoL9fAjx.js +0 -1
  42. package/cdn/useGlobalComponents.pjgSwLk9.js +0 -1
  43. package/cdn/useLightDomStyles.2RQE6Iby.js +0 -1
  44. package/cdn/usePlacement.CRfzWKVY.js +0 -58
  45. package/cdn/useReward.DSMOMYCh.js +0 -1
  46. package/dist/formatReward-D3CkH7It.js +0 -39
  47. package/dist/useGlobalComponents-mSs9unyN.js +0 -21
  48. package/dist/useReward-DSrQsn3r.js +0 -65
@@ -1,7 +1,8 @@
1
- import { a as registerWebComponent, i as useClientReady, o as sanitizeProductList, s as openSharingPage, t as usePlacement } from "./usePlacement-DTN6H6vW.js";
2
- import { t as useGlobalComponents } from "./useGlobalComponents-mSs9unyN.js";
3
- import { t as useLightDomStyles } from "./useLightDomStyles-DPKMhggr.js";
4
- import { n as formatEstimatedReward, t as applyRewardPlaceholder } from "./formatReward-D3CkH7It.js";
1
+ import { c as sanitizeProductList, i as useLang, l as openSharingPage, o as useClientReady, s as registerWebComponent, t as usePlacement } from "./usePlacement-4PoDbn2X.js";
2
+ import { t as useGlobalComponents } from "./useGlobalComponents-CZ7Sh2tZ.js";
3
+ import { t as useLightDomStyles } from "./useLightDomStyles-DphuQhvx.js";
4
+ import { i as y, n as T, r as b } from "./rewards-B5VmlrcI.js";
5
+ import { componentDefaults } from "./i18n/defaults.js";
5
6
  import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-WEWSJ8kV.js";
6
7
  import { trackEvent } from "@frak-labs/core-sdk";
7
8
  import { getMerchantInformation, getUserReferralStatus, trackPurchaseStatus } from "@frak-labs/core-sdk/actions";
@@ -116,13 +117,19 @@ const cssSource = cssSource$1;
116
117
  * Given referral status and merchant info, compute the display variant
117
118
  * and pick the appropriate purchase reward.
118
119
  */
119
- function resolvePostPurchaseContext(referralStatus, merchantInfo) {
120
- const purchaseReward = merchantInfo.rewards.find((r) => r.interactionTypeKey === "purchase" && (r.referrer || r.referee));
121
- if (!purchaseReward) return null;
122
- const variant = referralStatus?.isReferred && purchaseReward.referee ? "referee" : "referrer";
120
+ function resolvePostPurchaseContext(referralStatus, merchantInfo, currency) {
121
+ const audience = referralStatus?.isReferred ? "referee" : "referrer";
122
+ const selected = T(merchantInfo.rewards, {
123
+ targetInteraction: "purchase",
124
+ currency,
125
+ audience
126
+ });
127
+ if (!selected) return null;
128
+ const { campaign } = selected;
129
+ const variant = referralStatus?.isReferred && campaign.referee ? "referee" : "referrer";
123
130
  return {
124
131
  variant,
125
- reward: variant === "referee" ? purchaseReward.referee : purchaseReward.referrer,
132
+ reward: variant === "referee" ? campaign.referee : campaign.referrer,
126
133
  merchantDomain: merchantInfo.onChainMetadata.domain
127
134
  };
128
135
  }
@@ -154,10 +161,11 @@ function resolvePostPurchaseContext(referralStatus, merchantInfo) {
154
161
  * ></frak-post-purchase>
155
162
  * ```
156
163
  */
157
- function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, placement: placementId, classname = "", variant: forcedVariant, badgeText: propBadgeText, referrerText: propReferrerText, refereeText: propRefereeText, ctaText: propCtaText, preview, previewVariant, products, imageUrl }) {
164
+ 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 }) {
158
165
  const isPreview = !!preview;
159
166
  const { shouldRender, isHidden, isClientReady } = useClientReady();
160
167
  const placement = usePlacement(placementId);
168
+ const lang = useLang();
161
169
  useLightDomStyles("frak-post-purchase", placementId, placement?.components?.postPurchase?.css, cssSource, cssSource$2);
162
170
  const [context, setContext] = useState(null);
163
171
  const [hasFetched, setHasFetched] = useState(false);
@@ -185,7 +193,7 @@ function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, plac
185
193
  if (!client) return;
186
194
  Promise.all([getUserReferralStatus(client), getMerchantInformation(client)]).then(([referralStatus, merchantInfo]) => {
187
195
  setHasFetched(true);
188
- setContext(resolvePostPurchaseContext(referralStatus, merchantInfo));
196
+ setContext(resolvePostPurchaseContext(referralStatus, merchantInfo, client.config.metadata?.currency));
189
197
  }).catch((e) => {
190
198
  if (e instanceof FrakRpcError && e.code === RpcErrorCodes.configError) {
191
199
  setHasFetched(true);
@@ -204,17 +212,20 @@ function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, plac
204
212
  const rewardText = useMemo(() => {
205
213
  if (!context?.reward) return void 0;
206
214
  const currency = window.FrakSetup?.client?.config?.metadata?.currency;
207
- return formatEstimatedReward(context.reward, currency);
215
+ return y(context.reward, currency);
208
216
  }, [context?.reward]);
209
217
  const globalComponents = useGlobalComponents();
210
218
  const postPurchaseConfig = placement?.components?.postPurchase ?? globalComponents?.postPurchase;
211
219
  const resolvedBadgeText = propBadgeText ?? postPurchaseConfig?.badgeText;
220
+ const imageUrl = propImageUrl ?? postPurchaseConfig?.imageUrl;
212
221
  const texts = useMemo(() => {
222
+ const defaults = componentDefaults[lang].postPurchase;
213
223
  return {
214
- message: resolvedVariant === "referee" ? rewardText ? applyRewardPlaceholder(propRefereeText ?? postPurchaseConfig?.refereeText ?? "You just earned {REWARD}! Share with friends to earn even more.", rewardText) : propRefereeText ?? postPurchaseConfig?.refereeNoRewardText ?? "You just earned a reward! Share with friends to earn even more." : rewardText ? applyRewardPlaceholder(propReferrerText ?? postPurchaseConfig?.referrerText ?? "Earn {REWARD} by sharing this with your friends!", rewardText) : propReferrerText ?? postPurchaseConfig?.referrerNoRewardText ?? "Share this with your friends and earn rewards!",
215
- cta: rewardText ? applyRewardPlaceholder(propCtaText ?? postPurchaseConfig?.ctaText ?? "Share & earn {REWARD}", rewardText) : propCtaText ?? postPurchaseConfig?.ctaNoRewardText ?? "Share & earn"
224
+ message: resolvedVariant === "referee" ? rewardText ? b(propRefereeText ?? postPurchaseConfig?.refereeText ?? defaults.refereeText, rewardText) : propRefereeText ?? postPurchaseConfig?.refereeNoRewardText ?? defaults.refereeNoRewardText : rewardText ? b(propReferrerText ?? postPurchaseConfig?.referrerText ?? defaults.referrerText, rewardText) : propReferrerText ?? postPurchaseConfig?.referrerNoRewardText ?? defaults.referrerNoRewardText,
225
+ cta: rewardText ? b(propCtaText ?? postPurchaseConfig?.ctaText ?? defaults.ctaText, rewardText) : propCtaText ?? postPurchaseConfig?.ctaNoRewardText ?? defaults.ctaNoRewardText
216
226
  };
217
227
  }, [
228
+ lang,
218
229
  resolvedVariant,
219
230
  rewardText,
220
231
  postPurchaseConfig,
@@ -0,0 +1,145 @@
1
+ //#region ../core/dist/getCurrencyAmountKey-DQcwjJiB.js
2
+ const e = {
3
+ eur: `fr-FR`,
4
+ usd: `en-US`,
5
+ gbp: `en-GB`
6
+ };
7
+ function t(t) {
8
+ return t && t in e ? t : `eur`;
9
+ }
10
+ function n(t) {
11
+ return t ? e[t] ?? e.eur : e.eur;
12
+ }
13
+ function r$1(e, r) {
14
+ let i = n(r), a = t(r);
15
+ return e.toLocaleString(i, {
16
+ style: `currency`,
17
+ currency: a,
18
+ minimumFractionDigits: 0,
19
+ maximumFractionDigits: 2
20
+ });
21
+ }
22
+ function i$1(e) {
23
+ return e ? `${e}Amount` : `eurAmount`;
24
+ }
25
+ //#endregion
26
+ //#region ../core/dist/rewards.js
27
+ function r(e) {
28
+ return Array.isArray(e) ? e : e.conditions;
29
+ }
30
+ function i(e) {
31
+ if (typeof e == `number`) return e;
32
+ if (typeof e == `string` && e.trim() !== ``) {
33
+ let t = Number(e);
34
+ return Number.isFinite(t) ? t : void 0;
35
+ }
36
+ }
37
+ function a(e, t, n) {
38
+ let o = [];
39
+ for (let s of r(e)) {
40
+ if (`logic` in s) {
41
+ o.push(...a(s, t, n));
42
+ continue;
43
+ }
44
+ if (s.field === t && n.has(s.operator)) {
45
+ let e = i(s.value);
46
+ e != null && o.push(e);
47
+ }
48
+ }
49
+ return o;
50
+ }
51
+ const o = new Set([
52
+ `gt`,
53
+ `gte`,
54
+ `between`
55
+ ]), s = new Set([`gt`, `gte`]);
56
+ function c(e) {
57
+ let t = a(e, `purchase.amount`, o);
58
+ return t.length > 0 ? Math.min(...t) : void 0;
59
+ }
60
+ function l(e) {
61
+ let t = a(e, `time.timestamp`, s);
62
+ if (t.length !== 0) return /* @__PURE__ */ new Date(Math.min(...t) * 1e3);
63
+ }
64
+ function h(e, t) {
65
+ switch (e.payoutType) {
66
+ case `fixed`: return e.amount[t];
67
+ case `percentage`: return e.maxAmount?.[t] ?? 0;
68
+ case `tiered`: return e.tiers.reduce((e, n) => `amount` in n ? Math.max(e, n.amount[t]) : e, 0);
69
+ }
70
+ }
71
+ function g(e) {
72
+ return e.payoutType === `percentage` ? e.percent : e.payoutType === `tiered` ? e.tiers.reduce((e, t) => `percent` in t ? Math.max(e, t.percent) : e, 0) : 0;
73
+ }
74
+ function _(e, t) {
75
+ let n = h(e, t);
76
+ return n > 0 ? n : g(e) * 1e-6;
77
+ }
78
+ function v(r, i) {
79
+ let a = t(i), o = i$1(a);
80
+ switch (r.payoutType) {
81
+ case `fixed`: return r$1(Math.round(r.amount[o]), a);
82
+ case `percentage`: return `${r.percent} %`;
83
+ case `tiered`: {
84
+ let t = h(r, o);
85
+ if (t > 0) return r$1(Math.round(t), a);
86
+ let n = g(r);
87
+ return n > 0 ? `${n} %` : r$1(0, a);
88
+ }
89
+ }
90
+ }
91
+ function y(e, r) {
92
+ if (e && !(_(e, i$1(t(r))) <= 0)) return v(e, r);
93
+ }
94
+ function b(e, t) {
95
+ return t ? e.replaceAll(`{REWARD}`, t) : e.replaceAll(`{REWARD}`, ``);
96
+ }
97
+ function x(e, t) {
98
+ return e.expiresAt != null && new Date(e.expiresAt).getTime() <= t;
99
+ }
100
+ function S(e, t) {
101
+ let n = l(e.conditions);
102
+ return n == null || n.getTime() <= t;
103
+ }
104
+ function C(e, t) {
105
+ return t === `referee` ? e.referee : e.referrer;
106
+ }
107
+ function w(e, t, n) {
108
+ let r = C(e, n);
109
+ return r ? _(r, t) : 0;
110
+ }
111
+ function T(e, r = {}) {
112
+ let i = (r.now ?? /* @__PURE__ */ new Date()).getTime(), a = r.audience ?? `referrer`, o = i$1(t(r.currency)), s = (r.targetInteraction ? e.filter((e) => e.interactionTypeKey === r.targetInteraction) : e).filter((e) => !x(e, i)), c = s.filter((e) => S(e, i));
113
+ if (c.length > 0) return {
114
+ campaign: c.reduce((e, t) => w(t, o, a) > w(e, o, a) ? t : e),
115
+ status: `live`
116
+ };
117
+ let u = s.map((e) => ({
118
+ campaign: e,
119
+ startsAt: l(e.conditions)
120
+ })).filter((e) => e.startsAt != null);
121
+ if (u.length === 0) return;
122
+ let d = u.reduce((e, t) => t.startsAt.getTime() < e.startsAt.getTime() ? t : e);
123
+ return {
124
+ campaign: d.campaign,
125
+ status: `upcoming`,
126
+ startsAt: d.startsAt
127
+ };
128
+ }
129
+ function E(t, n = {}) {
130
+ let r = T(t, n);
131
+ if (!r) return;
132
+ let i = C(r.campaign, n.audience ?? `referrer`);
133
+ if (!i) return;
134
+ let a = y(i, n.currency);
135
+ if (!a) return;
136
+ let o = c(r.campaign.conditions), s = o == null ? void 0 : r$1(o, n.currency), l = r.campaign.defaultLockupSeconds, u = l && l > 0 ? Math.round(l / 86400) : void 0;
137
+ return {
138
+ formatted: a,
139
+ payoutType: i.payoutType,
140
+ minPurchaseAmount: s,
141
+ lockupDurationDays: u
142
+ };
143
+ }
144
+ //#endregion
145
+ export { y as i, T as n, b as r, E as t };
@@ -0,0 +1,17 @@
1
+ import { a as subscribeSdkConfig } from "./usePlacement-4PoDbn2X.js";
2
+ import { sdkConfigStore } from "@frak-labs/core-sdk";
3
+ import { useSyncExternalStore } from "preact/compat";
4
+ //#region src/hooks/useGlobalComponents.ts
5
+ /**
6
+ * Subscribe to the global component defaults from the SDK config store.
7
+ * These serve as fallbacks when no placement-level override exists.
8
+ *
9
+ * Backed by `useSyncExternalStore`: the snapshot is the stored `components`
10
+ * object reference (stable between `frak:config` dispatches), so the component
11
+ * only re-renders when the global components actually change.
12
+ */
13
+ function useGlobalComponents() {
14
+ return useSyncExternalStore(subscribeSdkConfig, () => sdkConfigStore.getConfig().components);
15
+ }
16
+ //#endregion
17
+ export { useGlobalComponents as t };
@@ -1,4 +1,4 @@
1
- import { r as lightDomBaseCss } from "./usePlacement-DTN6H6vW.js";
1
+ import { r as lightDomBaseCss } from "./usePlacement-4PoDbn2X.js";
2
2
  import { useEffect } from "preact/hooks";
3
3
  //#region src/styles/styleManager.ts
4
4
  function ensureStyle(id, css) {
@@ -3,7 +3,8 @@ import * as coreSdkIndex from "@frak-labs/core-sdk";
3
3
  import { decompressJsonFromB64, deleteQueryParamCaseInsensitive, 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
- import { useEffect, useMemo, useState } from "preact/hooks";
6
+ import { useCallback, useEffect, useState } from "preact/hooks";
7
+ import { useSyncExternalStore } from "preact/compat";
7
8
  //#region src/actions/sharingPage.ts
8
9
  async function openSharingPage(targetInteraction, placement, options) {
9
10
  if (!window.FrakSetup?.client) {
@@ -341,6 +342,49 @@ function useClientReady() {
341
342
  };
342
343
  }
343
344
  //#endregion
345
+ //#region src/hooks/sdkConfigSubscription.ts
346
+ /**
347
+ * Shared `useSyncExternalStore` plumbing for the SDK config store.
348
+ *
349
+ * The resolved merchant config lives on `window.__frakSdkConfig` and notifies
350
+ * via the `frak:config` CustomEvent (see `@frak-labs/core-sdk` `sdkConfigStore`).
351
+ * A single module-level `subscribe` keeps the reference stable across renders
352
+ * so `useSyncExternalStore` never re-subscribes, and lets every config-driven
353
+ * hook (`useLang`, `usePlacement`, `useGlobalComponents`) share one listener
354
+ * shape instead of each hand-rolling an effect + version counter.
355
+ */
356
+ /**
357
+ * Subscribe to resolved-config changes. Stable reference (module-level) so
358
+ * `useSyncExternalStore` treats it as a constant store subscription.
359
+ */
360
+ function subscribeSdkConfig(onStoreChange) {
361
+ if (typeof window === "undefined") return () => {};
362
+ window.addEventListener("frak:config", onStoreChange);
363
+ return () => window.removeEventListener("frak:config", onStoreChange);
364
+ }
365
+ //#endregion
366
+ //#region src/hooks/useLang.ts
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
+ * Resolve the active display language for the Web Components.
377
+ *
378
+ * Precedence: resolved SDK/backend config `lang` (driven by `metadata.lang`
379
+ * or the backend `/resolve` response) → browser language → `en`. Backed by
380
+ * `useSyncExternalStore` with a bare-string snapshot, so a `frak:config`
381
+ * dispatch only re-renders the component when the resolved language actually
382
+ * changes (see `@/i18n/defaults`).
383
+ */
384
+ function useLang() {
385
+ return useSyncExternalStore(subscribeSdkConfig, () => sdkConfigStore.getConfig().lang ?? detectBrowserLang());
386
+ }
387
+ //#endregion
344
388
  //#region src/styles/sharedCss.ts
345
389
  const sharedCss = `
346
390
  :host {
@@ -409,17 +453,15 @@ const lightDomBaseCss = `
409
453
  function getPlacement(id) {
410
454
  return sdkConfigStore.getConfig().placements?.[id];
411
455
  }
456
+ /**
457
+ * Subscribe to a single resolved placement from the SDK config store.
458
+ *
459
+ * Backed by `useSyncExternalStore`: the snapshot is the stored placement
460
+ * object reference (stable between `frak:config` dispatches), so the component
461
+ * only re-renders when that placement actually changes.
462
+ */
412
463
  function usePlacement(placementId) {
413
- const [configVersion, setConfigVersion] = useState(0);
414
- useEffect(() => {
415
- const onConfig = (_e) => {
416
- setConfigVersion((v) => v + 1);
417
- };
418
- window.addEventListener("frak:config", onConfig);
419
- setConfigVersion((v) => v + 1);
420
- return () => window.removeEventListener("frak:config", onConfig);
421
- }, []);
422
- return useMemo(() => placementId ? getPlacement(placementId) : void 0, [placementId, configVersion]);
464
+ return useSyncExternalStore(subscribeSdkConfig, useCallback(() => placementId ? getPlacement(placementId) : void 0, [placementId]));
423
465
  }
424
466
  //#endregion
425
- export { registerWebComponent as a, useClientReady as i, buildStyleContent as n, sanitizeProductList as o, lightDomBaseCss as r, openSharingPage as s, usePlacement as t };
467
+ export { subscribeSdkConfig as a, sanitizeProductList as c, useLang as i, openSharingPage as l, buildStyleContent as n, useClientReady as o, lightDomBaseCss as r, registerWebComponent as s, usePlacement as t };
@@ -0,0 +1,39 @@
1
+ import { t as E } from "./rewards-B5VmlrcI.js";
2
+ import { getMerchantInformation } from "@frak-labs/core-sdk/actions";
3
+ import { useEffect, useState } from "preact/hooks";
4
+ //#region src/hooks/useReward.ts
5
+ /**
6
+ * Hook to fetch and format the best reward for a given interaction type.
7
+ *
8
+ * Calls `getMerchantInformation`, picks the highest-value reward across all
9
+ * matching live campaigns for the requested `audience` side, and returns it as
10
+ * a formatted string.
11
+ *
12
+ * @param shouldUseReward - Whether to fetch the reward at all
13
+ * @param targetInteraction - Optional filter by interaction type (e.g. "purchase")
14
+ * @param audience - Reward side to display: `"referrer"` (default) or `"referee"`
15
+ * @returns Object containing the formatted reward string, or undefined if unavailable
16
+ */
17
+ function useReward(shouldUseReward, targetInteraction, audience) {
18
+ const [reward, setReward] = useState(void 0);
19
+ useEffect(() => {
20
+ if (!shouldUseReward) return;
21
+ const client = window.FrakSetup?.client;
22
+ if (!client) return;
23
+ getMerchantInformation(client).then((merchantInfo) => {
24
+ const best = E(merchantInfo.rewards, {
25
+ currency: client.config.metadata?.currency,
26
+ targetInteraction,
27
+ audience
28
+ });
29
+ if (best && best.payoutType !== "percentage") setReward(best.formatted);
30
+ }).catch(() => {});
31
+ }, [
32
+ shouldUseReward,
33
+ targetInteraction,
34
+ audience
35
+ ]);
36
+ return { reward };
37
+ }
38
+ //#endregion
39
+ export { useReward as t };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "1.0.10",
14
+ "version": "1.0.11-beta.ea740bc7",
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",
@@ -66,6 +66,12 @@
66
66
  "import": "./dist/banner.js",
67
67
  "types": "./dist/banner.d.ts"
68
68
  },
69
+ "./i18n/defaults": {
70
+ "development": "./src/i18n/defaults.ts",
71
+ "production": "./src/i18n/defaults.ts",
72
+ "import": "./dist/i18n/defaults.js",
73
+ "types": "./dist/i18n/defaults.d.ts"
74
+ },
69
75
  "./cdn": {
70
76
  "import": "./cdn/components.js"
71
77
  },
@@ -86,8 +92,8 @@
86
92
  "publish": "echo 'Publishing components...'"
87
93
  },
88
94
  "dependencies": {
89
- "@frak-labs/core-sdk": "1.1.5",
90
- "@frak-labs/frame-connector": "0.2.0",
95
+ "@frak-labs/core-sdk": "1.1.6-beta.ea740bc7",
96
+ "@frak-labs/frame-connector": "0.2.0-beta.ea740bc7",
91
97
  "preact": "^10.29.0",
92
98
  "preact-custom-element": "^4.6.0",
93
99
  "@frak-labs/design-system": "0.0.0"
@@ -1,167 +0,0 @@
1
- import{T as e,_ as t,b as n,d as r,s as i,u as a}from"./loader.js";import{a as o,c as s,d as c,i as ee,l,o as u,s as d,t as f,u as p}from"./usePlacement.CRfzWKVY.js";import{a as m,i as h,n as g,r as _,t as te}from"./GiftIcon.DnSW4dJQ.js";import{t as v}from"./useGlobalComponents.pjgSwLk9.js";import{t as y}from"./useLightDomStyles.2RQE6Iby.js";import{t as b}from"./formatReward.DNFkBh_E.js";import{t as x}from"./useReward.DSMOMYCh.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 ne({title:e,description:t,cta:n,dismissLabel:r,onAction:i,onDismiss:a,className:o,classNames:s}){return p(`div`,{className:`${E}${o?` ${o}`:``}`,role:`alert`,children:[p(`div`,{className:k,children:[p(`span`,{className:`${A}${s?.icon?` ${s.icon}`:``}`,children:p(g,{width:20,height:20})}),p(`p`,{className:`${j}${s?.title?` ${s.title}`:``}`,children:e})]}),p(`div`,{className:w,children:[p(`p`,{className:`${O}${s?.description?` ${s.description}`:``}`,children:t}),p(`button`,{type:`button`,className:`${D}${s?.cta?` ${s.cta}`:``}`,onClick:i,children:[n,p(h,{width:14,height:14})]})]}),p(`button`,{type:`button`,className:`${T}${s?.close?` ${s.close}`:``}`,onClick:a,"aria-label":r,children:p(m,{width:16,height:16})})]})}var re=`Banner_frakLogo__1gnumzi9`,ie=`Banner_iconSvg__1gnumzi1`,ae=`Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0`,oe=`Banner_referralBody__1gnumzi5`,se=`Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0`,M=`Banner_referralDescription__1gnumzi7 reset_base__1831jhd0`,N=`Banner_referralIconWrapper__1gnumzi3`,P=`Banner_referralImage__1gnumzi4`,F=`Banner_referralTitle__1gnumzi6 reset_base__1831jhd0`;const I=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 L({placement:c,classname:m=``,interaction:h,referralTitle:g,referralDescription:S,referralCta:C,inappTitle:w,inappDescription:T,inappCta:E,imageUrl:D,preview:O,previewMode:k,allowInappRedirect:A}){let j=!!O,L=k===`inapp`?`inapp`:`referral`,R=A===!0||A===`true`,z=f(c),{shouldRender:B,isHidden:V,isClientReady:H}=ee();y(`frak-banner`,c,z?.components?.banner?.css,I,e);let[U,W]=d(!1),[G,K]=d(()=>j?L:R&&r?`inapp`:null),q=o(null);l(()=>{j&&K(L)},[j,L]);let{reward:J}=x(G===`referral`&&H,h),[Y,X]=d(null);l(()=>{let e=window.FrakSetup?.client;G!==`inapp`||j||!H||!e||i(e).then(e=>X(e)).catch(()=>{})},[G,j,H]),l(()=>{j||!G||U||q.current!==G&&H&&(n(window.FrakSetup?.client,`banner_impression`,{placement:c,variant:G,has_reward:G===`referral`?!!J:void 0}),q.current=G)},[G,U,H,j,c]),l(()=>{if(j||G===`inapp`)return;let e=()=>K(`referral`);return window.addEventListener(a,e),()=>window.removeEventListener(a,e)},[j,G]);let Z=s(async()=>{if(j)return;if(n(window.FrakSetup?.client,`banner_resolved`,{placement:c,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()}t(r)},[j,G,Y,c]),ce=s(()=>{j||(n(window.FrakSetup?.client,`banner_resolved`,{placement:c,variant:G??`referral`,outcome:`dismissed`}),W(!0))},[j,G,c]),le=v(),Q=z?.components?.banner??le?.banner,$=u(()=>{if(G===`referral`){let e=J?`Earn ${J} on purchases on this site`:`You've been referred!`;return{title:b(g??Q?.referralTitle??e,J),description:b(S??Q?.referralDescription??`Earn rewards after your purchase via the Frak partner app.`,J),cta:C??Q?.referralCta??`Got it`}}return{title:b(w??Q?.inappTitle??`Open in your browser`,J),description:b(T??Q?.inappDescription??`For a better experience and to earn your rewards, open this page in your default browser.`,J),cta:E??Q?.inappCta??`Open browser`}},[G,J,Q,g,S,C,w,T,E]);if(!G||!j&&(!B||V||U))return null;let ue=[ae,`frak-banner`,`frak-banner--${G}`,m].filter(Boolean).join(` `);return G===`inapp`?p(ne,{title:$.title,description:$.description,cta:$.cta,dismissLabel:`Dismiss`,onAction:Z,onDismiss:ce,className:[`frak-banner`,`frak-banner--inapp`,m].filter(Boolean).join(` `),classNames:{icon:`frak-banner__icon`,title:`frak-banner__title`,description:`frak-banner__description`,cta:`frak-banner__cta`,close:`frak-banner__close`}}):p(`div`,{class:ue,role:`alert`,children:[p(`div`,{class:`${N} frak-banner__icon`,children:D?p(`img`,{src:D,alt:``,class:P}):p(te,{class:ie})}),p(`div`,{class:`${oe} frak-banner__text`,children:[p(`p`,{class:`${F} frak-banner__title`,children:$.title}),p(`p`,{class:`${M} frak-banner__description`,children:$.description}),p(`button`,{type:`button`,class:`${se} frak-banner__cta`,onClick:Z,children:$.cta})]}),p(_,{class:`${re} frak-banner__logo`,width:42,height:24})]})}c(L,`frak-banner`,[`placement`,`classname`,`interaction`,`referralTitle`,`referralDescription`,`referralCta`,`inappTitle`,`inappDescription`,`inappCta`,`preview`,`previewMode`,`imageUrl`,`allowInappRedirect`],{shadow:!1});export{L as Banner};
@@ -1 +0,0 @@
1
- import{b as e,i as t}from"./loader.js";import{c as n,d as r,i,o as a,t as o,u as s}from"./usePlacement.CRfzWKVY.js";import{t as c}from"./useGlobalComponents.pjgSwLk9.js";import{t as l}from"./useLightDomStyles.2RQE6Iby.js";import{t as u}from"./formatReward.DNFkBh_E.js";import{t as d}from"./useReward.DSMOMYCh.js";import{t as f}from"./embeddedWallet.BS-9u4Be.js";function p({placement:r,text:p=`Share and earn!`,classname:m=``,noRewardText:h,targetInteraction:g,clickAction:_,preview:v}){let y=!!v,b=o(r),x=c(),S=b?.components?.buttonShare??x?.buttonShare;l(`frak-button-share`,r,S?.css);let C=a(()=>b?.targetInteraction===void 0?g:b.targetInteraction,[b?.targetInteraction,g]),w=S?.text??p,T=S?.noRewardText??h,E=a(()=>w.includes(`{REWARD}`),[w]),D=a(()=>S?.clickAction??_??`sharing-page`,[S?.clickAction,_]),{shouldRender:O,isHidden:k,isClientReady:A}=i(),{reward:j}=d(E&&A,C),M=a(()=>E?j?u(w,j):T??u(w,void 0):w,[E,w,T,j]),N=n(()=>{if(!y){if(e(window.FrakSetup.client,`share_button_clicked`,{placement:r,target_interaction:C,has_reward:!!j,click_action:D}),D===`embedded-wallet`){f(C,r);return}t(C,r)}},[y,D,C,r,j]);if(!y&&(!O||k))return null;let P=[`button`,`button__fadeIn`,m].filter(Boolean).join(` `);return s(`button`,{type:`button`,disabled:!y&&!A,class:P,onClick:N,children:M})}r(p,`frak-button-share`,[`text`,`placement`,`classname`,`clickAction`,`noRewardText`,`targetInteraction`,`preview`],{shadow:!1});export{p as ButtonShare};
@@ -1,40 +0,0 @@
1
- import{d as e,i as t,l as n,m as r,n as i,o as a,s as o,t as s,u as c}from"./usePlacement.CRfzWKVY.js";import{t as l}from"./useReward.DSMOMYCh.js";import{t as u}from"./embeddedWallet.BS-9u4Be.js";function d(e){return c(`svg`,{fill:`none`,height:`1em`,viewBox:`0 0 28 28`,width:`1em`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[c(`title`,{children:`Gift icon`}),c(`path`,{d:`m23.1427 13.9999v11.4285h-18.2857v-11.4285m9.1429 11.4285v-17.14282m0 0h-5.1429c-.75776 0-1.48448-.30102-2.0203-.83684s-.83684-1.26255-.83684-2.02031.30102-1.48448.83684-2.0203 1.26254-.83684 2.0203-.83684c4 0 5.1429 5.71429 5.1429 5.71429zm0 0h5.1428c.7578 0 1.4845-.30102 2.0203-.83684s.8369-1.26255.8369-2.02031-.3011-1.48448-.8369-2.0203-1.2625-.83684-2.0203-.83684c-4 0-5.1428 5.71429-5.1428 5.71429zm-11.42861 0h22.85711v5.71432h-22.85711z`,stroke:`#fff`,"stroke-linecap":`round`,"stroke-linejoin":`round`})]})}function f(){`vibrate`in navigator&&navigator.vibrate(10)}function p(e,t){f(),u(e,t)}function m({placement:e,classname:u=``,useReward:f,targetInteraction:m}){let h=s(e),g=a(()=>h?.targetInteraction===void 0?m:h.targetInteraction,[h?.targetInteraction,m]),_=a(()=>f===!0,[f]),{shouldRender:v,isHidden:y,isClientReady:b}=t(),{reward:x}=l(_&&b,g),[S,C]=o(`right`);if(n(()=>{let e=h?.components?.buttonWallet?.position,t=window.FrakSetup?.modalWalletConfig?.metadata?.position;C(e??t??`right`)},[h?.components?.buttonWallet?.position]),!v||y)return null;let w=[`button`,`button__fadeIn`,S===`left`?`button__left`:`button__right`,u].filter(Boolean).join(` `);return c(r,{children:[c(`style`,{children:i(`
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
- `,h?.components?.buttonWallet?.css)}),c(`button`,{type:`button`,"aria-label":`Open wallet`,part:`button`,disabled:!b,class:w,onClick:()=>{p(g,e)},children:[c(d,{}),x&&c(`span`,{class:`reward`,children:x})]})]})}e(m,`frak-button-wallet`,[`placement`,`classname`,`useReward`,`targetInteraction`],{shadow:!0});export{m as ButtonWallet};
@@ -1 +0,0 @@
1
- import{f as e,g as t,h as n,m as r,p as i,u as a}from"./usePlacement.CRfzWKVY.js";function o(e,t){for(var n in t)e[n]=t[n];return e}function s(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function c(e,t){this.props=e,this.context=t}(c.prototype=new e).isPureReactComponent=!0,c.prototype.shouldComponentUpdate=function(e,t){return s(this.props,e)||s(this.state,t)};var l=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),l&&l(e)},typeof Symbol<`u`&&Symbol.for;var u=t.__e;t.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}u(e,t,n,r)};var d=t.unmount;function f(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=o({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return f(e,t,n)})),e}function p(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return p(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function m(){this.__u=0,this.o=null,this.__b=null}function h(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function g(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),d&&d(e)},(m.prototype=new e).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=h(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=p(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},m.prototype.componentWillUnmount=function(){this.o=[]},m.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var i=document.createElement(`div`),a=this.__v.__k[0].__c;this.__v.__k[0]=f(this.__b,i,a.__O=a.__P)}this.__b=null}var o=t.__a&&n(r,null,e.fallback);return o&&(o.__u&=-33),[n(r,null,t.__a?null:e.children),o]};var _=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(g.prototype=new e).__a=function(e){var t=this,n=h(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),_(t,e,r)):i()};n?n(a):a()}},g.prototype.render=function(e){this.i=null,this.l=new Map;var t=i(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},g.prototype.componentDidUpdate=g.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){_(e,n,t)})};var v=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,y=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,b=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,x=/[A-Z0-9]/g,S=typeof document<`u`,C=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};e.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(t){Object.defineProperty(e.prototype,t,{configurable:!0,get:function(){return this[`UNSAFE_`+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var w=t.event;t.event=function(e){return w&&(e=w(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var T={configurable:!0,get:function(){return this.class}},E=t.vnode;t.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},a=n.indexOf(`-`)==-1;for(var o in t){var s=t[o];if(!(o===`value`&&`defaultValue`in t&&s==null||S&&o===`children`&&n===`noscript`||o===`class`||o===`className`)){var c=o.toLowerCase();o===`defaultValue`&&`value`in t&&t.value==null?o=`value`:o===`download`&&!0===s?s=``:c===`translate`&&s===`no`?s=!1:c[0]===`o`&&c[1]===`n`?c===`ondoubleclick`?o=`ondblclick`:c!==`onchange`||n!==`input`&&n!==`textarea`||C(t.type)?c===`onfocus`?o=`onfocusin`:c===`onblur`?o=`onfocusout`:b.test(o)&&(o=c):c=o=`oninput`:a&&y.test(o)?o=o.replace(x,`-$&`).toLowerCase():s===null&&(s=void 0),c===`oninput`&&r[o=c]&&(o=`oninputCapture`),r[o]=s}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=i(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=i(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,`className`,T)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=v,E&&E(e)};var D=t.__r;t.__r=function(e){D&&D(e),e.__c};var O=t.diffed;t.diffed=function(e){O&&O(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};function k(e){return a(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,"aria-hidden":`true`,...e,children:a(`path`,{d:`M7.33301 0C11.383 0 14.6668 3.28307 14.667 7.33301C14.667 11.3831 11.3831 14.667 7.33301 14.667C3.28307 14.6668 0 11.383 0 7.33301C0.000175746 3.28318 3.28318 0.000175742 7.33301 0ZM10.3896 4.27734C10.151 4.0388 9.76303 4.03775 9.52441 4.27637L7.33301 6.46777L5.14258 4.27637C4.90397 4.03776 4.51601 4.03882 4.27734 4.27734C4.03869 4.516 4.03771 4.90392 4.27637 5.14258L6.4668 7.33398L4.27637 9.52441C4.03807 9.76306 4.03891 10.1511 4.27734 10.3896C4.51589 10.6282 4.9039 10.629 5.14258 10.3906L7.33301 8.2002L9.52344 10.3906C9.76198 10.629 10.15 10.6279 10.3887 10.3896C10.6273 10.151 10.6283 9.76209 10.3896 9.52344L8.2002 7.33398L10.3906 5.14258C10.6293 4.90392 10.6283 4.516 10.3896 4.27734Z`,fill:`currentColor`})})}function A(e){return a(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,...e,children:a(`path`,{d:`M5.45508 0C5.75614 0.000209333 6 0.244788 6 0.545898C5.99979 0.846831 5.75601 1.09159 5.45508 1.0918H4.36426C3.05445 1.0918 2.27964 1.35707 1.81836 1.81836C1.35714 2.27966 1.0918 3.05454 1.0918 4.36426V7.63672C1.09186 8.94625 1.35713 9.72139 1.81836 10.1826C2.2797 10.6436 3.05488 10.9092 4.36426 10.9092H7.63672C8.94628 10.9091 9.72135 10.6438 10.1826 10.1826C10.6438 9.72139 10.9091 8.94625 10.9092 7.63672V6.5459C10.9092 6.24466 11.1538 6 11.4551 6C11.7561 6.00028 12 6.24483 12 6.5459V7.63672C11.9999 9.05391 11.72 10.1882 10.9541 10.9541C10.1882 11.7199 9.05394 12 7.63672 12H4.36426C2.94714 12 1.81283 11.7197 1.04688 10.9541C0.280997 10.1882 6.04321e-05 9.05391 0 7.63672V4.36426C0 2.94692 0.28099 1.81283 1.04688 1.04688C1.81284 0.280915 2.94686 0 4.36426 0H5.45508ZM11.4541 0C11.7553 2.20143e-05 11.999 0.244672 11.999 0.545898V3.16406C11.9988 3.46509 11.7552 3.70896 11.4541 3.70898C11.1532 3.70873 10.9084 3.46495 10.9082 3.16406V1.8623L6.93066 5.83984C6.71766 6.05283 6.37218 6.05283 6.15918 5.83984C5.94657 5.62681 5.94632 5.28124 6.15918 5.06836L10.1357 1.0918H8.83594C8.53504 1.09154 8.29025 0.846803 8.29004 0.545898C8.29004 0.244816 8.53491 0.000254588 8.83594 0H11.4541Z`,fill:`currentColor`})})}function j(e){return a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:e.width??`63`,height:e.height??`24`,fill:`none`,viewBox:`0 0 63 24`,...e,children:[a(`title`,{children:`Frak`}),a(`rect`,{width:`24`,height:`24`,rx:`6`,fill:`#0043EF`}),a(`path`,{fill:`white`,d:`M9.76941 15.9093L5.1481 14.3453C5.06012 14.3155 4.96875 14.3811 4.96875 14.474V17.3274C4.96875 17.3857 5.00584 17.4373 5.06103 17.4561L9.68234 19.02C9.77032 19.0499 9.86169 18.9843 9.86169 18.8913V16.038C9.86169 15.9796 9.8246 15.9281 9.76941 15.9093ZM14.5764 10.4374L9.95396 12.0013C9.89878 12.0201 9.86169 12.0717 9.86169 12.13V14.9833C9.86169 15.0763 9.95306 15.1419 10.041 15.112L14.6635 13.5481C14.7187 13.5293 14.7558 13.4777 14.7558 13.4194V10.566C14.7558 10.4731 14.6646 10.4075 14.5764 10.4374ZM18.9173 5.01993L11.1787 7.51231C11.1226 7.53041 11.0846 7.58265 11.0846 7.64168V10.5651C11.0846 10.6233 11.1423 10.6644 11.1983 10.6463L18.9369 8.15396C18.993 8.13586 19.0312 8.08362 19.0312 8.02459V5.10113C19.031 5.043 18.9734 5.00184 18.9173 5.01993Z`}),a(`path`,{fill:`currentColor`,d:`M52.7211 9.5114C52.8254 9.51159 52.9095 9.59651 52.9096 9.70085L52.8383 18.2057C52.8383 18.3069 52.7575 18.3891 52.6577 18.3893L52.6411 18.3864H51.3022C51.1512 18.3861 50.7795 18.2504 50.3901 18.0007C49.8574 18.2487 49.2664 18.3893 48.644 18.3893H48.3901C47.2354 18.3893 46.1869 17.9123 45.4272 17.1442C44.667 16.3763 44.1958 15.316 44.1957 14.1481C44.1957 12.98 44.6675 11.9191 45.4272 11.151C46.1587 10.4118 47.1591 9.94381 48.2631 9.90983C49.1702 9.85599 49.9861 9.98778 50.4887 10.4967V9.70085C50.4888 9.5964 50.5737 9.51141 50.6782 9.5114H52.7211ZM35.352 5.61686H36.9623C37.0879 5.61703 37.1896 5.71855 37.1909 5.84538V7.81022C37.1909 7.93652 37.088 8.03874 36.9623 8.03874H34.9203C34.3151 8.03874 33.6274 8.63552 33.6274 9.25163V10.6149C34.2626 9.97905 34.9289 9.65371 35.352 9.63054H36.4604C36.5867 9.63054 36.6889 9.73339 36.6889 9.85905V11.8239C36.6889 11.9502 36.586 12.0524 36.4604 12.0524H34.9194C34.3143 12.0525 33.6276 12.6493 33.6274 13.2653V18.1999C33.6272 18.3042 33.5423 18.3883 33.4379 18.3883H31.395C31.2907 18.3882 31.2066 18.3042 31.2065 18.1999V9.93815C31.2065 9.86969 31.1975 9.80188 31.2006 9.73405C31.2397 8.87625 31.1516 5.44451 35.352 5.61686ZM39.933 9.63054C40.0375 9.63055 40.1224 9.71555 40.1225 9.81999V10.6149C40.7578 9.97909 41.5843 9.63054 41.8471 9.63054H43.4565C43.5821 9.63054 43.6844 9.73339 43.685 9.85905V11.8239C43.6848 11.95 43.5829 12.0513 43.4575 12.0514H41.4145C40.8093 12.0515 40.1225 12.6492 40.1225 13.2653V18.1999C40.1223 18.3042 40.0374 18.3883 39.933 18.3883H37.8901C37.7859 18.3882 37.7018 18.3041 37.7016 18.1999V9.81999C37.7017 9.71565 37.7858 9.63072 37.8901 9.63054H39.933ZM56.1967 7.00651C56.3021 7.00678 56.3879 7.09283 56.3881 7.1989V13.4479L59.8295 10.1891C59.8654 10.1552 59.912 10.1364 59.9614 10.1364H62.2797C62.4501 10.1364 62.5363 10.3414 62.4174 10.4626L59.3022 13.6325L62.7993 18.0749C62.8986 18.2012 62.8091 18.3864 62.6489 18.3864H60.2387C60.1804 18.3864 60.1258 18.3596 60.0893 18.3141L57.6723 15.3161C57.5998 15.2283 57.4679 15.2203 57.3871 15.3005L56.3881 16.2858V18.194C56.3881 18.2996 56.3029 18.3861 56.1967 18.3864H54.1879C54.0823 18.3862 53.9955 18.3003 53.9955 18.194V7.1989C53.9958 7.09341 54.0818 7.00669 54.1879 7.00651H56.1967ZM48.3705 11.9606C47.7802 11.9607 47.2427 12.2054 46.853 12.6003C46.4626 12.9952 46.2202 13.5386 46.2202 14.1354C46.2202 14.7323 46.4626 15.2763 46.853 15.6706C47.2427 16.0654 47.7802 16.3102 48.3705 16.3102H48.6616C49.2513 16.3102 49.7894 16.0654 50.1791 15.6706C50.5696 15.2763 50.8119 14.7323 50.8119 14.1354C50.8119 13.5386 50.5695 12.9945 50.1791 12.6003C49.7894 12.2055 49.2512 11.9606 48.6616 11.9606H48.3705Z`})]})}2*Math.PI*11;function M(e){return a(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,...e,children:a(`path`,{d:`M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0ZM8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5ZM8.10352 10.207C8.82025 10.2071 9.23531 10.6346 9.23535 11.3262C9.23535 12.0304 8.82028 12.4579 8.10352 12.458C7.36167 12.4579 6.97168 12.0304 6.97168 11.3262C6.97172 10.6346 7.36171 10.2072 8.10352 10.207ZM8.84766 3.54102C9.01311 3.54121 9.14736 3.67535 9.14746 3.84082V4.74805L8.84375 8.37012C8.83069 8.52552 8.6999 8.64551 8.54395 8.64551H7.62891C7.47133 8.64523 7.34074 8.52251 7.33008 8.36523L7.08496 4.74805V3.84082C7.08507 3.67533 7.2193 3.54119 7.38477 3.54102H8.84766Z`,fill:`currentColor`})})}function N(e){return a(`svg`,{viewBox:`0 0 100 100`,fill:`none`,"aria-hidden":`true`,...e,children:[a(`circle`,{cx:`38`,cy:`28`,r:`23`,fill:`#FFF533`}),a(`path`,{d:`M50 38C30 10 12 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),a(`path`,{d:`M50 38C70 10 88 30 50 38Z`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),a(`rect`,{x:`10`,y:`38`,width:`80`,height:`16`,rx:`2`,stroke:`#222222`,"stroke-width":`4`}),a(`path`,{d:`M15 54V89C15 90.6 16.4 92 18 92H82C83.6 92 85 90.6 85 89V54`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`,"stroke-linejoin":`round`}),a(`line`,{x1:`50`,y1:`54`,x2:`50`,y2:`92`,stroke:`#222222`,"stroke-width":`4`,"stroke-linecap":`round`})]})}export{k as a,A as i,M as n,j as r,N as t};