@worldcoin/idkit 1.0.0-alpha.7 → 1.1.0
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/{chunk-NDPS4MUA.js → chunk-JCPD6J62.js} +2 -5
- package/build/{config-6a355d3b.d.ts → config-71e4be16.d.ts} +1 -3
- package/build/index.d.ts +3 -20
- package/build/index.js +296 -336
- package/build/internal.d.ts +1 -2
- package/build/internal.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -4
|
@@ -36,7 +36,6 @@ var useIDKitStore = createWithEqualityFn()(
|
|
|
36
36
|
verification_level: DEFAULT_VERIFICATION_LEVEL,
|
|
37
37
|
open: false,
|
|
38
38
|
result: null,
|
|
39
|
-
theme: "light",
|
|
40
39
|
errorTitle: "",
|
|
41
40
|
errorDetail: "",
|
|
42
41
|
autoClose: true,
|
|
@@ -86,16 +85,14 @@ var useIDKitStore = createWithEqualityFn()(
|
|
|
86
85
|
action_description,
|
|
87
86
|
bridge_url,
|
|
88
87
|
autoClose,
|
|
89
|
-
theme,
|
|
90
88
|
advanced
|
|
91
89
|
}, source) => {
|
|
92
90
|
set({
|
|
93
|
-
theme,
|
|
94
91
|
signal,
|
|
95
92
|
action,
|
|
96
|
-
autoClose,
|
|
97
93
|
bridge_url,
|
|
98
94
|
action_description,
|
|
95
|
+
autoClose: autoClose ?? true,
|
|
99
96
|
app_id: advanced?.self_hosted ? SELF_HOSTED_APP_ID : app_id,
|
|
100
97
|
verification_level: verification_level ?? DEFAULT_VERIFICATION_LEVEL
|
|
101
98
|
});
|
|
@@ -111,7 +108,7 @@ var useIDKitStore = createWithEqualityFn()(
|
|
|
111
108
|
() => {
|
|
112
109
|
set({ stage: "SUCCESS" /* SUCCESS */, result });
|
|
113
110
|
if (get().autoClose)
|
|
114
|
-
setTimeout(() => get().onOpenChange(false),
|
|
111
|
+
setTimeout(() => get().onOpenChange(false), 2500);
|
|
115
112
|
},
|
|
116
113
|
(response) => {
|
|
117
114
|
let errorMessage = void 0;
|
|
@@ -17,8 +17,6 @@ declare enum ConfigSource {
|
|
|
17
17
|
type WidgetConfig = {
|
|
18
18
|
/** Whether to automatically close the widget after a successful verification. Defaults to `false`. */
|
|
19
19
|
autoClose?: boolean;
|
|
20
|
-
/** The theme to apply to the widget's UI. Defaults to `light`. */
|
|
21
|
-
theme?: 'dark' | 'light';
|
|
22
20
|
/** Function to trigger when verification is successful. Should receive a single parameter of type `ISuccessResult` which contains the proof details. */
|
|
23
21
|
onSuccess: CallbackFn<ISuccessResult>;
|
|
24
22
|
/** Called after the proof is returned from the World App, but before showing the success screen. Throwing in this screen will show the user a custom error. Used to perform additional validation when needed. */
|
|
@@ -41,4 +39,4 @@ type WidgetProps = Config & {
|
|
|
41
39
|
}) => JSX.Element;
|
|
42
40
|
};
|
|
43
41
|
|
|
44
|
-
export { Config as C, IDKITStage as I, WidgetProps as W,
|
|
42
|
+
export { Config as C, IDKITStage as I, WidgetProps as W, ConfigSource as a, CallbackFn as b };
|
package/build/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { C as Config, W as WidgetProps
|
|
2
|
-
import { MotionProps } from 'framer-motion';
|
|
1
|
+
import { C as Config, W as WidgetProps } from './config-71e4be16.js';
|
|
3
2
|
import * as react from 'react';
|
|
4
|
-
|
|
3
|
+
export { IErrorState, ISuccessResult, VerificationLevel } from '@worldcoin/idkit-core';
|
|
5
4
|
export { solidityEncode } from '@worldcoin/idkit-core/hashing';
|
|
6
|
-
import { IDKitConfig } from '@worldcoin/idkit-core';
|
|
7
|
-
export { CredentialType, IErrorState, ISuccessResult, VerificationLevel } from '@worldcoin/idkit-core';
|
|
8
5
|
|
|
9
6
|
type HookConfig = Partial<Pick<Config, 'handleVerify' | 'onSuccess'>>;
|
|
10
7
|
declare const useIDKit: ({ handleVerify, onSuccess }?: HookConfig) => {
|
|
@@ -12,20 +9,6 @@ declare const useIDKit: ({ handleVerify, onSuccess }?: HookConfig) => {
|
|
|
12
9
|
setOpen: (open: boolean) => void;
|
|
13
10
|
};
|
|
14
11
|
|
|
15
|
-
type Props$1 = ButtonHTMLAttributes<HTMLButtonElement> & MotionProps & {
|
|
16
|
-
theme?: 'dark' | 'light';
|
|
17
|
-
};
|
|
18
|
-
declare const SignInButton: FC<Props$1>;
|
|
19
|
-
|
|
20
12
|
declare const _default: react.NamedExoticComponent<WidgetProps>;
|
|
21
13
|
|
|
22
|
-
|
|
23
|
-
nonce?: string;
|
|
24
|
-
onSuccess: (jwt: string) => void;
|
|
25
|
-
children?: ({ open }: {
|
|
26
|
-
open: () => void;
|
|
27
|
-
}) => JSX.Element;
|
|
28
|
-
};
|
|
29
|
-
declare const SignInWithWorldID: FC<Props>;
|
|
30
|
-
|
|
31
|
-
export { Config, _default as IDKitWidget, SignInButton, SignInWithWorldID, WidgetProps, useIDKit };
|
|
14
|
+
export { Config, _default as IDKitWidget, WidgetProps, useIDKit };
|
package/build/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
QRCode_default,
|
|
3
3
|
__,
|
|
4
4
|
idkit_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JCPD6J62.js";
|
|
6
6
|
|
|
7
7
|
// src/hooks/useIDKit.ts
|
|
8
8
|
import { useEffect } from "react";
|
|
@@ -24,72 +24,6 @@ var useIDKit = ({ handleVerify, onSuccess } = {}) => {
|
|
|
24
24
|
};
|
|
25
25
|
var useIDKit_default = useIDKit;
|
|
26
26
|
|
|
27
|
-
// src/components/SignInButton.tsx
|
|
28
|
-
import { motion } from "framer-motion";
|
|
29
|
-
|
|
30
|
-
// src/components/Icons/WorldcoinIcon.tsx
|
|
31
|
-
import { jsx } from "react/jsx-runtime";
|
|
32
|
-
var WorldcoinIcon = (props) => /* @__PURE__ */ jsx("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 33 32", children: /* @__PURE__ */ jsx(
|
|
33
|
-
"path",
|
|
34
|
-
{
|
|
35
|
-
fill: "currentColor",
|
|
36
|
-
d: "M30.7195 9.77312C29.9097 7.87434 28.7647 6.17103 27.2845 4.6911C25.8044 3.21117 24.1288 2.06632 22.2298 1.25654C20.247 0.418848 18.1525 0 16.0021 0C13.8238 0 11.7293 0.418848 9.7744 1.25654C7.87537 2.06632 6.17184 3.21117 4.69171 4.6911C3.21159 6.17103 2.06659 7.87434 1.25671 9.77312C0.418903 11.7277 0 13.822 0 16C0 18.1501 0.418903 20.2443 1.25671 22.2269C2.06659 24.1257 3.21159 25.829 4.69171 27.3089C6.17184 28.7888 7.87537 29.9337 9.7744 30.7155C11.7572 31.5532 13.8517 31.9721 16.0021 31.9721C18.1525 31.9721 20.247 31.5532 22.2298 30.7155C24.1288 29.9058 25.8323 28.7609 27.3125 27.281C28.7926 25.801 29.9376 24.0977 30.7475 22.1989C31.5853 20.2164 32.0042 18.1222 32.0042 15.9721C32.0042 13.822 31.5574 11.7277 30.7195 9.77312ZM10.696 14.4921C11.3383 11.9232 13.6842 10.0524 16.4489 10.0524H27.5638C28.2899 11.4206 28.7367 12.9284 28.9043 14.4921H10.696ZM28.9043 17.5079C28.7367 19.0716 28.262 20.5794 27.5638 21.9476H16.4489C13.6842 21.9476 11.3662 20.0489 10.696 17.5079H28.9043ZM6.81415 6.81326C9.27172 4.35602 12.5392 3.01571 16.0021 3.01571C19.465 3.01571 22.7325 4.35602 25.19 6.81326C25.2738 6.89703 25.3297 6.95288 25.4134 7.03665H16.4489C14.0472 7.03665 11.8131 7.95811 10.1095 9.66143C8.76903 11.0017 7.9033 12.6771 7.62403 14.4921H3.09988C3.435 11.5881 4.71964 8.9075 6.81415 6.81326ZM16.0021 28.9843C12.5392 28.9843 9.27172 27.644 6.81415 25.1867C4.71964 23.0925 3.435 20.3839 3.09988 17.5079H7.62403C7.93123 19.3229 8.79696 20.9983 10.1095 22.3386C11.8131 24.0419 14.0472 24.9633 16.4489 24.9633H25.4134C25.3297 25.0471 25.2738 25.103 25.19 25.1867C22.7325 27.644 19.465 28.9843 16.0021 28.9843Z"
|
|
37
|
-
}
|
|
38
|
-
) });
|
|
39
|
-
var WorldcoinIcon_default = WorldcoinIcon;
|
|
40
|
-
|
|
41
|
-
// src/components/SignInButton.tsx
|
|
42
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
43
|
-
var SignInButton = ({ style, theme = "light", ...props }) => /* @__PURE__ */ jsx2(
|
|
44
|
-
motion.button,
|
|
45
|
-
{
|
|
46
|
-
whileTap: { scale: 0.98 },
|
|
47
|
-
whileHover: { scale: 1.02 },
|
|
48
|
-
style: {
|
|
49
|
-
overflow: "hidden",
|
|
50
|
-
borderStyle: "none",
|
|
51
|
-
display: "relative",
|
|
52
|
-
padding: "1.5rem 6rem",
|
|
53
|
-
borderRadius: "0.75rem",
|
|
54
|
-
borderColor: "rgba(255, 255, 255, 0.1)",
|
|
55
|
-
borderWidth: theme == "dark" ? "1px" : "0px",
|
|
56
|
-
...style
|
|
57
|
-
},
|
|
58
|
-
...props,
|
|
59
|
-
children: /* @__PURE__ */ jsx2(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
style: {
|
|
63
|
-
zIndex: 10,
|
|
64
|
-
inset: "1px",
|
|
65
|
-
display: "grid",
|
|
66
|
-
cursor: "pointer",
|
|
67
|
-
placeItems: "center",
|
|
68
|
-
position: "absolute",
|
|
69
|
-
borderRadius: "0.75rem",
|
|
70
|
-
backgroundColor: theme == "dark" ? "#000" : "#f2f5f9"
|
|
71
|
-
},
|
|
72
|
-
children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
73
|
-
/* @__PURE__ */ jsx2(WorldcoinIcon_default, { style: { height: "1rem", width: "1rem" } }),
|
|
74
|
-
/* @__PURE__ */ jsx2(
|
|
75
|
-
"span",
|
|
76
|
-
{
|
|
77
|
-
style: {
|
|
78
|
-
marginLeft: "1rem",
|
|
79
|
-
fontSize: "0.875rem",
|
|
80
|
-
lineHeight: "1.25rem",
|
|
81
|
-
fontFamily: "Rubik, ui-sans-serif, system-ui, -apple-system, sans-serif"
|
|
82
|
-
},
|
|
83
|
-
children: __("Sign in with World ID")
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
] })
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
var SignInButton_default = SignInButton;
|
|
92
|
-
|
|
93
27
|
// src/components/IDKitWidget/index.tsx
|
|
94
28
|
import { memo as memo2 } from "react";
|
|
95
29
|
|
|
@@ -773,6 +707,9 @@ select{
|
|
|
773
707
|
.-mt-\\[2px\\]{
|
|
774
708
|
margin-top: -2px;
|
|
775
709
|
}
|
|
710
|
+
.mb-10{
|
|
711
|
+
margin-bottom: 40px;
|
|
712
|
+
}
|
|
776
713
|
.mb-12{
|
|
777
714
|
margin-bottom: 48px;
|
|
778
715
|
}
|
|
@@ -806,9 +743,6 @@ select{
|
|
|
806
743
|
.inline-flex{
|
|
807
744
|
display: inline-flex;
|
|
808
745
|
}
|
|
809
|
-
.grid{
|
|
810
|
-
display: grid;
|
|
811
|
-
}
|
|
812
746
|
.hidden{
|
|
813
747
|
display: none;
|
|
814
748
|
}
|
|
@@ -842,12 +776,12 @@ select{
|
|
|
842
776
|
.h-\\[244px\\]{
|
|
843
777
|
height: 244px;
|
|
844
778
|
}
|
|
845
|
-
.min-h-\\[35rem\\]{
|
|
846
|
-
min-height: 35rem;
|
|
847
|
-
}
|
|
848
779
|
.min-h-full{
|
|
849
780
|
min-height: 100%;
|
|
850
781
|
}
|
|
782
|
+
.min-h-screen{
|
|
783
|
+
min-height: 100vh;
|
|
784
|
+
}
|
|
851
785
|
.w-12{
|
|
852
786
|
width: 48px;
|
|
853
787
|
}
|
|
@@ -945,6 +879,11 @@ select{
|
|
|
945
879
|
margin-right: calc(12px * var(--tw-space-x-reverse));
|
|
946
880
|
margin-left: calc(12px * calc(1 - var(--tw-space-x-reverse)));
|
|
947
881
|
}
|
|
882
|
+
.space-x-4 > :not([hidden]) ~ :not([hidden]){
|
|
883
|
+
--tw-space-x-reverse: 0;
|
|
884
|
+
margin-right: calc(16px * var(--tw-space-x-reverse));
|
|
885
|
+
margin-left: calc(16px * calc(1 - var(--tw-space-x-reverse)));
|
|
886
|
+
}
|
|
948
887
|
.space-x-6 > :not([hidden]) ~ :not([hidden]){
|
|
949
888
|
--tw-space-x-reverse: 0;
|
|
950
889
|
margin-right: calc(24px * var(--tw-space-x-reverse));
|
|
@@ -993,10 +932,6 @@ select{
|
|
|
993
932
|
.rounded-md{
|
|
994
933
|
border-radius: 0.375rem;
|
|
995
934
|
}
|
|
996
|
-
.rounded-t-2xl{
|
|
997
|
-
border-top-left-radius: 1rem;
|
|
998
|
-
border-top-right-radius: 1rem;
|
|
999
|
-
}
|
|
1000
935
|
.border{
|
|
1001
936
|
border-width: 1px;
|
|
1002
937
|
}
|
|
@@ -1046,6 +981,9 @@ select{
|
|
|
1046
981
|
.p-2{
|
|
1047
982
|
padding: 8px;
|
|
1048
983
|
}
|
|
984
|
+
.p-4{
|
|
985
|
+
padding: 16px;
|
|
986
|
+
}
|
|
1049
987
|
.p-7{
|
|
1050
988
|
padding: 28px;
|
|
1051
989
|
}
|
|
@@ -1108,6 +1046,10 @@ select{
|
|
|
1108
1046
|
font-size: 14px;
|
|
1109
1047
|
line-height: 20px;
|
|
1110
1048
|
}
|
|
1049
|
+
.text-xs{
|
|
1050
|
+
font-size: 12px;
|
|
1051
|
+
line-height: 16px;
|
|
1052
|
+
}
|
|
1111
1053
|
.font-bold{
|
|
1112
1054
|
font-weight: 700;
|
|
1113
1055
|
}
|
|
@@ -1147,6 +1089,10 @@ select{
|
|
|
1147
1089
|
--tw-text-opacity: 1;
|
|
1148
1090
|
color: rgb(112 134 143 / var(--tw-text-opacity));
|
|
1149
1091
|
}
|
|
1092
|
+
.text-9ba3ae{
|
|
1093
|
+
--tw-text-opacity: 1;
|
|
1094
|
+
color: rgb(155 163 174 / var(--tw-text-opacity));
|
|
1095
|
+
}
|
|
1150
1096
|
.text-9eafc0{
|
|
1151
1097
|
--tw-text-opacity: 1;
|
|
1152
1098
|
color: rgb(158 175 192 / var(--tw-text-opacity));
|
|
@@ -1298,6 +1244,9 @@ input[type='number']::-webkit-inner-spin-button,
|
|
|
1298
1244
|
.md\\:hidden{
|
|
1299
1245
|
display: none;
|
|
1300
1246
|
}
|
|
1247
|
+
.md\\:min-h-\\[35rem\\]{
|
|
1248
|
+
min-height: 35rem;
|
|
1249
|
+
}
|
|
1301
1250
|
.md\\:max-w-md{
|
|
1302
1251
|
max-width: 448px;
|
|
1303
1252
|
}
|
|
@@ -1307,6 +1256,9 @@ input[type='number']::-webkit-inner-spin-button,
|
|
|
1307
1256
|
.md\\:overflow-y-auto{
|
|
1308
1257
|
overflow-y: auto;
|
|
1309
1258
|
}
|
|
1259
|
+
.md\\:rounded-2xl{
|
|
1260
|
+
border-radius: 1rem;
|
|
1261
|
+
}
|
|
1310
1262
|
.md\\:rounded-b-2xl{
|
|
1311
1263
|
border-bottom-right-radius: 1rem;
|
|
1312
1264
|
border-bottom-left-radius: 1rem;
|
|
@@ -1318,16 +1270,16 @@ input[type='number']::-webkit-inner-spin-button,
|
|
|
1318
1270
|
`;
|
|
1319
1271
|
|
|
1320
1272
|
// src/components/Styles.tsx
|
|
1321
|
-
import { jsx
|
|
1322
|
-
var Styles = () => /* @__PURE__ */
|
|
1273
|
+
import { jsx } from "react/jsx-runtime";
|
|
1274
|
+
var Styles = () => /* @__PURE__ */ jsx("style", { children: styles_default });
|
|
1323
1275
|
var Styles_default = Styles;
|
|
1324
1276
|
|
|
1325
1277
|
// src/components/IDKitWidget/BaseWidget.tsx
|
|
1326
1278
|
import { shallow as shallow2 } from "zustand/shallow";
|
|
1327
1279
|
|
|
1328
1280
|
// src/components/Icons/XMarkIcon.tsx
|
|
1329
|
-
import { jsx as
|
|
1330
|
-
var XMarkIcon = (props) => /* @__PURE__ */
|
|
1281
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
1282
|
+
var XMarkIcon = (props) => /* @__PURE__ */ jsx2("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2(
|
|
1331
1283
|
"path",
|
|
1332
1284
|
{
|
|
1333
1285
|
strokeWidth: "1.5",
|
|
@@ -1340,14 +1292,14 @@ var XMarkIcon = (props) => /* @__PURE__ */ jsx4("svg", { ...props, xmlns: "http:
|
|
|
1340
1292
|
var XMarkIcon_default = XMarkIcon;
|
|
1341
1293
|
|
|
1342
1294
|
// src/components/Icons/ErrorIcon.tsx
|
|
1343
|
-
import { jsx as
|
|
1344
|
-
var ErrorIcon = (props) => /* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1295
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
1296
|
+
var ErrorIcon = (props) => /* @__PURE__ */ jsxs("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", children: [
|
|
1297
|
+
/* @__PURE__ */ jsx3("circle", { cx: "50", cy: "50", r: "49.375", fill: "url(#a)", fillOpacity: ".65", stroke: "url(#b)", strokeWidth: "1.25" }),
|
|
1298
|
+
/* @__PURE__ */ jsxs("g", { filter: "url(#c)", children: [
|
|
1299
|
+
/* @__PURE__ */ jsx3("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
|
|
1300
|
+
/* @__PURE__ */ jsx3("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#FFC9AD", strokeWidth: "1.136" })
|
|
1349
1301
|
] }),
|
|
1350
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ jsx3(
|
|
1351
1303
|
"path",
|
|
1352
1304
|
{
|
|
1353
1305
|
stroke: "#FF4732",
|
|
@@ -1357,16 +1309,16 @@ var ErrorIcon = (props) => /* @__PURE__ */ jsxs2("svg", { ...props, xmlns: "http
|
|
|
1357
1309
|
d: "m57.5 42.5-15 14.999m15 .001-15-14.999"
|
|
1358
1310
|
}
|
|
1359
1311
|
),
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
1313
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1314
|
+
/* @__PURE__ */ jsx3("stop", { stopColor: "#FFA483" }),
|
|
1315
|
+
/* @__PURE__ */ jsx3("stop", { offset: "1", stopColor: "#FFA483", stopOpacity: "0" })
|
|
1364
1316
|
] }),
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1367
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1318
|
+
/* @__PURE__ */ jsx3("stop", { stopColor: "#FFA483" }),
|
|
1319
|
+
/* @__PURE__ */ jsx3("stop", { offset: ".713", stopColor: "#FFA483", stopOpacity: "0" })
|
|
1368
1320
|
] }),
|
|
1369
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ jsxs(
|
|
1370
1322
|
"filter",
|
|
1371
1323
|
{
|
|
1372
1324
|
id: "c",
|
|
@@ -1377,13 +1329,13 @@ var ErrorIcon = (props) => /* @__PURE__ */ jsxs2("svg", { ...props, xmlns: "http
|
|
|
1377
1329
|
colorInterpolationFilters: "sRGB",
|
|
1378
1330
|
filterUnits: "userSpaceOnUse",
|
|
1379
1331
|
children: [
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
/* @__PURE__ */
|
|
1383
|
-
/* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ jsx3("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1333
|
+
/* @__PURE__ */ jsx3("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
|
|
1334
|
+
/* @__PURE__ */ jsx3("feOffset", { dy: "1.875" }),
|
|
1335
|
+
/* @__PURE__ */ jsx3("feGaussianBlur", { stdDeviation: "1.875" }),
|
|
1336
|
+
/* @__PURE__ */ jsx3("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 0.788235 0 0 0 0 0.678431 0 0 0 0.45 0" }),
|
|
1337
|
+
/* @__PURE__ */ jsx3("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_740" }),
|
|
1338
|
+
/* @__PURE__ */ jsx3("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_740", result: "shape" })
|
|
1387
1339
|
]
|
|
1388
1340
|
}
|
|
1389
1341
|
)
|
|
@@ -1395,8 +1347,8 @@ var ErrorIcon_default = ErrorIcon;
|
|
|
1395
1347
|
import { AppErrorCodes } from "@worldcoin/idkit-core";
|
|
1396
1348
|
|
|
1397
1349
|
// src/components/Icons/ReloadIcon.tsx
|
|
1398
|
-
import { jsx as
|
|
1399
|
-
var ReloadIcon = (props) => /* @__PURE__ */
|
|
1350
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1351
|
+
var ReloadIcon = (props) => /* @__PURE__ */ jsx4("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx4(
|
|
1400
1352
|
"path",
|
|
1401
1353
|
{
|
|
1402
1354
|
d: "M12.3809 1.6665L13.3626 4.24214C12.3754 3.66434 11.2263 3.33317 9.99992 3.33317C6.31802 3.33317 3.33325 6.31794 3.33325 9.99984C3.33325 11.2141 3.6579 12.3526 4.22513 13.3332M7.61897 18.3332L6.63719 15.7575C7.62438 16.3353 8.77348 16.6665 9.99992 16.6665C13.6818 16.6665 16.6666 13.6817 16.6666 9.99984C16.6666 8.78555 16.3419 7.64708 15.7747 6.6665",
|
|
@@ -1408,16 +1360,79 @@ var ReloadIcon = (props) => /* @__PURE__ */ jsx6("svg", { width: "20", height: "
|
|
|
1408
1360
|
) });
|
|
1409
1361
|
var ReloadIcon_default = ReloadIcon;
|
|
1410
1362
|
|
|
1363
|
+
// src/components/Icons/WarningIcon.tsx
|
|
1364
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1365
|
+
var WarningIcon = (props) => /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", ...props, children: [
|
|
1366
|
+
/* @__PURE__ */ jsx5(
|
|
1367
|
+
"circle",
|
|
1368
|
+
{
|
|
1369
|
+
cx: "50",
|
|
1370
|
+
cy: "50",
|
|
1371
|
+
r: "49.375",
|
|
1372
|
+
fill: "url(#warning-a)",
|
|
1373
|
+
fillOpacity: ".65",
|
|
1374
|
+
stroke: "url(#warning-b)",
|
|
1375
|
+
strokeWidth: "1.25"
|
|
1376
|
+
}
|
|
1377
|
+
),
|
|
1378
|
+
/* @__PURE__ */ jsxs2("g", { filter: "url(#warning-c)", children: [
|
|
1379
|
+
/* @__PURE__ */ jsx5("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
|
|
1380
|
+
/* @__PURE__ */ jsx5("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#FFE999", strokeWidth: "1.136" })
|
|
1381
|
+
] }),
|
|
1382
|
+
/* @__PURE__ */ jsx5(
|
|
1383
|
+
"path",
|
|
1384
|
+
{
|
|
1385
|
+
fill: "#FFB200",
|
|
1386
|
+
fillRule: "evenodd",
|
|
1387
|
+
d: "M47.46 40.207c1.107-1.943 3.973-1.943 5.08 0l9.59 16.834c1.076 1.888-.324 4.209-2.54 4.209H40.41c-2.216 0-3.616-2.32-2.54-4.21l9.59-16.833Zm3.79 16.043a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm-.313-10a.937.937 0 1 0-1.875 0v6.25a.938.938 0 0 0 1.875 0v-6.25Z",
|
|
1388
|
+
clipRule: "evenodd"
|
|
1389
|
+
}
|
|
1390
|
+
),
|
|
1391
|
+
/* @__PURE__ */ jsxs2("defs", { children: [
|
|
1392
|
+
/* @__PURE__ */ jsxs2("linearGradient", { id: "warning-a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1393
|
+
/* @__PURE__ */ jsx5("stop", { stopColor: "#FFDA66" }),
|
|
1394
|
+
/* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "#FFDA66", stopOpacity: "0" })
|
|
1395
|
+
] }),
|
|
1396
|
+
/* @__PURE__ */ jsxs2("linearGradient", { id: "warning-b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1397
|
+
/* @__PURE__ */ jsx5("stop", { stopColor: "#FFDA66" }),
|
|
1398
|
+
/* @__PURE__ */ jsx5("stop", { offset: ".713", stopColor: "#FFDA66", stopOpacity: "0" })
|
|
1399
|
+
] }),
|
|
1400
|
+
/* @__PURE__ */ jsxs2(
|
|
1401
|
+
"filter",
|
|
1402
|
+
{
|
|
1403
|
+
id: "warning-c",
|
|
1404
|
+
width: "77.5",
|
|
1405
|
+
height: "77.5",
|
|
1406
|
+
x: "11.25",
|
|
1407
|
+
y: "13.125",
|
|
1408
|
+
colorInterpolationFilters: "sRGB",
|
|
1409
|
+
filterUnits: "userSpaceOnUse",
|
|
1410
|
+
children: [
|
|
1411
|
+
/* @__PURE__ */ jsx5("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1412
|
+
/* @__PURE__ */ jsx5("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
|
|
1413
|
+
/* @__PURE__ */ jsx5("feOffset", { dy: "1.875" }),
|
|
1414
|
+
/* @__PURE__ */ jsx5("feGaussianBlur", { stdDeviation: "1.875" }),
|
|
1415
|
+
/* @__PURE__ */ jsx5("feColorMatrix", { values: "0 0 0 0 1 0 0 0 0 0.913725 0 0 0 0 0.6 0 0 0 0.45 0" }),
|
|
1416
|
+
/* @__PURE__ */ jsx5("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_758" }),
|
|
1417
|
+
/* @__PURE__ */ jsx5("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_758", result: "shape" })
|
|
1418
|
+
]
|
|
1419
|
+
}
|
|
1420
|
+
)
|
|
1421
|
+
] })
|
|
1422
|
+
] });
|
|
1423
|
+
var WarningIcon_default = WarningIcon;
|
|
1424
|
+
|
|
1411
1425
|
// src/components/IDKitWidget/States/ErrorState.tsx
|
|
1412
|
-
import { jsx as
|
|
1426
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1413
1427
|
var getParams = ({ retryFlow, errorState }) => ({ retryFlow, errorState });
|
|
1414
1428
|
var ERROR_TITLES = {
|
|
1415
1429
|
[AppErrorCodes.GenericError]: __("Something went wrong"),
|
|
1416
|
-
[AppErrorCodes.FailedByHostApp]: __("Verification Declined")
|
|
1430
|
+
[AppErrorCodes.FailedByHostApp]: __("Verification Declined"),
|
|
1431
|
+
[AppErrorCodes.VerificationRejected]: __("Request cancelled")
|
|
1417
1432
|
};
|
|
1418
1433
|
var ERROR_MESSAGES = {
|
|
1419
1434
|
[AppErrorCodes.ConnectionFailed]: __("Connection to your wallet failed. Please try again."),
|
|
1420
|
-
[AppErrorCodes.VerificationRejected]: __("You
|
|
1435
|
+
[AppErrorCodes.VerificationRejected]: __("You\u2019ve cancelled the request in World App."),
|
|
1421
1436
|
[AppErrorCodes.MaxVerificationsReached]: __(
|
|
1422
1437
|
"You have already verified the maximum number of times for this action."
|
|
1423
1438
|
),
|
|
@@ -1432,26 +1447,26 @@ var ERROR_MESSAGES = {
|
|
|
1432
1447
|
[AppErrorCodes.InclusionProofPending]: __(
|
|
1433
1448
|
"Your identity is still being registered. Please wait a few minutes and try again."
|
|
1434
1449
|
),
|
|
1435
|
-
[AppErrorCodes.
|
|
1450
|
+
[AppErrorCodes.GenericError]: __("Something unexpected went wrong. Please try again."),
|
|
1436
1451
|
[AppErrorCodes.UnexpectedResponse]: __("Unexpected response from your wallet. Please try again."),
|
|
1437
|
-
[AppErrorCodes.
|
|
1452
|
+
[AppErrorCodes.FailedByHostApp]: __("Verification failed by the app. Please contact the app owner for details.")
|
|
1438
1453
|
};
|
|
1439
1454
|
var ErrorState = () => {
|
|
1440
1455
|
const { retryFlow, errorState } = idkit_default(getParams);
|
|
1441
1456
|
return /* @__PURE__ */ jsxs3("div", { className: "space-y-8", children: [
|
|
1442
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ jsx6("div", { className: "-mt-5 flex items-center justify-center", children: errorState?.code == AppErrorCodes.VerificationRejected ? /* @__PURE__ */ jsx6(WarningIcon_default, { className: "w-24" }) : /* @__PURE__ */ jsx6(ErrorIcon_default, { className: "w-24" }) }),
|
|
1443
1458
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ jsx6("p", { className: "text-center text-2xl font-semibold text-gray-900 dark:text-white", children: errorState?.code && ERROR_TITLES[errorState.code] || ERROR_TITLES[AppErrorCodes.GenericError] }),
|
|
1460
|
+
/* @__PURE__ */ jsx6("p", { className: "mx-auto mt-2 max-w-[14rem] text-center text-657080", children: errorState?.message || ERROR_MESSAGES[errorState?.code ?? AppErrorCodes.GenericError] })
|
|
1446
1461
|
] }),
|
|
1447
|
-
/* @__PURE__ */
|
|
1462
|
+
/* @__PURE__ */ jsx6("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs3(
|
|
1448
1463
|
"button",
|
|
1449
1464
|
{
|
|
1450
1465
|
type: "button",
|
|
1451
1466
|
onClick: retryFlow,
|
|
1452
1467
|
className: "inline-flex items-center rounded-lg border border-ebecef bg-transparent px-8 py-3 font-medium text-3c424b shadow-sm transition duration-300 hover:shadow focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-40",
|
|
1453
1468
|
children: [
|
|
1454
|
-
/* @__PURE__ */
|
|
1469
|
+
/* @__PURE__ */ jsx6(ReloadIcon_default, { className: "mr-1.5 h-5 w-5" }),
|
|
1455
1470
|
__("Try Again")
|
|
1456
1471
|
]
|
|
1457
1472
|
}
|
|
@@ -1467,11 +1482,11 @@ import * as Toast from "@radix-ui/react-toast";
|
|
|
1467
1482
|
var verified_default = "./verified-O6D4JQCX.webp";
|
|
1468
1483
|
|
|
1469
1484
|
// src/components/WorldIDIcon.tsx
|
|
1470
|
-
import { Fragment, jsx as
|
|
1485
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1471
1486
|
var WorldIDIcon = ({ border, size = "sm", ...props }) => {
|
|
1472
1487
|
const heightWidth = size === "md" ? 36 : 24;
|
|
1473
1488
|
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1474
|
-
border && /* @__PURE__ */
|
|
1489
|
+
border && /* @__PURE__ */ jsx7(
|
|
1475
1490
|
"svg",
|
|
1476
1491
|
{
|
|
1477
1492
|
className: classNames(
|
|
@@ -1481,17 +1496,17 @@ var WorldIDIcon = ({ border, size = "sm", ...props }) => {
|
|
|
1481
1496
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1482
1497
|
fill: "currentColor",
|
|
1483
1498
|
viewBox: "0 0 26 26",
|
|
1484
|
-
children: /* @__PURE__ */
|
|
1499
|
+
children: /* @__PURE__ */ jsx7("path", { d: "M8.382 2.244a6.938 6.938 0 0 1 9.236 0l1.626 1.451c.346.308.722.581 1.122.815l1.882 1.098a6.937 6.937 0 0 1 2.854 8.784l-.877 1.995c-.187.424-.33.866-.428 1.319l-.463 2.129a6.938 6.938 0 0 1-7.473 5.429l-2.168-.218a6.934 6.934 0 0 0-1.386 0l-2.168.218a6.938 6.938 0 0 1-7.473-5.429l-.463-2.13a6.937 6.937 0 0 0-.428-1.318l-.877-1.995a6.938 6.938 0 0 1 2.854-8.784L5.634 4.51c.4-.234.776-.507 1.122-.815l1.626-1.45Z" })
|
|
1485
1500
|
}
|
|
1486
1501
|
),
|
|
1487
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ jsx7("img", { src: verified_default, ...props, alt: "Verified", width: heightWidth, height: heightWidth })
|
|
1488
1503
|
] });
|
|
1489
1504
|
};
|
|
1490
1505
|
var WorldIDIcon_default = WorldIDIcon;
|
|
1491
1506
|
|
|
1492
1507
|
// src/components/Icons/InfoIcon.tsx
|
|
1493
|
-
import { jsx as
|
|
1494
|
-
var InfoIcon = (props) => /* @__PURE__ */
|
|
1508
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1509
|
+
var InfoIcon = (props) => /* @__PURE__ */ jsx8("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx8(
|
|
1495
1510
|
"path",
|
|
1496
1511
|
{
|
|
1497
1512
|
fill: "currentColor",
|
|
@@ -1503,20 +1518,20 @@ var InfoIcon = (props) => /* @__PURE__ */ jsx9("svg", { ...props, xmlns: "http:/
|
|
|
1503
1518
|
var InfoIcon_default = InfoIcon;
|
|
1504
1519
|
|
|
1505
1520
|
// src/components/IDKitWidget/States/PrivacyState.tsx
|
|
1506
|
-
import { jsx as
|
|
1521
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1507
1522
|
var PrivacyState = () => {
|
|
1508
1523
|
return /* @__PURE__ */ jsxs5("div", { className: "-mt-6 flex flex-col items-center justify-center space-y-6 font-sans text-sm", children: [
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
-
/* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ jsx9(WorldIDIcon_default, { className: "h-12 w-12" }),
|
|
1525
|
+
/* @__PURE__ */ jsx9("p", { className: "text-center text-2xl font-semibold dark:text-white", children: __("Privacy preserving to the core.") }),
|
|
1511
1526
|
/* @__PURE__ */ jsxs5("ul", { className: "text-9eafc0 mb-6 list-disc space-y-3 px-12 dark:text-white", children: [
|
|
1512
|
-
/* @__PURE__ */
|
|
1527
|
+
/* @__PURE__ */ jsx9("li", { className: "text-left", children: __(
|
|
1513
1528
|
"World ID uses Zero-Knowledge Proofs to make it cryptographically impossible to track persons across applications."
|
|
1514
1529
|
) }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ jsx9("li", { className: "text-left", children: __("Orb biometrics analyzed by the Orb are not stored.") }),
|
|
1516
1531
|
/* @__PURE__ */ jsxs5("li", { className: "text-left ", children: [
|
|
1517
1532
|
__("Code and hardware are open source or source available on"),
|
|
1518
1533
|
" ",
|
|
1519
|
-
/* @__PURE__ */
|
|
1534
|
+
/* @__PURE__ */ jsx9(
|
|
1520
1535
|
"a",
|
|
1521
1536
|
{
|
|
1522
1537
|
href: "https://github.com/worldcoin/idkit-js",
|
|
@@ -1530,17 +1545,17 @@ var PrivacyState = () => {
|
|
|
1530
1545
|
] })
|
|
1531
1546
|
] }),
|
|
1532
1547
|
/* @__PURE__ */ jsxs5("div", { className: "text-9eafc0 dark:text-9eafc0 -ml-4 flex items-center space-x-3", children: [
|
|
1533
|
-
/* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ jsx9(InfoIcon_default, { className: "h-4 w-4 " }),
|
|
1549
|
+
/* @__PURE__ */ jsx9("p", { className: "whitespace-nowrap text-sm font-medium", children: __("Biometrics are never shared.") })
|
|
1535
1550
|
] })
|
|
1536
1551
|
] });
|
|
1537
1552
|
};
|
|
1538
1553
|
var PrivacyState_default = PrivacyState;
|
|
1539
1554
|
|
|
1540
1555
|
// src/components/Icons/CheckIcon.tsx
|
|
1541
|
-
import { jsx as
|
|
1556
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1542
1557
|
var CheckIcon = (props) => /* @__PURE__ */ jsxs6("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", ...props, children: [
|
|
1543
|
-
/* @__PURE__ */
|
|
1558
|
+
/* @__PURE__ */ jsx10(
|
|
1544
1559
|
"circle",
|
|
1545
1560
|
{
|
|
1546
1561
|
cx: "50",
|
|
@@ -1553,10 +1568,10 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs6("svg", { xmlns: "http://www.w3.
|
|
|
1553
1568
|
}
|
|
1554
1569
|
),
|
|
1555
1570
|
/* @__PURE__ */ jsxs6("g", { filter: "url(#success-c)", children: [
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ jsx10("circle", { cx: "50", cy: "50", r: "35", fill: "#fff" }),
|
|
1572
|
+
/* @__PURE__ */ jsx10("circle", { cx: "50", cy: "50", r: "34.432", stroke: "#CCEBCC", strokeWidth: "1.136" })
|
|
1558
1573
|
] }),
|
|
1559
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ jsx10(
|
|
1560
1575
|
"path",
|
|
1561
1576
|
{
|
|
1562
1577
|
stroke: "#090",
|
|
@@ -1568,12 +1583,12 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs6("svg", { xmlns: "http://www.w3.
|
|
|
1568
1583
|
),
|
|
1569
1584
|
/* @__PURE__ */ jsxs6("defs", { children: [
|
|
1570
1585
|
/* @__PURE__ */ jsxs6("linearGradient", { id: "success-a", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsx10("stop", { stopColor: "#99D699" }),
|
|
1587
|
+
/* @__PURE__ */ jsx10("stop", { offset: "1", stopColor: "#99D699", stopOpacity: "0" })
|
|
1573
1588
|
] }),
|
|
1574
1589
|
/* @__PURE__ */ jsxs6("linearGradient", { id: "success-b", x1: "50", x2: "50", y1: "0", y2: "100", gradientUnits: "userSpaceOnUse", children: [
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsx10("stop", { stopColor: "#99D699" }),
|
|
1591
|
+
/* @__PURE__ */ jsx10("stop", { offset: ".713", stopColor: "#99D699", stopOpacity: "0" })
|
|
1577
1592
|
] }),
|
|
1578
1593
|
/* @__PURE__ */ jsxs6(
|
|
1579
1594
|
"filter",
|
|
@@ -1586,13 +1601,13 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs6("svg", { xmlns: "http://www.w3.
|
|
|
1586
1601
|
colorInterpolationFilters: "sRGB",
|
|
1587
1602
|
filterUnits: "userSpaceOnUse",
|
|
1588
1603
|
children: [
|
|
1589
|
-
/* @__PURE__ */
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1595
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsx10("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1605
|
+
/* @__PURE__ */ jsx10("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }),
|
|
1606
|
+
/* @__PURE__ */ jsx10("feOffset", { dy: "1.875" }),
|
|
1607
|
+
/* @__PURE__ */ jsx10("feGaussianBlur", { stdDeviation: "1.875" }),
|
|
1608
|
+
/* @__PURE__ */ jsx10("feColorMatrix", { values: "0 0 0 0 0.8 0 0 0 0 0.921569 0 0 0 0 0.8 0 0 0 0.45 0" }),
|
|
1609
|
+
/* @__PURE__ */ jsx10("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_39_712" }),
|
|
1610
|
+
/* @__PURE__ */ jsx10("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_39_712", result: "shape" })
|
|
1596
1611
|
]
|
|
1597
1612
|
}
|
|
1598
1613
|
)
|
|
@@ -1601,13 +1616,13 @@ var CheckIcon = (props) => /* @__PURE__ */ jsxs6("svg", { xmlns: "http://www.w3.
|
|
|
1601
1616
|
var CheckIcon_default = CheckIcon;
|
|
1602
1617
|
|
|
1603
1618
|
// src/components/IDKitWidget/States/SuccessState.tsx
|
|
1604
|
-
import { jsx as
|
|
1619
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1605
1620
|
var SuccessState = () => {
|
|
1606
1621
|
return /* @__PURE__ */ jsxs7("div", { className: "space-y-6", children: [
|
|
1607
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ jsx11("div", { className: "-mt-5 flex items-center justify-center", children: /* @__PURE__ */ jsx11(CheckIcon_default, { className: "w-24 text-white" }) }),
|
|
1608
1623
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1624
|
+
/* @__PURE__ */ jsx11("p", { className: "text-center text-2xl font-semibold text-gray-900 dark:text-white", children: __("Successfully verified") }),
|
|
1625
|
+
/* @__PURE__ */ jsx11("p", { className: "text-657080 mt-2 max-w-[14rem] text-center text-lg", children: __("Your World ID verification was successful") })
|
|
1611
1626
|
] })
|
|
1612
1627
|
] });
|
|
1613
1628
|
};
|
|
@@ -1616,7 +1631,18 @@ var SuccessState_default = SuccessState;
|
|
|
1616
1631
|
// src/components/IDKitWidget/States/WorldID/QRState.tsx
|
|
1617
1632
|
import copy from "copy-to-clipboard";
|
|
1618
1633
|
import { useCallback, useState as useState2 } from "react";
|
|
1619
|
-
import { AnimatePresence, motion
|
|
1634
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
1635
|
+
|
|
1636
|
+
// src/components/Icons/WorldcoinIcon.tsx
|
|
1637
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1638
|
+
var WorldcoinIcon = (props) => /* @__PURE__ */ jsx12("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 33 32", children: /* @__PURE__ */ jsx12(
|
|
1639
|
+
"path",
|
|
1640
|
+
{
|
|
1641
|
+
fill: "currentColor",
|
|
1642
|
+
d: "M30.7195 9.77312C29.9097 7.87434 28.7647 6.17103 27.2845 4.6911C25.8044 3.21117 24.1288 2.06632 22.2298 1.25654C20.247 0.418848 18.1525 0 16.0021 0C13.8238 0 11.7293 0.418848 9.7744 1.25654C7.87537 2.06632 6.17184 3.21117 4.69171 4.6911C3.21159 6.17103 2.06659 7.87434 1.25671 9.77312C0.418903 11.7277 0 13.822 0 16C0 18.1501 0.418903 20.2443 1.25671 22.2269C2.06659 24.1257 3.21159 25.829 4.69171 27.3089C6.17184 28.7888 7.87537 29.9337 9.7744 30.7155C11.7572 31.5532 13.8517 31.9721 16.0021 31.9721C18.1525 31.9721 20.247 31.5532 22.2298 30.7155C24.1288 29.9058 25.8323 28.7609 27.3125 27.281C28.7926 25.801 29.9376 24.0977 30.7475 22.1989C31.5853 20.2164 32.0042 18.1222 32.0042 15.9721C32.0042 13.822 31.5574 11.7277 30.7195 9.77312ZM10.696 14.4921C11.3383 11.9232 13.6842 10.0524 16.4489 10.0524H27.5638C28.2899 11.4206 28.7367 12.9284 28.9043 14.4921H10.696ZM28.9043 17.5079C28.7367 19.0716 28.262 20.5794 27.5638 21.9476H16.4489C13.6842 21.9476 11.3662 20.0489 10.696 17.5079H28.9043ZM6.81415 6.81326C9.27172 4.35602 12.5392 3.01571 16.0021 3.01571C19.465 3.01571 22.7325 4.35602 25.19 6.81326C25.2738 6.89703 25.3297 6.95288 25.4134 7.03665H16.4489C14.0472 7.03665 11.8131 7.95811 10.1095 9.66143C8.76903 11.0017 7.9033 12.6771 7.62403 14.4921H3.09988C3.435 11.5881 4.71964 8.9075 6.81415 6.81326ZM16.0021 28.9843C12.5392 28.9843 9.27172 27.644 6.81415 25.1867C4.71964 23.0925 3.435 20.3839 3.09988 17.5079H7.62403C7.93123 19.3229 8.79696 20.9983 10.1095 22.3386C11.8131 24.0419 14.0472 24.9633 16.4489 24.9633H25.4134C25.3297 25.0471 25.2738 25.103 25.19 25.1867C22.7325 27.644 19.465 28.9843 16.0021 28.9843Z"
|
|
1643
|
+
}
|
|
1644
|
+
) });
|
|
1645
|
+
var WorldcoinIcon_default = WorldcoinIcon;
|
|
1620
1646
|
|
|
1621
1647
|
// src/components/Icons/QRPlaceholderIcon.tsx
|
|
1622
1648
|
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
@@ -1741,9 +1767,52 @@ var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
|
1741
1767
|
setTimeout(() => setCopiedLink(false), 2e3);
|
|
1742
1768
|
}, [qrData]);
|
|
1743
1769
|
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1770
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-10 space-y-4 md:hidden", children: [
|
|
1771
|
+
/* @__PURE__ */ jsxs9(
|
|
1772
|
+
motion.a,
|
|
1773
|
+
{
|
|
1774
|
+
href: qrData ?? "",
|
|
1775
|
+
whileTap: { scale: 0.95 },
|
|
1776
|
+
whileHover: { scale: 1.05 },
|
|
1777
|
+
transition: { layout: { duration: 0.15 } },
|
|
1778
|
+
layoutId: media == "desktop" ? void 0 : "worldid-button",
|
|
1779
|
+
className: classNames(
|
|
1780
|
+
"flex w-full space-x-2 items-center px-4 py-4 border border-transparent font-medium rounded-2xl shadow-sm",
|
|
1781
|
+
"bg-0d151d dark:bg-white text-white dark:text-0d151d"
|
|
1782
|
+
),
|
|
1783
|
+
children: [
|
|
1784
|
+
/* @__PURE__ */ jsx14(WorldcoinIcon_default, { className: "h-5 w-5" }),
|
|
1785
|
+
/* @__PURE__ */ jsx14(
|
|
1786
|
+
motion.span,
|
|
1787
|
+
{
|
|
1788
|
+
className: "flex-1 text-center",
|
|
1789
|
+
transition: { layout: { duration: 0.15 } },
|
|
1790
|
+
layoutId: media == "desktop" ? void 0 : "worldid-text",
|
|
1791
|
+
children: __("Open Worldcoin App")
|
|
1792
|
+
}
|
|
1793
|
+
)
|
|
1794
|
+
]
|
|
1795
|
+
}
|
|
1796
|
+
),
|
|
1797
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
1798
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-4 ", children: [
|
|
1799
|
+
/* @__PURE__ */ jsx14("hr", { className: "flex-1" }),
|
|
1800
|
+
/* @__PURE__ */ jsx14("span", { className: "text-xs font-medium text-9ba3ae", children: "or" }),
|
|
1801
|
+
/* @__PURE__ */ jsx14("hr", { className: "flex-1" })
|
|
1802
|
+
] }),
|
|
1803
|
+
/* @__PURE__ */ jsx14(
|
|
1804
|
+
motion.button,
|
|
1805
|
+
{
|
|
1806
|
+
className: "w-full rounded-2xl border border-ebecef p-4 text-lg font-medium text-3c424b",
|
|
1807
|
+
onClick: () => setShowQR((state) => !state),
|
|
1808
|
+
children: showQR ? __("Hide QR Code") : __("Display QR Code")
|
|
1809
|
+
}
|
|
1810
|
+
)
|
|
1811
|
+
] })
|
|
1812
|
+
] }),
|
|
1744
1813
|
(media == "desktop" || showQR) && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1745
1814
|
/* @__PURE__ */ jsx14(AnimatePresence, { children: copiedLink && /* @__PURE__ */ jsx14(
|
|
1746
|
-
|
|
1815
|
+
motion.div,
|
|
1747
1816
|
{
|
|
1748
1817
|
className: "text-sm text-9eafc0",
|
|
1749
1818
|
initial: "hidden",
|
|
@@ -1783,41 +1852,6 @@ var QRState = ({ qrData, showQR, setShowQR }) => {
|
|
|
1783
1852
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
1784
1853
|
/* @__PURE__ */ jsx14("div", { onClick: copyLink, className: "cursor-pointer", children: /* @__PURE__ */ jsx14(QRCode_default, { data: qrData, size: 244 }) })
|
|
1785
1854
|
) : /* @__PURE__ */ jsx14("div", { className: "flex h-[244px] w-[244px] items-center justify-center", children: /* @__PURE__ */ jsx14(QRPlaceholderIcon_default, { className: "h-[244px] w-[244px] animate-pulse" }) }) }) })
|
|
1786
|
-
] }),
|
|
1787
|
-
/* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
1788
|
-
/* @__PURE__ */ jsxs9(
|
|
1789
|
-
motion2.a,
|
|
1790
|
-
{
|
|
1791
|
-
href: qrData ?? "",
|
|
1792
|
-
whileTap: { scale: 0.95 },
|
|
1793
|
-
whileHover: { scale: 1.05 },
|
|
1794
|
-
transition: { layout: { duration: 0.15 } },
|
|
1795
|
-
layoutId: media == "desktop" ? void 0 : "worldid-button",
|
|
1796
|
-
className: classNames(
|
|
1797
|
-
"flex w-full space-x-2 items-center px-4 py-4 border border-transparent font-medium rounded-2xl shadow-sm",
|
|
1798
|
-
"bg-0d151d dark:bg-white text-white dark:text-0d151d md:hidden"
|
|
1799
|
-
),
|
|
1800
|
-
children: [
|
|
1801
|
-
/* @__PURE__ */ jsx14(WorldcoinIcon_default, { className: "h-5 w-5" }),
|
|
1802
|
-
/* @__PURE__ */ jsx14(
|
|
1803
|
-
motion2.span,
|
|
1804
|
-
{
|
|
1805
|
-
className: "flex-1 text-center",
|
|
1806
|
-
transition: { layout: { duration: 0.15 } },
|
|
1807
|
-
layoutId: media == "desktop" ? void 0 : "worldid-text",
|
|
1808
|
-
children: __("Open Worldcoin App")
|
|
1809
|
-
}
|
|
1810
|
-
)
|
|
1811
|
-
]
|
|
1812
|
-
}
|
|
1813
|
-
),
|
|
1814
|
-
/* @__PURE__ */ jsxs9("div", { className: "space-x-2 md:hidden", children: [
|
|
1815
|
-
/* @__PURE__ */ jsx14(motion2.button, { className: "text-sm text-9eafc0", onClick: () => setShowQR((state) => !state), children: showQR ? __("Hide QR Code") : __("Show QR Code instead") }),
|
|
1816
|
-
showQR && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1817
|
-
/* @__PURE__ */ jsx14("span", { className: "text-9eafc0", children: "\xB7" }),
|
|
1818
|
-
/* @__PURE__ */ jsx14("button", { className: "text-sm dark:text-white", onClick: copyLink, children: copiedLink ? __("Copied!") : __("Copy QR Code") })
|
|
1819
|
-
] })
|
|
1820
|
-
] })
|
|
1821
1855
|
] })
|
|
1822
1856
|
] });
|
|
1823
1857
|
};
|
|
@@ -1893,7 +1927,6 @@ var getOptions = (store) => ({
|
|
|
1893
1927
|
action_description: store.action_description
|
|
1894
1928
|
});
|
|
1895
1929
|
var WorldIDState = () => {
|
|
1896
|
-
const media = useMedia_default();
|
|
1897
1930
|
const [showQR, setShowQR] = useState3(false);
|
|
1898
1931
|
const {
|
|
1899
1932
|
app_id,
|
|
@@ -1921,7 +1954,7 @@ var WorldIDState = () => {
|
|
|
1921
1954
|
setErrorState({ code: errorCode ?? AppErrorCodes2.GenericError });
|
|
1922
1955
|
}
|
|
1923
1956
|
if (result) {
|
|
1924
|
-
if (verification_level == VerificationLevel.Orb && result.verification_level == VerificationLevel.
|
|
1957
|
+
if (verification_level == VerificationLevel.Orb && result.verification_level == VerificationLevel.Device) {
|
|
1925
1958
|
console.error(
|
|
1926
1959
|
"Credential type received from wallet does not match configured credential_types. This should only happen when manually selecting disallowed credentials in the Worldcoin Simulator."
|
|
1927
1960
|
);
|
|
@@ -1961,7 +1994,7 @@ var WorldIDState_default = WorldIDState;
|
|
|
1961
1994
|
// src/components/IDKitWidget/BaseWidget.tsx
|
|
1962
1995
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
1963
1996
|
import { Fragment as Fragment3, useEffect as useEffect5, useMemo } from "react";
|
|
1964
|
-
import { AnimatePresence as AnimatePresence2, motion as
|
|
1997
|
+
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "framer-motion";
|
|
1965
1998
|
|
|
1966
1999
|
// src/components/Icons/ArrowLongLeftIcon.tsx
|
|
1967
2000
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
@@ -1992,9 +2025,8 @@ var HostAppVerificationState_default = memo(HostAppVerificationState);
|
|
|
1992
2025
|
|
|
1993
2026
|
// src/components/IDKitWidget/BaseWidget.tsx
|
|
1994
2027
|
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1995
|
-
var getParams2 = ({ open, processing, onOpenChange, stage, setStage,
|
|
2028
|
+
var getParams2 = ({ open, processing, onOpenChange, stage, setStage, computed, setOptions }) => ({
|
|
1996
2029
|
stage,
|
|
1997
|
-
theme,
|
|
1998
2030
|
setStage,
|
|
1999
2031
|
processing,
|
|
2000
2032
|
setOptions,
|
|
@@ -2003,17 +2035,8 @@ var getParams2 = ({ open, processing, onOpenChange, stage, setStage, theme, comp
|
|
|
2003
2035
|
canGoBack: computed.canGoBack(stage)
|
|
2004
2036
|
});
|
|
2005
2037
|
var IDKitWidget = ({ children, ...config }) => {
|
|
2006
|
-
const {
|
|
2007
|
-
isOpen,
|
|
2008
|
-
onOpenChange,
|
|
2009
|
-
processing,
|
|
2010
|
-
stage,
|
|
2011
|
-
setStage,
|
|
2012
|
-
canGoBack,
|
|
2013
|
-
setOptions,
|
|
2014
|
-
theme: _theme
|
|
2015
|
-
} = idkit_default(getParams2, shallow2);
|
|
2016
2038
|
const media = useMedia_default();
|
|
2039
|
+
const { isOpen, onOpenChange, stage, setStage, canGoBack, setOptions } = idkit_default(getParams2, shallow2);
|
|
2017
2040
|
useEffect5(() => {
|
|
2018
2041
|
setOptions(config, "props" /* PROPS */);
|
|
2019
2042
|
}, [config, setOptions]);
|
|
@@ -2037,85 +2060,78 @@ var IDKitWidget = ({ children, ...config }) => {
|
|
|
2037
2060
|
children?.({ open: () => onOpenChange(true) }),
|
|
2038
2061
|
/* @__PURE__ */ jsx19(Dialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx19(Fragment3, { children: /* @__PURE__ */ jsx19(AnimatePresence2, { children: isOpen && /* @__PURE__ */ jsxs13(root.div, { mode: "open", id: "idkit-widget", children: [
|
|
2039
2062
|
/* @__PURE__ */ jsx19(Styles_default, {}),
|
|
2040
|
-
/* @__PURE__ */ jsxs13(
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
"
|
|
2075
|
-
|
|
2076
|
-
onClick: () => setStage("WORLD_ID" /* WORLD_ID */),
|
|
2077
|
-
disabled: !canGoBack,
|
|
2078
|
-
className: classNames(
|
|
2079
|
-
!canGoBack && "invisible pointer-events-none",
|
|
2080
|
-
"dark:bg-d3dfea/15 flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 dark:text-white"
|
|
2081
|
-
),
|
|
2082
|
-
children: /* @__PURE__ */ jsx19(ArrowLongLeftIcon_default, { className: "w-4" })
|
|
2083
|
-
}
|
|
2084
|
-
),
|
|
2085
|
-
/* @__PURE__ */ jsx19(Dialog.Close, { className: "flex items-center justify-center rounded-full dark:text-white", children: /* @__PURE__ */ jsx19(XMarkIcon_default, { className: "h-5 w-5" }) })
|
|
2086
|
-
] }),
|
|
2087
|
-
/* @__PURE__ */ jsx19("div", { className: "relative mx-6 mb-6 flex flex-1 flex-col items-center justify-center", children: /* @__PURE__ */ jsx19(StageContent, {}) }),
|
|
2088
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between border-t border-f5f5f7 p-7 md:rounded-b-2xl", children: [
|
|
2089
|
-
/* @__PURE__ */ jsxs13(
|
|
2090
|
-
"a",
|
|
2091
|
-
{
|
|
2092
|
-
href: "https://worldcoin.org/world-id",
|
|
2093
|
-
target: "_blank",
|
|
2094
|
-
rel: "noreferrer",
|
|
2095
|
-
className: "flex items-center gap-1 text-sm text-9eafc0",
|
|
2096
|
-
children: [
|
|
2097
|
-
/* @__PURE__ */ jsx19(WorldcoinIcon_default, { className: "w-4 text-9eafc0 dark:text-white" }),
|
|
2098
|
-
/* @__PURE__ */ jsx19("span", { children: __("Powered by Worldcoin") })
|
|
2099
|
-
]
|
|
2100
|
-
}
|
|
2063
|
+
/* @__PURE__ */ jsxs13("div", { id: "modal", className: "fixed z-10 font-sans", children: [
|
|
2064
|
+
/* @__PURE__ */ jsx19(Dialog.Overlay, { asChild: true, children: /* @__PURE__ */ jsx19(
|
|
2065
|
+
motion2.div,
|
|
2066
|
+
{
|
|
2067
|
+
initial: { opacity: 0 },
|
|
2068
|
+
animate: { opacity: 1 },
|
|
2069
|
+
exit: { opacity: 0 },
|
|
2070
|
+
className: "fixed inset-0 bg-black/50 backdrop-blur-lg"
|
|
2071
|
+
}
|
|
2072
|
+
) }),
|
|
2073
|
+
/* @__PURE__ */ jsx19("div", { className: "fixed inset-0 z-10 overflow-y-hidden md:overflow-y-auto", children: /* @__PURE__ */ jsx19("div", { className: "flex min-h-full items-end justify-center text-center md:items-center md:p-4", children: /* @__PURE__ */ jsx19(Dialog.Content, { asChild: true, children: /* @__PURE__ */ jsx19(
|
|
2074
|
+
motion2.div,
|
|
2075
|
+
{
|
|
2076
|
+
layout: media == "mobile" ? "position" : true,
|
|
2077
|
+
exit: media == "mobile" ? "initMob" : "init",
|
|
2078
|
+
initial: media == "mobile" ? "initMob" : "init",
|
|
2079
|
+
animate: media == "mobile" ? "animateMob" : "animate",
|
|
2080
|
+
variants: {
|
|
2081
|
+
init: { opacity: 0, scale: 0.9 },
|
|
2082
|
+
initMob: { translateY: "100%" },
|
|
2083
|
+
animate: { opacity: 1, scale: 1 },
|
|
2084
|
+
animateMob: { translateY: 0 }
|
|
2085
|
+
},
|
|
2086
|
+
transition: { layout: { duration: 0.15 } },
|
|
2087
|
+
className: "relative z-50 flex min-h-screen w-full flex-col bg-white pt-6 shadow focus:outline-none focus-visible:ring focus-visible:ring-purple-500/75 dark:bg-0d151d md:min-h-[35rem] md:max-w-md md:rounded-2xl",
|
|
2088
|
+
children: /* @__PURE__ */ jsxs13(Toast.Provider, { children: [
|
|
2089
|
+
/* @__PURE__ */ jsx19(Toast.Viewport, { className: "flex justify-center" }),
|
|
2090
|
+
/* @__PURE__ */ jsxs13("div", { className: "mx-6 mb-12 flex items-center justify-between", children: [
|
|
2091
|
+
/* @__PURE__ */ jsx19(
|
|
2092
|
+
"button",
|
|
2093
|
+
{
|
|
2094
|
+
onClick: () => setStage("WORLD_ID" /* WORLD_ID */),
|
|
2095
|
+
disabled: !canGoBack,
|
|
2096
|
+
className: classNames(
|
|
2097
|
+
!canGoBack && "invisible pointer-events-none",
|
|
2098
|
+
"dark:bg-d3dfea/15 flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 dark:text-white"
|
|
2101
2099
|
),
|
|
2102
|
-
/* @__PURE__ */ jsx19(
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2100
|
+
children: /* @__PURE__ */ jsx19(ArrowLongLeftIcon_default, { className: "w-4" })
|
|
2101
|
+
}
|
|
2102
|
+
),
|
|
2103
|
+
/* @__PURE__ */ jsx19(Dialog.Close, { className: "flex items-center justify-center rounded-full dark:text-white", children: /* @__PURE__ */ jsx19(XMarkIcon_default, { className: "h-5 w-5" }) })
|
|
2104
|
+
] }),
|
|
2105
|
+
/* @__PURE__ */ jsx19("div", { className: "relative mx-6 mb-6 flex flex-1 flex-col items-center justify-center", children: /* @__PURE__ */ jsx19(StageContent, {}) }),
|
|
2106
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between border-t border-f5f5f7 p-7 md:rounded-b-2xl", children: [
|
|
2107
|
+
/* @__PURE__ */ jsxs13(
|
|
2108
|
+
"a",
|
|
2109
|
+
{
|
|
2110
|
+
href: "https://worldcoin.org/world-id",
|
|
2111
|
+
target: "_blank",
|
|
2112
|
+
rel: "noreferrer",
|
|
2113
|
+
className: "flex items-center gap-1 text-sm text-9eafc0",
|
|
2114
|
+
children: [
|
|
2115
|
+
/* @__PURE__ */ jsx19(WorldcoinIcon_default, { className: "w-4 text-9eafc0 dark:text-white" }),
|
|
2116
|
+
/* @__PURE__ */ jsx19("span", { children: __("Powered by Worldcoin") })
|
|
2117
|
+
]
|
|
2118
|
+
}
|
|
2119
|
+
),
|
|
2120
|
+
/* @__PURE__ */ jsx19(
|
|
2121
|
+
"a",
|
|
2122
|
+
{
|
|
2123
|
+
href: "https://developer.worldcoin.org/privacy-statement",
|
|
2124
|
+
target: "_blank",
|
|
2125
|
+
rel: "noreferrer",
|
|
2126
|
+
className: "text-sm text-9eafc0 hover:underline",
|
|
2127
|
+
children: __("Terms & Privacy")
|
|
2128
|
+
}
|
|
2129
|
+
)
|
|
2130
|
+
] })
|
|
2131
|
+
] })
|
|
2132
|
+
}
|
|
2133
|
+
) }) }) })
|
|
2134
|
+
] })
|
|
2119
2135
|
] }) }) }) })
|
|
2120
2136
|
] });
|
|
2121
2137
|
};
|
|
@@ -2125,66 +2141,10 @@ var BaseWidget_default = IDKitWidget;
|
|
|
2125
2141
|
var IDKitWidget_default = memo2(BaseWidget_default);
|
|
2126
2142
|
|
|
2127
2143
|
// src/index.ts
|
|
2144
|
+
import { VerificationLevel as VerificationLevel2 } from "@worldcoin/idkit-core";
|
|
2128
2145
|
import { solidityEncode } from "@worldcoin/idkit-core/hashing";
|
|
2129
|
-
|
|
2130
|
-
// src/components/SignInWithWorldID.tsx
|
|
2131
|
-
import { useMemo as useMemo2 } from "react";
|
|
2132
|
-
import { useState as useState4 } from "react";
|
|
2133
|
-
import { useCallback as useCallback2 } from "react";
|
|
2134
|
-
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2135
|
-
var SignInWithWorldID = ({ onSuccess, app_id, nonce, theme, children, ...props }) => {
|
|
2136
|
-
const [token, setToken] = useState4("");
|
|
2137
|
-
const signal = useMemo2(() => {
|
|
2138
|
-
if (nonce)
|
|
2139
|
-
return nonce;
|
|
2140
|
-
return Date.now().toString();
|
|
2141
|
-
}, [nonce]);
|
|
2142
|
-
const handleVerify = useCallback2(
|
|
2143
|
-
async (proof) => {
|
|
2144
|
-
const response = await fetch("https://developer.worldcoin.org/api/v1/oidc/authorize", {
|
|
2145
|
-
method: "POST",
|
|
2146
|
-
headers: {
|
|
2147
|
-
"Content-Type": "application/json"
|
|
2148
|
-
},
|
|
2149
|
-
body: JSON.stringify({ ...proof, app_id, nonce: signal, response_type: "id_token" })
|
|
2150
|
-
});
|
|
2151
|
-
if (!response.ok) {
|
|
2152
|
-
if (response.status != 400) {
|
|
2153
|
-
throw new Error("Something went wrong when verifying your identity. Please try again.");
|
|
2154
|
-
}
|
|
2155
|
-
const error = await response.json();
|
|
2156
|
-
throw new Error(error.message);
|
|
2157
|
-
}
|
|
2158
|
-
const { jwt } = await response.json();
|
|
2159
|
-
setToken(jwt);
|
|
2160
|
-
},
|
|
2161
|
-
[app_id, signal]
|
|
2162
|
-
);
|
|
2163
|
-
const onIDKitSuccess = useCallback2(() => void onSuccess(token), [onSuccess, token]);
|
|
2164
|
-
return /* @__PURE__ */ jsx20(
|
|
2165
|
-
IDKitWidget_default,
|
|
2166
|
-
{
|
|
2167
|
-
...props,
|
|
2168
|
-
action: "",
|
|
2169
|
-
autoClose: true,
|
|
2170
|
-
theme,
|
|
2171
|
-
app_id,
|
|
2172
|
-
signal,
|
|
2173
|
-
onSuccess: onIDKitSuccess,
|
|
2174
|
-
handleVerify,
|
|
2175
|
-
children: children ?? (({ open }) => /* @__PURE__ */ jsx20(SignInButton_default, { onClick: open, theme }))
|
|
2176
|
-
}
|
|
2177
|
-
);
|
|
2178
|
-
};
|
|
2179
|
-
var SignInWithWorldID_default = SignInWithWorldID;
|
|
2180
|
-
|
|
2181
|
-
// src/index.ts
|
|
2182
|
-
import { CredentialType, VerificationLevel as VerificationLevel2 } from "@worldcoin/idkit-core";
|
|
2183
2146
|
export {
|
|
2184
|
-
CredentialType,
|
|
2185
2147
|
IDKitWidget_default as IDKitWidget,
|
|
2186
|
-
SignInButton_default as SignInButton,
|
|
2187
|
-
SignInWithWorldID_default as SignInWithWorldID,
|
|
2188
2148
|
VerificationLevel2 as VerificationLevel,
|
|
2189
2149
|
solidityEncode,
|
|
2190
2150
|
useIDKit_default as useIDKit
|
package/build/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as zustand_traditional from 'zustand/traditional';
|
|
3
3
|
import * as zustand from 'zustand';
|
|
4
|
-
import { I as IDKITStage,
|
|
4
|
+
import { I as IDKITStage, a as ConfigSource, b as CallbackFn, C as Config } from './config-71e4be16.js';
|
|
5
5
|
import { IDKitConfig, ISuccessResult, IErrorState } from '@worldcoin/idkit-core';
|
|
6
6
|
|
|
7
7
|
type CleanWord<T> = T extends `${string}${' ' | ',' | '!' | '?' | '.' | '`'}${string}` ? never : T extends '' ? never : T;
|
|
@@ -31,7 +31,6 @@ type IDKitStore = {
|
|
|
31
31
|
stage: IDKITStage;
|
|
32
32
|
autoClose: boolean;
|
|
33
33
|
processing: boolean;
|
|
34
|
-
theme: Config['theme'];
|
|
35
34
|
result: ISuccessResult | null;
|
|
36
35
|
errorState: IErrorState | null;
|
|
37
36
|
errorCallbacks: Record<ConfigSource, CallbackFn<IErrorState> | undefined> | Record<string, never>;
|
package/build/internal.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worldcoin/idkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"homepage": "https://docs.worldcoin.org/id/idkit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"qrcode": "^1.5.1",
|
|
65
65
|
"react-shadow": "^19.1.0",
|
|
66
66
|
"zustand": "^4.3.3",
|
|
67
|
-
"@worldcoin/idkit-core": "1.
|
|
67
|
+
"@worldcoin/idkit-core": "1.1.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/node": "18.11.9",
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import useIDKit from './hooks/useIDKit'
|
|
2
|
-
import SignInButton from './components/SignInButton'
|
|
3
2
|
import IDKitWidget from '@/components/IDKitWidget/index'
|
|
4
3
|
import type { WidgetProps, Config } from '@/types/config'
|
|
4
|
+
import { VerificationLevel } from '@worldcoin/idkit-core'
|
|
5
5
|
import { solidityEncode } from '@worldcoin/idkit-core/hashing'
|
|
6
|
-
import SignInWithWorldID from './components/SignInWithWorldID'
|
|
7
6
|
import type { ISuccessResult, IErrorState } from '@worldcoin/idkit-core'
|
|
8
|
-
import { CredentialType, VerificationLevel } from '@worldcoin/idkit-core'
|
|
9
7
|
|
|
10
|
-
export { IDKitWidget, useIDKit, solidityEncode,
|
|
8
|
+
export { IDKitWidget, useIDKit, solidityEncode, VerificationLevel }
|
|
11
9
|
export type { ISuccessResult, IErrorState, Config, WidgetProps }
|