wacomm 2.24.0 → 2.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/success/SuccessMessage.d.ts +6 -0
- package/dist/success/SuccessMessage.stories.d.ts +7 -0
- package/dist/success/index.d.ts +1 -0
- package/dist/toaster/Toaster.d.ts +11 -0
- package/dist/toaster/Toaster.stories.d.ts +8 -0
- package/dist/toaster/index.d.ts +1 -0
- package/dist/wacomm.cjs.js +8 -8
- package/dist/wacomm.css +1 -1
- package/dist/wacomm.es.js +168 -135
- package/package.json +1 -1
package/dist/wacomm.es.js
CHANGED
|
@@ -34573,41 +34573,74 @@ function Ek({ children: e, lazyFallback: t = null, errorFallback: n = null }) {
|
|
|
34573
34573
|
});
|
|
34574
34574
|
}
|
|
34575
34575
|
//#endregion
|
|
34576
|
+
//#region src/success/SuccessMessage.tsx
|
|
34577
|
+
function Dk({ label: e = "Success" }) {
|
|
34578
|
+
return /* @__PURE__ */ C("div", {
|
|
34579
|
+
className: "text-green-600",
|
|
34580
|
+
children: e
|
|
34581
|
+
});
|
|
34582
|
+
}
|
|
34583
|
+
//#endregion
|
|
34584
|
+
//#region src/toaster/Toaster.tsx
|
|
34585
|
+
var Ok = 1e3;
|
|
34586
|
+
function kk({ message: e, isOpen: t, onClose: n = Yt, duration: r = 2e3, className: i = "" }) {
|
|
34587
|
+
let [a, o] = x("hidden");
|
|
34588
|
+
return g(() => {
|
|
34589
|
+
if (!t) return;
|
|
34590
|
+
o("entering");
|
|
34591
|
+
let e = requestAnimationFrame(() => o("visible"));
|
|
34592
|
+
return () => cancelAnimationFrame(e);
|
|
34593
|
+
}, [t]), g(() => {
|
|
34594
|
+
if (a !== "visible") return;
|
|
34595
|
+
let e = setTimeout(() => o("exiting"), r);
|
|
34596
|
+
return () => clearTimeout(e);
|
|
34597
|
+
}, [a, r]), g(() => {
|
|
34598
|
+
if (a !== "exiting") return;
|
|
34599
|
+
let e = setTimeout(() => {
|
|
34600
|
+
o("hidden"), n();
|
|
34601
|
+
}, Ok);
|
|
34602
|
+
return () => clearTimeout(e);
|
|
34603
|
+
}, [a, n]), a === "hidden" ? null : /* @__PURE__ */ C("div", {
|
|
34604
|
+
className: `fixed bottom-6 left-1/2 -translate-x-1/2 z-[100] px-4 py-2 rounded-md shadow-lg transition-all ease-out ${a === "visible" ? "duration-300 opacity-100 translate-y-0" : a === "exiting" ? "duration-1000 opacity-0 translate-y-4" : "duration-300 opacity-0 translate-y-4"} ${i}`,
|
|
34605
|
+
children: e
|
|
34606
|
+
});
|
|
34607
|
+
}
|
|
34608
|
+
//#endregion
|
|
34576
34609
|
//#region src/tags/Tag.tsx
|
|
34577
|
-
var
|
|
34610
|
+
var Ak = [
|
|
34578
34611
|
"text-lime-700 border border-lime-700 bg-white",
|
|
34579
34612
|
"text-violet-600 border border-violet-600 bg-white",
|
|
34580
34613
|
"text-blue-500 border border-blue-500 bg-white",
|
|
34581
34614
|
"text-slate-300 border border-slate-300 bg-white",
|
|
34582
34615
|
"text-cyan-600 border border-cyan-600 bg-white",
|
|
34583
34616
|
"text-yellow-700 border border-yellow-700 bg-white"
|
|
34584
|
-
],
|
|
34617
|
+
], jk = [
|
|
34585
34618
|
"bg-lime-700 text-white",
|
|
34586
34619
|
"bg-violet-600 text-white",
|
|
34587
34620
|
"bg-blue-500 text-white",
|
|
34588
34621
|
"bg-slate-300 text-white",
|
|
34589
34622
|
"bg-cyan-600 text-white",
|
|
34590
34623
|
"bg-yellow-700 text-white"
|
|
34591
|
-
],
|
|
34592
|
-
let n =
|
|
34593
|
-
return t ?
|
|
34624
|
+
], Mk = 6, Nk = (e) => (typeof e == "string" && (e = sn(e)), Math.abs(Math.floor(e)) % Mk), Pk = (e, t) => {
|
|
34625
|
+
let n = Nk(e);
|
|
34626
|
+
return t ? jk[n] : Ak[n];
|
|
34594
34627
|
};
|
|
34595
|
-
function
|
|
34628
|
+
function Fk({ label: e, onClick: t = Yt, className: n = "", labelSize: r = "base", isHighlighted: i = !1, color: a = 0 }) {
|
|
34596
34629
|
return /* @__PURE__ */ C(Va, {
|
|
34597
34630
|
onClick: t,
|
|
34598
|
-
className: G("Tag w-fit h-fit px-1 rounded-full", n, `text-${r}`,
|
|
34631
|
+
className: G("Tag w-fit h-fit px-1 rounded-full", n, `text-${r}`, Pk(a, i)),
|
|
34599
34632
|
children: e
|
|
34600
34633
|
});
|
|
34601
34634
|
}
|
|
34602
34635
|
//#endregion
|
|
34603
34636
|
//#region src/tags/Tags.tsx
|
|
34604
|
-
function
|
|
34637
|
+
function Ik({ tags: e, highlightedTagIndex: t, className: n = "" }) {
|
|
34605
34638
|
return /* @__PURE__ */ C(Ya, {
|
|
34606
34639
|
className: G("Tags flex flex-wrap gap-1", n),
|
|
34607
34640
|
items: e,
|
|
34608
34641
|
itemRenderer: (e, n) => {
|
|
34609
34642
|
let r = typeof t == "number" ? n === t : void 0;
|
|
34610
|
-
return /* @__PURE__ */ C(
|
|
34643
|
+
return /* @__PURE__ */ C(Fk, {
|
|
34611
34644
|
...e,
|
|
34612
34645
|
...r === void 0 ? {} : { isHighlighted: r }
|
|
34613
34646
|
}, n);
|
|
@@ -34616,7 +34649,7 @@ function Nk({ tags: e, highlightedTagIndex: t, className: n = "" }) {
|
|
|
34616
34649
|
}
|
|
34617
34650
|
//#endregion
|
|
34618
34651
|
//#region src/Text.tsx
|
|
34619
|
-
function
|
|
34652
|
+
function Lk({ text: e, onClick: t = Yt, className: n = "", isHighlighted: r = !1 }) {
|
|
34620
34653
|
return /* @__PURE__ */ C(Va, {
|
|
34621
34654
|
onClick: t,
|
|
34622
34655
|
className: G("Text", r ? "text-blue-500" : "text-gray-500", n),
|
|
@@ -34625,7 +34658,7 @@ function Pk({ text: e, onClick: t = Yt, className: n = "", isHighlighted: r = !1
|
|
|
34625
34658
|
}
|
|
34626
34659
|
//#endregion
|
|
34627
34660
|
//#region src/ShowMore.tsx
|
|
34628
|
-
function
|
|
34661
|
+
function Rk({ onClick: e = Yt, className: t = "" }) {
|
|
34629
34662
|
return /* @__PURE__ */ C(Va, {
|
|
34630
34663
|
onClick: e,
|
|
34631
34664
|
className: G("ShowMore font-bold text-gray-700", t),
|
|
@@ -34634,7 +34667,7 @@ function Fk({ onClick: e = Yt, className: t = "" }) {
|
|
|
34634
34667
|
}
|
|
34635
34668
|
//#endregion
|
|
34636
34669
|
//#region src/carousel/Carousel.tsx
|
|
34637
|
-
function
|
|
34670
|
+
function zk({ children: e, className: t = "w-50" }) {
|
|
34638
34671
|
return /* @__PURE__ */ C("div", {
|
|
34639
34672
|
className: G("Carousel", t),
|
|
34640
34673
|
children: /* @__PURE__ */ C(Te, {
|
|
@@ -34654,7 +34687,7 @@ function Ik({ children: e, className: t = "w-50" }) {
|
|
|
34654
34687
|
}
|
|
34655
34688
|
//#endregion
|
|
34656
34689
|
//#region src/avatar/LetterAvatar.tsx
|
|
34657
|
-
function
|
|
34690
|
+
function Bk({ letter: e, className: t = "", onClick: n }) {
|
|
34658
34691
|
return /* @__PURE__ */ C(Va, {
|
|
34659
34692
|
onClick: n,
|
|
34660
34693
|
className: G("LetterAvatar flex items-center justify-center rounded-full w-full h-full bg-blue-300 text-white font-bold", t),
|
|
@@ -34682,14 +34715,14 @@ function Lk({ letter: e, className: t = "", onClick: n }) {
|
|
|
34682
34715
|
}
|
|
34683
34716
|
//#endregion
|
|
34684
34717
|
//#region src/avatar/Avatar.tsx
|
|
34685
|
-
function
|
|
34718
|
+
function Vk({ label: e = "N", className: t = "w-full h-full", imgSrc: n = "", fallbackImgSrc: r = "", onClick: i = Yt }) {
|
|
34686
34719
|
return n || r ? /* @__PURE__ */ C(Vo, {
|
|
34687
34720
|
className: G("Avatar rounded-full w-full h-full", t),
|
|
34688
34721
|
src: n,
|
|
34689
34722
|
fallbackSrc: r,
|
|
34690
34723
|
alt: e,
|
|
34691
34724
|
onClick: i
|
|
34692
|
-
}) : /* @__PURE__ */ C(
|
|
34725
|
+
}) : /* @__PURE__ */ C(Bk, {
|
|
34693
34726
|
className: `LetterAvatar ${t}`,
|
|
34694
34727
|
onClick: i,
|
|
34695
34728
|
letter: e
|
|
@@ -34697,10 +34730,10 @@ function Rk({ label: e = "N", className: t = "w-full h-full", imgSrc: n = "", fa
|
|
|
34697
34730
|
}
|
|
34698
34731
|
//#endregion
|
|
34699
34732
|
//#region src/avatar/AvatarTag.tsx
|
|
34700
|
-
function
|
|
34733
|
+
function Hk({ label: e = "N", onClick: t = Yt, className: n = "", imgSrc: r = "", fallbackImgSrc: i = "", avatarClassName: a = "w-8 h-8" }) {
|
|
34701
34734
|
return /* @__PURE__ */ w(Wo, {
|
|
34702
34735
|
className: G("AvatarTag bg-white rounded-lg py-1", n),
|
|
34703
|
-
children: [/* @__PURE__ */ C(
|
|
34736
|
+
children: [/* @__PURE__ */ C(Vk, {
|
|
34704
34737
|
className: a,
|
|
34705
34738
|
onClick: t,
|
|
34706
34739
|
label: e?.charAt(0).toUpperCase(),
|
|
@@ -34714,12 +34747,12 @@ function zk({ label: e = "N", onClick: t = Yt, className: n = "", imgSrc: r = ""
|
|
|
34714
34747
|
}
|
|
34715
34748
|
//#endregion
|
|
34716
34749
|
//#region src/avatar/AvatarTimeTag.tsx
|
|
34717
|
-
function
|
|
34750
|
+
function Uk({ label: e = "N", time: t, onClick: n = Yt, className: r = "", avatarClassName: i = "h-11 w-11", imgSrc: a = "", fallbackImgSrc: o }) {
|
|
34718
34751
|
return /* @__PURE__ */ w(Wo, {
|
|
34719
34752
|
className: G("AvatarTimeTag bg-white rounded-lg py-1", r),
|
|
34720
34753
|
children: [/* @__PURE__ */ C("div", {
|
|
34721
34754
|
className: G("rounded-full overflow-hidden", i),
|
|
34722
|
-
children: /* @__PURE__ */ C(
|
|
34755
|
+
children: /* @__PURE__ */ C(Vk, {
|
|
34723
34756
|
className: "w-full h-full",
|
|
34724
34757
|
onClick: n,
|
|
34725
34758
|
label: e?.charAt(0).toUpperCase(),
|
|
@@ -34741,7 +34774,7 @@ function Bk({ label: e = "N", time: t, onClick: n = Yt, className: r = "", avata
|
|
|
34741
34774
|
}
|
|
34742
34775
|
//#endregion
|
|
34743
34776
|
//#region src/images/mediaUpload/MediaUploadPreview.tsx
|
|
34744
|
-
function
|
|
34777
|
+
function Wk({ file: e, objectUrl: t, onRemove: n, className: r = "", imgClassName: i = "" }) {
|
|
34745
34778
|
return /* @__PURE__ */ w("div", {
|
|
34746
34779
|
className: G("relative flex-shrink-0", r),
|
|
34747
34780
|
children: [/* @__PURE__ */ C(Bo, {
|
|
@@ -34759,15 +34792,15 @@ function Vk({ file: e, objectUrl: t, onRemove: n, className: r = "", imgClassNam
|
|
|
34759
34792
|
}
|
|
34760
34793
|
//#endregion
|
|
34761
34794
|
//#region src/images/useFileInput.tsx
|
|
34762
|
-
var
|
|
34795
|
+
var Gk = "image/jpeg,image/png,image/webp,image/avif,image/bmp,image/svg+xml,image/tiff,image/heic,image/heif", Kk = [
|
|
34763
34796
|
"video/",
|
|
34764
34797
|
"image/gif",
|
|
34765
34798
|
"image/apng"
|
|
34766
34799
|
];
|
|
34767
|
-
function
|
|
34768
|
-
return !
|
|
34800
|
+
function qk(e) {
|
|
34801
|
+
return !Kk.some((t) => e.type === t || e.type.startsWith(t));
|
|
34769
34802
|
}
|
|
34770
|
-
function
|
|
34803
|
+
function Jk({ onChange: e, accept: t = Gk, multiple: n = !1 }) {
|
|
34771
34804
|
let r = b(null), i = b(e);
|
|
34772
34805
|
return i.current = e, {
|
|
34773
34806
|
inputElement: /* @__PURE__ */ C("input", {
|
|
@@ -34777,7 +34810,7 @@ function Gk({ onChange: e, accept: t = Hk, multiple: n = !1 }) {
|
|
|
34777
34810
|
multiple: n,
|
|
34778
34811
|
className: "hidden",
|
|
34779
34812
|
onChange: (e) => {
|
|
34780
|
-
let t = Array.from(e.target.files ?? []).filter(
|
|
34813
|
+
let t = Array.from(e.target.files ?? []).filter(qk);
|
|
34781
34814
|
e.target.value = "", t.length > 0 && i.current(t);
|
|
34782
34815
|
}
|
|
34783
34816
|
}),
|
|
@@ -34786,12 +34819,12 @@ function Gk({ onChange: e, accept: t = Hk, multiple: n = !1 }) {
|
|
|
34786
34819
|
}
|
|
34787
34820
|
//#endregion
|
|
34788
34821
|
//#region src/images/mediaUpload/MediaUpload.tsx
|
|
34789
|
-
function
|
|
34822
|
+
function Yk({ onChange: e, multiple: t = !0, maxFiles: n = 9, className: r = "", accept: i = Gk, loading: a = !1 }) {
|
|
34790
34823
|
let [o, s] = x([]), [c, l] = x("");
|
|
34791
34824
|
g(() => () => {
|
|
34792
34825
|
o.forEach((e) => URL.revokeObjectURL(e.objectUrl));
|
|
34793
34826
|
}, []);
|
|
34794
|
-
let { inputElement: u, trigger: d } =
|
|
34827
|
+
let { inputElement: u, trigger: d } = Jk({
|
|
34795
34828
|
onChange: (e) => f(e),
|
|
34796
34829
|
accept: i,
|
|
34797
34830
|
multiple: t
|
|
@@ -34818,7 +34851,7 @@ function Kk({ onChange: e, multiple: t = !0, maxFiles: n = 9, className: r = "",
|
|
|
34818
34851
|
children: [
|
|
34819
34852
|
/* @__PURE__ */ w(Wo, {
|
|
34820
34853
|
className: "gap-2 items-end overflow-x-auto",
|
|
34821
|
-
children: [o.map((e, t) => /* @__PURE__ */ C(
|
|
34854
|
+
children: [o.map((e, t) => /* @__PURE__ */ C(Wk, {
|
|
34822
34855
|
file: e.file,
|
|
34823
34856
|
objectUrl: e.objectUrl,
|
|
34824
34857
|
onRemove: () => p(t)
|
|
@@ -34839,7 +34872,7 @@ function Kk({ onChange: e, multiple: t = !0, maxFiles: n = 9, className: r = "",
|
|
|
34839
34872
|
}
|
|
34840
34873
|
//#endregion
|
|
34841
34874
|
//#region src/images/imageGrid/ImageGridBase.tsx
|
|
34842
|
-
var
|
|
34875
|
+
var Xk = 500, Zk = {
|
|
34843
34876
|
background: "transparent",
|
|
34844
34877
|
border: "none",
|
|
34845
34878
|
boxShadow: "none",
|
|
@@ -34847,13 +34880,13 @@ var qk = 500, Jk = {
|
|
|
34847
34880
|
width: "fit-content",
|
|
34848
34881
|
height: "fit-content"
|
|
34849
34882
|
};
|
|
34850
|
-
function
|
|
34883
|
+
function Qk({ onSelect: e, selectedSrc: t, srcs: n, onDelete: r, className: i = "", isMobile: a = !1, extraCell: o }) {
|
|
34851
34884
|
let [s, c] = x(null), l = b(null), u = b(!1), d = () => {
|
|
34852
34885
|
l.current &&= (clearTimeout(l.current), null);
|
|
34853
34886
|
}, f = (e) => {
|
|
34854
34887
|
u.current = !1, d(), l.current = setTimeout(() => {
|
|
34855
34888
|
u.current = !0, c(e);
|
|
34856
|
-
},
|
|
34889
|
+
}, Xk);
|
|
34857
34890
|
}, p = (t) => {
|
|
34858
34891
|
if (u.current) {
|
|
34859
34892
|
u.current = !1;
|
|
@@ -34863,13 +34896,13 @@ function Yk({ onSelect: e, selectedSrc: t, srcs: n, onDelete: r, className: i =
|
|
|
34863
34896
|
}, m = {
|
|
34864
34897
|
overlay: { backgroundColor: "rgba(0, 0, 0, 0.75)" },
|
|
34865
34898
|
content: a ? {
|
|
34866
|
-
...
|
|
34899
|
+
...Zk,
|
|
34867
34900
|
top: "0",
|
|
34868
34901
|
left: "0",
|
|
34869
34902
|
transform: "none",
|
|
34870
34903
|
width: "100vw"
|
|
34871
34904
|
} : {
|
|
34872
|
-
...
|
|
34905
|
+
...Zk,
|
|
34873
34906
|
top: "50%",
|
|
34874
34907
|
left: "50%",
|
|
34875
34908
|
transform: "translate(-50%, -50%)"
|
|
@@ -34965,37 +34998,37 @@ function Yk({ onSelect: e, selectedSrc: t, srcs: n, onDelete: r, className: i =
|
|
|
34965
34998
|
}
|
|
34966
34999
|
//#endregion
|
|
34967
35000
|
//#region src/images/imageGrid/ImageGrid.tsx
|
|
34968
|
-
function
|
|
34969
|
-
return /* @__PURE__ */ C(
|
|
35001
|
+
function $k(e) {
|
|
35002
|
+
return /* @__PURE__ */ C(Qk, { ...e });
|
|
34970
35003
|
}
|
|
34971
35004
|
//#endregion
|
|
34972
35005
|
//#region src/images/imageGrid/ImageGridUpload.tsx
|
|
34973
|
-
var
|
|
35006
|
+
var eA = (e) => e.map((e) => ({
|
|
34974
35007
|
file: e,
|
|
34975
35008
|
objectUrl: URL.createObjectURL(e)
|
|
34976
|
-
})),
|
|
34977
|
-
function
|
|
35009
|
+
})), tA = (e) => e.forEach((e) => URL.revokeObjectURL(e.objectUrl));
|
|
35010
|
+
function nA({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImages: i = 9, uploadLabel: a = "Upload", loading: o = !1, isUploaded: s = !1, ...c }) {
|
|
34978
35011
|
let [l, u] = x([]), [d, f] = x(!1), [p, m] = x(""), h = b(l);
|
|
34979
|
-
h.current = l, g(() => () =>
|
|
34980
|
-
let _ = () => i - c.srcs.length - h.current.length, { inputElement: v, trigger: y } =
|
|
35012
|
+
h.current = l, g(() => () => tA(h.current), []);
|
|
35013
|
+
let _ = () => i - c.srcs.length - h.current.length, { inputElement: v, trigger: y } = Jk({
|
|
34981
35014
|
onChange: (e) => {
|
|
34982
|
-
|
|
35015
|
+
tA(h.current);
|
|
34983
35016
|
let n = i - c.srcs.length, r = e.slice(0, n);
|
|
34984
|
-
m(e.length > n ? `You can only add ${i} images in total.` : ""), u(
|
|
35017
|
+
m(e.length > n ? `You can only add ${i} images in total.` : ""), u(eA(r)), t?.(r), f(!0);
|
|
34985
35018
|
},
|
|
34986
35019
|
multiple: !0
|
|
34987
|
-
}), { inputElement: T, trigger: E } =
|
|
35020
|
+
}), { inputElement: T, trigger: E } = Jk({
|
|
34988
35021
|
onChange: (e) => {
|
|
34989
35022
|
let n = _(), r = e.slice(0, n);
|
|
34990
|
-
m(e.length > n ? `You can only add ${i} images in total.` : ""), u((e) => [...e, ...
|
|
35023
|
+
m(e.length > n ? `You can only add ${i} images in total.` : ""), u((e) => [...e, ...eA(r)]), t?.(r), f(!0);
|
|
34991
35024
|
},
|
|
34992
35025
|
multiple: !0
|
|
34993
35026
|
}), D = (e) => {
|
|
34994
35027
|
u((t) => (URL.revokeObjectURL(t[e].objectUrl), t.filter((t, n) => n !== e))), m("");
|
|
34995
35028
|
}, O = () => {
|
|
34996
|
-
e(l.map((e) => e.file)),
|
|
35029
|
+
e(l.map((e) => e.file)), tA(l), u([]), m("");
|
|
34997
35030
|
}, k = () => {
|
|
34998
|
-
|
|
35031
|
+
tA(l), u([]), f(!1), m("");
|
|
34999
35032
|
};
|
|
35000
35033
|
g(() => {
|
|
35001
35034
|
s && k();
|
|
@@ -35014,7 +35047,7 @@ function $k({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImag
|
|
|
35014
35047
|
return /* @__PURE__ */ w(S, { children: [
|
|
35015
35048
|
v,
|
|
35016
35049
|
T,
|
|
35017
|
-
/* @__PURE__ */ C(
|
|
35050
|
+
/* @__PURE__ */ C(Qk, {
|
|
35018
35051
|
...c,
|
|
35019
35052
|
onDelete: r ? n : void 0,
|
|
35020
35053
|
extraCell: A
|
|
@@ -35030,7 +35063,7 @@ function $k({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImag
|
|
|
35030
35063
|
children: [
|
|
35031
35064
|
/* @__PURE__ */ C(Wo, {
|
|
35032
35065
|
className: "overflow-x-auto gap-2",
|
|
35033
|
-
children: l.map((e, t) => /* @__PURE__ */ C(
|
|
35066
|
+
children: l.map((e, t) => /* @__PURE__ */ C(Wk, {
|
|
35034
35067
|
file: e.file,
|
|
35035
35068
|
objectUrl: e.objectUrl,
|
|
35036
35069
|
onRemove: () => D(t),
|
|
@@ -35063,37 +35096,37 @@ function $k({ onUpload: e, onChange: t, onDelete: n, isEditable: r = !1, maxImag
|
|
|
35063
35096
|
}
|
|
35064
35097
|
//#endregion
|
|
35065
35098
|
//#region node_modules/tslib/tslib.es6.mjs
|
|
35066
|
-
var
|
|
35067
|
-
return
|
|
35099
|
+
var rA = function(e, t) {
|
|
35100
|
+
return rA = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
|
|
35068
35101
|
e.__proto__ = t;
|
|
35069
35102
|
} || function(e, t) {
|
|
35070
35103
|
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
35071
|
-
},
|
|
35104
|
+
}, rA(e, t);
|
|
35072
35105
|
};
|
|
35073
|
-
function
|
|
35106
|
+
function iA(e, t) {
|
|
35074
35107
|
if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
35075
|
-
|
|
35108
|
+
rA(e, t);
|
|
35076
35109
|
function n() {
|
|
35077
35110
|
this.constructor = e;
|
|
35078
35111
|
}
|
|
35079
35112
|
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
35080
35113
|
}
|
|
35081
|
-
var
|
|
35082
|
-
return
|
|
35114
|
+
var aA = function() {
|
|
35115
|
+
return aA = Object.assign || function(e) {
|
|
35083
35116
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
35084
35117
|
return e;
|
|
35085
|
-
},
|
|
35118
|
+
}, aA.apply(this, arguments);
|
|
35086
35119
|
};
|
|
35087
|
-
function
|
|
35088
|
-
return this instanceof
|
|
35120
|
+
function oA(e) {
|
|
35121
|
+
return this instanceof oA ? (this.v = e, this) : new oA(e);
|
|
35089
35122
|
}
|
|
35090
|
-
var
|
|
35091
|
-
return
|
|
35123
|
+
var sA = function(e) {
|
|
35124
|
+
return sA = Object.getOwnPropertyNames || function(e) {
|
|
35092
35125
|
var t = [];
|
|
35093
35126
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[t.length] = n);
|
|
35094
35127
|
return t;
|
|
35095
|
-
},
|
|
35096
|
-
},
|
|
35128
|
+
}, sA(e);
|
|
35129
|
+
}, cA = /* @__PURE__ */ t(((e, t) => {
|
|
35097
35130
|
var n = !1, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _;
|
|
35098
35131
|
function v() {
|
|
35099
35132
|
if (!n) {
|
|
@@ -35164,7 +35197,7 @@ var iA = function(e) {
|
|
|
35164
35197
|
}
|
|
35165
35198
|
};
|
|
35166
35199
|
t.exports = y;
|
|
35167
|
-
})),
|
|
35200
|
+
})), lA = /* @__PURE__ */ t(((e, t) => {
|
|
35168
35201
|
var n = !!(typeof window < "u" && window.document && window.document.createElement);
|
|
35169
35202
|
t.exports = {
|
|
35170
35203
|
canUseDOM: n,
|
|
@@ -35173,8 +35206,8 @@ var iA = function(e) {
|
|
|
35173
35206
|
canUseViewport: n && !!window.screen,
|
|
35174
35207
|
isInWorker: !n
|
|
35175
35208
|
};
|
|
35176
|
-
})),
|
|
35177
|
-
var n =
|
|
35209
|
+
})), uA = /* @__PURE__ */ t(((e, t) => {
|
|
35210
|
+
var n = lA(), r;
|
|
35178
35211
|
n.canUseDOM && (r = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== !0);
|
|
35179
35212
|
function i(e, t) {
|
|
35180
35213
|
if (!n.canUseDOM || t && !("addEventListener" in document)) return !1;
|
|
@@ -35186,8 +35219,8 @@ var iA = function(e) {
|
|
|
35186
35219
|
return !a && r && e === "wheel" && (a = document.implementation.hasFeature("Events.wheel", "3.0")), a;
|
|
35187
35220
|
}
|
|
35188
35221
|
t.exports = i;
|
|
35189
|
-
})),
|
|
35190
|
-
var n =
|
|
35222
|
+
})), dA = /* @__PURE__ */ t(((e, t) => {
|
|
35223
|
+
var n = cA(), r = uA(), i = 10, a = 40, o = 800;
|
|
35191
35224
|
function s(e) {
|
|
35192
35225
|
var t = 0, n = 0, r = 0, s = 0;
|
|
35193
35226
|
return "detail" in e && (n = e.detail), "wheelDelta" in e && (n = -e.wheelDelta / 120), "wheelDeltaY" in e && (n = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (t = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = n, n = 0), r = t * i, s = n * i, "deltaY" in e && (s = e.deltaY), "deltaX" in e && (r = e.deltaX), (r || s) && e.deltaMode && (e.deltaMode == 1 ? (r *= a, s *= a) : (r *= o, s *= o)), r && !t && (t = r < 1 ? -1 : 1), s && !n && (n = s < 1 ? -1 : 1), {
|
|
@@ -35200,12 +35233,12 @@ var iA = function(e) {
|
|
|
35200
35233
|
s.getEventType = function() {
|
|
35201
35234
|
return n.firefox() ? "DOMMouseScroll" : r("wheel") ? "wheel" : "mousewheel";
|
|
35202
35235
|
}, t.exports = s;
|
|
35203
|
-
})),
|
|
35204
|
-
t.exports =
|
|
35236
|
+
})), fA = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
35237
|
+
t.exports = dA();
|
|
35205
35238
|
})))(), 1);
|
|
35206
|
-
function
|
|
35239
|
+
function pA(e, t, n, r, i, a) {
|
|
35207
35240
|
a === void 0 && (a = 0);
|
|
35208
|
-
var o =
|
|
35241
|
+
var o = DA(e, t, a), s = o.width, c = o.height, l = Math.min(s, n), u = Math.min(c, r);
|
|
35209
35242
|
return l > u * i ? {
|
|
35210
35243
|
width: u * i,
|
|
35211
35244
|
height: u
|
|
@@ -35214,30 +35247,30 @@ function uA(e, t, n, r, i, a) {
|
|
|
35214
35247
|
height: l / i
|
|
35215
35248
|
};
|
|
35216
35249
|
}
|
|
35217
|
-
function
|
|
35250
|
+
function mA(e) {
|
|
35218
35251
|
return e.width > e.height ? e.width / e.naturalWidth : e.height / e.naturalHeight;
|
|
35219
35252
|
}
|
|
35220
|
-
function
|
|
35253
|
+
function hA(e, t, n, r, i) {
|
|
35221
35254
|
i === void 0 && (i = 0);
|
|
35222
|
-
var a =
|
|
35255
|
+
var a = DA(t.width, t.height, i), o = a.width, s = a.height;
|
|
35223
35256
|
return {
|
|
35224
|
-
x:
|
|
35225
|
-
y:
|
|
35257
|
+
x: gA(e.x, o, n.width, r),
|
|
35258
|
+
y: gA(e.y, s, n.height, r)
|
|
35226
35259
|
};
|
|
35227
35260
|
}
|
|
35228
|
-
function
|
|
35261
|
+
function gA(e, t, n, r) {
|
|
35229
35262
|
var i = Math.abs(t * r / 2 - n / 2);
|
|
35230
|
-
return
|
|
35263
|
+
return OA(e, -i, i);
|
|
35231
35264
|
}
|
|
35232
|
-
function
|
|
35265
|
+
function _A(e, t) {
|
|
35233
35266
|
return Math.sqrt((e.y - t.y) ** 2 + (e.x - t.x) ** 2);
|
|
35234
35267
|
}
|
|
35235
|
-
function
|
|
35268
|
+
function vA(e, t) {
|
|
35236
35269
|
return Math.atan2(t.y - e.y, t.x - e.x) * 180 / Math.PI;
|
|
35237
35270
|
}
|
|
35238
|
-
function
|
|
35271
|
+
function yA(e, t, n, r, i, a, o) {
|
|
35239
35272
|
a === void 0 && (a = 0), o === void 0 && (o = !0);
|
|
35240
|
-
var s = o ?
|
|
35273
|
+
var s = o ? bA : xA, c = DA(t.width, t.height, a), l = DA(t.naturalWidth, t.naturalHeight, a), u = {
|
|
35241
35274
|
x: s(100, ((c.width - n.width / i) / 2 - e.x / i) / c.width * 100),
|
|
35242
35275
|
y: s(100, ((c.height - n.height / i) / 2 - e.y / i) / c.height * 100),
|
|
35243
35276
|
width: s(100, n.width / c.width * 100 / i),
|
|
@@ -35251,20 +35284,20 @@ function gA(e, t, n, r, i, a, o) {
|
|
|
35251
35284
|
};
|
|
35252
35285
|
return {
|
|
35253
35286
|
croppedAreaPercentages: u,
|
|
35254
|
-
croppedAreaPixels:
|
|
35287
|
+
croppedAreaPixels: aA(aA({}, p), {
|
|
35255
35288
|
x: Math.round(s(l.width - p.width, u.x * l.width / 100)),
|
|
35256
35289
|
y: Math.round(s(l.height - p.height, u.y * l.height / 100))
|
|
35257
35290
|
})
|
|
35258
35291
|
};
|
|
35259
35292
|
}
|
|
35260
|
-
function
|
|
35293
|
+
function bA(e, t) {
|
|
35261
35294
|
return Math.min(e, Math.max(0, t));
|
|
35262
35295
|
}
|
|
35263
|
-
function
|
|
35296
|
+
function xA(e, t) {
|
|
35264
35297
|
return t;
|
|
35265
35298
|
}
|
|
35266
|
-
function
|
|
35267
|
-
var o =
|
|
35299
|
+
function SA(e, t, n, r, i, a) {
|
|
35300
|
+
var o = DA(t.width, t.height, n), s = OA(r.width / o.width * (100 / e.width), i, a);
|
|
35268
35301
|
return {
|
|
35269
35302
|
crop: {
|
|
35270
35303
|
x: s * o.width / 2 - r.width / 2 - o.width * s * (e.x / 100),
|
|
@@ -35273,13 +35306,13 @@ function yA(e, t, n, r, i, a) {
|
|
|
35273
35306
|
zoom: s
|
|
35274
35307
|
};
|
|
35275
35308
|
}
|
|
35276
|
-
function
|
|
35277
|
-
var r =
|
|
35309
|
+
function CA(e, t, n) {
|
|
35310
|
+
var r = mA(t);
|
|
35278
35311
|
return n.height > n.width ? n.height / (e.height * r) : n.width / (e.width * r);
|
|
35279
35312
|
}
|
|
35280
|
-
function
|
|
35313
|
+
function wA(e, t, n, r, i, a) {
|
|
35281
35314
|
n === void 0 && (n = 0);
|
|
35282
|
-
var o =
|
|
35315
|
+
var o = DA(t.naturalWidth, t.naturalHeight, n), s = OA(CA(e, t, r), i, a), c = r.height > r.width ? r.height / e.height : r.width / e.width;
|
|
35283
35316
|
return {
|
|
35284
35317
|
crop: {
|
|
35285
35318
|
x: ((o.width - e.width) / 2 - e.x) * c,
|
|
@@ -35288,32 +35321,32 @@ function xA(e, t, n, r, i, a) {
|
|
|
35288
35321
|
zoom: s
|
|
35289
35322
|
};
|
|
35290
35323
|
}
|
|
35291
|
-
function
|
|
35324
|
+
function TA(e, t) {
|
|
35292
35325
|
return {
|
|
35293
35326
|
x: (t.x + e.x) / 2,
|
|
35294
35327
|
y: (t.y + e.y) / 2
|
|
35295
35328
|
};
|
|
35296
35329
|
}
|
|
35297
|
-
function
|
|
35330
|
+
function EA(e) {
|
|
35298
35331
|
return e * Math.PI / 180;
|
|
35299
35332
|
}
|
|
35300
|
-
function
|
|
35301
|
-
var r =
|
|
35333
|
+
function DA(e, t, n) {
|
|
35334
|
+
var r = EA(n);
|
|
35302
35335
|
return {
|
|
35303
35336
|
width: Math.abs(Math.cos(r) * e) + Math.abs(Math.sin(r) * t),
|
|
35304
35337
|
height: Math.abs(Math.sin(r) * e) + Math.abs(Math.cos(r) * t)
|
|
35305
35338
|
};
|
|
35306
35339
|
}
|
|
35307
|
-
function
|
|
35340
|
+
function OA(e, t, n) {
|
|
35308
35341
|
return Math.min(Math.max(e, t), n);
|
|
35309
35342
|
}
|
|
35310
|
-
function
|
|
35343
|
+
function kA() {
|
|
35311
35344
|
return [...arguments].filter(function(e) {
|
|
35312
35345
|
return typeof e == "string" && e.length > 0;
|
|
35313
35346
|
}).join(" ").trim();
|
|
35314
35347
|
}
|
|
35315
|
-
var
|
|
35316
|
-
|
|
35348
|
+
var AA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n", jA = 1, MA = 3, NA = 1, PA = function(e) {
|
|
35349
|
+
iA(t, e);
|
|
35317
35350
|
function t() {
|
|
35318
35351
|
var r = e !== null && e.apply(this, arguments) || this;
|
|
35319
35352
|
return r.cropperRef = n.createRef(), r.imageRef = n.createRef(), r.videoRef = n.createRef(), r.containerPosition = {
|
|
@@ -35356,10 +35389,10 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35356
35389
|
e && (r.previousCropSize = e, r.emitCropData(), r.setInitialCrop(e), r.isInitialized = !0), r.props.onMediaLoaded && r.props.onMediaLoaded(r.mediaSize);
|
|
35357
35390
|
}, r.setInitialCrop = function(e) {
|
|
35358
35391
|
if (r.props.initialCroppedAreaPercentages) {
|
|
35359
|
-
var t =
|
|
35392
|
+
var t = SA(r.props.initialCroppedAreaPercentages, r.mediaSize, r.props.rotation, e, r.props.minZoom, r.props.maxZoom), n = t.crop, i = t.zoom;
|
|
35360
35393
|
r.props.onCropChange(n), r.props.onZoomChange && r.props.onZoomChange(i);
|
|
35361
35394
|
} else if (r.props.initialCroppedAreaPixels) {
|
|
35362
|
-
var a =
|
|
35395
|
+
var a = wA(r.props.initialCroppedAreaPixels, r.mediaSize, r.props.rotation, e, r.props.minZoom, r.props.maxZoom), n = a.crop, i = a.zoom;
|
|
35363
35396
|
r.props.onCropChange(n), r.props.onZoomChange && r.props.onZoomChange(i);
|
|
35364
35397
|
}
|
|
35365
35398
|
}, r.computeSizes = function() {
|
|
@@ -35395,11 +35428,11 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35395
35428
|
width: e.offsetWidth,
|
|
35396
35429
|
height: e.offsetHeight
|
|
35397
35430
|
};
|
|
35398
|
-
r.mediaSize =
|
|
35431
|
+
r.mediaSize = aA(aA({}, s), {
|
|
35399
35432
|
naturalWidth: n,
|
|
35400
35433
|
naturalHeight: i
|
|
35401
35434
|
}), r.props.setMediaSize && r.props.setMediaSize(r.mediaSize);
|
|
35402
|
-
var c = r.props.cropSize ? r.props.cropSize :
|
|
35435
|
+
var c = r.props.cropSize ? r.props.cropSize : pA(r.mediaSize.width, r.mediaSize.height, r.containerRect.width, r.containerRect.height, r.props.aspect, r.props.rotation);
|
|
35403
35436
|
return (r.state.cropSize?.height !== c.height || r.state.cropSize?.width !== c.width) && r.props.onCropSizeChange && r.props.onCropSizeChange(c), r.setState({ cropSize: c }, r.recomputeCropPosition), r.props.setCropSize && r.props.setCropSize(c), c;
|
|
35404
35437
|
}
|
|
35405
35438
|
}, r.saveContainerPosition = function() {
|
|
@@ -35437,7 +35470,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35437
35470
|
r.dragStartPosition = {
|
|
35438
35471
|
x: e.x,
|
|
35439
35472
|
y: e.y
|
|
35440
|
-
}, r.dragStartCrop =
|
|
35473
|
+
}, r.dragStartCrop = aA({}, r.props.crop), (t = r.props).onInteractionStart?.call(t);
|
|
35441
35474
|
}, r.onDrag = function(e) {
|
|
35442
35475
|
var t = e.x, n = e.y;
|
|
35443
35476
|
r.currentWindow && (r.rafDragTimeout && r.currentWindow.cancelAnimationFrame(r.rafDragTimeout), r.rafDragTimeout = r.currentWindow.requestAnimationFrame(function() {
|
|
@@ -35445,7 +35478,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35445
35478
|
var e = t - r.dragStartPosition.x, i = n - r.dragStartPosition.y, a = {
|
|
35446
35479
|
x: r.dragStartCrop.x + e,
|
|
35447
35480
|
y: r.dragStartCrop.y + i
|
|
35448
|
-
}, o = r.props.restrictPosition ?
|
|
35481
|
+
}, o = r.props.restrictPosition ? hA(a, r.mediaSize, r.state.cropSize, r.props.zoom, r.props.rotation) : a;
|
|
35449
35482
|
r.props.onCropChange(o);
|
|
35450
35483
|
}
|
|
35451
35484
|
}));
|
|
@@ -35455,7 +35488,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35455
35488
|
}, r.onWheel = function(e) {
|
|
35456
35489
|
if (r.currentWindow && !(r.props.onWheelRequest && !r.props.onWheelRequest(e))) {
|
|
35457
35490
|
e.preventDefault();
|
|
35458
|
-
var n = t.getMousePoint(e), i = (0,
|
|
35491
|
+
var n = t.getMousePoint(e), i = (0, fA.default)(e).pixelY, a = r.props.zoom - i * r.props.zoomSpeed / 200;
|
|
35459
35492
|
r.setNewZoom(a, n, { shouldUpdatePosition: !0 }), r.state.hasWheelJustStarted || r.setState({ hasWheelJustStarted: !0 }, function() {
|
|
35460
35493
|
var e;
|
|
35461
35494
|
return (e = r.props).onInteractionStart?.call(e);
|
|
@@ -35482,18 +35515,18 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35482
35515
|
}, r.setNewZoom = function(e, t, n) {
|
|
35483
35516
|
var i = (n === void 0 ? {} : n).shouldUpdatePosition, a = i === void 0 || i;
|
|
35484
35517
|
if (!(!r.state.cropSize || !r.props.onZoomChange)) {
|
|
35485
|
-
var o =
|
|
35518
|
+
var o = OA(e, r.props.minZoom, r.props.maxZoom);
|
|
35486
35519
|
if (a) {
|
|
35487
35520
|
var s = r.getPointOnContainer(t, r.containerPosition), c = r.getPointOnMedia(s), l = {
|
|
35488
35521
|
x: c.x * o - s.x,
|
|
35489
35522
|
y: c.y * o - s.y
|
|
35490
|
-
}, u = r.props.restrictPosition ?
|
|
35523
|
+
}, u = r.props.restrictPosition ? hA(l, r.mediaSize, r.state.cropSize, o, r.props.rotation) : l;
|
|
35491
35524
|
r.props.onCropChange(u);
|
|
35492
35525
|
}
|
|
35493
35526
|
r.props.onZoomChange(o);
|
|
35494
35527
|
}
|
|
35495
35528
|
}, r.getCropData = function() {
|
|
35496
|
-
return r.state.cropSize ?
|
|
35529
|
+
return r.state.cropSize ? yA(r.props.restrictPosition ? hA(r.props.crop, r.mediaSize, r.state.cropSize, r.props.zoom, r.props.rotation) : r.props.crop, r.mediaSize, r.state.cropSize, r.getAspect(), r.props.zoom, r.props.rotation, r.props.restrictPosition) : null;
|
|
35497
35530
|
}, r.emitCropData = function() {
|
|
35498
35531
|
var e = r.getCropData();
|
|
35499
35532
|
if (e) {
|
|
@@ -35516,14 +35549,14 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35516
35549
|
y: r.props.crop.y * n
|
|
35517
35550
|
};
|
|
35518
35551
|
}
|
|
35519
|
-
var i = r.props.restrictPosition ?
|
|
35552
|
+
var i = r.props.restrictPosition ? hA(e, r.mediaSize, r.state.cropSize, r.props.zoom, r.props.rotation) : e;
|
|
35520
35553
|
r.previousCropSize = r.state.cropSize, r.props.onCropChange(i), r.emitCropData();
|
|
35521
35554
|
}
|
|
35522
35555
|
}, r.onKeyDown = function(e) {
|
|
35523
35556
|
var t, n = r.props, i = n.crop, a = n.onCropChange, o = n.keyboardStep, s = n.zoom, c = n.rotation, l = o;
|
|
35524
35557
|
if (r.state.cropSize) {
|
|
35525
35558
|
e.shiftKey && (l *= .2);
|
|
35526
|
-
var u =
|
|
35559
|
+
var u = aA({}, i);
|
|
35527
35560
|
switch (e.key) {
|
|
35528
35561
|
case "ArrowUp":
|
|
35529
35562
|
u.y -= l, e.preventDefault();
|
|
@@ -35539,7 +35572,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35539
35572
|
break;
|
|
35540
35573
|
default: return;
|
|
35541
35574
|
}
|
|
35542
|
-
r.props.restrictPosition && (u =
|
|
35575
|
+
r.props.restrictPosition && (u = hA(u, r.mediaSize, r.state.cropSize, s, c)), e.repeat || (t = r.props).onInteractionStart?.call(t), a(u);
|
|
35543
35576
|
}
|
|
35544
35577
|
}, r.onKeyUp = function(e) {
|
|
35545
35578
|
var t;
|
|
@@ -35556,7 +35589,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35556
35589
|
}, r;
|
|
35557
35590
|
}
|
|
35558
35591
|
return t.prototype.componentDidMount = function() {
|
|
35559
|
-
!this.currentDoc || !this.currentWindow || (this.containerRef && (this.containerRef.ownerDocument && (this.currentDoc = this.containerRef.ownerDocument), this.currentDoc.defaultView && (this.currentWindow = this.currentDoc.defaultView), this.initResizeObserver(), window.ResizeObserver === void 0 && this.currentWindow.addEventListener("resize", this.computeSizes), this.props.zoomWithScroll && this.containerRef.addEventListener("wheel", this.onWheel, { passive: !1 }), this.containerRef.addEventListener("gesturestart", this.onGestureStart)), this.currentDoc.addEventListener("scroll", this.onScroll), this.props.disableAutomaticStylesInjection || (this.styleRef = this.currentDoc.createElement("style"), this.styleRef.setAttribute("type", "text/css"), this.props.nonce && this.styleRef.setAttribute("nonce", this.props.nonce), this.styleRef.innerHTML =
|
|
35592
|
+
!this.currentDoc || !this.currentWindow || (this.containerRef && (this.containerRef.ownerDocument && (this.currentDoc = this.containerRef.ownerDocument), this.currentDoc.defaultView && (this.currentWindow = this.currentDoc.defaultView), this.initResizeObserver(), window.ResizeObserver === void 0 && this.currentWindow.addEventListener("resize", this.computeSizes), this.props.zoomWithScroll && this.containerRef.addEventListener("wheel", this.onWheel, { passive: !1 }), this.containerRef.addEventListener("gesturestart", this.onGestureStart)), this.currentDoc.addEventListener("scroll", this.onScroll), this.props.disableAutomaticStylesInjection || (this.styleRef = this.currentDoc.createElement("style"), this.styleRef.setAttribute("type", "text/css"), this.props.nonce && this.styleRef.setAttribute("nonce", this.props.nonce), this.styleRef.innerHTML = AA, this.currentDoc.head.appendChild(this.styleRef)), this.imageRef.current && this.imageRef.current.complete && this.onMediaLoad(), this.props.setImageRef && this.props.setImageRef(this.imageRef), this.props.setVideoRef && this.props.setVideoRef(this.videoRef), this.props.setCropperRef && this.props.setCropperRef(this.cropperRef));
|
|
35560
35593
|
}, t.prototype.componentWillUnmount = function() {
|
|
35561
35594
|
!this.currentDoc || !this.currentWindow || (window.ResizeObserver === void 0 && this.currentWindow.removeEventListener("resize", this.computeSizes), this.resizeObserver?.disconnect(), this.containerRef && this.containerRef.removeEventListener("gesturestart", this.preventZoomSafari), this.styleRef && this.styleRef.parentNode?.removeChild(this.styleRef), this.cleanEvents(), this.props.zoomWithScroll && this.clearScrollEvent());
|
|
35562
35595
|
}, t.prototype.componentDidUpdate = function(e) {
|
|
@@ -35578,15 +35611,15 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35578
35611
|
return this.props.objectFit;
|
|
35579
35612
|
}, t.prototype.onPinchStart = function(e) {
|
|
35580
35613
|
var n = t.getTouchPoint(e.touches[0]), r = t.getTouchPoint(e.touches[1]);
|
|
35581
|
-
this.lastPinchDistance =
|
|
35614
|
+
this.lastPinchDistance = _A(n, r), this.lastPinchRotation = vA(n, r), this.onDragStart(TA(n, r));
|
|
35582
35615
|
}, t.prototype.onPinchMove = function(e) {
|
|
35583
35616
|
var n = this;
|
|
35584
35617
|
if (!(!this.currentDoc || !this.currentWindow)) {
|
|
35585
|
-
var r = t.getTouchPoint(e.touches[0]), i = t.getTouchPoint(e.touches[1]), a =
|
|
35618
|
+
var r = t.getTouchPoint(e.touches[0]), i = t.getTouchPoint(e.touches[1]), a = TA(r, i);
|
|
35586
35619
|
this.onDrag(a), this.rafPinchTimeout && this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout), this.rafPinchTimeout = this.currentWindow.requestAnimationFrame(function() {
|
|
35587
|
-
var e =
|
|
35620
|
+
var e = _A(r, i), t = n.props.zoom * (e / n.lastPinchDistance);
|
|
35588
35621
|
n.setNewZoom(t, a, { shouldUpdatePosition: !1 }), n.lastPinchDistance = e;
|
|
35589
|
-
var o =
|
|
35622
|
+
var o = vA(r, i), s = n.props.rotation + (o - n.lastPinchRotation);
|
|
35590
35623
|
n.props.onRotationChange && n.props.onRotationChange(s), n.lastPinchRotation = o;
|
|
35591
35624
|
});
|
|
35592
35625
|
}
|
|
@@ -35600,31 +35633,31 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35600
35633
|
},
|
|
35601
35634
|
"data-testid": "container",
|
|
35602
35635
|
style: _,
|
|
35603
|
-
className:
|
|
35604
|
-
}, r ? n.createElement("img",
|
|
35636
|
+
className: kA("reactEasyCrop_Container", x)
|
|
35637
|
+
}, r ? n.createElement("img", aA({
|
|
35605
35638
|
alt: "",
|
|
35606
|
-
className:
|
|
35639
|
+
className: kA("reactEasyCrop_Image", w === "contain" && "reactEasyCrop_Contain", w === "horizontal-cover" && "reactEasyCrop_Cover_Horizontal", w === "vertical-cover" && "reactEasyCrop_Cover_Vertical", C)
|
|
35607
35640
|
}, a, {
|
|
35608
35641
|
src: r,
|
|
35609
35642
|
ref: this.imageRef,
|
|
35610
|
-
style:
|
|
35643
|
+
style: aA(aA({}, y), { transform: s || `translate(${l}px, ${u}px) rotate(${d}deg) scale(${f})` }),
|
|
35611
35644
|
onLoad: this.onMediaLoad
|
|
35612
|
-
})) : i && n.createElement("video",
|
|
35645
|
+
})) : i && n.createElement("video", aA({
|
|
35613
35646
|
autoPlay: !0,
|
|
35614
35647
|
playsInline: !0,
|
|
35615
35648
|
loop: !0,
|
|
35616
35649
|
muted: !0,
|
|
35617
|
-
className:
|
|
35650
|
+
className: kA("reactEasyCrop_Video", w === "contain" && "reactEasyCrop_Contain", w === "horizontal-cover" && "reactEasyCrop_Cover_Horizontal", w === "vertical-cover" && "reactEasyCrop_Cover_Vertical", C)
|
|
35618
35651
|
}, a, {
|
|
35619
35652
|
ref: this.videoRef,
|
|
35620
35653
|
onLoadedMetadata: this.onMediaLoad,
|
|
35621
|
-
style:
|
|
35654
|
+
style: aA(aA({}, y), { transform: s || `translate(${l}px, ${u}px) rotate(${d}deg) scale(${f})` }),
|
|
35622
35655
|
controls: !1
|
|
35623
35656
|
}), (Array.isArray(i) ? i : [{ src: i }]).map(function(e) {
|
|
35624
|
-
return n.createElement("source",
|
|
35625
|
-
})), this.state.cropSize && n.createElement("div",
|
|
35657
|
+
return n.createElement("source", aA({ key: e.src }, e));
|
|
35658
|
+
})), this.state.cropSize && n.createElement("div", aA({
|
|
35626
35659
|
ref: this.cropperRef,
|
|
35627
|
-
style:
|
|
35660
|
+
style: aA(aA({}, v), {
|
|
35628
35661
|
width: h ? Math.round(this.state.cropSize.width) : this.state.cropSize.width,
|
|
35629
35662
|
height: h ? Math.round(this.state.cropSize.height) : this.state.cropSize.height
|
|
35630
35663
|
}),
|
|
@@ -35632,14 +35665,14 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35632
35665
|
onKeyDown: this.onKeyDown,
|
|
35633
35666
|
onKeyUp: this.onKeyUp,
|
|
35634
35667
|
"data-testid": "cropper",
|
|
35635
|
-
className:
|
|
35668
|
+
className: kA("reactEasyCrop_CropArea", p === "round" && "reactEasyCrop_CropAreaRound", m && "reactEasyCrop_CropAreaGrid", S)
|
|
35636
35669
|
}, o)));
|
|
35637
35670
|
}, t.defaultProps = {
|
|
35638
35671
|
zoom: 1,
|
|
35639
35672
|
rotation: 0,
|
|
35640
35673
|
aspect: 4 / 3,
|
|
35641
|
-
maxZoom:
|
|
35642
|
-
minZoom:
|
|
35674
|
+
maxZoom: MA,
|
|
35675
|
+
minZoom: jA,
|
|
35643
35676
|
cropShape: "rect",
|
|
35644
35677
|
objectFit: "contain",
|
|
35645
35678
|
showGrid: !0,
|
|
@@ -35650,7 +35683,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35650
35683
|
zoomSpeed: 1,
|
|
35651
35684
|
restrictPosition: !0,
|
|
35652
35685
|
zoomWithScroll: !0,
|
|
35653
|
-
keyboardStep:
|
|
35686
|
+
keyboardStep: NA
|
|
35654
35687
|
}, t.getMousePoint = function(e) {
|
|
35655
35688
|
return {
|
|
35656
35689
|
x: Number(e.clientX),
|
|
@@ -35665,7 +35698,7 @@ var DA = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left:
|
|
|
35665
35698
|
}(n.Component);
|
|
35666
35699
|
//#endregion
|
|
35667
35700
|
//#region src/images/imageCropper/ImageCropper.tsx
|
|
35668
|
-
function
|
|
35701
|
+
function FA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error: i, isLoading: a, isCompleted: o, className: s = "" }) {
|
|
35669
35702
|
let c = y(() => e && `${e}${e.includes("?") ? "&" : "?"}t=${Date.now()}`, [e]), [l, u] = x(!1), [d, f] = x(c), [p, h] = x({
|
|
35670
35703
|
x: 0,
|
|
35671
35704
|
y: 0
|
|
@@ -35673,7 +35706,7 @@ function MA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error:
|
|
|
35673
35706
|
g(() => {
|
|
35674
35707
|
o && u(!1);
|
|
35675
35708
|
}, [o]);
|
|
35676
|
-
let { inputElement: E, trigger: D } =
|
|
35709
|
+
let { inputElement: E, trigger: D } = Jk({ onChange: async (e) => {
|
|
35677
35710
|
let t = e[0];
|
|
35678
35711
|
if (!t) return;
|
|
35679
35712
|
let n = await r(t);
|
|
@@ -35723,7 +35756,7 @@ function MA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error:
|
|
|
35723
35756
|
children: [
|
|
35724
35757
|
d ? /* @__PURE__ */ C("div", {
|
|
35725
35758
|
className: "relative w-full h-64",
|
|
35726
|
-
children: /* @__PURE__ */ C(
|
|
35759
|
+
children: /* @__PURE__ */ C(PA, {
|
|
35727
35760
|
image: d,
|
|
35728
35761
|
crop: p,
|
|
35729
35762
|
zoom: _,
|
|
@@ -35769,4 +35802,4 @@ function MA({ imageUrl: e, fallbackImageUrl: t, onSubmit: n, onSelect: r, error:
|
|
|
35769
35802
|
})] });
|
|
35770
35803
|
}
|
|
35771
35804
|
//#endregion
|
|
35772
|
-
export { Wa as A, Ua as ATarget, Fo as AddButton, Yo as AlertWrapper, rC as ArenaTag, as as Autocomplete,
|
|
35805
|
+
export { Wa as A, Ua as ATarget, Fo as AddButton, Yo as AlertWrapper, rC as ArenaTag, as as Autocomplete, Vk as Avatar, Hk as AvatarTag, Uk as AvatarTimeTag, eC as BlockTag, LS as BuddyTag, fo as Button, wo as CacheButton, zS as CalendarTag, zk as Carousel, es as ChatAlert, ls as CheckboxGroup, hC as CityTag, Va as ClickableDiv, Lo as CloseAccountButton, Ra as CloseIcon, cC as CoachTag, iC as CollectionTag, Ho as Column, os as CommentEditor, KS as CommentTag, TC as CommentsSection, Uo as Container, Rs as Coordinates, Bs as CoordinatesUpdater, HS as CopyTag, Ws as Copyright, pC as CreatePostTag, BS as CreateTag, xC as DashedLine, wy as DateDisplay, Iv as DatePicker, Cy as DateRange, Sy as DateTimePicker, qo as Deletable, ss as DuelVersus, La as EditIcon, Ko as EditableBlock, $a as EmailInput, wk as ErrorBoundary, Sk as ErrorMessage, aC as EventTag, Us as ExpandableContainer, IS as ExploreTag, zo as Form, lC as GameTag, qS as GoBackTag, Ga as Heading, PS as HomeTag, FA as ImageCropper, $k as ImageGrid, nA as ImageGridUpload, dC as ImageTag, Bo as Img, Ek as LazyErrorBoundary, uC as LeaderboardTag, SC as LikeSection, Ya as List, oo as LoadingIcon, so as LoadingIndicator, _C as LocationPointTag, WS as LogoutTag, VS as MapTag, oC as MarketTag, Yk as MediaUpload, jS as MenuTooltip, ts as MessageAlert, JS as MessageTag, yC as MiddleDot, jo as Modal, Po as ModalButton, No as ModalItem, Lv as MonthPicker, Vs as MyGeolocationUpdater, is as NavArrows, NS as Navbar, _b as NavigationControlPosition, FS as NearbyTag, RS as NewsfeedTag, Tk as NotFound, $o as NotificationAlert, bC as OrDivider, hk as OrderLabels, _k as OrderPicker, gb as OsmMap, Ka as P, no as PasswordInput, io as PasswordSetup, mk as Picker, fC as PollTag, mC as PostTag, US as PrivateTag, ds as RadioGroup, Mo as RedStar, EC as RepliesSection, ZS as ReportTag, Ha as Row, Io as SaveCancelButtons, Jo as SearchBar, za as SendIcon, tC as SettingsTag, Rk as ShowMore, Vo as SmartImage, Ls as SocialMediaIcon, Ja as Span, Go as StaticColumn, Wo as StaticRow, gC as StreetTag, Do as StyledButton, Dk as SuccessMessage, ho as SvgButton, q as SvgSize, Qo as SvgTag, AS as SvgTooltip, ns as Tabs, Fk as Tag, Ik as Tags, nC as TeamTag, Lk as Text, Qa as TextInput, Ps as TextUpdater, qa as Textarea, Ns as TextareaAutosize, Is as TimeAgo, sg as TimePicker, kk as Toaster, So as ToggleButton, kS as Tooltip, GS as UpArrowTag, sC as UserTag, vC as VerticalLine };
|