@latticexyz/entrykit 2.2.12-entrykit-bc150f8e6c877fc2c6381f761b6c629c10f52965 → 2.2.12-entrykit-097d5f20d7d6decda06c7bb4fbabbb0a75220317
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/dist/tsup/internal.d.ts +1 -0
- package/dist/tsup/internal.js +123 -242
- package/dist/tsup/internal.js.map +1 -1
- package/package.json +8 -8
package/dist/tsup/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Root as
|
|
1
|
+
import{Root as qt,DialogPortal as Yt,DialogContent as Xt}from"@radix-ui/react-dialog";import{forwardRef as Bt,useEffect as Ft,useRef as Te,useState as Re}from"react";import Wt from"react-dom";var ke=`*, ::before, ::after {
|
|
2
2
|
--tw-border-spacing-x: 0;
|
|
3
3
|
--tw-border-spacing-y: 0;
|
|
4
4
|
--tw-translate-x: 0;
|
|
@@ -532,6 +532,11 @@ video {
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
+
.grid-cols-2.divide-y > :not([hidden]) ~ :not([hidden]):nth-child(-n + 2) {
|
|
536
|
+
border-top-width: 0;
|
|
537
|
+
border-bottom-width: 0;
|
|
538
|
+
}
|
|
539
|
+
|
|
535
540
|
.sr-only {
|
|
536
541
|
position: absolute;
|
|
537
542
|
width: 1px;
|
|
@@ -602,16 +607,16 @@ video {
|
|
|
602
607
|
margin-bottom: -0.25rem;
|
|
603
608
|
}
|
|
604
609
|
|
|
605
|
-
.-my-2\\.5 {
|
|
606
|
-
margin-top: -0.625rem;
|
|
607
|
-
margin-bottom: -0.625rem;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
610
|
.-my-\\[0\\.125em\\] {
|
|
611
611
|
margin-top: -0.125em;
|
|
612
612
|
margin-bottom: -0.125em;
|
|
613
613
|
}
|
|
614
614
|
|
|
615
|
+
.mx-auto {
|
|
616
|
+
margin-left: auto;
|
|
617
|
+
margin-right: auto;
|
|
618
|
+
}
|
|
619
|
+
|
|
615
620
|
.-ml-3 {
|
|
616
621
|
margin-left: -0.75rem;
|
|
617
622
|
}
|
|
@@ -652,10 +657,6 @@ video {
|
|
|
652
657
|
height: 4rem;
|
|
653
658
|
}
|
|
654
659
|
|
|
655
|
-
.h-2\\.5 {
|
|
656
|
-
height: 0.625rem;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
660
|
.h-4 {
|
|
660
661
|
height: 1rem;
|
|
661
662
|
}
|
|
@@ -680,22 +681,26 @@ video {
|
|
|
680
681
|
max-height: 8rem;
|
|
681
682
|
}
|
|
682
683
|
|
|
683
|
-
.min-h-\\[
|
|
684
|
-
min-height:
|
|
684
|
+
.min-h-\\[28rem\\] {
|
|
685
|
+
min-height: 28rem;
|
|
685
686
|
}
|
|
686
687
|
|
|
687
688
|
.w-16 {
|
|
688
689
|
width: 4rem;
|
|
689
690
|
}
|
|
690
691
|
|
|
691
|
-
.w-
|
|
692
|
-
width:
|
|
692
|
+
.w-28 {
|
|
693
|
+
width: 7rem;
|
|
693
694
|
}
|
|
694
695
|
|
|
695
696
|
.w-4 {
|
|
696
697
|
width: 1rem;
|
|
697
698
|
}
|
|
698
699
|
|
|
700
|
+
.w-48 {
|
|
701
|
+
width: 12rem;
|
|
702
|
+
}
|
|
703
|
+
|
|
699
704
|
.w-6 {
|
|
700
705
|
width: 1.5rem;
|
|
701
706
|
}
|
|
@@ -716,6 +721,10 @@ video {
|
|
|
716
721
|
width: 100%;
|
|
717
722
|
}
|
|
718
723
|
|
|
724
|
+
.max-w-\\[26rem\\] {
|
|
725
|
+
max-width: 26rem;
|
|
726
|
+
}
|
|
727
|
+
|
|
719
728
|
.flex-shrink-0 {
|
|
720
729
|
flex-shrink: 0;
|
|
721
730
|
}
|
|
@@ -764,14 +773,18 @@ video {
|
|
|
764
773
|
flex-direction: column;
|
|
765
774
|
}
|
|
766
775
|
|
|
767
|
-
.
|
|
768
|
-
|
|
776
|
+
.flex-col-reverse {
|
|
777
|
+
flex-direction: column-reverse;
|
|
769
778
|
}
|
|
770
779
|
|
|
771
780
|
.place-items-center {
|
|
772
781
|
place-items: center;
|
|
773
782
|
}
|
|
774
783
|
|
|
784
|
+
.items-end {
|
|
785
|
+
align-items: flex-end;
|
|
786
|
+
}
|
|
787
|
+
|
|
775
788
|
.items-center {
|
|
776
789
|
align-items: center;
|
|
777
790
|
}
|
|
@@ -784,12 +797,12 @@ video {
|
|
|
784
797
|
justify-content: center;
|
|
785
798
|
}
|
|
786
799
|
|
|
787
|
-
.
|
|
788
|
-
|
|
800
|
+
.justify-between {
|
|
801
|
+
justify-content: space-between;
|
|
789
802
|
}
|
|
790
803
|
|
|
791
|
-
.gap-1
|
|
792
|
-
gap: 0.
|
|
804
|
+
.gap-1 {
|
|
805
|
+
gap: 0.25rem;
|
|
793
806
|
}
|
|
794
807
|
|
|
795
808
|
.gap-2 {
|
|
@@ -800,6 +813,10 @@ video {
|
|
|
800
813
|
gap: 0.625rem;
|
|
801
814
|
}
|
|
802
815
|
|
|
816
|
+
.gap-4 {
|
|
817
|
+
gap: 1rem;
|
|
818
|
+
}
|
|
819
|
+
|
|
803
820
|
.gap-5 {
|
|
804
821
|
gap: 1.25rem;
|
|
805
822
|
}
|
|
@@ -808,18 +825,24 @@ video {
|
|
|
808
825
|
gap: 1.5rem;
|
|
809
826
|
}
|
|
810
827
|
|
|
811
|
-
.
|
|
812
|
-
--tw-
|
|
813
|
-
|
|
814
|
-
|
|
828
|
+
.divide-y > :not([hidden]) ~ :not([hidden]) {
|
|
829
|
+
--tw-divide-y-reverse: 0;
|
|
830
|
+
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
|
831
|
+
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
|
815
832
|
}
|
|
816
833
|
|
|
817
|
-
.
|
|
818
|
-
|
|
834
|
+
.divide-neutral-700 > :not([hidden]) ~ :not([hidden]) {
|
|
835
|
+
--tw-divide-opacity: 1;
|
|
836
|
+
border-color: rgb(64 64 64 / var(--tw-divide-opacity));
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.divide-neutral-800 > :not([hidden]) ~ :not([hidden]) {
|
|
840
|
+
--tw-divide-opacity: 1;
|
|
841
|
+
border-color: rgb(38 38 38 / var(--tw-divide-opacity));
|
|
819
842
|
}
|
|
820
843
|
|
|
821
|
-
.self-
|
|
822
|
-
align-self:
|
|
844
|
+
.self-auto {
|
|
845
|
+
align-self: auto;
|
|
823
846
|
}
|
|
824
847
|
|
|
825
848
|
.self-end {
|
|
@@ -830,14 +853,6 @@ video {
|
|
|
830
853
|
align-self: center;
|
|
831
854
|
}
|
|
832
855
|
|
|
833
|
-
.self-stretch {
|
|
834
|
-
align-self: stretch;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
.overflow-y-auto {
|
|
838
|
-
overflow-y: auto;
|
|
839
|
-
}
|
|
840
|
-
|
|
841
856
|
.overflow-y-scroll {
|
|
842
857
|
overflow-y: scroll;
|
|
843
858
|
}
|
|
@@ -858,12 +873,12 @@ video {
|
|
|
858
873
|
border-width: 1px;
|
|
859
874
|
}
|
|
860
875
|
|
|
861
|
-
.border-
|
|
862
|
-
border-
|
|
876
|
+
.border-4 {
|
|
877
|
+
border-width: 4px;
|
|
863
878
|
}
|
|
864
879
|
|
|
865
|
-
.border-
|
|
866
|
-
border-
|
|
880
|
+
.border-l-4 {
|
|
881
|
+
border-left-width: 4px;
|
|
867
882
|
}
|
|
868
883
|
|
|
869
884
|
.border-neutral-300 {
|
|
@@ -871,11 +886,6 @@ video {
|
|
|
871
886
|
border-color: rgb(212 212 212 / var(--tw-border-opacity));
|
|
872
887
|
}
|
|
873
888
|
|
|
874
|
-
.border-neutral-400 {
|
|
875
|
-
--tw-border-opacity: 1;
|
|
876
|
-
border-color: rgb(163 163 163 / var(--tw-border-opacity));
|
|
877
|
-
}
|
|
878
|
-
|
|
879
889
|
.border-red-500 {
|
|
880
890
|
--tw-border-opacity: 1;
|
|
881
891
|
border-color: rgb(239 68 68 / var(--tw-border-opacity));
|
|
@@ -885,27 +895,27 @@ video {
|
|
|
885
895
|
border-color: transparent;
|
|
886
896
|
}
|
|
887
897
|
|
|
888
|
-
.bg-amber-700 {
|
|
889
|
-
--tw-bg-opacity: 1;
|
|
890
|
-
background-color: rgb(180 83 9 / var(--tw-bg-opacity));
|
|
891
|
-
}
|
|
892
|
-
|
|
893
898
|
.bg-black\\/10 {
|
|
894
899
|
background-color: rgb(0 0 0 / 0.1);
|
|
895
900
|
}
|
|
896
901
|
|
|
897
|
-
.bg-
|
|
902
|
+
.bg-neutral-100 {
|
|
898
903
|
--tw-bg-opacity: 1;
|
|
899
|
-
background-color: rgb(
|
|
904
|
+
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
|
900
905
|
}
|
|
901
906
|
|
|
902
|
-
.bg-neutral-
|
|
907
|
+
.bg-neutral-700 {
|
|
903
908
|
--tw-bg-opacity: 1;
|
|
904
|
-
background-color: rgb(
|
|
909
|
+
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.bg-neutral-800 {
|
|
913
|
+
--tw-bg-opacity: 1;
|
|
914
|
+
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
|
|
905
915
|
}
|
|
906
916
|
|
|
907
|
-
.bg-neutral-
|
|
908
|
-
background-color: rgb(
|
|
917
|
+
.bg-neutral-800\\/85 {
|
|
918
|
+
background-color: rgb(38 38 38 / 0.85);
|
|
909
919
|
}
|
|
910
920
|
|
|
911
921
|
.bg-neutral-900 {
|
|
@@ -972,8 +982,8 @@ video {
|
|
|
972
982
|
padding: 1.5rem;
|
|
973
983
|
}
|
|
974
984
|
|
|
975
|
-
.p-\\[
|
|
976
|
-
padding:
|
|
985
|
+
.p-\\[\\.75em\\] {
|
|
986
|
+
padding: .75em;
|
|
977
987
|
}
|
|
978
988
|
|
|
979
989
|
.px-3 {
|
|
@@ -986,9 +996,14 @@ video {
|
|
|
986
996
|
padding-right: 1.25rem;
|
|
987
997
|
}
|
|
988
998
|
|
|
989
|
-
.
|
|
990
|
-
padding-
|
|
991
|
-
padding-
|
|
999
|
+
.px-8 {
|
|
1000
|
+
padding-left: 2rem;
|
|
1001
|
+
padding-right: 2rem;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.py-8 {
|
|
1005
|
+
padding-top: 2rem;
|
|
1006
|
+
padding-bottom: 2rem;
|
|
992
1007
|
}
|
|
993
1008
|
|
|
994
1009
|
.pb-5 {
|
|
@@ -999,6 +1014,10 @@ video {
|
|
|
999
1014
|
text-align: left;
|
|
1000
1015
|
}
|
|
1001
1016
|
|
|
1017
|
+
.text-center {
|
|
1018
|
+
text-align: center;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1002
1021
|
.font-mono {
|
|
1003
1022
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
1004
1023
|
}
|
|
@@ -1073,11 +1092,6 @@ video {
|
|
|
1073
1092
|
color: rgb(249 115 22 / var(--tw-text-opacity));
|
|
1074
1093
|
}
|
|
1075
1094
|
|
|
1076
|
-
.text-red-700 {
|
|
1077
|
-
--tw-text-opacity: 1;
|
|
1078
|
-
color: rgb(185 28 28 / var(--tw-text-opacity));
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
1095
|
.text-red-900 {
|
|
1082
1096
|
--tw-text-opacity: 1;
|
|
1083
1097
|
color: rgb(127 29 29 / var(--tw-text-opacity));
|
|
@@ -1113,20 +1127,20 @@ video {
|
|
|
1113
1127
|
outline-offset: 2px;
|
|
1114
1128
|
}
|
|
1115
1129
|
|
|
1116
|
-
.ring-
|
|
1130
|
+
.ring-1 {
|
|
1117
1131
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1118
|
-
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(
|
|
1132
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1119
1133
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1120
1134
|
}
|
|
1121
1135
|
|
|
1122
|
-
.ring-
|
|
1136
|
+
.ring-2 {
|
|
1123
1137
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1124
|
-
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(
|
|
1138
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1125
1139
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1126
1140
|
}
|
|
1127
1141
|
|
|
1128
|
-
.ring-
|
|
1129
|
-
--tw-ring-color: rgb(
|
|
1142
|
+
.ring-neutral-700\\/50 {
|
|
1143
|
+
--tw-ring-color: rgb(64 64 64 / 0.5);
|
|
1130
1144
|
}
|
|
1131
1145
|
|
|
1132
1146
|
.ring-transparent {
|
|
@@ -1145,6 +1159,12 @@ video {
|
|
|
1145
1159
|
transition-duration: 150ms;
|
|
1146
1160
|
}
|
|
1147
1161
|
|
|
1162
|
+
.transition-all {
|
|
1163
|
+
transition-property: all;
|
|
1164
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1165
|
+
transition-duration: 150ms;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1148
1168
|
.duration-100 {
|
|
1149
1169
|
transition-duration: 100ms;
|
|
1150
1170
|
}
|
|
@@ -1183,20 +1203,16 @@ video {
|
|
|
1183
1203
|
--tw-enter-opacity: 0;
|
|
1184
1204
|
}
|
|
1185
1205
|
|
|
1186
|
-
.slide-in-from-bottom-
|
|
1187
|
-
--tw-enter-translate-y:
|
|
1206
|
+
.slide-in-from-bottom-8 {
|
|
1207
|
+
--tw-enter-translate-y: 2rem;
|
|
1188
1208
|
}
|
|
1189
1209
|
|
|
1190
1210
|
.slide-in-from-left-2 {
|
|
1191
1211
|
--tw-enter-translate-x: -0.5rem;
|
|
1192
1212
|
}
|
|
1193
1213
|
|
|
1194
|
-
.animate-duration-
|
|
1195
|
-
animation-duration:
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
.animate-duration-500 {
|
|
1199
|
-
animation-duration: 500ms;
|
|
1214
|
+
.animate-duration-300 {
|
|
1215
|
+
animation-duration: 300ms;
|
|
1200
1216
|
}
|
|
1201
1217
|
|
|
1202
1218
|
@property --tw-border-gradient-angle {
|
|
@@ -1243,53 +1259,34 @@ video {
|
|
|
1243
1259
|
--tw-ring-color: rgb(249 115 22 / var(--tw-ring-opacity));
|
|
1244
1260
|
}
|
|
1245
1261
|
|
|
1246
|
-
.hover\\:border-neutral-500:hover {
|
|
1247
|
-
--tw-border-opacity: 1;
|
|
1248
|
-
border-color: rgb(115 115 115 / var(--tw-border-opacity));
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
1262
|
.hover\\:bg-neutral-200:hover {
|
|
1252
1263
|
--tw-bg-opacity: 1;
|
|
1253
1264
|
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
|
1254
1265
|
}
|
|
1255
1266
|
|
|
1256
|
-
.hover\\:bg-neutral-700:hover {
|
|
1257
|
-
--tw-bg-opacity: 1;
|
|
1258
|
-
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
1267
|
.hover\\:bg-orange-400:hover {
|
|
1262
1268
|
--tw-bg-opacity: 1;
|
|
1263
1269
|
background-color: rgb(251 146 60 / var(--tw-bg-opacity));
|
|
1264
1270
|
}
|
|
1265
1271
|
|
|
1266
|
-
.hover\\:text-neutral-
|
|
1272
|
+
.hover\\:text-neutral-500:hover {
|
|
1267
1273
|
--tw-text-opacity: 1;
|
|
1268
|
-
color: rgb(
|
|
1274
|
+
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1269
1275
|
}
|
|
1270
1276
|
|
|
1271
|
-
.
|
|
1272
|
-
|
|
1277
|
+
.hover\\:text-white:hover {
|
|
1278
|
+
--tw-text-opacity: 1;
|
|
1279
|
+
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1273
1280
|
}
|
|
1274
1281
|
|
|
1275
|
-
.
|
|
1276
|
-
--tw-
|
|
1277
|
-
--tw-
|
|
1282
|
+
.hover\\:brightness-125:hover {
|
|
1283
|
+
--tw-brightness: brightness(1.25);
|
|
1284
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
1278
1285
|
}
|
|
1279
1286
|
|
|
1280
|
-
.
|
|
1287
|
+
.focus\\:border-orange-500:focus {
|
|
1281
1288
|
--tw-border-opacity: 1;
|
|
1282
|
-
border-color: rgb(
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
.active\\:bg-neutral-300:active {
|
|
1286
|
-
--tw-bg-opacity: 1;
|
|
1287
|
-
background-color: rgb(212 212 212 / var(--tw-bg-opacity));
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
.active\\:bg-neutral-600:active {
|
|
1291
|
-
--tw-bg-opacity: 1;
|
|
1292
|
-
background-color: rgb(82 82 82 / var(--tw-bg-opacity));
|
|
1289
|
+
border-color: rgb(249 115 22 / var(--tw-border-opacity));
|
|
1293
1290
|
}
|
|
1294
1291
|
|
|
1295
1292
|
.active\\:bg-orange-600:active {
|
|
@@ -1297,11 +1294,16 @@ video {
|
|
|
1297
1294
|
background-color: rgb(234 88 12 / var(--tw-bg-opacity));
|
|
1298
1295
|
}
|
|
1299
1296
|
|
|
1300
|
-
.
|
|
1301
|
-
--tw-brightness: brightness(1.
|
|
1297
|
+
.active\\:brightness-150:active {
|
|
1298
|
+
--tw-brightness: brightness(1.5);
|
|
1302
1299
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
1303
1300
|
}
|
|
1304
1301
|
|
|
1302
|
+
.group:hover .group-hover\\:rotate-90 {
|
|
1303
|
+
--tw-rotate: 90deg;
|
|
1304
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1305
1307
|
.group:hover .group-hover\\:text-black {
|
|
1306
1308
|
--tw-text-opacity: 1;
|
|
1307
1309
|
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
@@ -1320,19 +1322,8 @@ video {
|
|
|
1320
1322
|
pointer-events: none;
|
|
1321
1323
|
}
|
|
1322
1324
|
|
|
1323
|
-
.aria-disabled\\:
|
|
1324
|
-
|
|
1325
|
-
border-color: rgb(212 212 212 / var(--tw-border-opacity));
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
.aria-disabled\\:bg-neutral-200[aria-disabled="true"] {
|
|
1329
|
-
--tw-bg-opacity: 1;
|
|
1330
|
-
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
.aria-disabled\\:text-neutral-400[aria-disabled="true"] {
|
|
1334
|
-
--tw-text-opacity: 1;
|
|
1335
|
-
color: rgb(163 163 163 / var(--tw-text-opacity));
|
|
1325
|
+
.aria-disabled\\:opacity-50[aria-disabled="true"] {
|
|
1326
|
+
opacity: 0.5;
|
|
1336
1327
|
}
|
|
1337
1328
|
|
|
1338
1329
|
.group[aria-busy="true"] .group-aria-busy\\:translate-x-0 {
|
|
@@ -1373,17 +1364,17 @@ video {
|
|
|
1373
1364
|
font-weight: 500;
|
|
1374
1365
|
}
|
|
1375
1366
|
|
|
1376
|
-
.links\\:text-
|
|
1367
|
+
.links\\:text-white a[href]:not(.links-unset) {
|
|
1377
1368
|
--tw-text-opacity: 1;
|
|
1378
|
-
color: rgb(
|
|
1369
|
+
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1379
1370
|
}
|
|
1380
1371
|
|
|
1381
1372
|
.links\\:underline a[href]:not(.links-unset) {
|
|
1382
1373
|
text-decoration-line: underline;
|
|
1383
1374
|
}
|
|
1384
1375
|
|
|
1385
|
-
.links\\:decoration-neutral-
|
|
1386
|
-
text-decoration-color: #
|
|
1376
|
+
.links\\:decoration-neutral-500 a[href]:not(.links-unset) {
|
|
1377
|
+
text-decoration-color: #737373;
|
|
1387
1378
|
}
|
|
1388
1379
|
|
|
1389
1380
|
.links\\:underline-offset-4 a[href]:not(.links-unset) {
|
|
@@ -1396,31 +1387,9 @@ video {
|
|
|
1396
1387
|
|
|
1397
1388
|
@media (min-width: 640px) {
|
|
1398
1389
|
|
|
1399
|
-
.sm\\:
|
|
1400
|
-
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
.sm\\:place-items-center {
|
|
1404
|
-
place-items: center;
|
|
1390
|
+
.sm\\:items-center {
|
|
1391
|
+
align-items: center;
|
|
1405
1392
|
}
|
|
1406
|
-
|
|
1407
|
-
.sm\\:self-start {
|
|
1408
|
-
align-self: flex-start;
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
.sm\\:border {
|
|
1412
|
-
border-width: 1px;
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
.dark\\:divide-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) > :not([hidden]) ~ :not([hidden]) {
|
|
1417
|
-
--tw-divide-opacity: 1;
|
|
1418
|
-
border-color: rgb(64 64 64 / var(--tw-divide-opacity));
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
.dark\\:border-neutral-400:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1422
|
-
--tw-border-opacity: 1;
|
|
1423
|
-
border-color: rgb(163 163 163 / var(--tw-border-opacity));
|
|
1424
1393
|
}
|
|
1425
1394
|
|
|
1426
1395
|
.dark\\:border-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
@@ -1428,16 +1397,6 @@ video {
|
|
|
1428
1397
|
border-color: rgb(64 64 64 / var(--tw-border-opacity));
|
|
1429
1398
|
}
|
|
1430
1399
|
|
|
1431
|
-
.dark\\:bg-neutral-100:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1432
|
-
--tw-bg-opacity: 1;
|
|
1433
|
-
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
.dark\\:bg-neutral-700:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1437
|
-
--tw-bg-opacity: 1;
|
|
1438
|
-
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
1400
|
.dark\\:bg-neutral-800:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1442
1401
|
--tw-bg-opacity: 1;
|
|
1443
1402
|
background-color: rgb(38 38 38 / var(--tw-bg-opacity));
|
|
@@ -1448,10 +1407,6 @@ video {
|
|
|
1448
1407
|
background-color: rgb(23 23 23 / var(--tw-bg-opacity));
|
|
1449
1408
|
}
|
|
1450
1409
|
|
|
1451
|
-
.dark\\:bg-neutral-900\\/75:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1452
|
-
background-color: rgb(23 23 23 / 0.75);
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
1410
|
.dark\\:bg-red-900:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1456
1411
|
--tw-bg-opacity: 1;
|
|
1457
1412
|
background-color: rgb(127 29 29 / var(--tw-bg-opacity));
|
|
@@ -1461,26 +1416,11 @@ video {
|
|
|
1461
1416
|
background-color: rgb(255 255 255 / 0.1);
|
|
1462
1417
|
}
|
|
1463
1418
|
|
|
1464
|
-
.dark\\:text-black:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1465
|
-
--tw-text-opacity: 1;
|
|
1466
|
-
color: rgb(0 0 0 / var(--tw-text-opacity));
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
.dark\\:text-neutral-300:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1470
|
-
--tw-text-opacity: 1;
|
|
1471
|
-
color: rgb(212 212 212 / var(--tw-text-opacity));
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
1419
|
.dark\\:text-neutral-400:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1475
1420
|
--tw-text-opacity: 1;
|
|
1476
1421
|
color: rgb(163 163 163 / var(--tw-text-opacity));
|
|
1477
1422
|
}
|
|
1478
1423
|
|
|
1479
|
-
.dark\\:text-neutral-500:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1480
|
-
--tw-text-opacity: 1;
|
|
1481
|
-
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
1424
|
.dark\\:text-red-50:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1485
1425
|
--tw-text-opacity: 1;
|
|
1486
1426
|
color: rgb(254 242 242 / var(--tw-text-opacity));
|
|
@@ -1496,75 +1436,16 @@ video {
|
|
|
1496
1436
|
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1497
1437
|
}
|
|
1498
1438
|
|
|
1499
|
-
.dark\\:hover\\:border-neutral-300:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1500
|
-
--tw-border-opacity: 1;
|
|
1501
|
-
border-color: rgb(212 212 212 / var(--tw-border-opacity));
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
.dark\\:hover\\:bg-neutral-200:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1505
|
-
--tw-bg-opacity: 1;
|
|
1506
|
-
background-color: rgb(229 229 229 / var(--tw-bg-opacity));
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
1439
|
.dark\\:hover\\:bg-neutral-700:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1510
1440
|
--tw-bg-opacity: 1;
|
|
1511
1441
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
|
|
1512
1442
|
}
|
|
1513
1443
|
|
|
1514
|
-
.dark\\:hover\\:text-neutral-400:hover:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1515
|
-
--tw-text-opacity: 1;
|
|
1516
|
-
color: rgb(163 163 163 / var(--tw-text-opacity));
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
.dark\\:active\\:border-neutral-200:active:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1520
|
-
--tw-border-opacity: 1;
|
|
1521
|
-
border-color: rgb(229 229 229 / var(--tw-border-opacity));
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
.dark\\:active\\:bg-neutral-300:active:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1525
|
-
--tw-bg-opacity: 1;
|
|
1526
|
-
background-color: rgb(212 212 212 / var(--tw-bg-opacity));
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
.dark\\:active\\:bg-neutral-600:active:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1530
|
-
--tw-bg-opacity: 1;
|
|
1531
|
-
background-color: rgb(82 82 82 / var(--tw-bg-opacity));
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
1444
|
.group:hover .dark\\:group-hover\\:text-white:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1535
1445
|
--tw-text-opacity: 1;
|
|
1536
1446
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1537
1447
|
}
|
|
1448
|
+
`;import{useResizeObserver as Ut}from"usehooks-ts";import{mergeRefs as Gt}from"react-merge-refs";import{createContext as Tt,useContext as Ot}from"react";import{jsx as zt}from"react/jsx-runtime";var Ae=Tt(null);function Se({frame:e,children:t}){if(Ot(Ae))throw new Error("`FrameProvider` can only be used once.");return zt(Ae.Provider,{value:{frame:e},children:t})}import{useMediaQuery as Lt}from"usehooks-ts";import"@rainbow-me/rainbowkit/styles.css";import{createContext as Dt,useContext as Ne}from"react";import{RainbowKitProvider as Kt,lightTheme as Pe,midnightTheme as Me}from"@rainbow-me/rainbowkit";import{jsx as Ie}from"react/jsx-runtime";var se=Dt(null);function He({config:e,children:t}){if(Ne(se))throw new Error("`EntryKitProvider` can only be used once.");return Ie(Kt,{initialChain:e.chainId,appInfo:{appName:e.appInfo?.name},theme:e.theme==="light"?Pe({borderRadius:"none"}):e.theme==="dark"?Me({borderRadius:"none"}):{lightMode:Pe({borderRadius:"none"}),darkMode:Me({borderRadius:"none"})},children:Ie(se.Provider,{value:e,children:t})})}function p(){let e=Ne(se);if(!e)throw new Error("`useEntryKitConfig` can only be used within a `EntryKitProvider`.");return e}function Ee(){let{theme:e}=p(),t=Lt("(prefers-color-scheme: dark)");return e??(t?"dark":"light")}import{jsx as H,jsxs as _t}from"react/jsx-runtime";function Vt({onSize:e,...t}){let n=Te(null);return Ut({ref:n,onResize:e}),H("div",{ref:n,...t,style:{...t.style,display:"inline-block"}})}var L=Bt(function({mode:t,children:n},r){let a=Te(null),[s,i]=Re(!1),o=s?a.current:null,[c,l]=Re({width:void 0,height:void 0}),d=o?.contentDocument,u=Ee();Ft(()=>{d&&d.body.setAttribute("data-theme",u)},[d,u]);let f=t==="modal"?{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",zIndex:"2147483646"}:c.width&&c.height?{all:"unset",display:"inline-block",width:`${c.width}px`,height:`${c.height}px`}:{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",opacity:0,pointerEvents:"none"};return H("iframe",{ref:Gt([r,a]),style:f,onLoad:()=>i(!0),srcDoc:"<!doctype html><title>\u2026</title>",children:d?Wt.createPortal(_t(Se,{frame:o,children:[H("div",{children:t==="modal"?n:H(Vt,{onSize:l,children:n})}),H("style",{dangerouslySetInnerHTML:{__html:ke}})]}),d.body):null})});import{twMerge as Oe}from"tailwind-merge";import{jsx as A,jsxs as Qt}from"react/jsx-runtime";function ze({open:e,onOpenChange:t,children:n}){return A(qt,{open:e,onOpenChange:t,children:A(Yt,{children:Qt(L,{mode:"modal",children:[A("div",{className:Oe("fixed inset-0","bg-neutral-800/85","animate-in animate-duration-300 fade-in")}),A("div",{className:Oe("fixed inset-0","grid items-end sm:items-center transition-all","animate-in animate-duration-300 fade-in slide-in-from-bottom-8"),children:A("div",{children:A(Xt,{className:"outline-none w-full max-w-[26rem] mx-auto","aria-describedby":void 0,children:n})})})]})})})}import{useCallback as ce,useMemo as $t}from"react";import{useStore as jt}from"zustand";import{createStore as Jt}from"zustand/vanilla";var B=Jt(()=>({open:!1}));function y(){let e=jt(B,a=>a.open),t=ce(()=>{B.setState({open:!0})},[]),n=ce(()=>{B.setState({open:!1})},[]),r=ce(a=>{B.setState({open:a})},[]);return $t(()=>({accountModalOpen:e,openAccountModal:t,closeAccountModal:n,toggleAccountModal:r}),[e,t,n,r])}import{twMerge as Ct}from"tailwind-merge";import{useConnectorClient as Wr}from"wagmi";import{useAccount as Jn}from"wagmi";import{twMerge as F}from"tailwind-merge";import{twMerge as Zt}from"tailwind-merge";import{jsx as De,jsxs as en}from"react/jsx-runtime";function x({className:e,...t}){return en("svg",{className:Zt("-my-[0.125em] h-[1.25em] w-[1.25em] animate-spin",e),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...t,children:[De("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),De("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}import{jsx as E,jsxs as nn}from"react/jsx-runtime";var tn=({variant:e="primary"}={})=>F("group self-center leading-none outline-none border-4 border-transparent","transition hover:brightness-125 active:brightness-150","focus:border-orange-500","aria-disabled:pointer-events-none aria-busy:pointer-events-none","aria-disabled:opacity-50","p-[.75em] font-medium",{primary:F("bg-neutral-700 text-white"),secondary:F("bg-neutral-800 text-white")}[e]),g=({pending:e,variant:t,type:n,className:r,children:a,disabled:s,...i})=>E("button",{type:n||"button",className:F(tn({variant:t,pending:e}),r),"aria-busy":e,"aria-disabled":s,disabled:s||e,...i,children:nn("span",{className:"grid grid-cols-[1fr_auto_1fr] gap-2",children:[E("span",{className:"flex items-center justify-end text-[.75em]",children:E("span",{className:"transition opacity-0 translate-x-2 group-aria-busy:opacity-100 group-aria-busy:translate-x-0 duration-100 group-aria-busy:duration-300",children:E(x,{})})}),E("span",{children:a})]})});import{useConnectModal as Zn}from"@rainbow-me/rainbowkit";import{useMutation as $e,useQuery as er}from"@tanstack/react-query";import{useConnectors as Yn}from"wagmi";import{createClient as Bn,custom as Fn,getAddress as Wn,numberToHex as qe,SwitchChainError as Un}from"viem";import{ChainNotConfiguredError as Gn,createConnector as Vn}from"wagmi";import{createStore as rn}from"zustand/vanilla";import{persist as an}from"zustand/middleware";var m=rn(an(()=>({publicKeys:{},addresses:{},activeCredential:null}),{name:"mud:passkey:cache"}));function on(e){e.key===m.persist.getOptions().name&&m.persist.rehydrate()}window.addEventListener("storage",on);import{smartAccountActions as _n}from"permissionless/clients";import{toWebAuthnAccount as vn}from"viem/account-abstraction";import{BaseError as sn}from"abitype";import{pad as cn,encodeFunctionData as de,hashMessage as dn,hashTypedData as Le,encodeAbiParameters as Be,stringToHex as ln,size as pn,encodePacked as un,parseSignature as mn}from"viem";import{entryPoint07Abi as fn,entryPoint07Address as yn,getUserOperationHash as gn,toSmartAccount as hn}from"viem/account-abstraction";import{readContract as Ke}from"viem/actions";import{parseSignature as wn}from"webauthn-p256";async function G(e){let{client:t,owners:n,nonce:r=0n}=e,a=e.address,s={abi:fn,address:yn,version:"0.7"},i={abi:xn,address:"0x356336adA1619BeC1Ae4E6D94Dd9c0490DA414a8"};if(!n.length)throw new Error("`owners` must have at least one account.");function o(d){return d.type==="webAuthn"?d.publicKey:cn(d.address)}let c=e.signer??n[0],l=n.indexOf(c);if(l===-1)throw new Error("`signer` must be one of `owners`.");return hn({client:t,entryPoint:s,extend:{__isCoinbaseSmartAccount:!0,abi:U,factory:i,signer:c},async encodeCalls(d){return d.length===1?de({abi:U,functionName:"execute",args:[d[0].to,d[0].value??0n,d[0].data??"0x"]}):de({abi:U,functionName:"executeBatch",args:[d.map(u=>({data:u.data??"0x",target:u.to,value:u.value??0n}))]})},async getAddress(){return a??=await Ke(t,{...i,functionName:"getAddress",args:[n.map(o),r]}),a},async getFactoryArgs(){let d=de({abi:i.abi,functionName:"createAccount",args:[n.map(o),r]});return{factory:i.address,factoryData:d}},async getStubSignature(){return c.type==="webAuthn"?"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000001949fc7c88032b9fcb5f6efc7a7b8c63668eae9871b765e23123bb473ff57aa831a7c0d9276168ebcc29f2875a0239cffdf2a9cd1c2007c5c77c071db9264df1d000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008a7b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2273496a396e6164474850596759334b7156384f7a4a666c726275504b474f716d59576f4d57516869467773222c226f726967696e223a2268747470733a2f2f7369676e2e636f696e626173652e636f6d222c2263726f73734f726967696e223a66616c73657d00000000000000000000000000000000000000000000":R({signature:"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",ownerIndex:l})},async sign(d){let u=await this.getAddress(),f=le({address:u,chainId:t.chain.id,hash:d.hash}),w=await W({hash:f,owner:c});return R({signature:w,ownerIndex:l})},async signMessage(d){let{message:u}=d,f=await this.getAddress(),w=le({address:f,chainId:t.chain.id,hash:dn(u)}),N=await W({hash:w,owner:c});return R({signature:N,ownerIndex:l})},async signTypedData(d){let{domain:u,types:f,primaryType:w,message:N}=d,ie=await this.getAddress(),Ht=le({address:ie,chainId:t.chain.id,hash:Le({domain:u,message:N,primaryType:w,types:f})}),Et=await W({hash:Ht,owner:c});return R({signature:Et,ownerIndex:l})},async signUserOperation(d){let{chainId:u=t.chain.id,...f}=d,w=await this.getAddress(),N=gn({chainId:u,entryPointAddress:s.address,entryPointVersion:s.version,userOperation:{...f,sender:w}}),ie=await W({hash:N,owner:c});return R({signature:ie,ownerIndex:l})},userOperation:{async estimateGas(d){if(c.type==="webAuthn")return{verificationGasLimit:BigInt(Math.max(Number(d.verificationGasLimit??0n),8e5))}}},async isOwner(d){return await Ke(t,{abi:U,address:await this.getAddress(),functionName:"isOwnerBytes",args:[o(d)]})}})}async function W({hash:e,owner:t}){if(t.type==="webAuthn"){let{signature:n,webauthn:r}=await t.sign({hash:e});return bn({signature:n,webauthn:r})}if(t.sign)return t.sign({hash:e});throw new sn("`owner` does not support raw sign.")}function le({address:e,chainId:t,hash:n}){return Le({domain:{chainId:t,name:"Coinbase Smart Wallet",verifyingContract:e,version:"1"},types:{CoinbaseSmartWalletMessage:[{name:"hash",type:"bytes32"}]},primaryType:"CoinbaseSmartWalletMessage",message:{hash:n}})}function bn({webauthn:e,signature:t}){let{r:n,s:r}=wn(t);return Be([{components:[{name:"authenticatorData",type:"bytes"},{name:"clientDataJSON",type:"bytes"},{name:"challengeIndex",type:"uint256"},{name:"typeIndex",type:"uint256"},{name:"r",type:"uint256"},{name:"s",type:"uint256"}],type:"tuple"}],[{authenticatorData:e.authenticatorData,clientDataJSON:ln(e.clientDataJSON),challengeIndex:BigInt(e.challengeIndex),typeIndex:BigInt(e.typeIndex),r:n,s:r}])}function R(e){let{ownerIndex:t}=e,n=(()=>{if(pn(e.signature)!==65)return e.signature;let r=mn(e.signature);return un(["bytes32","bytes32","uint8"],[r.r,r.s,r.yParity===0?27:28])})();return Be([{components:[{name:"ownerIndex",type:"uint8"},{name:"signatureData",type:"bytes"}],type:"tuple"}],[{ownerIndex:t,signatureData:n}])}var U=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"owner",type:"bytes"}],name:"AlreadyOwner",type:"error"},{inputs:[],name:"Initialized",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidEthereumAddressOwner",type:"error"},{inputs:[{name:"key",type:"uint256"}],name:"InvalidNonceKey",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidOwnerBytesLength",type:"error"},{inputs:[],name:"LastOwner",type:"error"},{inputs:[{name:"index",type:"uint256"}],name:"NoOwnerAtIndex",type:"error"},{inputs:[{name:"ownersRemaining",type:"uint256"}],name:"NotLastOwner",type:"error"},{inputs:[{name:"selector",type:"bytes4"}],name:"SelectorNotAllowed",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{inputs:[],name:"UnauthorizedCallContext",type:"error"},{inputs:[],name:"UpgradeFailed",type:"error"},{inputs:[{name:"index",type:"uint256"},{name:"expectedOwner",type:"bytes"},{name:"actualOwner",type:"bytes"}],name:"WrongOwnerAtIndex",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"AddOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"RemoveOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"REPLAYABLE_NONCE_KEY",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"addOwnerAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"addOwnerPublicKey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"functionSelector",type:"bytes4"}],name:"canSkipChainIdValidation",outputs:[{name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"domainSeparator",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"entryPoint",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"calls",type:"bytes[]"}],name:"executeWithoutChainIdValidation",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHashWithoutChainId",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"$",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"owners",type:"bytes[]"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"isOwnerAddress",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"bytes"}],name:"isOwnerBytes",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"isOwnerPublicKey",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"result",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextOwnerIndex",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"}],name:"ownerAtIndex",outputs:[{name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownerCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeLastOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeOwnerAtIndex",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"removedOwnersCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"}],name:"replaySafeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"newImplementation",type:"address"},{name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{name:"validationData",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],xn=[{inputs:[{name:"implementation_",type:"address"}],stateMutability:"payable",type:"constructor"},{inputs:[],name:"OwnerRequired",type:"error"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"createAccount",outputs:[{name:"account",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"getAddress",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"}];async function T(e,t){let{publicKeys:n}=m.getState(),r=n[t];if(!r)throw new Error("No public key found for passkey credential.");let s=[vn({credential:{id:t,publicKey:r}})];return await G({client:e,owners:s})}import{bytesToHex as Hn,hashMessage as En}from"viem";import{sign as Rn}from"webauthn-p256";import{bytesToHex as Cn,hexToBytes as Fe}from"webauthn-p256";import{concatBytes as kn,utf8ToBytes as An}from"@noble/curves/abstract/utils";async function V(e){let{authenticatorData:t,challengeIndex:n,clientDataJSON:r,typeIndex:a,userVerificationRequired:s}=e,i=a||r.indexOf('"type"'),o=n||r.indexOf('"challenge"'),c=Fe(t);if(c.length<37)throw new Error("Invalid authenticatorData");let l=c[32];if((l&1)!==1)throw new Error("Invalid authenticatorData");if(s&&(l&4)!==4)throw new Error("Invalid authenticatorData");if((l&8)!==8&&(l&16)===16)throw new Error("Invalid authenticatorData");let d='"type":"webauthn.get"';if(d!==r.slice(Number(i),d.length+1))throw new Error("Invalid clientDataJSON");if(!r.slice(Number(o)).match(/^"challenge":"(.*?)"/))throw new Error("Invalid clientDataJSON");let f=new Uint8Array(await crypto.subtle.digest("SHA-256",An(r))),w=new Uint8Array(await crypto.subtle.digest("SHA-256",kn(Fe(t),f)));return Cn(w)}import{sign as Pn}from"webauthn-p256";import{parseSignature as Sn,serializePublicKey as We}from"webauthn-p256";import{secp256r1 as Ue}from"@noble/curves/p256";function pe(e){let{r:t,s:n}=Sn(e.signatureHex),r=new Ue.Signature(t,n).addRecoveryBit(1).recoverPublicKey(e.messageHash.slice(2)),a=new Ue.Signature(t,n).addRecoveryBit(0).recoverPublicKey(e.messageHash.slice(2));return[We(r),We(a)]}import{hashMessage as Mn}from"viem";function In([e,t]){return Nn([...pe(e),...pe(t)])}async function Ge(e){let t=Mn(e.signatureHex),{signature:n,webauthn:r,raw:a}=await Pn({credentialId:e.credentialId,hash:t}),s=await V(r),i=In([e,{signatureHex:n,messageHash:s}]);if(i)return{publicKey:i,credential:a}}function Nn(e){let t=new Set;for(let n of e){if(t.has(n))return n;t.add(n)}}async function ue(){let e=Hn(crypto.getRandomValues(new Uint8Array(256))),t=En(e),{signature:n,webauthn:r,raw:a}=await Rn({hash:t}),s=await(async()=>{let i=m.getState().publicKeys[a.id];if(i)return i;let o=await V(r),c=await Ge({credentialId:a.id,messageHash:o,signatureHex:n});if(!c)throw new Error("recovery failed");if(c.credential.id!==a.id)throw new Error("wrong credential");return m.setState(l=>({publicKeys:{...l.publicKeys,[a.id]:c.publicKey}})),c.publicKey})();return console.log("recovered passkey",a.id,s),m.setState(()=>({activeCredential:a.id})),{id:a.id,publicKey:s,raw:a}}import{createCredential as Tn}from"webauthn-p256";async function Ve(){let e=await Tn({name:"MUD Account"});return console.log("created passkey",e),m.setState(t=>({activeCredential:e.id,publicKeys:{...t.publicKeys,[e.id]:e.publicKey}})),e}import{resourceToHex as On}from"@latticexyz/common";import{parseAbi as zn}from"viem";import Dn from"@latticexyz/world/mud.config";var _={pollingInterval:250},O=On({type:"system",namespace:"",name:"unlimited"}),_e=Dn.namespaces.world.tables,me=zn(["function registerDelegation(address delegatee, bytes32 delegationControlId, bytes initCallData)"]);import{createBundlerClient as Kn}from"viem/account-abstraction";var Ln=new Set([31337,17420,17069,690]);function q({paymasterAddress:e,...t}){let n=t.chain??t.client?.chain;return Kn({..._,paymaster:{getPaymasterData:async()=>({paymaster:e,paymasterData:"0x"})},userOperation:{estimateFeesPerGas:n&&Ln.has(n.id)?async()=>({maxFeePerGas:100000n,maxPriorityFeePerGas:0n}):void 0},...t})}import{observer as qn}from"@latticexyz/explorer/observer";S.type="passkey";function S({chainId:e,bundlerTransport:t,paymasterAddress:n,explorerUrl:r}){return Vn(a=>{if(!a.transports)throw new Error("Wagmi must be configured with transports to use the passkey connector.");let s=a.chains.find(l=>l.id===e);if(!s)throw new Error(`Could not find configured chain for chain ID ${e}.`);let i=a.transports[s.id];if(!i)throw new Error(`Could not find configured transport for chain ID ${e}.`);let o=Bn({..._,chain:s,transport:i}),c=m.getState().activeCredential!=null;return{id:"passkey",type:S.type,name:"Passkey",async createPasskey(){let{id:l}=await Ve(),d=await T(o,l);this.onAccountsChanged([d.address]),this.onConnect?.({chainId:qe(e)})},async reusePasskey(){let{id:l}=await ue(),d=await T(o,l);this.onAccountsChanged([d.address]),this.onConnect?.({chainId:qe(e)})},async hasPasskey(){return Object.keys(m.getState().publicKeys).length>0},async connect(l){if(console.log("connect"),l?.chainId!=null&&l.chainId!==e)throw new Error(`Can't connect to chain ${l.chainId}. Passkey connector is bound to chain ${e}.`);!m.getState().activeCredential&&!l?.isReconnecting&&await ue();let d=await this.getAccounts();return c=d.length>0,{accounts:d,chainId:e}},async disconnect(){console.log("disconnect"),c=!1,m.setState({activeCredential:null})},async getAccounts(){console.log("getAccounts");let l=m.getState().activeCredential;if(!l)return[];try{console.log("getting account for credential",l);let d=await T(o,l);return console.log("got account",d),[d.address]}catch{console.log("could not get address for credential ID",l)}return[]},async getChainId(){return e},async isAuthorized(){return console.log("isAuthorized"),c?(await this.getAccounts()).length>0:!1},async switchChain(l){if(l.chainId!==e)throw new Error(`Can't connect to chain ${l.chainId}. Passkey connector is bound to chain ${e}.`);let d=a.chains.find(u=>u.id===l.chainId);if(!d)throw new Un(new Gn);return d},onAccountsChanged(l){console.log("onAccountsChanged"),l.length>0?a.emitter.emit("change",{accounts:l.map(d=>Wn(d))}):this.onDisconnect()},onChainChanged(l){console.log("onChainChanged"),a.emitter.emit("change",{chainId:Number(l)})},async onConnect(l){console.log("onConnect");let d=await this.getAccounts();a.emitter.emit("connect",{accounts:d,chainId:e})},async onDisconnect(l){console.log("onDisconnect"),a.emitter.emit("disconnect"),c=!1},async getClient(l){console.log("passkeyConnector.getClient",l);let d=m.getState().activeCredential;if(!d)throw new Error("Not connected.");let u=await T(o,d);return q({paymasterAddress:n,transport:t,client:o,account:u}).extend(_n()).extend(f=>r?qn({explorerUrl:r})(f):{})},async getProvider(l){return Fn({request:o.transport.request})({retryCount:0})}}})}function Ye(){let t=Yn().find(n=>n.type===S.type);if(!t)throw new Error("Could not find passkey connector. Did you configure Wagmi with the EntryKit passkey connector or passkey wallet?");return t}import{twMerge as Xn}from"tailwind-merge";import{jsx as fe,jsxs as Qn}from"react/jsx-runtime";function v({className:e,...t}){return Qn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 8 8",fill:"currentColor",shapeRendering:"crispEdges",className:Xn("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...t,children:[fe("path",{d:"M0 0h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm2-1h1v1H7zm0 1h1v1H7zM6 7h1v1H6zm1-2h1v1H7zm0-1h1v1H7zm0-1h1v1H7z"}),fe("path",{d:"M2 2h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm1-3h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm0 1h1v1H5zm0 1h1v1H5zm0 1h1v1H5zM4 5h1v1H4zM3 5h1v1H3z",opacity:".5"}),fe("path",{d:"M7 2h1v1H7zm0-1h1v1H7zM1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm1 0h1v1H6zm1 0h1v1H7z"})]})}function Xe(){let{appInfo:e}=p(),t=e?.name??document.title,n=location.host,r=e?.icon??document.querySelector("link[rel~='icon']")?.getAttribute("href")??"/favico.ico",a=e?.image;return{appName:t,appOrigin:n,appIcon:r,appImage:a}}import{useQuery as $n}from"@tanstack/react-query";function Y(e){return $n({enabled:!!e,retry:!1,retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,queryKey:[e],queryFn:()=>new Promise((t,n)=>{if(!e)throw new Error("usePreloadImage: Must provide `url` to preload image.");let r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error(`usePreloadImage: Could not load image.
|
|
1538
1449
|
|
|
1539
|
-
.dark\\:aria-disabled\\:border-neutral-600[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1540
|
-
--tw-border-opacity: 1;
|
|
1541
|
-
border-color: rgb(82 82 82 / var(--tw-border-opacity));
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
.dark\\:aria-disabled\\:bg-neutral-400[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1545
|
-
--tw-bg-opacity: 1;
|
|
1546
|
-
background-color: rgb(163 163 163 / var(--tw-bg-opacity));
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
.dark\\:aria-disabled\\:text-neutral-500[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1550
|
-
--tw-text-opacity: 1;
|
|
1551
|
-
color: rgb(115 115 115 / var(--tw-text-opacity));
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
.dark\\:aria-disabled\\:text-neutral-600[aria-disabled="true"]:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1555
|
-
--tw-text-opacity: 1;
|
|
1556
|
-
color: rgb(82 82 82 / var(--tw-text-opacity));
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
.dark\\:links\\:text-white a[href]:not(.links-unset):where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1560
|
-
--tw-text-opacity: 1;
|
|
1561
|
-
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
.dark\\:links\\:decoration-neutral-500 a[href]:not(.links-unset):where([data-theme="dark"], [data-theme="dark"] *) {
|
|
1565
|
-
text-decoration-color: #737373;
|
|
1566
|
-
}
|
|
1567
|
-
`;import{useResizeObserver as _t}from"usehooks-ts";import{mergeRefs as qt}from"react-merge-refs";import{createContext as Dt,useContext as Kt}from"react";import{jsx as Lt}from"react/jsx-runtime";var Se=Dt(null);function Pe({frame:e,children:t}){if(Kt(Se))throw new Error("`FrameProvider` can only be used once.");return Lt(Se.Provider,{value:{frame:e},children:t})}import{useMediaQuery as Ft}from"usehooks-ts";import"@rainbow-me/rainbowkit/styles.css";import{createContext as Bt,useContext as He}from"react";import{RainbowKitProvider as Wt,lightTheme as Me,midnightTheme as Ne}from"@rainbow-me/rainbowkit";import{jsx as Ie}from"react/jsx-runtime";var me=Bt(null);function Ee({config:e,children:t}){if(He(me))throw new Error("`EntryKitProvider` can only be used once.");return Ie(Wt,{initialChain:e.chainId,appInfo:{appName:e.appInfo?.name},theme:e.theme==="light"?Me({borderRadius:"none"}):e.theme==="dark"?Ne({borderRadius:"none"}):{lightMode:Me({borderRadius:"none"}),darkMode:Ne({borderRadius:"none"})},children:Ie(me.Provider,{value:e,children:t})})}function p(){let e=He(me);if(!e)throw new Error("`useEntryKitConfig` can only be used within a `EntryKitProvider`.");return e}function Re(){let{theme:e}=p(),t=Ft("(prefers-color-scheme: dark)");return e??(t?"dark":"light")}import{jsx as O,jsxs as Xt}from"react/jsx-runtime";function Yt({onSize:e,...t}){let r=Oe(null);return _t({ref:r,onResize:e}),O("div",{ref:r,...t,style:{...t.style,display:"inline-block"}})}var U=Gt(function({mode:t,children:r},a){let n=Oe(null),[i,o]=Te(!1),d=i?n.current:null,[l,c]=Te({width:void 0,height:void 0}),s=d?.contentDocument,u=Re();Ut(()=>{s&&s.body.setAttribute("data-theme",u)},[s,u]);let f=t==="modal"?{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",zIndex:"2147483646"}:l.width&&l.height?{all:"unset",display:"inline-block",width:`${l.width}px`,height:`${l.height}px`}:{all:"unset",display:"block",position:"fixed",inset:"0",width:"100vw",height:"100vh",opacity:0,pointerEvents:"none"};return O("iframe",{ref:qt([a,n]),style:f,onLoad:()=>o(!0),srcDoc:"<!doctype html><title>\u2026</title>",children:s?Vt.createPortal(Xt(Pe,{frame:d,children:[O("div",{children:t==="modal"?r:O(Yt,{onSize:c,children:r})}),O("style",{dangerouslySetInnerHTML:{__html:Ae}})]}),s.body):null})});import{twMerge as ze}from"tailwind-merge";import{jsx as z,jsxs as Jt}from"react/jsx-runtime";function De({open:e,onOpenChange:t,children:r}){return z($t,{open:e,onOpenChange:t,children:z(Qt,{children:Jt(U,{mode:"modal",children:[z("div",{className:ze("fixed inset-0","bg-neutral-700/50 dark:bg-neutral-900/75","animate-in animate-duration-500 fade-in")}),z("div",{className:ze("fixed inset-0","grid place-items-end sm:place-items-center overflow-y-auto","animate-in animate-duration-200 fade-in slide-in-from-bottom-4"),children:z(jt,{className:"outline-none w-full sm:max-w-screen-sm","aria-describedby":void 0,children:r})})]})})})}import{useCallback as fe,useMemo as Zt}from"react";import{useStore as er}from"zustand";import{createStore as tr}from"zustand/vanilla";var V=tr(()=>({open:!1}));function y(){let e=er(V,n=>n.open),t=fe(()=>{V.setState({open:!0})},[]),r=fe(()=>{V.setState({open:!1})},[]),a=fe(n=>{V.setState({open:n})},[]);return Zt(()=>({accountModalOpen:e,openAccountModal:t,closeAccountModal:r,toggleAccountModal:a}),[e,t,r,a])}import{twMerge as At}from"tailwind-merge";import{useConnectorClient as ja}from"wagmi";import{useAccount as Zr}from"wagmi";import{twMerge as _}from"tailwind-merge";import{twMerge as rr}from"tailwind-merge";import{jsx as Ke,jsxs as ar}from"react/jsx-runtime";function b({className:e,...t}){return ar("svg",{className:rr("-my-[0.125em] h-[1.25em] w-[1.25em] animate-spin",e),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...t,children:[Ke("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Ke("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}import{jsx as D,jsxs as or}from"react/jsx-runtime";var nr=({variant:e="primary",pending:t=!1}={})=>_("group self-center leading-none outline-none border border-transparent ring-2 ring-transparent focus:ring-orange-500 focus:border-transparent transition","aria-disabled:pointer-events-none aria-busy:pointer-events-none","p-[1em] font-semibold",{primary:_("bg-neutral-900 text-white hover:bg-neutral-700 active:bg-neutral-600 aria-disabled:bg-neutral-200 aria-disabled:text-neutral-400","dark:bg-neutral-100 dark:text-black dark:hover:bg-neutral-200 dark:active:bg-neutral-300 dark:aria-disabled:bg-neutral-400 dark:aria-disabled:text-neutral-600",t&&"dark:bg-neutral-700 dark:text-neutral-400"),secondary:_("text-black border-neutral-400 hover:bg-neutral-200 hover:border-neutral-500 active:bg-neutral-300 active:border-neutral-600 aria-disabled:text-neutral-400 aria-disabled:border-neutral-300","dark:text-white dark:border-neutral-400 dark:hover:bg-neutral-700 dark:hover:border-neutral-300 dark:active:bg-neutral-600 dark:active:border-neutral-200 dark:aria-disabled:text-neutral-500 dark:aria-disabled:border-neutral-600")}[e]),k=({pending:e,variant:t,type:r,className:a,children:n,disabled:i,...o})=>D("button",{type:r||"button",className:_(nr({variant:t,pending:e}),a),"aria-busy":e,"aria-disabled":i,disabled:i||e,...o,children:or("span",{className:"grid grid-cols-[1fr_auto_1fr] gap-2",children:[D("span",{className:"flex items-center justify-end text-[.75em]",children:D("span",{className:"transition opacity-0 translate-x-2 group-aria-busy:opacity-100 group-aria-busy:translate-x-0 duration-100 group-aria-busy:duration-300",children:D(b,{})})}),D("span",{children:n})]})});import{useConnectModal as ea}from"@rainbow-me/rainbowkit";import{useMutation as ta}from"@tanstack/react-query";import{useConnectors as $r}from"wagmi";import{createClient as Fr,custom as Gr,getAddress as Ur,numberToHex as Ye,SwitchChainError as Vr}from"viem";import{ChainNotConfiguredError as _r,createConnector as qr}from"wagmi";import{createStore as ir}from"zustand/vanilla";import{persist as sr}from"zustand/middleware";var m=ir(sr(()=>({publicKeys:{},addresses:{},activeCredential:null}),{name:"mud:passkey:cache"}));function cr(e){e.key===m.persist.getOptions().name&&m.persist.rehydrate()}window.addEventListener("storage",cr);import{smartAccountActions as Yr}from"permissionless/clients";import{toWebAuthnAccount as Cr}from"viem/account-abstraction";import{BaseError as dr}from"abitype";import{pad as lr,encodeFunctionData as ge,hashMessage as pr,hashTypedData as Be,encodeAbiParameters as We,stringToHex as ur,size as mr,encodePacked as fr,parseSignature as gr}from"viem";import{entryPoint07Abi as yr,entryPoint07Address as hr,getUserOperationHash as br,toSmartAccount as wr}from"viem/account-abstraction";import{readContract as Le}from"viem/actions";import{parseSignature as xr}from"webauthn-p256";async function X(e){let{client:t,owners:r,nonce:a=0n}=e,n=e.address,i={abi:yr,address:hr,version:"0.7"},o={abi:kr,address:"0x356336adA1619BeC1Ae4E6D94Dd9c0490DA414a8"};if(!r.length)throw new Error("`owners` must have at least one account.");function d(s){return s.type==="webAuthn"?s.publicKey:lr(s.address)}let l=e.signer??r[0],c=r.indexOf(l);if(c===-1)throw new Error("`signer` must be one of `owners`.");return wr({client:t,entryPoint:i,extend:{__isCoinbaseSmartAccount:!0,abi:Y,factory:o,signer:l},async encodeCalls(s){return s.length===1?ge({abi:Y,functionName:"execute",args:[s[0].to,s[0].value??0n,s[0].data??"0x"]}):ge({abi:Y,functionName:"executeBatch",args:[s.map(u=>({data:u.data??"0x",target:u.to,value:u.value??0n}))]})},async getAddress(){return n??=await Le(t,{...o,functionName:"getAddress",args:[r.map(d),a]}),n},async getFactoryArgs(){let s=ge({abi:o.abi,functionName:"createAccount",args:[r.map(d),a]});return{factory:o.address,factoryData:s}},async getStubSignature(){return l.type==="webAuthn"?"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000001949fc7c88032b9fcb5f6efc7a7b8c63668eae9871b765e23123bb473ff57aa831a7c0d9276168ebcc29f2875a0239cffdf2a9cd1c2007c5c77c071db9264df1d000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008a7b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2273496a396e6164474850596759334b7156384f7a4a666c726275504b474f716d59576f4d57516869467773222c226f726967696e223a2268747470733a2f2f7369676e2e636f696e626173652e636f6d222c2263726f73734f726967696e223a66616c73657d00000000000000000000000000000000000000000000":K({signature:"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",ownerIndex:c})},async sign(s){let u=await this.getAddress(),f=ye({address:u,chainId:t.chain.id,hash:s.hash}),v=await q({hash:f,owner:l});return K({signature:v,ownerIndex:c})},async signMessage(s){let{message:u}=s,f=await this.getAddress(),v=ye({address:f,chainId:t.chain.id,hash:pr(u)}),T=await q({hash:v,owner:l});return K({signature:T,ownerIndex:c})},async signTypedData(s){let{domain:u,types:f,primaryType:v,message:T}=s,ue=await this.getAddress(),Tt=ye({address:ue,chainId:t.chain.id,hash:Be({domain:u,message:T,primaryType:v,types:f})}),Ot=await q({hash:Tt,owner:l});return K({signature:Ot,ownerIndex:c})},async signUserOperation(s){let{chainId:u=t.chain.id,...f}=s,v=await this.getAddress(),T=br({chainId:u,entryPointAddress:i.address,entryPointVersion:i.version,userOperation:{...f,sender:v}}),ue=await q({hash:T,owner:l});return K({signature:ue,ownerIndex:c})},userOperation:{async estimateGas(s){if(l.type==="webAuthn")return{verificationGasLimit:BigInt(Math.max(Number(s.verificationGasLimit??0n),8e5))}}},async isOwner(s){return await Le(t,{abi:Y,address:await this.getAddress(),functionName:"isOwnerBytes",args:[d(s)]})}})}async function q({hash:e,owner:t}){if(t.type==="webAuthn"){let{signature:r,webauthn:a}=await t.sign({hash:e});return vr({signature:r,webauthn:a})}if(t.sign)return t.sign({hash:e});throw new dr("`owner` does not support raw sign.")}function ye({address:e,chainId:t,hash:r}){return Be({domain:{chainId:t,name:"Coinbase Smart Wallet",verifyingContract:e,version:"1"},types:{CoinbaseSmartWalletMessage:[{name:"hash",type:"bytes32"}]},primaryType:"CoinbaseSmartWalletMessage",message:{hash:r}})}function vr({webauthn:e,signature:t}){let{r,s:a}=xr(t);return We([{components:[{name:"authenticatorData",type:"bytes"},{name:"clientDataJSON",type:"bytes"},{name:"challengeIndex",type:"uint256"},{name:"typeIndex",type:"uint256"},{name:"r",type:"uint256"},{name:"s",type:"uint256"}],type:"tuple"}],[{authenticatorData:e.authenticatorData,clientDataJSON:ur(e.clientDataJSON),challengeIndex:BigInt(e.challengeIndex),typeIndex:BigInt(e.typeIndex),r,s:a}])}function K(e){let{ownerIndex:t}=e,r=(()=>{if(mr(e.signature)!==65)return e.signature;let a=gr(e.signature);return fr(["bytes32","bytes32","uint8"],[a.r,a.s,a.yParity===0?27:28])})();return We([{components:[{name:"ownerIndex",type:"uint8"},{name:"signatureData",type:"bytes"}],type:"tuple"}],[{ownerIndex:t,signatureData:r}])}var Y=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"owner",type:"bytes"}],name:"AlreadyOwner",type:"error"},{inputs:[],name:"Initialized",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidEthereumAddressOwner",type:"error"},{inputs:[{name:"key",type:"uint256"}],name:"InvalidNonceKey",type:"error"},{inputs:[{name:"owner",type:"bytes"}],name:"InvalidOwnerBytesLength",type:"error"},{inputs:[],name:"LastOwner",type:"error"},{inputs:[{name:"index",type:"uint256"}],name:"NoOwnerAtIndex",type:"error"},{inputs:[{name:"ownersRemaining",type:"uint256"}],name:"NotLastOwner",type:"error"},{inputs:[{name:"selector",type:"bytes4"}],name:"SelectorNotAllowed",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{inputs:[],name:"UnauthorizedCallContext",type:"error"},{inputs:[],name:"UpgradeFailed",type:"error"},{inputs:[{name:"index",type:"uint256"},{name:"expectedOwner",type:"bytes"},{name:"actualOwner",type:"bytes"}],name:"WrongOwnerAtIndex",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"AddOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"index",type:"uint256"},{indexed:!1,name:"owner",type:"bytes"}],name:"RemoveOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[],name:"REPLAYABLE_NONCE_KEY",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"addOwnerAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"addOwnerPublicKey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"functionSelector",type:"bytes4"}],name:"canSkipChainIdValidation",outputs:[{name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"domainSeparator",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"entryPoint",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"calls",type:"bytes[]"}],name:"executeWithoutChainIdValidation",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHashWithoutChainId",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"$",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"owners",type:"bytes[]"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"isOwnerAddress",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"bytes"}],name:"isOwnerBytes",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"isOwnerPublicKey",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"result",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextOwnerIndex",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"}],name:"ownerAtIndex",outputs:[{name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownerCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeLastOwner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"index",type:"uint256"},{name:"owner",type:"bytes"}],name:"removeOwnerAtIndex",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"removedOwnersCount",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"hash",type:"bytes32"}],name:"replaySafeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{name:"newImplementation",type:"address"},{name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{name:"validationData",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],kr=[{inputs:[{name:"implementation_",type:"address"}],stateMutability:"payable",type:"constructor"},{inputs:[],name:"OwnerRequired",type:"error"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"createAccount",outputs:[{name:"account",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{name:"owners",type:"bytes[]"},{name:"nonce",type:"uint256"}],name:"getAddress",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"implementation",outputs:[{name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"}];async function L(e,t){let{publicKeys:r}=m.getState(),a=r[t];if(!a)throw new Error("No public key found for passkey credential.");let i=[Cr({credential:{id:t,publicKey:a}})];return await X({client:e,owners:i})}import{bytesToHex as Rr,hashMessage as Tr}from"viem";import{sign as Or}from"webauthn-p256";import{bytesToHex as Ar,hexToBytes as Fe}from"webauthn-p256";import{concatBytes as Sr,utf8ToBytes as Pr}from"@noble/curves/abstract/utils";async function $(e){let{authenticatorData:t,challengeIndex:r,clientDataJSON:a,typeIndex:n,userVerificationRequired:i}=e,o=n||a.indexOf('"type"'),d=r||a.indexOf('"challenge"'),l=Fe(t);if(l.length<37)throw new Error("Invalid authenticatorData");let c=l[32];if((c&1)!==1)throw new Error("Invalid authenticatorData");if(i&&(c&4)!==4)throw new Error("Invalid authenticatorData");if((c&8)!==8&&(c&16)===16)throw new Error("Invalid authenticatorData");let s='"type":"webauthn.get"';if(s!==a.slice(Number(o),s.length+1))throw new Error("Invalid clientDataJSON");if(!a.slice(Number(d)).match(/^"challenge":"(.*?)"/))throw new Error("Invalid clientDataJSON");let f=new Uint8Array(await crypto.subtle.digest("SHA-256",Pr(a))),v=new Uint8Array(await crypto.subtle.digest("SHA-256",Sr(Fe(t),f)));return Ar(v)}import{sign as Nr}from"webauthn-p256";import{parseSignature as Mr,serializePublicKey as Ge}from"webauthn-p256";import{secp256r1 as Ue}from"@noble/curves/p256";function he(e){let{r:t,s:r}=Mr(e.signatureHex),a=new Ue.Signature(t,r).addRecoveryBit(1).recoverPublicKey(e.messageHash.slice(2)),n=new Ue.Signature(t,r).addRecoveryBit(0).recoverPublicKey(e.messageHash.slice(2));return[Ge(a),Ge(n)]}import{hashMessage as Ir}from"viem";function Hr([e,t]){return Er([...he(e),...he(t)])}async function Ve(e){let t=Ir(e.signatureHex),{signature:r,webauthn:a,raw:n}=await Nr({credentialId:e.credentialId,hash:t}),i=await $(a),o=Hr([e,{signatureHex:r,messageHash:i}]);if(o)return{publicKey:o,credential:n}}function Er(e){let t=new Set;for(let r of e){if(t.has(r))return r;t.add(r)}}async function be(){let e=Rr(crypto.getRandomValues(new Uint8Array(256))),t=Tr(e),{signature:r,webauthn:a,raw:n}=await Or({hash:t}),i=await(async()=>{let o=m.getState().publicKeys[n.id];if(o)return o;let d=await $(a),l=await Ve({credentialId:n.id,messageHash:d,signatureHex:r});if(!l)throw new Error("recovery failed");if(l.credential.id!==n.id)throw new Error("wrong credential");return m.setState(c=>({publicKeys:{...c.publicKeys,[n.id]:l.publicKey}})),l.publicKey})();return console.log("recovered passkey",n.id,i),m.setState(()=>({activeCredential:n.id})),{id:n.id,publicKey:i,raw:n}}import{createCredential as zr}from"webauthn-p256";async function _e(){let e=await zr({name:"MUD Account"});return console.log("created passkey",e),m.setState(t=>({activeCredential:e.id,publicKeys:{...t.publicKeys,[e.id]:e.publicKey}})),e}import{resourceToHex as Dr}from"@latticexyz/common";import{parseAbi as Kr}from"viem";import Lr from"@latticexyz/world/mud.config";var Q={pollingInterval:250},B=Dr({type:"system",namespace:"",name:"unlimited"}),qe=Lr.namespaces.world.tables,we=Kr(["function registerDelegation(address delegatee, bytes32 delegationControlId, bytes initCallData)"]);import{createBundlerClient as Br}from"viem/account-abstraction";var Wr=new Set([31337,17420,17069,690]);function j({paymasterAddress:e,...t}){let r=t.chain??t.client?.chain;return Br({...Q,paymaster:{getPaymasterData:async()=>({paymaster:e,paymasterData:"0x"})},userOperation:{estimateFeesPerGas:r&&Wr.has(r.id)?async()=>({maxFeePerGas:100000n,maxPriorityFeePerGas:0n}):void 0},...t})}import{observer as Xr}from"@latticexyz/explorer/observer";N.type="passkey";function N({chainId:e,bundlerTransport:t,paymasterAddress:r,explorerUrl:a}){return qr(n=>{if(!n.transports)throw new Error("Wagmi must be configured with transports to use the passkey connector.");let i=n.chains.find(c=>c.id===e);if(!i)throw new Error(`Could not find configured chain for chain ID ${e}.`);let o=n.transports[i.id];if(!o)throw new Error(`Could not find configured transport for chain ID ${e}.`);let d=Fr({...Q,chain:i,transport:o}),l=m.getState().activeCredential!=null;return{id:"passkey",type:N.type,name:"Passkey",async createPasskey(){let{id:c}=await _e(),s=await L(d,c);this.onAccountsChanged([s.address]),this.onConnect?.({chainId:Ye(e)})},async reusePasskey(){let{id:c}=await be(),s=await L(d,c);this.onAccountsChanged([s.address]),this.onConnect?.({chainId:Ye(e)})},async connect(c){if(console.log("connect"),c?.chainId!=null&&c.chainId!==e)throw new Error(`Can't connect to chain ${c.chainId}. Passkey connector is bound to chain ${e}.`);!m.getState().activeCredential&&!c?.isReconnecting&&await be();let s=await this.getAccounts();return l=s.length>0,{accounts:s,chainId:e}},async disconnect(){console.log("disconnect"),l=!1,m.setState({activeCredential:null})},async getAccounts(){console.log("getAccounts");let c=m.getState().activeCredential;if(!c)return[];try{console.log("getting account for credential",c);let s=await L(d,c);return console.log("got account",s),[s.address]}catch{console.log("could not get address for credential ID",c)}return[]},async getChainId(){return e},async isAuthorized(){return console.log("isAuthorized"),l?(await this.getAccounts()).length>0:!1},async switchChain(c){if(c.chainId!==e)throw new Error(`Can't connect to chain ${c.chainId}. Passkey connector is bound to chain ${e}.`);let s=n.chains.find(u=>u.id===c.chainId);if(!s)throw new Vr(new _r);return s},onAccountsChanged(c){console.log("onAccountsChanged"),c.length>0?n.emitter.emit("change",{accounts:c.map(s=>Ur(s))}):this.onDisconnect()},onChainChanged(c){console.log("onChainChanged"),n.emitter.emit("change",{chainId:Number(c)})},async onConnect(c){console.log("onConnect");let s=await this.getAccounts();n.emitter.emit("connect",{accounts:s,chainId:e})},async onDisconnect(c){console.log("onDisconnect"),n.emitter.emit("disconnect"),l=!1},async getClient(c){console.log("passkeyConnector.getClient",c);let s=m.getState().activeCredential;if(!s)throw new Error("Not connected.");let u=await L(d,s);return j({paymasterAddress:r,transport:t,client:d,account:u}).extend(Yr()).extend(f=>a?Xr({explorerUrl:a})(f):{})},async getProvider(c){return Gr({request:d.transport.request})({retryCount:0})}}})}function Xe(){let t=$r().find(r=>r.type===N.type);if(!t)throw new Error("Could not find passkey connector. Did you configure Wagmi with the EntryKit passkey connector or passkey wallet?");return t}import{twMerge as Qr}from"tailwind-merge";import{jsx as xe,jsxs as jr}from"react/jsx-runtime";function A({className:e,...t}){return jr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 8 8",fill:"currentColor",shapeRendering:"crispEdges",className:Qr("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...t,children:[xe("path",{d:"M0 0h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm0 1h1v1H0zm1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm2-1h1v1H7zm0 1h1v1H7zM6 7h1v1H6zm1-2h1v1H7zm0-1h1v1H7zm0-1h1v1H7z"}),xe("path",{d:"M2 2h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm0 1h1v1H2zm1-3h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm0 1h1v1H5zm0 1h1v1H5zm0 1h1v1H5zM4 5h1v1H4zM3 5h1v1H3z",opacity:".5"}),xe("path",{d:"M7 2h1v1H7zm0-1h1v1H7zM1 0h1v1H1zm1 0h1v1H2zm1 0h1v1H3zm1 0h1v1H4zm1 0h1v1H5zm1 0h1v1H6zm1 0h1v1H7z"})]})}function $e(){let{appInfo:e}=p(),t=e?.name??document.title,r=location.host,a=e?.icon??document.querySelector("link[rel~='icon']")?.getAttribute("href")??"/favico.ico",n=e?.image;return{appName:t,appOrigin:r,appIcon:a,appImage:n}}import{useQuery as Jr}from"@tanstack/react-query";function J(e){return Jr({enabled:!!e,retry:!1,retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,queryKey:[e],queryFn:()=>new Promise((t,r)=>{if(!e)throw new Error("usePreloadImage: Must provide `url` to preload image.");let a=new Image;a.onload=()=>t(a),a.onerror=()=>r(new Error(`usePreloadImage: Could not load image.
|
|
1568
|
-
|
|
1569
|
-
URL: ${e}`)),a.src=e})})}import{jsx as W,jsxs as Qe}from"react/jsx-runtime";function je(){let{appName:e,appOrigin:t,appIcon:r}=$e(),{data:a,isLoading:n}=J(r);return Qe("div",{className:"flex-grow flex flex-col items-center justify-center gap-2",children:[W("div",{className:"w-16 h-16 m-2",children:n?null:a?W("img",{src:r,className:"w-full h-full object-cover"}):W(A,{className:"w-full h-full text-orange-500 dark:bg-neutral-800"})}),Qe("div",{className:"flex flex-col gap-1 items-center justify-center",children:[W("div",{className:"text-2xl",children:e}),W("div",{className:"text-sm font-mono text-neutral-400",children:t})]})]})}import{Fragment as ra,jsx as w,jsxs as Z}from"react/jsx-runtime";function Je(){let e=Zr(),{accountModalOpen:t}=y(),{openConnectModal:r,connectModalOpen:a}=ea(),n=Xe(),i=ta({mutationKey:["createPasskey",n.id,t,a,e.status],mutationFn:async()=>await n.createPasskey()});return w(ra,{children:w("div",{className:"flex-grow grid place-items-center p-6",children:Z("div",{className:"flex flex-col gap-6",children:[w("div",{className:"p-4",children:w(je,{})}),Z("div",{className:"flex flex-col gap-2",children:[Z("div",{className:"flex flex-col",children:[w(k,{className:"self-auto flex justify-center",pending:i.status==="pending",onClick:()=>i.mutate(),children:"Create account"}),i.status==="error"?w("div",{className:"bg-red-100 text-red-700 text-sm p-2 animate-in animate-duration-200 fade-in",children:i.error.message}):null]}),w(k,{className:"self-auto flex justify-center text-sm py-1",variant:"secondary",pending:e.status==="connecting",onClick:r,children:"Connect with passkey or wallet"})]}),Z("a",{href:"https://mud.dev",target:"_blank",rel:"noreferrer noopener",className:"self-center p-2 flex items-center justify-center gap-1.5 text-sm",children:[w("span",{className:"block w-4 h-4",children:w(A,{className:"w-full h-full text-orange-500 dark:bg-neutral-800"})}),w("span",{children:"Powered by MUD"})]})]})})})}import{useState as aa}from"react";import{twMerge as na}from"tailwind-merge";import{Fragment as oa,jsx as ee,jsxs as Ze}from"react/jsx-runtime";function et({steps:e}){if(!e.length)throw new Error("No steps.");let[t,r]=aa(null),a=e.find(o=>o.content!=null&&!o.isComplete),n=e.filter(o=>o.isComplete),i=(t!=null?e.find(o=>o.id===t):null)??a??(n.length<e.length?n.at(-1):null)??e.at(0);return Ze(oa,{children:[ee("div",{className:"flex items-center justify-center p-2",children:e.filter(o=>o.id!=="finalize").map(o=>Ze("button",{type:"button",title:o.label,disabled:!o.content,className:"outline-none p-2.5 -my-2.5 hover:enabled:brightness-125 transition",onClick:()=>r(o.id),children:[ee("span",{className:na("block w-2.5 h-2.5 rounded-full",o.id===a?.id?"bg-orange-500":o.isComplete?"bg-amber-700":"bg-gray-300",o.id===i.id?"ring-4 ring-orange-500/20":null)}),ee("span",{className:"sr-only",children:o.label})]},o.id))}),ee("div",{className:"outline-none flex-grow flex flex-col",children:i.content})]})}import{useDisconnect as fa}from"wagmi";import{twMerge as ia}from"tailwind-merge";import{jsx as sa}from"react/jsx-runtime";function g({className:e,children:t}){return sa("div",{className:ia("flex-grow flex flex-col gap-5 px-5 pb-5","animate-in fade-in slide-in-from-left-2",e),children:t})}import{useQuery as ca}from"@tanstack/react-query";function te(e){let t=e?.toLowerCase();return ca({enabled:!!t,queryKey:["ens",t],initialData:{address:void 0,name:void 0,displayName:void 0,avatar:void 0},queryFn:async()=>{let r=await fetch(`https://api.ensideas.com/ens/resolve/${t}`).then(a=>a.json());return{address:r.address??void 0,name:r.name??void 0,displayName:r.displayName??void 0,avatar:r.avatar??void 0}}})}import{jsx as ve,jsxs as da}from"react/jsx-runtime";function F({hex:e}){return e.length<=10?ve("span",{title:e,children:e}):da("span",{title:e,children:[ve("span",{className:"after:select-none after:content-['\u2026']",children:e.slice(0,6)}),ve("span",{className:"tracking-[-1ch] text-transparent",children:e.slice(6,-4)}),e.slice(-4)]})}import{twMerge as la}from"tailwind-merge";import{BaseError as pa,UserRejectedRequestError as ua}from"viem";import{jsx as tt,jsxs as ma}from"react/jsx-runtime";function S({title:e,error:t}){if(!t||t instanceof pa&&t.walk(n=>n instanceof ua)!=null)return null;let r=e??"Error",a=typeof t=="string"?t:t instanceof Error?String(t):"Something unexpected happened.";return ma("div",{className:la("text-sm border-l-4 border-red-500","bg-red-100 text-red-900","dark:bg-red-900 dark:text-red-50"),children:[tt("div",{className:"p-3 font-semibold",children:r}),tt("div",{className:"px-3 whitespace-break-spaces break-all max-h-32 overflow-y-scroll",children:a})]})}import{Fragment as ga,jsx as P,jsxs as I}from"react/jsx-runtime";function rt({userAddress:e}){let{data:t}=te(e),{disconnect:r,isPending:a,error:n}=fa(),{closeAccountModal:i}=y();return I(ga,{children:[I(g,{children:[P("div",{className:"text-lg font-medium",children:"Your wallet"}),I("div",{className:"space-y-4",children:[I("p",{children:["Hello,"," ",t.name?P("span",{className:"font-medium",children:t.name}):P("span",{className:"text-sm font-mono font-medium",children:P(F,{hex:e})}),"!"]}),I("p",{children:["Once signed in, your wallet address (",P("span",{className:"text-sm font-mono font-medium",children:P(F,{hex:e})}),") will be associated with all onchain actions for this app."]})]})]}),I(g,{className:"justify-end",children:[n?P(S,{error:n}):null,P(k,{variant:"secondary",className:"self-stretch sm:self-start",pending:a,onClick:()=>{i(),r()},children:"Disconnect"})]})]})}import{useClient as Aa}from"wagmi";import{useQuery as Sa}from"@tanstack/react-query";import{createStore as ya}from"zustand/vanilla";import{persist as ha}from"zustand/middleware";var G=ya(ha(()=>({appSigners:{}}),{name:"mud:entrykit",partialize:({appSigners:e})=>({appSigners:e})}));function ba(e){e.key===G.persist.getOptions().name&&G.persist.rehydrate()}window.addEventListener("storage",ba);import{generatePrivateKey as wa,privateKeyToAccount as xa}from"viem/accounts";function at(e){let t=G.getState().appSigners[e]??(()=>{let r=wa();return G.setState(a=>({appSigners:{...a.appSigners,[e]:r}})),r})();return xa(t)}import{smartAccountActions as va}from"permissionless";import{callFrom as ka}from"@latticexyz/world/internal";import{observer as Ca}from"@latticexyz/explorer/observer";async function nt({worldAddress:e,userAddress:t,client:r,bundlerTransport:a,paymasterAddress:n,explorerUrl:i}){let o=at(t),d=await X({client:r,owners:[o]});return j({paymasterAddress:n,transport:a,client:r,account:d}).extend(va()).extend(ka({worldAddress:e,delegatorAddress:t,publicClient:r})).extend(c=>i?Ca({explorerUrl:i})(c):{})}function H(e){let{chainId:t,bundlerTransport:r,paymasterAddress:a,worldAddress:n,explorerUrl:i}=p(),o=Aa({chainId:t}),d=["appAccountClient",o?.uid,e];return Sa(o&&e?{queryKey:d,queryFn:async()=>await nt({worldAddress:n,userAddress:e,client:o,bundlerTransport:r,paymasterAddress:a,explorerUrl:i}),staleTime:1/0}:{queryKey:d,enabled:!1})}import{useMutation as Ia,useQueryClient as Ha}from"@tanstack/react-query";import{getAction as ae}from"viem/utils";import{sendUserOperation as Ea,waitForUserOperationReceipt as Ra}from"viem/account-abstraction";import{defineStore as Pa}from"@latticexyz/store";import{parseAbi as Ma}from"viem";var ke=Ma(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),Na=Pa({namespaces:{root:{namespace:"",tables:{Allowance:{schema:{user:"address",allowance:"uint256"},key:["user"]},Grantor:{schema:{grantor:"address",allowance:"uint256"},key:["grantor"]},PassHolder:{schema:{user:"address",passId:"bytes32",lastRenewed:"uint256",lastClaimed:"uint256"},key:["user","passId"]},PassConfig:{schema:{passId:"bytes32",claimAmount:"uint256",claimInterval:"uint256",validityPeriod:"uint256",grantor:"address"},key:["passId"]},Spender:{schema:{spender:"address",user:"address"},key:["spender"]},SystemConfig:{schema:{entryPoint:"address"},key:[]}}}}}),re=Na.namespaces.root.tables;import{writeContract as ot}from"viem/actions";function it(){let{worldAddress:e,paymasterAddress:t}=p(),r=Ha();return Ia({mutationKey:["setupAppAccount"],mutationFn:async({userClient:a,appAccountAddress:n,registerSpender:i,registerDelegation:o})=>{a.account.type!=="smart"&&(await ae(a,ot,"writeContract")({chain:a.chain,account:a.account,address:t,abi:ke,functionName:"registerSpender",args:[n]}),await ae(a,ot,"writeContract")({chain:a.chain,account:a.account,address:e,abi:we,functionName:"registerDelegation",args:[n,B,"0x"]}));let d=[];if(i&&(console.log("registering spender"),d.push({to:t,abi:ke,functionName:"registerSpender",args:[n]})),o&&(console.log("registering delegation"),d.push({to:e,abi:we,functionName:"registerDelegation",args:[n,B,"0x"]})),!d.length)return;console.log("setting up account with",d);let l=await ae(a,Ea,"sendUserOperation")({calls:d});console.log("got user op hash",l);let c=await ae(a,Ra,"waitForUserOperationReceipt")({hash:l});console.log("got user op receipt",c),await r.invalidateQueries({queryKey:["readContract"]})}})}import{jsx as h,jsxs as st}from"react/jsx-runtime";function ct({userClient:e,registerSpender:t,registerDelegation:r}){let{closeAccountModal:a}=y(),n=H(e.account.address),i=it();return n.status==="pending"?h(g,{className:"items-center justify-center",children:h(b,{})}):n.status==="error"?h(g,{children:h(S,{error:n.error})}):!t&&!r?st(g,{children:[h("div",{className:"text-lg font-medium",children:"Your app account"}),h("p",{children:"Blah blah blah app account"}),h("p",{children:"All sorted"})]}):st(g,{children:[h("div",{className:"text-lg font-medium",children:"Set up account"}),h("p",{children:"Blah blah blah app account"}),n.data?h(k,{className:"self-start",pending:i.status==="pending",onClick:async()=>{await i.mutateAsync({userClient:e,appAccountAddress:n.data.account.address,registerSpender:t,registerDelegation:r}),a()},children:"Set up"}):h("p",{children:"not ready"})]})}import{useReadContract as Ta}from"wagmi";import Oa from"@latticexyz/store/out/IStoreRead.sol/IStoreRead.abi.json";import{decodeValueArgs as za,getKeyTuple as Da,getSchemaTypes as Ka,getValueSchema as La}from"@latticexyz/protocol-parser/internal";function E({table:e,key:t,...r}){return Ta(e&&t&&r.query?.enabled!==!1?{...r,abi:Oa,functionName:"getRecord",args:[e.tableId,Da(e,t)],query:{...r.query,select:a=>({...t,...za(Ka(La(e)),{staticData:a[0],encodedLengths:a[1],dynamicData:a[2]})})}}:{})}function ne(e){let{chainId:t,paymasterAddress:r}=p();return E({chainId:t,address:r,...e?{table:re.Allowance,key:{user:e}}:null})}import{useMutation as Ba,useQueryClient as Wa}from"@tanstack/react-query";function dt(){let e=Wa(),{passIssuerTransport:t}=p();return Ba({mutationKey:["claimGasPass"],mutationFn:async r=>{let a=t({retryCount:0});await a.request({method:"quarry_issuePass",params:["0x01",r]}),await a.request({method:"quarry_claimAllowance",params:["0x01",r]}),await e.invalidateQueries({queryKey:["readContract"]})}})}import{twMerge as Fa}from"tailwind-merge";import{jsx as oe,jsxs as Ga}from"react/jsx-runtime";function lt({className:e,...t}){return Ga("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 263 428",fill:"currentColor",className:Fa("w-[0.6em] h-[1em]",e),...t,children:[oe("path",{d:"M132 321V428L263 243L132 321Z"}),oe("path",{d:"M0 243L132 321V428",fillOpacity:"0.5"}),oe("path",{d:"M132 0V296L263 218"}),oe("path",{d:"M0 218L132 296V0L0 218Z",fillOpacity:"0.5"})]})}import{formatEther as Ua}from"viem";function pt(e){let t=Ua(e),r=Math.floor(parseFloat(t)).toString().length;return parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:Math.max(0,6-r)})}import{jsx as Va,jsxs as _a}from"react/jsx-runtime";function ut({wei:e}){return _a("span",{className:"inline-flex items-center gap-1",children:[pt(e)," ",Va(lt,{})]})}import{useEffect as Ya}from"react";import{parseEther as qa}from"viem";var ie=qa("0.01");import{Fragment as Xa,jsx as x,jsxs as se}from"react/jsx-runtime";function mt({userAddress:e}){let t=ne(e),r=dt();return Ya(()=>{r.status==="idle"&&t.data&&t.data.allowance<ie&&r.mutate(e)},[t.data,r,e]),t.status==="pending"?x(g,{className:"items-center justify-center",children:x(b,{})}):t.status==="error"?x(g,{children:x(S,{error:t.error})}):x(Xa,{children:se(g,{children:[x("div",{className:"text-lg font-medium",children:"Top up"}),se("div",{className:"space-y-4",children:[t.data.allowance>0n?se("p",{children:["You currently have ",x(ut,{wei:t.data.allowance})," allowance to spend on gas."]}):x("p",{children:"You haven't claimed a gas pass yet."}),se("div",{className:"flex flex-col",children:[x(k,{className:"self-start",pending:r.status==="pending",onClick:()=>r.mutate(e),children:"Claim gas pass"}),r.status==="error"?x("div",{className:"bg-red-100 text-red-700 text-sm p-2 animate-in animate-duration-200 fade-in",children:r.error.message}):null]})]})]})})}function ft(e){let{chainId:t,paymasterAddress:r}=p();return E({chainId:t,address:r,...e?{table:re.Spender,key:{spender:e}}:null})}function gt(e,t){let{chainId:r,worldAddress:a}=p();return E({chainId:r,address:a,...e&&t?{table:qe.UserDelegationControl,key:{delegator:e,delegatee:t}}:null})}import{useMemo as $a}from"react";import{jsx as Ce}from"react/jsx-runtime";function ce(e){let t=e?.account.address,r=ne(t),a=H(t),n=ft(a.data?.account.address),i=t&&n.data?n.data.user.toLowerCase()===t.toLowerCase():!1,o=gt(e?.account.address,a.data?.account.address),d=o.data?o.data?.delegationControlId===B:!1;return $a(()=>t?[{id:"connectWallet",label:"Sign in",isComplete:!0,content:Ce(rt,{userAddress:t})},{id:"claimGasPass",label:"Top up",isComplete:(r.data?.allowance??0n)>=ie,content:Ce(mt,{userAddress:t})},{id:"setupAppAccount",label:"Set up account",isComplete:i&&d,content:Ce(ct,{userClient:e,registerSpender:!i,registerDelegation:!d})}]:[{id:"connectWallet",label:"Sign in",isComplete:!1,content:null}],[r.data?.allowance,d,i,t,e])}import{jsx as Qa}from"react/jsx-runtime";function yt({userClient:e}){let t=ce(e);return Qa(et,{steps:t})}import{jsx as ht}from"react/jsx-runtime";function bt(){let{chainId:e}=p(),t=ja({chainId:e});return t.status!=="success"?ht(Je,{}):ht(yt,{userClient:t.data})}import{useState as Ja}from"react";import{ErrorBoundary as Za}from"react-error-boundary";import{wait as en}from"@latticexyz/common/utils";import{twMerge as tn}from"tailwind-merge";import{useIsMounted as rn}from"usehooks-ts";import{jsx as de,jsxs as wt}from"react/jsx-runtime";function xt({children:e}){let t=rn(),[r,a]=Ja(1);return de(Za,{fallbackRender:({error:n,resetErrorBoundary:i})=>wt("div",{className:tn("flex-grow flex flex-col justify-center p-5 gap-2"),children:[de(S,{error:n instanceof Error?n.stack??n.message:n}),r>0?wt("button",{type:"button",onClick:async o=>{o.currentTarget.ariaBusy="true",await en(1e3),i(),t()&&(a(d=>d-1),o.currentTarget.ariaBusy=null)},className:"group aria-busy:pointer-events-none self-end flex items-center gap-1",children:[de(b,{className:"transition opacity-0 group-aria-busy:opacity-100 text-xs text-neutral-500 dark:text-neutral-400"}),de("span",{className:"text-sm text-neutral-500 dark:text-neutral-400 group-hover:text-black dark:group-hover:text-white",children:"Retry?"})]}):null]}),children:e})}import{DialogClose as on,DialogTitle as sn}from"@radix-ui/react-dialog";import{twMerge as an}from"tailwind-merge";import{jsx as nn}from"react/jsx-runtime";function vt({className:e,children:t,...r}){return nn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:an("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...r,children:t})}import{jsx as kt}from"react/jsx-runtime";function Ct(e){return kt(vt,{strokeWidth:"2",stroke:"currentColor",...e,children:kt("path",{d:"M6 18L18 6M6 6L18 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as R,jsxs as St}from"react/jsx-runtime";function Pt(){let{accountModalOpen:e,toggleAccountModal:t}=y();return St(De,{open:e,onOpenChange:t,children:[R(sn,{className:"sr-only",children:"Connect with EntryKit"}),e?St("div",{className:At("relative flex flex-col min-h-[20rem] border-t sm:border","bg-neutral-100 text-neutral-700 border-neutral-300","dark:bg-neutral-800 dark:text-neutral-300 dark:border-neutral-700 dark:divide-neutral-700","links:font-medium links:underline links:underline-offset-4","links:text-black dark:links:text-white","links:decoration-neutral-300 dark:links:decoration-neutral-500 hover:links:decoration-orange-500"),children:[R(xt,{children:R(bt,{})}),R("div",{className:"absolute top-0 right-0",children:R(on,{className:At("pointer-events-auto leading-none p-1 transition","text-neutral-400 hover:text-neutral-600","dark:text-neutral-500 dark:hover:text-neutral-400"),title:"Close",children:R(Ct,{className:"m-0"})})})]}):null]})}import{jsx as dn,jsxs as ln}from"react/jsx-runtime";function cn({config:e,children:t}){return ln(Ee,{config:e,children:[t,dn(Pt,{})]})}import{useAccount as un}from"wagmi";import{twMerge as M}from"tailwind-merge";import{twMerge as Mt}from"tailwind-merge";import{Fragment as pn,jsx as le,jsxs as Nt}from"react/jsx-runtime";function It({address:e}){let{data:t}=te(e),{isSuccess:r}=J(t.avatar);return Nt(pn,{children:[Nt("span",{className:"flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center",children:[le("img",{src:r?t.avatar:void 0,className:Mt("col-start-1 row-start-1","inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",r?"opacity-100":"opacity-0")}),le(A,{className:Mt("col-start-1 row-start-1 text-orange-500","transition duration-300",r?"opacity-0":"opacity-100")})]}),le("span",{className:"flex-grow",children:t.name??(e?le(F,{hex:e}):null)})]})}import{jsx as C,jsxs as Et}from"react/jsx-runtime";var Ht=M("w-60 inline-flex outline-none transition","border border-transparent","text-base leading-none"),mn=M("bg-neutral-100 border-neutral-300 text-black","dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"),fn=M("cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700");function gn(){let{openAccountModal:e,accountModalOpen:t}=y(),{status:r,address:a}=un();return C(U,{mode:"child",children:r==="connected"||r==="reconnecting"&&a?C("button",{type:"button",className:M(Ht,mn,fn,"p-3"),onClick:e,children:C("span",{className:"flex-grow inline-flex gap-2.5 items-center text-left font-medium",children:C(It,{address:a})})},"connected"):Et("button",{type:"button",className:M(Ht,"group","items-center justify-center gap-2.5 p-3","bg-orange-500 text-white font-medium","hover:bg-orange-400","active:bg-orange-600","aria-busy:saturate-50"),"aria-busy":t,onClick:e,children:[Et("span",{className:"pointer-events-none inline-grid place-items-center -ml-3",children:[C("span",{className:M("col-start-1 row-start-1 leading-none","scale-100 opacity-100 transition duration-300","group-aria-busy:scale-125 group-aria-busy:opacity-0"),children:C(A,{})}),C("span",{"aria-hidden":!0,className:M("col-start-1 row-start-1","scale-50 opacity-0 transition duration-300 delay-50","group-aria-busy:scale-100 group-aria-busy:opacity-100"),children:C(b,{})})]}),C("span",{className:"font-medium",children:"Sign in"})]},"sign in")})}import{useConnectorClient as yn}from"wagmi";import{useMemo as hn}from"react";function bn(){let{chainId:e}=p(),{data:t,error:r}=yn({chainId:e});r&&console.error("Error retrieving user client",r);let a=H(t?.account.address),n=ce(t);return hn(()=>{if(n.every(i=>i.isComplete))return a.data},[a.data,n])}import{connectorsForWallets as xn,getDefaultWallets as vn}from"@rainbow-me/rainbowkit";import{createConfig as kn}from"wagmi";var wn=`data:image/svg+xml;base64,${btoa('<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" width="512" height="512" viewBox="-64 -32 608 512"><path d="M6.206 425.469A6.202 6.202 0 010 419.263c0-1.771.235-3.517.663-5.245 9.95-78.847 57.22-96.006 100.964-107.256 21.008-5.412 62.901-26.489 57.822-53.668-10.596-9.819-21.113-23.39-22.946-43.63l-1.274.026c-2.932-.044-5.778-.716-8.422-2.217-5.848-3.325-9.051-9.697-10.596-16.958-3.238-22.186-4.058-33.515 7.768-38.464l.096-.035c-1.467-27.37 3.159-67.64-24.944-76.141C154.622 7.1 218.597-30.203 266.627 30.805c53.519 2.801 77.389 78.611 44.154 121.046h-1.405c11.826 4.949 10.045 17.674 7.767 38.464-1.544 7.261-4.747 13.633-10.595 16.958-2.645 1.501-5.481 2.173-8.422 2.217l-1.275-.026c-1.833 20.24-12.376 33.811-22.972 43.63-4.459 23.871 27.275 43.011 49.33 50.997a139.442 139.442 0 004.268 5.525c-7.2 9.941-8.771 22.797-4.564 34.038-17.002 8.763-24.255 29.334-16.479 46.86-11.966 7.55-18.258 21.305-16.609 34.955H6.206zm419.058-105.362a86.778 86.778 0 0019.446-1.641c29.36-5.822 53.152-27.467 62.657-55.823 3.596-10.544 5.071-21.663 4.521-33.341-1.179-23.46-12.193-46.633-29.631-62.369-17.107-15.361-38.342-23.574-61.383-23.042-22.841.507-45.359 11.216-60.187 28.593-14.977 17.551-22.003 39.144-20.921 62.133.585 11.661 3.482 23.016 8.737 34.074 7.741 16.303 19.934 29.735 35.391 39.048l-22.457 20.711 13.232 27.86-29.413 13.973 13.991 29.456-26.769 12.717 16.81 35.374 35.601-16.915 40.375-110.808zm15.239-129.364c13.685 4.869 20.824 19.908 15.954 33.593-4.87 13.685-19.908 20.833-33.593 15.963-13.685-4.87-20.834-19.917-15.963-33.602 4.87-13.685 19.917-20.825 33.602-15.954z"/></svg>')}`,pe=e=>()=>({id:"passkey",name:"Passkey",iconUrl:wn,iconBackground:"#fec",createConnector:t=>r=>({...N(e)(r),...t})});function Cn(e){let{wallets:t}=vn(),r=[{groupName:"Recommended",wallets:[pe({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t],a=xn(r,{appName:e.appInfo.name,projectId:e.walletConnectProjectId});return kn({connectors:a,chains:e.chains,transports:e.transports})}function Vl(e){return e!=null&&"__isCoinbaseSmartAccount"in e&&e.__isCoinbaseSmartAccount===!0}var ql=new Set([17420,31337]);function Yl(e){return t=>{let{request:r,...a}=e(t),n=null,i=new Map;return{...a,async request(o){if(o.method==="eth_chainId")return n??(n=await r(o));if(o.method==="eth_getTransactionReceipt"){let d=o.params[0],l=i.get(d)??await r(o);return i.has(d)||i.set(d,l),l}if(o.method==="eth_sendUserOperation")return(await r({...o,method:"pimlico_sendUserOperationNow"})).userOpHash;if(o.method==="eth_getUserOperationReceipt"){let d=o.params[0],l=i.get(d)??await r(o);return i.has(d)||i.set(d,l),l}return r(o)}}}}import{connectorsForWallets as Sn}from"@rainbow-me/rainbowkit";import{getDefaultWallets as An}from"@rainbow-me/rainbowkit";function Rt(e){let{wallets:t}=An();return[{groupName:"Recommended",wallets:[pe({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t]}function rp({wallets:e,...t}){return Sn(e??Rt(t),{appName:t.appInfo?.name??document.title,projectId:t.walletConnectProjectId})}export{gn as AccountButton,cn as EntryKitProvider,Y as abi,Cn as createWagmiConfig,rp as getConnectors,Rt as getWallets,Vl as isCoinbaseSmartAccount,N as passkeyConnector,pe as passkeyWallet,q as sign,X as toCoinbaseSmartAccount,ye as toReplaySafeHash,vr as toWebAuthnSignature,y as useAccountModal,bn as useAppAccountClient,p as useEntryKitConfig,Yl as wiresaw,ql as wiresawChainIds,K as wrapSignature};
|
|
1450
|
+
URL: ${e}`)),r.src=e})})}import{jsx as X,jsxs as jn}from"react/jsx-runtime";function Qe(){let{appName:e,appIcon:t}=Xe(),{data:n,isLoading:r}=Y(t);return jn("div",{className:"flex-grow flex flex-col items-center justify-center gap-2",children:[X("div",{className:"w-16 h-16 m-2",children:r?null:n?X("img",{src:t,className:"w-full h-full object-cover"}):X(v,{className:"w-full h-full text-orange-500 dark:bg-neutral-800"})}),X("div",{className:"text-2xl text-white text-center",children:e})]})}import{twMerge as tr}from"tailwind-merge";import{Fragment as nr,jsx as C,jsxs as ye}from"react/jsx-runtime";function je(){let e=Jn(),{accountModalOpen:t}=y(),{openConnectModal:n,connectModalOpen:r}=Zn(),a=Ye(),s=$e({onError:c=>console.error(c),mutationKey:["createPasskey",a.id,t,r,e.status],mutationFn:()=>a.createPasskey()}),i=$e({onError:c=>console.error(c),mutationKey:["reusePasskey",a.id,t,r,e.status],mutationFn:()=>a.reusePasskey()}),{data:o}=er({queryKey:["hasPasskey",a.id,t,r,e.status],queryFn:()=>a.hasPasskey()});return C(nr,{children:C("div",{className:"flex-grow grid place-items-center p-6",children:ye("div",{className:"flex flex-col gap-6",children:[C("div",{className:"p-4",children:C(Qe,{})}),ye("div",{className:"self-center flex flex-col gap-2 w-60",children:[ye("div",{className:tr("flex flex-col gap-2",o?"flex-col-reverse":null),children:[C(g,{variant:o?"secondary":"primary",className:"self-auto flex justify-center",pending:s.status==="pending",onClick:()=>s.mutate(),children:"Create account"}),C(g,{variant:o?"primary":"secondary",className:"self-auto flex justify-center",pending:i.status==="pending",onClick:()=>i.mutate(),children:"Sign in"})]}),C("button",{className:"text-sm self-center transition text-neutral-500 hover:text-white p-2",disabled:e.status==="connecting",onClick:n,children:"Already have a wallet?"})]})]})})})}import{useState as Br}from"react";import{useMemo as Lr}from"react";import{parseEther as rr}from"viem";var Q=rr("0.01");import{useReadContract as ar}from"wagmi";import or from"@latticexyz/store/out/IStoreRead.sol/IStoreRead.abi.json";import{decodeValueArgs as ir,getKeyTuple as sr,getSchemaTypes as cr,getValueSchema as dr}from"@latticexyz/protocol-parser/internal";function P({table:e,key:t,...n}){return ar(e&&t&&n.query?.enabled!==!1?{...n,abi:or,functionName:"getRecord",args:[e.tableId,sr(e,t)],query:{...n.query,select:r=>({...t,...ir(cr(dr(e)),{staticData:r[0],encodedLengths:r[1],dynamicData:r[2]})})}}:{})}import{defineStore as lr}from"@latticexyz/store";import{parseAbi as pr}from"viem";var ge=pr(["error SpenderSystem_AlreadyRegistered(address spender, address user)","error SpenderSystem_HasOwnBalance(address spender)","function registerSpender(address spender)"]),ur=lr({namespaces:{root:{namespace:"",tables:{Allowance:{schema:{user:"address",allowance:"uint256"},key:["user"]},Grantor:{schema:{grantor:"address",allowance:"uint256"},key:["grantor"]},PassHolder:{schema:{user:"address",passId:"bytes32",lastRenewed:"uint256",lastClaimed:"uint256"},key:["user","passId"]},PassConfig:{schema:{passId:"bytes32",claimAmount:"uint256",claimInterval:"uint256",validityPeriod:"uint256",grantor:"address"},key:["passId"]},Spender:{schema:{spender:"address",user:"address"},key:["spender"]},SystemConfig:{schema:{entryPoint:"address"},key:[]}}}}}),$=ur.namespaces.root.tables;function j(e){let{chainId:t,paymasterAddress:n}=p();return P({chainId:t,address:n,...e?{table:$.Allowance,key:{user:e}}:null})}import{useClient as vr}from"wagmi";import{useQuery as Cr}from"@tanstack/react-query";import{createStore as mr}from"zustand/vanilla";import{persist as fr}from"zustand/middleware";var z=mr(fr(()=>({appSigners:{}}),{name:"mud:entrykit",partialize:({appSigners:e})=>({appSigners:e})}));function yr(e){e.key===z.persist.getOptions().name&&z.persist.rehydrate()}window.addEventListener("storage",yr);import{generatePrivateKey as gr,privateKeyToAccount as hr}from"viem/accounts";function Je(e){let t=z.getState().appSigners[e]??(()=>{let n=gr();return z.setState(r=>({appSigners:{...r.appSigners,[e]:n}})),n})();return hr(t)}import{smartAccountActions as wr}from"permissionless";import{callFrom as br}from"@latticexyz/world/internal";import{observer as xr}from"@latticexyz/explorer/observer";async function Ze({worldAddress:e,userAddress:t,client:n,bundlerTransport:r,paymasterAddress:a,explorerUrl:s}){let i=Je(t),o=await G({client:n,owners:[i]});return q({paymasterAddress:a,transport:r,client:n,account:o}).extend(wr()).extend(br({worldAddress:e,delegatorAddress:t,publicClient:n})).extend(l=>s?xr({explorerUrl:s})(l):{})}function M(e){let{chainId:t,bundlerTransport:n,paymasterAddress:r,worldAddress:a,explorerUrl:s}=p(),i=vr({chainId:t}),o=["appAccountClient",i?.uid,e];return Cr(i&&e?{queryKey:o,queryFn:async()=>await Ze({worldAddress:a,userAddress:e,client:i,bundlerTransport:n,paymasterAddress:r,explorerUrl:s}),staleTime:1/0}:{queryKey:o,enabled:!1})}function et(e){let{chainId:t,paymasterAddress:n}=p();return P({chainId:t,address:n,...e?{table:$.Spender,key:{spender:e}}:null})}function tt(e,t){let{chainId:n,worldAddress:r}=p();return P({chainId:n,address:r,...e&&t?{table:_e.UserDelegationControl,key:{delegator:e,delegatee:t}}:null})}import{useDisconnect as Sr}from"wagmi";import{useQuery as kr}from"@tanstack/react-query";function J(e){let t=e?.toLowerCase();return kr({enabled:!!t,queryKey:["ens",t],initialData:{address:void 0,name:void 0,displayName:void 0,avatar:void 0},queryFn:async()=>{let n=await fetch(`https://api.ensideas.com/ens/resolve/${t}`).then(r=>r.json());return{address:n.address??void 0,name:n.name??void 0,displayName:n.displayName??void 0,avatar:n.avatar??void 0}}})}import{jsx as he,jsxs as Ar}from"react/jsx-runtime";function Z({hex:e}){return e.length<=10?he("span",{title:e,children:e}):Ar("span",{title:e,children:[he("span",{className:"after:select-none after:content-['\u2026']",children:e.slice(0,6)}),he("span",{className:"tracking-[-1ch] text-transparent",children:e.slice(6,-4)}),e.slice(-4)]})}import{jsx as D,jsxs as we}from"react/jsx-runtime";function nt({isActive:e,isExpanded:t,userAddress:n}){let{data:r}=J(n),{disconnect:a,isPending:s}=Sr(),{closeAccountModal:i}=y();return we("div",{className:"flex flex-col gap-4",children:[we("div",{className:"flex justify-between gap-4",children:[we("div",{children:[D("div",{children:"Account"}),D("div",{className:"font-mono text-white",children:r.name??D(Z,{hex:n})})]}),D(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",pending:s,onClick:()=>{i(),a()},children:"Sign out"})]}),t?D("p",{className:"text-sm",children:"Each of your onchain actions in this app is associated with your account."}):null]})}import{useMutation as Pr,useQueryClient as Mr}from"@tanstack/react-query";function rt(){let e=Mr(),{passIssuerTransport:t}=p();return Pr({onError:n=>console.error(n),mutationKey:["claimGasPass"],mutationFn:async n=>{let r=t({retryCount:0});await r.request({method:"quarry_issuePass",params:["0x01",n]}),await r.request({method:"quarry_claimAllowance",params:["0x01",n]}),await e.invalidateQueries({queryKey:["readContract"]})}})}import{twMerge as Ir}from"tailwind-merge";import{jsx as ee,jsxs as Nr}from"react/jsx-runtime";function at({className:e,...t}){return Nr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 263 428",fill:"currentColor",className:Ir("w-[0.6em] h-[1em]",e),...t,children:[ee("path",{d:"M132 321V428L263 243L132 321Z"}),ee("path",{d:"M0 243L132 321V428",fillOpacity:"0.5"}),ee("path",{d:"M132 0V296L263 218"}),ee("path",{d:"M0 218L132 296V0L0 218Z",fillOpacity:"0.5"})]})}import{formatEther as Hr}from"viem";function ot(e){let t=Hr(e),n=Math.floor(parseFloat(t)).toString().length;return parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:Math.max(0,6-n)})}import{jsx as Er,jsxs as Rr}from"react/jsx-runtime";function it({wei:e}){return Rr("span",{className:"inline-flex items-center gap-1",children:[ot(e)," ",Er(at,{})]})}import{useEffect as Tr}from"react";import{jsx as I,jsxs as be}from"react/jsx-runtime";function st({isActive:e,isExpanded:t,userAddress:n}){let r=j(n),a=rt();return Tr(()=>{e&&a.status==="idle"&&r.data&&r.data.allowance<Q&&a.mutate(n)},[r.data,a,e,n]),be("div",{className:"flex flex-col gap-4",children:[be("div",{className:"flex justify-between gap-4",children:[be("div",{children:[I("div",{children:"Allowance"}),I("div",{className:"font-mono text-white",children:r.data?I(it,{wei:r.data.allowance}):I(x,{})})]}),I(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",pending:a.status==="pending",onClick:()=>a.mutate(n),children:"Top up"})]}),t?I("p",{className:"text-sm",children:"Your allowance is used to pay for onchain computation."}):null]})}import{useMutation as Or,useQueryClient as zr}from"@tanstack/react-query";import{getAction as te}from"viem/utils";import{sendUserOperation as Dr,waitForUserOperationReceipt as Kr}from"viem/account-abstraction";import{writeContract as ct}from"viem/actions";function dt(){let{worldAddress:e,paymasterAddress:t}=p(),n=zr();return Or({onError:r=>console.error(r),mutationKey:["setupAppAccount"],mutationFn:async({userClient:r,appAccountAddress:a,registerSpender:s,registerDelegation:i})=>{r.account.type!=="smart"&&(await te(r,ct,"writeContract")({chain:r.chain,account:r.account,address:t,abi:ge,functionName:"registerSpender",args:[a]}),await te(r,ct,"writeContract")({chain:r.chain,account:r.account,address:e,abi:me,functionName:"registerDelegation",args:[a,O,"0x"]}));let o=[];if(s&&(console.log("registering spender"),o.push({to:t,abi:ge,functionName:"registerSpender",args:[a]})),i&&(console.log("registering delegation"),o.push({to:e,abi:me,functionName:"registerDelegation",args:[a,O,"0x"]})),!o.length)return;console.log("setting up account with",o);let c=await te(r,Dr,"sendUserOperation")({calls:o});console.log("got user op hash",c);let l=await te(r,Kr,"waitForUserOperationReceipt")({hash:c});console.log("got user op receipt",l),await n.invalidateQueries({queryKey:["readContract"]})}})}import{jsx as K,jsxs as xe}from"react/jsx-runtime";function lt({isActive:e,isExpanded:t,userClient:n,registerSpender:r,registerDelegation:a}){let{closeAccountModal:s}=y(),i=M(n.account.address),o=dt(),c=!a&&!a;return xe("div",{className:"flex flex-col gap-4",children:[xe("div",{className:"flex justify-between gap-4",children:[xe("div",{children:[K("div",{children:"Session"}),K("div",{className:"font-mono text-white",children:c?"Approved":"Set up"})]}),c?K(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",disabled:!0,children:"Revoke"}):K(g,{variant:e?"primary":"secondary",className:"flex-shrink-0 text-sm p-1 w-28",pending:!i.data||o.status==="pending",onClick:i.data?async()=>{await o.mutateAsync({userClient:n,appAccountAddress:i.data.account.address,registerSpender:r,registerDelegation:a}),s()}:void 0,children:"Approve"})]}),t?K("p",{className:"text-sm",children:"You can perform actions in this app without interruptions for approvals."}):null]})}import{jsx as ve}from"react/jsx-runtime";function ne(e){let t=e?.account.address,n=j(t),r=M(t),a=et(r.data?.account.address),s=t&&a.data?a.data.user.toLowerCase()===t.toLowerCase():!1,i=tt(e?.account.address,r.data?.account.address),o=i.data?i.data?.delegationControlId===O:!1;return Lr(()=>t?[{id:"wallet",label:"Sign in",isComplete:!0,content:c=>ve(nt,{...c,userAddress:t})},{id:"allowance",label:"Top up",isComplete:(n.data?.allowance??0n)>=Q,content:c=>ve(st,{...c,userAddress:t})},{id:"session",label:"Set up account",isComplete:s&&o,content:c=>ve(lt,{...c,userClient:e,registerSpender:!s,registerDelegation:!o})}]:[{id:"wallet",label:"Sign in",isComplete:!1,content:()=>null}],[n.data?.allowance,o,s,t,e])}import{twMerge as Fr}from"tailwind-merge";import{jsx as pt}from"react/jsx-runtime";function ut({userClient:e}){let t=ne(e),[n,r]=Br(null),a=t.find(o=>o.content!=null&&!o.isComplete),s=t.filter(o=>o.isComplete),i=(n!=null?t.find(o=>o.id===n):null)??a??(s.length<t.length?s.at(-1):null);return pt("div",{className:"px-8 flex-grow flex flex-col divide-y divide-neutral-800",children:t.map(o=>{let c=o===i,l=c||s.length===t.length;return pt("div",{className:Fr("py-8 flex flex-col justify-center",c?"flex-grow":null),children:o.content({isActive:c,isExpanded:l})},o.id)})})}import{jsx as mt}from"react/jsx-runtime";function ft(){let{chainId:e}=p(),t=Wr({chainId:e});return t.status!=="success"?mt(je,{}):mt(ut,{userClient:t.data})}import{useState as qr}from"react";import{ErrorBoundary as Yr}from"react-error-boundary";import{twMerge as Ur}from"tailwind-merge";import{BaseError as Gr,UserRejectedRequestError as Vr}from"viem";import{jsx as yt,jsxs as _r}from"react/jsx-runtime";function gt({title:e,error:t}){if(!t||t instanceof Gr&&t.walk(a=>a instanceof Vr)!=null)return null;let n=e??"Error",r=typeof t=="string"?t:t instanceof Error?String(t):"Something unexpected happened.";return _r("div",{className:Ur("text-sm border-l-4 border-red-500","bg-red-100 text-red-900","dark:bg-red-900 dark:text-red-50"),children:[yt("div",{className:"p-3 font-semibold",children:n}),yt("div",{className:"px-3 whitespace-break-spaces break-all max-h-32 overflow-y-scroll",children:r})]})}import{wait as Xr}from"@latticexyz/common/utils";import{twMerge as Qr}from"tailwind-merge";import{useIsMounted as $r}from"usehooks-ts";import{jsx as re,jsxs as ht}from"react/jsx-runtime";function wt({children:e}){let t=$r(),[n,r]=qr(1);return re(Yr,{fallbackRender:({error:a,resetErrorBoundary:s})=>ht("div",{className:Qr("flex-grow flex flex-col justify-center p-5 gap-2"),children:[re(gt,{error:a instanceof Error?a.stack??a.message:a}),n>0?ht("button",{type:"button",onClick:async i=>{i.currentTarget.ariaBusy="true",await Xr(1e3),s(),t()&&(r(o=>o-1),i.currentTarget.ariaBusy=null)},className:"group aria-busy:pointer-events-none self-end flex items-center gap-1",children:[re(x,{className:"transition opacity-0 group-aria-busy:opacity-100 text-xs text-neutral-500 dark:text-neutral-400"}),re("span",{className:"text-sm text-neutral-500 dark:text-neutral-400 group-hover:text-black dark:group-hover:text-white",children:"Retry?"})]}):null]}),children:e})}import{DialogClose as Zr,DialogTitle as ea}from"@radix-ui/react-dialog";import{twMerge as jr}from"tailwind-merge";import{jsx as Jr}from"react/jsx-runtime";function bt({className:e,children:t,...n}){return Jr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:jr("-my-[0.125em] h-[1.25em] w-[1.25em]",e),...n,children:t})}import{jsx as xt}from"react/jsx-runtime";function vt(e){return xt(bt,{strokeWidth:"2",stroke:"currentColor",...e,children:xt("path",{d:"M6 18L18 6M6 6L18 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as h,jsxs as Ce}from"react/jsx-runtime";function kt(){let{accountModalOpen:e,toggleAccountModal:t}=y();return Ce(ze,{open:e,onOpenChange:t,children:[h(ea,{className:"sr-only",children:"Connect with EntryKit"}),e?Ce("div",{className:Ct("relative flex flex-col min-h-[28rem] ring-1","bg-neutral-900 text-neutral-400 ring-neutral-700/50 divide-neutral-700","links:font-medium links:underline links:underline-offset-4","links:text-white","links:decoration-neutral-500 hover:links:decoration-orange-500"),children:[h("div",{className:"flex-grow flex flex-col",children:h(wt,{children:h(ft,{})})}),Ce("a",{href:"https://mud.dev",target:"_blank",rel:"noreferrer noopener",className:"group self-center p-3 flex items-center justify-center gap-2 links-unset text-sm font-mono transition text-neutral-400 hover:text-white",children:[h("span",{className:"block w-4 h-4",children:h(v,{className:"w-full h-full text-orange-500 group-hover:rotate-90 transition duration-300"})}),h("span",{children:"Powered by MUD"})]}),h("div",{className:"absolute top-0 right-0",children:h(Zr,{className:Ct("pointer-events-auto leading-none p-2 transition","text-neutral-700 hover:text-neutral-500"),title:"Close",children:h(vt,{className:"m-0"})})})]}):null]})}import{jsx as na,jsxs as ra}from"react/jsx-runtime";function ta({config:e,children:t}){return ra(He,{config:e,children:[t,na(kt,{})]})}import{useAccount as oa}from"wagmi";import{twMerge as k}from"tailwind-merge";import{twMerge as At}from"tailwind-merge";import{Fragment as aa,jsx as ae,jsxs as St}from"react/jsx-runtime";function Pt({address:e}){let{data:t}=J(e),{isSuccess:n}=Y(t.avatar);return St(aa,{children:[St("span",{className:"flex-shrink-0 w-6 h-6 -my-1 -mx-0.5 grid place-items-center",children:[ae("img",{src:n?t.avatar:void 0,className:At("col-start-1 row-start-1","inline-flex w-full h-full rounded-full bg-black/10 dark:bg-white/10 bg-cover bg-no-repeat bg-center",n?"opacity-100":"opacity-0")}),ae(v,{className:At("col-start-1 row-start-1 text-orange-500","transition duration-300",n?"opacity-0":"opacity-100")})]}),ae("span",{className:"flex-grow",children:t.name??(e?ae(Z,{hex:e}):null)})]})}import{jsx as b,jsxs as It}from"react/jsx-runtime";var Mt=k("w-48 inline-flex outline-none transition","border border-transparent","text-base leading-none"),ia=k("bg-neutral-100 border-neutral-300 text-black","dark:bg-neutral-800 dark:border-neutral-700 dark:text-white"),sa=k("cursor-pointer outline-none hover:bg-neutral-200 data-[highlighted]:bg-neutral-200 dark:hover:bg-neutral-700");function ca(){let{openAccountModal:e,accountModalOpen:t}=y(),{status:n,address:r}=oa();return b(L,{mode:"child",children:n==="connected"||n==="reconnecting"&&r?b("button",{type:"button",className:k(Mt,ia,sa,"p-3"),onClick:e,children:b("span",{className:"flex-grow inline-flex gap-2.5 items-center text-left font-medium",children:b(Pt,{address:r})})},"connected"):It("button",{type:"button",className:k(Mt,"group","items-center justify-center gap-2.5 p-3","bg-orange-500 text-white font-medium","hover:bg-orange-400","active:bg-orange-600","aria-busy:saturate-50"),"aria-busy":t,onClick:e,children:[It("span",{className:"pointer-events-none inline-grid place-items-center -ml-3",children:[b("span",{className:k("col-start-1 row-start-1 leading-none","scale-100 opacity-100 transition duration-300","group-aria-busy:scale-125 group-aria-busy:opacity-0"),children:b(v,{})}),b("span",{"aria-hidden":!0,className:k("col-start-1 row-start-1","scale-50 opacity-0 transition duration-300 delay-50","group-aria-busy:scale-100 group-aria-busy:opacity-100"),children:b(x,{})})]}),b("span",{className:"font-medium",children:"Sign in"})]},"sign in")})}import{useConnectorClient as da}from"wagmi";import{useMemo as la}from"react";function pa(){let{chainId:e}=p(),{data:t,error:n}=da({chainId:e});n&&console.error("Error retrieving user client",n);let r=M(t?.account.address),a=ne(t);return la(()=>{if(a.every(s=>s.isComplete))return r.data},[r.data,a])}import{connectorsForWallets as ma,getDefaultWallets as fa}from"@rainbow-me/rainbowkit";import{createConfig as ya}from"wagmi";var ua=`data:image/svg+xml;base64,${btoa('<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" width="512" height="512" viewBox="-64 -32 608 512"><path d="M6.206 425.469A6.202 6.202 0 010 419.263c0-1.771.235-3.517.663-5.245 9.95-78.847 57.22-96.006 100.964-107.256 21.008-5.412 62.901-26.489 57.822-53.668-10.596-9.819-21.113-23.39-22.946-43.63l-1.274.026c-2.932-.044-5.778-.716-8.422-2.217-5.848-3.325-9.051-9.697-10.596-16.958-3.238-22.186-4.058-33.515 7.768-38.464l.096-.035c-1.467-27.37 3.159-67.64-24.944-76.141C154.622 7.1 218.597-30.203 266.627 30.805c53.519 2.801 77.389 78.611 44.154 121.046h-1.405c11.826 4.949 10.045 17.674 7.767 38.464-1.544 7.261-4.747 13.633-10.595 16.958-2.645 1.501-5.481 2.173-8.422 2.217l-1.275-.026c-1.833 20.24-12.376 33.811-22.972 43.63-4.459 23.871 27.275 43.011 49.33 50.997a139.442 139.442 0 004.268 5.525c-7.2 9.941-8.771 22.797-4.564 34.038-17.002 8.763-24.255 29.334-16.479 46.86-11.966 7.55-18.258 21.305-16.609 34.955H6.206zm419.058-105.362a86.778 86.778 0 0019.446-1.641c29.36-5.822 53.152-27.467 62.657-55.823 3.596-10.544 5.071-21.663 4.521-33.341-1.179-23.46-12.193-46.633-29.631-62.369-17.107-15.361-38.342-23.574-61.383-23.042-22.841.507-45.359 11.216-60.187 28.593-14.977 17.551-22.003 39.144-20.921 62.133.585 11.661 3.482 23.016 8.737 34.074 7.741 16.303 19.934 29.735 35.391 39.048l-22.457 20.711 13.232 27.86-29.413 13.973 13.991 29.456-26.769 12.717 16.81 35.374 35.601-16.915 40.375-110.808zm15.239-129.364c13.685 4.869 20.824 19.908 15.954 33.593-4.87 13.685-19.908 20.833-33.593 15.963-13.685-4.87-20.834-19.917-15.963-33.602 4.87-13.685 19.917-20.825 33.602-15.954z"/></svg>')}`,oe=e=>()=>({id:"passkey",name:"Passkey",iconUrl:ua,iconBackground:"#fec",createConnector:t=>n=>({...S(e)(n),...t})});function ga(e){let{wallets:t}=fa(),n=[{groupName:"Recommended",wallets:[oe({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t],r=ma(n,{appName:e.appInfo.name,projectId:e.walletConnectProjectId});return ya({connectors:r,chains:e.chains,transports:e.transports})}function Sl(e){return e!=null&&"__isCoinbaseSmartAccount"in e&&e.__isCoinbaseSmartAccount===!0}var Ml=new Set([17420,31337]);function Il(e){return t=>{let{request:n,...r}=e(t),a=null,s=new Map;return{...r,async request(i){if(i.method==="eth_chainId")return a??(a=await n(i));if(i.method==="eth_getTransactionReceipt"){let o=i.params[0],c=s.get(o)??await n(i);return s.has(o)||s.set(o,c),c}if(i.method==="eth_sendUserOperation")return(await n({...i,method:"pimlico_sendUserOperationNow"})).userOpHash;if(i.method==="eth_getUserOperationReceipt"){let o=i.params[0],c=s.get(o)??await n(i);return s.has(o)||s.set(o,c),c}return n(i)}}}}import{connectorsForWallets as wa}from"@rainbow-me/rainbowkit";import{getDefaultWallets as ha}from"@rainbow-me/rainbowkit";function Nt(e){let{wallets:t}=ha();return[{groupName:"Recommended",wallets:[oe({chainId:e.chainId,bundlerTransport:e.bundlerTransport,paymasterAddress:e.paymasterAddress})]},...t]}function Kl({wallets:e,...t}){return wa(e??Nt(t),{appName:t.appInfo?.name??document.title,projectId:t.walletConnectProjectId})}export{ca as AccountButton,ta as EntryKitProvider,U as abi,ga as createWagmiConfig,Kl as getConnectors,Nt as getWallets,Sl as isCoinbaseSmartAccount,S as passkeyConnector,oe as passkeyWallet,W as sign,G as toCoinbaseSmartAccount,le as toReplaySafeHash,bn as toWebAuthnSignature,y as useAccountModal,pa as useAppAccountClient,p as useEntryKitConfig,Il as wiresaw,Ml as wiresawChainIds,R as wrapSignature};
|
|
1570
1451
|
//# sourceMappingURL=internal.js.map
|