@veryai/widget 1.0.19 → 1.0.21
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/build/index.js +52 -33
- package/build/index.js.map +1 -1
- package/build/index.mjs +52 -33
- package/build/index.mjs.map +1 -1
- package/package.json +15 -14
- package/LICENSE +0 -190
package/build/index.js
CHANGED
|
@@ -59,13 +59,14 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// src/styles/styles.css
|
|
62
|
-
styleInject(".default {\n --very-brand-color: #
|
|
62
|
+
styleInject(".default {\n --very-brand-color: #1f3765;\n --very-bg-color: #000;\n --very-primary: #fafbff;\n --very-secondary: rgba(255, 255, 255, 0.6);\n --very-tertiary: rgba(255, 255, 255, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #fafbff;\n --very-button-text: #1f3765;\n --very-border: #b0c6d4;\n}\n.dark {\n --very-brand-color: #1f3765;\n --very-bg-color: #000;\n --very-primary: #fafbff;\n --very-secondary: rgba(255, 255, 255, 0.6);\n --very-tertiary: rgba(255, 255, 255, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #fafbff;\n --very-button-text: #1f3765;\n --very-border: #b0c6d4;\n}\n.light {\n --very-brand-color: #1f3765;\n --very-bg-color: #fafbff;\n --very-primary: #1c2125;\n --very-secondary: rgba(0, 0, 0, 0.6);\n --very-tertiary: rgba(0, 0, 0, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #1f3765;\n --very-button-text: #fafbff;\n --very-border: #1f3765;\n}\n.very-dialog-overlay {\n backdrop-filter: blur(4px);\n background-color: rgba(0, 0, 0, 0.5);\n inset: 0;\n position: fixed;\n z-index: 40;\n}\n.very-processing {\n backdrop-filter: blur(4px);\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-size: 16px;\n font-weight: 500;\n color: var(--very-primary);\n}\n.very-widget {\n align-items: center;\n background-color: var(--very-bg-color);\n border-radius: 20px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n color: var(--very-primary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 16px;\n left: 50%;\n max-width: 440px;\n position: fixed;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 90vw;\n z-index: 50;\n .very-content {\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n padding: 40px 32px 24px;\n }\n .very-center {\n position: relative;\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n gap: 8px;\n }\n .title {\n color: var(--very-primary);\n font-size: 28px;\n font-style: normal;\n font-weight: 600;\n letter-spacing: -0.5px;\n line-height: 120%;\n margin-top: 20px;\n text-align: center;\n }\n .tip {\n color: var(--very-secondary);\n font-size: 16px;\n font-style: normal;\n letter-spacing: -0.192px;\n line-height: 144%;\n margin-bottom: 24px;\n margin-top: 8px;\n text-align: center;\n }\n}\n.very-close {\n cursor: pointer;\n padding: 12px;\n position: absolute;\n right: 16px;\n top: 16px;\n opacity: 0.6;\n transition: opacity 0.15s ease;\n}\n.very-close:hover {\n opacity: 1;\n}\n.very-footer {\n align-items: center;\n color: var(--very-secondary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n gap: 6px;\n padding: 0 32px 28px;\n width: 100%;\n}\n.very-footer-logo {\n align-items: center;\n display: flex;\n gap: 6px;\n}\n.very-footer-brand {\n height: 14px;\n width: auto;\n}\n.light .very-footer-brand {\n content: url(https://assets.very.org/branding/logo-dark.svg);\n}\n.very-footer-links {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.very-footer-sep {\n color: var(--very-tertiary);\n font-size: 13px;\n}\n.very-terms {\n cursor: pointer;\n font-size: 13px;\n color: var(--very-tertiary);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.very-try-again {\n align-items: center;\n background-color: var(--very-button-bg);\n border: none;\n border-radius: 12px;\n color: var(--very-button-text);\n cursor: pointer;\n display: flex;\n font-size: 16px;\n font-weight: 600;\n gap: 12px;\n height: 56px;\n justify-content: center;\n margin-top: 24px;\n padding: 16px 28px;\n width: 100%;\n transition: opacity 0.15s ease;\n}\n.very-try-again:hover {\n opacity: 0.9;\n}\n.error {\n color: var(--very-primary);\n font-size: 28px;\n font-style: normal;\n font-weight: 600;\n letter-spacing: -0.5px;\n line-height: 120%;\n text-align: center;\n}\n.very-loading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 60px;\n height: 60px;\n}\n.very-loading-animation {\n animation: very-spin 1s linear infinite;\n width: 60px;\n height: 60px;\n}\n.very-loading-logo {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes very-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n");
|
|
63
63
|
|
|
64
64
|
// src/tools/constants.ts
|
|
65
65
|
var API_URL = "https://bridge.very.org/api/v1/";
|
|
66
66
|
var VERIFY_PROOF_URL = "https://verify.very.org/api/v1/verify";
|
|
67
67
|
var QR_URL = "veros://verify";
|
|
68
|
-
var
|
|
68
|
+
var TermsUrl = "https://very.org/legal/terms";
|
|
69
|
+
var PrivacyUrl = "https://very.org/legal/privacy";
|
|
69
70
|
|
|
70
71
|
// src/tools/cryptoUtils.ts
|
|
71
72
|
var encodeBase64 = (data) => {
|
|
@@ -181,8 +182,8 @@ var import_qr_code_styling = __toESM(require("qr-code-styling"));
|
|
|
181
182
|
var closeSVG = `
|
|
182
183
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
183
184
|
<g clip-path="url(#clip0_2453_16329)">
|
|
184
|
-
<path d="M0.815918 0.816406L19.184 19.1845" stroke="#
|
|
185
|
-
<path d="M19.184 0.816406L0.815918 19.1845" stroke="#
|
|
185
|
+
<path d="M0.815918 0.816406L19.184 19.1845" stroke="var(--very-primary, #fafbff)" stroke-width="0.833333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
186
|
+
<path d="M19.184 0.816406L0.815918 19.1845" stroke="var(--very-primary, #fafbff)" stroke-width="0.833333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
186
187
|
</g>
|
|
187
188
|
<defs>
|
|
188
189
|
<clipPath id="clip0_2453_16329">
|
|
@@ -192,11 +193,11 @@ var closeSVG = `
|
|
|
192
193
|
</svg>
|
|
193
194
|
`;
|
|
194
195
|
var logoSVG = `<svg width="56" height="48" viewBox="0 0 56 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
195
|
-
<path d="M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z" fill="#
|
|
196
|
-
<path d="M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z" fill="#
|
|
197
|
-
<path d="M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z" fill="#
|
|
198
|
-
<path d="M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z" fill="#
|
|
199
|
-
<path d="M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z" fill="#
|
|
196
|
+
<path d="M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z" fill="var(--very-primary, #fafbff)"/>
|
|
197
|
+
<path d="M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z" fill="var(--very-primary, #fafbff)"/>
|
|
198
|
+
<path d="M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z" fill="var(--very-primary, #fafbff)"/>
|
|
199
|
+
<path d="M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z" fill="var(--very-primary, #fafbff)"/>
|
|
200
|
+
<path d="M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z" fill="var(--very-primary, #fafbff)"/>
|
|
200
201
|
</svg>
|
|
201
202
|
`;
|
|
202
203
|
|
|
@@ -204,41 +205,57 @@ var logoSVG = `<svg width="56" height="48" viewBox="0 0 56 48" fill="none" xmlns
|
|
|
204
205
|
var createFooterElement = () => {
|
|
205
206
|
const footer = document.createElement("div");
|
|
206
207
|
footer.className = "very-footer";
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
208
|
+
const logoRow = document.createElement("div");
|
|
209
|
+
logoRow.className = "very-footer-logo";
|
|
210
|
+
const poweredByText = document.createElement("span");
|
|
211
|
+
poweredByText.textContent = "Powered by";
|
|
212
|
+
logoRow.appendChild(poweredByText);
|
|
213
|
+
const brandLogo = document.createElement("img");
|
|
214
|
+
brandLogo.className = "very-footer-brand";
|
|
215
|
+
brandLogo.alt = "VeryAI";
|
|
216
|
+
brandLogo.src = "https://assets.very.org/branding/logo-light.svg";
|
|
217
|
+
logoRow.appendChild(brandLogo);
|
|
218
|
+
const linksRow = document.createElement("div");
|
|
219
|
+
linksRow.className = "very-footer-links";
|
|
220
|
+
const tosLink = document.createElement("a");
|
|
221
|
+
tosLink.className = "very-terms";
|
|
222
|
+
tosLink.href = TermsUrl;
|
|
223
|
+
tosLink.target = "_blank";
|
|
224
|
+
tosLink.rel = "noopener noreferrer";
|
|
225
|
+
tosLink.textContent = "Terms of Service";
|
|
226
|
+
const separator = document.createElement("span");
|
|
227
|
+
separator.className = "very-footer-sep";
|
|
228
|
+
separator.textContent = "\xB7";
|
|
229
|
+
const ppLink = document.createElement("a");
|
|
230
|
+
ppLink.className = "very-terms";
|
|
231
|
+
ppLink.href = PrivacyUrl;
|
|
232
|
+
ppLink.target = "_blank";
|
|
233
|
+
ppLink.rel = "noopener noreferrer";
|
|
234
|
+
ppLink.textContent = "Privacy Policy";
|
|
235
|
+
linksRow.appendChild(tosLink);
|
|
236
|
+
linksRow.appendChild(separator);
|
|
237
|
+
linksRow.appendChild(ppLink);
|
|
238
|
+
footer.appendChild(logoRow);
|
|
239
|
+
footer.appendChild(linksRow);
|
|
223
240
|
return footer;
|
|
224
241
|
};
|
|
225
242
|
var qrCode = new import_qr_code_styling.default({
|
|
226
243
|
width: 240,
|
|
227
244
|
height: 240,
|
|
228
245
|
backgroundOptions: {
|
|
229
|
-
color: "
|
|
246
|
+
color: "#fafbff"
|
|
230
247
|
},
|
|
231
248
|
dotsOptions: {
|
|
232
|
-
color: "
|
|
249
|
+
color: "#000000",
|
|
233
250
|
type: "dots"
|
|
234
251
|
},
|
|
235
252
|
cornersDotOptions: {
|
|
236
253
|
type: "rounded",
|
|
237
|
-
color: "
|
|
254
|
+
color: "#000000"
|
|
238
255
|
},
|
|
239
256
|
cornersSquareOptions: {
|
|
240
257
|
type: "extra-rounded",
|
|
241
|
-
color: "
|
|
258
|
+
color: "#000000"
|
|
242
259
|
},
|
|
243
260
|
qrOptions: {
|
|
244
261
|
errorCorrectionLevel: "Q"
|
|
@@ -252,13 +269,15 @@ var createQRCodeElement = (url, isProcessing) => {
|
|
|
252
269
|
logo.innerHTML = logoSVG;
|
|
253
270
|
const title = document.createElement("div");
|
|
254
271
|
title.className = "title";
|
|
255
|
-
title.textContent = "Verify with
|
|
272
|
+
title.textContent = "Verify with VeryAI";
|
|
256
273
|
const tip = document.createElement("div");
|
|
257
274
|
tip.className = "tip";
|
|
258
|
-
tip.textContent = "Please use your
|
|
275
|
+
tip.textContent = "Please use your VeryAI App to scan the QR code";
|
|
259
276
|
const qrContainer = document.createElement("div");
|
|
260
277
|
qrContainer.className = "very-center";
|
|
261
278
|
qrContainer.style.position = "relative";
|
|
279
|
+
qrContainer.style.borderRadius = "17px";
|
|
280
|
+
qrContainer.style.overflow = "hidden";
|
|
262
281
|
qrCode.update({
|
|
263
282
|
data: url
|
|
264
283
|
});
|
|
@@ -328,7 +347,7 @@ var createLoadingElement = () => {
|
|
|
328
347
|
const loadingAnimation = document.createElement("div");
|
|
329
348
|
loadingAnimation.className = "very-loading-animation";
|
|
330
349
|
loadingAnimation.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none">
|
|
331
|
-
<path d="M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z" fill="#
|
|
350
|
+
<path d="M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z" fill="var(--very-active, #3692cd)"/>
|
|
332
351
|
</svg>`;
|
|
333
352
|
const loadingLogo = document.createElement("div");
|
|
334
353
|
loadingLogo.className = "very-loading-logo";
|
|
@@ -619,7 +638,7 @@ var VeryWidget = ({
|
|
|
619
638
|
if (children) {
|
|
620
639
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: children({ open: handleOpen }) });
|
|
621
640
|
}
|
|
622
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: handleOpen, children: "Open
|
|
641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: handleOpen, children: "Open VeryAI Widget" }) });
|
|
623
642
|
};
|
|
624
643
|
|
|
625
644
|
// src/adapters/vue/index.ts
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["// Native JavaScript version (recommended)\nexport { createVeryWidget } from \"./vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig, IVeryWidgetState } from \"./vanilla/VeryWidget\";\n\n// Multi-framework adapters\nexport * from \"./adapters/react\";\nexport * from \"./adapters/vanilla\";\nexport * from \"./adapters/vue\";\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default {\\n --very-brand-color: #c0f97b;\\n --very-bg-color: #1c2125;\\n --very-primary: #fff;\\n --very-secondary: #fcfcfc;\\n --very-tertiary: #7e8791;\\n}\\n.dark {\\n --very-brand-color: #c0f97b;\\n --very-bg-color: #000;\\n --very-primary: #fff;\\n --very-secondary: #fcfcfc;\\n --very-tertiary: #7e8791;\\n}\\n.light {\\n --very-brand-color: #c0f97b;\\n --very-bg-color: #fff;\\n --very-primary: #000;\\n --very-secondary: #32363a;\\n --very-tertiary: #7e8791;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 0.5rem;\\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 28rem;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n margin-top: 12px;\\n padding: 1.5rem;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 8px;\\n }\\n .title {\\n color: var(--very-primary);\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 32px;\\n font-style: normal;\\n font-weight: 500;\\n letter-spacing: -1.152px;\\n line-height: 100%;\\n margin-top: 24px;\\n text-align: center;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 16px;\\n font-style: normal;\\n letter-spacing: -0.192px;\\n line-height: 144%;\\n margin-bottom: 21px;\\n margin-top: 12px;\\n text-align: center;\\n }\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 10px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-tertiary);\\n display: flex;\\n flex-direction: column;\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 13px;\\n font-style: normal;\\n font-weight: 500;\\n gap: 4px;\\n padding-bottom: 36px;\\n width: 100%;\\n}\\n.very-footer-logo {\\n align-items: center;\\n display: flex;\\n gap: 4px;\\n}\\n.very-terms {\\n cursor: pointer;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: #f64c46;\\n border: 1px solid var(--very-tertiary);\\n border-radius: 72px;\\n color: var(--very-primary);\\n cursor: pointer;\\n display: flex;\\n flex: 1 0 0;\\n font-size: 16px;\\n font-weight: 500;\\n gap: 12px;\\n height: 60px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 20px 28px;\\n width: 80%;\\n}\\n.error {\\n color: var(--very-primary);\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 32px;\\n font-style: normal;\\n font-weight: 500;\\n letter-spacing: -0.864px;\\n line-height: 100%;\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsPrivacyUrl = \"https://docs.very.org/legal/terms-of-use\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsPrivacyUrl } from \"../tools/constants\";\nimport { logoSVG } from \"./svgs\";\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n footer.innerHTML = `\n <div class=\"very-footer-logo\">\n <span>Powered by</span>\n <svg width=\"17\" height=\"14\" viewBox=\"0 0 17 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12.1421 14L12.9289 12.6357L9.85813 7.30953L9.58302 7.78664C9.26607 8.3363 9.2661 9.01322 9.58309 9.56285L12.1421 14Z\" fill=\"#7E8791\"/>\n <path d=\"M16.7872 5.94447L16.0004 7.3088L9.85781 7.30942L10.1321 6.83388C10.4495 6.28342 11.0367 5.94426 11.6721 5.94429L16.7872 5.94447Z\" fill=\"#7E8791\"/>\n <path d=\"M11.6346 0L13.2081 2.34639e-07L10.6503 4.43578C10.3329 4.98627 9.7458 5.32547 9.11035 5.3255L8.56277 5.32552L11.6346 0Z\" fill=\"#7E8791\"/>\n <path d=\"M5.49101 0.000330567L3.91745 0.000330314L6.47525 4.43611C6.79268 4.9866 7.3798 5.3258 8.01525 5.32583L8.56283 5.32586L5.49101 0.000330567Z\" fill=\"#7E8791\"/>\n <path d=\"M1.35172 7.27597L0.564941 5.91164L5.67996 5.91146C6.31541 5.91144 6.90256 6.25059 7.22003 6.80105L7.4941 7.27625L7.4943 7.27659L7.76921 7.75337C8.08615 8.30303 8.08612 8.97994 7.76914 9.52957L5.21012 13.9667L4.42334 12.6024L7.4939 7.27659L1.35172 7.27597Z\" fill=\"#7E8791\"/>\n </svg>\n <span>VERY</span>\n </div>\n <div class=\"very-terms\" onclick=\"window.open(${TermsPrivacyUrl}, '_blank')\">\n Terms of Service\n </div>\n `;\n return footer;\n};\n\nconst qrCode = new QRCodeStyling({\n width: 240,\n height: 240,\n backgroundOptions: {\n color: \"transparent\",\n },\n dotsOptions: {\n color: \"var(--very-primary)\",\n type: \"dots\",\n },\n cornersDotOptions: {\n type: \"rounded\",\n color: \"var(--very-primary)\",\n },\n cornersSquareOptions: {\n type: \"extra-rounded\",\n color: \"var(--very-primary)\",\n },\n qrOptions: {\n errorCorrectionLevel: \"Q\",\n },\n type: \"svg\",\n});\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Create Logo\n const logo = document.createElement(\"div\");\n logo.innerHTML = logoSVG;\n\n // Create title\n const title = document.createElement(\"div\");\n title.className = \"title\";\n title.textContent = \"Verify with Very\";\n\n // Create tip\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Please use your Very App to scan the QR code\";\n\n // Create QR code container\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-center\";\n qrContainer.style.position = \"relative\";\n\n // Need to integrate QR code generation library here\n qrCode.update({\n data: url,\n });\n\n qrCode.append(qrContainer);\n\n // If processing, add processing overlay\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n\n text.innerHTML = `\n \n <div style=\"margin-top: 16px; text-align: center;\">\n Please wait while we <br /> process your verification.\n </div>\n `;\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n container.appendChild(logo);\n container.appendChild(title);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n error.innerHTML = `\n ${\n isExpired\n ? `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n`\n : `\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16310)\">\n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16310\">\n<rect width=\"48\" height=\"48\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`\n }\n <div class=\"error\">${\n isExpired ? \"Session Expired\" : \"Verification Failed\"\n }</div>\n <div style=\"font-size: 16px; color: var(--very-secondary);\">${\n errorText || \"Unable to verify your identity. Please try again.\"\n }</div>\n <div class=\"very-try-again\" onclick=\"this.dispatchEvent(new CustomEvent('refresh'))\">\n Try Again\n </div>\n `;\n\n error.addEventListener(\"refresh\", onRefresh);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"#3692CD\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"#FCFCFC\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"#FCFCFC\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"#FCFCFC\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"#FCFCFC\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\nexport const logoSVG = `<svg width=\"56\" height=\"48\" viewBox=\"0 0 56 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z\" fill=\"#B0C6D4\"/>\n<path d=\"M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z\" fill=\"#B0C6D4\"/>\n<path d=\"M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z\" fill=\"#B0C6D4\"/>\n<path d=\"M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z\" fill=\"#B0C6D4\"/>\n<path d=\"M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z\" fill=\"#B0C6D4\"/>\n</svg>\n`;\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, this.refresh)\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Mobile|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Open Very Widget</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close,\n destroy,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,QAAI,KAAK,YAAY;AACnB,WAAK,aAAa,OAAO,KAAK,UAAU;AAAA,IAC1C,OAAO;AACL,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF,OAAO;AACL,SAAK,YAAY,KAAK;AAAA,EACxB;AAEA,MAAI,MAAM,YAAY;AACpB,UAAM,WAAW,UAAU;AAAA,EAC7B,O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,SACE,4CAAC,SAAI,WACH,sDAAC,YAAO,SAAS,YAAY,8BAAgB,GAC/C;AAEJ;;;ACrBO,IAAM,gBAAgB,CAAC,WAAiC;AAC7D,MAAI,iBAA6D;AACjE,MAAI,SAAS;AAEb,QAAM,OAAO,MAAM;AACjB,QAAI,CAAC,gBAAgB;AACnB,uBAAiB,iBAAiB;AAAA,QAChC,GAAG;AAAA,QACH,WAAW,CAAC,UAAU;AACpB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AACA,mBAAe,KAAK;AACpB,aAAS;AAAA,EACX;AAEA,QAAM,QAAQ,MAAM;AAClB,QAAI,gBAAgB;AAClB,qBAAe,MAAM;AACrB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qBAAe,QAAQ;AACvB,uBAAiB;AACjB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["QRCodeStyling"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["// Native JavaScript version (recommended)\nexport { createVeryWidget } from \"./vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig, IVeryWidgetState } from \"./vanilla/VeryWidget\";\n\n// Multi-framework adapters\nexport * from \"./adapters/react\";\nexport * from \"./adapters/vanilla\";\nexport * from \"./adapters/vue\";\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.dark {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.light {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #fafbff;\\n --very-primary: #1c2125;\\n --very-secondary: rgba(0, 0, 0, 0.6);\\n --very-tertiary: rgba(0, 0, 0, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #1f3765;\\n --very-button-text: #fafbff;\\n --very-border: #1f3765;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 20px;\\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 440px;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n padding: 40px 32px 24px;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 8px;\\n }\\n .title {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n margin-top: 20px;\\n text-align: center;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-size: 16px;\\n font-style: normal;\\n letter-spacing: -0.192px;\\n line-height: 144%;\\n margin-bottom: 24px;\\n margin-top: 8px;\\n text-align: center;\\n }\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 12px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n opacity: 0.6;\\n transition: opacity 0.15s ease;\\n}\\n.very-close:hover {\\n opacity: 1;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-secondary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 14px;\\n font-style: normal;\\n font-weight: 400;\\n gap: 6px;\\n padding: 0 32px 28px;\\n width: 100%;\\n}\\n.very-footer-logo {\\n align-items: center;\\n display: flex;\\n gap: 6px;\\n}\\n.very-footer-brand {\\n height: 14px;\\n width: auto;\\n}\\n.light .very-footer-brand {\\n content: url(https://assets.very.org/branding/logo-dark.svg);\\n}\\n.very-footer-links {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n}\\n.very-footer-sep {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n}\\n.very-terms {\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--very-tertiary);\\n text-decoration: underline;\\n text-underline-offset: 2px;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: var(--very-button-bg);\\n border: none;\\n border-radius: 12px;\\n color: var(--very-button-text);\\n cursor: pointer;\\n display: flex;\\n font-size: 16px;\\n font-weight: 600;\\n gap: 12px;\\n height: 56px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 16px 28px;\\n width: 100%;\\n transition: opacity 0.15s ease;\\n}\\n.very-try-again:hover {\\n opacity: 0.9;\\n}\\n.error {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsUrl = \"https://very.org/legal/terms\";\nexport const PrivacyUrl = \"https://very.org/legal/privacy\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsUrl, PrivacyUrl } from \"../tools/constants\";\nimport { logoSVG } from \"./svgs\";\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n\n const logoRow = document.createElement(\"div\");\n logoRow.className = \"very-footer-logo\";\n\n const poweredByText = document.createElement(\"span\");\n poweredByText.textContent = \"Powered by\";\n logoRow.appendChild(poweredByText);\n\n const brandLogo = document.createElement(\"img\");\n brandLogo.className = \"very-footer-brand\";\n brandLogo.alt = \"VeryAI\";\n brandLogo.src = \"https://assets.very.org/branding/logo-light.svg\";\n logoRow.appendChild(brandLogo);\n\n const linksRow = document.createElement(\"div\");\n linksRow.className = \"very-footer-links\";\n\n const tosLink = document.createElement(\"a\");\n tosLink.className = \"very-terms\";\n tosLink.href = TermsUrl;\n tosLink.target = \"_blank\";\n tosLink.rel = \"noopener noreferrer\";\n tosLink.textContent = \"Terms of Service\";\n\n const separator = document.createElement(\"span\");\n separator.className = \"very-footer-sep\";\n separator.textContent = \"·\";\n\n const ppLink = document.createElement(\"a\");\n ppLink.className = \"very-terms\";\n ppLink.href = PrivacyUrl;\n ppLink.target = \"_blank\";\n ppLink.rel = \"noopener noreferrer\";\n ppLink.textContent = \"Privacy Policy\";\n\n linksRow.appendChild(tosLink);\n linksRow.appendChild(separator);\n linksRow.appendChild(ppLink);\n\n footer.appendChild(logoRow);\n footer.appendChild(linksRow);\n\n return footer;\n};\n\nconst qrCode = new QRCodeStyling({\n width: 240,\n height: 240,\n backgroundOptions: {\n color: \"#fafbff\",\n },\n dotsOptions: {\n color: \"#000000\",\n type: \"dots\",\n },\n cornersDotOptions: {\n type: \"rounded\",\n color: \"#000000\",\n },\n cornersSquareOptions: {\n type: \"extra-rounded\",\n color: \"#000000\",\n },\n qrOptions: {\n errorCorrectionLevel: \"Q\",\n },\n type: \"svg\",\n});\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Create Logo\n const logo = document.createElement(\"div\");\n logo.innerHTML = logoSVG;\n\n // Create title\n const title = document.createElement(\"div\");\n title.className = \"title\";\n title.textContent = \"Verify with VeryAI\";\n\n // Create tip\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Please use your VeryAI App to scan the QR code\";\n\n // Create QR code container\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-center\";\n qrContainer.style.position = \"relative\";\n qrContainer.style.borderRadius = \"17px\";\n qrContainer.style.overflow = \"hidden\";\n\n // Need to integrate QR code generation library here\n qrCode.update({\n data: url,\n });\n\n qrCode.append(qrContainer);\n\n // If processing, add processing overlay\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n\n text.innerHTML = `\n \n <div style=\"margin-top: 16px; text-align: center;\">\n Please wait while we <br /> process your verification.\n </div>\n `;\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n container.appendChild(logo);\n container.appendChild(title);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n error.innerHTML = `\n ${\n isExpired\n ? `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n`\n : `\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16310)\">\n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16310\">\n<rect width=\"48\" height=\"48\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`\n }\n <div class=\"error\">${\n isExpired ? \"Session Expired\" : \"Verification Failed\"\n }</div>\n <div style=\"font-size: 16px; color: var(--very-secondary);\">${\n errorText || \"Unable to verify your identity. Please try again.\"\n }</div>\n <div class=\"very-try-again\" onclick=\"this.dispatchEvent(new CustomEvent('refresh'))\">\n Try Again\n </div>\n `;\n\n error.addEventListener(\"refresh\", onRefresh);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"var(--very-active, #3692cd)\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\nexport const logoSVG = `<svg width=\"56\" height=\"48\" viewBox=\"0 0 56 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z\" fill=\"var(--very-primary, #fafbff)\"/>\n</svg>\n`;\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, this.refresh)\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Mobile|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Open VeryAI Widget</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close,\n destroy,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;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B,CAAC,WAAiC;AAC7D,MAAI,iBAA6D;AACjE,MAAI,SAAS;AAEb,QAAM,OAAO,MAAM;AACjB,QAAI,CAAC,gBAAgB;AACnB,uBAAiB,iBAAiB;AAAA,QAChC,GAAG;AAAA,QACH,WAAW,CAAC,UAAU;AACpB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AACA,mBAAe,KAAK;AACpB,aAAS;AAAA,EACX;AAEA,QAAM,QAAQ,MAAM;AAClB,QAAI,gBAAgB;AAClB,qBAAe,MAAM;AACrB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qBAAe,QAAQ;AACvB,uBAAiB;AACjB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["QRCodeStyling"]}
|
package/build/index.mjs
CHANGED
|
@@ -21,13 +21,14 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// src/styles/styles.css
|
|
24
|
-
styleInject(".default {\n --very-brand-color: #
|
|
24
|
+
styleInject(".default {\n --very-brand-color: #1f3765;\n --very-bg-color: #000;\n --very-primary: #fafbff;\n --very-secondary: rgba(255, 255, 255, 0.6);\n --very-tertiary: rgba(255, 255, 255, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #fafbff;\n --very-button-text: #1f3765;\n --very-border: #b0c6d4;\n}\n.dark {\n --very-brand-color: #1f3765;\n --very-bg-color: #000;\n --very-primary: #fafbff;\n --very-secondary: rgba(255, 255, 255, 0.6);\n --very-tertiary: rgba(255, 255, 255, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #fafbff;\n --very-button-text: #1f3765;\n --very-border: #b0c6d4;\n}\n.light {\n --very-brand-color: #1f3765;\n --very-bg-color: #fafbff;\n --very-primary: #1c2125;\n --very-secondary: rgba(0, 0, 0, 0.6);\n --very-tertiary: rgba(0, 0, 0, 0.4);\n --very-active: #3692cd;\n --very-button-bg: #1f3765;\n --very-button-text: #fafbff;\n --very-border: #1f3765;\n}\n.very-dialog-overlay {\n backdrop-filter: blur(4px);\n background-color: rgba(0, 0, 0, 0.5);\n inset: 0;\n position: fixed;\n z-index: 40;\n}\n.very-processing {\n backdrop-filter: blur(4px);\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-size: 16px;\n font-weight: 500;\n color: var(--very-primary);\n}\n.very-widget {\n align-items: center;\n background-color: var(--very-bg-color);\n border-radius: 20px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n color: var(--very-primary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 16px;\n left: 50%;\n max-width: 440px;\n position: fixed;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 90vw;\n z-index: 50;\n .very-content {\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n padding: 40px 32px 24px;\n }\n .very-center {\n position: relative;\n align-items: center;\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n gap: 8px;\n }\n .title {\n color: var(--very-primary);\n font-size: 28px;\n font-style: normal;\n font-weight: 600;\n letter-spacing: -0.5px;\n line-height: 120%;\n margin-top: 20px;\n text-align: center;\n }\n .tip {\n color: var(--very-secondary);\n font-size: 16px;\n font-style: normal;\n letter-spacing: -0.192px;\n line-height: 144%;\n margin-bottom: 24px;\n margin-top: 8px;\n text-align: center;\n }\n}\n.very-close {\n cursor: pointer;\n padding: 12px;\n position: absolute;\n right: 16px;\n top: 16px;\n opacity: 0.6;\n transition: opacity 0.15s ease;\n}\n.very-close:hover {\n opacity: 1;\n}\n.very-footer {\n align-items: center;\n color: var(--very-secondary);\n display: flex;\n flex-direction: column;\n font-family: Instrument Sans, sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n gap: 6px;\n padding: 0 32px 28px;\n width: 100%;\n}\n.very-footer-logo {\n align-items: center;\n display: flex;\n gap: 6px;\n}\n.very-footer-brand {\n height: 14px;\n width: auto;\n}\n.light .very-footer-brand {\n content: url(https://assets.very.org/branding/logo-dark.svg);\n}\n.very-footer-links {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.very-footer-sep {\n color: var(--very-tertiary);\n font-size: 13px;\n}\n.very-terms {\n cursor: pointer;\n font-size: 13px;\n color: var(--very-tertiary);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.very-try-again {\n align-items: center;\n background-color: var(--very-button-bg);\n border: none;\n border-radius: 12px;\n color: var(--very-button-text);\n cursor: pointer;\n display: flex;\n font-size: 16px;\n font-weight: 600;\n gap: 12px;\n height: 56px;\n justify-content: center;\n margin-top: 24px;\n padding: 16px 28px;\n width: 100%;\n transition: opacity 0.15s ease;\n}\n.very-try-again:hover {\n opacity: 0.9;\n}\n.error {\n color: var(--very-primary);\n font-size: 28px;\n font-style: normal;\n font-weight: 600;\n letter-spacing: -0.5px;\n line-height: 120%;\n text-align: center;\n}\n.very-loading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 60px;\n height: 60px;\n}\n.very-loading-animation {\n animation: very-spin 1s linear infinite;\n width: 60px;\n height: 60px;\n}\n.very-loading-logo {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 10;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes very-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n");
|
|
25
25
|
|
|
26
26
|
// src/tools/constants.ts
|
|
27
27
|
var API_URL = "https://bridge.very.org/api/v1/";
|
|
28
28
|
var VERIFY_PROOF_URL = "https://verify.very.org/api/v1/verify";
|
|
29
29
|
var QR_URL = "veros://verify";
|
|
30
|
-
var
|
|
30
|
+
var TermsUrl = "https://very.org/legal/terms";
|
|
31
|
+
var PrivacyUrl = "https://very.org/legal/privacy";
|
|
31
32
|
|
|
32
33
|
// src/tools/cryptoUtils.ts
|
|
33
34
|
var encodeBase64 = (data) => {
|
|
@@ -143,8 +144,8 @@ import QRCodeStyling from "qr-code-styling";
|
|
|
143
144
|
var closeSVG = `
|
|
144
145
|
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
145
146
|
<g clip-path="url(#clip0_2453_16329)">
|
|
146
|
-
<path d="M0.815918 0.816406L19.184 19.1845" stroke="#
|
|
147
|
-
<path d="M19.184 0.816406L0.815918 19.1845" stroke="#
|
|
147
|
+
<path d="M0.815918 0.816406L19.184 19.1845" stroke="var(--very-primary, #fafbff)" stroke-width="0.833333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
148
|
+
<path d="M19.184 0.816406L0.815918 19.1845" stroke="var(--very-primary, #fafbff)" stroke-width="0.833333" stroke-linecap="round" stroke-linejoin="round"/>
|
|
148
149
|
</g>
|
|
149
150
|
<defs>
|
|
150
151
|
<clipPath id="clip0_2453_16329">
|
|
@@ -154,11 +155,11 @@ var closeSVG = `
|
|
|
154
155
|
</svg>
|
|
155
156
|
`;
|
|
156
157
|
var logoSVG = `<svg width="56" height="48" viewBox="0 0 56 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
157
|
-
<path d="M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z" fill="#
|
|
158
|
-
<path d="M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z" fill="#
|
|
159
|
-
<path d="M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z" fill="#
|
|
160
|
-
<path d="M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z" fill="#
|
|
161
|
-
<path d="M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z" fill="#
|
|
158
|
+
<path d="M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z" fill="var(--very-primary, #fafbff)"/>
|
|
159
|
+
<path d="M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z" fill="var(--very-primary, #fafbff)"/>
|
|
160
|
+
<path d="M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z" fill="var(--very-primary, #fafbff)"/>
|
|
161
|
+
<path d="M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z" fill="var(--very-primary, #fafbff)"/>
|
|
162
|
+
<path d="M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z" fill="var(--very-primary, #fafbff)"/>
|
|
162
163
|
</svg>
|
|
163
164
|
`;
|
|
164
165
|
|
|
@@ -166,41 +167,57 @@ var logoSVG = `<svg width="56" height="48" viewBox="0 0 56 48" fill="none" xmlns
|
|
|
166
167
|
var createFooterElement = () => {
|
|
167
168
|
const footer = document.createElement("div");
|
|
168
169
|
footer.className = "very-footer";
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
170
|
+
const logoRow = document.createElement("div");
|
|
171
|
+
logoRow.className = "very-footer-logo";
|
|
172
|
+
const poweredByText = document.createElement("span");
|
|
173
|
+
poweredByText.textContent = "Powered by";
|
|
174
|
+
logoRow.appendChild(poweredByText);
|
|
175
|
+
const brandLogo = document.createElement("img");
|
|
176
|
+
brandLogo.className = "very-footer-brand";
|
|
177
|
+
brandLogo.alt = "VeryAI";
|
|
178
|
+
brandLogo.src = "https://assets.very.org/branding/logo-light.svg";
|
|
179
|
+
logoRow.appendChild(brandLogo);
|
|
180
|
+
const linksRow = document.createElement("div");
|
|
181
|
+
linksRow.className = "very-footer-links";
|
|
182
|
+
const tosLink = document.createElement("a");
|
|
183
|
+
tosLink.className = "very-terms";
|
|
184
|
+
tosLink.href = TermsUrl;
|
|
185
|
+
tosLink.target = "_blank";
|
|
186
|
+
tosLink.rel = "noopener noreferrer";
|
|
187
|
+
tosLink.textContent = "Terms of Service";
|
|
188
|
+
const separator = document.createElement("span");
|
|
189
|
+
separator.className = "very-footer-sep";
|
|
190
|
+
separator.textContent = "\xB7";
|
|
191
|
+
const ppLink = document.createElement("a");
|
|
192
|
+
ppLink.className = "very-terms";
|
|
193
|
+
ppLink.href = PrivacyUrl;
|
|
194
|
+
ppLink.target = "_blank";
|
|
195
|
+
ppLink.rel = "noopener noreferrer";
|
|
196
|
+
ppLink.textContent = "Privacy Policy";
|
|
197
|
+
linksRow.appendChild(tosLink);
|
|
198
|
+
linksRow.appendChild(separator);
|
|
199
|
+
linksRow.appendChild(ppLink);
|
|
200
|
+
footer.appendChild(logoRow);
|
|
201
|
+
footer.appendChild(linksRow);
|
|
185
202
|
return footer;
|
|
186
203
|
};
|
|
187
204
|
var qrCode = new QRCodeStyling({
|
|
188
205
|
width: 240,
|
|
189
206
|
height: 240,
|
|
190
207
|
backgroundOptions: {
|
|
191
|
-
color: "
|
|
208
|
+
color: "#fafbff"
|
|
192
209
|
},
|
|
193
210
|
dotsOptions: {
|
|
194
|
-
color: "
|
|
211
|
+
color: "#000000",
|
|
195
212
|
type: "dots"
|
|
196
213
|
},
|
|
197
214
|
cornersDotOptions: {
|
|
198
215
|
type: "rounded",
|
|
199
|
-
color: "
|
|
216
|
+
color: "#000000"
|
|
200
217
|
},
|
|
201
218
|
cornersSquareOptions: {
|
|
202
219
|
type: "extra-rounded",
|
|
203
|
-
color: "
|
|
220
|
+
color: "#000000"
|
|
204
221
|
},
|
|
205
222
|
qrOptions: {
|
|
206
223
|
errorCorrectionLevel: "Q"
|
|
@@ -214,13 +231,15 @@ var createQRCodeElement = (url, isProcessing) => {
|
|
|
214
231
|
logo.innerHTML = logoSVG;
|
|
215
232
|
const title = document.createElement("div");
|
|
216
233
|
title.className = "title";
|
|
217
|
-
title.textContent = "Verify with
|
|
234
|
+
title.textContent = "Verify with VeryAI";
|
|
218
235
|
const tip = document.createElement("div");
|
|
219
236
|
tip.className = "tip";
|
|
220
|
-
tip.textContent = "Please use your
|
|
237
|
+
tip.textContent = "Please use your VeryAI App to scan the QR code";
|
|
221
238
|
const qrContainer = document.createElement("div");
|
|
222
239
|
qrContainer.className = "very-center";
|
|
223
240
|
qrContainer.style.position = "relative";
|
|
241
|
+
qrContainer.style.borderRadius = "17px";
|
|
242
|
+
qrContainer.style.overflow = "hidden";
|
|
224
243
|
qrCode.update({
|
|
225
244
|
data: url
|
|
226
245
|
});
|
|
@@ -290,7 +309,7 @@ var createLoadingElement = () => {
|
|
|
290
309
|
const loadingAnimation = document.createElement("div");
|
|
291
310
|
loadingAnimation.className = "very-loading-animation";
|
|
292
311
|
loadingAnimation.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none">
|
|
293
|
-
<path d="M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z" fill="#
|
|
312
|
+
<path d="M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z" fill="var(--very-active, #3692cd)"/>
|
|
294
313
|
</svg>`;
|
|
295
314
|
const loadingLogo = document.createElement("div");
|
|
296
315
|
loadingLogo.className = "very-loading-logo";
|
|
@@ -581,7 +600,7 @@ var VeryWidget = ({
|
|
|
581
600
|
if (children) {
|
|
582
601
|
return /* @__PURE__ */ jsx("div", { className, children: children({ open: handleOpen }) });
|
|
583
602
|
}
|
|
584
|
-
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("button", { onClick: handleOpen, children: "Open
|
|
603
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("button", { onClick: handleOpen, children: "Open VeryAI Widget" }) });
|
|
585
604
|
};
|
|
586
605
|
|
|
587
606
|
// src/adapters/vue/index.ts
|
package/build/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default {\\n --very-brand-color: #c0f97b;\\n --very-bg-color: #1c2125;\\n --very-primary: #fff;\\n --very-secondary: #fcfcfc;\\n --very-tertiary: #7e8791;\\n}\\n.dark {\\n --very-brand-color: #c0f97b;\\n --very-bg-color: #000;\\n --very-primary: #fff;\\n --very-secondary: #fcfcfc;\\n --very-tertiary: #7e8791;\\n}\\n.light {\\n --very-brand-color: #c0f97b;\\n --very-bg-color: #fff;\\n --very-primary: #000;\\n --very-secondary: #32363a;\\n --very-tertiary: #7e8791;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 0.5rem;\\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 28rem;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n margin-top: 12px;\\n padding: 1.5rem;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 8px;\\n }\\n .title {\\n color: var(--very-primary);\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 32px;\\n font-style: normal;\\n font-weight: 500;\\n letter-spacing: -1.152px;\\n line-height: 100%;\\n margin-top: 24px;\\n text-align: center;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 16px;\\n font-style: normal;\\n letter-spacing: -0.192px;\\n line-height: 144%;\\n margin-bottom: 21px;\\n margin-top: 12px;\\n text-align: center;\\n }\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 10px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-tertiary);\\n display: flex;\\n flex-direction: column;\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 13px;\\n font-style: normal;\\n font-weight: 500;\\n gap: 4px;\\n padding-bottom: 36px;\\n width: 100%;\\n}\\n.very-footer-logo {\\n align-items: center;\\n display: flex;\\n gap: 4px;\\n}\\n.very-terms {\\n cursor: pointer;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: #f64c46;\\n border: 1px solid var(--very-tertiary);\\n border-radius: 72px;\\n color: var(--very-primary);\\n cursor: pointer;\\n display: flex;\\n flex: 1 0 0;\\n font-size: 16px;\\n font-weight: 500;\\n gap: 12px;\\n height: 60px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 20px 28px;\\n width: 80%;\\n}\\n.error {\\n color: var(--very-primary);\\n font-family:\\n -apple-system,\\n BlinkMacSystemFont,\\n Segoe UI,\\n Roboto,\\n Oxygen-Sans,\\n Ubuntu,\\n Cantarell,\\n Helvetica Neue,\\n sans-serif;\\n font-size: 32px;\\n font-style: normal;\\n font-weight: 500;\\n letter-spacing: -0.864px;\\n line-height: 100%;\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsPrivacyUrl = \"https://docs.very.org/legal/terms-of-use\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsPrivacyUrl } from \"../tools/constants\";\nimport { logoSVG } from \"./svgs\";\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n footer.innerHTML = `\n <div class=\"very-footer-logo\">\n <span>Powered by</span>\n <svg width=\"17\" height=\"14\" viewBox=\"0 0 17 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12.1421 14L12.9289 12.6357L9.85813 7.30953L9.58302 7.78664C9.26607 8.3363 9.2661 9.01322 9.58309 9.56285L12.1421 14Z\" fill=\"#7E8791\"/>\n <path d=\"M16.7872 5.94447L16.0004 7.3088L9.85781 7.30942L10.1321 6.83388C10.4495 6.28342 11.0367 5.94426 11.6721 5.94429L16.7872 5.94447Z\" fill=\"#7E8791\"/>\n <path d=\"M11.6346 0L13.2081 2.34639e-07L10.6503 4.43578C10.3329 4.98627 9.7458 5.32547 9.11035 5.3255L8.56277 5.32552L11.6346 0Z\" fill=\"#7E8791\"/>\n <path d=\"M5.49101 0.000330567L3.91745 0.000330314L6.47525 4.43611C6.79268 4.9866 7.3798 5.3258 8.01525 5.32583L8.56283 5.32586L5.49101 0.000330567Z\" fill=\"#7E8791\"/>\n <path d=\"M1.35172 7.27597L0.564941 5.91164L5.67996 5.91146C6.31541 5.91144 6.90256 6.25059 7.22003 6.80105L7.4941 7.27625L7.4943 7.27659L7.76921 7.75337C8.08615 8.30303 8.08612 8.97994 7.76914 9.52957L5.21012 13.9667L4.42334 12.6024L7.4939 7.27659L1.35172 7.27597Z\" fill=\"#7E8791\"/>\n </svg>\n <span>VERY</span>\n </div>\n <div class=\"very-terms\" onclick=\"window.open(${TermsPrivacyUrl}, '_blank')\">\n Terms of Service\n </div>\n `;\n return footer;\n};\n\nconst qrCode = new QRCodeStyling({\n width: 240,\n height: 240,\n backgroundOptions: {\n color: \"transparent\",\n },\n dotsOptions: {\n color: \"var(--very-primary)\",\n type: \"dots\",\n },\n cornersDotOptions: {\n type: \"rounded\",\n color: \"var(--very-primary)\",\n },\n cornersSquareOptions: {\n type: \"extra-rounded\",\n color: \"var(--very-primary)\",\n },\n qrOptions: {\n errorCorrectionLevel: \"Q\",\n },\n type: \"svg\",\n});\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Create Logo\n const logo = document.createElement(\"div\");\n logo.innerHTML = logoSVG;\n\n // Create title\n const title = document.createElement(\"div\");\n title.className = \"title\";\n title.textContent = \"Verify with Very\";\n\n // Create tip\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Please use your Very App to scan the QR code\";\n\n // Create QR code container\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-center\";\n qrContainer.style.position = \"relative\";\n\n // Need to integrate QR code generation library here\n qrCode.update({\n data: url,\n });\n\n qrCode.append(qrContainer);\n\n // If processing, add processing overlay\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n\n text.innerHTML = `\n \n <div style=\"margin-top: 16px; text-align: center;\">\n Please wait while we <br /> process your verification.\n </div>\n `;\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n container.appendChild(logo);\n container.appendChild(title);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n error.innerHTML = `\n ${\n isExpired\n ? `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n`\n : `\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16310)\">\n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16310\">\n<rect width=\"48\" height=\"48\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`\n }\n <div class=\"error\">${\n isExpired ? \"Session Expired\" : \"Verification Failed\"\n }</div>\n <div style=\"font-size: 16px; color: var(--very-secondary);\">${\n errorText || \"Unable to verify your identity. Please try again.\"\n }</div>\n <div class=\"very-try-again\" onclick=\"this.dispatchEvent(new CustomEvent('refresh'))\">\n Try Again\n </div>\n `;\n\n error.addEventListener(\"refresh\", onRefresh);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"#3692CD\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"#FCFCFC\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"#FCFCFC\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"#FCFCFC\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"#FCFCFC\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"#FCFCFC\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\nexport const logoSVG = `<svg width=\"56\" height=\"48\" viewBox=\"0 0 56 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z\" fill=\"#B0C6D4\"/>\n<path d=\"M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z\" fill=\"#B0C6D4\"/>\n<path d=\"M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z\" fill=\"#B0C6D4\"/>\n<path d=\"M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z\" fill=\"#B0C6D4\"/>\n<path d=\"M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z\" fill=\"#B0C6D4\"/>\n</svg>\n`;\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, this.refresh)\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Mobile|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Open Very Widget</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close,\n destroy,\n };\n};\n"],"mappings":";AACyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,QAAI,KAAK,YAAY;AACnB,WAAK,aAAa,OAAO,KAAK,UAAU;AAAA,IAC1C,OAAO;AACL,WAAK,YAAY,KAAK;AAAA,IACxB;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zB;AAAA,EACF;AAEA,MAAI,UAAU;AACZ,WAAO,oBAAC,SAAI,WAAuB,mBAAS,EAAE,MAAM,WAAW,CAAC,GAAE;AAAA,EACpE;AAEA,SACE,oBAAC,SAAI,WACH,8BAAC,YAAO,SAAS,YAAY,8BAAgB,GAC/C;AAEJ;;;ACrBO,IAAM,gBAAgB,CAAC,WAAiC;AAC7D,MAAI,iBAA6D;AACjE,MAAI,SAAS;AAEb,QAAM,OAAO,MAAM;AACjB,QAAI,CAAC,gBAAgB;AACnB,uBAAiB,iBAAiB;AAAA,QAChC,GAAG;AAAA,QACH,WAAW,CAAC,UAAU;AACpB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AACA,mBAAe,KAAK;AACpB,aAAS;AAAA,EACX;AAEA,QAAM,QAAQ,MAAM;AAClB,QAAI,gBAAgB;AAClB,qBAAe,MAAM;AACrB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qBAAe,QAAQ;AACvB,uBAAiB;AACjB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["#style-inject:#style-inject","../src/styles/styles.css","../src/tools/constants.ts","../src/tools/cryptoUtils.ts","../src/tools/createSession.ts","../src/tools/verifyProof.ts","../src/vanilla/components.ts","../src/vanilla/svgs.ts","../src/vanilla/VeryWidget.ts","../src/adapters/react/index.tsx","../src/adapters/vue/index.ts"],"sourcesContent":["\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\".default {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.dark {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #000;\\n --very-primary: #fafbff;\\n --very-secondary: rgba(255, 255, 255, 0.6);\\n --very-tertiary: rgba(255, 255, 255, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #fafbff;\\n --very-button-text: #1f3765;\\n --very-border: #b0c6d4;\\n}\\n.light {\\n --very-brand-color: #1f3765;\\n --very-bg-color: #fafbff;\\n --very-primary: #1c2125;\\n --very-secondary: rgba(0, 0, 0, 0.6);\\n --very-tertiary: rgba(0, 0, 0, 0.4);\\n --very-active: #3692cd;\\n --very-button-bg: #1f3765;\\n --very-button-text: #fafbff;\\n --very-border: #1f3765;\\n}\\n.very-dialog-overlay {\\n backdrop-filter: blur(4px);\\n background-color: rgba(0, 0, 0, 0.5);\\n inset: 0;\\n position: fixed;\\n z-index: 40;\\n}\\n.very-processing {\\n backdrop-filter: blur(4px);\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n font-size: 16px;\\n font-weight: 500;\\n color: var(--very-primary);\\n}\\n.very-widget {\\n align-items: center;\\n background-color: var(--very-bg-color);\\n border-radius: 20px;\\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\\n color: var(--very-primary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 16px;\\n left: 50%;\\n max-width: 440px;\\n position: fixed;\\n top: 50%;\\n transform: translate(-50%, -50%);\\n width: 90vw;\\n z-index: 50;\\n .very-content {\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n padding: 40px 32px 24px;\\n }\\n .very-center {\\n position: relative;\\n align-items: center;\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n justify-content: center;\\n gap: 8px;\\n }\\n .title {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n margin-top: 20px;\\n text-align: center;\\n }\\n .tip {\\n color: var(--very-secondary);\\n font-size: 16px;\\n font-style: normal;\\n letter-spacing: -0.192px;\\n line-height: 144%;\\n margin-bottom: 24px;\\n margin-top: 8px;\\n text-align: center;\\n }\\n}\\n.very-close {\\n cursor: pointer;\\n padding: 12px;\\n position: absolute;\\n right: 16px;\\n top: 16px;\\n opacity: 0.6;\\n transition: opacity 0.15s ease;\\n}\\n.very-close:hover {\\n opacity: 1;\\n}\\n.very-footer {\\n align-items: center;\\n color: var(--very-secondary);\\n display: flex;\\n flex-direction: column;\\n font-family: Instrument Sans, sans-serif;\\n font-size: 14px;\\n font-style: normal;\\n font-weight: 400;\\n gap: 6px;\\n padding: 0 32px 28px;\\n width: 100%;\\n}\\n.very-footer-logo {\\n align-items: center;\\n display: flex;\\n gap: 6px;\\n}\\n.very-footer-brand {\\n height: 14px;\\n width: auto;\\n}\\n.light .very-footer-brand {\\n content: url(https://assets.very.org/branding/logo-dark.svg);\\n}\\n.very-footer-links {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n}\\n.very-footer-sep {\\n color: var(--very-tertiary);\\n font-size: 13px;\\n}\\n.very-terms {\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--very-tertiary);\\n text-decoration: underline;\\n text-underline-offset: 2px;\\n}\\n.very-try-again {\\n align-items: center;\\n background-color: var(--very-button-bg);\\n border: none;\\n border-radius: 12px;\\n color: var(--very-button-text);\\n cursor: pointer;\\n display: flex;\\n font-size: 16px;\\n font-weight: 600;\\n gap: 12px;\\n height: 56px;\\n justify-content: center;\\n margin-top: 24px;\\n padding: 16px 28px;\\n width: 100%;\\n transition: opacity 0.15s ease;\\n}\\n.very-try-again:hover {\\n opacity: 0.9;\\n}\\n.error {\\n color: var(--very-primary);\\n font-size: 28px;\\n font-style: normal;\\n font-weight: 600;\\n letter-spacing: -0.5px;\\n line-height: 120%;\\n text-align: center;\\n}\\n.very-loading {\\n position: relative;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-animation {\\n animation: very-spin 1s linear infinite;\\n width: 60px;\\n height: 60px;\\n}\\n.very-loading-logo {\\n position: absolute;\\n top: 0;\\n left: 0;\\n bottom: 0;\\n right: 0;\\n z-index: 10;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n@keyframes very-spin {\\n from {\\n transform: rotate(0deg);\\n }\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\")","export const API_URL = \"https://bridge.very.org/api/v1/\";\nexport const VERIFY_PROOF_URL = \"https://verify.very.org/api/v1/verify\";\nexport const QR_URL = \"veros://verify\";\n\nexport const TermsUrl = \"https://very.org/legal/terms\";\nexport const PrivacyUrl = \"https://very.org/legal/privacy\";\n","export const encodeBase64 = (data: ArrayBuffer): string => {\n return btoa(String.fromCharCode(...new Uint8Array(data)));\n};\n\nexport const decodeBase64 = (base64: string): ArrayBuffer => {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes.buffer;\n};\n\nexport const encryptPayload = async (\n key: CryptoKey,\n iv: Uint8Array,\n payload: object\n): Promise<ArrayBuffer> => {\n const encoder = new TextEncoder();\n const encoded = encoder.encode(JSON.stringify(payload));\n\n return crypto.subtle.encrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encoded\n );\n};\n\nexport const decryptPayload = async (\n key: CryptoKey,\n ivBase64: string,\n encryptedBase64: string\n): Promise<string> => {\n const iv = new Uint8Array(decodeBase64(ivBase64));\n const encryptedData = decodeBase64(encryptedBase64);\n\n const decryptedBuffer = await crypto.subtle.decrypt(\n {\n name: \"AES-GCM\",\n iv: iv,\n },\n key,\n encryptedData\n );\n\n const decoder = new TextDecoder();\n const decodedText = decoder.decode(decryptedBuffer);\n // return JSON.parse(decodedText);\n return decodedText;\n};\n\nexport const importKeyFromBase64 = async (\n keyBase64: string\n): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64);\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n\nexport const generateKeyIv = async () => {\n const key = await crypto.subtle.generateKey(\n {\n name: \"AES-GCM\",\n length: 256,\n },\n true,\n [\"encrypt\"]\n );\n\n const exportedKey = await crypto.subtle.exportKey(\"raw\", key); // Export as ArrayBuffer\n const keyBase64 = encodeBase64(exportedKey); // Your existing encodeBase64 function\n const iv = crypto.getRandomValues(new Uint8Array(12)); // 96-bit IV for AES-GCM\n\n return { key, keyBase64, iv };\n};\n\nexport const keyFromBase64 = async (keyBase64: string): Promise<CryptoKey> => {\n const rawKey = decodeBase64(keyBase64); // Convert to ArrayBuffer\n return crypto.subtle.importKey(\"raw\", rawKey, { name: \"AES-GCM\" }, true, [\n \"decrypt\",\n ]);\n};\n","import { API_URL } from \"./constants\";\nimport { encodeBase64, encryptPayload, generateKeyIv } from \"./cryptoUtils\";\n\nexport interface ISession {\n sessionId: string;\n sessionAuthToken: string;\n key: string;\n keyObject: CryptoKey;\n iv: string;\n}\n\ninterface IParam {\n appId: string;\n idpContext: string;\n idpTypeId: string;\n idpQuery: string;\n}\nexport const createBridgeSession = async (\n payload: IParam\n): Promise<ISession> => {\n // Generate AES-GCM key and IV\n\n const { key, keyBase64, iv } = await generateKeyIv();\n\n // Encrypt the payload\n const encrypted = await encryptPayload(key, iv, payload);\n\n // Base64 encode IV and encrypted data\n const ivBase64 = encodeBase64(iv.buffer);\n const payloadBase64 = encodeBase64(encrypted);\n\n // Send encrypted payload to the bridge\n const response = await fetch(`${API_URL}sessions`, {\n method: \"POST\",\n headers: {\n // \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n iv: ivBase64,\n payload: payloadBase64,\n }),\n });\n\n const result = await response.json();\n if (!result.sessionId) {\n throw new Error(result?.userMessage || \"verification error\");\n }\n return {\n sessionId: result?.sessionId,\n sessionAuthToken: result?.sessionAuthToken,\n key: keyBase64,\n keyObject: key,\n iv: ivBase64,\n };\n};\n\nexport interface ISessionStatus {\n status: \"initialized\" | \"received\" | \"completed\" | \"error\";\n response: {\n payload: string;\n iv: string;\n };\n userMessage?: string;\n}\n\nexport const getSessionStatus = async (\n sessionId: string\n): Promise<ISessionStatus> => {\n const status = await fetch(`${API_URL}session/${sessionId}`);\n return await status.json();\n};\n","import { VERIFY_PROOF_URL } from \"./constants\";\n\nexport const verifyProof = async (proof: string, url?: string) => {\n const response = await fetch(url || VERIFY_PROOF_URL, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n proof: proof,\n }),\n });\n\n return await response.json();\n};\n","import QRCodeStyling from \"qr-code-styling\";\nimport { TermsUrl, PrivacyUrl } from \"../tools/constants\";\nimport { logoSVG } from \"./svgs\";\n\nexport const createFooterElement = (): HTMLElement => {\n const footer = document.createElement(\"div\");\n footer.className = \"very-footer\";\n\n const logoRow = document.createElement(\"div\");\n logoRow.className = \"very-footer-logo\";\n\n const poweredByText = document.createElement(\"span\");\n poweredByText.textContent = \"Powered by\";\n logoRow.appendChild(poweredByText);\n\n const brandLogo = document.createElement(\"img\");\n brandLogo.className = \"very-footer-brand\";\n brandLogo.alt = \"VeryAI\";\n brandLogo.src = \"https://assets.very.org/branding/logo-light.svg\";\n logoRow.appendChild(brandLogo);\n\n const linksRow = document.createElement(\"div\");\n linksRow.className = \"very-footer-links\";\n\n const tosLink = document.createElement(\"a\");\n tosLink.className = \"very-terms\";\n tosLink.href = TermsUrl;\n tosLink.target = \"_blank\";\n tosLink.rel = \"noopener noreferrer\";\n tosLink.textContent = \"Terms of Service\";\n\n const separator = document.createElement(\"span\");\n separator.className = \"very-footer-sep\";\n separator.textContent = \"·\";\n\n const ppLink = document.createElement(\"a\");\n ppLink.className = \"very-terms\";\n ppLink.href = PrivacyUrl;\n ppLink.target = \"_blank\";\n ppLink.rel = \"noopener noreferrer\";\n ppLink.textContent = \"Privacy Policy\";\n\n linksRow.appendChild(tosLink);\n linksRow.appendChild(separator);\n linksRow.appendChild(ppLink);\n\n footer.appendChild(logoRow);\n footer.appendChild(linksRow);\n\n return footer;\n};\n\nconst qrCode = new QRCodeStyling({\n width: 240,\n height: 240,\n backgroundOptions: {\n color: \"#fafbff\",\n },\n dotsOptions: {\n color: \"#000000\",\n type: \"dots\",\n },\n cornersDotOptions: {\n type: \"rounded\",\n color: \"#000000\",\n },\n cornersSquareOptions: {\n type: \"extra-rounded\",\n color: \"#000000\",\n },\n qrOptions: {\n errorCorrectionLevel: \"Q\",\n },\n type: \"svg\",\n});\n\nexport const createQRCodeElement = (\n url: string,\n isProcessing: boolean\n): HTMLElement => {\n const container = document.createElement(\"div\");\n container.className = \"very-center\";\n\n // Create Logo\n const logo = document.createElement(\"div\");\n logo.innerHTML = logoSVG;\n\n // Create title\n const title = document.createElement(\"div\");\n title.className = \"title\";\n title.textContent = \"Verify with VeryAI\";\n\n // Create tip\n const tip = document.createElement(\"div\");\n tip.className = \"tip\";\n tip.textContent = \"Please use your VeryAI App to scan the QR code\";\n\n // Create QR code container\n const qrContainer = document.createElement(\"div\");\n qrContainer.className = \"very-center\";\n qrContainer.style.position = \"relative\";\n qrContainer.style.borderRadius = \"17px\";\n qrContainer.style.overflow = \"hidden\";\n\n // Need to integrate QR code generation library here\n qrCode.update({\n data: url,\n });\n\n qrCode.append(qrContainer);\n\n // If processing, add processing overlay\n if (isProcessing) {\n const processing = document.createElement(\"div\");\n processing.className = \"very-processing\";\n\n const loading = createLoadingElement();\n const text = document.createElement(\"div\");\n\n text.innerHTML = `\n \n <div style=\"margin-top: 16px; text-align: center;\">\n Please wait while we <br /> process your verification.\n </div>\n `;\n processing.appendChild(loading);\n processing.appendChild(text);\n qrContainer.appendChild(processing);\n }\n\n container.appendChild(logo);\n container.appendChild(title);\n container.appendChild(tip);\n container.appendChild(qrContainer);\n\n return container;\n};\n\nexport const createErrorElement = (\n errorText: string,\n onRefresh: () => void\n): HTMLElement => {\n const error = document.createElement(\"div\");\n error.className = \"very-center\";\n\n const isExpired = errorText.includes(\"has expired\");\n\n error.innerHTML = `\n ${\n isExpired\n ? `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n`\n : `\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16310)\">\n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary)\" stroke-width=\"2\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16310\">\n<rect width=\"48\" height=\"48\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`\n }\n <div class=\"error\">${\n isExpired ? \"Session Expired\" : \"Verification Failed\"\n }</div>\n <div style=\"font-size: 16px; color: var(--very-secondary);\">${\n errorText || \"Unable to verify your identity. Please try again.\"\n }</div>\n <div class=\"very-try-again\" onclick=\"this.dispatchEvent(new CustomEvent('refresh'))\">\n Try Again\n </div>\n `;\n\n error.addEventListener(\"refresh\", onRefresh);\n\n return error;\n};\n\nexport const createLoadingElement = (): HTMLElement => {\n const loading = document.createElement(\"div\");\n loading.className = \"very-loading\";\n\n const loadingAnimation = document.createElement(\"div\");\n loadingAnimation.className = \"very-loading-animation\";\n loadingAnimation.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n <path d=\"M45.2919 48.2242C46.0765 49.1592 45.9594 50.5618 44.9612 51.2641C42.2207 53.1923 39.1273 54.5767 35.8488 55.3336C31.8508 56.2566 27.6913 56.2203 23.7101 55.2277C19.7289 54.2351 16.0391 52.3143 12.9425 49.6225C9.84589 46.9307 7.4303 43.5441 5.89325 39.7399C4.35621 35.9356 3.74134 31.8215 4.09893 27.7341C4.45651 23.6466 5.7764 19.7018 7.95067 16.2222C10.1249 12.7426 13.0919 9.82699 16.6089 7.71373C19.493 5.98075 22.6799 4.82769 25.9907 4.31098C27.1966 4.12277 28.2552 5.05039 28.3403 6.26796C28.4255 7.48554 27.5041 8.5301 26.3016 8.73928C23.6866 9.19418 21.1714 10.1288 18.8854 11.5024C15.9663 13.2564 13.5037 15.6764 11.6991 18.5644C9.89441 21.4525 8.79891 24.7267 8.50211 28.1193C8.20531 31.5119 8.71565 34.9265 9.9914 38.0841C11.2672 41.2416 13.2721 44.0524 15.8423 46.2867C18.4125 48.5209 21.475 50.1151 24.7794 50.939C28.0837 51.7629 31.5362 51.793 34.8545 51.0269C37.4531 50.427 39.9116 49.3521 42.1087 47.8627C43.119 47.1779 44.5074 47.2892 45.2919 48.2242Z\" fill=\"var(--very-active, #3692cd)\"/>\n</svg>`;\n\n const loadingLogo = document.createElement(\"div\");\n loadingLogo.className = \"very-loading-logo\";\n loadingLogo.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\">\n<path d=\"M36.1162 42L37.465 39.6611L32.2009 30.5306L31.7292 31.3485C31.1859 32.2908 31.186 33.4512 31.7294 34.3935L36.1162 42Z\" fill=\"#FAFBFF\"/>\n<path d=\"M44.0792 28.1905L42.7304 30.5294L32.2003 30.5304L32.6705 29.7152C33.2147 28.7716 34.2213 28.1902 35.3106 28.1902L44.0792 28.1905Z\" fill=\"#FAFBFF\"/>\n<path d=\"M35.2462 18L37.9438 18L33.5589 25.6042C33.0148 26.5479 32.0083 27.1294 30.919 27.1294L29.9802 27.1295L35.2462 18Z\" fill=\"#FAFBFF\"/>\n<path d=\"M24.7144 18.0006L22.0168 18.0006L26.4016 25.6048C26.9458 26.5485 27.9523 27.1299 29.0416 27.13L29.9804 27.13L24.7144 18.0006Z\" fill=\"#FAFBFF\"/>\n<path d=\"M17.6184 30.4731L16.2697 28.1342L25.0383 28.1339C26.1276 28.1339 27.1342 28.7153 27.6784 29.6589L28.1482 30.4736L28.1486 30.4742L28.6199 31.2915C29.1632 32.2338 29.1631 33.3942 28.6197 34.3364L24.2329 41.9429L22.8841 39.6041L28.1479 30.4742L17.6184 30.4731Z\" fill=\"#FAFBFF\"/>\n</svg>`;\n\n loading.appendChild(loadingAnimation);\n loading.appendChild(loadingLogo);\n\n return loading;\n};\n","export const closeSVG = `\n<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<g clip-path=\"url(#clip0_2453_16329)\">\n<path d=\"M0.815918 0.816406L19.184 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M19.184 0.816406L0.815918 19.1845\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"0.833333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</g>\n<defs>\n<clipPath id=\"clip0_2453_16329\">\n<rect width=\"20\" height=\"20\" fill=\"white\"/>\n</clipPath>\n</defs>\n</svg>\n`;\n\nexport const errorSVG = `<svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<g clip-path=\"url(#clip0_2453_16310)\"> \n<path d=\"M34.542 46.043C40.8933 46.043 46.042 40.8942 46.042 34.543C46.042 28.1917 40.8933 23.043 34.542 23.043C28.1907 23.043 23.042 28.1917 23.042 34.543C23.042 40.8942 28.1907 46.043 34.542 46.043Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M30.948 31.7461C30.948 31.0354 31.1588 30.3404 31.5537 29.7495C31.9485 29.1586 32.5099 28.6978 33.1665 28.4259C33.8232 28.1539 34.5458 28.0828 35.2429 28.2214C35.94 28.3601 36.5803 28.7022 37.0829 29.205C37.5854 29.7075 37.9277 30.3479 38.0665 31.045C38.2051 31.7421 38.134 32.4647 37.862 33.1213C37.59 33.778 37.1292 34.3394 36.5383 34.7342C35.9474 35.129 35.2524 35.3399 34.5417 35.3399V37.2565\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M15.3751 18.2526C19.8739 18.2526 23.5209 14.6056 23.5209 10.1068C23.5209 5.60795 19.8739 1.96094 15.3751 1.96094C10.8763 1.96094 7.22925 5.60795 7.22925 10.1068C7.22925 14.6056 10.8763 18.2526 15.3751 18.2526Z\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M17.2916 34.5382H1.95825C1.95816 32.1291 2.60669 29.7645 3.83576 27.6926C5.06482 25.6207 6.8291 23.9179 8.94328 22.7631C11.0575 21.6083 13.4436 21.0441 15.8511 21.1295C18.2586 21.215 20.5988 21.9472 22.6257 23.249\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M34.5414 42.0482C34.2767 42.0482 34.0623 41.8337 34.0623 41.569C34.0623 41.3043 34.2767 41.0898 34.5414 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> \n<path d=\"M34.5415 42.0482C34.8062 42.0482 35.0207 41.8337 35.0207 41.569C35.0207 41.3043 34.8062 41.0898 34.5415 41.0898\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" /> </g> <defs> <clipPath id=\"clip0_2453_16310\"> <rect width=\"48\" height=\"48\" fill=\"white\" /> </clipPath> </defs>\n</svg>`;\n\nexport const expiredSVG = ` <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> \n<path d=\"M39.8379 2.4375H45.5624L39.8379 9.68852H45.5624\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M25.7168 6.94531H35.4487L25.7168 18.5853H35.4487\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.3745 9.68359C10.4519 9.68359 2.4375 17.6981 2.4375 27.6208C2.4375 37.5434 10.4519 45.5577 20.3745 45.5577C30.2973 45.5577 38.3116 37.5434 38.3116 27.6208C38.3116 24.8453 37.995 23.6748 37.9271 23.3198\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5652 27.6289H11.4058\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /> \n<path d=\"M20.5654 27.6289L25.7176 37.1701\" stroke=\"var(--very-primary, #fafbff)\" stroke-width=\"2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n</svg>`;\n\nexport const logoSVG = `<svg width=\"56\" height=\"48\" viewBox=\"0 0 56 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M39.908 48L42.6111 43.3223L32.0612 25.0612L31.116 26.6971C30.0271 28.5816 30.0272 30.9025 31.1162 32.7869L39.908 48Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M55.8667 20.381L53.1636 25.0587L32.0601 25.0609L33.0023 23.4304C34.093 21.5431 36.1102 20.3803 38.2934 20.3804L55.8667 20.381Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M38.1644 0L43.5705 8.04476e-07L34.7829 15.2084C33.6923 17.0958 31.6752 18.2587 29.4921 18.2589L27.6108 18.2589L38.1644 0Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M17.0574 0.00113337L11.6513 0.0011325L20.4389 15.2095C21.5295 17.0969 23.5466 18.2599 25.7297 18.26L27.611 18.2601L17.0574 0.00113337Z\" fill=\"var(--very-primary, #fafbff)\"/>\n<path d=\"M2.8364 24.9462L0.133331 20.2685L17.7066 20.2679C19.8897 20.2678 21.907 21.4306 22.9977 23.3179L23.9393 24.9471L23.9399 24.9483L24.8844 26.583C25.9733 28.4675 25.9732 30.7884 24.8842 32.6728L16.0924 47.8859L13.3893 43.2082L23.9386 24.9483L2.8364 24.9462Z\" fill=\"var(--very-primary, #fafbff)\"/>\n</svg>\n`;\n","import \"../styles/styles.css\";\nimport { QR_URL } from \"../tools/constants\";\nimport {\n createBridgeSession,\n getSessionStatus,\n ISession,\n} from \"../tools/createSession\";\nimport { decryptPayload, keyFromBase64 } from \"../tools/cryptoUtils\";\nimport { verifyProof } from \"../tools/verifyProof\";\nimport {\n createErrorElement,\n createFooterElement,\n createLoadingElement,\n createQRCodeElement,\n} from \"./components\";\nimport { closeSVG } from \"./svgs\";\n\nexport interface IVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\nexport interface IVeryWidgetState {\n type: \"loading\" | \"qr-code\" | \"processing\" | \"error\";\n url?: string;\n errorText?: string;\n isProcessing?: boolean;\n}\n\nexport class VeryWidgetVanilla {\n private config: IVeryWidgetConfig;\n private session?: ISession;\n private timer?: number;\n private isOpen = false;\n private overlay?: HTMLElement;\n private widget?: HTMLElement;\n private content?: HTMLElement;\n\n constructor(config: IVeryWidgetConfig) {\n this.config = config;\n this.init();\n }\n\n private init(): void {\n // If there's a trigger element, bind click event\n if (this.config.triggerElement) {\n const trigger =\n typeof this.config.triggerElement === \"string\"\n ? document.querySelector(this.config.triggerElement)\n : this.config.triggerElement;\n\n if (trigger) {\n trigger.addEventListener(\"click\", () => this.open());\n }\n }\n }\n\n open(): void {\n if (this.isOpen) return;\n\n this.isOpen = true;\n this.createUI();\n this.getSession();\n }\n\n close(): void {\n if (!this.isOpen) return;\n\n this.isOpen = false;\n this.cleanup();\n this.destroyUI();\n }\n\n private createUI(): void {\n // Create overlay\n this.overlay = document.createElement(\"div\");\n this.overlay.className = \"very-dialog-overlay\";\n\n // Create widget container\n this.widget = document.createElement(\"div\");\n this.widget.className = `very-widget ${this.config.theme || \"default\"}`;\n this.widget.id = \"very-widget\";\n\n // Create content area\n this.content = document.createElement(\"div\");\n this.content.className = \"very-content\";\n\n // Create close button\n const closeButton = this.createCloseButton();\n\n // Create footer\n const footer = createFooterElement();\n\n // Assemble DOM\n this.widget.appendChild(this.content);\n this.widget.appendChild(footer);\n this.widget.appendChild(closeButton);\n this.overlay.appendChild(this.widget);\n\n // Bind events\n this.overlay.addEventListener(\"click\", (e) => {\n if (e.target === this.overlay) {\n this.close();\n }\n });\n\n // Add to page\n document.body.appendChild(this.overlay);\n\n // Show loading state\n this.updateState({ type: \"loading\" });\n }\n\n private destroyUI(): void {\n if (this.overlay && this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n this.overlay = undefined;\n this.widget = undefined;\n this.content = undefined;\n }\n\n private createCloseButton(): HTMLElement {\n const closeButton = document.createElement(\"div\");\n closeButton.className = \"very-close\";\n closeButton.innerHTML = closeSVG;\n closeButton.addEventListener(\"click\", () => this.close());\n return closeButton;\n }\n\n private updateState(state: IVeryWidgetState): void {\n if (!this.content) return;\n\n this.content.innerHTML = \"\";\n\n switch (state.type) {\n case \"loading\":\n this.content.appendChild(createLoadingElement());\n break;\n case \"qr-code\":\n this.content.appendChild(\n createQRCodeElement(state.url!, state.isProcessing || false)\n );\n break;\n case \"processing\":\n this.content.appendChild(createQRCodeElement(state.url!, true));\n break;\n case \"error\":\n this.content.appendChild(\n createErrorElement(state.errorText!, this.refresh)\n );\n break;\n }\n }\n\n private async getSession(): Promise<void> {\n try {\n const res = await createBridgeSession({\n appId: this.config.appId,\n idpContext: this.config.context,\n idpTypeId: this.config.typeId,\n idpQuery: this.config.query,\n });\n this.session = res;\n setTimeout(() => {\n this.updateState({\n type: \"qr-code\",\n url: this.getUrl(),\n isProcessing: false,\n });\n }, 1000);\n this.startPolling();\n } catch (error) {\n console.error(error);\n const errorMessage = String(error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n }\n\n private getUrl(): string | undefined {\n if (!this.session) {\n return undefined;\n }\n\n const query = new URLSearchParams();\n [\"sessionId\", \"key\"].forEach((key) => {\n query.append(key, this.session![key]);\n });\n query.append(\"action\", \"verify\");\n // query.append(\"requestId\", \"\");\n // query.append(\"clientId\", \"\");\n\n return `${QR_URL}?${query.toString()}`;\n }\n\n private startPolling(): void {\n this.timer = setInterval(async () => {\n if (!this.session?.sessionId) {\n return;\n }\n\n try {\n const res = await getSessionStatus(this.session.sessionId);\n console.log(\"sessionId= \", this.session?.sessionId, \"status = \", res);\n\n if (res.status === \"error\") {\n this.config.onError?.(res.userMessage);\n this.updateState({\n type: \"error\",\n errorText: res.userMessage,\n });\n this.cleanup();\n return;\n }\n\n if (res?.status === \"received\") {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n return;\n }\n\n if (res?.status === \"completed\" && res.response) {\n this.updateState({\n type: \"processing\",\n isProcessing: true,\n });\n this.cleanup();\n\n try {\n const proof = await decryptPayload(\n await keyFromBase64(this.session.key),\n res.response.iv,\n res.response.payload\n );\n\n const verifyRes = await verifyProof(proof, this.config.verifyUrl);\n if (verifyRes.status === \"valid\") {\n this.config.onSuccess(proof);\n this.close();\n } else {\n this.config.onError?.(\"verify invalid\");\n this.updateState({\n type: \"error\",\n errorText: \"verify invalid\",\n });\n }\n } catch (error) {\n const errorMessage = String(error?.message || error);\n this.config.onError?.(errorMessage);\n this.updateState({\n type: \"error\",\n errorText: errorMessage,\n });\n }\n return;\n }\n\n // Update QR code state\n const url = this.getUrl();\n if (url) {\n this.updateState({\n type: \"qr-code\",\n url,\n isProcessing: false,\n });\n\n // Auto redirect on mobile\n this.handleMobileRedirect(url);\n }\n } catch (error) {\n console.error(\"Polling error:\", error);\n }\n }, 3000);\n }\n\n private handleMobileRedirect(url: string): void {\n const isMobile = /Mobile|Android|iPhone|iPad|iPod|Mobile|Tablet/i.test(\n navigator.userAgent\n );\n\n if (isMobile) {\n setTimeout(() => {\n const link = document.createElement(\"a\");\n link.href = url;\n link.target = \"_blank\";\n link.rel = \"noopener noreferrer\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }, 300);\n }\n }\n\n private cleanup(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n refresh(): void {\n this.cleanup();\n this.getSession();\n }\n\n destroy(): void {\n this.close();\n }\n}\n\n// Global function for easy direct calling\nexport function createVeryWidget(config: IVeryWidgetConfig): VeryWidgetVanilla {\n return new VeryWidgetVanilla(config);\n}\n","import React, { useEffect, useRef } from \"react\";\nimport { IWidgetProps } from \"../../types\";\nimport {\n createVeryWidget,\n IVeryWidgetConfig,\n VeryWidgetVanilla,\n} from \"../../vanilla/VeryWidget\";\n\nexport const VeryWidget: React.FC<IWidgetProps> = ({\n children,\n className,\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme = \"default\",\n}) => {\n const widgetRef = useRef<VeryWidgetVanilla>(null);\n\n useEffect(() => {\n const config: IVeryWidgetConfig = {\n appId,\n context,\n typeId,\n query,\n verifyUrl,\n onSuccess,\n theme,\n };\n\n widgetRef.current = createVeryWidget(config);\n\n return () => {\n if (widgetRef.current) {\n widgetRef.current.destroy();\n }\n };\n }, [appId, context, typeId, query, verifyUrl, onSuccess, theme]);\n\n const handleOpen = () => {\n if (widgetRef.current) {\n widgetRef.current.open();\n }\n };\n\n if (children) {\n return <div className={className}>{children({ open: handleOpen })}</div>;\n }\n\n return (\n <div className={className}>\n <button onClick={handleOpen}>Open VeryAI Widget</button>\n </div>\n );\n};\n\nexport default VeryWidget;\n","import { createVeryWidget } from \"../../vanilla/VeryWidget\";\n\nexport interface IUseVeryWidgetConfig {\n appId: string;\n context: string;\n typeId: string;\n query: string;\n verifyUrl?: string;\n onSuccess: (proof: string) => void;\n onError?: (error: string) => void;\n theme?: \"default\" | \"light\" | \"dark\";\n triggerElement?: string | HTMLElement;\n}\n\n/**\n * Vue adapter - re-export vanilla implementation\n */\nexport { createVeryWidget } from \"../../vanilla/VeryWidget\";\nexport type { IVeryWidgetConfig } from \"../../vanilla/VeryWidget\";\n\n/**\n * Vue 3 Composition API Hook (requires Vue 3 environment)\n * Usage example:\n *\n * import { useVeryWidget } from '@veryai/widget/adapters/vue';\n *\n * const { isOpen, open, close, destroy } = useVeryWidget({\n * appId: 'your-app-id',\n * context: 'your-context',\n * typeId: 'your-type-id',\n * query: 'your-query',\n * onSuccess: (proof) => console.log('Success:', proof),\n * onError: (error) => console.error('Error:', error),\n * });\n */\nexport const useVeryWidget = (config: IUseVeryWidgetConfig) => {\n let widgetInstance: ReturnType<typeof createVeryWidget> | null = null;\n let isOpen = false;\n\n const open = () => {\n if (!widgetInstance) {\n widgetInstance = createVeryWidget({\n ...config,\n onSuccess: (proof) => {\n config.onSuccess(proof);\n isOpen = false;\n },\n onError: (error) => {\n config.onError?.(error);\n isOpen = false;\n },\n });\n }\n widgetInstance.open();\n isOpen = true;\n };\n\n const close = () => {\n if (widgetInstance) {\n widgetInstance.close();\n isOpen = false;\n }\n };\n\n const destroy = () => {\n if (widgetInstance) {\n widgetInstance.destroy();\n widgetInstance = null;\n isOpen = false;\n }\n };\n\n return {\n get isOpen() {\n return isOpen;\n },\n open,\n close,\n destroy,\n };\n};\n"],"mappings":";AACyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aAAa,YAAa;AAE7C,QAAM,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACrE,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,OAAO;AAEb,MAAI,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AU;AACpB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,iBAAO,UAAU,KAAK;AACtB,mBAAS;AAAA,QACX;AAAA,MACF,CAAC;AAAA,IACH;AACA,mBAAe,KAAK;AACpB,aAAS;AAAA,EACX;AAEA,QAAM,QAAQ,MAAM;AAClB,QAAI,gBAAgB;AAClB,qBAAe,MAAM;AACrB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,gBAAgB;AAClB,qBAAe,QAAQ;AACvB,uBAAiB;AACjB,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,SAAS;AACX,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veryai/widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Cross-framework widget for Very palm verification.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"version": "bumpp patch ",
|
|
7
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --out-dir build --tsconfig tsconfig.json --watch",
|
|
8
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --out-dir build --tsconfig tsconfig.json ",
|
|
9
|
+
"lint:scripts": "eslint . --ext .ts",
|
|
10
|
+
"lint:styles": "stylelint ./**/*.{css,scss} --allow-empty-input",
|
|
11
|
+
"lint": "pnpm lint:scripts && pnpm lint:styles",
|
|
12
|
+
"publish": "pnpm publish --no-git-checks --access public",
|
|
13
|
+
"autoPublish": "cd packages/widget && pnpm run version && pnpm run build && pnpm run publish"
|
|
14
|
+
},
|
|
5
15
|
"main": "./build/index.js",
|
|
6
16
|
"module": "./build/index.mjs",
|
|
7
17
|
"types": "./build/index.d.ts",
|
|
@@ -56,22 +66,13 @@
|
|
|
56
66
|
},
|
|
57
67
|
"repository": {
|
|
58
68
|
"type": "git",
|
|
59
|
-
"url": "git+https://github.com/
|
|
69
|
+
"url": "git+https://github.com/veroslabs/veros-widget.git"
|
|
60
70
|
},
|
|
61
71
|
"bugs": {
|
|
62
|
-
"url": "https://github.com/
|
|
72
|
+
"url": "https://github.com/veroslabs/veros-widget/issues"
|
|
63
73
|
},
|
|
64
|
-
"homepage": "https://github.com/
|
|
74
|
+
"homepage": "https://github.com/veroslabs/veros-widget",
|
|
65
75
|
"publishConfig": {
|
|
66
76
|
"access": "public"
|
|
67
|
-
},
|
|
68
|
-
"scripts": {
|
|
69
|
-
"version": "bumpp patch ",
|
|
70
|
-
"dev": "tsup src/index.ts --format esm,cjs --dts --out-dir build --tsconfig tsconfig.json --watch",
|
|
71
|
-
"build": "tsup src/index.ts --format esm,cjs --dts --out-dir build --tsconfig tsconfig.json ",
|
|
72
|
-
"lint:scripts": "eslint . --ext .ts",
|
|
73
|
-
"lint:styles": "stylelint ./**/*.{css,scss} --allow-empty-input",
|
|
74
|
-
"lint": "pnpm lint:scripts && pnpm lint:styles",
|
|
75
|
-
"autoPublish": "cd packages/widget && pnpm run version && pnpm run build && pnpm run publish"
|
|
76
77
|
}
|
|
77
|
-
}
|
|
78
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
Copyright 2025 Very Labs
|
|
179
|
-
|
|
180
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
-
you may not use this file except in compliance with the License.
|
|
182
|
-
You may obtain a copy of the License at
|
|
183
|
-
|
|
184
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
-
|
|
186
|
-
Unless required by applicable law or agreed to in writing, software
|
|
187
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
-
See the License for the specific language governing permissions and
|
|
190
|
-
limitations under the License.
|