@akin-travel/partner-sdk 1.0.5
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/README.md +1204 -0
- package/dist/account/components/AccountInfoSection.d.ts +46 -0
- package/dist/account/components/AccountInfoSection.d.ts.map +1 -0
- package/dist/account/components/AccountInfoSection.js +52 -0
- package/dist/account/components/AccountInfoSection.js.map +1 -0
- package/dist/account/components/NotificationPreferencesSection.d.ts +40 -0
- package/dist/account/components/NotificationPreferencesSection.d.ts.map +1 -0
- package/dist/account/components/NotificationPreferencesSection.js +116 -0
- package/dist/account/components/NotificationPreferencesSection.js.map +1 -0
- package/dist/account/components/PasskeySection.d.ts +49 -0
- package/dist/account/components/PasskeySection.d.ts.map +1 -0
- package/dist/account/components/PasskeySection.js +298 -0
- package/dist/account/components/PasskeySection.js.map +1 -0
- package/dist/account/hooks/useAccountForm.d.ts +23 -0
- package/dist/account/hooks/useAccountForm.d.ts.map +1 -0
- package/dist/account/hooks/useAccountForm.js +133 -0
- package/dist/account/hooks/useAccountForm.js.map +1 -0
- package/dist/account/index.d.ts +10 -0
- package/dist/account/index.d.ts.map +1 -0
- package/dist/account/index.js +21 -0
- package/dist/account/index.js.map +1 -0
- package/dist/auth/AkinAuthProvider.d.ts +31 -0
- package/dist/auth/AkinAuthProvider.d.ts.map +1 -0
- package/dist/auth/AkinAuthProvider.js +632 -0
- package/dist/auth/AkinAuthProvider.js.map +1 -0
- package/dist/auth/components/LoginForm.d.ts +63 -0
- package/dist/auth/components/LoginForm.d.ts.map +1 -0
- package/dist/auth/components/LoginForm.js +230 -0
- package/dist/auth/components/LoginForm.js.map +1 -0
- package/dist/auth/components/MagicLinkForm.d.ts +41 -0
- package/dist/auth/components/MagicLinkForm.d.ts.map +1 -0
- package/dist/auth/components/MagicLinkForm.js +88 -0
- package/dist/auth/components/MagicLinkForm.js.map +1 -0
- package/dist/auth/components/RequireAuth.d.ts +62 -0
- package/dist/auth/components/RequireAuth.d.ts.map +1 -0
- package/dist/auth/components/RequireAuth.js +63 -0
- package/dist/auth/components/RequireAuth.js.map +1 -0
- package/dist/auth/components/RequireGuest.d.ts +60 -0
- package/dist/auth/components/RequireGuest.d.ts.map +1 -0
- package/dist/auth/components/RequireGuest.js +64 -0
- package/dist/auth/components/RequireGuest.js.map +1 -0
- package/dist/auth/components/SignupForm.d.ts +45 -0
- package/dist/auth/components/SignupForm.d.ts.map +1 -0
- package/dist/auth/components/SignupForm.js +167 -0
- package/dist/auth/components/SignupForm.js.map +1 -0
- package/dist/auth/index.d.ts +10 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +21 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +136 -0
- package/dist/client.js.map +1 -0
- package/dist/components/PhoneInput.d.ts +62 -0
- package/dist/components/PhoneInput.d.ts.map +1 -0
- package/dist/components/PhoneInput.js +65 -0
- package/dist/components/PhoneInput.js.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/config.d.ts +111 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +56 -0
- package/dist/config.js.map +1 -0
- package/dist/constants/preferences.d.ts +22 -0
- package/dist/constants/preferences.d.ts.map +1 -0
- package/dist/constants/preferences.js +52 -0
- package/dist/constants/preferences.js.map +1 -0
- package/dist/currency/CurrencyProvider.d.ts +46 -0
- package/dist/currency/CurrencyProvider.d.ts.map +1 -0
- package/dist/currency/CurrencyProvider.js +145 -0
- package/dist/currency/CurrencyProvider.js.map +1 -0
- package/dist/currency/components/CurrencySelector.d.ts +43 -0
- package/dist/currency/components/CurrencySelector.d.ts.map +1 -0
- package/dist/currency/components/CurrencySelector.js +58 -0
- package/dist/currency/components/CurrencySelector.js.map +1 -0
- package/dist/currency/exchangeRates.d.ts +40 -0
- package/dist/currency/exchangeRates.d.ts.map +1 -0
- package/dist/currency/exchangeRates.js +90 -0
- package/dist/currency/exchangeRates.js.map +1 -0
- package/dist/currency/index.d.ts +6 -0
- package/dist/currency/index.d.ts.map +1 -0
- package/dist/currency/index.js +20 -0
- package/dist/currency/index.js.map +1 -0
- package/dist/header/components/CurrencyAccordion.d.ts +45 -0
- package/dist/header/components/CurrencyAccordion.d.ts.map +1 -0
- package/dist/header/components/CurrencyAccordion.js +54 -0
- package/dist/header/components/CurrencyAccordion.js.map +1 -0
- package/dist/header/components/HeaderMenu.d.ts +49 -0
- package/dist/header/components/HeaderMenu.d.ts.map +1 -0
- package/dist/header/components/HeaderMenu.js +95 -0
- package/dist/header/components/HeaderMenu.js.map +1 -0
- package/dist/header/components/LanguageAccordion.d.ts +45 -0
- package/dist/header/components/LanguageAccordion.d.ts.map +1 -0
- package/dist/header/components/LanguageAccordion.js +54 -0
- package/dist/header/components/LanguageAccordion.js.map +1 -0
- package/dist/header/components/UserAvatar.d.ts +26 -0
- package/dist/header/components/UserAvatar.d.ts.map +1 -0
- package/dist/header/components/UserAvatar.js +46 -0
- package/dist/header/components/UserAvatar.js.map +1 -0
- package/dist/header/index.d.ts +10 -0
- package/dist/header/index.d.ts.map +1 -0
- package/dist/header/index.js +13 -0
- package/dist/header/index.js.map +1 -0
- package/dist/i18n/I18nProvider.d.ts +57 -0
- package/dist/i18n/I18nProvider.d.ts.map +1 -0
- package/dist/i18n/I18nProvider.js +205 -0
- package/dist/i18n/I18nProvider.js.map +1 -0
- package/dist/i18n/components/LanguageSelector.d.ts +43 -0
- package/dist/i18n/components/LanguageSelector.d.ts.map +1 -0
- package/dist/i18n/components/LanguageSelector.js +57 -0
- package/dist/i18n/components/LanguageSelector.js.map +1 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +14 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/translations/en.json +283 -0
- package/dist/i18n/translations/es.json +283 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +191 -0
- package/dist/index.js.map +1 -0
- package/dist/loyalty/AkinLoyaltyProvider.d.ts +18 -0
- package/dist/loyalty/AkinLoyaltyProvider.d.ts.map +1 -0
- package/dist/loyalty/AkinLoyaltyProvider.js +399 -0
- package/dist/loyalty/AkinLoyaltyProvider.js.map +1 -0
- package/dist/loyalty/components/LoyaltyCard.d.ts +48 -0
- package/dist/loyalty/components/LoyaltyCard.d.ts.map +1 -0
- package/dist/loyalty/components/LoyaltyCard.js +140 -0
- package/dist/loyalty/components/LoyaltyCard.js.map +1 -0
- package/dist/loyalty/components/PointsDisplay.d.ts +40 -0
- package/dist/loyalty/components/PointsDisplay.d.ts.map +1 -0
- package/dist/loyalty/components/PointsDisplay.js +32 -0
- package/dist/loyalty/components/PointsDisplay.js.map +1 -0
- package/dist/loyalty/components/PreviousStays.d.ts +59 -0
- package/dist/loyalty/components/PreviousStays.d.ts.map +1 -0
- package/dist/loyalty/components/PreviousStays.js +101 -0
- package/dist/loyalty/components/PreviousStays.js.map +1 -0
- package/dist/loyalty/components/SimpleTierCards.d.ts +51 -0
- package/dist/loyalty/components/SimpleTierCards.d.ts.map +1 -0
- package/dist/loyalty/components/SimpleTierCards.js +96 -0
- package/dist/loyalty/components/SimpleTierCards.js.map +1 -0
- package/dist/loyalty/components/TierCard.d.ts +30 -0
- package/dist/loyalty/components/TierCard.d.ts.map +1 -0
- package/dist/loyalty/components/TierCard.js +41 -0
- package/dist/loyalty/components/TierCard.js.map +1 -0
- package/dist/loyalty/components/TierProgress.d.ts +32 -0
- package/dist/loyalty/components/TierProgress.d.ts.map +1 -0
- package/dist/loyalty/components/TierProgress.js +41 -0
- package/dist/loyalty/components/TierProgress.js.map +1 -0
- package/dist/loyalty/components/TierRequirementsTable.d.ts +54 -0
- package/dist/loyalty/components/TierRequirementsTable.d.ts.map +1 -0
- package/dist/loyalty/components/TierRequirementsTable.js +104 -0
- package/dist/loyalty/components/TierRequirementsTable.js.map +1 -0
- package/dist/loyalty/components/TransactionList.d.ts +44 -0
- package/dist/loyalty/components/TransactionList.d.ts.map +1 -0
- package/dist/loyalty/components/TransactionList.js +112 -0
- package/dist/loyalty/components/TransactionList.js.map +1 -0
- package/dist/loyalty/components/UpcomingStays.d.ts +49 -0
- package/dist/loyalty/components/UpcomingStays.d.ts.map +1 -0
- package/dist/loyalty/components/UpcomingStays.js +60 -0
- package/dist/loyalty/components/UpcomingStays.js.map +1 -0
- package/dist/loyalty/index.d.ts +12 -0
- package/dist/loyalty/index.d.ts.map +1 -0
- package/dist/loyalty/index.js +27 -0
- package/dist/loyalty/index.js.map +1 -0
- package/dist/types/account.d.ts +108 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/account.js +3 -0
- package/dist/types/account.js.map +1 -0
- package/dist/types/auth.d.ts +205 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +3 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/currency.d.ts +102 -0
- package/dist/types/currency.d.ts.map +1 -0
- package/dist/types/currency.js +3 -0
- package/dist/types/currency.js.map +1 -0
- package/dist/types/header.d.ts +105 -0
- package/dist/types/header.d.ts.map +1 -0
- package/dist/types/header.js +3 -0
- package/dist/types/header.js.map +1 -0
- package/dist/types/i18n.d.ts +90 -0
- package/dist/types/i18n.d.ts.map +1 -0
- package/dist/types/i18n.js +3 -0
- package/dist/types/i18n.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/loyalty.d.ts +312 -0
- package/dist/types/loyalty.d.ts.map +1 -0
- package/dist/types/loyalty.js +3 -0
- package/dist/types/loyalty.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/tierLabels.d.ts +27 -0
- package/dist/utils/tierLabels.d.ts.map +1 -0
- package/dist/utils/tierLabels.js +110 -0
- package/dist/utils/tierLabels.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.useSDK = useSDK;
|
|
38
|
+
exports.useAkinAuth = useAkinAuth;
|
|
39
|
+
exports.AkinProvider = AkinProvider;
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const react_1 = require("react");
|
|
42
|
+
const client_1 = require("@apollo/client");
|
|
43
|
+
const app_1 = require("firebase/app");
|
|
44
|
+
const auth_1 = require("firebase/auth");
|
|
45
|
+
const config_1 = require("../config");
|
|
46
|
+
const client_2 = require("../client");
|
|
47
|
+
const AkinLoyaltyProvider_1 = require("../loyalty/AkinLoyaltyProvider");
|
|
48
|
+
const I18nProvider_1 = require("../i18n/I18nProvider");
|
|
49
|
+
const CurrencyProvider_1 = require("../currency/CurrencyProvider");
|
|
50
|
+
// GraphQL Mutations
|
|
51
|
+
const LOGIN_MEMBER_GIP = (0, client_2.gql) `
|
|
52
|
+
mutation LoginMemberGIP($input: LoginMemberGIPInput!) {
|
|
53
|
+
loginMemberGIP(input: $input) {
|
|
54
|
+
user {
|
|
55
|
+
id
|
|
56
|
+
email
|
|
57
|
+
firstName
|
|
58
|
+
lastName
|
|
59
|
+
emailVerified
|
|
60
|
+
}
|
|
61
|
+
memberData {
|
|
62
|
+
id
|
|
63
|
+
firstName
|
|
64
|
+
lastName
|
|
65
|
+
email
|
|
66
|
+
phone
|
|
67
|
+
countryCode
|
|
68
|
+
spendableNetworkPoints
|
|
69
|
+
unspendableNetworkPoints
|
|
70
|
+
tierAtPartner
|
|
71
|
+
tierDisplayName
|
|
72
|
+
status
|
|
73
|
+
vibePreference
|
|
74
|
+
perkPreferences
|
|
75
|
+
placeTypePreferences
|
|
76
|
+
loyaltyNumber
|
|
77
|
+
marketingOptIn
|
|
78
|
+
createdAt
|
|
79
|
+
updatedAt
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
const SIGN_UP_PASSWORDLESS = (0, client_2.gql) `
|
|
85
|
+
mutation SignUpPasswordless($input: SignUpPasswordlessInput!) {
|
|
86
|
+
signUpPasswordless(input: $input) {
|
|
87
|
+
success
|
|
88
|
+
userId
|
|
89
|
+
email
|
|
90
|
+
error
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
const REQUEST_MAGIC_LINK = (0, client_2.gql) `
|
|
95
|
+
mutation RequestMagicLink($email: String!, $userType: String!, $partnerId: ID) {
|
|
96
|
+
requestMagicLink(email: $email, userType: $userType, partnerId: $partnerId) {
|
|
97
|
+
success
|
|
98
|
+
error
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
const VERIFY_AUTH_TOKEN = (0, client_2.gql) `
|
|
103
|
+
mutation VerifyAuthToken($token: String!) {
|
|
104
|
+
verifyAuthToken(token: $token) {
|
|
105
|
+
success
|
|
106
|
+
customToken
|
|
107
|
+
userId
|
|
108
|
+
isNewUser
|
|
109
|
+
error
|
|
110
|
+
memberData {
|
|
111
|
+
id
|
|
112
|
+
firstName
|
|
113
|
+
lastName
|
|
114
|
+
email
|
|
115
|
+
phone
|
|
116
|
+
countryCode
|
|
117
|
+
spendableNetworkPoints
|
|
118
|
+
unspendableNetworkPoints
|
|
119
|
+
tierAtPartner
|
|
120
|
+
tierDisplayName
|
|
121
|
+
status
|
|
122
|
+
loyaltyNumber
|
|
123
|
+
marketingOptIn
|
|
124
|
+
createdAt
|
|
125
|
+
updatedAt
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
`;
|
|
130
|
+
const PASSKEY_AUTHENTICATION_OPTIONS = (0, client_2.gql) `
|
|
131
|
+
mutation PasskeyAuthenticationOptions($userId: String, $tenantId: String, $userType: String) {
|
|
132
|
+
passkeyAuthenticationOptions(userId: $userId, tenantId: $tenantId, userType: $userType)
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
const PASSKEY_AUTHENTICATE = (0, client_2.gql) `
|
|
136
|
+
mutation PasskeyAuthenticate($authenticationResponse: JSONObject!, $expectedChallenge: String!) {
|
|
137
|
+
passkeyAuthenticate(authenticationResponse: $authenticationResponse, expectedChallenge: $expectedChallenge) {
|
|
138
|
+
customToken
|
|
139
|
+
tenantId
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
// Helper to dynamically import browser-only WebAuthn functions
|
|
144
|
+
async function importWebAuthnBrowser() {
|
|
145
|
+
if (typeof window === 'undefined') {
|
|
146
|
+
throw new Error('WebAuthn is only available in the browser');
|
|
147
|
+
}
|
|
148
|
+
return await Promise.resolve().then(() => __importStar(require('@simplewebauthn/browser')));
|
|
149
|
+
}
|
|
150
|
+
// Check for WebAuthn support
|
|
151
|
+
function isPasskeySupported() {
|
|
152
|
+
if (typeof window === 'undefined')
|
|
153
|
+
return false;
|
|
154
|
+
return window?.PublicKeyCredential !== undefined && typeof window.PublicKeyCredential === 'function';
|
|
155
|
+
}
|
|
156
|
+
// Firebase error code to user-friendly message mapping
|
|
157
|
+
const FIREBASE_ERROR_MESSAGES = {
|
|
158
|
+
'auth/invalid-email': 'Please enter a valid email address.',
|
|
159
|
+
'auth/user-disabled': 'This account has been disabled. Please contact support.',
|
|
160
|
+
'auth/user-not-found': 'No account found with this email address.',
|
|
161
|
+
'auth/wrong-password': 'Incorrect password. Please try again.',
|
|
162
|
+
'auth/email-already-in-use': 'An account with this email already exists.',
|
|
163
|
+
'auth/weak-password': 'Password is too weak. Please use at least 6 characters.',
|
|
164
|
+
'auth/operation-not-allowed': 'This sign-in method is not enabled.',
|
|
165
|
+
'auth/too-many-requests': 'Too many failed attempts. Please try again later.',
|
|
166
|
+
'auth/network-request-failed': 'Network error. Please check your connection.',
|
|
167
|
+
'auth/popup-closed-by-user': 'Sign-in was cancelled.',
|
|
168
|
+
'auth/cancelled-popup-request': 'Sign-in was cancelled.',
|
|
169
|
+
'auth/popup-blocked': 'Pop-up was blocked. Please allow pop-ups for this site.',
|
|
170
|
+
'auth/invalid-credential': 'Invalid credentials. Please try again.',
|
|
171
|
+
'auth/invalid-verification-code': 'Invalid verification code.',
|
|
172
|
+
'auth/invalid-verification-id': 'Invalid verification. Please request a new link.',
|
|
173
|
+
'auth/code-expired': 'Verification code has expired. Please request a new one.',
|
|
174
|
+
'auth/credential-already-in-use': 'This credential is already associated with another account.',
|
|
175
|
+
'auth/requires-recent-login': 'Please sign in again to complete this action.',
|
|
176
|
+
'auth/api-key-not-valid.-please-pass-a-valid-api-key.': 'Authentication service configuration error. Please contact support.',
|
|
177
|
+
'auth/requests-from-referer-blocked': 'This domain is not authorized for authentication.',
|
|
178
|
+
'auth/invalid-custom-token': 'Authentication failed. Please try again.',
|
|
179
|
+
'auth/custom-token-mismatch': 'Authentication failed. Please try again.',
|
|
180
|
+
};
|
|
181
|
+
// Extract Firebase error code and convert to user-friendly message
|
|
182
|
+
function getReadableErrorMessage(error) {
|
|
183
|
+
if (!(error instanceof Error)) {
|
|
184
|
+
return 'An unexpected error occurred. Please try again.';
|
|
185
|
+
}
|
|
186
|
+
const message = error.message;
|
|
187
|
+
// Check for Firebase error format: "Firebase: Error (auth/error-code)."
|
|
188
|
+
const firebaseMatch = message.match(/Firebase: Error \((auth\/[^)]+)\)/);
|
|
189
|
+
if (firebaseMatch) {
|
|
190
|
+
const errorCode = firebaseMatch[1];
|
|
191
|
+
return FIREBASE_ERROR_MESSAGES[errorCode] || `Authentication error: ${errorCode.replace('auth/', '').replace(/-/g, ' ')}`;
|
|
192
|
+
}
|
|
193
|
+
// Check for referer blocked error (different format)
|
|
194
|
+
if (message.includes('requests-from-referer') && message.includes('are-blocked')) {
|
|
195
|
+
return 'This domain is not authorized for authentication. Please contact support.';
|
|
196
|
+
}
|
|
197
|
+
// Check for WebAuthn/Passkey errors
|
|
198
|
+
if (message.includes('RP ID') && message.includes('invalid')) {
|
|
199
|
+
return 'Passkey authentication is not available for this domain.';
|
|
200
|
+
}
|
|
201
|
+
// Check for GraphQL errors
|
|
202
|
+
if (message.includes('GraphQL')) {
|
|
203
|
+
return 'Server error. Please try again later.';
|
|
204
|
+
}
|
|
205
|
+
// Return original message if no mapping found (might already be user-friendly)
|
|
206
|
+
return message;
|
|
207
|
+
}
|
|
208
|
+
const AuthContext = (0, react_1.createContext)(undefined);
|
|
209
|
+
const SDKContext = (0, react_1.createContext)(undefined);
|
|
210
|
+
/**
|
|
211
|
+
* Hook to access SDK configuration and Firebase instances
|
|
212
|
+
*/
|
|
213
|
+
function useSDK() {
|
|
214
|
+
const context = (0, react_1.useContext)(SDKContext);
|
|
215
|
+
if (!context) {
|
|
216
|
+
throw new Error('useSDK must be used within an AkinProvider');
|
|
217
|
+
}
|
|
218
|
+
return context;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Hook to access auth state and actions
|
|
222
|
+
*/
|
|
223
|
+
function useAkinAuth() {
|
|
224
|
+
const context = (0, react_1.useContext)(AuthContext);
|
|
225
|
+
if (!context) {
|
|
226
|
+
throw new Error('useAkinAuth must be used within an AkinProvider');
|
|
227
|
+
}
|
|
228
|
+
return context;
|
|
229
|
+
}
|
|
230
|
+
// Helper to convert Firebase user to AkinUser
|
|
231
|
+
function toAkinUser(firebaseUser) {
|
|
232
|
+
return {
|
|
233
|
+
id: firebaseUser.uid,
|
|
234
|
+
email: firebaseUser.email || '',
|
|
235
|
+
displayName: firebaseUser.displayName || undefined,
|
|
236
|
+
emailVerified: firebaseUser.emailVerified,
|
|
237
|
+
photoURL: firebaseUser.photoURL || undefined,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Main provider for the Akin Partner SDK
|
|
242
|
+
* Wraps your app to provide auth and loyalty functionality
|
|
243
|
+
*/
|
|
244
|
+
function AkinProvider({ config: userConfig, children }) {
|
|
245
|
+
const resolvedConfig = (0, react_1.useMemo)(() => (0, config_1.resolveConfig)(userConfig), [userConfig]);
|
|
246
|
+
// Initialize Firebase
|
|
247
|
+
const { firebaseApp, auth } = (0, react_1.useMemo)(() => {
|
|
248
|
+
const existingApp = (0, app_1.getApps)().find((app) => app.name === 'akin-partner-sdk');
|
|
249
|
+
const app = existingApp ||
|
|
250
|
+
(0, app_1.initializeApp)({
|
|
251
|
+
apiKey: resolvedConfig.firebase.apiKey,
|
|
252
|
+
authDomain: resolvedConfig.firebase.authDomain,
|
|
253
|
+
projectId: resolvedConfig.firebase.projectId,
|
|
254
|
+
appId: resolvedConfig.firebase.appId,
|
|
255
|
+
}, 'akin-partner-sdk');
|
|
256
|
+
const authInstance = (0, auth_1.getAuth)(app);
|
|
257
|
+
// Set tenant for multi-tenancy
|
|
258
|
+
authInstance.tenantId = resolvedConfig.gipTenantId;
|
|
259
|
+
return { firebaseApp: app, auth: authInstance };
|
|
260
|
+
}, [resolvedConfig]);
|
|
261
|
+
// Create Apollo client
|
|
262
|
+
const apolloClient = (0, react_1.useMemo)(() => (0, client_2.createAkinClient)(userConfig), [userConfig]);
|
|
263
|
+
// Auth state
|
|
264
|
+
const [firebaseUser, setFirebaseUser] = (0, react_1.useState)(null);
|
|
265
|
+
const [user, setUser] = (0, react_1.useState)(null);
|
|
266
|
+
const [member, setMember] = (0, react_1.useState)(null);
|
|
267
|
+
const [isLoading, setIsLoading] = (0, react_1.useState)(true);
|
|
268
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
269
|
+
// Refs for deduplication
|
|
270
|
+
const lastSyncedUidRef = (0, react_1.useRef)(null);
|
|
271
|
+
const isInitializedRef = (0, react_1.useRef)(false);
|
|
272
|
+
// Set up token provider for Apollo client
|
|
273
|
+
(0, react_1.useEffect)(() => {
|
|
274
|
+
(0, client_2.setTokenProvider)(async () => {
|
|
275
|
+
if (!firebaseUser)
|
|
276
|
+
return null;
|
|
277
|
+
try {
|
|
278
|
+
return await firebaseUser.getIdToken();
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}, [firebaseUser]);
|
|
285
|
+
// Sync member data from API
|
|
286
|
+
const syncMemberData = (0, react_1.useCallback)(async (fbUser) => {
|
|
287
|
+
if (lastSyncedUidRef.current === fbUser.uid)
|
|
288
|
+
return;
|
|
289
|
+
lastSyncedUidRef.current = fbUser.uid;
|
|
290
|
+
try {
|
|
291
|
+
const idToken = await fbUser.getIdToken();
|
|
292
|
+
const { data } = await apolloClient.mutate({
|
|
293
|
+
mutation: LOGIN_MEMBER_GIP,
|
|
294
|
+
variables: {
|
|
295
|
+
input: {
|
|
296
|
+
idToken,
|
|
297
|
+
partnerId: resolvedConfig.partnerId,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
if (data?.loginMemberGIP?.memberData) {
|
|
302
|
+
const memberData = data.loginMemberGIP.memberData;
|
|
303
|
+
setMember({
|
|
304
|
+
...memberData,
|
|
305
|
+
createdAt: new Date(memberData.createdAt),
|
|
306
|
+
updatedAt: new Date(memberData.updatedAt),
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
catch (err) {
|
|
311
|
+
if (resolvedConfig.debug) {
|
|
312
|
+
console.error('[Akin SDK] Error syncing member data:', err);
|
|
313
|
+
}
|
|
314
|
+
setError('Failed to load member data');
|
|
315
|
+
}
|
|
316
|
+
}, [apolloClient, resolvedConfig]);
|
|
317
|
+
// Listen for auth state changes
|
|
318
|
+
(0, react_1.useEffect)(() => {
|
|
319
|
+
const unsubscribe = (0, auth_1.onAuthStateChanged)(auth, async (fbUser) => {
|
|
320
|
+
setFirebaseUser(fbUser);
|
|
321
|
+
if (fbUser) {
|
|
322
|
+
setUser(toAkinUser(fbUser));
|
|
323
|
+
await syncMemberData(fbUser);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
setUser(null);
|
|
327
|
+
setMember(null);
|
|
328
|
+
lastSyncedUidRef.current = null;
|
|
329
|
+
(0, client_2.clearTokenCache)();
|
|
330
|
+
}
|
|
331
|
+
if (!isInitializedRef.current) {
|
|
332
|
+
isInitializedRef.current = true;
|
|
333
|
+
setIsLoading(false);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
// Set a timeout for initialization
|
|
337
|
+
const timeout = setTimeout(() => {
|
|
338
|
+
if (!isInitializedRef.current) {
|
|
339
|
+
isInitializedRef.current = true;
|
|
340
|
+
setIsLoading(false);
|
|
341
|
+
}
|
|
342
|
+
}, 10000);
|
|
343
|
+
return () => {
|
|
344
|
+
unsubscribe();
|
|
345
|
+
clearTimeout(timeout);
|
|
346
|
+
};
|
|
347
|
+
}, [auth, syncMemberData]);
|
|
348
|
+
// Auth actions
|
|
349
|
+
const signIn = (0, react_1.useCallback)(async (email, password) => {
|
|
350
|
+
setError(null);
|
|
351
|
+
setIsLoading(true);
|
|
352
|
+
try {
|
|
353
|
+
await (0, auth_1.setPersistence)(auth, auth_1.browserLocalPersistence);
|
|
354
|
+
await (0, auth_1.signInWithEmailAndPassword)(auth, email, password);
|
|
355
|
+
}
|
|
356
|
+
catch (err) {
|
|
357
|
+
const message = getReadableErrorMessage(err);
|
|
358
|
+
setError(message);
|
|
359
|
+
throw err;
|
|
360
|
+
}
|
|
361
|
+
finally {
|
|
362
|
+
setIsLoading(false);
|
|
363
|
+
}
|
|
364
|
+
}, [auth]);
|
|
365
|
+
const signUp = (0, react_1.useCallback)(async (data) => {
|
|
366
|
+
setError(null);
|
|
367
|
+
setIsLoading(true);
|
|
368
|
+
try {
|
|
369
|
+
await (0, auth_1.setPersistence)(auth, auth_1.browserLocalPersistence);
|
|
370
|
+
const credential = await (0, auth_1.createUserWithEmailAndPassword)(auth, data.email, data.password);
|
|
371
|
+
// Update display name
|
|
372
|
+
await (0, auth_1.updateProfile)(credential.user, {
|
|
373
|
+
displayName: `${data.firstName} ${data.lastName}`,
|
|
374
|
+
});
|
|
375
|
+
// Sync will happen via onAuthStateChanged
|
|
376
|
+
}
|
|
377
|
+
catch (err) {
|
|
378
|
+
const message = getReadableErrorMessage(err);
|
|
379
|
+
setError(message);
|
|
380
|
+
throw err;
|
|
381
|
+
}
|
|
382
|
+
finally {
|
|
383
|
+
setIsLoading(false);
|
|
384
|
+
}
|
|
385
|
+
}, [auth]);
|
|
386
|
+
const signUpPasswordless = (0, react_1.useCallback)(async (data) => {
|
|
387
|
+
setError(null);
|
|
388
|
+
try {
|
|
389
|
+
const { data: result } = await apolloClient.mutate({
|
|
390
|
+
mutation: SIGN_UP_PASSWORDLESS,
|
|
391
|
+
variables: {
|
|
392
|
+
input: {
|
|
393
|
+
firstName: data.firstName,
|
|
394
|
+
lastName: data.lastName,
|
|
395
|
+
email: data.email,
|
|
396
|
+
phone: data.phone,
|
|
397
|
+
countryCode: data.countryCode,
|
|
398
|
+
partnerId: resolvedConfig.partnerId,
|
|
399
|
+
termsAccepted: data.termsAccepted,
|
|
400
|
+
marketingOptIn: data.marketingOptIn,
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
if (result?.signUpPasswordless?.success) {
|
|
405
|
+
return { success: true };
|
|
406
|
+
}
|
|
407
|
+
const errorMsg = result?.signUpPasswordless?.error || 'Passwordless signup failed';
|
|
408
|
+
setError(errorMsg);
|
|
409
|
+
return { success: false, error: errorMsg };
|
|
410
|
+
}
|
|
411
|
+
catch (err) {
|
|
412
|
+
const message = getReadableErrorMessage(err);
|
|
413
|
+
setError(message);
|
|
414
|
+
return { success: false, error: message };
|
|
415
|
+
}
|
|
416
|
+
}, [apolloClient, resolvedConfig.partnerId]);
|
|
417
|
+
const requestMagicLink = (0, react_1.useCallback)(async (email) => {
|
|
418
|
+
setError(null);
|
|
419
|
+
try {
|
|
420
|
+
const { data: result } = await apolloClient.mutate({
|
|
421
|
+
mutation: REQUEST_MAGIC_LINK,
|
|
422
|
+
variables: {
|
|
423
|
+
email,
|
|
424
|
+
userType: 'member',
|
|
425
|
+
partnerId: resolvedConfig.partnerId,
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
if (result?.requestMagicLink?.success) {
|
|
429
|
+
return { success: true };
|
|
430
|
+
}
|
|
431
|
+
const errorMsg = result?.requestMagicLink?.error || 'Failed to send magic link';
|
|
432
|
+
setError(errorMsg);
|
|
433
|
+
return { success: false, error: errorMsg };
|
|
434
|
+
}
|
|
435
|
+
catch (err) {
|
|
436
|
+
const message = getReadableErrorMessage(err);
|
|
437
|
+
setError(message);
|
|
438
|
+
return { success: false, error: message };
|
|
439
|
+
}
|
|
440
|
+
}, [apolloClient, resolvedConfig.partnerId]);
|
|
441
|
+
const verifyMagicLink = (0, react_1.useCallback)(async (token) => {
|
|
442
|
+
setError(null);
|
|
443
|
+
setIsLoading(true);
|
|
444
|
+
try {
|
|
445
|
+
const { data: result } = await apolloClient.mutate({
|
|
446
|
+
mutation: VERIFY_AUTH_TOKEN,
|
|
447
|
+
variables: { token },
|
|
448
|
+
});
|
|
449
|
+
if (!result?.verifyAuthToken?.success) {
|
|
450
|
+
const errorMsg = result?.verifyAuthToken?.error || 'Verification failed. Please request a new link.';
|
|
451
|
+
setError(errorMsg);
|
|
452
|
+
setIsLoading(false);
|
|
453
|
+
return { success: false, error: errorMsg };
|
|
454
|
+
}
|
|
455
|
+
// Sign in with the custom token
|
|
456
|
+
if (result.verifyAuthToken.customToken) {
|
|
457
|
+
await (0, auth_1.signInWithCustomToken)(auth, result.verifyAuthToken.customToken);
|
|
458
|
+
}
|
|
459
|
+
// Set member data if provided
|
|
460
|
+
if (result.verifyAuthToken.memberData) {
|
|
461
|
+
const memberData = result.verifyAuthToken.memberData;
|
|
462
|
+
setMember({
|
|
463
|
+
...memberData,
|
|
464
|
+
createdAt: new Date(memberData.createdAt),
|
|
465
|
+
updatedAt: new Date(memberData.updatedAt),
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
setIsLoading(false);
|
|
469
|
+
return {
|
|
470
|
+
success: true,
|
|
471
|
+
isNewUser: result.verifyAuthToken.isNewUser,
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
catch (err) {
|
|
475
|
+
const message = getReadableErrorMessage(err);
|
|
476
|
+
setError(message);
|
|
477
|
+
setIsLoading(false);
|
|
478
|
+
return { success: false, error: message };
|
|
479
|
+
}
|
|
480
|
+
}, [apolloClient, auth]);
|
|
481
|
+
const signInWithGoogle = (0, react_1.useCallback)(async () => {
|
|
482
|
+
setError(null);
|
|
483
|
+
setIsLoading(true);
|
|
484
|
+
try {
|
|
485
|
+
const provider = new auth_1.GoogleAuthProvider();
|
|
486
|
+
await (0, auth_1.signInWithPopup)(auth, provider);
|
|
487
|
+
}
|
|
488
|
+
catch (err) {
|
|
489
|
+
const message = getReadableErrorMessage(err);
|
|
490
|
+
setError(message);
|
|
491
|
+
throw err;
|
|
492
|
+
}
|
|
493
|
+
finally {
|
|
494
|
+
setIsLoading(false);
|
|
495
|
+
}
|
|
496
|
+
}, [auth]);
|
|
497
|
+
const signInWithPasskey = (0, react_1.useCallback)(async () => {
|
|
498
|
+
if (!isPasskeySupported()) {
|
|
499
|
+
const message = 'Passkeys are not supported in this browser.';
|
|
500
|
+
setError(message);
|
|
501
|
+
throw new Error(message);
|
|
502
|
+
}
|
|
503
|
+
setError(null);
|
|
504
|
+
setIsLoading(true);
|
|
505
|
+
try {
|
|
506
|
+
// Step 1: Get authentication options from server
|
|
507
|
+
// Pass userType to scope credential discovery to MEMBER passkeys only
|
|
508
|
+
const { data: optionsData } = await apolloClient.mutate({
|
|
509
|
+
mutation: PASSKEY_AUTHENTICATION_OPTIONS,
|
|
510
|
+
variables: { userType: 'MEMBER' },
|
|
511
|
+
});
|
|
512
|
+
if (!optionsData?.passkeyAuthenticationOptions) {
|
|
513
|
+
throw new Error('No passkeys registered. Please sign in with email first, then register a passkey.');
|
|
514
|
+
}
|
|
515
|
+
const options = optionsData.passkeyAuthenticationOptions;
|
|
516
|
+
// Step 2: Start WebAuthn authentication (browser prompts user)
|
|
517
|
+
const { startAuthentication } = await importWebAuthnBrowser();
|
|
518
|
+
const authenticationResponse = await startAuthentication({ optionsJSON: options });
|
|
519
|
+
// Step 3: Verify authentication on server and get custom token
|
|
520
|
+
const { data: authData } = await apolloClient.mutate({
|
|
521
|
+
mutation: PASSKEY_AUTHENTICATE,
|
|
522
|
+
variables: {
|
|
523
|
+
authenticationResponse,
|
|
524
|
+
expectedChallenge: options.challenge,
|
|
525
|
+
},
|
|
526
|
+
});
|
|
527
|
+
if (!authData?.passkeyAuthenticate) {
|
|
528
|
+
throw new Error('Passkey verification failed. Please try again.');
|
|
529
|
+
}
|
|
530
|
+
const { customToken, tenantId: credentialTenantId } = authData.passkeyAuthenticate;
|
|
531
|
+
// Step 4: Update Firebase tenant if different from config
|
|
532
|
+
if (credentialTenantId && auth.tenantId !== credentialTenantId) {
|
|
533
|
+
auth.tenantId = credentialTenantId;
|
|
534
|
+
}
|
|
535
|
+
// Step 5: Sign in with the custom token
|
|
536
|
+
await (0, auth_1.signInWithCustomToken)(auth, customToken);
|
|
537
|
+
// Success - loading will be reset in finally block
|
|
538
|
+
}
|
|
539
|
+
catch (err) {
|
|
540
|
+
const error = err;
|
|
541
|
+
// User cancelled the passkey prompt - not an error
|
|
542
|
+
if (error.name === 'NotAllowedError') {
|
|
543
|
+
setIsLoading(false);
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
const message = getReadableErrorMessage(err);
|
|
547
|
+
setError(message);
|
|
548
|
+
throw error;
|
|
549
|
+
}
|
|
550
|
+
finally {
|
|
551
|
+
setIsLoading(false);
|
|
552
|
+
}
|
|
553
|
+
}, [apolloClient, auth]);
|
|
554
|
+
const signOut = (0, react_1.useCallback)(async () => {
|
|
555
|
+
try {
|
|
556
|
+
await (0, auth_1.signOut)(auth);
|
|
557
|
+
setUser(null);
|
|
558
|
+
setMember(null);
|
|
559
|
+
(0, client_2.clearTokenCache)();
|
|
560
|
+
apolloClient.clearStore();
|
|
561
|
+
}
|
|
562
|
+
catch (err) {
|
|
563
|
+
const message = getReadableErrorMessage(err);
|
|
564
|
+
setError(message);
|
|
565
|
+
throw err;
|
|
566
|
+
}
|
|
567
|
+
}, [auth, apolloClient]);
|
|
568
|
+
const resetPassword = (0, react_1.useCallback)(async (email) => {
|
|
569
|
+
setError(null);
|
|
570
|
+
try {
|
|
571
|
+
await (0, auth_1.sendPasswordResetEmail)(auth, email);
|
|
572
|
+
}
|
|
573
|
+
catch (err) {
|
|
574
|
+
const message = getReadableErrorMessage(err);
|
|
575
|
+
setError(message);
|
|
576
|
+
throw err;
|
|
577
|
+
}
|
|
578
|
+
}, [auth]);
|
|
579
|
+
const refreshMemberData = (0, react_1.useCallback)(async () => {
|
|
580
|
+
if (firebaseUser) {
|
|
581
|
+
lastSyncedUidRef.current = null; // Force re-sync
|
|
582
|
+
await syncMemberData(firebaseUser);
|
|
583
|
+
}
|
|
584
|
+
}, [firebaseUser, syncMemberData]);
|
|
585
|
+
const clearError = (0, react_1.useCallback)(() => {
|
|
586
|
+
setError(null);
|
|
587
|
+
}, []);
|
|
588
|
+
// Build context value
|
|
589
|
+
const authValue = (0, react_1.useMemo)(() => ({
|
|
590
|
+
// State
|
|
591
|
+
user,
|
|
592
|
+
member,
|
|
593
|
+
isAuthenticated: !!user,
|
|
594
|
+
isLoading,
|
|
595
|
+
error,
|
|
596
|
+
// Actions
|
|
597
|
+
signIn,
|
|
598
|
+
signUp,
|
|
599
|
+
signUpPasswordless,
|
|
600
|
+
requestMagicLink,
|
|
601
|
+
verifyMagicLink,
|
|
602
|
+
signInWithGoogle,
|
|
603
|
+
signInWithPasskey,
|
|
604
|
+
signOut,
|
|
605
|
+
resetPassword,
|
|
606
|
+
refreshMemberData,
|
|
607
|
+
clearError,
|
|
608
|
+
}), [
|
|
609
|
+
user,
|
|
610
|
+
member,
|
|
611
|
+
isLoading,
|
|
612
|
+
error,
|
|
613
|
+
signIn,
|
|
614
|
+
signUp,
|
|
615
|
+
signUpPasswordless,
|
|
616
|
+
requestMagicLink,
|
|
617
|
+
verifyMagicLink,
|
|
618
|
+
signInWithGoogle,
|
|
619
|
+
signInWithPasskey,
|
|
620
|
+
signOut,
|
|
621
|
+
resetPassword,
|
|
622
|
+
refreshMemberData,
|
|
623
|
+
clearError,
|
|
624
|
+
]);
|
|
625
|
+
const sdkValue = (0, react_1.useMemo)(() => ({
|
|
626
|
+
config: resolvedConfig,
|
|
627
|
+
firebaseApp,
|
|
628
|
+
auth,
|
|
629
|
+
}), [resolvedConfig, firebaseApp, auth]);
|
|
630
|
+
return ((0, jsx_runtime_1.jsx)(SDKContext.Provider, { value: sdkValue, children: (0, jsx_runtime_1.jsx)(client_1.ApolloProvider, { client: apolloClient, children: (0, jsx_runtime_1.jsx)(I18nProvider_1.I18nProvider, { config: resolvedConfig.i18n, children: (0, jsx_runtime_1.jsx)(CurrencyProvider_1.CurrencyProvider, { config: resolvedConfig.currency, children: (0, jsx_runtime_1.jsx)(AuthContext.Provider, { value: authValue, children: (0, jsx_runtime_1.jsx)(AkinLoyaltyProvider_1.AkinLoyaltyProvider, { children: children }) }) }) }) }) }));
|
|
631
|
+
}
|
|
632
|
+
//# sourceMappingURL=AkinAuthProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AkinAuthProvider.js","sourceRoot":"","sources":["../../src/auth/AkinAuthProvider.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoOb,wBAMC;AAKD,kCAMC;AAsBD,oCA0dC;;AAnuBD,iCASe;AACf,2CAAgD;AAChD,sCAAwE;AACxE,wCAeuB;AAEvB,sCAA0C;AAC1C,sCAAqF;AAErF,wEAAqE;AACrE,uDAAoD;AACpD,mEAAgE;AAEhE,oBAAoB;AACpB,MAAM,gBAAgB,GAAG,IAAA,YAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC3B,CAAC;AAEF,MAAM,oBAAoB,GAAG,IAAA,YAAG,EAAA;;;;;;;;;CAS/B,CAAC;AAEF,MAAM,kBAAkB,GAAG,IAAA,Y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