@onairosofficial/onairos-capacitor 0.1.0 → 0.1.1
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/LICENSE +194 -10
- package/README.md +182 -25
- package/dist/onairos.capacitor.esm.js +1 -0
- package/dist/onairos.capacitor.esm.turbopack.js +1 -0
- package/onairos.d.ts +656 -0
- package/package.json +186 -38
- package/src/OnairosReconnectButton.jsx +272 -0
- package/src/RSA.jsx +57 -0
- package/src/assets/NewLogo.png +0 -0
- package/src/assets/OnairosNewLogo.png +0 -0
- package/src/assets/chatgpt-icon.png +0 -0
- package/src/assets/fire-horse.png +0 -0
- package/src/assets/fire-horse.transparent.png +0 -0
- package/src/assets/latest-firehorse.png +0 -0
- package/src/assets/perplexity.png +0 -0
- package/src/assets/persona.png +0 -0
- package/src/assets/persona1.png +0 -0
- package/src/assets/persona2.png +0 -0
- package/src/assets/persona3.png +0 -0
- package/src/assets/persona4.png +0 -0
- package/src/assets/persona5.png +0 -0
- package/src/capacitorConnectorCatalog.js +38 -0
- package/src/capacitorOAuthConfig.js +52 -0
- package/src/chatgptHostedImport/index.js +303 -0
- package/src/components/AuthButtons.jsx +48 -0
- package/src/components/ConnectChatGPTModal.jsx +666 -0
- package/src/components/ConnectClaudeModal.jsx +610 -0
- package/src/components/ConnectGeminiModal.jsx +639 -0
- package/src/components/ConnectGrokModal.jsx +701 -0
- package/src/components/ConnectPerplexityModal.jsx +726 -0
- package/src/components/DataExplainerScreen.jsx +349 -0
- package/src/components/DataRequest.js +885 -0
- package/src/components/DataRequest.jsx +1055 -0
- package/src/components/EmailAuth.js +1871 -0
- package/src/components/EmailAuth.jsx +2062 -0
- package/src/components/ExtensionInstallPrompt.jsx +142 -0
- package/src/components/GoogleButton.js +133 -0
- package/src/components/LLMConnectorManager.jsx +201 -0
- package/src/components/LoadingPage.jsx +19 -0
- package/src/components/LoadingScreen.jsx +81 -0
- package/src/components/LunarBirthdate.jsx +96 -0
- package/src/components/LunarLoadingPage.jsx +251 -0
- package/src/components/Notification.jsx +21 -0
- package/src/components/OnairosAppButton.jsx +85 -0
- package/src/components/OnairosSSO.jsx +645 -0
- package/src/components/OnairosTrigger.jsx +61 -0
- package/src/components/PerplexityLogo.jsx +43 -0
- package/src/components/PinSetup.js +200 -0
- package/src/components/PinSetup.jsx +228 -0
- package/src/components/SDK_PIN_INTEGRATION_REQUIRED_CHANGES.md +526 -0
- package/src/components/SdkErrorBoundary.jsx +36 -0
- package/src/components/SecuritySetup.js +81 -0
- package/src/components/SessionUserBar.jsx +83 -0
- package/src/components/SignUp.js +123 -0
- package/src/components/TestTelegramButton.js +53 -0
- package/src/components/TrainingComponent.jsx +200 -0
- package/src/components/TrainingScreen.jsx +897 -0
- package/src/components/UniversalOnboarding.js +306 -0
- package/src/components/UniversalOnboarding.jsx +4837 -0
- package/src/components/ValentineLoadingPage.jsx +502 -0
- package/src/components/ValentineModeSelector.jsx +162 -0
- package/src/components/WelcomeScreen.jsx +435 -0
- package/src/components/WrappedLoadingPage.jsx +205 -0
- package/src/components/connectors/ChatGPTConnector.js +348 -0
- package/src/components/connectors/ChatGPTConnector.jsx +348 -0
- package/src/components/connectors/ClaudeConnector.js +44 -0
- package/src/components/connectors/ClaudeConnector.jsx +44 -0
- package/src/components/connectors/GeminiConnector.js +170 -0
- package/src/components/connectors/GeminiConnector.jsx +170 -0
- package/src/components/connectors/GmailConnector.js +148 -0
- package/src/components/connectors/GmailConnector.jsx +148 -0
- package/src/components/connectors/GrokConnector.js +16 -0
- package/src/components/connectors/GrokConnector.jsx +16 -0
- package/src/components/connectors/HingeConnector.js +419 -0
- package/src/components/connectors/HingeConnector.jsx +419 -0
- package/src/components/connectors/InstagramDataConnector.js +726 -0
- package/src/components/connectors/InstagramDataConnector.jsx +726 -0
- package/src/components/connectors/LinkedInConnector.js +4 -0
- package/src/components/connectors/LinkedInConnector.jsx +296 -0
- package/src/components/connectors/PerplexityConnector.jsx +16 -0
- package/src/components/connectors/PinterestConnector.js +208 -0
- package/src/components/connectors/PinterestConnector.jsx +208 -0
- package/src/components/connectors/README.md +292 -0
- package/src/components/connectors/RedditConnector.js +229 -0
- package/src/components/connectors/RedditConnector.jsx +229 -0
- package/src/components/connectors/SephoraConnector.js +482 -0
- package/src/components/connectors/SephoraConnector.jsx +482 -0
- package/src/components/connectors/TikTokConnector.jsx +430 -0
- package/src/components/connectors/YoutubeConnector.js +361 -0
- package/src/components/connectors/YoutubeConnector.jsx +361 -0
- package/src/components/connectors/index.js +50 -0
- package/src/components/icons.jsx +46 -0
- package/src/components/icons.tsx +21 -0
- package/src/components/ui/PageLayout.jsx +1255 -0
- package/src/components/ui/PrimaryButton.jsx +162 -0
- package/src/components/ui/button.jsx +49 -0
- package/src/components/ui/card.jsx +61 -0
- package/src/components/ui/checkbox.jsx +33 -0
- package/src/components/ui/label.jsx +29 -0
- package/src/components/utils/UpdateConnections.js +45 -0
- package/src/components/utils/oauthHelper.js +97 -0
- package/src/config/api-config.js +138 -0
- package/src/deepLink.jsx +38 -0
- package/src/getPin.js +26 -0
- package/src/icons/Avatar.png +0 -0
- package/src/icons/Sentiment.png +0 -0
- package/src/icons/Trait.png +0 -0
- package/src/iframe/DataRequestPage.jsx +285 -0
- package/src/iframe/OnairosButtonIntegration.md +148 -0
- package/src/iframe/components/Box.jsx +56 -0
- package/src/iframe/components/IndividualConnection.jsx +88 -0
- package/src/iframe/dataRequestHandler.js +714 -0
- package/src/iframe/data_request_iframe.html +27 -0
- package/src/iframe/data_request_page.js +47 -0
- package/src/iframe/icons/Avatar.png +1 -0
- package/src/iframe/icons/Avatar2.png +1 -0
- package/src/iframe/icons/Sentiment.png +1 -0
- package/src/iframe/icons/Trait.png +1 -0
- package/src/iframe/icons/onairos_logo.png +0 -0
- package/src/iframe/utils/api.js +57 -0
- package/src/index.js +274 -0
- package/src/laravel/OnairosVue.vue +410 -0
- package/src/laravel/blade-helpers.js +320 -0
- package/src/laravel/vite-plugin.js +179 -0
- package/src/mobile/MobileDataRequestPage.jsx +233 -0
- package/src/mobile/components/MobileBox.jsx +71 -0
- package/src/mobile/components/MobileIndividualConnection.jsx +51 -0
- package/src/mobile/shims/browser-apis.js +78 -0
- package/src/mobile/shims/lucide-shim.js +85 -0
- package/src/newUI/EMAIL_VERIFICATION_API_SCHEMA.md +268 -0
- package/src/newUI/PlatformConnectorsStep.tsx +435 -0
- package/src/newUI/PrimaryButton.tsx +213 -0
- package/src/newUI/SignInStep.tsx +194 -0
- package/src/newUI/VerificationStep.tsx +133 -0
- package/src/newUI/WelcomeScreen.tsx +311 -0
- package/src/newUI/services/connectedAccountsService.js +129 -0
- package/src/onairos.capacitor.jsx +16 -0
- package/src/onairos.core.jsx +133 -0
- package/src/onairos.jsx +14 -0
- package/src/onairos.native.jsx +15 -0
- package/src/onairosButton.jsx +9000 -0
- package/src/overlay/CheckBox.jsx +114 -0
- package/src/overlay/IndividualConnection copy.js +86 -0
- package/src/overlay/IndividualConnection.js +191 -0
- package/src/overlay/IndividualConnectionNew.jsx +157 -0
- package/src/overlay/box.js +84 -0
- package/src/overlay/overlay.js +437 -0
- package/src/styles/onairos-scoped-preflight.css +97 -0
- package/src/styles/sdkCssRegistry.js +20 -0
- package/src/styles/styleLoaderInsertShadow.js +69 -0
- package/src/styles/tailwind.capacitor.css +395 -0
- package/src/styles/tailwind.css +395 -0
- package/src/theme/colors.js +40 -0
- package/src/utils/apiKeyValidation.js +341 -0
- package/src/utils/apiResponseLogger.js +316 -0
- package/src/utils/authHeaders.js +275 -0
- package/src/utils/biometrics.js +26 -0
- package/src/utils/bookmarkletUtils.js +28 -0
- package/src/utils/capacitorDetection.js +278 -0
- package/src/utils/capacitorLLMHelper.js +352 -0
- package/src/utils/capacitorPlugins.js +366 -0
- package/src/utils/crossDomainSSO.js +587 -0
- package/src/utils/deepLinking.js +27 -0
- package/src/utils/devLogger.js +46 -0
- package/src/utils/extensionDetection.js +418 -0
- package/src/utils/extractMemory.js +277 -0
- package/src/utils/framerBrandingOverrides.js +40 -0
- package/src/utils/googleWebClientId.js +55 -0
- package/src/utils/overlayHandler.js +224 -0
- package/src/utils/platformDisconnect.js +309 -0
- package/src/utils/pollTrainingStatus.js +200 -0
- package/src/utils/rawMemoriesAccess.js +211 -0
- package/src/utils/resolveBackendAppId.js +47 -0
- package/src/utils/responseFormatter.js +140 -0
- package/src/utils/sdkDebugStorage.js +113 -0
- package/src/utils/sdkInitialization.js +645 -0
- package/src/utils/sessionManager.js +1258 -0
- package/src/utils/startBackgroundTraining.js +100 -0
- package/src/utils/userDataFormatter.js +222 -0
- package/index.d.ts +0 -1
- package/index.js +0 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Poll `training.statusUrl` until training reports ready (cross-SDK parity with React Native).
|
|
3
|
+
* @see docs/CROSS_SDK_PARITY.md §5
|
|
4
|
+
*
|
|
5
|
+
* Backend contract: GET with `Authorization: Bearer <token>` until
|
|
6
|
+
* `trainingStatus.isCurrentlyTraining` is false (then host POSTs `apiUrl`). Respect
|
|
7
|
+
* `polling.recommendedIntervalMs` from each JSON response, falling back to `pollIntervalMs`.
|
|
8
|
+
* On HTTP 429, honor `Retry-After` and JSON `retryAfter` / `recommendedIntervalMs` when present.
|
|
9
|
+
*
|
|
10
|
+
* @param {object} opts
|
|
11
|
+
* @param {string} opts.statusUrl
|
|
12
|
+
* @param {string} opts.token Bearer token (same as apiUrl fetch)
|
|
13
|
+
* @param {number} [opts.pollIntervalMs=5000]
|
|
14
|
+
* @returns {Promise<{ ready: boolean, neverTrained?: boolean, lastPayload?: any }>}
|
|
15
|
+
*/
|
|
16
|
+
export async function pollTrainingStatus({ statusUrl, token, pollIntervalMs = 5000 }) {
|
|
17
|
+
const maxAttempts = 60;
|
|
18
|
+
let attempts = 0;
|
|
19
|
+
let intervalMs = normalizePollInterval(pollIntervalMs);
|
|
20
|
+
|
|
21
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
22
|
+
|
|
23
|
+
while (attempts < maxAttempts) {
|
|
24
|
+
attempts += 1;
|
|
25
|
+
try {
|
|
26
|
+
const res = await fetch(statusUrl, {
|
|
27
|
+
method: 'GET',
|
|
28
|
+
headers: {
|
|
29
|
+
Authorization: `Bearer ${token}`,
|
|
30
|
+
'Content-Type': 'application/json',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (res.status === 429) {
|
|
35
|
+
const body = await res.json().catch(() => ({}));
|
|
36
|
+
const waitMs = parseRateLimitBackoffMs(res, body, intervalMs * 2);
|
|
37
|
+
await sleep(waitMs);
|
|
38
|
+
attempts -= 1;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!res.ok) {
|
|
43
|
+
try {
|
|
44
|
+
console.warn('[pollTrainingStatus] non-OK response', res.status);
|
|
45
|
+
} catch (_) {}
|
|
46
|
+
await sleep(intervalMs);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const data = await res.json().catch(() => ({}));
|
|
51
|
+
intervalMs = pickNextIntervalMs(data, intervalMs, pollIntervalMs);
|
|
52
|
+
|
|
53
|
+
if (isTrainingResponseReady(data)) {
|
|
54
|
+
return {
|
|
55
|
+
ready: true,
|
|
56
|
+
regenerationInFlight: data.regenerationInFlight === true,
|
|
57
|
+
traitsComplete: data.traitsComplete,
|
|
58
|
+
lastPayload: data
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (isTrainingResponseNeverStarted(data)) {
|
|
62
|
+
return { ready: false, neverTrained: true, lastPayload: data };
|
|
63
|
+
}
|
|
64
|
+
await sleep(intervalMs);
|
|
65
|
+
} catch (e) {
|
|
66
|
+
try {
|
|
67
|
+
console.warn('[pollTrainingStatus] request error', e?.message || e);
|
|
68
|
+
} catch (_) {}
|
|
69
|
+
await sleep(intervalMs);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return { ready: false, neverTrained: true };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Normalize `training` from getAPIurlMobile-style resolution payloads.
|
|
78
|
+
* Missing / ambiguous training → `{ ready: true }` so legacy backends do not block.
|
|
79
|
+
*/
|
|
80
|
+
export function normalizeTrainingFromResolution(training) {
|
|
81
|
+
if (training == null) return { ready: true };
|
|
82
|
+
if (typeof training !== 'object') return { ready: true };
|
|
83
|
+
|
|
84
|
+
const statusUrl = training.statusUrl || training.status_url || null;
|
|
85
|
+
const pollIntervalMs = Number(training.pollIntervalMs ?? training.poll_interval_ms ?? 5000) || 5000;
|
|
86
|
+
|
|
87
|
+
if (training.ready === true || training.status === 'complete' || training.status === 'ready') {
|
|
88
|
+
return { ready: true, statusUrl: statusUrl || undefined, pollIntervalMs };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (training.ready === false && typeof statusUrl === 'string' && statusUrl.length > 0) {
|
|
92
|
+
return {
|
|
93
|
+
ready: false,
|
|
94
|
+
statusUrl,
|
|
95
|
+
pollIntervalMs,
|
|
96
|
+
neverTrained: training.neverTrained === true,
|
|
97
|
+
regenerationInFlight: training.regenerationInFlight === true,
|
|
98
|
+
traitsComplete: training.traitsComplete,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return { ready: true, statusUrl: statusUrl || undefined, pollIntervalMs };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** @param {Response} res */
|
|
106
|
+
function parseRateLimitBackoffMs(res, body, fallbackMs) {
|
|
107
|
+
const safeFallback = Math.max(500, fallbackMs || 5000);
|
|
108
|
+
try {
|
|
109
|
+
const h = res.headers?.get?.('Retry-After');
|
|
110
|
+
if (h != null && h !== '') {
|
|
111
|
+
const asNum = parseInt(h, 10);
|
|
112
|
+
if (!Number.isNaN(asNum) && asNum >= 0) {
|
|
113
|
+
return Math.max(asNum * 1000, safeFallback);
|
|
114
|
+
}
|
|
115
|
+
const asDate = Date.parse(h);
|
|
116
|
+
if (!Number.isNaN(asDate)) {
|
|
117
|
+
return Math.max(asDate - Date.now(), safeFallback);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} catch (_) {}
|
|
121
|
+
|
|
122
|
+
const ra = body?.retryAfter;
|
|
123
|
+
if (typeof ra === 'number' && ra >= 0) {
|
|
124
|
+
return Math.max(ra * 1000, safeFallback);
|
|
125
|
+
}
|
|
126
|
+
const rim = body?.recommendedIntervalMs;
|
|
127
|
+
if (typeof rim === 'number' && rim >= 0) {
|
|
128
|
+
return Math.max(rim, safeFallback);
|
|
129
|
+
}
|
|
130
|
+
return safeFallback;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function pickNextIntervalMs(data, currentIntervalMs, initialPollIntervalMs) {
|
|
134
|
+
const fromPoll = data?.polling?.recommendedIntervalMs;
|
|
135
|
+
if (typeof fromPoll === 'number' && fromPoll >= 50) {
|
|
136
|
+
return normalizePollInterval(fromPoll);
|
|
137
|
+
}
|
|
138
|
+
return normalizePollInterval(currentIntervalMs || initialPollIntervalMs);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function normalizePollInterval(ms) {
|
|
142
|
+
const n = Number(ms) || 5000;
|
|
143
|
+
return Math.min(120000, Math.max(50, n));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isTrainingResponseReady(data) {
|
|
147
|
+
if (!data || typeof data !== 'object') return false;
|
|
148
|
+
const ts = data.trainingStatus;
|
|
149
|
+
const history = data.trainingHistory;
|
|
150
|
+
|
|
151
|
+
// Canonical handoff: backend success + not actively training → POST apiUrl
|
|
152
|
+
if (data.success !== false && ts && ts.isCurrentlyTraining === false) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (data.ready === true) return true;
|
|
157
|
+
if (data.regenerationInFlight === false && data.traitsComplete === true) return true;
|
|
158
|
+
if (data.status === 'complete' || data.status === 'ready') return true;
|
|
159
|
+
if (data.trainingComplete === true) return true;
|
|
160
|
+
if (data.isCurrentlyTraining === false && (data.traitsReady === true || data.personalityReady === true)) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const hasTrainingHistory =
|
|
165
|
+
ts?.lastTrainingDate != null ||
|
|
166
|
+
((history?.totalSessions ?? 0) > 0) ||
|
|
167
|
+
history?.lastCompletedTraining != null ||
|
|
168
|
+
data.lastTrainingDate != null;
|
|
169
|
+
|
|
170
|
+
if (ts?.isCurrentlyTraining === false && hasTrainingHistory) return true;
|
|
171
|
+
if (data.isCurrentlyTraining === false && data.lastTrainingDate != null) return true;
|
|
172
|
+
|
|
173
|
+
const flatStatus = data.trainingStatus || data.trainingHistory;
|
|
174
|
+
if (typeof flatStatus === 'string' && /complete|ready|done/i.test(flatStatus)) return true;
|
|
175
|
+
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function isTrainingResponseNeverStarted(data) {
|
|
180
|
+
if (!data || typeof data !== 'object') return false;
|
|
181
|
+
|
|
182
|
+
const ts = data.trainingStatus;
|
|
183
|
+
const history = data.trainingHistory;
|
|
184
|
+
const hasTrainingHistory =
|
|
185
|
+
ts?.lastTrainingDate != null ||
|
|
186
|
+
((history?.totalSessions ?? 0) > 0) ||
|
|
187
|
+
history?.lastCompletedTraining != null ||
|
|
188
|
+
data.lastTrainingDate != null;
|
|
189
|
+
|
|
190
|
+
// If we have explicit trainingStatus, canonical "ready" path above handles isCurrentlyTraining === false
|
|
191
|
+
if (ts && typeof ts.isCurrentlyTraining === 'boolean') {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
(ts?.isCurrentlyTraining === false || data.isCurrentlyTraining === false) &&
|
|
197
|
+
!hasTrainingHistory &&
|
|
198
|
+
!data.activeProcess
|
|
199
|
+
);
|
|
200
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raw memories access helpers (UX + defense in depth).
|
|
3
|
+
* Security is enforced on the backend via handoff `authorizedData.rawMemories`
|
|
4
|
+
* and API guards — not via optional policy prefetch.
|
|
5
|
+
*
|
|
6
|
+
* @see docs/RAW_MEMORIES_SDK_UPDATE.md
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Connectors that exist primarily for raw export to partner apps. */
|
|
10
|
+
export const RAW_MEMORY_CONNECTOR_KEYS = new Set([
|
|
11
|
+
'chatgpt',
|
|
12
|
+
'claude',
|
|
13
|
+
'gemini',
|
|
14
|
+
'grok',
|
|
15
|
+
'perplexity',
|
|
16
|
+
'netflix',
|
|
17
|
+
'spotify',
|
|
18
|
+
'sephora',
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
export const LLM_RAW_MEMORY_CONNECTOR_KEYS = new Set([
|
|
22
|
+
'chatgpt',
|
|
23
|
+
'claude',
|
|
24
|
+
'gemini',
|
|
25
|
+
'grok',
|
|
26
|
+
'perplexity',
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Normalize handoff `authorizedData` (supports legacy `llmData` alias).
|
|
31
|
+
* @param {object|null|undefined} authorizedData
|
|
32
|
+
* @returns {object|null}
|
|
33
|
+
*/
|
|
34
|
+
export function normalizeAuthorizedData(authorizedData) {
|
|
35
|
+
if (authorizedData == null || typeof authorizedData !== 'object') {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const hasExplicitRaw = Object.prototype.hasOwnProperty.call(authorizedData, 'rawMemories');
|
|
39
|
+
const rawMemories =
|
|
40
|
+
authorizedData.rawMemories === true ||
|
|
41
|
+
authorizedData.rawMemories === 'true' ||
|
|
42
|
+
(!hasExplicitRaw && (authorizedData.llmData === true || authorizedData.llmData === 'true'));
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
...authorizedData,
|
|
46
|
+
rawMemories: !!rawMemories,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {object|null|undefined} authorizedData
|
|
52
|
+
* @returns {boolean}
|
|
53
|
+
*/
|
|
54
|
+
export function isRawMemoriesAuthorized(authorizedData) {
|
|
55
|
+
const normalized = normalizeAuthorizedData(authorizedData);
|
|
56
|
+
return normalized?.rawMemories === true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Parse `rawMemoriesPolicy` from getAPIurlMobile-style payloads.
|
|
61
|
+
* @param {object|null|undefined} handoffPayload
|
|
62
|
+
* @returns {{ offered: boolean, code?: string, connectorPlatforms?: string[] }|null}
|
|
63
|
+
*/
|
|
64
|
+
export function parseRawMemoriesPolicy(handoffPayload) {
|
|
65
|
+
if (!handoffPayload || typeof handoffPayload !== 'object') return null;
|
|
66
|
+
const policy =
|
|
67
|
+
handoffPayload.rawMemoriesPolicy ||
|
|
68
|
+
handoffPayload.raw_memories_policy ||
|
|
69
|
+
null;
|
|
70
|
+
if (!policy || typeof policy !== 'object') return null;
|
|
71
|
+
|
|
72
|
+
const offered =
|
|
73
|
+
policy.offered === true ||
|
|
74
|
+
policy.offered === 'true' ||
|
|
75
|
+
(policy.rawMemoriesAvailable === true && policy.offered !== false);
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
offered: !!offered,
|
|
79
|
+
code: policy.code || policy.reason || undefined,
|
|
80
|
+
connectorPlatforms: Array.isArray(policy.connectorPlatforms)
|
|
81
|
+
? policy.connectorPlatforms
|
|
82
|
+
: Array.isArray(policy.connector_platforms)
|
|
83
|
+
? policy.connector_platforms
|
|
84
|
+
: undefined,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Whether the SDK should offer raw-memories UI (consent row, LLM-only onboarding).
|
|
90
|
+
* `null` = unknown (legacy: follow developer props only).
|
|
91
|
+
*
|
|
92
|
+
* @param {{ policyPrefetch?: { rawMemoriesAvailable?: boolean }|null, handoffPolicy?: ReturnType<typeof parseRawMemoriesPolicy> }} opts
|
|
93
|
+
* @returns {boolean|null}
|
|
94
|
+
*/
|
|
95
|
+
export function resolveRawMemoriesOfferedForUi({ policyPrefetch = null, handoffPolicy = null } = {}) {
|
|
96
|
+
if (handoffPolicy && typeof handoffPolicy.offered === 'boolean') {
|
|
97
|
+
return handoffPolicy.offered;
|
|
98
|
+
}
|
|
99
|
+
if (
|
|
100
|
+
policyPrefetch &&
|
|
101
|
+
typeof policyPrefetch.rawMemoriesAvailable === 'boolean'
|
|
102
|
+
) {
|
|
103
|
+
return policyPrefetch.rawMemoriesAvailable;
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Optional UI-only policy prefetch (never used as the security gate).
|
|
110
|
+
* @param {{ baseUrl: string, apiKey: string, appId?: string|null }} opts
|
|
111
|
+
* @returns {Promise<{ rawMemoriesAvailable: boolean, code?: string, connectorPlatforms?: string[] }|null>}
|
|
112
|
+
*/
|
|
113
|
+
export async function fetchRawMemoriesPolicyForUiOptional({ baseUrl, apiKey, appId = null }) {
|
|
114
|
+
if (!baseUrl || !apiKey) return null;
|
|
115
|
+
const root = String(baseUrl).replace(/\/$/, '');
|
|
116
|
+
const url = `${root}/api/raw-memories/policy`;
|
|
117
|
+
try {
|
|
118
|
+
const res = await fetch(url, {
|
|
119
|
+
method: 'GET',
|
|
120
|
+
headers: {
|
|
121
|
+
'x-api-key': apiKey,
|
|
122
|
+
...(appId ? { 'x-onairos-app-id': appId } : {}),
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
if (!res.ok) return null;
|
|
126
|
+
const body = await res.json().catch(() => ({}));
|
|
127
|
+
if (typeof body.rawMemoriesAvailable !== 'boolean') return null;
|
|
128
|
+
return {
|
|
129
|
+
rawMemoriesAvailable: body.rawMemoriesAvailable,
|
|
130
|
+
code: body.code,
|
|
131
|
+
connectorPlatforms: body.connectorPlatforms,
|
|
132
|
+
};
|
|
133
|
+
} catch (_) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Inference / combined fetch body flag — server handoff is authoritative.
|
|
140
|
+
* @param {object|null|undefined} authorizedData
|
|
141
|
+
* @returns {boolean}
|
|
142
|
+
*/
|
|
143
|
+
export function shouldSendIncludeLlmData(authorizedData) {
|
|
144
|
+
return isRawMemoriesAuthorized(authorizedData);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Whether to call `/llm-data/history` or filtered-conversation endpoints.
|
|
149
|
+
* @param {object|null|undefined} authorizedData
|
|
150
|
+
* @returns {boolean}
|
|
151
|
+
*/
|
|
152
|
+
export function shouldFetchLlmHistory(authorizedData) {
|
|
153
|
+
return isRawMemoriesAuthorized(authorizedData);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @param {string[]} approved
|
|
158
|
+
* @returns {string[]}
|
|
159
|
+
*/
|
|
160
|
+
export function stripRawMemoriesFromApproved(approved) {
|
|
161
|
+
if (!Array.isArray(approved)) return [];
|
|
162
|
+
return approved.filter((id) => String(id).toLowerCase() !== 'rawmemories');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Host asked for raw-memories *export* UX (not the same as personality/preferences only).
|
|
167
|
+
* @param {{ rawMemoriesOnly?: boolean, rawMemoriesConfig?: object|null, requestData?: unknown }} opts
|
|
168
|
+
* @returns {boolean}
|
|
169
|
+
*/
|
|
170
|
+
export function developerRequestedRawMemoriesExport({
|
|
171
|
+
rawMemoriesOnly = false,
|
|
172
|
+
rawMemoriesConfig = null,
|
|
173
|
+
requestData = null,
|
|
174
|
+
} = {}) {
|
|
175
|
+
if (rawMemoriesOnly) return true;
|
|
176
|
+
if (rawMemoriesConfig != null) return true;
|
|
177
|
+
if (Array.isArray(requestData)) {
|
|
178
|
+
return requestData.some((x) => String(x).toLowerCase() === 'rawmemories');
|
|
179
|
+
}
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Remove raw-export connectors from onboarding only when the host wanted raw export
|
|
185
|
+
* but the app is not approved (`rawMemoriesOffered === false`).
|
|
186
|
+
* Personality/preferences flows keep ChatGPT etc. for server-side training.
|
|
187
|
+
*
|
|
188
|
+
* @param {Array<{ connector?: string, name?: string }>} platforms
|
|
189
|
+
* @param {boolean|null} rawMemoriesOffered
|
|
190
|
+
* @param {{ rawMemoriesOnly?: boolean, rawMemoriesConfig?: object|null, requestData?: unknown }} [devProps]
|
|
191
|
+
* @returns {typeof platforms}
|
|
192
|
+
*/
|
|
193
|
+
export function filterPlatformsForRawExport(platforms, rawMemoriesOffered, devProps = {}) {
|
|
194
|
+
if (rawMemoriesOffered !== false || !Array.isArray(platforms)) return platforms;
|
|
195
|
+
if (!developerRequestedRawMemoriesExport(devProps)) return platforms;
|
|
196
|
+
return platforms.filter((p) => {
|
|
197
|
+
const key = String(p?.connector || p?.name || '').trim().toLowerCase();
|
|
198
|
+
return !RAW_MEMORY_CONNECTOR_KEYS.has(key);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Read `traitIntent` from handoff only (no `/api/trait-intents/resolve`).
|
|
204
|
+
* @param {object|null|undefined} handoffPayload
|
|
205
|
+
* @returns {object|null}
|
|
206
|
+
*/
|
|
207
|
+
export function readTraitIntentFromHandoff(handoffPayload) {
|
|
208
|
+
if (!handoffPayload || typeof handoffPayload !== 'object') return null;
|
|
209
|
+
const intent = handoffPayload.traitIntent ?? handoffPayload.trait_intent ?? null;
|
|
210
|
+
return intent && typeof intent === 'object' ? intent : null;
|
|
211
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve backend app id for handoff / training (module scope — avoids TDZ under obfuscation).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function decodeJwtPayloadSafe(token) {
|
|
6
|
+
try {
|
|
7
|
+
if (!token || typeof token !== 'string') return null;
|
|
8
|
+
const base64 = token.split('.')[1];
|
|
9
|
+
if (!base64) return null;
|
|
10
|
+
|
|
11
|
+
const b64 = base64.replace(/-/g, '+').replace(/_/g, '/');
|
|
12
|
+
const padded = b64 + '='.repeat((4 - (b64.length % 4)) % 4);
|
|
13
|
+
|
|
14
|
+
const json = decodeURIComponent(
|
|
15
|
+
atob(padded)
|
|
16
|
+
.split('')
|
|
17
|
+
.map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))
|
|
18
|
+
.join('')
|
|
19
|
+
);
|
|
20
|
+
const payload = JSON.parse(json);
|
|
21
|
+
return payload && typeof payload === 'object' ? payload : null;
|
|
22
|
+
} catch (_) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param {{ fallbackName?: string|null, token?: string|null }} opts
|
|
29
|
+
* @returns {string|null}
|
|
30
|
+
*/
|
|
31
|
+
export function resolveBackendAppId({ fallbackName, token } = {}) {
|
|
32
|
+
try {
|
|
33
|
+
const explicit =
|
|
34
|
+
(typeof window !== 'undefined' && window.onairosAppId) ||
|
|
35
|
+
(typeof window !== 'undefined' && window.onairosBackendAppId) ||
|
|
36
|
+
null;
|
|
37
|
+
if (explicit && typeof explicit === 'string') return explicit;
|
|
38
|
+
|
|
39
|
+
const payload = decodeJwtPayloadSafe(token);
|
|
40
|
+
const fromToken = payload?.appId || payload?.appID || payload?.app_id || null;
|
|
41
|
+
if (fromToken && typeof fromToken === 'string') return fromToken;
|
|
42
|
+
|
|
43
|
+
return fallbackName || null;
|
|
44
|
+
} catch (_) {
|
|
45
|
+
return fallbackName || null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response formatter utility for Onairos SDK
|
|
3
|
+
* Converts array-based responses to dictionary format for better developer experience
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Standard 16 personality types in order that the API returns them
|
|
7
|
+
export const PERSONALITY_TYPES = [
|
|
8
|
+
'Analyst',
|
|
9
|
+
'Diplomat',
|
|
10
|
+
'Sentinel',
|
|
11
|
+
'Explorer',
|
|
12
|
+
'Architect',
|
|
13
|
+
'Logician',
|
|
14
|
+
'Commander',
|
|
15
|
+
'Debater',
|
|
16
|
+
'Advocate',
|
|
17
|
+
'Mediator',
|
|
18
|
+
'Protagonist',
|
|
19
|
+
'Campaigner',
|
|
20
|
+
'Logistician',
|
|
21
|
+
'Defender',
|
|
22
|
+
'Executive',
|
|
23
|
+
'Consul'
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
// Standard trait categories that might be returned
|
|
27
|
+
export const TRAIT_CATEGORIES = [
|
|
28
|
+
'Openness',
|
|
29
|
+
'Conscientiousness',
|
|
30
|
+
'Extraversion',
|
|
31
|
+
'Agreeableness',
|
|
32
|
+
'Neuroticism'
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Formats API response to include both array and dictionary formats
|
|
37
|
+
* @param {Object} apiResponse - Raw API response from Onairos
|
|
38
|
+
* @param {Object} options - Formatting options
|
|
39
|
+
* @param {boolean} options.includeDictionary - Whether to include dictionary format (default: true)
|
|
40
|
+
* @param {boolean} options.includeArray - Whether to include original array format (default: true)
|
|
41
|
+
* @returns {Object} Formatted response with both formats
|
|
42
|
+
*/
|
|
43
|
+
export function formatOnairosResponse(apiResponse, options = {}) {
|
|
44
|
+
const { includeDictionary = true, includeArray = true } = options;
|
|
45
|
+
|
|
46
|
+
if (!apiResponse) {
|
|
47
|
+
return apiResponse;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const formatted = { ...apiResponse };
|
|
51
|
+
|
|
52
|
+
// Handle personality scores if present
|
|
53
|
+
if (apiResponse.InferenceResult?.traits || apiResponse.traits || apiResponse.scores) {
|
|
54
|
+
const scores = apiResponse.InferenceResult?.traits || apiResponse.traits || apiResponse.scores;
|
|
55
|
+
|
|
56
|
+
if (Array.isArray(scores) && scores.length >= 16) {
|
|
57
|
+
if (includeDictionary) {
|
|
58
|
+
// Create personality dictionary
|
|
59
|
+
const personalityDict = {};
|
|
60
|
+
PERSONALITY_TYPES.forEach((type, index) => {
|
|
61
|
+
personalityDict[type] = scores[index];
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Add to formatted response
|
|
65
|
+
if (formatted.InferenceResult) {
|
|
66
|
+
formatted.InferenceResult.personalityDict = personalityDict;
|
|
67
|
+
} else {
|
|
68
|
+
formatted.personalityDict = personalityDict;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!includeArray) {
|
|
73
|
+
// Remove array format if not requested
|
|
74
|
+
if (formatted.InferenceResult?.traits) {
|
|
75
|
+
delete formatted.InferenceResult.traits;
|
|
76
|
+
}
|
|
77
|
+
if (formatted.traits) {
|
|
78
|
+
delete formatted.traits;
|
|
79
|
+
}
|
|
80
|
+
if (formatted.scores) {
|
|
81
|
+
delete formatted.scores;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Handle trait data if present (for preferences/traits)
|
|
88
|
+
if (apiResponse.traitResult || apiResponse.traits) {
|
|
89
|
+
const traits = apiResponse.traitResult || apiResponse.traits;
|
|
90
|
+
|
|
91
|
+
if (Array.isArray(traits) && includeDictionary) {
|
|
92
|
+
const traitDict = {};
|
|
93
|
+
TRAIT_CATEGORIES.forEach((category, index) => {
|
|
94
|
+
if (traits[index] !== undefined) {
|
|
95
|
+
traitDict[category] = traits[index];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
formatted.traitDict = traitDict;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return formatted;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Legacy formatter for backward compatibility
|
|
108
|
+
* Converts scores array to personality dictionary only
|
|
109
|
+
* @param {Array} scores - Array of personality scores
|
|
110
|
+
* @returns {Object} Dictionary with personality type names as keys
|
|
111
|
+
*/
|
|
112
|
+
export function formatPersonalityScores(scores) {
|
|
113
|
+
if (!Array.isArray(scores) || scores.length < 16) {
|
|
114
|
+
console.warn('Invalid scores array provided to formatPersonalityScores');
|
|
115
|
+
return {};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const personalityDict = {};
|
|
119
|
+
PERSONALITY_TYPES.forEach((type, index) => {
|
|
120
|
+
personalityDict[type] = scores[index];
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
return personalityDict;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get personality type names in order
|
|
128
|
+
* @returns {Array} Array of personality type names
|
|
129
|
+
*/
|
|
130
|
+
export function getPersonalityTypes() {
|
|
131
|
+
return [...PERSONALITY_TYPES];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Get trait category names in order
|
|
136
|
+
* @returns {Array} Array of trait category names
|
|
137
|
+
*/
|
|
138
|
+
export function getTraitCategories() {
|
|
139
|
+
return [...TRAIT_CATEGORIES];
|
|
140
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight SDK debug metadata persisted in localStorage for field diagnostics.
|
|
3
|
+
* Keeps a compact meta object plus a small ring buffer of recent events.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const META_KEY = 'onairos_sdk_meta';
|
|
7
|
+
const RING_KEY = 'onairos_debug_ring';
|
|
8
|
+
const MAX_RING = 24;
|
|
9
|
+
|
|
10
|
+
// Injected at build time via webpack DefinePlugin; falls back for local dev.
|
|
11
|
+
// eslint-disable-next-line no-undef
|
|
12
|
+
export const SDK_VERSION = typeof __ONAIROS_SDK_VERSION__ !== 'undefined' ? __ONAIROS_SDK_VERSION__ : 'dev';
|
|
13
|
+
// eslint-disable-next-line no-undef
|
|
14
|
+
export const SDK_BUILD_TIME = typeof __ONAIROS_SDK_BUILD_TIME__ !== 'undefined' ? __ONAIROS_SDK_BUILD_TIME__ : null;
|
|
15
|
+
|
|
16
|
+
function readJson(key, fallback) {
|
|
17
|
+
try {
|
|
18
|
+
if (typeof localStorage === 'undefined') return fallback;
|
|
19
|
+
const raw = localStorage.getItem(key);
|
|
20
|
+
if (!raw) return fallback;
|
|
21
|
+
return JSON.parse(raw);
|
|
22
|
+
} catch {
|
|
23
|
+
return fallback;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function writeJson(key, value) {
|
|
28
|
+
try {
|
|
29
|
+
if (typeof localStorage === 'undefined') return false;
|
|
30
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
31
|
+
return true;
|
|
32
|
+
} catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function maskEmail(email) {
|
|
38
|
+
if (!email || typeof email !== 'string') return null;
|
|
39
|
+
const trimmed = email.trim();
|
|
40
|
+
const at = trimmed.indexOf('@');
|
|
41
|
+
if (at <= 0) return null;
|
|
42
|
+
return `${trimmed.charAt(0)}***${trimmed.slice(at)}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function compactDetail(detail) {
|
|
46
|
+
if (!detail || typeof detail !== 'object') return {};
|
|
47
|
+
const out = {};
|
|
48
|
+
for (const [key, value] of Object.entries(detail)) {
|
|
49
|
+
if (key === 'stack') continue;
|
|
50
|
+
if (value == null) {
|
|
51
|
+
out[key] = value;
|
|
52
|
+
} else if (typeof value === 'string') {
|
|
53
|
+
out[key] = value.length > 96 ? `${value.slice(0, 93)}...` : value;
|
|
54
|
+
} else if (typeof value === 'number' || typeof value === 'boolean') {
|
|
55
|
+
out[key] = value;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function pushSdkDebugEvent(tag, detail = {}) {
|
|
62
|
+
try {
|
|
63
|
+
const entry = {
|
|
64
|
+
t: Date.now(),
|
|
65
|
+
tag: String(tag || '').slice(0, 48),
|
|
66
|
+
...compactDetail(detail),
|
|
67
|
+
};
|
|
68
|
+
const ring = readJson(RING_KEY, []);
|
|
69
|
+
ring.push(entry);
|
|
70
|
+
while (ring.length > MAX_RING) ring.shift();
|
|
71
|
+
writeJson(RING_KEY, ring);
|
|
72
|
+
} catch (_) {}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function persistSdkDebugMeta(partial = {}) {
|
|
76
|
+
try {
|
|
77
|
+
const prev = readJson(META_KEY, {});
|
|
78
|
+
const next = {
|
|
79
|
+
version: SDK_VERSION,
|
|
80
|
+
buildTime: SDK_BUILD_TIME,
|
|
81
|
+
updatedAt: new Date().toISOString(),
|
|
82
|
+
...prev,
|
|
83
|
+
...partial,
|
|
84
|
+
};
|
|
85
|
+
writeJson(META_KEY, next);
|
|
86
|
+
if (typeof window !== 'undefined') {
|
|
87
|
+
window.__ONAIROS_SDK_DEBUG__ = next;
|
|
88
|
+
}
|
|
89
|
+
return next;
|
|
90
|
+
} catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function getSdkDebugMeta() {
|
|
96
|
+
const meta = readJson(META_KEY, null);
|
|
97
|
+
if (meta) return meta;
|
|
98
|
+
return persistSdkDebugMeta();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function getSdkDebugRing() {
|
|
102
|
+
return readJson(RING_KEY, []);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export default {
|
|
106
|
+
SDK_VERSION,
|
|
107
|
+
SDK_BUILD_TIME,
|
|
108
|
+
maskEmail,
|
|
109
|
+
pushSdkDebugEvent,
|
|
110
|
+
persistSdkDebugMeta,
|
|
111
|
+
getSdkDebugMeta,
|
|
112
|
+
getSdkDebugRing,
|
|
113
|
+
};
|