@sikka/hawa 0.37.1-next → 0.38.0-next
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/{Radio-y9uhxitu.d.ts → Radio-lgoClQrv.d.ts} +2 -2
- package/dist/{Radio-BCD7k628.d.mts → Radio-uQ7DtzcI.d.mts} +2 -2
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/blocks/auth/index.d.mts +1 -0
- package/dist/blocks/auth/index.d.ts +1 -0
- package/dist/blocks/auth/index.js +207 -123
- package/dist/blocks/auth/index.mjs +204 -101
- package/dist/blocks/feedback/index.js +4 -40
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.d.mts +2 -1
- package/dist/blocks/index.d.ts +2 -1
- package/dist/blocks/index.js +457 -400
- package/dist/blocks/index.mjs +10 -8
- package/dist/blocks/misc/index.js +5 -32
- package/dist/blocks/misc/index.mjs +5 -5
- package/dist/blocks/pricing/index.js +4 -22
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/checkbox/index.d.mts +1 -1
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/{chunk-BPHQFAWM.mjs → chunk-4EZL2A64.mjs} +3 -11
- package/dist/{chunk-DS3AACQJ.mjs → chunk-E6C3LDHD.mjs} +1 -1
- package/dist/{chunk-ODOCZAWC.mjs → chunk-E77TUADR.mjs} +1 -1
- package/dist/{chunk-QXH7ZDMN.mjs → chunk-IA5FLRFL.mjs} +3 -11
- package/dist/{chunk-ZTUWU652.mjs → chunk-JJMRBD3S.mjs} +3 -3
- package/dist/{chunk-RNFJAEEU.mjs → chunk-LDJD5ITW.mjs} +1 -0
- package/dist/{chunk-QYWOI3DO.mjs → chunk-MHSSZ6XE.mjs} +204 -144
- package/dist/{chunk-BTDR3VAG.mjs → chunk-Q3HJI7ZE.mjs} +4 -21
- package/dist/{chunk-MDHDHEPZ.mjs → chunk-TMUQCNLO.mjs} +3 -11
- package/dist/{chunk-PXGL7ZXQ.mjs → chunk-V4SUYEVH.mjs} +1 -0
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.d.mts +1 -1
- package/dist/colorPicker/index.d.ts +1 -1
- package/dist/colorPicker/index.js +35 -31
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +33 -29
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.d.mts +2 -2
- package/dist/combobox/index.d.ts +2 -2
- package/dist/combobox/index.js +52 -48
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +52 -48
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.d.mts +1 -1
- package/dist/command/index.d.ts +1 -1
- package/dist/command/index.js +26 -4
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +26 -4
- package/dist/command/index.mjs.map +1 -1
- package/dist/dataTable/index.js +1 -10
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +1 -10
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +48 -25
- package/dist/elements/index.d.ts +48 -25
- package/dist/elements/index.js +361 -294
- package/dist/elements/index.mjs +40 -27
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/{index-e_Ob_SnB.d.ts → index-B0aJcA6d.d.mts} +6 -4
- package/dist/{index-e_Ob_SnB.d.mts → index-B0aJcA6d.d.ts} +6 -4
- package/dist/index.css +29 -3
- package/dist/index.d.mts +50 -26
- package/dist/index.d.ts +50 -26
- package/dist/index.js +790 -721
- package/dist/index.mjs +313 -248
- package/dist/input/index.d.mts +1 -1
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +46 -42
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +45 -41
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +64 -69
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +57 -62
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.mjs +2 -2
- package/dist/passwordInput/index.js +70 -66
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +59 -55
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +50 -55
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +47 -52
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.d.mts +37 -16
- package/dist/pinInput/index.d.ts +37 -16
- package/dist/pinInput/index.js +208 -78
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +203 -77
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/radio/index.d.mts +1 -1
- package/dist/radio/index.d.ts +1 -1
- package/dist/radio/index.js +55 -60
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +50 -55
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.js +2 -2
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs +2 -2
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.js +43 -39
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +43 -39
- package/dist/select/index.mjs.map +1 -1
- package/dist/signature/index.d.mts +1 -1
- package/dist/signature/index.d.ts +1 -1
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs.map +1 -1
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.d.mts +1 -1
- package/dist/stats/index.d.ts +1 -1
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs.map +1 -1
- package/dist/tabs/index.js +2 -2
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +2 -2
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.d.mts +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/textarea/index.js +34 -30
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +34 -30
- package/dist/textarea/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/pinInput/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
// elements/pinInput/PinInput.tsx
|
4
|
-
import
|
4
|
+
import * as React2 from "react";
|
5
5
|
|
6
6
|
// util/index.ts
|
7
7
|
import { clsx } from "clsx";
|
@@ -11,87 +11,213 @@ function cn(...inputs) {
|
|
11
11
|
}
|
12
12
|
|
13
13
|
// elements/pinInput/PinInput.tsx
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
};
|
57
|
-
return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React.createElement(
|
58
|
-
"div",
|
59
|
-
{
|
60
|
-
className: "hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2",
|
61
|
-
dir: "ltr"
|
62
|
-
},
|
63
|
-
pin.map((value, index) => /* @__PURE__ */ React.createElement(
|
64
|
-
"input",
|
14
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
15
|
+
|
16
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
17
|
+
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
18
|
+
|
19
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
20
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
21
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
22
|
+
return Boolean(className) && array.indexOf(className) === index;
|
23
|
+
}).join(" ");
|
24
|
+
|
25
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
26
|
+
import { forwardRef, createElement } from "react";
|
27
|
+
|
28
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
29
|
+
var defaultAttributes = {
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
31
|
+
width: 24,
|
32
|
+
height: 24,
|
33
|
+
viewBox: "0 0 24 24",
|
34
|
+
fill: "none",
|
35
|
+
stroke: "currentColor",
|
36
|
+
strokeWidth: 2,
|
37
|
+
strokeLinecap: "round",
|
38
|
+
strokeLinejoin: "round"
|
39
|
+
};
|
40
|
+
|
41
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
42
|
+
var Icon = forwardRef(
|
43
|
+
({
|
44
|
+
color = "currentColor",
|
45
|
+
size = 24,
|
46
|
+
strokeWidth = 2,
|
47
|
+
absoluteStrokeWidth,
|
48
|
+
className = "",
|
49
|
+
children,
|
50
|
+
iconNode,
|
51
|
+
...rest
|
52
|
+
}, ref) => {
|
53
|
+
return createElement(
|
54
|
+
"svg",
|
65
55
|
{
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
),
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
56
|
+
ref,
|
57
|
+
...defaultAttributes,
|
58
|
+
width: size,
|
59
|
+
height: size,
|
60
|
+
stroke: color,
|
61
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
62
|
+
className: mergeClasses("lucide", className),
|
63
|
+
...rest
|
64
|
+
},
|
65
|
+
[
|
66
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
67
|
+
...Array.isArray(children) ? children : [children]
|
68
|
+
]
|
69
|
+
);
|
70
|
+
}
|
71
|
+
);
|
72
|
+
|
73
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
74
|
+
var createLucideIcon = (iconName, iconNode) => {
|
75
|
+
const Component = forwardRef2(
|
76
|
+
({ className, ...props }, ref) => createElement2(Icon, {
|
77
|
+
ref,
|
78
|
+
iconNode,
|
79
|
+
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
80
|
+
...props
|
81
|
+
})
|
82
|
+
);
|
83
|
+
Component.displayName = `${iconName}`;
|
84
|
+
return Component;
|
85
|
+
};
|
86
|
+
|
87
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
88
|
+
var Dot = createLucideIcon("Dot", [
|
89
|
+
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
90
|
+
]);
|
91
|
+
|
92
|
+
// elements/helperText/HelperText.tsx
|
93
|
+
import React from "react";
|
94
|
+
var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
|
95
|
+
"p",
|
96
|
+
{
|
97
|
+
className: cn(
|
98
|
+
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
99
|
+
helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
100
|
+
)
|
101
|
+
},
|
102
|
+
helperText
|
103
|
+
);
|
104
|
+
|
105
|
+
// elements/pinInput/PinInput.tsx
|
106
|
+
var PinInputRoot = React2.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
107
|
+
OTPInput,
|
108
|
+
{
|
109
|
+
ref,
|
110
|
+
containerClassName: cn(
|
111
|
+
"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50",
|
112
|
+
containerClassName
|
113
|
+
),
|
114
|
+
className: cn("disabled:hawa-cursor-not-allowed", className),
|
115
|
+
...props
|
116
|
+
}
|
117
|
+
));
|
118
|
+
PinInputRoot.displayName = "PinInputRoot";
|
119
|
+
var PinInputGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
120
|
+
"div",
|
121
|
+
{
|
122
|
+
ref,
|
123
|
+
className: cn("hawa-flex hawa-items-center", className),
|
124
|
+
...props
|
125
|
+
}
|
126
|
+
));
|
127
|
+
PinInputGroup.displayName = "PinInputGroup";
|
128
|
+
var PinInputSlot = React2.forwardRef(({ index, className, ...props }, ref) => {
|
129
|
+
const pinInputContext = React2.useContext(OTPInputContext);
|
130
|
+
const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
|
131
|
+
return /* @__PURE__ */ React2.createElement(
|
132
|
+
"div",
|
85
133
|
{
|
134
|
+
ref,
|
86
135
|
className: cn(
|
87
|
-
"hawa-
|
88
|
-
|
89
|
-
|
136
|
+
"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md",
|
137
|
+
isActive && "hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2",
|
138
|
+
className
|
139
|
+
),
|
140
|
+
...props
|
90
141
|
},
|
91
|
-
|
92
|
-
|
142
|
+
char,
|
143
|
+
hasFakeCaret && /* @__PURE__ */ React2.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React2.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
|
144
|
+
);
|
145
|
+
});
|
146
|
+
PinInputSlot.displayName = "PinInputSlot";
|
147
|
+
var PinInputSeperator = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React2.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React2.createElement(Dot, null)));
|
148
|
+
PinInputSeperator.displayName = "PinInputSeperator";
|
149
|
+
var PinInput = ({
|
150
|
+
separatorPosition = 0,
|
151
|
+
...props
|
152
|
+
}) => {
|
153
|
+
const maxLength = props.maxLength || 6;
|
154
|
+
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
155
|
+
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
156
|
+
const secondGroupLength = maxLength - firstGroupLength;
|
157
|
+
return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React2.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React2.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React2.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React2.createElement(
|
158
|
+
PinInputSlot,
|
159
|
+
{
|
160
|
+
key: index + firstGroupLength,
|
161
|
+
index: index + firstGroupLength,
|
162
|
+
className: "hawa-w-full"
|
163
|
+
}
|
164
|
+
)))), /* @__PURE__ */ React2.createElement(HelperText, { helperText: props.helperText }));
|
93
165
|
};
|
94
166
|
export {
|
95
|
-
PinInput
|
167
|
+
PinInput,
|
168
|
+
PinInputGroup,
|
169
|
+
PinInputRoot,
|
170
|
+
PinInputSeperator,
|
171
|
+
PinInputSlot
|
96
172
|
};
|
173
|
+
/*! Bundled license information:
|
174
|
+
|
175
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
176
|
+
(**
|
177
|
+
* @license lucide-react v0.379.0 - ISC
|
178
|
+
*
|
179
|
+
* This source code is licensed under the ISC license.
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
181
|
+
*)
|
182
|
+
|
183
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
184
|
+
(**
|
185
|
+
* @license lucide-react v0.379.0 - ISC
|
186
|
+
*
|
187
|
+
* This source code is licensed under the ISC license.
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
189
|
+
*)
|
190
|
+
|
191
|
+
lucide-react/dist/esm/Icon.js:
|
192
|
+
(**
|
193
|
+
* @license lucide-react v0.379.0 - ISC
|
194
|
+
*
|
195
|
+
* This source code is licensed under the ISC license.
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
197
|
+
*)
|
198
|
+
|
199
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
200
|
+
(**
|
201
|
+
* @license lucide-react v0.379.0 - ISC
|
202
|
+
*
|
203
|
+
* This source code is licensed under the ISC license.
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
205
|
+
*)
|
206
|
+
|
207
|
+
lucide-react/dist/esm/icons/dot.js:
|
208
|
+
(**
|
209
|
+
* @license lucide-react v0.379.0 - ISC
|
210
|
+
*
|
211
|
+
* This source code is licensed under the ISC license.
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
213
|
+
*)
|
214
|
+
|
215
|
+
lucide-react/dist/esm/lucide-react.js:
|
216
|
+
(**
|
217
|
+
* @license lucide-react v0.379.0 - ISC
|
218
|
+
*
|
219
|
+
* This source code is licensed under the ISC license.
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
221
|
+
*)
|
222
|
+
*/
|
97
223
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../elements/pinInput/PinInput.tsx","../../util/index.ts"],"sourcesContent":["import React, { useEffect, useState, FC } from \"react\";\n\nimport { cn } from \"@util/index\";\n\ntype PinInputTypes = {\n /** Label text to display for the Pin Input */\n label?: string;\n /** Icon element to be displayed next to the Pin Input */\n icon?: JSX.Element;\n /** Number of digits in the Pin Input */\n digits: number;\n /** Width of the Pin Input - either 'normal' or 'full' */\n width?: \"normal\" | \"full\";\n /** Function to get the value of pins */\n getPins?: (pins: string[]) => void;\n /** The small red text under the input field to show validation or a hint. */\n helperText?: any;\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n};\n\nexport const PinInput: FC<PinInputTypes> = ({\n label,\n icon,\n digits,\n width = \"normal\",\n getPins,\n inputProps,\n ...props\n}) => {\n const [pin, setPin] = useState(Array.from(Array(digits)));\n\n const handleKeyDown = (e: any, index: any) => {\n let backTo = 0;\n if (e.key === \"Backspace\") {\n e.target.value.length === 0 ? (backTo = index - 1) : (backTo = index);\n const previousInput = document.getElementById(`input-${backTo}`);\n previousInput?.focus();\n }\n };\n useEffect(() => {\n let unfilled = pin.includes(undefined);\n if (!unfilled && getPins) {\n getPins(pin);\n }\n });\n const handleChange = (e: any, index: any) => {\n if (!/^\\d*$/.test(e.target.value)) {\n const newPin = [...pin];\n newPin[index] = \"\";\n setPin(newPin);\n return;\n } else {\n const newPin = [...pin];\n newPin[index] = e.target.value;\n setPin(newPin);\n\n if (e.target.value.length === 1) {\n const nextInput = document.getElementById(`input-${index + 1}`);\n nextInput?.focus();\n } else if (e.target.value.length === 0) {\n const previousInput = document.getElementById(`input-${index - 1}`);\n previousInput?.focus();\n }\n }\n };\n\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n <div\n className=\"hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2\"\n dir=\"ltr\"\n >\n {pin.map((value, index) => (\n <input\n key={index}\n type=\"text\"\n maxLength={1}\n value={value}\n inputMode=\"numeric\"\n id={`input-${index}`}\n pattern=\"[0-9]*\"\n className={cn(\n \"hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center placeholder:hawa-text-muted-foreground\",\n width === \"full\" ? \"hawa-w-full\" : \"hawa-w-10\"\n )}\n onChange={(e) => handleChange(e, index)}\n onKeyDown={(e) => handleKeyDown(e, index)}\n onFocus={(e) => e.target.select()}\n {...inputProps}\n />\n ))}\n </div>\n\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n props.helperText\n ? \"hawa-h-4 hawa-opacity-100\"\n : \"hawa-h-0 hawa-opacity-0\"\n )}\n >\n {props.helperText}\n </p>\n </div>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n"],"mappings":";;;AAAA,OAAO,SAAS,WAAW,gBAAoB;;;ACA/C,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS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AAA;AAAA,MACC,WAAU;AAAA,MACV,KAAI;AAAA;AAAA,IAEH,IAAI,IAAI,CAAC,OAAO,UACf;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,MAAK;AAAA,QACL,WAAW;AAAA,QACX;AAAA,QACA,WAAU;AAAA,QACV,IAAI,SAAS,KAAK;AAAA,QAClB,SAAQ;AAAA,QACR,WAAW;AAAA,UACT;AAAA,UACA,UAAU,SAAS,gBAAgB;AAAA,QACrC;AAAA,QACA,UAAU,CAAC,MAAM,aAAa,GAAG,KAAK;AAAA,QACtC,WAAW,CAAC,MAAM,cAAc,GAAG,KAAK;AAAA,QACxC,SAAS,CAAC,MAAM,EAAE,OAAO,OAAO;AAAA,QAC/B,GAAG;AAAA;AAAA,IACN,CACD;AAAA,EACH,GAEA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,MAAM,aACF,8BACA;AAAA,MACN;AAAA;AAAA,IAEC,MAAM;AAAA,EACT,CACF;AAEJ;","names":[]}
|
1
|
+
{"version":3,"sources":["../../elements/pinInput/PinInput.tsx","../../util/index.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/shared/src/utils.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/src/defaultAttributes.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/src/Icon.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/src/createLucideIcon.ts","../../../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/src/icons/dot.ts","../../elements/helperText/HelperText.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@util/index\";\nimport { OTPInput, OTPInputContext, OTPInputProps } from \"input-otp\";\nimport { Dot } from \"lucide-react\";\n\nimport { HelperText } from \"../helperText\";\n\nconst PinInputRoot = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:hawa-cursor-not-allowed\", className)}\n {...props}\n />\n));\nPinInputRoot.displayName = \"PinInputRoot\";\n\nconst PinInputGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"hawa-flex hawa-items-center\", className)}\n {...props}\n />\n));\nPinInputGroup.displayName = \"PinInputGroup\";\n\nconst PinInputSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const pinInputContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md\",\n isActive &&\n \"hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center\">\n <div className=\"hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nPinInputSlot.displayName = \"PinInputSlot\";\n\nconst PinInputSeperator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n));\nPinInputSeperator.displayName = \"PinInputSeperator\";\n\ntype PinInputProps = Omit<OTPInputProps, \"render\"> & {\n /*\n * The position of the separator in the pin input\n * @default 3\n */\n separatorPosition?: number;\n helperText?: any;\n};\n\nconst PinInput: React.FC<PinInputProps> = ({\n separatorPosition = 0,\n ...props\n}) => {\n const maxLength = props.maxLength || 6; // Assuming a default maxLength of 6 if not provided\n const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);\n\n const firstGroupLength =\n clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;\n const secondGroupLength = maxLength - firstGroupLength;\n\n return (\n <div className=\"hawa-flex hawa-flex-col hawa-gap-2\">\n <PinInputRoot {...props}>\n {firstGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full\">\n {[...Array(firstGroupLength)].map((_, index) => (\n <PinInputSlot key={index} index={index} className=\"hawa-w-full\" />\n ))}\n </PinInputGroup>\n )}\n {separatorPosition > 0 && separatorPosition < props.maxLength && (\n <PinInputSeperator />\n )}\n {secondGroupLength > 0 && (\n <PinInputGroup className=\"hawa-w-full\">\n {[...Array(secondGroupLength)].map((_, index) => (\n <PinInputSlot\n key={index + firstGroupLength}\n index={index + firstGroupLength}\n className=\"hawa-w-full\"\n />\n ))}\n </PinInputGroup>\n )}\n </PinInputRoot>\n <HelperText helperText={props.helperText} />\n </div>\n );\n};\n\nexport {\n PinInput,\n PinInputRoot,\n PinInputGroup,\n PinInputSlot,\n PinInputSeperator,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\ntype Palette = {\n name: string;\n colors: {\n [key: number]: string;\n };\n};\ntype Rgb = {\n r: number;\n g: number;\n b: number;\n};\nfunction hexToRgb(hex: string): Rgb | null {\n const sanitizedHex = hex.replaceAll(\"##\", \"#\");\n const colorParts = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(\n sanitizedHex\n );\n\n if (!colorParts) {\n return null;\n }\n\n const [, r, g, b] = colorParts;\n\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16)\n } as Rgb;\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const toHex = (c: number) => `0${c.toString(16)}`.slice(-2);\n return `#${toHex(r)}${toHex(g)}${toHex(b)}`;\n}\n\nexport function getTextColor(color: string): \"#FFF\" | \"#333\" {\n const rgbColor = hexToRgb(color);\n\n if (!rgbColor) {\n return \"#333\";\n }\n\n const { r, g, b } = rgbColor;\n const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luma < 120 ? \"#FFF\" : \"#333\";\n}\n\nfunction lighten(hex: string, intensity: number): string {\n const color = hexToRgb(`#${hex}`);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r + (255 - color.r) * intensity);\n const g = Math.round(color.g + (255 - color.g) * intensity);\n const b = Math.round(color.b + (255 - color.b) * intensity);\n\n return rgbToHex(r, g, b);\n}\n\nfunction darken(hex: string, intensity: number): string {\n const color = hexToRgb(hex);\n\n if (!color) {\n return \"\";\n }\n\n const r = Math.round(color.r * intensity);\n const g = Math.round(color.g * intensity);\n const b = Math.round(color.b * intensity);\n\n return rgbToHex(r, g, b);\n}\nconst parseColor = (color: any) => {\n if (color.startsWith(\"#\")) {\n // Convert hex to RGB\n let r = parseInt(color.slice(1, 3), 16);\n let g = parseInt(color.slice(3, 5), 16);\n let b = parseInt(color.slice(5, 7), 16);\n return [r, g, b];\n } else if (color.startsWith(\"rgb\")) {\n // Extract RGB values from rgb() format\n return color.match(/\\d+/g).map(Number);\n }\n // Default to white if format is unrecognized\n return [255, 255, 255];\n};\nexport const calculateLuminance = (color: any) => {\n const [r, g, b] = parseColor(color)?.map((c: any) => {\n c /= 255;\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nfunction getPallette(baseColor: string): Palette {\n const name = baseColor;\n\n const response: Palette = {\n name,\n colors: {\n 500: `#${baseColor}`.replace(\"##\", \"#\")\n }\n };\n\n const intensityMap: {\n [key: number]: number;\n } = {\n 50: 0.95,\n 100: 0.9,\n 200: 0.75,\n 300: 0.6,\n 400: 0.3,\n 600: 0.9,\n 700: 0.75,\n 800: 0.6,\n 900: 0.49\n };\n\n [50, 100, 200, 300, 400].forEach((level) => {\n response.colors[level] = lighten(baseColor, intensityMap[level]);\n });\n [600, 700, 800, 900].forEach((level) => {\n response.colors[level] = darken(baseColor, intensityMap[level]);\n });\n\n return response as Palette;\n}\n\nexport { getPallette };\n\n// const hexToRgb = (hex) => {\n// let d = hex?.split(\"#\")[1];\n// var aRgbHex = d?.match(/.{1,2}/g);\n// var aRgb = [\n// parseInt(aRgbHex[0], 16),\n// parseInt(aRgbHex[1], 16),\n// parseInt(aRgbHex[2], 16)\n// ];\n// return aRgb;\n// };\n// const getTextColor = (backColor) => {\n// let rgbArray = hexToRgb(backColor);\n// if (rgbArray[0] * 0.299 + rgbArray[1] * 0.587 + rgbArray[2] * 0.114 > 186) {\n// return \"#000000\";\n// } else {\n// return \"#ffffff\";\n// }\n// };\n// const replaceAt = function (string, index, replacement) {\n// // if (replacement == \"\" || replacement == \" \") {\n// // return (\n// // string.substring(0, index) +\n// // string.substring(index + replacement.length )\n// // );\n// // }\n// const replaced = string.substring(0, index) + replacement + string.substring(index + 1)\n// return replaced\n// };\n\n// export { hexToRgb, getTextColor, replaceAt };\n","import { CamelToPascal } from './utility-types';\n\n/**\n * Converts string to kebab case\n *\n * @param {string} string\n * @returns {string} A kebabized string\n */\nexport const toKebabCase = (string: string) =>\n string.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Converts string to pascal case\n *\n * @param {string} string\n * @returns {string} A pascalized string\n */\nexport const toPascalCase = <T extends string>(string: T): CamelToPascal<T> => {\n const camelCase = string.replace(/^([A-Z])|[\\s-_]+(\\w)/g, (match, p1, p2) =>\n p2 ? p2.toUpperCase() : p1.toLowerCase(),\n );\n\n return (camelCase.charAt(0).toUpperCase() + camelCase.slice(1)) as CamelToPascal<T>;\n};\n\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = <ClassType = string | undefined | null>(...classes: ClassType[]) =>\n classes\n .filter((className, index, array) => {\n return Boolean(className) && array.indexOf(className) === index;\n })\n .join(' ');\n","export default {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 2,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n};\n","import { createElement, forwardRef } from 'react';\nimport defaultAttributes from './defaultAttributes';\nimport { IconNode, LucideProps } from './types';\nimport { mergeClasses } from '@lucide/shared';\n\ninterface IconComponentProps extends LucideProps {\n iconNode: IconNode;\n}\n\n/**\n * Lucide icon component\n *\n * @component Icon\n * @param {object} props\n * @param {string} props.color - The color of the icon\n * @param {number} props.size - The size of the icon\n * @param {number} props.strokeWidth - The stroke width of the icon\n * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width\n * @param {string} props.className - The class name of the icon\n * @param {IconNode} props.children - The children of the icon\n * @param {IconNode} props.iconNode - The icon node of the icon\n *\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst Icon = forwardRef<SVGSVGElement, IconComponentProps>(\n (\n {\n color = 'currentColor',\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = '',\n children,\n iconNode,\n ...rest\n },\n ref,\n ) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,\n className: mergeClasses('lucide', className),\n ...rest,\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n);\n\nexport default Icon;\n","import { createElement, forwardRef } from 'react';\nimport { mergeClasses, toKebabCase } from '@lucide/shared';\nimport { IconNode, LucideProps } from './types';\nimport Icon from './Icon';\n\n/**\n * Create a Lucide icon component\n * @param {string} iconName\n * @param {array} iconNode\n * @returns {ForwardRefExoticComponent} LucideIcon\n */\nconst createLucideIcon = (iconName: string, iconNode: IconNode) => {\n const Component = forwardRef<SVGSVGElement, LucideProps>(({ className, ...props }, ref) =>\n createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),\n ...props,\n }),\n );\n\n Component.displayName = `${iconName}`;\n\n return Component;\n};\n\nexport default createLucideIcon;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Dot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Dot = createLucideIcon('Dot', [\n ['circle', { cx: '12.1', cy: '12.1', r: '1', key: '18d7e5' }],\n]);\n\nexport default Dot;\n","import React from \"react\";\n\nimport { cn } from \"@util/index\";\n\nexport const HelperText = ({ helperText }: { helperText?: any }) => (\n <p\n className={cn(\n \"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all\",\n helperText ? \"hawa-h-4 hawa-opacity-100\" : \"hawa-h-0 hawa-opacity-0\",\n )}\n >\n {helperText}\n </p>\n);\n"],"mappings":";;;AAAA,YAAYA,YAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADFA,SAAS,UAAU,uBAAsC;;;;;;AEK5C,IAAA,cAAc,CAAC,WAC1B,OAAO,QAAQ,sBAAsB,OAAO,EAAE,YAAY;AAsB/C,IAAA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