@1urso/generic-editor 0.1.75 → 0.1.76
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/generic-editor.js +64 -70
- package/dist/generic-editor.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/generic-editor.js
CHANGED
|
@@ -21661,35 +21661,29 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21661
21661
|
})
|
|
21662
21662
|
]
|
|
21663
21663
|
})] }), EditorSettings = () => {
|
|
21664
|
-
let { state: n, updateListSettings:
|
|
21664
|
+
let { state: n, updateListSettings: E, setCanvasHeight: O, setGridSize: A } = useEditor(), [j, M] = useState(!1), [N, P] = useState(""), [z, B] = useState("asc"), [H, U] = useState("bottom"), [W, Z] = useState("down"), [Oz, kz] = useState("150"), [Az, jz] = useState(""), [Mz, Nz] = useState("0"), [Fz, Iz] = useState("slideIn"), [Lz, Rz] = useState(.3), [zz, Bz] = useState("ease-out"), Uz = React.useRef(!1);
|
|
21665
21665
|
return useEffect(() => {
|
|
21666
|
-
if (
|
|
21667
|
-
|
|
21666
|
+
if (j && !Uz.current) {
|
|
21667
|
+
Uz.current = !0, P(n.listSettings.sortProp || "__none__"), B(n.listSettings.sortOrder || "asc"), U(n.listSettings.newestPosition || "bottom"), Z(n.listSettings.scrollDirection || "down"), jz(n.listSettings.containerHeight ? String(n.listSettings.containerHeight) : ""), kz(String(n.canvasHeight || 150)), Nz(String(n.gridSize || 0));
|
|
21668
21668
|
let _ = n.listSettings.entryAnimation;
|
|
21669
|
-
|
|
21669
|
+
Iz(_?.type || "slideIn"), Rz(_?.duration || .3), Bz(_?.timingFunction || "ease-out");
|
|
21670
21670
|
}
|
|
21671
|
+
j || (Uz.current = !1);
|
|
21672
|
+
}, [j]), useEffect(() => {
|
|
21673
|
+
if (!j) return;
|
|
21674
|
+
let n = parseInt(Oz, 10);
|
|
21675
|
+
!isNaN(n) && n > 0 && O(n);
|
|
21676
|
+
let _ = parseInt(Mz, 10);
|
|
21677
|
+
!isNaN(_) && _ >= 0 && A(_);
|
|
21671
21678
|
}, [
|
|
21672
|
-
|
|
21673
|
-
|
|
21674
|
-
|
|
21675
|
-
n.gridSize
|
|
21676
|
-
]), useEffect(() => {
|
|
21677
|
-
if (!A) return;
|
|
21678
|
-
let _ = parseInt(Z, 10);
|
|
21679
|
-
!isNaN(_) && _ > 0 && n.canvasHeight !== _ && E(_);
|
|
21680
|
-
let j = parseInt(jz, 10);
|
|
21681
|
-
!isNaN(j) && j >= 0 && n.gridSize !== j && O(j);
|
|
21682
|
-
}, [
|
|
21683
|
-
Z,
|
|
21684
|
-
jz,
|
|
21685
|
-
A,
|
|
21686
|
-
E,
|
|
21679
|
+
Oz,
|
|
21680
|
+
Mz,
|
|
21681
|
+
j,
|
|
21687
21682
|
O,
|
|
21688
|
-
|
|
21689
|
-
n.gridSize
|
|
21683
|
+
A
|
|
21690
21684
|
]), /* @__PURE__ */ jsxs(s$5, {
|
|
21691
|
-
open:
|
|
21692
|
-
onOpenChange:
|
|
21685
|
+
open: j,
|
|
21686
|
+
onOpenChange: M,
|
|
21693
21687
|
children: [/* @__PURE__ */ jsx(n$3, { children: /* @__PURE__ */ jsxs(o, {
|
|
21694
21688
|
variant: "soft",
|
|
21695
21689
|
color: "gray",
|
|
@@ -21736,14 +21730,14 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21736
21730
|
width: "100%",
|
|
21737
21731
|
justifyContent: "space-between"
|
|
21738
21732
|
},
|
|
21739
|
-
children: [
|
|
21733
|
+
children: [N === "__none__" ? "(Nenhum)" : n.availableProps.find((n) => n.dataName === N)?.name || N, /* @__PURE__ */ jsx(ChevronDownIcon, {})]
|
|
21740
21734
|
}) }), /* @__PURE__ */ jsxs(g$2, {
|
|
21741
21735
|
style: { zIndex: 1e5 },
|
|
21742
21736
|
children: [/* @__PURE__ */ jsx(v$4, {
|
|
21743
|
-
onSelect: () =>
|
|
21737
|
+
onSelect: () => P("__none__"),
|
|
21744
21738
|
children: "(Nenhum)"
|
|
21745
21739
|
}), n.availableProps.map((n) => /* @__PURE__ */ jsx(v$4, {
|
|
21746
|
-
onSelect: () =>
|
|
21740
|
+
onSelect: () => P(n.dataName),
|
|
21747
21741
|
children: n.name
|
|
21748
21742
|
}, n.dataName))]
|
|
21749
21743
|
})] })]
|
|
@@ -21759,14 +21753,14 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21759
21753
|
width: 150,
|
|
21760
21754
|
justifyContent: "space-between"
|
|
21761
21755
|
},
|
|
21762
|
-
children: [
|
|
21756
|
+
children: [z === "asc" ? "Crescente (A-Z)" : "Decrescente (Z-A)", /* @__PURE__ */ jsx(ChevronDownIcon, {})]
|
|
21763
21757
|
}) }), /* @__PURE__ */ jsxs(g$2, {
|
|
21764
21758
|
style: { zIndex: 1e5 },
|
|
21765
21759
|
children: [/* @__PURE__ */ jsx(v$4, {
|
|
21766
|
-
onSelect: () =>
|
|
21760
|
+
onSelect: () => B("asc"),
|
|
21767
21761
|
children: "Crescente (A-Z)"
|
|
21768
21762
|
}), /* @__PURE__ */ jsx(v$4, {
|
|
21769
|
-
onSelect: () =>
|
|
21763
|
+
onSelect: () => B("desc"),
|
|
21770
21764
|
children: "Decrescente (Z-A)"
|
|
21771
21765
|
})]
|
|
21772
21766
|
})] })] })]
|
|
@@ -21788,14 +21782,14 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21788
21782
|
width: "100%",
|
|
21789
21783
|
justifyContent: "space-between"
|
|
21790
21784
|
},
|
|
21791
|
-
children: [
|
|
21785
|
+
children: [H === "top" ? "Topo (Início)" : "Base (Final)", /* @__PURE__ */ jsx(ChevronDownIcon, {})]
|
|
21792
21786
|
}) }), /* @__PURE__ */ jsxs(g$2, {
|
|
21793
21787
|
style: { zIndex: 1e5 },
|
|
21794
21788
|
children: [/* @__PURE__ */ jsx(v$4, {
|
|
21795
|
-
onSelect: () =>
|
|
21789
|
+
onSelect: () => U("top"),
|
|
21796
21790
|
children: "Topo (Início)"
|
|
21797
21791
|
}), /* @__PURE__ */ jsx(v$4, {
|
|
21798
|
-
onSelect: () =>
|
|
21792
|
+
onSelect: () => U("bottom"),
|
|
21799
21793
|
children: "Base (Final)"
|
|
21800
21794
|
})]
|
|
21801
21795
|
})] })]
|
|
@@ -21813,14 +21807,14 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21813
21807
|
width: "100%",
|
|
21814
21808
|
justifyContent: "space-between"
|
|
21815
21809
|
},
|
|
21816
|
-
children: [
|
|
21810
|
+
children: [W === "down" ? "Descer (Padrão)" : "Subir (Chat)", /* @__PURE__ */ jsx(ChevronDownIcon, {})]
|
|
21817
21811
|
}) }), /* @__PURE__ */ jsxs(g$2, {
|
|
21818
21812
|
style: { zIndex: 1e5 },
|
|
21819
21813
|
children: [/* @__PURE__ */ jsx(v$4, {
|
|
21820
|
-
onSelect: () =>
|
|
21814
|
+
onSelect: () => Z("down"),
|
|
21821
21815
|
children: "Descer (Padrão)"
|
|
21822
21816
|
}), /* @__PURE__ */ jsx(v$4, {
|
|
21823
|
-
onSelect: () =>
|
|
21817
|
+
onSelect: () => Z("up"),
|
|
21824
21818
|
children: "Subir (Chat)"
|
|
21825
21819
|
})]
|
|
21826
21820
|
})] })]
|
|
@@ -21847,8 +21841,8 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21847
21841
|
/* @__PURE__ */ jsx(u$1, {
|
|
21848
21842
|
type: "number",
|
|
21849
21843
|
min: "10",
|
|
21850
|
-
value:
|
|
21851
|
-
onChange: (n) =>
|
|
21844
|
+
value: Oz,
|
|
21845
|
+
onChange: (n) => kz(n.target.value)
|
|
21852
21846
|
}),
|
|
21853
21847
|
/* @__PURE__ */ jsx(p$2, {
|
|
21854
21848
|
size: "1",
|
|
@@ -21869,8 +21863,8 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21869
21863
|
type: "number",
|
|
21870
21864
|
min: "0",
|
|
21871
21865
|
placeholder: "Auto (100%)",
|
|
21872
|
-
value:
|
|
21873
|
-
onChange: (n) =>
|
|
21866
|
+
value: Az,
|
|
21867
|
+
onChange: (n) => jz(n.target.value)
|
|
21874
21868
|
}),
|
|
21875
21869
|
/* @__PURE__ */ jsx(p$2, {
|
|
21876
21870
|
size: "1",
|
|
@@ -21902,48 +21896,48 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21902
21896
|
width: "100%",
|
|
21903
21897
|
justifyContent: "space-between"
|
|
21904
21898
|
},
|
|
21905
|
-
children: [
|
|
21899
|
+
children: [Fz === "slideIn" ? "Slide (Padrão)" : Fz === "smoothSlideUp" ? "Slide Suave (Up)" : Fz === "fadeIn" ? "Fade In" : Fz === "popIn" ? "Pop In" : Fz === "blurIn" ? "Blur In" : Fz === "slideInLeft" ? "Slide (Esq)" : Fz === "slideInRight" ? "Slide (Dir)" : Fz === "zoomIn" ? "Zoom In" : Fz === "bounceIn" ? "Bounce" : "Nenhum", /* @__PURE__ */ jsx(ChevronDownIcon, {})]
|
|
21906
21900
|
}) }), /* @__PURE__ */ jsxs(g$2, {
|
|
21907
21901
|
style: { zIndex: 1e5 },
|
|
21908
21902
|
children: [
|
|
21909
21903
|
/* @__PURE__ */ jsx(v$4, {
|
|
21910
|
-
onSelect: () =>
|
|
21904
|
+
onSelect: () => Iz("none"),
|
|
21911
21905
|
children: "Nenhum"
|
|
21912
21906
|
}),
|
|
21913
21907
|
/* @__PURE__ */ jsx(v$4, {
|
|
21914
|
-
onSelect: () =>
|
|
21908
|
+
onSelect: () => Iz("slideIn"),
|
|
21915
21909
|
children: "Slide (Padrão)"
|
|
21916
21910
|
}),
|
|
21917
21911
|
/* @__PURE__ */ jsx(v$4, {
|
|
21918
|
-
onSelect: () =>
|
|
21912
|
+
onSelect: () => Iz("smoothSlideUp"),
|
|
21919
21913
|
children: "Slide Suave (Up)"
|
|
21920
21914
|
}),
|
|
21921
21915
|
/* @__PURE__ */ jsx(v$4, {
|
|
21922
|
-
onSelect: () =>
|
|
21916
|
+
onSelect: () => Iz("fadeIn"),
|
|
21923
21917
|
children: "Fade In"
|
|
21924
21918
|
}),
|
|
21925
21919
|
/* @__PURE__ */ jsx(v$4, {
|
|
21926
|
-
onSelect: () =>
|
|
21920
|
+
onSelect: () => Iz("popIn"),
|
|
21927
21921
|
children: "Pop In"
|
|
21928
21922
|
}),
|
|
21929
21923
|
/* @__PURE__ */ jsx(v$4, {
|
|
21930
|
-
onSelect: () =>
|
|
21924
|
+
onSelect: () => Iz("blurIn"),
|
|
21931
21925
|
children: "Blur In"
|
|
21932
21926
|
}),
|
|
21933
21927
|
/* @__PURE__ */ jsx(v$4, {
|
|
21934
|
-
onSelect: () =>
|
|
21928
|
+
onSelect: () => Iz("slideInLeft"),
|
|
21935
21929
|
children: "Slide (Esq)"
|
|
21936
21930
|
}),
|
|
21937
21931
|
/* @__PURE__ */ jsx(v$4, {
|
|
21938
|
-
onSelect: () =>
|
|
21932
|
+
onSelect: () => Iz("slideInRight"),
|
|
21939
21933
|
children: "Slide (Dir)"
|
|
21940
21934
|
}),
|
|
21941
21935
|
/* @__PURE__ */ jsx(v$4, {
|
|
21942
|
-
onSelect: () =>
|
|
21936
|
+
onSelect: () => Iz("zoomIn"),
|
|
21943
21937
|
children: "Zoom In"
|
|
21944
21938
|
}),
|
|
21945
21939
|
/* @__PURE__ */ jsx(v$4, {
|
|
21946
|
-
onSelect: () =>
|
|
21940
|
+
onSelect: () => Iz("bounceIn"),
|
|
21947
21941
|
children: "Bounce"
|
|
21948
21942
|
})
|
|
21949
21943
|
]
|
|
@@ -21957,8 +21951,8 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21957
21951
|
type: "number",
|
|
21958
21952
|
step: "0.1",
|
|
21959
21953
|
min: "0.1",
|
|
21960
|
-
value:
|
|
21961
|
-
onChange: (n) =>
|
|
21954
|
+
value: Lz,
|
|
21955
|
+
onChange: (n) => Rz(parseFloat(n.target.value) || .3)
|
|
21962
21956
|
})] }),
|
|
21963
21957
|
/* @__PURE__ */ jsxs(p, { children: [/* @__PURE__ */ jsx(p$2, {
|
|
21964
21958
|
size: "1",
|
|
@@ -21972,24 +21966,24 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
21972
21966
|
width: "100%",
|
|
21973
21967
|
justifyContent: "space-between"
|
|
21974
21968
|
},
|
|
21975
|
-
children: [
|
|
21969
|
+
children: [zz === "ease-out" ? "Ease Out" : zz === "linear" ? "Linear" : zz === "bounce" ? "Bounce" : "Ease", /* @__PURE__ */ jsx(ChevronDownIcon, {})]
|
|
21976
21970
|
}) }), /* @__PURE__ */ jsxs(g$2, {
|
|
21977
21971
|
style: { zIndex: 1e5 },
|
|
21978
21972
|
children: [
|
|
21979
21973
|
/* @__PURE__ */ jsx(v$4, {
|
|
21980
|
-
onSelect: () =>
|
|
21974
|
+
onSelect: () => Bz("ease"),
|
|
21981
21975
|
children: "Ease"
|
|
21982
21976
|
}),
|
|
21983
21977
|
/* @__PURE__ */ jsx(v$4, {
|
|
21984
|
-
onSelect: () =>
|
|
21978
|
+
onSelect: () => Bz("ease-out"),
|
|
21985
21979
|
children: "Ease Out"
|
|
21986
21980
|
}),
|
|
21987
21981
|
/* @__PURE__ */ jsx(v$4, {
|
|
21988
|
-
onSelect: () =>
|
|
21982
|
+
onSelect: () => Bz("linear"),
|
|
21989
21983
|
children: "Linear"
|
|
21990
21984
|
}),
|
|
21991
21985
|
/* @__PURE__ */ jsx(v$4, {
|
|
21992
|
-
onSelect: () =>
|
|
21986
|
+
onSelect: () => Bz("bounce"),
|
|
21993
21987
|
children: "Bounce"
|
|
21994
21988
|
})
|
|
21995
21989
|
]
|
|
@@ -22015,8 +22009,8 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
22015
22009
|
children: "Tamanho do Grid (px) - 0 para desativar"
|
|
22016
22010
|
}), /* @__PURE__ */ jsx(u$1, {
|
|
22017
22011
|
type: "number",
|
|
22018
|
-
value:
|
|
22019
|
-
onChange: (n) =>
|
|
22012
|
+
value: Mz,
|
|
22013
|
+
onChange: (n) => Nz(n.target.value),
|
|
22020
22014
|
placeholder: "0"
|
|
22021
22015
|
})]
|
|
22022
22016
|
})
|
|
@@ -22035,20 +22029,20 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$5, { children: [/* @__PURE_
|
|
|
22035
22029
|
children: "Cancelar"
|
|
22036
22030
|
}) }), /* @__PURE__ */ jsx(D$2, { children: /* @__PURE__ */ jsx(o, {
|
|
22037
22031
|
onClick: () => {
|
|
22038
|
-
let n = parseInt(
|
|
22039
|
-
type:
|
|
22040
|
-
duration: Number(
|
|
22032
|
+
let n = parseInt(Az, 10), _ = parseInt(Oz, 10), j = parseInt(Mz, 10), P = {
|
|
22033
|
+
type: Fz,
|
|
22034
|
+
duration: Number(Lz),
|
|
22041
22035
|
delay: 0,
|
|
22042
|
-
timingFunction:
|
|
22036
|
+
timingFunction: zz
|
|
22043
22037
|
};
|
|
22044
|
-
|
|
22045
|
-
sortProp:
|
|
22046
|
-
sortOrder:
|
|
22047
|
-
newestPosition:
|
|
22048
|
-
scrollDirection:
|
|
22038
|
+
E({
|
|
22039
|
+
sortProp: N === "__none__" ? "" : N,
|
|
22040
|
+
sortOrder: z,
|
|
22041
|
+
newestPosition: H,
|
|
22042
|
+
scrollDirection: W,
|
|
22049
22043
|
containerHeight: !isNaN(n) && n > 0 ? n : void 0,
|
|
22050
|
-
entryAnimation:
|
|
22051
|
-
}), !isNaN(
|
|
22044
|
+
entryAnimation: P
|
|
22045
|
+
}), !isNaN(_) && _ > 0 && O(_), !isNaN(j) && j >= 0 && A(j), M(!1);
|
|
22052
22046
|
},
|
|
22053
22047
|
children: "Salvar Alterações"
|
|
22054
22048
|
}) })]
|
|
@@ -54,7 +54,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${n.do
|
|
|
54
54
|
top: ${r}px !important;
|
|
55
55
|
}
|
|
56
56
|
`),()=>{m.contains(p)&&m.removeChild(p)}},[n]),(0,r.jsx)(LD,{isPresent:n,childRef:s,sizeRef:c,children:t.cloneElement(e,{ref:u})})}var zD=({children:e,initial:n,isPresent:i,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,root:u})=>{let d=VS(BD),f=(0,t.useId)(),p=!0,m=(0,t.useMemo)(()=>(p=!1,{id:f,initial:n,isPresent:i,custom:o,onExitComplete:e=>{d.set(e,!0);for(let e of d.values())if(!e)return;a&&a()},register:e=>(d.set(e,!1),()=>d.delete(e))}),[i,d,a]);return s&&p&&(m={...m}),(0,t.useMemo)(()=>{d.forEach((e,t)=>d.set(t,!1))},[i]),t.useEffect(()=>{!i&&!d.size&&a&&a()},[i]),c===`popLayout`&&(e=(0,r.jsx)(RD,{isPresent:i,anchorX:l,root:u,children:e})),(0,r.jsx)(WS.Provider,{value:m,children:e})};function BD(){return new Map}function VD(e=!0){let n=(0,t.useContext)(WS);if(n===null)return[!0,null];let{isPresent:r,onExitComplete:i,register:a}=n,o=(0,t.useId)();(0,t.useEffect)(()=>{if(e)return a(o)},[e]);let s=(0,t.useCallback)(()=>e&&i&&i(o),[o,i,e]);return!r&&i?[!1,s]:[!0]}var HD=e=>e.key||``;function UD(e){let n=[];return t.Children.forEach(e,e=>{(0,t.isValidElement)(e)&&n.push(e)}),n}var WD=({children:e,custom:n,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,root:u})=>{let[d,f]=VD(c),p=(0,t.useMemo)(()=>UD(e),[e]),m=c&&!d?[]:p.map(HD),h=(0,t.useRef)(!0),g=(0,t.useRef)(p),_=VS(()=>new Map),v=(0,t.useRef)(new Set),[y,b]=(0,t.useState)(p),[x,S]=(0,t.useState)(p);US(()=>{h.current=!1,g.current=p;for(let e=0;e<x.length;e++){let t=HD(x[e]);m.includes(t)?(_.delete(t),v.current.delete(t)):_.get(t)!==!0&&_.set(t,!1)}},[x,m.length,m.join(`-`)]);let C=[];if(p!==y){let e=[...p];for(let t=0;t<x.length;t++){let n=x[t],r=HD(n);m.includes(r)||(e.splice(t,0,n),C.push(n))}return s===`wait`&&C.length&&(e=C),S(UD(e)),b(p),null}process.env.NODE_ENV!==`production`&&s===`wait`&&x.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);let{forceRender:w}=(0,t.useContext)(BS);return(0,r.jsx)(r.Fragment,{children:x.map(e=>{let t=HD(e),y=c&&!d?!1:p===x||m.includes(t);return(0,r.jsx)(zD,{isPresent:y,initial:!h.current||i?void 0:!1,custom:n,presenceAffectsLayout:o,mode:s,root:u,onExitComplete:y?void 0:()=>{if(v.current.has(t))return;if(v.current.add(t),_.has(t))_.set(t,!0);else return;let e=!0;_.forEach(t=>{t||(e=!1)}),e&&(w?.(),S(g.current),c&&f?.(),a&&a())},anchorX:l,children:e},t)})})},GD=(0,t.createContext)({strict:!1}),KD={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},qD={};for(let e in KD)qD[e]={isEnabled:t=>KD[e].some(e=>!!t[e])};function JD(e){for(let t in e)qD[t]={...qD[t],...e[t]}}var YD=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function XD(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||YD.has(e)}function ZD(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var QD=d((()=>{})),$D=p({default:()=>tO}),eO,tO,nO=d((()=>{QD(),eO=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,tO=ZD(function(e){return eO.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),rO=e=>!XD(e);function iO(e){typeof e==`function`&&(rO=t=>t.startsWith(`on`)?!XD(t):e(t))}try{iO((nO(),g($D)).default)}catch{}function aO(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(rO(i)||n===!0&&XD(i)||!t&&!XD(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var oO=(0,t.createContext)({});function sO(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function cO(e){return typeof e==`string`||Array.isArray(e)}var lO=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],uO=[`initial`,...lO];function dO(e){return sO(e.animate)||uO.some(t=>cO(e[t]))}function fO(e){return!!(dO(e)||e.variants)}function pO(e,t){if(dO(e)){let{initial:t,animate:n}=e;return{initial:t===!1||cO(t)?t:void 0,animate:cO(n)?n:void 0}}return e.inherit===!1?{}:t}function mO(e){let{initial:n,animate:r}=pO(e,(0,t.useContext)(oO));return(0,t.useMemo)(()=>({initial:n,animate:r}),[hO(n),hO(r)])}function hO(e){return Array.isArray(e)?e.join(` `):e}function gO(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var _O={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(Q.test(e))e=parseFloat(e);else return e;return`${gO(e,t.target.x)}% ${gO(e,t.target.y)}%`}},vO={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Pw.parse(e);if(i.length>5)return r;let a=Pw.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Rw(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},yO={borderRadius:{..._O,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:_O,borderTopRightRadius:_O,borderBottomLeftRadius:_O,borderBottomRightRadius:_O,boxShadow:vO};function bO(e,{layout:t,layoutId:n}){return KT.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!yO[e]||e===`opacity`)}var xO={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},SO=GT.length;function CO(e,t,n){let r=``,i=!0;for(let a=0;a<SO;a++){let o=GT[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=rD(s,YE[o]);if(!c){i=!1;let t=xO[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function wO(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(KT.has(e)){o=!0;continue}else if(JC(e)){i[e]=n;continue}else{let t=rD(n,YE[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=CO(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var TO=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function EO(e,t,n){for(let r in t)!AD(t[r])&&!bO(r,n)&&(e[r]=t[r])}function DO({transformTemplate:e},n){return(0,t.useMemo)(()=>{let t=TO();return wO(t,n,e),Object.assign({},t.vars,t.style)},[n])}function OO(e,t){let n=e.style||{},r={};return EO(r,n,e),Object.assign(r,DO(e,t)),r}function kO(e,t){let n={},r=OO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var AO={offset:`stroke-dashoffset`,array:`stroke-dasharray`},jO={offset:`strokeDashoffset`,array:`strokeDasharray`};function MO(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?AO:jO;e[a.offset]=Q.transform(-r);let o=Q.transform(t),s=Q.transform(n);e[a.array]=`${o} ${s}`}var NO=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function PO(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(wO(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of NO)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&MO(d,i,a,o,!1)}var FO=()=>({...TO(),attrs:{}}),IO=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function LO(e,n,r,i){let a=(0,t.useMemo)(()=>{let t=FO();return PO(t,n,IO(i),e.transformTemplate,e.style),{...t.attrs,style:{...t.style}}},[n]);if(e.style){let t={};EO(t,e.style,e),a.style={...t,...a.style}}return a}var RO=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function zO(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(RO.indexOf(e)>-1||/[A-Z]/u.test(e))}function BO(e,n,r,{latestValues:i},a,o=!1,s){let c=(s??zO(e)?LO:kO)(n,i,a,e),l=aO(n,typeof e==`string`,o),u=e===t.Fragment?{}:{...l,...c,ref:r},{children:d}=n,f=(0,t.useMemo)(()=>AD(d)?d.get():d,[d]);return(0,t.createElement)(e,{...u,children:f})}function VO(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function HO(e,t,n,r){if(typeof t==`function`){let[i,a]=VO(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=VO(r);t=t(n===void 0?e.custom:n,i,a)}return t}function UO(e){return AD(e)?e.get():e}function WO({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:GO(n,r,i,e),renderState:t()}}function GO(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=UO(a[e]);let{initial:o,animate:s}=e,c=dO(e),l=fO(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!sO(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=HO(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var KO=e=>(n,r)=>{let i=(0,t.useContext)(oO),a=(0,t.useContext)(WS),o=()=>WO(e,n,i,a);return r?o():VS(o)};function qO(e,t,n){let{style:r}=e,i={};for(let a in r)(AD(r[a])||t.style&&AD(t.style[a])||bO(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}var JO=KO({scrapeMotionValuesFromProps:qO,createRenderState:TO});function YO(e,t,n){let r=qO(e,t,n);for(let n in e)if(AD(e[n])||AD(t[n])){let t=GT.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var XO=KO({scrapeMotionValuesFromProps:YO,createRenderState:FO}),ZO=Symbol.for(`motionComponentSymbol`);function QO(e,n,r){let i=(0,t.useRef)(r);(0,t.useInsertionEffect)(()=>{i.current=r});let a=(0,t.useRef)(null);return(0,t.useCallback)(t=>{t&&e.onMount?.(t),n&&(t?n.mount(t):n.unmount());let r=i.current;if(typeof r==`function`)if(t){let e=r(t);typeof e==`function`&&(a.current=e)}else a.current?(a.current(),a.current=null):r(t);else r&&(r.current=t)},[n])}var $O=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),ek=`data-`+$O(`framerAppearId`),tk=(0,t.createContext)({});function nk(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function rk(e,n,r,i,a,o){let{visualElement:s}=(0,t.useContext)(oO),c=(0,t.useContext)(GD),l=(0,t.useContext)(WS),u=(0,t.useContext)(ND).reducedMotion,d=(0,t.useRef)(null);i||=c.renderer,!d.current&&i&&(d.current=i(e,{visualState:n,parent:s,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:o}));let f=d.current,p=(0,t.useContext)(tk);f&&!f.projection&&a&&(f.type===`html`||f.type===`svg`)&&ik(d.current,r,a,p);let m=(0,t.useRef)(!1);(0,t.useInsertionEffect)(()=>{f&&m.current&&f.update(r,l)});let h=r[ek],g=(0,t.useRef)(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return US(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),g.current&&f.animationState&&f.animationState.animateChanges())}),(0,t.useEffect)(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),!1),f.enteringChildren=void 0)}),f}function ik(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:ak(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&nk(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function ak(e){if(e)return e.options.allowProjection===!1?ak(e.parent):e.projection}function ok(e,{forwardMotionProps:n=!1,type:i}={},a,o){a&&JD(a);let s=i?i===`svg`:zO(e),c=s?XO:JO;function l(i,l){let u,d={...(0,t.useContext)(ND),...i,layoutId:sk(i)},{isStatic:f}=d,p=mO(i),m=c(i,f);if(!f&&HS){ck(d,a);let t=lk(d);u=t.MeasureLayout,p.visualElement=rk(e,m,d,o,t.ProjectionNode,s)}return(0,r.jsxs)(oO.Provider,{value:p,children:[u&&p.visualElement?(0,r.jsx)(u,{visualElement:p.visualElement,...d}):null,BO(e,i,QO(m,p.visualElement,l),m,f,n,s)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=(0,t.forwardRef)(l);return u[ZO]=e,u}function sk({layoutId:e}){let n=(0,t.useContext)(BS).id;return n&&e!==void 0?n+`-`+e:e}function ck(e,n){let r=(0,t.useContext)(GD).strict;if(process.env.NODE_ENV!==`production`&&n&&r){let t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?YS(!1,t,`lazy-strict-mode`):XS(!1,t,`lazy-strict-mode`)}}function lk(e){let{drag:t,layout:n}=qD;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function uk(e,t){if(typeof Proxy>`u`)return ok;let n=new Map,r=(n,r)=>ok(n,r,e,t);return new Proxy((e,t)=>(process.env.NODE_ENV!==`production`&&dC(!1,`motion() is deprecated. Use motion.create() instead.`),r(e,t)),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,ok(a,void 0,e,t)),n.get(a))})}function dk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function fk({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function pk(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function mk(e){return e===void 0||e===1}function hk({scale:e,scaleX:t,scaleY:n}){return!mk(e)||!mk(t)||!mk(n)}function gk(e){return hk(e)||_k(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _k(e){return vk(e.x)||vk(e.y)}function vk(e){return e&&e!==`0%`}function yk(e,t,n){return n+t*(e-n)}function bk(e,t,n,r,i){return i!==void 0&&(e=yk(e,i,r)),yk(e,n,r)+t}function xk(e,t=0,n=1,r,i){e.min=bk(e.min,t,n,r,i),e.max=bk(e.max,t,n,r,i)}function Sk(e,{x:t,y:n}){xk(e.x,t.translate,t.scale,t.originPoint),xk(e.y,n.translate,n.scale,n.originPoint)}var Ck=.999999999999,wk=1.0000000000001;function Tk(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ok(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Sk(e,o)),r&&gk(a.latestValues)&&Ok(e,a.latestValues))}t.x<wk&&t.x>Ck&&(t.x=1),t.y<wk&&t.y>Ck&&(t.y=1)}function Ek(e,t){e.min+=t,e.max+=t}function Dk(e,t,n,r,i=.5){xk(e,t,n,Rw(e.min,e.max,i),r)}function Ok(e,t){Dk(e.x,t.x,t.scaleX,t.scale,t.originX),Dk(e.y,t.y,t.scaleY,t.scale,t.originY)}function kk(e,t){return dk(pk(e.getBoundingClientRect(),t))}function Ak(e,t,n){let r=kk(e,n),{scroll:i}=t;return i&&(Ek(r.x,i.offset.x),Ek(r.y,i.offset.y)),r}var jk=()=>({translate:0,scale:1,origin:0,originPoint:0}),Mk=()=>({x:jk(),y:jk()}),Nk=()=>({min:0,max:0}),Pk=()=>({x:Nk(),y:Nk()}),Fk={current:null},Ik={current:!1};function Lk(){if(Ik.current=!0,HS)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Fk.current=e.matches;e.addEventListener(`change`,t),t()}else Fk.current=!1}var Rk=new WeakMap;function zk(e,t,n){for(let r in t){let i=t[r],a=n[r];if(AD(i))e.addValue(r,i);else if(AD(a))e.addValue(r,lD(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,lD(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Bk=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Vk=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=aE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=GC.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,zC.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=dO(t),this.isVariantNode=fO(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&AD(t)&&t.set(s[e])}}mount(e){this.current=e,Rk.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Ik.current||Lk(),this.shouldReduceMotion=Fk.current),process.env.NODE_ENV!==`production`&&dC(this.shouldReduceMotion!==!0,`You have Reduced Motion enabled on your device. Animations may not appear as expected.`,`reduced-motion-disabled`),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),BC(this.notifyUpdate),BC(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=KT.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&zC.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in qD){let t=qD[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Pk()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Bk.length;t++){let n=Bk[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=zk(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=lD(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(QS(n)||eC(n))?n=parseFloat(n):!MD(n)&&Pw.test(t)&&(n=QE(e,t)),this.setBaseTarget(e,AD(n)?n.get():n)),AD(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=HO(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!AD(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new oC),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){uD.render(this.render)}},Hk=class extends Vk{constructor(){super(...arguments),this.KeyframeResolver=tD}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;AD(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Uk(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Wk(e){return window.getComputedStyle(e)}var Gk=class extends Hk{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Uk}readValueFromInstance(e,t){if(KT.has(t))return this.projection?.isProjecting?VT(t):UT(e,t);{let n=Wk(e),r=(JC(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return kk(e,t)}build(e,t,n){wO(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return qO(e,t,n)}},Kk=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function qk(e,t,n,r){for(let n in Uk(e,t,void 0,r),t.attrs)e.setAttribute(Kk.has(n)?n:$O(n),t.attrs[n])}var Jk=class extends Hk{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Pk}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(KT.has(t)){let e=ZE(t);return e&&e.default||0}return t=Kk.has(t)?t:$O(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return YO(e,t,n)}build(e,t,n){PO(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){qk(e,t,n,r)}mount(e){this.isSVGTag=IO(e.tagName),super.mount(e)}},Yk=(e,n)=>n.isSVG??zO(e)?new Jk(n):new Gk(n,{allowProjection:e!==t.Fragment});function Xk(e,t,n){let r=e.getProps();return HO(r,t,n===void 0?r.custom:n,e)}var Zk=e=>Array.isArray(e);function Qk(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,lD(n))}function $k(e){return Zk(e)?e[e.length-1]||0:e}function eA(e,t){let{transitionEnd:n={},transition:r={},...i}=Xk(e,t)||{};for(let t in i={...i,...n},i)Qk(e,t,$k(i[t]))}function tA(e){return!!(AD(e)&&e.add)}function nA(e,t){let n=e.getValue(`willChange`);if(tA(n))return n.add(t);if(!n&&ZS.WillChange){let n=new ZS.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function rA(e){return e.props[ek]}var iA=e=>e!==null;function aA(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(iA),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}var oA={type:`spring`,stiffness:500,damping:25,restSpeed:10},sA=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),cA={type:`keyframes`,duration:.8},lA={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},uA=(e,{keyframes:t})=>t.length>2?cA:KT.has(e)?e.startsWith(`scale`)?sA(t[1]):oA:lA;function dA({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var fA=(e,t,n,r={},i,a)=>o=>{let s=LE(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=sC(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};dA(s)||Object.assign(u,uA(e,u)),u.duration&&=sC(u.duration),u.repeatDelay&&=sC(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(DE(u),u.delay===0&&(d=!0)),(ZS.instantAnimations||ZS.skipAnimations)&&(d=!0,DE(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=aA(u.keyframes,s);if(e!==void 0){zC.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new jT(u):new ME(u)};function pA({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function mA(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&pA(l,t))continue;let o={delay:n,...LE(a||{},t)},u=r.get();if(u!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let n=rA(e);if(n){let e=window.MotionHandoffAnimation(n,t,zC);e!==null&&(o.startTime=e,d=!0)}}nA(e,t),r.start(fA(t,r,i,e.shouldReduceMotion&&RE.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{zC.update(()=>{o&&eA(e,o)})}),c}function hA(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function gA(e,t,n={}){let r=Xk(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(mA(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return _A(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function _A(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(gA(c,t,{...o,delay:n+(typeof r==`function`?0:r)+hA(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function vA(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>gA(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=gA(e,t,n);else{let i=typeof t==`function`?Xk(e,t,n.custom):t;r=Promise.all(mA(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}function yA(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var bA=uO.length;function xA(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&xA(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<bA;n++){let r=uO[n],i=e.props[r];(cO(i)||i===!1)&&(t[r]=i)}return t}var SA=[...lO].reverse(),CA=lO.length;function wA(e){return t=>Promise.all(t.map(({animation:t,options:n})=>vA(e,t,n)))}function TA(e){let t=wA(e),n=OA(),r=!0,i=t=>(n,r)=>{let i=Xk(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=xA(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<CA;t++){let f=SA[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=cO(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||sO(m)||typeof m==`boolean`)continue;let v=EA(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},T=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Zk(t)&&Zk(n)?!yA(t,n):t!==n,r?t==null?l.add(e):T(e):t!==void 0&&l.has(e)?T(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let E=_&&v;y&&(!E||b)&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Xk(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=hA(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=Xk(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=OA()}}}function EA(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!yA(t,e):!1}function DA(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function OA(){return{animate:DA(!0),whileInView:DA(),whileHover:DA(),whileTap:DA(),whileDrag:DA(),whileFocus:DA(),exit:DA()}}var kA=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},AA=class extends kA{constructor(e){super(e),e.animationState||=TA(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();sO(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},jA=0,MA={animation:{Feature:AA},exit:{Feature:class extends kA{constructor(){super(...arguments),this.id=jA++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function NA(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function PA(e){return{point:{x:e.pageX,y:e.pageY}}}var FA=e=>t=>yD(t)&&e(t,PA(t));function IA(e,t,n,r){return NA(e,t,FA(n),r)}var LA=1e-4,RA=1-LA,zA=1+LA,BA=.01,VA=0-BA,HA=0+BA;function UA(e){return e.max-e.min}function WA(e,t,n){return Math.abs(e-t)<=n}function GA(e,t,n,r=.5){e.origin=r,e.originPoint=Rw(t.min,t.max,e.origin),e.scale=UA(n)/UA(t),e.translate=Rw(n.min,n.max,e.origin)-e.originPoint,(e.scale>=RA&&e.scale<=zA||isNaN(e.scale))&&(e.scale=1),(e.translate>=VA&&e.translate<=HA||isNaN(e.translate))&&(e.translate=0)}function KA(e,t,n,r){GA(e.x,t.x,n.x,r?r.originX:void 0),GA(e.y,t.y,n.y,r?r.originY:void 0)}function qA(e,t,n){e.min=n.min+t.min,e.max=e.min+UA(t)}function JA(e,t,n){qA(e.x,t.x,n.x),qA(e.y,t.y,n.y)}function YA(e,t,n){e.min=t.min-n.min,e.max=e.min+UA(t)}function XA(e,t,n){YA(e.x,t.x,n.x),YA(e.y,t.y,n.y)}function ZA(e){return[e(`x`),e(`y`)]}var QA=({current:e})=>e?e.ownerDocument.defaultView:null,$A=(e,t)=>Math.abs(e-t);function ej(e,t){let n=$A(e.x,t.x),r=$A(e.y,t.y);return Math.sqrt(n**2+r**2)}var tj=new Set([`auto`,`scroll`]),nj=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=aj(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=ej(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=VC;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=rj(t,this.transformPagePoint),zC.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=aj(e.type===`pointercancel`?this.lastMoveEventInfo:rj(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!yD(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=rj(PA(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=VC;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,aj(s,this.history)),this.removeListeners=iC(IA(this.contextWindow,`pointermove`,this.handlePointerMove),IA(this.contextWindow,`pointerup`,this.handlePointerUp),IA(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(tj.has(e.overflowX)||tj.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener(`scroll`,this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),zC.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),BC(this.updatePoint)}};function rj(e,t){return t?{point:t(e.point)}:e}function ij(e,t){return{x:e.x-t.x,y:e.y-t.y}}function aj({point:e},t){return{point:e,delta:ij(e,sj(t)),offset:ij(e,oj(t)),velocity:cj(t,.1)}}function oj(e){return e[0]}function sj(e){return e[e.length-1]}function cj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=sj(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>sC(t)));)n--;if(!r)return{x:0,y:0};let a=cC(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function lj(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Rw(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Rw(n,e,r.max):Math.min(e,n)),e}function uj(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function dj(e,{top:t,left:n,bottom:r,right:i}){return{x:uj(e.x,n,i),y:uj(e.y,t,r)}}function fj(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function pj(e,t){return{x:fj(e.x,t.x),y:fj(e.y,t.y)}}function mj(e,t){let n=.5,r=UA(e),i=UA(t);return i>r?n=aC(t.min,t.max-r,e.min):r>i&&(n=aC(e.min,e.max-i,t.min)),qS(0,1,n)}function hj(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var gj=.35;function _j(e=gj){return e===!1?e=0:e===!0&&(e=gj),{x:vj(e,`left`,`right`),y:vj(e,`top`,`bottom`)}}function vj(e,t,n){return{min:yj(e,t),max:yj(e,n)}}function yj(e,t){return typeof e==`number`?e:e[t]||0}var bj=new WeakMap,xj=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Pk(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t?(this.stopAnimation(),this.snapToCursor(PA(e).point)):this.pauseAnimation()},a=(e,t)=>{this.stopAnimation();let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mD(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ZA(e=>{let t=this.getAxisMotionValue(e).get()||0;if(hw.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=UA(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&zC.postRender(()=>i(e,t)),nA(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Cj(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>ZA(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new nj(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:QA(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&zC.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Sj(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=lj(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&nk(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=dj(n.layoutBox,e):this.constraints=!1,this.elastic=_j(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&ZA(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=hj(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!nk(e))return!1;let n=e.current;XS(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Ak(n,r.root,this.visualElement.getTransformPagePoint()),a=pj(r.layout.layoutBox,i);if(t){let e=t(fk(a));this.hasMutatedConstraints=!!e,e&&(a=dk(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=ZA(o=>{if(!Sj(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return nA(this.visualElement,e),n.start(fA(e,n,0,t,this.visualElement,!1))}stopAnimation(){ZA(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){ZA(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){ZA(t=>{let{drag:n}=this.getProps();if(!Sj(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Rw(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!nk(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};ZA(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=mj({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ZA(t=>{if(!Sj(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Rw(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;bj.set(this.visualElement,this);let e=this.visualElement.current,t=IA(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&!xD(e.target)&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();nk(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),zC.read(n);let a=NA(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ZA(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=gj,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Sj(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Cj(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var wj=class extends kA{constructor(e){super(e),this.removeGroupControls=nC,this.removeListeners=nC,this.controls=new xj(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||nC}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}},Tj=e=>(t,n)=>{e&&zC.postRender(()=>e(t,n))},Ej=class extends kA{constructor(){super(...arguments),this.removePointerDownListener=nC}onPointerDown(e){this.session=new nj(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:QA(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Tj(e),onStart:Tj(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&zC.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=IA(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Dj={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Oj=!1,kj=class extends t.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Oj&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Dj.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,Oj=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||zC.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),uD.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Oj=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Aj(e){let[n,i]=VD(),a=(0,t.useContext)(BS);return(0,r.jsx)(kj,{...e,layoutGroup:a,switchLayoutGroup:(0,t.useContext)(tk),isPresent:n,safeToRemove:i})}function jj(e,t,n){let r=AD(e)?e:lD(e);return r.start(fA(``,r,t,n)),r.animation}var Mj=(e,t)=>e.depth-t.depth,Nj=class{constructor(){this.children=[],this.isDirty=!1}add(e){GS(this.children,e),this.isDirty=!0}remove(e){KS(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Mj),this.isDirty=!1,this.children.forEach(e)}};function Pj(e,t){let n=GC.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(BC(r),e(a-t))};return zC.setup(r,!0),()=>BC(r)}var Fj=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],Ij=Fj.length,Lj=e=>typeof e==`string`?parseFloat(e):e,Rj=e=>typeof e==`number`||Q.test(e);function zj(e,t,n,r,i,a){i?(e.opacity=Rw(0,n.opacity??1,Vj(r)),e.opacityExit=Rw(t.opacity??1,0,Hj(r))):a&&(e.opacity=Rw(t.opacity??1,n.opacity??1,r));for(let i=0;i<Ij;i++){let a=`border${Fj[i]}Radius`,o=Bj(t,a),s=Bj(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||Rj(o)===Rj(s)?(e[a]=Math.max(Rw(Lj(o),Lj(s),r),0),(hw.test(s)||hw.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Rw(t.rotate||0,n.rotate||0,r))}function Bj(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Vj=Uj(0,.5,wC),Hj=Uj(.5,.95,nC);function Uj(e,t,n){return r=>r<e?0:r>t?1:n(aC(e,t,r))}function Wj(e,t){e.min=t.min,e.max=t.max}function Gj(e,t){Wj(e.x,t.x),Wj(e.y,t.y)}function Kj(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function qj(e,t,n,r,i){return e-=t,e=yk(e,1/n,r),i!==void 0&&(e=yk(e,1/i,r)),e}function Jj(e,t=0,n=1,r=.5,i,a=e,o=e){if(hw.test(t)&&(t=parseFloat(t),t=Rw(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Rw(a.min,a.max,r);e===a&&(s-=t),e.min=qj(e.min,t,n,s,i),e.max=qj(e.max,t,n,s,i)}function Yj(e,t,[n,r,i],a,o){Jj(e,t[n],t[r],t[i],t.scale,a,o)}var Xj=[`x`,`scaleX`,`originX`],Zj=[`y`,`scaleY`,`originY`];function Qj(e,t,n,r){Yj(e.x,t,Xj,n?n.x:void 0,r?r.x:void 0),Yj(e.y,t,Zj,n?n.y:void 0,r?r.y:void 0)}function $j(e){return e.translate===0&&e.scale===1}function eM(e){return $j(e.x)&&$j(e.y)}function tM(e,t){return e.min===t.min&&e.max===t.max}function nM(e,t){return tM(e.x,t.x)&&tM(e.y,t.y)}function rM(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function iM(e,t){return rM(e.x,t.x)&&rM(e.y,t.y)}function aM(e){return UA(e.x)/UA(e.y)}function oM(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var sM=class{constructor(){this.members=[]}add(e){GS(this.members,e),e.scheduleRender()}remove(e){if(KS(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function cM(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var lM={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},uM=[``,`X`,`Y`,`Z`],dM=1e3,fM=0;function pM(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function mM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=rA(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,zC,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&mM(r)}function hM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=fM++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,FC.value&&(lM.nodes=lM.calculatedTargetDeltas=lM.calculatedProjections=0),this.nodes.forEach(vM),this.nodes.forEach(TM),this.nodes.forEach(EM),this.nodes.forEach(yM),FC.addProjectionMetrics&&FC.addProjectionMetrics(lM)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Nj)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new oC),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=OD(t)&&!kD(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;zC.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Pj(i,250),Dj.hasAnimatedSinceResize&&(Dj.hasAnimatedSinceResize=!1,this.nodes.forEach(wM)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||NM,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!iM(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...LE(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||wM(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),BC(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(DM),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&mM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xM);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(SM);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(CM),this.nodes.forEach(gM),this.nodes.forEach(_M)):this.nodes.forEach(SM),this.clearAllSnapshots();let e=GC.now();VC.delta=qS(0,1e3/60,e-VC.timestamp),VC.timestamp=e,VC.isProcessing=!0,HC.update.process(VC),HC.preRender.process(VC),HC.render.process(VC),VC.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uD.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(bM),this.sharedNodes.forEach(OM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,zC.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){zC.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!UA(this.snapshot.measuredBox.x)&&!UA(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Pk(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!eM(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||gk(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),LM(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Pk();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zM))){let{scroll:e}=this.root;e&&(Ek(t.x,e.offset.x),Ek(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Pk();if(Gj(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Gj(t,e),Ek(t.x,i.offset.x),Ek(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=Pk();Gj(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ok(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),gk(r.latestValues)&&Ok(n,r.latestValues)}return gk(this.latestValues)&&Ok(n,this.latestValues),n}removeTransform(e){let t=Pk();Gj(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!gk(n.latestValues))continue;hk(n.latestValues)&&n.updateSnapshot();let r=Pk();Gj(r,n.measurePageBox()),Qj(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return gk(this.latestValues)&&Qj(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==VC.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=VC.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Pk(),this.targetWithTransforms=Pk()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),JA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gj(this.target,this.layout.layoutBox),Sk(this.target,this.targetDelta)):Gj(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),FC.value&&lM.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||hk(this.parent.latestValues)||_k(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pk(),this.relativeTargetOrigin=Pk(),XA(this.relativeTargetOrigin,t,n),Gj(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===VC.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Gj(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Tk(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Pk());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Kj(this.prevProjectionDelta.x,this.projectionDelta.x),Kj(this.prevProjectionDelta.y,this.projectionDelta.y)),KA(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!oM(this.projectionDelta.x,this.prevProjectionDelta.x)||!oM(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),FC.value&&lM.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Mk(),this.projectionDelta=Mk(),this.projectionDeltaWithTransform=Mk()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Mk();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=Pk(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(MM));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;kM(a.x,e.x,n),kM(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(XA(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jM(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&nM(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=Pk(),Gj(d,this.relativeTarget)),s&&(this.animationValues=i,zj(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(BC(this.pendingAnimation),void 0),this.pendingAnimation=zC.update(()=>{Dj.hasAnimatedSinceResize=!0,KC.layout++,this.motionValue||=lD(0),this.currentAnimation=jj(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{KC.layout--},onComplete:()=>{KC.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(dM),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&RM(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Pk();let t=UA(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=UA(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Gj(t,n),Ok(t,i),KA(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new sM),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&pM(`z`,e,r,this.animationValues);for(let t=0;t<uM.length;t++)pM(`rotate${uM[t]}`,e,r,this.animationValues),pM(`skew${uM[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=UO(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=UO(t?.pointerEvents)||``),this.hasProjected&&!gk(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=cM(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,yO){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=yO[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?UO(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(xM),this.root.sharedNodes.clear()}}}function gM(e){e.updateLayout()}function _M(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?ZA(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=UA(r);r.min=n[e].min,r.max=r.min+i}):RM(i,t.layoutBox,n)&&ZA(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=UA(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Mk();KA(o,n,t.layoutBox);let s=Mk();a?KA(s,e.applyTransform(r,!0),t.measuredBox):KA(s,n,t.layoutBox);let c=!eM(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=Pk();XA(o,t.layoutBox,i.layoutBox);let s=Pk();XA(s,n,a.layoutBox),iM(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function vM(e){FC.value&&lM.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function yM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function bM(e){e.clearSnapshot()}function xM(e){e.clearMeasurements()}function SM(e){e.isLayoutDirty=!1}function CM(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function wM(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function TM(e){e.resolveTargetDelta()}function EM(e){e.calcProjection()}function DM(e){e.resetSkewAndRotation()}function OM(e){e.removeLeadSnapshot()}function kM(e,t,n){e.translate=Rw(t.translate,0,n),e.scale=Rw(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function AM(e,t,n,r){e.min=Rw(t.min,n.min,r),e.max=Rw(t.max,n.max,r)}function jM(e,t,n,r){AM(e.x,t.x,n.x,r),AM(e.y,t.y,n.y,r)}function MM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var NM={duration:.45,ease:[.4,0,.1,1]},PM=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),FM=PM(`applewebkit/`)&&!PM(`chrome/`)?Math.round:nC;function IM(e){e.min=FM(e.min),e.max=FM(e.max)}function LM(e){IM(e.x),IM(e.y)}function RM(e,t,n){return e===`position`||e===`preserve-aspect`&&!WA(aM(t),aM(n),.2)}function zM(e){return e!==e.root&&e.scroll?.wasRoot}var BM=hM({attachResizeListener:(e,t)=>NA(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),VM={current:void 0},HM=hM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!VM.current){let e=new BM({});e.mount(window),e.setOptions({layoutScroll:!0}),VM.current=e}return VM.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),UM={pan:{Feature:Ej},drag:{Feature:wj,ProjectionNode:HM,MeasureLayout:Aj}};function WM(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&zC.postRender(()=>i(t,PA(t)))}var GM=class extends kA{mount(){let{current:e}=this.node;e&&(this.unmount=_D(e,(e,t)=>(WM(this.node,t,`Start`),e=>WM(this.node,e,`End`))))}unmount(){}},KM=class extends kA{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=iC(NA(this.node.current,`focus`,()=>this.onFocus()),NA(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function qM(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&zC.postRender(()=>i(t,PA(t)))}var JM=class extends kA{mount(){let{current:e}=this.node;e&&(this.unmount=DD(e,(e,t)=>(qM(this.node,t,`Start`),(e,{success:t})=>qM(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}},YM=new WeakMap,XM=new WeakMap,ZM=e=>{let t=YM.get(e.target);t&&t(e)},QM=e=>{e.forEach(ZM)};function $M({root:e,...t}){let n=e||document;XM.has(n)||XM.set(n,{});let r=XM.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(QM,{root:e,...t})),r[i]}function eN(e,t,n){let r=$M(t);return YM.set(e,n),r.observe(e),()=>{YM.delete(e),r.unobserve(e)}}var tN={some:0,all:1},nN=class extends kA{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:tN[r]};return eN(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(rN(e,t))&&this.startObserver()}unmount(){}};function rN({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var iN={inView:{Feature:nN},tap:{Feature:JM},focus:{Feature:KM},hover:{Feature:GM}},aN={layout:{ProjectionNode:HM,MeasureLayout:Aj}},oN=uk({...MA,...iN,...UM,...aN},Yk),sN=(e,t)=>{if(e.id===t.id)return!1;let n=.1;return e.x>=t.x-n&&e.x+e.width<=t.x+t.width+n&&e.y>=t.y-n&&e.y+e.height<=t.y+t.height+n},cN=(e,t,n,r,i=1.2)=>{if(!e)return 0;let a=document.createElement(`canvas`).getContext(`2d`);if(!a)return 0;a.font=`${r}px ${n}`;let o=e.split(` `),s=``,c=1;for(let e=0;e<o.length;e++){let n=s+o[e]+` `;a.measureText(n).width>t&&e>0?(s=o[e]+` `,c++):s=n}let l=e.split(`
|
|
57
|
-
`).length-1;return c+=l,Math.ceil(c*r*i)};let lN=(e,t)=>{let n=e.map(e=>({...e})),r=new Map(e.map(e=>[e.id,e])),i=[];n.forEach(e=>{let a=e.type===`text`,o=e.type===`text-container`;if((a||o)&&e.autoGrow){let a=e.content;t&&(a=a.replace(/\{\{(.*?)\}\}/g,(n,r)=>{let i=t[r.trim()];return i==null?n:e.formatting?jS(i,e.formatting):String(i)}));let s=parseInt(String(e.style?.fontSize||16)),c=String(e.style?.fontFamily||`Arial`);if(o&&e.containerExpansion===`horizontal`){let t=document.createElement(`canvas`).getContext(`2d`);if(t){t.font=`${s}px ${c}`;let n=t.measureText(a),r=Math.ceil(n.width+parseInt(String(e.style?.padding||0))*2);Math.abs(r-e.width)>1&&(e.width=r,e.content=a)}}else{let t=cN(a,e.width,c,s),o=e.height,l=t-o;if(Math.abs(l)>1){e.height=t,e.content=a;let s=[],c=r.get(e.id);c&&n.forEach(t=>{if(t.id===e.id)return;let n=r.get(t.id);n&&sN(c,n)&&s.push(t)});let u=new Set([e.id]);s.forEach(e=>{e.height+=l,u.add(e.id)}),i.push({triggerY:e.y+o,delta:l,ignoreIds:u})}}}}),n.forEach(e=>{let t=r.get(e.id);if(!t)return;let n=0;i.forEach(r=>{r.ignoreIds.has(e.id)||t.y>=r.triggerY-.1&&(n+=r.delta)}),e.y+=n});let a=0;return n.forEach(e=>{let t=e.y+e.height;t>a&&(a=t)}),{elements:n,totalHeight:a}};var uN=e=>{switch(e){case`linear`:return`linear`;case`ease-in`:return`easeIn`;case`ease-out`:return`easeOut`;case`ease-in-out`:return`easeInOut`;case`bounce`:return`easeOut`;case`ease`:return`easeInOut`;default:return`easeOut`}},dN=e=>{if(!e||e.type===`none`)return{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1}};let t={initial:{},animate:{}};switch(e.type){case`fadeIn`:t.initial={opacity:0},t.animate={opacity:1};break;case`slideInLeft`:t.initial={opacity:0,x:-100},t.animate={opacity:1,x:0};break;case`slideInRight`:t.initial={opacity:0,x:100},t.animate={opacity:1,x:0};break;case`slideInUp`:t.initial={opacity:0,y:100},t.animate={opacity:1,y:0};break;case`slideInDown`:t.initial={opacity:0,y:-100},t.animate={opacity:1,y:0};break;case`zoomIn`:t.initial={opacity:0,scale:.5},t.animate={opacity:1,scale:1};break;case`bounceIn`:t.initial={opacity:0,scale:.3},t.animate={opacity:1,scale:1,transition:{type:`spring`,bounce:.6}};break;case`smoothSlideUp`:t.initial={opacity:0,y:30},t.animate={opacity:1,y:0};break;case`popIn`:t.initial={opacity:0,scale:.8,y:10},t.animate={opacity:1,scale:1,y:0};break;case`blurIn`:t.initial={opacity:0,filter:`blur(10px)`},t.animate={opacity:1,filter:`blur(0px)`};break;case`pulse`:t.animate={scale:[1,1.05,1]};break;case`shake`:t.animate={x:[0,-5,5,-5,5,0]};break;case`spin`:t.animate={rotate:360};break;default:t.initial={opacity:0,y:20},t.animate={opacity:1,y:0}}return t},fN=(e,t)=>{let n={duration:e?.duration||.4,ease:uN(e?.timingFunction),delay:e?.delay||0},r;e?.iterationCount===`infinite`?r=1/0:typeof e?.iterationCount==`number`&&e.iterationCount>1&&(r=e.iterationCount-1);let i=t?.animate?.transition;return i?{...n,...i,delay:n.delay,repeat:r??i.repeat}:r===void 0?n:{...n,repeat:r}},pN=({element:e,offsetY:n=0,dataContext:i,onSelect:a,isSelected:o})=>{let s=e.content;if(i){if(e.type===`text`||e.type===`text-container`)s=s.replace(/\{\{(.*?)\}\}/g,(t,n)=>{let r=i[n.trim()];return r==null?t:e.formatting?jS(r,e.formatting):String(r)});else if(e.type===`image`)if(e.dataBinding){let t=i[e.dataBinding];t!=null&&(s=String(t))}else s=s.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let n=i[t.trim()];return n==null?e:String(n)})}let c={position:`absolute`,left:e.x,top:e.y+n,width:e.type===`text-container`&&e.autoGrow&&e.containerExpansion===`horizontal`?`max-content`:`${e.width}px`,height:e.autoGrow?`auto`:`${e.height}px`,transform:e.rotation?`rotate(${e.rotation}deg)`:void 0,padding:e.type===`image`||e.type===`text`||e.type===`text-container`?0:`8px`,overflow:e.autoGrow?`visible`:`hidden`,whiteSpace:e.type===`text-container`&&e.autoGrow&&e.containerExpansion===`horizontal`?`nowrap`:e.autoGrow?`pre-wrap`:void 0,wordBreak:e.autoGrow?`break-word`:void 0,outline:o?`2px solid var(--blue-9)`:void 0,zIndex:o?10:void 0,cursor:a?`pointer`:void 0,...e.style},l=e.animation&&e.animation.type!==`none`,u=t.default.useMemo(()=>l?dN(e.animation):null,[e.animation,l]),d=t.default.useMemo(()=>fN(e.animation,u),[e.animation,u]),f=(0,r.jsxs)(r.Fragment,{children:[(e.type===`text`||e.type===`text-container`)&&(0,r.jsx)(H,{style:{width:`100%`,height:`100%`,display:`block`},children:s}),e.type===`image`&&(s?(0,r.jsx)(`img`,{src:s,alt:`Element`,style:{width:`100%`,height:`100%`,objectFit:e.style?.objectFit||`cover`,display:`block`}}):(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,backgroundColor:`#eee`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(H,{size:`1`,children:`Imagem`})})),e.type===`box`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`}}),e.type===`checkbox`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(`input`,{type:`checkbox`,checked:i&&e.dataBinding?i[e.dataBinding]===!0||String(i[e.dataBinding])===`true`:!1,readOnly:!0,style:{width:`100%`,height:`100%`,margin:0}})})]});return l&&u?(0,r.jsx)(oN.div,{variants:u,initial:`initial`,animate:`animate`,transition:d,style:c,onClick:t=>{t.stopPropagation(),a?.(e.id)},children:f}):(0,r.jsx)(U,{style:c,onClick:t=>{t.stopPropagation(),a?.(e.id)},children:f})},mN=({item:e,elements:n,animation:i,onSelect:a,selectedElementIds:o})=>{let{elements:s,totalHeight:c}=t.default.useMemo(()=>lN(n,e),[n,e]),l=t.default.useMemo(()=>dN(i),[i]),u=t.default.useMemo(()=>l.animate?.transition||{duration:i?.duration||.4,ease:uN(i?.timingFunction)},[i,l]);return(0,r.jsx)(oN.div,{layout:!0,variants:l,initial:`initial`,animate:`animate`,exit:{opacity:0,scale:.9},transition:u,whileHover:{scale:1.02,transition:{duration:.2}},style:{position:`relative`,height:c,width:`100%`,marginBottom:`20px`,transformOrigin:`center center`},children:s.map(t=>(0,r.jsx)(pN,{element:t,offsetY:0,dataContext:e,onSelect:a,isSelected:o?.includes(t.id)},t.id))})};let hN=()=>{let{state:e,setSelectedElements:n}=rS(),[i,a]=t.default.useState(!1),[o,s]=t.default.useState([]);return t.default.useEffect(()=>{let t;return i&&e.isList?(o.length===0&&s([{id:Date.now(),...e.mockData[0]||{}}]),t=setInterval(()=>{s(t=>{let n=t.length%(e.mockData.length||1),r={...e.mockData.length>0?e.mockData[n]:{id:t.length},id:`${Date.now()}-${t.length}`};return e.listSettings.newestPosition===`top`?[r,...t].slice(0,20):[...t,r].slice(-20)})},1500)):s([]),()=>clearInterval(t)},[i,e.isList,e.listSettings.newestPosition,e.mockData]),(0,r.jsxs)(U,{style:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,backgroundColor:`var(--color-panel-solid)`},children:[e.isList&&(0,r.jsx)(U,{style:{position:`absolute`,bottom:10,right:10,zIndex:100,backgroundColor:`var(--color-surface)`,padding:`4px`,borderRadius:`var(--radius-3)`,boxShadow:`0 2px 10px rgba(0,0,0,0.1)`},children:(0,r.jsxs)(G,{size:`1`,variant:i?`soft`:`solid`,color:i?`red`:`green`,onClick:()=>a(!i),children:[i?(0,r.jsx)(Mt,{}):(0,r.jsx)(ft,{}),i?`Parar Simulação`:`Simular Entrada`]})}),(0,r.jsx)(Xv,{type:`auto`,scrollbars:`vertical`,style:{height:`100%`,width:`100%`},children:(0,r.jsx)(U,{style:{position:`relative`,minHeight:`100%`,width:`100%`},children:(()=>{if(e.elements.length===0)return(0,r.jsx)(W,{align:`center`,justify:`center`,style:{height:`100%`},children:(0,r.jsx)(H,{color:`gray`,children:`Preview vazio`})});if(e.isList){let t=[];if(i)t=o;else{if(t=e.mockData.length>0?e.mockData:Array.from({length:10}).map((e,t)=>({id:t})),e.listSettings.sortProp){let n=e.listSettings.sortProp,r=e.listSettings.sortOrder===`asc`?1:-1;t=[...t].sort((e,t)=>{let i=e[n],a=t[n];return i<a?-1*r:i>a?1*r:0})}e.listSettings.newestPosition===`top`&&(t=[...t].reverse())}let a=e.listSettings.containerHeight;return(0,r.jsx)(U,{style:{width:`100%`,minHeight:a?`${a}px`:`100%`,height:a?`${a}px`:void 0,overflowY:a?`auto`:void 0,display:`flex`,flexDirection:`column`,justifyContent:e.listSettings.newestPosition===`top`?`flex-start`:`flex-end`,padding:16},children:(0,r.jsx)(WD,{mode:`popLayout`,children:t.map((t,i)=>(0,r.jsx)(mN,{item:t,elements:e.elements,animation:e.listSettings.entryAnimation,onSelect:e=>n([e]),selectedElementIds:e.selectedElementIds},t.id||i))})})}return(0,r.jsx)(r.Fragment,{children:e.elements.map(t=>(0,r.jsx)(pN,{element:t,dataContext:e.singleMockData,onSelect:e=>n([e]),isSelected:e.selectedElementIds.includes(t.id)},t.id))})})()})})]})};function gN(){return(gN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _N(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function vN(e){var n=(0,t.useRef)(e),r=(0,t.useRef)(function(e){n.current&&n.current(e)});return n.current=e,r.current}var yN=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},bN=function(e){return`touches`in e},xN=function(e){return e&&e.ownerDocument.defaultView||self},SN=function(e,t,n){var r=e.getBoundingClientRect(),i=bN(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:yN((i.pageX-(r.left+xN(e).pageXOffset))/r.width),top:yN((i.pageY-(r.top+xN(e).pageYOffset))/r.height)}},CN=function(e){!bN(e)&&e.preventDefault()},wN=t.default.memo(function(e){var n=e.onMove,r=e.onKey,i=_N(e,[`onMove`,`onKey`]),a=(0,t.useRef)(null),o=vN(n),s=vN(r),c=(0,t.useRef)(null),l=(0,t.useRef)(!1),u=(0,t.useMemo)(function(){var e=function(e){CN(e),(bN(e)?e.touches.length>0:e.buttons>0)&&a.current?o(SN(a.current,e,c.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=xN(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(CN(t),!function(e,t){return t&&!bN(e)}(t,l.current)&&r)){if(bN(t)){l.current=!0;var i=t.changedTouches||[];i.length&&(c.current=i[0].identifier)}r.focus(),o(SN(r,t,c.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},n]},[s,o]),d=u[0],f=u[1],p=u[2];return(0,t.useEffect)(function(){return p},[p]),t.default.createElement(`div`,gN({},i,{onTouchStart:d,onMouseDown:d,className:`react-colorful__interactive`,ref:a,onKeyDown:f,tabIndex:0,role:`slider`}))}),TN=function(e){return e.filter(Boolean).join(` `)},EN=function(e){var n=e.color,r=e.left,i=e.top,a=i===void 0?.5:i,o=TN([`react-colorful__pointer`,e.className]);return t.default.createElement(`div`,{className:o,style:{top:100*a+`%`,left:100*r+`%`}},t.default.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:n}}))},DN=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var ON=function(e){return LN(kN(e))},kN=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?DN(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?DN(parseInt(e.substring(6,8),16)/255,2):1}},AN=function(e){return IN(PN(e))},jN=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:DN(e.h),s:DN(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:DN(i/2),a:DN(r,2)}},MN=function(e){var t=jN(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},NN=function(e){var t=jN(e);return`hsla(`+t.h+`, `+t.s+`%, `+t.l+`%, `+t.a+`)`},PN=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:DN(255*[r,s,o,o,c,r][l]),g:DN(255*[c,r,r,s,o,o][l]),b:DN(255*[o,o,c,r,r,s][l]),a:DN(i,2)}},FN=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},IN=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?FN(DN(255*i)):``;return`#`+FN(t)+FN(n)+FN(r)+a},LN=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:DN(60*(s<0?s+6:s)),s:DN(a?o/a*100:0),v:DN(a/255*100),a:i}},RN=t.default.memo(function(e){var n=e.hue,r=e.onChange,i=TN([`react-colorful__hue`,e.className]);return t.default.createElement(`div`,{className:i},t.default.createElement(wN,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:yN(n+360*e.left,0,360)})},"aria-label":`Hue`,"aria-valuenow":DN(n),"aria-valuemax":`360`,"aria-valuemin":`0`},t.default.createElement(EN,{className:`react-colorful__hue-pointer`,left:n/360,color:MN({h:n,s:100,v:100,a:1})})))}),zN=t.default.memo(function(e){var n=e.hsva,r=e.onChange,i={backgroundColor:MN({h:n.h,s:100,v:100,a:1})};return t.default.createElement(`div`,{className:`react-colorful__saturation`,style:i},t.default.createElement(wN,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:yN(n.s+100*e.left,0,100),v:yN(n.v-100*e.top,0,100)})},"aria-label":`Color`,"aria-valuetext":`Saturation `+DN(n.s)+`%, Brightness `+DN(n.v)+`%`},t.default.createElement(EN,{className:`react-colorful__saturation-pointer`,top:1-n.v/100,left:n.s/100,color:MN(n)})))}),BN=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},VN=function(e,t){return e.toLowerCase()===t.toLowerCase()||BN(kN(e),kN(t))};function HN(e,n,r){var i=vN(r),a=(0,t.useState)(function(){return e.toHsva(n)}),o=a[0],s=a[1],c=(0,t.useRef)({color:n,hsva:o});return(0,t.useEffect)(function(){if(!e.equal(n,c.current.color)){var t=e.toHsva(n);c.current={hsva:t,color:n},s(t)}},[n,e]),(0,t.useEffect)(function(){var t;BN(o,c.current.hsva)||e.equal(t=e.fromHsva(o),c.current.color)||(c.current={hsva:o,color:t},i(t))},[o,e,i]),[o,(0,t.useCallback)(function(e){s(function(t){return Object.assign({},t,e)})},[])]}var UN,WN=typeof window<`u`?t.useLayoutEffect:t.useEffect,GN=function(){return UN||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},KN=new Map,qN=function(e){WN(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!KN.has(t)){var n=t.createElement(`style`);n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,KN.set(t,n);var r=GN();r&&n.setAttribute(`nonce`,r),t.head.appendChild(n)}},[])},JN=function(e){var n=e.className,r=e.hsva,i=e.onChange,a={backgroundImage:`linear-gradient(90deg, `+NN(Object.assign({},r,{a:0}))+`, `+NN(Object.assign({},r,{a:1}))+`)`},o=TN([`react-colorful__alpha`,n]),s=DN(100*r.a);return t.default.createElement(`div`,{className:o},t.default.createElement(`div`,{className:`react-colorful__alpha-gradient`,style:a}),t.default.createElement(wN,{onMove:function(e){i({a:e.left})},onKey:function(e){i({a:yN(r.a+e.left)})},"aria-label":`Alpha`,"aria-valuetext":s+`%`,"aria-valuenow":s,"aria-valuemin":`0`,"aria-valuemax":`100`},t.default.createElement(EN,{className:`react-colorful__alpha-pointer`,left:r.a,color:NN(r)})))},YN=function(e){var n=e.className,r=e.colorModel,i=e.color,a=i===void 0?r.defaultColor:i,o=e.onChange,s=_N(e,[`className`,`colorModel`,`color`,`onChange`]),c=(0,t.useRef)(null);qN(c);var l=HN(r,a,o),u=l[0],d=l[1],f=TN([`react-colorful`,n]);return t.default.createElement(`div`,gN({},s,{ref:c,className:f}),t.default.createElement(zN,{hsva:u,onChange:d}),t.default.createElement(RN,{hue:u.h,onChange:d}),t.default.createElement(JN,{hsva:u,onChange:d,className:`react-colorful__last-control`}))},XN={defaultColor:`0001`,toHsva:ON,fromHsva:AN,equal:VN},ZN=function(e){return t.default.createElement(YN,gN({},e,{colorModel:XN}))},QN={black:`#000000`,white:`#ffffff`,red:`#ff0000`,green:`#008000`,blue:`#0000ff`,yellow:`#ffff00`,cyan:`#00ffff`,magenta:`#ff00ff`,gray:`#808080`,grey:`#808080`,silver:`#c0c0c0`,maroon:`#800000`,olive:`#808000`,purple:`#800080`,teal:`#008080`,navy:`#000080`,orange:`#ffa500`,transparent:`#00000000`};let $N=e=>{if(!e)return`#000000`;let t=e.trim().toLowerCase();if(t.startsWith(`#`))return t.length===4?`#`+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t.length===5?`#`+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4]:t;if(QN[t])return QN[t];let n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)$/);if(n){let e=parseInt(n[1]),t=parseInt(n[2]),r=parseInt(n[3]),i=n[4]?parseFloat(n[4]):1,a=e=>{let t=Math.round(e).toString(16);return t.length===1?`0`+t:t},o=Math.round(i*255);return`#${a(e)}${a(t)}${a(r)}${a(o)}`}return`#000000`},eP=({color:e,onChange:t})=>{let n=(e=>$N(e))(e);return(0,r.jsxs)(W,{direction:`column`,gap:`3`,style:{width:`100%`},children:[(0,r.jsx)(ZN,{color:n,onChange:t,style:{width:`100%`}}),(0,r.jsxs)(W,{gap:`2`,align:`center`,children:[(0,r.jsx)(U,{style:{width:32,height:32,backgroundColor:n,borderRadius:4,border:`1px solid var(--gray-5)`,flexShrink:0}}),(0,r.jsx)(X,{value:e,onChange:e=>t(e.target.value),onBlur:()=>{e&&/^[0-9A-Fa-f]{3,8}$/.test(e)&&t(`#`+e)},placeholder:`#RRGGBBAA`,style:{flexGrow:1}})]})]})},tP=({color:e,onChange:t,label:n})=>(0,r.jsxs)(Ay,{children:[(0,r.jsx)(jy,{children:(0,r.jsxs)(G,{variant:`surface`,color:`gray`,style:{width:`100%`,justifyContent:`flex-start`,padding:`0 8px`,height:32},children:[(0,r.jsx)(U,{style:{width:18,height:18,backgroundColor:e||`transparent`,borderRadius:2,border:`1px solid var(--gray-8)`,marginRight:8,backgroundImage:e===`transparent`?`linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)`:`none`,backgroundSize:`8px 8px`,backgroundPosition:`0 0, 0 4px, 4px -4px, -4px 0px`}}),(0,r.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n||e||`Transparente`})]})}),(0,r.jsx)(My,{style:{width:240},children:(0,r.jsx)(eP,{color:e,onChange:t})})]}),nP=({elementId:e})=>{let{state:t,updateElement:n}=rS(),i=t.elements.find(t=>t.id===e);return i?(0,r.jsx)(U,{pt:`2`,children:(0,r.jsxs)(sb,{defaultValue:`formatting`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`formatting`,style:{flex:1},children:`Formatação`}),(0,r.jsx)(lb,{value:`style`,style:{flex:1},children:`Estilo`}),(0,r.jsx)(lb,{value:`bindings`,style:{flex:1},children:`Vínculos`}),(0,r.jsx)(lb,{value:`conditional`,style:{flex:1},children:`Regras`}),(0,r.jsx)(lb,{value:`animation`,style:{flex:1},children:`Anim`})]}),(0,r.jsxs)(U,{pt:`3`,children:[(0,r.jsx)(ub,{value:`formatting`,children:(0,r.jsx)(iP,{element:i,updateElement:n})}),(0,r.jsx)(ub,{value:`style`,children:(0,r.jsx)(aP,{element:i,updateElement:n})}),(0,r.jsx)(ub,{value:`bindings`,children:(0,r.jsx)(pP,{element:i,updateElement:n,availableProps:t.availableProps||[]})}),(0,r.jsx)(ub,{value:`conditional`,children:(0,r.jsx)(mP,{element:i,updateElement:n,availableProps:t.availableProps||[]})}),(0,r.jsx)(ub,{value:`animation`,children:(0,r.jsx)(rP,{element:i,updateElement:n})})]})]})}):null},rP=({element:e,updateElement:t})=>{let n=e.animation||{type:`none`,duration:1,delay:0},i=r=>{t(e.id,{animation:{...n,...r}})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Tipo de Animação`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[n.type===`none`?`Nenhuma`:n.type===`slideIn`?`Slide In (Padrão)`:n.type===`fadeIn`?`Fade In`:n.type===`smoothSlideUp`?`Slide Suave (Up)`:n.type===`popIn`?`Pop In`:n.type===`blurIn`?`Blur In`:n.type===`slideInLeft`?`Slide In (Esquerda)`:n.type===`slideInRight`?`Slide In (Direita)`:n.type===`slideInUp`?`Slide In (Cima)`:n.type===`slideInDown`?`Slide In (Baixo)`:n.type===`zoomIn`?`Zoom In`:n.type===`bounceIn`?`Bounce In`:n.type===`pulse`?`Pulse (Atenção)`:n.type===`shake`?`Shake (Atenção)`:`Spin (Loop)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>i({type:`none`}),children:`Nenhuma`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideIn`}),children:`Slide In (Padrão)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`fadeIn`}),children:`Fade In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`smoothSlideUp`}),children:`Slide Suave (Up)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`popIn`}),children:`Pop In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`blurIn`}),children:`Blur In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInLeft`}),children:`Slide In (Esquerda)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInRight`}),children:`Slide In (Direita)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInUp`}),children:`Slide In (Cima)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInDown`}),children:`Slide In (Baixo)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`zoomIn`}),children:`Zoom In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`bounceIn`}),children:`Bounce In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`pulse`}),children:`Pulse (Atenção)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`shake`}),children:`Shake (Atenção)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`spin`}),children:`Spin (Loop)`})]})]})]}),n.type!==`none`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Duração (s)`}),(0,r.jsx)(X,{type:`number`,step:`0.1`,min:`0.1`,value:n.duration,onChange:e=>i({duration:parseFloat(e.target.value)||.5})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Atraso (s)`}),(0,r.jsx)(X,{type:`number`,step:`0.1`,min:`0`,value:n.delay,onChange:e=>i({delay:parseFloat(e.target.value)||0})})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Curva de Tempo`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[(n.timingFunction||`ease`)===`linear`?`Linear`:(n.timingFunction||`ease`)===`ease-in`?`Ease In`:(n.timingFunction||`ease`)===`ease-out`?`Ease Out`:(n.timingFunction||`ease`)===`ease-in-out`?`Ease In Out`:(n.timingFunction||`ease`)===`bounce`?`Bounce`:`Ease`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`linear`}),children:`Linear`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease`}),children:`Ease`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease-in`}),children:`Ease In`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease-out`}),children:`Ease Out`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease-in-out`}),children:`Ease In Out`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`bounce`}),children:`Bounce`})]})]})]}),[`pulse`,`shake`,`spin`].includes(n.type)&&(0,r.jsx)(U,{children:(0,r.jsxs)(W,{align:`center`,gap:`2`,mt:`2`,children:[(0,r.jsx)(ib,{checked:n.iterationCount===`infinite`,onCheckedChange:e=>i({iterationCount:e?`infinite`:1})}),(0,r.jsx)(H,{size:`2`,children:`Repetir Infinitamente`})]})})]})]})},iP=({element:e,updateElement:t})=>{let n=e.formatting||{type:`text`},i=r=>{t(e.id,{formatting:{...n,...r}})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(e.type===`text`||e.type===`text-container`)&&(0,r.jsxs)(U,{children:[(0,r.jsxs)(W,{align:`center`,gap:`2`,mb:`3`,children:[(0,r.jsx)(ib,{checked:e.autoGrow||!1,onCheckedChange:n=>t(e.id,{autoGrow:n})}),(0,r.jsx)(H,{size:`2`,children:e.type===`text-container`?`Expandir container automaticamente`:`Expandir altura automaticamente`})]}),e.type===`text-container`&&e.autoGrow&&(0,r.jsxs)(U,{mb:`3`,ml:`4`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Direção de Expansão`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[(e.containerExpansion||`vertical`)===`vertical`?`Vertical (Altura Cresce)`:`Horizontal (Largura Cresce)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>t(e.id,{containerExpansion:`vertical`}),children:`Vertical (Altura Cresce)`}),(0,r.jsx)(q,{onSelect:()=>t(e.id,{containerExpansion:`horizontal`}),children:`Horizontal (Largura Cresce)`})]})]})]}),(0,r.jsx)(Qy,{size:`4`,mb:`2`})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Tipo de Formatação`}),(0,r.jsxs)(Wy,{value:n.type,onValueChange:e=>i({type:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`text`,children:`Texto (Padrão)`}),(0,r.jsx)(Y,{value:`boolean`,children:`Booleano (Sim/Não)`}),(0,r.jsx)(Y,{value:`date`,children:`Data`}),(0,r.jsx)(Y,{value:`number`,children:`Número / Moeda`})]})]})]}),n.type===`boolean`&&(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Texto para Verdadeiro`}),(0,r.jsx)(X,{placeholder:`Ex: Sim`,value:n.trueLabel||``,onChange:e=>i({trueLabel:e.target.value})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Texto para Falso`}),(0,r.jsx)(X,{placeholder:`Ex: Não`,value:n.falseLabel||``,onChange:e=>i({falseLabel:e.target.value})})]})]}),n.type===`date`&&(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Formato da Data`}),(0,r.jsx)(X,{placeholder:`Ex: DD/MM/YYYY`,value:n.dateFormat||``,onChange:e=>i({dateFormat:e.target.value})}),(0,r.jsx)(H,{size:`1`,color:`gray`,mt:`1`,style:{fontSize:10},children:`Use DD, MM, YYYY, HH, mm, ss.`})]}),n.type===`number`&&(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Estilo`}),(0,r.jsxs)(Wy,{value:n.numberFormat||`decimal`,onValueChange:e=>i({numberFormat:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`decimal`,children:`Decimal`}),(0,r.jsx)(Y,{value:`currency`,children:`Moeda`}),(0,r.jsx)(Y,{value:`percent`,children:`Porcentagem`})]})]})]}),n.numberFormat===`currency`&&(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Símbolo da Moeda`}),(0,r.jsx)(X,{placeholder:`Ex: R$`,value:n.currencySymbol||``,onChange:e=>i({currencySymbol:e.target.value})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Casas Decimais`}),(0,r.jsx)(X,{type:`number`,placeholder:`2`,value:n.decimalPlaces===void 0?``:n.decimalPlaces,onChange:e=>i({decimalPlaces:parseInt(e.target.value)||0})})]})]})]})},aP=({element:e,updateElement:n})=>{let i=e.style||{},[a,o]=(0,t.useState)(i.borderTopLeftRadius!==void 0||i.borderTopRightRadius!==void 0||i.borderBottomRightRadius!==void 0||i.borderBottomLeftRadius!==void 0),s=t=>{n(e.id,{style:{...i,...t}})},c=(e,t)=>{let n=typeof e==`number`?e:parseInt(e)||0;s({[t]:`${n}px`})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsxs)(W,{align:`center`,justify:`between`,mb:`2`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Arredondamento`}),(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(H,{size:`1`,children:`Individual`}),(0,r.jsx)(ib,{checked:a,onCheckedChange:e=>{if(o(e),!e)s({borderRadius:i.borderTopLeftRadius||i.borderRadius||0,borderTopLeftRadius:void 0,borderTopRightRadius:void 0,borderBottomRightRadius:void 0,borderBottomLeftRadius:void 0});else{let e=i.borderRadius||0;s({borderRadius:void 0,borderTopLeftRadius:e,borderTopRightRadius:e,borderBottomRightRadius:e,borderBottomLeftRadius:e})}}})]})]}),a?(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Sup. Esq.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderTopLeftRadius)||0,onChange:e=>c(e.target.value,`borderTopLeftRadius`)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Sup. Dir.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderTopRightRadius)||0,onChange:e=>c(e.target.value,`borderTopRightRadius`)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Inf. Esq.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderBottomLeftRadius)||0,onChange:e=>c(e.target.value,`borderBottomLeftRadius`)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Inf. Dir.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderBottomRightRadius)||0,onChange:e=>c(e.target.value,`borderBottomRightRadius`)})]})]}):(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Raio (Todos os cantos)`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderRadius)||0,onChange:e=>s({borderRadius:`${parseInt(e.target.value)||0}px`})})]})]}),(0,r.jsx)(Qy,{size:`4`,my:`2`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,children:`Espaçamento Interno`}),(0,r.jsx)(K,{columns:`2`,gap:`3`,children:(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Tamanho (px)`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.padding)||0,onChange:e=>s({padding:`${parseInt(e.target.value)||0}px`})})]})})]}),(0,r.jsx)(Qy,{size:`4`,my:`2`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,children:`Sombra (Box Shadow)`}),(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Cor`}),(0,r.jsx)(tP,{color:oP(i.boxShadow),onChange:e=>s({boxShadow:lP(i.boxShadow,e)})})]}),(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Blur (px)`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:sP(i.boxShadow),onChange:e=>s({boxShadow:uP(i.boxShadow,parseInt(e.target.value)||0)})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Spread (px)`}),(0,r.jsx)(X,{type:`number`,value:cP(i.boxShadow),onChange:e=>s({boxShadow:dP(i.boxShadow,parseInt(e.target.value)||0)})})]})]}),(0,r.jsx)(G,{variant:`soft`,color:`gray`,size:`1`,onClick:()=>s({boxShadow:i.boxShadow?void 0:`0 4px 12px 0 rgba(0,0,0,0.15)`}),children:i.boxShadow?`Remover Sombra`:`Adicionar Sombra`})]})]})]})};var oP=e=>{if(!e||e===`none`)return`#0000001a`;let t=e.match(/(?:rgba?\([^)]+\)|#[0-9a-fA-F]{3,8}|[a-zA-Z]+)\s*$/);return t?t[0].trim():`#0000001a`},sP=e=>{if(!e||e===`none`)return 12;let t=e.match(/(-?\d+(?:\.\d+)?)(?:px)?/g);return t&&t.length>=3?parseFloat(t[2]):12},cP=e=>{if(!e||e===`none`)return 0;let t=e.match(/(-?\d+(?:\.\d+)?)(?:px)?/g);return t&&t.length>=4?parseFloat(t[3]):0},lP=(e,t)=>{let n=sP(e),r=cP(e);return`${e?.includes(`inset`)?`inset `:``}0px 4px ${n}px ${r}px ${t}`},uP=(e,t)=>{let n=(e||`0 4px 12px 0 #0000001a`).match(/(-?\d+(?:\.\d+)?)(?:px)?/g)||[`0`,`4`,`12`,`0`],r=oP(e);return`${e?.includes(`inset`)?`inset `:``}${n[0]||0}px ${n[1]||4}px ${t}px ${n[3]||0}px ${r}`},dP=(e,t)=>{let n=(e||`0 4px 12px 0 #0000001a`).match(/(-?\d+(?:\.\d+)?)(?:px)?/g)||[`0`,`4`,`12`,`0`],r=oP(e);return`${e?.includes(`inset`)?`inset `:``}${n[0]||0}px ${n[1]||4}px ${n[2]||12}px ${t}px ${r}`},fP=[{key:`color`,label:`Cor do texto`},{key:`backgroundColor`,label:`Cor de fundo`},{key:`borderColor`,label:`Cor da borda`},{key:`boxShadowColor`,label:`Cor da sombra`}];let pP=({element:e,updateElement:t,availableProps:n})=>{let i=e.styleBindings||{},a=(n,r)=>{let a={...i};r?a[n]=r:delete a[n],t(e.id,{styleBindings:Object.keys(a).length>0?a:void 0})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Vínculos de Estilo (Data Binding)`}),(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`2`,children:`Vincule propriedades de estilo a variáveis de dados. O valor da variável será aplicado em tempo real (ex.: cores em formato #RRGGBB, rgba(), etc.).`}),fP.map(({key:e,label:t})=>(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:t}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,size:`1`,style:{width:`100%`,justifyContent:`space-between`},children:[i[e]?n.find(t=>t.dataName===i[e])?.name||i[e]:`Nenhum`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>a(e,null),children:`Nenhum`}),n.map(t=>(0,r.jsx)(q,{onSelect:()=>a(e,t.dataName),children:t.name},t.dataName)),n.length===0&&(0,r.jsx)(q,{disabled:!0,children:`Nenhuma variável disponível`})]})]})]},e))]})},mP=({element:e,updateElement:t,availableProps:n})=>{let i=e.conditions||[],a=()=>{let r={id:crypto.randomUUID(),property:n.length>0?n[0].dataName:``,operator:`equals`,value:``,style:{color:`#ff0000`}};t(e.id,{conditions:[...i,r]})},o=n=>{t(e.id,{conditions:i.filter(e=>e.id!==n)})},s=(n,r)=>{t(e.id,{conditions:i.map(e=>e.id===n?{...e,...r}:e)})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,children:[(0,r.jsx)(H,{size:`2`,color:`gray`,children:`Regras de Exibição`}),(0,r.jsxs)(G,{size:`1`,variant:`soft`,onClick:a,children:[(0,r.jsx)(mt,{}),` Nova Regra`]})]}),i.length===0?(0,r.jsx)(H,{size:`1`,color:`gray`,style:{fontStyle:`italic`},children:`Nenhuma regra condicional definida.`}):(0,r.jsx)(W,{direction:`column`,gap:`2`,children:i.map(e=>(0,r.jsxs)(U,{style:{border:`1px solid var(--gray-6)`,borderRadius:4,padding:8},children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,mb:`2`,children:[(0,r.jsxs)(H,{size:`1`,weight:`bold`,children:[`Se `,e.property,`...`]}),(0,r.jsx)(J,{size:`1`,color:`red`,variant:`ghost`,onClick:()=>o(e.id),children:(0,r.jsx)(Xt,{})})]}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,mb:`2`,children:[(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,size:`1`,style:{width:`100%`,justifyContent:`space-between`},children:[n.find(t=>t.dataName===e.property)?.name||e.property||`Propriedade`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[n.map(t=>(0,r.jsx)(q,{onSelect:()=>s(e.id,{property:t.dataName}),children:t.name},t.dataName)),n.length===0&&(0,r.jsx)(q,{disabled:!0,children:`Nenhuma variável disponível`})]})]}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,size:`1`,style:{width:`100%`,justifyContent:`space-between`},children:[e.operator===`equals`?`Igual a`:e.operator===`notEquals`?`Diferente de`:e.operator===`contains`?`Contém`:e.operator===`greaterThan`?`Maior que`:`Menor que`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`equals`}),children:`Igual a`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`notEquals`}),children:`Diferente de`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`contains`}),children:`Contém`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`greaterThan`}),children:`Maior que`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`lessThan`}),children:`Menor que`})]})]})]}),(0,r.jsx)(X,{size:`1`,placeholder:`Valor`,value:e.value,onChange:t=>s(e.id,{value:t.target.value})}),(0,r.jsxs)(U,{mt:`2`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor quando verdadeiro`}),(0,r.jsx)(tP,{color:e.style?.color||`#ff0000`,onChange:t=>s(e.id,{style:{...e.style,color:t}})})]})]},e.id))})]})};var hP=({title:e,isOpen:t,onToggle:n,children:i,onReset:a})=>(0,r.jsxs)(U,{style:{borderBottom:`1px solid var(--gray-4)`},children:[(0,r.jsxs)(W,{align:`center`,style:{width:`100%`},children:[(0,r.jsxs)(G,{variant:`ghost`,onClick:n,style:{flex:1,justifyContent:`space-between`,padding:`12px 8px`,borderRadius:0,height:`auto`,cursor:`pointer`,color:`var(--gray-12)`},children:[(0,r.jsx)(H,{weight:`bold`,size:`2`,children:e}),t?(0,r.jsx)(fe,{}):(0,r.jsx)(me,{})]}),a&&t&&(0,r.jsx)(bb,{content:`Resetar para padrão`,children:(0,r.jsx)(J,{variant:`ghost`,color:`gray`,onClick:e=>{e.stopPropagation(),a()},style:{marginRight:8},children:(0,r.jsx)(vt,{})})})]}),t&&(0,r.jsx)(U,{p:`3`,style:{backgroundColor:`var(--gray-2)`},children:i})]}),gP=({value:e,onChange:n,units:i=[`px`,`%`,`em`,`rem`,`vw`,`vh`],min:a,max:o,placeholder:s,label:c})=>{let l=e=>{if(e==null||e===``)return{num:``,unit:i[0]};let t=String(e).match(/^(-?[\d.]+)([a-z%]+)?$/i);return t?{num:t[1],unit:t[2]||i[0]}:{num:``,unit:i[0]}},[u,d]=(0,t.useState)(l(e));(0,t.useEffect)(()=>{d(l(e))},[e]);let f=(e,t)=>{if(e===``){n(``);return}n(`${e}${t}`)};return(0,r.jsxs)(U,{children:[c&&(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:c}),(0,r.jsxs)(W,{children:[(0,r.jsx)(X,{type:`number`,value:u.num,onChange:e=>{let t=e.target.value;d({...u,num:t}),f(t,u.unit)},placeholder:s,style:{borderTopRightRadius:0,borderBottomRightRadius:0,flex:1},min:a,max:o}),(0,r.jsxs)(Wy,{value:u.unit,onValueChange:e=>{d({...u,unit:e}),f(u.num,e)},children:[(0,r.jsx)(Gy,{style:{width:60,borderTopLeftRadius:0,borderBottomLeftRadius:0,marginLeft:-1}}),(0,r.jsx)(Ky,{children:i.map(e=>(0,r.jsx)(Y,{value:e,children:e},e))})]})]})]})},_P=({values:e,onChange:n,label:i})=>{let[a,o]=(0,t.useState)(!0),s=e=>{n({top:e,right:e,bottom:e,left:e})},c=(t,r)=>{n({...e,[t]:r})};return(0,r.jsxs)(U,{children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,mb:`1`,children:[i&&(0,r.jsx)(H,{size:`1`,color:`gray`,children:i}),(0,r.jsx)(bb,{content:a?`Desvincular lados`:`Vincular lados`,children:(0,r.jsx)(J,{size:`1`,variant:`ghost`,color:a?`blue`:`gray`,onClick:()=>o(!a),children:a?(0,r.jsx)(vP,{}):(0,r.jsx)(yP,{})})})]}),a?(0,r.jsx)(gP,{value:e.top||``,onChange:s,placeholder:`Todos`}):(0,r.jsxs)(K,{columns:`2`,gap:`2`,children:[(0,r.jsx)(gP,{value:e.top,onChange:e=>c(`top`,e),label:`Top`}),(0,r.jsx)(gP,{value:e.right,onChange:e=>c(`right`,e),label:`Right`}),(0,r.jsx)(gP,{value:e.bottom,onChange:e=>c(`bottom`,e),label:`Bottom`}),(0,r.jsx)(gP,{value:e.left,onChange:e=>c(`left`,e),label:`Left`})]})]})},vP=()=>(0,r.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,r.jsx)(`path`,{d:`M4.5 6.5L1.35355 9.64645C0.908293 10.0917 0.908293 10.8134 1.35355 11.2587L3.74132 13.6464C4.18658 14.0917 4.90829 14.0917 5.35355 13.6464L8.5 10.5M10.5 8.5L13.6464 5.35355C14.0917 4.90829 14.0917 4.18658 13.6464 3.74132L11.2587 1.35355C10.8134 0.908293 10.0917 0.908293 9.64645 1.35355L6.5 4.5M6.5 8.5H8.5`,stroke:`currentColor`})}),yP=()=>(0,r.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,r.jsx)(`path`,{d:`M4.5 6.5L1.35355 9.64645C0.908293 10.0917 0.908293 10.8134 1.35355 11.2587L3.74132 13.6464C4.18658 14.0917 4.90829 14.0917 5.35355 13.6464L8.5 10.5M10.5 8.5L13.6464 5.35355C14.0917 4.90829 14.0917 4.18658 13.6464 3.74132L11.2587 1.35355C10.8134 0.908293 10.0917 0.908293 9.64645 1.35355L6.5 4.5`,stroke:`currentColor`})});let bP=()=>{let{state:e,setPropertiesPanelOpen:n,updateElement:i,updateElements:a,removeSelected:o,copy:s,paste:c,addElement:l}=rS(),{isPropertiesPanelOpen:u,selectedElementIds:d,elements:f}=e,p=(0,t.useMemo)(()=>f.filter(e=>d.includes(e.id)),[f,d]),m=p[0],h=p.length>1,[g,_]=(0,t.useState)({content:!0,layout:!0,typography:!0,appearance:!1,borders:!1,effects:!1,transform:!1,animation:!1,conditions:!1,formatting:!1,spacing:!1}),[v,y]=(0,t.useState)(``),[b,x]=(0,t.useState)({});(0,t.useEffect)(()=>{let e=localStorage.getItem(`editor-presets`);if(e)try{x(JSON.parse(e))}catch(e){console.error(`Failed to load presets`,e)}},[]);let S=e=>{if(!m)return;let t={...b,[e]:{style:m.style}};x(t),localStorage.setItem(`editor-presets`,JSON.stringify(t))},C=e=>{let t=b[e];t&&t.style&&D(t.style)};if(!u||!m)return null;let w=e=>{_(t=>({...t,[e]:!t[e]}))},T=e=>{h?a(d.map(t=>({id:t,changes:e}))):i(m.id,e)},E=()=>{if(h)s(),c();else{let{id:e,...t}=m;l({...t,x:m.x+20,y:m.y+20})}},D=e=>{h?a(p.map(t=>({id:t.id,changes:{style:{...t.style,...e}}}))):i(m.id,{style:{...m.style,...e}})},O=e=>{let t={};e.forEach(e=>t[e]=void 0),D(t)},k=(e,t)=>{if(!v)return!0;let n=v.toLowerCase();return e.toLowerCase().includes(n)||t.some(e=>e.toLowerCase().includes(n))},A=e=>{if(!h)return e(m);let t=e(m);return p.every(n=>e(n)===t)?t:`Mixed`},j=(e,t=``)=>{let n=A(t=>t.style?.[e]);return n===`Mixed`?`Mixed`:n===void 0?t:n},M=String(j(`fontFamily`,`Arial`)),N=AS(M,e.availableFonts||[`Arial`]),P=()=>{let e=j(`fontWeight`,`normal`);return e===`Mixed`?`400`:kS(e,OS)},F=e=>{let t={x:0,y:4,blur:12,spread:0,color:`#0000001a`,inset:!1};if(!e||e===`none`)return t;let n=e.trim(),r=n.includes(`inset`),i=n.replace(`inset`,``).trim(),a=i.match(/(-?\d+(?:\.\d+)?)(?:px)?\s+(-?\d+(?:\.\d+)?)(?:px)?(?:\s+(\d+(?:\.\d+)?)(?:px)?)?(?:\s+(\d+(?:\.\d+)?)(?:px)?)?/);return a?{x:parseFloat(a[1]),y:parseFloat(a[2]),blur:a[3]?parseFloat(a[3]):0,spread:a[4]?parseFloat(a[4]):0,color:i.replace(a[0],``).trim()||t.color,inset:r}:t},I=F(m.style?.boxShadow),re=e=>{let t={...I,...e};D({boxShadow:`${t.inset?`inset `:``}${t.x}px ${t.y}px ${t.blur}px ${t.spread}px ${t.color}`})};return(0,r.jsx)(ny,{open:u,onOpenChange:n,children:(0,r.jsxs)(iy,{style:{maxWidth:500,width:`100%`,maxHeight:`85vh`,height:`100%`,padding:0,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,r.jsxs)(U,{style:{borderBottom:`1px solid var(--gray-4)`},children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,p:`4`,pb:`2`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(ay,{style:{margin:0},children:`Propriedades`}),(0,r.jsx)(oy,{size:`1`,color:`gray`,children:h?`${p.length} selecionados`:m.name||`Elemento`})]}),(0,r.jsxs)(W,{gap:`2`,children:[(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsx)(J,{variant:`ghost`,color:`gray`,children:(0,r.jsx)(ee,{})})}),(0,r.jsxs)(fy,{children:[(0,r.jsx)(py,{children:`Presets`}),Object.keys(b).length===0&&(0,r.jsx)(q,{disabled:!0,children:`Nenhum preset salvo`}),Object.keys(b).map(e=>(0,r.jsx)(q,{onSelect:t=>{t.preventDefault(),C(e)},onClick:()=>C(e),style:{cursor:`pointer`},children:e},e)),(0,r.jsx)(xy,{}),(0,r.jsxs)(q,{onSelect:e=>{e.preventDefault();let t=prompt(`Nome do novo preset:`);t&&S(t)},children:[(0,r.jsx)(mt,{style:{marginRight:8}}),` Salvar Atual`]})]})]}),(0,r.jsx)(sy,{children:(0,r.jsx)(J,{variant:`ghost`,color:`gray`,children:(0,r.jsx)(Ee,{})})})]})]}),(0,r.jsxs)(W,{gap:`2`,px:`4`,pb:`3`,children:[(0,r.jsx)(bb,{content:`Bloquear`,children:(0,r.jsx)(J,{variant:`soft`,color:m.locked?`orange`:`gray`,onClick:()=>T({locked:!m.locked}),children:m.locked?(0,r.jsx)(et,{}):(0,r.jsx)(nt,{})})}),(0,r.jsx)(bb,{content:`Ocultar`,children:(0,r.jsx)(J,{variant:`soft`,color:m.hidden?`blue`:`gray`,onClick:()=>T({hidden:!m.hidden}),children:m.hidden?(0,r.jsx)(Be,{}):(0,r.jsx)(He,{})})}),(0,r.jsx)(bb,{content:`Duplicar`,children:(0,r.jsx)(J,{variant:`soft`,color:`gray`,onClick:E,children:(0,r.jsx)(we,{})})}),(0,r.jsx)(U,{style:{flex:1}}),(0,r.jsx)(bb,{content:`Excluir`,children:(0,r.jsx)(J,{variant:`soft`,color:`red`,onClick:()=>{o(),n(!1)},children:(0,r.jsx)(Xt,{})})})]})]}),(0,r.jsx)(U,{p:`3`,style:{borderBottom:`1px solid var(--gray-4)`,backgroundColor:`var(--gray-1)`},children:(0,r.jsx)(X,{placeholder:`Buscar...`,value:v,onChange:e=>y(e.target.value),children:(0,r.jsx)(_b,{children:(0,r.jsx)(ot,{height:`16`,width:`16`})})})}),(0,r.jsxs)(U,{style:{flex:1,overflowY:`auto`,overflowX:`hidden`},children:[k(`Conteúdo`,[`text`,`image`,`url`,`value`,`content`])&&(m.type===`text`||m.type===`text-container`||m.type===`image`)&&(0,r.jsx)(hP,{title:`Conteúdo`,isOpen:g.content,onToggle:()=>w(`content`),children:(0,r.jsxs)(U,{children:[(m.type===`text`||m.type===`text-container`)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Texto`}),(0,r.jsx)(pb,{value:m.content||``,onChange:e=>T({content:e.target.value}),rows:4,placeholder:`Texto ou {{variavel}}...`})]}),m.type===`image`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`URL da Imagem`}),(0,r.jsx)(X,{value:m.content||``,onChange:e=>T({content:e.target.value}),placeholder:`https://...`})]})]})}),k(`Tipografia`,[`font`,`text`,`color`,`align`,`size`,`weight`,`transform`,`decoration`])&&(0,r.jsx)(hP,{title:`Tipografia`,isOpen:g.typography,onToggle:()=>w(`typography`),onReset:()=>O([`fontFamily`,`fontSize`,`fontWeight`,`color`,`textAlign`,`fontStyle`,`textDecoration`,`textTransform`,`lineHeight`,`letterSpacing`]),children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Família da Fonte`}),(0,r.jsxs)(Wy,{value:M,onValueChange:e=>D({fontFamily:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`},placeholder:`Selecione...`}),(0,r.jsx)(Ky,{style:{zIndex:1e5},children:N.map(e=>(0,r.jsx)(Y,{value:e,children:e},e))})]})]}),(0,r.jsx)(gP,{label:`Tamanho`,value:j(`fontSize`,`16px`),onChange:e=>D({fontSize:e})}),(0,r.jsx)(gP,{label:`Altura da Linha`,value:j(`lineHeight`,`normal`),onChange:e=>D({lineHeight:e}),units:[``,`px`,`em`,`%`],placeholder:`Normal`}),(0,r.jsx)(gP,{label:`Espaçamento`,value:j(`letterSpacing`,`normal`),onChange:e=>D({letterSpacing:e}),units:[`px`,`em`],placeholder:`Normal`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Peso`}),(0,r.jsxs)(Wy,{value:P(),onValueChange:e=>D({fontWeight:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`},placeholder:`Normal`}),(0,r.jsxs)(Ky,{style:{zIndex:1e5},children:[(0,r.jsx)(Y,{value:`100`,children:`100 - Thin`}),(0,r.jsx)(Y,{value:`300`,children:`300 - Light`}),(0,r.jsx)(Y,{value:`400`,children:`400 - Normal`}),(0,r.jsx)(Y,{value:`500`,children:`500 - Medium`}),(0,r.jsx)(Y,{value:`600`,children:`600 - Semi Bold`}),(0,r.jsx)(Y,{value:`700`,children:`700 - Bold`}),(0,r.jsx)(Y,{value:`900`,children:`900 - Black`}),(0,r.jsx)(Y,{value:`normal`,children:`Normal`}),(0,r.jsx)(Y,{value:`bold`,children:`Bold`})]})]})]}),(0,r.jsx)(U,{style:{gridColumn:`span 2`},children:(0,r.jsxs)(W,{justify:`between`,align:`center`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Estilo`}),(0,r.jsxs)(W,{gap:`1`,children:[(0,r.jsx)(J,{variant:j(`fontStyle`)===`italic`?`solid`:`soft`,onClick:()=>D({fontStyle:j(`fontStyle`)===`italic`?`normal`:`italic`}),children:(0,r.jsx)(Ke,{})}),(0,r.jsx)(J,{variant:j(`textDecoration`)===`underline`?`solid`:`soft`,onClick:()=>D({textDecoration:j(`textDecoration`)===`underline`?`none`:`underline`}),children:(0,r.jsx)(Qt,{})}),(0,r.jsx)(J,{variant:j(`textDecoration`)===`line-through`?`solid`:`soft`,onClick:()=>D({textDecoration:j(`textDecoration`)===`line-through`?`none`:`line-through`}),children:(0,r.jsx)(Pt,{})})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Transformação`}),(0,r.jsxs)(Wy,{value:j(`textTransform`,`none`),onValueChange:e=>D({textTransform:e}),children:[(0,r.jsx)(Gy,{style:{width:100}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`none`,children:`Nenhum`}),(0,r.jsx)(Y,{value:`uppercase`,children:`MAIÚSCULA`}),(0,r.jsx)(Y,{value:`lowercase`,children:`minúscula`}),(0,r.jsx)(Y,{value:`capitalize`,children:`Capitalizada`})]})]})]})]})}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Alinhamento`}),(0,r.jsxs)(Ly,{value:j(`textAlign`,`left`),onValueChange:e=>D({textAlign:e}),children:[(0,r.jsx)(Ry,{value:`left`,children:(0,r.jsx)(Wt,{})}),(0,r.jsx)(Ry,{value:`center`,children:(0,r.jsx)(Bt,{})}),(0,r.jsx)(Ry,{value:`right`,children:(0,r.jsx)(Kt,{})}),(0,r.jsx)(Ry,{value:`justify`,children:(0,r.jsx)(Ht,{})})]})]}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor do Texto`}),(0,r.jsx)(tP,{color:j(`color`,`#000000`),onChange:e=>D({color:e})})]})]})}),k(`Aparência`,[`background`,`opacity`,`blend`,`cursor`])&&(0,r.jsxs)(hP,{title:`Aparência`,isOpen:g.appearance,onToggle:()=>w(`appearance`),onReset:()=>O([`backgroundColor`,`backgroundImage`,`backgroundSize`,`opacity`,`mixBlendMode`,`cursor`]),children:[(0,r.jsxs)(sb,{defaultValue:`solid`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`solid`,children:`Sólido`}),(0,r.jsx)(lb,{value:`gradient`,children:`Gradiente`}),(0,r.jsx)(lb,{value:`image`,children:`Imagem`})]}),(0,r.jsxs)(U,{pt:`3`,children:[(0,r.jsxs)(ub,{value:`solid`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor de Fundo`}),(0,r.jsx)(tP,{color:j(`backgroundColor`,`transparent`),onChange:e=>D({backgroundColor:e,backgroundImage:`none`})})]}),(0,r.jsxs)(ub,{value:`gradient`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`CSS Gradient`}),(0,r.jsx)(pb,{value:j(`backgroundImage`,``),onChange:e=>D({backgroundImage:e.target.value}),placeholder:`linear-gradient(to right, red, blue)`,rows:3})]}),(0,r.jsxs)(ub,{value:`image`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`URL da Imagem`}),(0,r.jsx)(X,{value:j(`backgroundImage`,``).replace(/url\(['"]?(.*?)['"]?\)/,`$1`),onChange:e=>D({backgroundImage:`url('${e.target.value}')`}),placeholder:`https://...`,mb:`2`}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Tamanho`}),(0,r.jsxs)(Wy,{value:j(`backgroundSize`,`auto`),onValueChange:e=>D({backgroundSize:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`auto`,children:`Auto`}),(0,r.jsx)(Y,{value:`cover`,children:`Cobrir (Cover)`}),(0,r.jsx)(Y,{value:`contain`,children:`Conter (Contain)`}),(0,r.jsx)(Y,{value:`100% 100%`,children:`Esticar`})]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Repetição`}),(0,r.jsxs)(Wy,{value:j(`backgroundRepeat`,`repeat`),onValueChange:e=>D({backgroundRepeat:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`repeat`,children:`Repetir`}),(0,r.jsx)(Y,{value:`no-repeat`,children:`Não Repetir`}),(0,r.jsx)(Y,{value:`repeat-x`,children:`Horizontal`}),(0,r.jsx)(Y,{value:`repeat-y`,children:`Vertical`})]})]})]})]})]})]})]}),(0,r.jsxs)(U,{mt:`3`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Opacidade`}),(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(tb,{min:0,max:1,step:.05,value:[parseFloat(j(`opacity`,`1`))],onValueChange:([e])=>D({opacity:e}),style:{flex:1}}),(0,r.jsxs)(H,{size:`1`,children:[Math.round(parseFloat(j(`opacity`,`1`))*100),`%`]})]})]}),(0,r.jsxs)(K,{columns:`2`,gap:`3`,mt:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Blend Mode`}),(0,r.jsxs)(Wy,{value:j(`mixBlendMode`,`normal`),onValueChange:e=>D({mixBlendMode:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`normal`,children:`Normal`}),(0,r.jsx)(Y,{value:`multiply`,children:`Multiply`}),(0,r.jsx)(Y,{value:`screen`,children:`Screen`}),(0,r.jsx)(Y,{value:`overlay`,children:`Overlay`}),(0,r.jsx)(Y,{value:`darken`,children:`Darken`}),(0,r.jsx)(Y,{value:`lighten`,children:`Lighten`})]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cursor`}),(0,r.jsxs)(Wy,{value:j(`cursor`,`auto`),onValueChange:e=>D({cursor:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`auto`,children:`Auto`}),(0,r.jsx)(Y,{value:`default`,children:`Padrão`}),(0,r.jsx)(Y,{value:`pointer`,children:`Mãozinha`}),(0,r.jsx)(Y,{value:`text`,children:`Texto`}),(0,r.jsx)(Y,{value:`move`,children:`Mover`}),(0,r.jsx)(Y,{value:`not-allowed`,children:`Bloqueado`})]})]})]})]})]}),k(`Layout`,[`width`,`height`,`x`,`y`,`z-index`,`overflow`])&&(0,r.jsx)(hP,{title:`Layout & Dimensões`,isOpen:g.layout,onToggle:()=>w(`layout`),onReset:()=>T({width:100,height:100,x:0,y:0,style:{...m.style,zIndex:void 0,overflow:void 0}}),children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsx)(gP,{label:`Largura`,value:m.width,onChange:e=>T({width:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Altura`,value:m.height,onChange:e=>T({height:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Posição X`,value:m.x,onChange:e=>T({x:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Posição Y`,value:m.y,onChange:e=>T({y:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Z-Index`,value:j(`zIndex`,`auto`),onChange:e=>D({zIndex:e===``?void 0:parseInt(e)}),units:[``],placeholder:`Auto`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Overflow`}),(0,r.jsxs)(Wy,{value:j(`overflow`,`visible`),onValueChange:e=>D({overflow:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`visible`,children:`Visível`}),(0,r.jsx)(Y,{value:`hidden`,children:`Oculto`}),(0,r.jsx)(Y,{value:`scroll`,children:`Scroll`}),(0,r.jsx)(Y,{value:`auto`,children:`Auto`})]})]})]})]})}),k(`Espaçamento`,[`padding`,`margin`])&&(0,r.jsxs)(hP,{title:`Espaçamento (Margin/Padding)`,isOpen:g.spacing,onToggle:()=>w(`spacing`),onReset:()=>O([`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`]),children:[(0,r.jsx)(U,{mb:`3`,children:(0,r.jsx)(_P,{label:`Padding (Interno)`,values:{top:j(`paddingTop`,j(`padding`)),right:j(`paddingRight`,j(`padding`)),bottom:j(`paddingBottom`,j(`padding`)),left:j(`paddingLeft`,j(`padding`))},onChange:e=>{e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?D({padding:e.top,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0}):D({padding:void 0,paddingTop:e.top,paddingRight:e.right,paddingBottom:e.bottom,paddingLeft:e.left})}})}),(0,r.jsx)(U,{children:(0,r.jsx)(_P,{label:`Margin (Externo)`,values:{top:j(`marginTop`,j(`margin`)),right:j(`marginRight`,j(`margin`)),bottom:j(`marginBottom`,j(`margin`)),left:j(`marginLeft`,j(`margin`))},onChange:e=>{e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?D({margin:e.top,marginTop:void 0,marginRight:void 0,marginBottom:void 0,marginLeft:void 0}):D({margin:void 0,marginTop:e.top,marginRight:e.right,marginBottom:e.bottom,marginLeft:e.left})}})})]}),k(`Bordas`,[`border`,`radius`,`stroke`])&&(0,r.jsxs)(hP,{title:`Bordas & Cantos`,isOpen:g.borders,onToggle:()=>w(`borders`),onReset:()=>O([`border`,`borderWidth`,`borderStyle`,`borderColor`,`borderRadius`,`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`]),children:[(0,r.jsxs)(sb,{defaultValue:`all`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`all`,children:(0,r.jsx)(te,{})}),(0,r.jsx)(lb,{value:`top`,children:(0,r.jsx)(ce,{})}),(0,r.jsx)(lb,{value:`right`,children:(0,r.jsx)(oe,{})}),(0,r.jsx)(lb,{value:`bottom`,children:(0,r.jsx)(ne,{})}),(0,r.jsx)(lb,{value:`left`,children:(0,r.jsx)(ie,{})})]}),(0,r.jsx)(U,{pt:`3`,children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Estilo`}),(0,r.jsxs)(Wy,{value:j(`borderStyle`,`none`),onValueChange:e=>D({borderStyle:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`none`,children:`Nenhuma`}),(0,r.jsx)(Y,{value:`solid`,children:`Sólida`}),(0,r.jsx)(Y,{value:`dashed`,children:`Tracejada`}),(0,r.jsx)(Y,{value:`dotted`,children:`Pontilhada`}),(0,r.jsx)(Y,{value:`double`,children:`Dupla`})]})]})]}),(0,r.jsx)(gP,{label:`Espessura`,value:j(`borderWidth`,`0px`),onChange:e=>D({borderWidth:e})}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor`}),(0,r.jsx)(tP,{color:j(`borderColor`,`#000000`),onChange:e=>D({borderColor:e})})]})]})})]}),(0,r.jsx)(U,{mt:`3`,children:(0,r.jsx)(_P,{label:`Arredondamento (Radius)`,values:{top:j(`borderTopLeftRadius`,j(`borderRadius`)),right:j(`borderTopRightRadius`,j(`borderRadius`)),bottom:j(`borderBottomRightRadius`,j(`borderRadius`)),left:j(`borderBottomLeftRadius`,j(`borderRadius`))},onChange:e=>{e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?D({borderRadius:e.top,borderTopLeftRadius:void 0,borderTopRightRadius:void 0,borderBottomRightRadius:void 0,borderBottomLeftRadius:void 0}):D({borderRadius:void 0,borderTopLeftRadius:e.top,borderTopRightRadius:e.right,borderBottomRightRadius:e.bottom,borderBottomLeftRadius:e.left})}})})]}),k(`Efeitos`,[`shadow`,`sombra`])&&(0,r.jsx)(hP,{title:`Efeitos (Sombra)`,isOpen:g.effects,onToggle:()=>w(`effects`),onReset:()=>O([`boxShadow`,`textShadow`]),children:(0,r.jsxs)(sb,{defaultValue:`box`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`box`,children:`Box Shadow`}),(0,r.jsx)(lb,{value:`text`,children:`Text Shadow`})]}),(0,r.jsxs)(U,{pt:`3`,children:[(0,r.jsx)(ub,{value:`box`,children:(0,r.jsxs)(U,{p:`2`,style:{backgroundColor:`var(--gray-3)`,borderRadius:`var(--radius-2)`},children:[(0,r.jsxs)(W,{justify:`between`,mb:`2`,children:[(0,r.jsx)(H,{size:`1`,weight:`bold`,children:`Box Shadow`}),(0,r.jsxs)(W,{gap:`2`,align:`center`,children:[(0,r.jsx)(H,{size:`1`,children:`Inset`}),(0,r.jsx)(`input`,{type:`checkbox`,checked:I.inset,onChange:e=>re({inset:e.target.checked})})]})]}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,mb:`2`,children:[(0,r.jsx)(gP,{label:`X`,value:I.x,onChange:e=>re({x:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Y`,value:I.y,onChange:e=>re({y:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Blur`,value:I.blur,onChange:e=>re({blur:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Spread`,value:I.spread,onChange:e=>re({spread:parseFloat(e)}),units:[`px`]})]}),(0,r.jsx)(tP,{color:I.color,onChange:e=>re({color:e})})]})}),(0,r.jsx)(ub,{value:`text`,children:(0,r.jsxs)(U,{p:`2`,style:{backgroundColor:`var(--gray-3)`,borderRadius:`var(--radius-2)`},children:[(0,r.jsx)(H,{size:`1`,weight:`bold`,mb:`2`,as:`div`,children:`Text Shadow`}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,mb:`2`,children:[(0,r.jsx)(gP,{label:`X`,value:F(j(`textShadow`,`none`)).x,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${e}px ${t.y}px ${t.blur}px ${t.color}`})},units:[`px`]}),(0,r.jsx)(gP,{label:`Y`,value:F(j(`textShadow`,`none`)).y,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${t.x}px ${e}px ${t.blur}px ${t.color}`})},units:[`px`]}),(0,r.jsx)(gP,{label:`Blur`,value:F(j(`textShadow`,`none`)).blur,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${t.x}px ${t.y}px ${e}px ${t.color}`})},units:[`px`]})]}),(0,r.jsx)(tP,{color:F(j(`textShadow`,`none`)).color,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${t.x}px ${t.y}px ${t.blur}px ${e}`})}})]})})]})]})}),k(`Transform`,[`scale`,`rotate`,`skew`,`translate`])&&(0,r.jsx)(hP,{title:`Transformação`,isOpen:g.transform,onToggle:()=>w(`transform`),onReset:()=>T({rotation:0,style:{...m.style,transform:void 0}}),children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsx)(gP,{label:`Rotação (deg)`,value:m.rotation,onChange:e=>T({rotation:parseFloat(e)}),units:[`deg`]}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Transform CSS (Scale, Skew, Translate)`}),(0,r.jsx)(X,{value:j(`transform`,``),onChange:e=>D({transform:e.target.value}),placeholder:`ex: scale(1.5) skewX(10deg)`}),(0,r.jsxs)(H,{size:`1`,color:`gray`,mt:`1`,children:[`Use sintaxe CSS padrão. Ex: `,(0,r.jsx)(`code`,{children:`scale(1.2)`}),`, `,(0,r.jsx)(`code`,{children:`skewY(10deg)`})]})]})]})}),!h&&(0,r.jsxs)(r.Fragment,{children:[k(`Animação`,[`animation`])&&(0,r.jsx)(hP,{title:`Animação`,isOpen:g.animation,onToggle:()=>w(`animation`),onReset:()=>T({animation:void 0}),children:(0,r.jsx)(rP,{element:m,updateElement:i})}),k(`Regras`,[`condition`])&&(0,r.jsx)(hP,{title:`Regras Condicionais`,isOpen:g.conditions,onToggle:()=>w(`conditions`),onReset:()=>T({conditions:[]}),children:(0,r.jsx)(mP,{element:m,updateElement:i,availableProps:e.availableProps||[]})}),k(`Formatação`,[`format`])&&(0,r.jsx)(hP,{title:`Formatação`,isOpen:g.formatting,onToggle:()=>w(`formatting`),onReset:()=>T({formatting:void 0}),children:(0,r.jsx)(iP,{element:m,updateElement:i})})]})]},m?.id??d.join(`,`))]})})};var xP=20,SP=`#f5f5f5`,CP=`#999`;let wP=({orientation:e})=>{let{state:n}=rS(),{zoom:i,pan:a}=n,o=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let t=o.current;if(!t)return;let n=t.getContext(`2d`);if(!n)return;let r=t.width,s=t.height;n.fillStyle=SP,n.fillRect(0,0,r,s),n.fillStyle=CP,n.font=`10px sans-serif`,n.strokeStyle=CP,n.lineWidth=1;let c=e===`horizontal`?-a.x/i:-a.y/i,l=e===`horizontal`?(r-a.x)/i:(s-a.y)/i,u=100;u=i>2?10:i>.8?50:i>.4?100:200;let d=Math.floor(c/u)*u;n.beginPath();for(let t=d;t<l;t+=u){let r=t*i+(e===`horizontal`?a.x:a.y);e===`horizontal`?(n.moveTo(r,0),n.lineTo(r,xP),n.fillText(t.toString(),r+2,10)):(n.moveTo(0,r),n.lineTo(xP,r),n.save(),n.translate(10,r+2),n.rotate(-Math.PI/2),n.fillText(t.toString(),0,0),n.restore())}n.stroke()},[i,a,e,n.canvasHeight]),(0,t.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{let t=e.parentElement?.getBoundingClientRect();t&&(e.width=t.width,e.height=t.height)});return e.parentElement&&t.observe(e.parentElement),()=>t.disconnect()},[]),(0,r.jsx)(`canvas`,{ref:o,style:{width:`100%`,height:`100%`,display:`block`,pointerEvents:`none`}})};var TP=({icon:e,label:n,keys:i})=>(0,r.jsxs)(W,{align:`center`,justify:`between`,py:`2`,children:[(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(U,{style:{color:`var(--gray-10)`},children:(0,r.jsx)(e,{})}),(0,r.jsx)(H,{size:`2`,children:n})]}),(0,r.jsx)(W,{gap:`1`,children:i.map((e,n)=>(0,r.jsxs)(t.default.Fragment,{children:[(0,r.jsx)(Ey,{children:e}),n<i.length-1&&(0,r.jsx)(H,{size:`1`,color:`gray`,children:`+`})]},n))})]});let EP=()=>(0,r.jsxs)(ny,{children:[(0,r.jsx)(ry,{children:(0,r.jsxs)(G,{variant:`solid`,color:`amber`,radius:`full`,style:{height:36,padding:`0 14px`,boxShadow:`0 4px 6px rgba(0,0,0,0.1)`},title:`Atalhos de Teclado`,children:[(0,r.jsx)(gt,{width:`18`,height:`18`}),`Ajuda`]})}),(0,r.jsxs)(iy,{style:{maxWidth:700},onPointerDown:e=>e.stopPropagation(),children:[(0,r.jsx)(ay,{children:`Atalhos de Teclado`}),(0,r.jsx)(H,{size:`2`,color:`gray`,mb:`4`,as:`p`,children:`Agilize seu fluxo de trabalho com estes atalhos.`}),(0,r.jsxs)(K,{columns:{initial:`1`,sm:`2`},gap:`6`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,color:`blue`,children:`Edição Básica`}),(0,r.jsx)(Qy,{size:`4`,mb:`2`}),(0,r.jsx)(TP,{icon:It,label:`Desfazer`,keys:[`Ctrl`,`Z`]}),(0,r.jsx)(TP,{icon:It,label:`Refazer`,keys:[`Ctrl`,`Y`]}),(0,r.jsx)(TP,{icon:Se,label:`Copiar`,keys:[`Ctrl`,`C`]}),(0,r.jsx)(TP,{icon:Se,label:`Colar`,keys:[`Ctrl`,`V`]}),(0,r.jsx)(TP,{icon:Xt,label:`Excluir`,keys:[`Delete`]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,color:`blue`,children:`Navegação e Seleção`}),(0,r.jsx)(Qy,{size:`4`,mb:`2`}),(0,r.jsx)(TP,{icon:ut,label:`Mover Elemento`,keys:[`Setas`]}),(0,r.jsx)(TP,{icon:ut,label:`Mover Rápido`,keys:[`Shift`,`Setas`]}),(0,r.jsx)(TP,{icon:Oe,label:`Multiseleção`,keys:[`Shift`,`Click`]}),(0,r.jsx)(TP,{icon:wt,label:`Mover Canvas (Pan)`,keys:[`Espaço`,`Arrastar`]}),(0,r.jsx)(TP,{icon:ot,label:`Zoom`,keys:[`Ctrl`,`Scroll`]})]})]}),(0,r.jsx)(W,{justify:`end`,mt:`5`,children:(0,r.jsx)(sy,{children:(0,r.jsx)(G,{variant:`soft`,color:`gray`,children:`Fechar`})})})]})]}),DP=()=>{let{state:e,updateListSettings:n,setCanvasHeight:i,setGridSize:a}=rS(),[o,s]=(0,t.useState)(!1),[c,l]=(0,t.useState)(``),[u,d]=(0,t.useState)(`asc`),[f,p]=(0,t.useState)(`bottom`),[m,h]=(0,t.useState)(`down`),[g,_]=(0,t.useState)(`150`),[v,y]=(0,t.useState)(``),[b,x]=(0,t.useState)(`0`),[S,C]=(0,t.useState)(`slideIn`),[w,T]=(0,t.useState)(.3),[E,D]=(0,t.useState)(`ease-out`);return(0,t.useEffect)(()=>{if(o){l(e.listSettings.sortProp||`__none__`),d(e.listSettings.sortOrder||`asc`),p(e.listSettings.newestPosition||`bottom`),h(e.listSettings.scrollDirection||`down`),y(e.listSettings.containerHeight?String(e.listSettings.containerHeight):``),_(String(e.canvasHeight||150)),x(String(e.gridSize||0));let t=e.listSettings.entryAnimation;C(t?.type||`slideIn`),T(t?.duration||.3),D(t?.timingFunction||`ease-out`)}},[o,e.listSettings,e.canvasHeight,e.gridSize]),(0,t.useEffect)(()=>{if(!o)return;let t=parseInt(g,10);!isNaN(t)&&t>0&&e.canvasHeight!==t&&i(t);let n=parseInt(b,10);!isNaN(n)&&n>=0&&e.gridSize!==n&&a(n)},[g,b,o,i,a,e.canvasHeight,e.gridSize]),(0,r.jsxs)(ny,{open:o,onOpenChange:s,children:[(0,r.jsx)(ry,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`center`,cursor:`pointer`},children:[(0,r.jsx)(Je,{}),` Configurações`]})}),(0,r.jsxs)(iy,{style:{maxWidth:600},children:[(0,r.jsx)(ay,{children:`Configurações do Editor`}),(0,r.jsx)(oy,{size:`2`,mb:`4`,children:`Configure o comportamento da lista.`}),(0,r.jsx)(U,{pt:`3`,children:(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Ordenação`}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Propriedade para Ordenar`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[c===`__none__`?`(Nenhum)`:e.availableProps.find(e=>e.dataName===c)?.name||c,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>l(`__none__`),children:`(Nenhum)`}),e.availableProps.map(e=>(0,r.jsx)(q,{onSelect:()=>l(e.dataName),children:e.name},e.dataName))]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Direção`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:150,justifyContent:`space-between`},children:[u===`asc`?`Crescente (A-Z)`:`Decrescente (Z-A)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>d(`asc`),children:`Crescente (A-Z)`}),(0,r.jsx)(q,{onSelect:()=>d(`desc`),children:`Decrescente (Z-A)`})]})]})]})]}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Posição do Recente`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[f===`top`?`Topo (Início)`:`Base (Final)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>p(`top`),children:`Topo (Início)`}),(0,r.jsx)(q,{onSelect:()=>p(`bottom`),children:`Base (Final)`})]})]})]}),(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Comportamento de Rolagem`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[m===`down`?`Descer (Padrão)`:`Subir (Chat)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>h(`down`),children:`Descer (Padrão)`}),(0,r.jsx)(q,{onSelect:()=>h(`up`),children:`Subir (Chat)`})]})]})]})]}),(0,r.jsx)(H,{size:`2`,weight:`bold`,mt:`2`,children:`Dimensões`}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Altura do Item (Template) (px)`}),(0,r.jsx)(X,{type:`number`,min:`10`,value:g,onChange:e=>_(e.target.value)}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Altura de cada item individual na lista.`})]}),(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Altura da Lista (Container) (px)`}),(0,r.jsx)(X,{type:`number`,min:`0`,placeholder:`Auto (100%)`,value:v,onChange:e=>y(e.target.value)}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Altura total da lista. Se exceder, rola. Vazio = 100%.`})]})]}),(0,r.jsx)(H,{size:`2`,weight:`bold`,mt:`2`,children:`Animação de Entrada na Lista`}),(0,r.jsxs)(K,{columns:`3`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Efeito`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[S===`slideIn`?`Slide (Padrão)`:S===`smoothSlideUp`?`Slide Suave (Up)`:S===`fadeIn`?`Fade In`:S===`popIn`?`Pop In`:S===`blurIn`?`Blur In`:S===`slideInLeft`?`Slide (Esq)`:S===`slideInRight`?`Slide (Dir)`:S===`zoomIn`?`Zoom In`:S===`bounceIn`?`Bounce`:`Nenhum`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>C(`none`),children:`Nenhum`}),(0,r.jsx)(q,{onSelect:()=>C(`slideIn`),children:`Slide (Padrão)`}),(0,r.jsx)(q,{onSelect:()=>C(`smoothSlideUp`),children:`Slide Suave (Up)`}),(0,r.jsx)(q,{onSelect:()=>C(`fadeIn`),children:`Fade In`}),(0,r.jsx)(q,{onSelect:()=>C(`popIn`),children:`Pop In`}),(0,r.jsx)(q,{onSelect:()=>C(`blurIn`),children:`Blur In`}),(0,r.jsx)(q,{onSelect:()=>C(`slideInLeft`),children:`Slide (Esq)`}),(0,r.jsx)(q,{onSelect:()=>C(`slideInRight`),children:`Slide (Dir)`}),(0,r.jsx)(q,{onSelect:()=>C(`zoomIn`),children:`Zoom In`}),(0,r.jsx)(q,{onSelect:()=>C(`bounceIn`),children:`Bounce`})]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Duração (s)`}),(0,r.jsx)(X,{type:`number`,step:`0.1`,min:`0.1`,value:w,onChange:e=>T(parseFloat(e.target.value)||.3)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Curva (Easing)`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[E===`ease-out`?`Ease Out`:E===`linear`?`Linear`:E===`bounce`?`Bounce`:`Ease`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>D(`ease`),children:`Ease`}),(0,r.jsx)(q,{onSelect:()=>D(`ease-out`),children:`Ease Out`}),(0,r.jsx)(q,{onSelect:()=>D(`linear`),children:`Linear`}),(0,r.jsx)(q,{onSelect:()=>D(`bounce`),children:`Bounce`})]})]})]})]}),(0,r.jsxs)(U,{mt:`2`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Grid Snapping (Travar)`}),(0,r.jsx)(W,{gap:`3`,align:`center`,mt:`2`,children:(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Tamanho do Grid (px) - 0 para desativar`}),(0,r.jsx)(X,{type:`number`,value:b,onChange:e=>x(e.target.value),placeholder:`0`})]})})]})]})}),(0,r.jsxs)(W,{gap:`3`,mt:`4`,justify:`end`,children:[(0,r.jsx)(sy,{children:(0,r.jsx)(G,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(sy,{children:(0,r.jsx)(G,{onClick:()=>{let e=parseInt(v,10),t=parseInt(g,10),r=parseInt(b,10),o={type:S,duration:Number(w),delay:0,timingFunction:E};n({sortProp:c===`__none__`?``:c,sortOrder:u,newestPosition:f,scrollDirection:m,containerHeight:!isNaN(e)&&e>0?e:void 0,entryAnimation:o}),!isNaN(t)&&t>0&&i(t),!isNaN(r)&&r>=0&&a(r),s(!1)},children:`Salvar Alterações`})})]})]})]})},OP=({onClose:e})=>{let{state:t,jumpToHistory:n,undo:i,redo:a}=rS(),o=t=>{n(t),e&&e()};return(0,r.jsxs)(W,{direction:`column`,style:{width:`100%`},children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,p:`2`,style:{borderBottom:`1px solid var(--gray-5)`},children:[(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(vt,{}),(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Histórico`})]}),(0,r.jsxs)(W,{gap:`2`,children:[(0,r.jsx)(G,{size:`1`,variant:`soft`,onClick:i,disabled:t.historyIndex<=0,children:`Desfazer`}),(0,r.jsx)(G,{size:`1`,variant:`soft`,onClick:a,disabled:t.historyIndex>=t.history.length-1,children:`Refazer`})]})]}),(0,r.jsx)(U,{p:`0`,children:t.history.map((e,n)=>{let i=n===t.historyIndex,a=n>t.historyIndex,s=t.historyDescriptions?.[n]||(n===0?`Estado Inicial`:`Alteração ${n}`);return(0,r.jsx)(U,{p:`2`,style:{backgroundColor:i?`var(--accent-3)`:`transparent`,opacity:a?.5:1,cursor:`pointer`,borderBottom:`1px solid var(--gray-3)`},onClick:()=>o(n),className:`history-item`,children:(0,r.jsxs)(W,{align:`center`,justify:`between`,children:[(0,r.jsx)(H,{size:`2`,weight:i?`bold`:`regular`,children:s}),i&&(0,r.jsx)(H,{size:`1`,color:`blue`,children:`Atual`})]})},n)})})]})};function kP(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return(0,t.useMemo)(()=>e=>{n.forEach(t=>t(e))},n)}var AP=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function jP(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function MP(e){return`nodeType`in e}function NP(e){return e?jP(e)?e:MP(e)?e.ownerDocument?.defaultView??window:window:window}function PP(e){let{Document:t}=NP(e);return e instanceof t}function FP(e){return jP(e)?!1:e instanceof NP(e).HTMLElement}function IP(e){return e instanceof NP(e).SVGElement}function LP(e){return e?jP(e)?e.document:MP(e)?PP(e)?e:FP(e)||IP(e)?e.ownerDocument:document:document:document}var RP=AP?t.useLayoutEffect:t.useEffect;function zP(e){let n=(0,t.useRef)(e);return RP(()=>{n.current=e}),(0,t.useCallback)(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.current==null?void 0:n.current(...t)},[])}function BP(){let e=(0,t.useRef)(null);return[(0,t.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,t.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function VP(e,n){n===void 0&&(n=[e]);let r=(0,t.useRef)(e);return RP(()=>{r.current!==e&&(r.current=e)},n),r}function HP(e,n){let r=(0,t.useRef)();return(0,t.useMemo)(()=>{let t=e(r.current);return r.current=t,t},[...n])}function UP(e){let n=zP(e),r=(0,t.useRef)(null);return[r,(0,t.useCallback)(e=>{e!==r.current&&n?.(e,r.current),r.current=e},[])]}function WP(e){let n=(0,t.useRef)();return(0,t.useEffect)(()=>{n.current=e},[e]),n.current}var GP={};function KP(e,n){return(0,t.useMemo)(()=>{if(n)return n;let t=GP[e]==null?0:GP[e]+1;return GP[e]=t,e+`-`+t},[e,n])}function qP(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var JP=qP(1),YP=qP(-1);function XP(e){return`clientX`in e&&`clientY`in e}function ZP(e){if(!e)return!1;let{KeyboardEvent:t}=NP(e.target);return t&&e instanceof t}function QP(e){if(!e)return!1;let{TouchEvent:t}=NP(e.target);return t&&e instanceof t}function $P(e){if(QP(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return XP(e)?{x:e.clientX,y:e.clientY}:null}var eF=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[eF.Translate.toString(e),eF.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),tF=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function nF(e){return e.matches(tF)?e:e.querySelector(tF)}var rF={display:`none`};function iF(e){let{id:n,value:r}=e;return t.default.createElement(`div`,{id:n,style:rF},r)}function aF(e){let{id:n,announcement:r,ariaLiveType:i=`assertive`}=e;return t.default.createElement(`div`,{id:n,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":i,"aria-atomic":!0},r)}function oF(){let[e,n]=(0,t.useState)(``);return{announce:(0,t.useCallback)(e=>{e!=null&&n(e)},[]),announcement:e}}var sF=(0,t.createContext)(null);function cF(e){let n=(0,t.useContext)(sF);(0,t.useEffect)(()=>{if(!n)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return n(e)},[e,n])}function lF(){let[e]=(0,t.useState)(()=>new Set),n=(0,t.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,t.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),n]}var uF={draggable:`
|
|
57
|
+
`).length-1;return c+=l,Math.ceil(c*r*i)};let lN=(e,t)=>{let n=e.map(e=>({...e})),r=new Map(e.map(e=>[e.id,e])),i=[];n.forEach(e=>{let a=e.type===`text`,o=e.type===`text-container`;if((a||o)&&e.autoGrow){let a=e.content;t&&(a=a.replace(/\{\{(.*?)\}\}/g,(n,r)=>{let i=t[r.trim()];return i==null?n:e.formatting?jS(i,e.formatting):String(i)}));let s=parseInt(String(e.style?.fontSize||16)),c=String(e.style?.fontFamily||`Arial`);if(o&&e.containerExpansion===`horizontal`){let t=document.createElement(`canvas`).getContext(`2d`);if(t){t.font=`${s}px ${c}`;let n=t.measureText(a),r=Math.ceil(n.width+parseInt(String(e.style?.padding||0))*2);Math.abs(r-e.width)>1&&(e.width=r,e.content=a)}}else{let t=cN(a,e.width,c,s),o=e.height,l=t-o;if(Math.abs(l)>1){e.height=t,e.content=a;let s=[],c=r.get(e.id);c&&n.forEach(t=>{if(t.id===e.id)return;let n=r.get(t.id);n&&sN(c,n)&&s.push(t)});let u=new Set([e.id]);s.forEach(e=>{e.height+=l,u.add(e.id)}),i.push({triggerY:e.y+o,delta:l,ignoreIds:u})}}}}),n.forEach(e=>{let t=r.get(e.id);if(!t)return;let n=0;i.forEach(r=>{r.ignoreIds.has(e.id)||t.y>=r.triggerY-.1&&(n+=r.delta)}),e.y+=n});let a=0;return n.forEach(e=>{let t=e.y+e.height;t>a&&(a=t)}),{elements:n,totalHeight:a}};var uN=e=>{switch(e){case`linear`:return`linear`;case`ease-in`:return`easeIn`;case`ease-out`:return`easeOut`;case`ease-in-out`:return`easeInOut`;case`bounce`:return`easeOut`;case`ease`:return`easeInOut`;default:return`easeOut`}},dN=e=>{if(!e||e.type===`none`)return{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1}};let t={initial:{},animate:{}};switch(e.type){case`fadeIn`:t.initial={opacity:0},t.animate={opacity:1};break;case`slideInLeft`:t.initial={opacity:0,x:-100},t.animate={opacity:1,x:0};break;case`slideInRight`:t.initial={opacity:0,x:100},t.animate={opacity:1,x:0};break;case`slideInUp`:t.initial={opacity:0,y:100},t.animate={opacity:1,y:0};break;case`slideInDown`:t.initial={opacity:0,y:-100},t.animate={opacity:1,y:0};break;case`zoomIn`:t.initial={opacity:0,scale:.5},t.animate={opacity:1,scale:1};break;case`bounceIn`:t.initial={opacity:0,scale:.3},t.animate={opacity:1,scale:1,transition:{type:`spring`,bounce:.6}};break;case`smoothSlideUp`:t.initial={opacity:0,y:30},t.animate={opacity:1,y:0};break;case`popIn`:t.initial={opacity:0,scale:.8,y:10},t.animate={opacity:1,scale:1,y:0};break;case`blurIn`:t.initial={opacity:0,filter:`blur(10px)`},t.animate={opacity:1,filter:`blur(0px)`};break;case`pulse`:t.animate={scale:[1,1.05,1]};break;case`shake`:t.animate={x:[0,-5,5,-5,5,0]};break;case`spin`:t.animate={rotate:360};break;default:t.initial={opacity:0,y:20},t.animate={opacity:1,y:0}}return t},fN=(e,t)=>{let n={duration:e?.duration||.4,ease:uN(e?.timingFunction),delay:e?.delay||0},r;e?.iterationCount===`infinite`?r=1/0:typeof e?.iterationCount==`number`&&e.iterationCount>1&&(r=e.iterationCount-1);let i=t?.animate?.transition;return i?{...n,...i,delay:n.delay,repeat:r??i.repeat}:r===void 0?n:{...n,repeat:r}},pN=({element:e,offsetY:n=0,dataContext:i,onSelect:a,isSelected:o})=>{let s=e.content;if(i){if(e.type===`text`||e.type===`text-container`)s=s.replace(/\{\{(.*?)\}\}/g,(t,n)=>{let r=i[n.trim()];return r==null?t:e.formatting?jS(r,e.formatting):String(r)});else if(e.type===`image`)if(e.dataBinding){let t=i[e.dataBinding];t!=null&&(s=String(t))}else s=s.replace(/\{\{(.*?)\}\}/g,(e,t)=>{let n=i[t.trim()];return n==null?e:String(n)})}let c={position:`absolute`,left:e.x,top:e.y+n,width:e.type===`text-container`&&e.autoGrow&&e.containerExpansion===`horizontal`?`max-content`:`${e.width}px`,height:e.autoGrow?`auto`:`${e.height}px`,transform:e.rotation?`rotate(${e.rotation}deg)`:void 0,padding:e.type===`image`||e.type===`text`||e.type===`text-container`?0:`8px`,overflow:e.autoGrow?`visible`:`hidden`,whiteSpace:e.type===`text-container`&&e.autoGrow&&e.containerExpansion===`horizontal`?`nowrap`:e.autoGrow?`pre-wrap`:void 0,wordBreak:e.autoGrow?`break-word`:void 0,outline:o?`2px solid var(--blue-9)`:void 0,zIndex:o?10:void 0,cursor:a?`pointer`:void 0,...e.style},l=e.animation&&e.animation.type!==`none`,u=t.default.useMemo(()=>l?dN(e.animation):null,[e.animation,l]),d=t.default.useMemo(()=>fN(e.animation,u),[e.animation,u]),f=(0,r.jsxs)(r.Fragment,{children:[(e.type===`text`||e.type===`text-container`)&&(0,r.jsx)(H,{style:{width:`100%`,height:`100%`,display:`block`},children:s}),e.type===`image`&&(s?(0,r.jsx)(`img`,{src:s,alt:`Element`,style:{width:`100%`,height:`100%`,objectFit:e.style?.objectFit||`cover`,display:`block`}}):(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,backgroundColor:`#eee`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(H,{size:`1`,children:`Imagem`})})),e.type===`box`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`}}),e.type===`checkbox`&&(0,r.jsx)(U,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,r.jsx)(`input`,{type:`checkbox`,checked:i&&e.dataBinding?i[e.dataBinding]===!0||String(i[e.dataBinding])===`true`:!1,readOnly:!0,style:{width:`100%`,height:`100%`,margin:0}})})]});return l&&u?(0,r.jsx)(oN.div,{variants:u,initial:`initial`,animate:`animate`,transition:d,style:c,onClick:t=>{t.stopPropagation(),a?.(e.id)},children:f}):(0,r.jsx)(U,{style:c,onClick:t=>{t.stopPropagation(),a?.(e.id)},children:f})},mN=({item:e,elements:n,animation:i,onSelect:a,selectedElementIds:o})=>{let{elements:s,totalHeight:c}=t.default.useMemo(()=>lN(n,e),[n,e]),l=t.default.useMemo(()=>dN(i),[i]),u=t.default.useMemo(()=>l.animate?.transition||{duration:i?.duration||.4,ease:uN(i?.timingFunction)},[i,l]);return(0,r.jsx)(oN.div,{layout:!0,variants:l,initial:`initial`,animate:`animate`,exit:{opacity:0,scale:.9},transition:u,whileHover:{scale:1.02,transition:{duration:.2}},style:{position:`relative`,height:c,width:`100%`,marginBottom:`20px`,transformOrigin:`center center`},children:s.map(t=>(0,r.jsx)(pN,{element:t,offsetY:0,dataContext:e,onSelect:a,isSelected:o?.includes(t.id)},t.id))})};let hN=()=>{let{state:e,setSelectedElements:n}=rS(),[i,a]=t.default.useState(!1),[o,s]=t.default.useState([]);return t.default.useEffect(()=>{let t;return i&&e.isList?(o.length===0&&s([{id:Date.now(),...e.mockData[0]||{}}]),t=setInterval(()=>{s(t=>{let n=t.length%(e.mockData.length||1),r={...e.mockData.length>0?e.mockData[n]:{id:t.length},id:`${Date.now()}-${t.length}`};return e.listSettings.newestPosition===`top`?[r,...t].slice(0,20):[...t,r].slice(-20)})},1500)):s([]),()=>clearInterval(t)},[i,e.isList,e.listSettings.newestPosition,e.mockData]),(0,r.jsxs)(U,{style:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,backgroundColor:`var(--color-panel-solid)`},children:[e.isList&&(0,r.jsx)(U,{style:{position:`absolute`,bottom:10,right:10,zIndex:100,backgroundColor:`var(--color-surface)`,padding:`4px`,borderRadius:`var(--radius-3)`,boxShadow:`0 2px 10px rgba(0,0,0,0.1)`},children:(0,r.jsxs)(G,{size:`1`,variant:i?`soft`:`solid`,color:i?`red`:`green`,onClick:()=>a(!i),children:[i?(0,r.jsx)(Mt,{}):(0,r.jsx)(ft,{}),i?`Parar Simulação`:`Simular Entrada`]})}),(0,r.jsx)(Xv,{type:`auto`,scrollbars:`vertical`,style:{height:`100%`,width:`100%`},children:(0,r.jsx)(U,{style:{position:`relative`,minHeight:`100%`,width:`100%`},children:(()=>{if(e.elements.length===0)return(0,r.jsx)(W,{align:`center`,justify:`center`,style:{height:`100%`},children:(0,r.jsx)(H,{color:`gray`,children:`Preview vazio`})});if(e.isList){let t=[];if(i)t=o;else{if(t=e.mockData.length>0?e.mockData:Array.from({length:10}).map((e,t)=>({id:t})),e.listSettings.sortProp){let n=e.listSettings.sortProp,r=e.listSettings.sortOrder===`asc`?1:-1;t=[...t].sort((e,t)=>{let i=e[n],a=t[n];return i<a?-1*r:i>a?1*r:0})}e.listSettings.newestPosition===`top`&&(t=[...t].reverse())}let a=e.listSettings.containerHeight;return(0,r.jsx)(U,{style:{width:`100%`,minHeight:a?`${a}px`:`100%`,height:a?`${a}px`:void 0,overflowY:a?`auto`:void 0,display:`flex`,flexDirection:`column`,justifyContent:e.listSettings.newestPosition===`top`?`flex-start`:`flex-end`,padding:16},children:(0,r.jsx)(WD,{mode:`popLayout`,children:t.map((t,i)=>(0,r.jsx)(mN,{item:t,elements:e.elements,animation:e.listSettings.entryAnimation,onSelect:e=>n([e]),selectedElementIds:e.selectedElementIds},t.id||i))})})}return(0,r.jsx)(r.Fragment,{children:e.elements.map(t=>(0,r.jsx)(pN,{element:t,dataContext:e.singleMockData,onSelect:e=>n([e]),isSelected:e.selectedElementIds.includes(t.id)},t.id))})})()})})]})};function gN(){return(gN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _N(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function vN(e){var n=(0,t.useRef)(e),r=(0,t.useRef)(function(e){n.current&&n.current(e)});return n.current=e,r.current}var yN=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},bN=function(e){return`touches`in e},xN=function(e){return e&&e.ownerDocument.defaultView||self},SN=function(e,t,n){var r=e.getBoundingClientRect(),i=bN(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:yN((i.pageX-(r.left+xN(e).pageXOffset))/r.width),top:yN((i.pageY-(r.top+xN(e).pageYOffset))/r.height)}},CN=function(e){!bN(e)&&e.preventDefault()},wN=t.default.memo(function(e){var n=e.onMove,r=e.onKey,i=_N(e,[`onMove`,`onKey`]),a=(0,t.useRef)(null),o=vN(n),s=vN(r),c=(0,t.useRef)(null),l=(0,t.useRef)(!1),u=(0,t.useMemo)(function(){var e=function(e){CN(e),(bN(e)?e.touches.length>0:e.buttons>0)&&a.current?o(SN(a.current,e,c.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=xN(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(CN(t),!function(e,t){return t&&!bN(e)}(t,l.current)&&r)){if(bN(t)){l.current=!0;var i=t.changedTouches||[];i.length&&(c.current=i[0].identifier)}r.focus(),o(SN(r,t,c.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},n]},[s,o]),d=u[0],f=u[1],p=u[2];return(0,t.useEffect)(function(){return p},[p]),t.default.createElement(`div`,gN({},i,{onTouchStart:d,onMouseDown:d,className:`react-colorful__interactive`,ref:a,onKeyDown:f,tabIndex:0,role:`slider`}))}),TN=function(e){return e.filter(Boolean).join(` `)},EN=function(e){var n=e.color,r=e.left,i=e.top,a=i===void 0?.5:i,o=TN([`react-colorful__pointer`,e.className]);return t.default.createElement(`div`,{className:o,style:{top:100*a+`%`,left:100*r+`%`}},t.default.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:n}}))},DN=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var ON=function(e){return LN(kN(e))},kN=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?DN(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?DN(parseInt(e.substring(6,8),16)/255,2):1}},AN=function(e){return IN(PN(e))},jN=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:DN(e.h),s:DN(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:DN(i/2),a:DN(r,2)}},MN=function(e){var t=jN(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},NN=function(e){var t=jN(e);return`hsla(`+t.h+`, `+t.s+`%, `+t.l+`%, `+t.a+`)`},PN=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:DN(255*[r,s,o,o,c,r][l]),g:DN(255*[c,r,r,s,o,o][l]),b:DN(255*[o,o,c,r,r,s][l]),a:DN(i,2)}},FN=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},IN=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?FN(DN(255*i)):``;return`#`+FN(t)+FN(n)+FN(r)+a},LN=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:DN(60*(s<0?s+6:s)),s:DN(a?o/a*100:0),v:DN(a/255*100),a:i}},RN=t.default.memo(function(e){var n=e.hue,r=e.onChange,i=TN([`react-colorful__hue`,e.className]);return t.default.createElement(`div`,{className:i},t.default.createElement(wN,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:yN(n+360*e.left,0,360)})},"aria-label":`Hue`,"aria-valuenow":DN(n),"aria-valuemax":`360`,"aria-valuemin":`0`},t.default.createElement(EN,{className:`react-colorful__hue-pointer`,left:n/360,color:MN({h:n,s:100,v:100,a:1})})))}),zN=t.default.memo(function(e){var n=e.hsva,r=e.onChange,i={backgroundColor:MN({h:n.h,s:100,v:100,a:1})};return t.default.createElement(`div`,{className:`react-colorful__saturation`,style:i},t.default.createElement(wN,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:yN(n.s+100*e.left,0,100),v:yN(n.v-100*e.top,0,100)})},"aria-label":`Color`,"aria-valuetext":`Saturation `+DN(n.s)+`%, Brightness `+DN(n.v)+`%`},t.default.createElement(EN,{className:`react-colorful__saturation-pointer`,top:1-n.v/100,left:n.s/100,color:MN(n)})))}),BN=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},VN=function(e,t){return e.toLowerCase()===t.toLowerCase()||BN(kN(e),kN(t))};function HN(e,n,r){var i=vN(r),a=(0,t.useState)(function(){return e.toHsva(n)}),o=a[0],s=a[1],c=(0,t.useRef)({color:n,hsva:o});return(0,t.useEffect)(function(){if(!e.equal(n,c.current.color)){var t=e.toHsva(n);c.current={hsva:t,color:n},s(t)}},[n,e]),(0,t.useEffect)(function(){var t;BN(o,c.current.hsva)||e.equal(t=e.fromHsva(o),c.current.color)||(c.current={hsva:o,color:t},i(t))},[o,e,i]),[o,(0,t.useCallback)(function(e){s(function(t){return Object.assign({},t,e)})},[])]}var UN,WN=typeof window<`u`?t.useLayoutEffect:t.useEffect,GN=function(){return UN||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},KN=new Map,qN=function(e){WN(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!KN.has(t)){var n=t.createElement(`style`);n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,KN.set(t,n);var r=GN();r&&n.setAttribute(`nonce`,r),t.head.appendChild(n)}},[])},JN=function(e){var n=e.className,r=e.hsva,i=e.onChange,a={backgroundImage:`linear-gradient(90deg, `+NN(Object.assign({},r,{a:0}))+`, `+NN(Object.assign({},r,{a:1}))+`)`},o=TN([`react-colorful__alpha`,n]),s=DN(100*r.a);return t.default.createElement(`div`,{className:o},t.default.createElement(`div`,{className:`react-colorful__alpha-gradient`,style:a}),t.default.createElement(wN,{onMove:function(e){i({a:e.left})},onKey:function(e){i({a:yN(r.a+e.left)})},"aria-label":`Alpha`,"aria-valuetext":s+`%`,"aria-valuenow":s,"aria-valuemin":`0`,"aria-valuemax":`100`},t.default.createElement(EN,{className:`react-colorful__alpha-pointer`,left:r.a,color:NN(r)})))},YN=function(e){var n=e.className,r=e.colorModel,i=e.color,a=i===void 0?r.defaultColor:i,o=e.onChange,s=_N(e,[`className`,`colorModel`,`color`,`onChange`]),c=(0,t.useRef)(null);qN(c);var l=HN(r,a,o),u=l[0],d=l[1],f=TN([`react-colorful`,n]);return t.default.createElement(`div`,gN({},s,{ref:c,className:f}),t.default.createElement(zN,{hsva:u,onChange:d}),t.default.createElement(RN,{hue:u.h,onChange:d}),t.default.createElement(JN,{hsva:u,onChange:d,className:`react-colorful__last-control`}))},XN={defaultColor:`0001`,toHsva:ON,fromHsva:AN,equal:VN},ZN=function(e){return t.default.createElement(YN,gN({},e,{colorModel:XN}))},QN={black:`#000000`,white:`#ffffff`,red:`#ff0000`,green:`#008000`,blue:`#0000ff`,yellow:`#ffff00`,cyan:`#00ffff`,magenta:`#ff00ff`,gray:`#808080`,grey:`#808080`,silver:`#c0c0c0`,maroon:`#800000`,olive:`#808000`,purple:`#800080`,teal:`#008080`,navy:`#000080`,orange:`#ffa500`,transparent:`#00000000`};let $N=e=>{if(!e)return`#000000`;let t=e.trim().toLowerCase();if(t.startsWith(`#`))return t.length===4?`#`+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:t.length===5?`#`+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4]:t;if(QN[t])return QN[t];let n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)$/);if(n){let e=parseInt(n[1]),t=parseInt(n[2]),r=parseInt(n[3]),i=n[4]?parseFloat(n[4]):1,a=e=>{let t=Math.round(e).toString(16);return t.length===1?`0`+t:t},o=Math.round(i*255);return`#${a(e)}${a(t)}${a(r)}${a(o)}`}return`#000000`},eP=({color:e,onChange:t})=>{let n=(e=>$N(e))(e);return(0,r.jsxs)(W,{direction:`column`,gap:`3`,style:{width:`100%`},children:[(0,r.jsx)(ZN,{color:n,onChange:t,style:{width:`100%`}}),(0,r.jsxs)(W,{gap:`2`,align:`center`,children:[(0,r.jsx)(U,{style:{width:32,height:32,backgroundColor:n,borderRadius:4,border:`1px solid var(--gray-5)`,flexShrink:0}}),(0,r.jsx)(X,{value:e,onChange:e=>t(e.target.value),onBlur:()=>{e&&/^[0-9A-Fa-f]{3,8}$/.test(e)&&t(`#`+e)},placeholder:`#RRGGBBAA`,style:{flexGrow:1}})]})]})},tP=({color:e,onChange:t,label:n})=>(0,r.jsxs)(Ay,{children:[(0,r.jsx)(jy,{children:(0,r.jsxs)(G,{variant:`surface`,color:`gray`,style:{width:`100%`,justifyContent:`flex-start`,padding:`0 8px`,height:32},children:[(0,r.jsx)(U,{style:{width:18,height:18,backgroundColor:e||`transparent`,borderRadius:2,border:`1px solid var(--gray-8)`,marginRight:8,backgroundImage:e===`transparent`?`linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)`:`none`,backgroundSize:`8px 8px`,backgroundPosition:`0 0, 0 4px, 4px -4px, -4px 0px`}}),(0,r.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n||e||`Transparente`})]})}),(0,r.jsx)(My,{style:{width:240},children:(0,r.jsx)(eP,{color:e,onChange:t})})]}),nP=({elementId:e})=>{let{state:t,updateElement:n}=rS(),i=t.elements.find(t=>t.id===e);return i?(0,r.jsx)(U,{pt:`2`,children:(0,r.jsxs)(sb,{defaultValue:`formatting`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`formatting`,style:{flex:1},children:`Formatação`}),(0,r.jsx)(lb,{value:`style`,style:{flex:1},children:`Estilo`}),(0,r.jsx)(lb,{value:`bindings`,style:{flex:1},children:`Vínculos`}),(0,r.jsx)(lb,{value:`conditional`,style:{flex:1},children:`Regras`}),(0,r.jsx)(lb,{value:`animation`,style:{flex:1},children:`Anim`})]}),(0,r.jsxs)(U,{pt:`3`,children:[(0,r.jsx)(ub,{value:`formatting`,children:(0,r.jsx)(iP,{element:i,updateElement:n})}),(0,r.jsx)(ub,{value:`style`,children:(0,r.jsx)(aP,{element:i,updateElement:n})}),(0,r.jsx)(ub,{value:`bindings`,children:(0,r.jsx)(pP,{element:i,updateElement:n,availableProps:t.availableProps||[]})}),(0,r.jsx)(ub,{value:`conditional`,children:(0,r.jsx)(mP,{element:i,updateElement:n,availableProps:t.availableProps||[]})}),(0,r.jsx)(ub,{value:`animation`,children:(0,r.jsx)(rP,{element:i,updateElement:n})})]})]})}):null},rP=({element:e,updateElement:t})=>{let n=e.animation||{type:`none`,duration:1,delay:0},i=r=>{t(e.id,{animation:{...n,...r}})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Tipo de Animação`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[n.type===`none`?`Nenhuma`:n.type===`slideIn`?`Slide In (Padrão)`:n.type===`fadeIn`?`Fade In`:n.type===`smoothSlideUp`?`Slide Suave (Up)`:n.type===`popIn`?`Pop In`:n.type===`blurIn`?`Blur In`:n.type===`slideInLeft`?`Slide In (Esquerda)`:n.type===`slideInRight`?`Slide In (Direita)`:n.type===`slideInUp`?`Slide In (Cima)`:n.type===`slideInDown`?`Slide In (Baixo)`:n.type===`zoomIn`?`Zoom In`:n.type===`bounceIn`?`Bounce In`:n.type===`pulse`?`Pulse (Atenção)`:n.type===`shake`?`Shake (Atenção)`:`Spin (Loop)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>i({type:`none`}),children:`Nenhuma`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideIn`}),children:`Slide In (Padrão)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`fadeIn`}),children:`Fade In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`smoothSlideUp`}),children:`Slide Suave (Up)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`popIn`}),children:`Pop In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`blurIn`}),children:`Blur In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInLeft`}),children:`Slide In (Esquerda)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInRight`}),children:`Slide In (Direita)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInUp`}),children:`Slide In (Cima)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`slideInDown`}),children:`Slide In (Baixo)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`zoomIn`}),children:`Zoom In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`bounceIn`}),children:`Bounce In`}),(0,r.jsx)(q,{onSelect:()=>i({type:`pulse`}),children:`Pulse (Atenção)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`shake`}),children:`Shake (Atenção)`}),(0,r.jsx)(q,{onSelect:()=>i({type:`spin`}),children:`Spin (Loop)`})]})]})]}),n.type!==`none`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Duração (s)`}),(0,r.jsx)(X,{type:`number`,step:`0.1`,min:`0.1`,value:n.duration,onChange:e=>i({duration:parseFloat(e.target.value)||.5})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Atraso (s)`}),(0,r.jsx)(X,{type:`number`,step:`0.1`,min:`0`,value:n.delay,onChange:e=>i({delay:parseFloat(e.target.value)||0})})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Curva de Tempo`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[(n.timingFunction||`ease`)===`linear`?`Linear`:(n.timingFunction||`ease`)===`ease-in`?`Ease In`:(n.timingFunction||`ease`)===`ease-out`?`Ease Out`:(n.timingFunction||`ease`)===`ease-in-out`?`Ease In Out`:(n.timingFunction||`ease`)===`bounce`?`Bounce`:`Ease`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`linear`}),children:`Linear`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease`}),children:`Ease`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease-in`}),children:`Ease In`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease-out`}),children:`Ease Out`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`ease-in-out`}),children:`Ease In Out`}),(0,r.jsx)(q,{onSelect:()=>i({timingFunction:`bounce`}),children:`Bounce`})]})]})]}),[`pulse`,`shake`,`spin`].includes(n.type)&&(0,r.jsx)(U,{children:(0,r.jsxs)(W,{align:`center`,gap:`2`,mt:`2`,children:[(0,r.jsx)(ib,{checked:n.iterationCount===`infinite`,onCheckedChange:e=>i({iterationCount:e?`infinite`:1})}),(0,r.jsx)(H,{size:`2`,children:`Repetir Infinitamente`})]})})]})]})},iP=({element:e,updateElement:t})=>{let n=e.formatting||{type:`text`},i=r=>{t(e.id,{formatting:{...n,...r}})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(e.type===`text`||e.type===`text-container`)&&(0,r.jsxs)(U,{children:[(0,r.jsxs)(W,{align:`center`,gap:`2`,mb:`3`,children:[(0,r.jsx)(ib,{checked:e.autoGrow||!1,onCheckedChange:n=>t(e.id,{autoGrow:n})}),(0,r.jsx)(H,{size:`2`,children:e.type===`text-container`?`Expandir container automaticamente`:`Expandir altura automaticamente`})]}),e.type===`text-container`&&e.autoGrow&&(0,r.jsxs)(U,{mb:`3`,ml:`4`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Direção de Expansão`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[(e.containerExpansion||`vertical`)===`vertical`?`Vertical (Altura Cresce)`:`Horizontal (Largura Cresce)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>t(e.id,{containerExpansion:`vertical`}),children:`Vertical (Altura Cresce)`}),(0,r.jsx)(q,{onSelect:()=>t(e.id,{containerExpansion:`horizontal`}),children:`Horizontal (Largura Cresce)`})]})]})]}),(0,r.jsx)(Qy,{size:`4`,mb:`2`})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Tipo de Formatação`}),(0,r.jsxs)(Wy,{value:n.type,onValueChange:e=>i({type:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`text`,children:`Texto (Padrão)`}),(0,r.jsx)(Y,{value:`boolean`,children:`Booleano (Sim/Não)`}),(0,r.jsx)(Y,{value:`date`,children:`Data`}),(0,r.jsx)(Y,{value:`number`,children:`Número / Moeda`})]})]})]}),n.type===`boolean`&&(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Texto para Verdadeiro`}),(0,r.jsx)(X,{placeholder:`Ex: Sim`,value:n.trueLabel||``,onChange:e=>i({trueLabel:e.target.value})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Texto para Falso`}),(0,r.jsx)(X,{placeholder:`Ex: Não`,value:n.falseLabel||``,onChange:e=>i({falseLabel:e.target.value})})]})]}),n.type===`date`&&(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Formato da Data`}),(0,r.jsx)(X,{placeholder:`Ex: DD/MM/YYYY`,value:n.dateFormat||``,onChange:e=>i({dateFormat:e.target.value})}),(0,r.jsx)(H,{size:`1`,color:`gray`,mt:`1`,style:{fontSize:10},children:`Use DD, MM, YYYY, HH, mm, ss.`})]}),n.type===`number`&&(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Estilo`}),(0,r.jsxs)(Wy,{value:n.numberFormat||`decimal`,onValueChange:e=>i({numberFormat:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`decimal`,children:`Decimal`}),(0,r.jsx)(Y,{value:`currency`,children:`Moeda`}),(0,r.jsx)(Y,{value:`percent`,children:`Porcentagem`})]})]})]}),n.numberFormat===`currency`&&(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Símbolo da Moeda`}),(0,r.jsx)(X,{placeholder:`Ex: R$`,value:n.currencySymbol||``,onChange:e=>i({currencySymbol:e.target.value})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Casas Decimais`}),(0,r.jsx)(X,{type:`number`,placeholder:`2`,value:n.decimalPlaces===void 0?``:n.decimalPlaces,onChange:e=>i({decimalPlaces:parseInt(e.target.value)||0})})]})]})]})},aP=({element:e,updateElement:n})=>{let i=e.style||{},[a,o]=(0,t.useState)(i.borderTopLeftRadius!==void 0||i.borderTopRightRadius!==void 0||i.borderBottomRightRadius!==void 0||i.borderBottomLeftRadius!==void 0),s=t=>{n(e.id,{style:{...i,...t}})},c=(e,t)=>{let n=typeof e==`number`?e:parseInt(e)||0;s({[t]:`${n}px`})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsxs)(W,{align:`center`,justify:`between`,mb:`2`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Arredondamento`}),(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(H,{size:`1`,children:`Individual`}),(0,r.jsx)(ib,{checked:a,onCheckedChange:e=>{if(o(e),!e)s({borderRadius:i.borderTopLeftRadius||i.borderRadius||0,borderTopLeftRadius:void 0,borderTopRightRadius:void 0,borderBottomRightRadius:void 0,borderBottomLeftRadius:void 0});else{let e=i.borderRadius||0;s({borderRadius:void 0,borderTopLeftRadius:e,borderTopRightRadius:e,borderBottomRightRadius:e,borderBottomLeftRadius:e})}}})]})]}),a?(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Sup. Esq.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderTopLeftRadius)||0,onChange:e=>c(e.target.value,`borderTopLeftRadius`)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Sup. Dir.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderTopRightRadius)||0,onChange:e=>c(e.target.value,`borderTopRightRadius`)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Inf. Esq.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderBottomLeftRadius)||0,onChange:e=>c(e.target.value,`borderBottomLeftRadius`)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Inf. Dir.`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderBottomRightRadius)||0,onChange:e=>c(e.target.value,`borderBottomRightRadius`)})]})]}):(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Raio (Todos os cantos)`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.borderRadius)||0,onChange:e=>s({borderRadius:`${parseInt(e.target.value)||0}px`})})]})]}),(0,r.jsx)(Qy,{size:`4`,my:`2`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,children:`Espaçamento Interno`}),(0,r.jsx)(K,{columns:`2`,gap:`3`,children:(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Tamanho (px)`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:parseInt(i.padding)||0,onChange:e=>s({padding:`${parseInt(e.target.value)||0}px`})})]})})]}),(0,r.jsx)(Qy,{size:`4`,my:`2`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,children:`Sombra (Box Shadow)`}),(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Cor`}),(0,r.jsx)(tP,{color:oP(i.boxShadow),onChange:e=>s({boxShadow:lP(i.boxShadow,e)})})]}),(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Blur (px)`}),(0,r.jsx)(X,{type:`number`,min:`0`,value:sP(i.boxShadow),onChange:e=>s({boxShadow:uP(i.boxShadow,parseInt(e.target.value)||0)})})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,color:`gray`,children:`Spread (px)`}),(0,r.jsx)(X,{type:`number`,value:cP(i.boxShadow),onChange:e=>s({boxShadow:dP(i.boxShadow,parseInt(e.target.value)||0)})})]})]}),(0,r.jsx)(G,{variant:`soft`,color:`gray`,size:`1`,onClick:()=>s({boxShadow:i.boxShadow?void 0:`0 4px 12px 0 rgba(0,0,0,0.15)`}),children:i.boxShadow?`Remover Sombra`:`Adicionar Sombra`})]})]})]})};var oP=e=>{if(!e||e===`none`)return`#0000001a`;let t=e.match(/(?:rgba?\([^)]+\)|#[0-9a-fA-F]{3,8}|[a-zA-Z]+)\s*$/);return t?t[0].trim():`#0000001a`},sP=e=>{if(!e||e===`none`)return 12;let t=e.match(/(-?\d+(?:\.\d+)?)(?:px)?/g);return t&&t.length>=3?parseFloat(t[2]):12},cP=e=>{if(!e||e===`none`)return 0;let t=e.match(/(-?\d+(?:\.\d+)?)(?:px)?/g);return t&&t.length>=4?parseFloat(t[3]):0},lP=(e,t)=>{let n=sP(e),r=cP(e);return`${e?.includes(`inset`)?`inset `:``}0px 4px ${n}px ${r}px ${t}`},uP=(e,t)=>{let n=(e||`0 4px 12px 0 #0000001a`).match(/(-?\d+(?:\.\d+)?)(?:px)?/g)||[`0`,`4`,`12`,`0`],r=oP(e);return`${e?.includes(`inset`)?`inset `:``}${n[0]||0}px ${n[1]||4}px ${t}px ${n[3]||0}px ${r}`},dP=(e,t)=>{let n=(e||`0 4px 12px 0 #0000001a`).match(/(-?\d+(?:\.\d+)?)(?:px)?/g)||[`0`,`4`,`12`,`0`],r=oP(e);return`${e?.includes(`inset`)?`inset `:``}${n[0]||0}px ${n[1]||4}px ${n[2]||12}px ${t}px ${r}`},fP=[{key:`color`,label:`Cor do texto`},{key:`backgroundColor`,label:`Cor de fundo`},{key:`borderColor`,label:`Cor da borda`},{key:`boxShadowColor`,label:`Cor da sombra`}];let pP=({element:e,updateElement:t,availableProps:n})=>{let i=e.styleBindings||{},a=(n,r)=>{let a={...i};r?a[n]=r:delete a[n],t(e.id,{styleBindings:Object.keys(a).length>0?a:void 0})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Vínculos de Estilo (Data Binding)`}),(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`2`,children:`Vincule propriedades de estilo a variáveis de dados. O valor da variável será aplicado em tempo real (ex.: cores em formato #RRGGBB, rgba(), etc.).`}),fP.map(({key:e,label:t})=>(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:t}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,size:`1`,style:{width:`100%`,justifyContent:`space-between`},children:[i[e]?n.find(t=>t.dataName===i[e])?.name||i[e]:`Nenhum`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>a(e,null),children:`Nenhum`}),n.map(t=>(0,r.jsx)(q,{onSelect:()=>a(e,t.dataName),children:t.name},t.dataName)),n.length===0&&(0,r.jsx)(q,{disabled:!0,children:`Nenhuma variável disponível`})]})]})]},e))]})},mP=({element:e,updateElement:t,availableProps:n})=>{let i=e.conditions||[],a=()=>{let r={id:crypto.randomUUID(),property:n.length>0?n[0].dataName:``,operator:`equals`,value:``,style:{color:`#ff0000`}};t(e.id,{conditions:[...i,r]})},o=n=>{t(e.id,{conditions:i.filter(e=>e.id!==n)})},s=(n,r)=>{t(e.id,{conditions:i.map(e=>e.id===n?{...e,...r}:e)})};return(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,children:[(0,r.jsx)(H,{size:`2`,color:`gray`,children:`Regras de Exibição`}),(0,r.jsxs)(G,{size:`1`,variant:`soft`,onClick:a,children:[(0,r.jsx)(mt,{}),` Nova Regra`]})]}),i.length===0?(0,r.jsx)(H,{size:`1`,color:`gray`,style:{fontStyle:`italic`},children:`Nenhuma regra condicional definida.`}):(0,r.jsx)(W,{direction:`column`,gap:`2`,children:i.map(e=>(0,r.jsxs)(U,{style:{border:`1px solid var(--gray-6)`,borderRadius:4,padding:8},children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,mb:`2`,children:[(0,r.jsxs)(H,{size:`1`,weight:`bold`,children:[`Se `,e.property,`...`]}),(0,r.jsx)(J,{size:`1`,color:`red`,variant:`ghost`,onClick:()=>o(e.id),children:(0,r.jsx)(Xt,{})})]}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,mb:`2`,children:[(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,size:`1`,style:{width:`100%`,justifyContent:`space-between`},children:[n.find(t=>t.dataName===e.property)?.name||e.property||`Propriedade`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[n.map(t=>(0,r.jsx)(q,{onSelect:()=>s(e.id,{property:t.dataName}),children:t.name},t.dataName)),n.length===0&&(0,r.jsx)(q,{disabled:!0,children:`Nenhuma variável disponível`})]})]}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,size:`1`,style:{width:`100%`,justifyContent:`space-between`},children:[e.operator===`equals`?`Igual a`:e.operator===`notEquals`?`Diferente de`:e.operator===`contains`?`Contém`:e.operator===`greaterThan`?`Maior que`:`Menor que`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`equals`}),children:`Igual a`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`notEquals`}),children:`Diferente de`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`contains`}),children:`Contém`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`greaterThan`}),children:`Maior que`}),(0,r.jsx)(q,{onSelect:()=>s(e.id,{operator:`lessThan`}),children:`Menor que`})]})]})]}),(0,r.jsx)(X,{size:`1`,placeholder:`Valor`,value:e.value,onChange:t=>s(e.id,{value:t.target.value})}),(0,r.jsxs)(U,{mt:`2`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor quando verdadeiro`}),(0,r.jsx)(tP,{color:e.style?.color||`#ff0000`,onChange:t=>s(e.id,{style:{...e.style,color:t}})})]})]},e.id))})]})};var hP=({title:e,isOpen:t,onToggle:n,children:i,onReset:a})=>(0,r.jsxs)(U,{style:{borderBottom:`1px solid var(--gray-4)`},children:[(0,r.jsxs)(W,{align:`center`,style:{width:`100%`},children:[(0,r.jsxs)(G,{variant:`ghost`,onClick:n,style:{flex:1,justifyContent:`space-between`,padding:`12px 8px`,borderRadius:0,height:`auto`,cursor:`pointer`,color:`var(--gray-12)`},children:[(0,r.jsx)(H,{weight:`bold`,size:`2`,children:e}),t?(0,r.jsx)(fe,{}):(0,r.jsx)(me,{})]}),a&&t&&(0,r.jsx)(bb,{content:`Resetar para padrão`,children:(0,r.jsx)(J,{variant:`ghost`,color:`gray`,onClick:e=>{e.stopPropagation(),a()},style:{marginRight:8},children:(0,r.jsx)(vt,{})})})]}),t&&(0,r.jsx)(U,{p:`3`,style:{backgroundColor:`var(--gray-2)`},children:i})]}),gP=({value:e,onChange:n,units:i=[`px`,`%`,`em`,`rem`,`vw`,`vh`],min:a,max:o,placeholder:s,label:c})=>{let l=e=>{if(e==null||e===``)return{num:``,unit:i[0]};let t=String(e).match(/^(-?[\d.]+)([a-z%]+)?$/i);return t?{num:t[1],unit:t[2]||i[0]}:{num:``,unit:i[0]}},[u,d]=(0,t.useState)(l(e));(0,t.useEffect)(()=>{d(l(e))},[e]);let f=(e,t)=>{if(e===``){n(``);return}n(`${e}${t}`)};return(0,r.jsxs)(U,{children:[c&&(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:c}),(0,r.jsxs)(W,{children:[(0,r.jsx)(X,{type:`number`,value:u.num,onChange:e=>{let t=e.target.value;d({...u,num:t}),f(t,u.unit)},placeholder:s,style:{borderTopRightRadius:0,borderBottomRightRadius:0,flex:1},min:a,max:o}),(0,r.jsxs)(Wy,{value:u.unit,onValueChange:e=>{d({...u,unit:e}),f(u.num,e)},children:[(0,r.jsx)(Gy,{style:{width:60,borderTopLeftRadius:0,borderBottomLeftRadius:0,marginLeft:-1}}),(0,r.jsx)(Ky,{children:i.map(e=>(0,r.jsx)(Y,{value:e,children:e},e))})]})]})]})},_P=({values:e,onChange:n,label:i})=>{let[a,o]=(0,t.useState)(!0),s=e=>{n({top:e,right:e,bottom:e,left:e})},c=(t,r)=>{n({...e,[t]:r})};return(0,r.jsxs)(U,{children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,mb:`1`,children:[i&&(0,r.jsx)(H,{size:`1`,color:`gray`,children:i}),(0,r.jsx)(bb,{content:a?`Desvincular lados`:`Vincular lados`,children:(0,r.jsx)(J,{size:`1`,variant:`ghost`,color:a?`blue`:`gray`,onClick:()=>o(!a),children:a?(0,r.jsx)(vP,{}):(0,r.jsx)(yP,{})})})]}),a?(0,r.jsx)(gP,{value:e.top||``,onChange:s,placeholder:`Todos`}):(0,r.jsxs)(K,{columns:`2`,gap:`2`,children:[(0,r.jsx)(gP,{value:e.top,onChange:e=>c(`top`,e),label:`Top`}),(0,r.jsx)(gP,{value:e.right,onChange:e=>c(`right`,e),label:`Right`}),(0,r.jsx)(gP,{value:e.bottom,onChange:e=>c(`bottom`,e),label:`Bottom`}),(0,r.jsx)(gP,{value:e.left,onChange:e=>c(`left`,e),label:`Left`})]})]})},vP=()=>(0,r.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,r.jsx)(`path`,{d:`M4.5 6.5L1.35355 9.64645C0.908293 10.0917 0.908293 10.8134 1.35355 11.2587L3.74132 13.6464C4.18658 14.0917 4.90829 14.0917 5.35355 13.6464L8.5 10.5M10.5 8.5L13.6464 5.35355C14.0917 4.90829 14.0917 4.18658 13.6464 3.74132L11.2587 1.35355C10.8134 0.908293 10.0917 0.908293 9.64645 1.35355L6.5 4.5M6.5 8.5H8.5`,stroke:`currentColor`})}),yP=()=>(0,r.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,r.jsx)(`path`,{d:`M4.5 6.5L1.35355 9.64645C0.908293 10.0917 0.908293 10.8134 1.35355 11.2587L3.74132 13.6464C4.18658 14.0917 4.90829 14.0917 5.35355 13.6464L8.5 10.5M10.5 8.5L13.6464 5.35355C14.0917 4.90829 14.0917 4.18658 13.6464 3.74132L11.2587 1.35355C10.8134 0.908293 10.0917 0.908293 9.64645 1.35355L6.5 4.5`,stroke:`currentColor`})});let bP=()=>{let{state:e,setPropertiesPanelOpen:n,updateElement:i,updateElements:a,removeSelected:o,copy:s,paste:c,addElement:l}=rS(),{isPropertiesPanelOpen:u,selectedElementIds:d,elements:f}=e,p=(0,t.useMemo)(()=>f.filter(e=>d.includes(e.id)),[f,d]),m=p[0],h=p.length>1,[g,_]=(0,t.useState)({content:!0,layout:!0,typography:!0,appearance:!1,borders:!1,effects:!1,transform:!1,animation:!1,conditions:!1,formatting:!1,spacing:!1}),[v,y]=(0,t.useState)(``),[b,x]=(0,t.useState)({});(0,t.useEffect)(()=>{let e=localStorage.getItem(`editor-presets`);if(e)try{x(JSON.parse(e))}catch(e){console.error(`Failed to load presets`,e)}},[]);let S=e=>{if(!m)return;let t={...b,[e]:{style:m.style}};x(t),localStorage.setItem(`editor-presets`,JSON.stringify(t))},C=e=>{let t=b[e];t&&t.style&&D(t.style)};if(!u||!m)return null;let w=e=>{_(t=>({...t,[e]:!t[e]}))},T=e=>{h?a(d.map(t=>({id:t,changes:e}))):i(m.id,e)},E=()=>{if(h)s(),c();else{let{id:e,...t}=m;l({...t,x:m.x+20,y:m.y+20})}},D=e=>{h?a(p.map(t=>({id:t.id,changes:{style:{...t.style,...e}}}))):i(m.id,{style:{...m.style,...e}})},O=e=>{let t={};e.forEach(e=>t[e]=void 0),D(t)},k=(e,t)=>{if(!v)return!0;let n=v.toLowerCase();return e.toLowerCase().includes(n)||t.some(e=>e.toLowerCase().includes(n))},A=e=>{if(!h)return e(m);let t=e(m);return p.every(n=>e(n)===t)?t:`Mixed`},j=(e,t=``)=>{let n=A(t=>t.style?.[e]);return n===`Mixed`?`Mixed`:n===void 0?t:n},M=String(j(`fontFamily`,`Arial`)),N=AS(M,e.availableFonts||[`Arial`]),P=()=>{let e=j(`fontWeight`,`normal`);return e===`Mixed`?`400`:kS(e,OS)},F=e=>{let t={x:0,y:4,blur:12,spread:0,color:`#0000001a`,inset:!1};if(!e||e===`none`)return t;let n=e.trim(),r=n.includes(`inset`),i=n.replace(`inset`,``).trim(),a=i.match(/(-?\d+(?:\.\d+)?)(?:px)?\s+(-?\d+(?:\.\d+)?)(?:px)?(?:\s+(\d+(?:\.\d+)?)(?:px)?)?(?:\s+(\d+(?:\.\d+)?)(?:px)?)?/);return a?{x:parseFloat(a[1]),y:parseFloat(a[2]),blur:a[3]?parseFloat(a[3]):0,spread:a[4]?parseFloat(a[4]):0,color:i.replace(a[0],``).trim()||t.color,inset:r}:t},I=F(m.style?.boxShadow),re=e=>{let t={...I,...e};D({boxShadow:`${t.inset?`inset `:``}${t.x}px ${t.y}px ${t.blur}px ${t.spread}px ${t.color}`})};return(0,r.jsx)(ny,{open:u,onOpenChange:n,children:(0,r.jsxs)(iy,{style:{maxWidth:500,width:`100%`,maxHeight:`85vh`,height:`100%`,padding:0,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,r.jsxs)(U,{style:{borderBottom:`1px solid var(--gray-4)`},children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,p:`4`,pb:`2`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(ay,{style:{margin:0},children:`Propriedades`}),(0,r.jsx)(oy,{size:`1`,color:`gray`,children:h?`${p.length} selecionados`:m.name||`Elemento`})]}),(0,r.jsxs)(W,{gap:`2`,children:[(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsx)(J,{variant:`ghost`,color:`gray`,children:(0,r.jsx)(ee,{})})}),(0,r.jsxs)(fy,{children:[(0,r.jsx)(py,{children:`Presets`}),Object.keys(b).length===0&&(0,r.jsx)(q,{disabled:!0,children:`Nenhum preset salvo`}),Object.keys(b).map(e=>(0,r.jsx)(q,{onSelect:t=>{t.preventDefault(),C(e)},onClick:()=>C(e),style:{cursor:`pointer`},children:e},e)),(0,r.jsx)(xy,{}),(0,r.jsxs)(q,{onSelect:e=>{e.preventDefault();let t=prompt(`Nome do novo preset:`);t&&S(t)},children:[(0,r.jsx)(mt,{style:{marginRight:8}}),` Salvar Atual`]})]})]}),(0,r.jsx)(sy,{children:(0,r.jsx)(J,{variant:`ghost`,color:`gray`,children:(0,r.jsx)(Ee,{})})})]})]}),(0,r.jsxs)(W,{gap:`2`,px:`4`,pb:`3`,children:[(0,r.jsx)(bb,{content:`Bloquear`,children:(0,r.jsx)(J,{variant:`soft`,color:m.locked?`orange`:`gray`,onClick:()=>T({locked:!m.locked}),children:m.locked?(0,r.jsx)(et,{}):(0,r.jsx)(nt,{})})}),(0,r.jsx)(bb,{content:`Ocultar`,children:(0,r.jsx)(J,{variant:`soft`,color:m.hidden?`blue`:`gray`,onClick:()=>T({hidden:!m.hidden}),children:m.hidden?(0,r.jsx)(Be,{}):(0,r.jsx)(He,{})})}),(0,r.jsx)(bb,{content:`Duplicar`,children:(0,r.jsx)(J,{variant:`soft`,color:`gray`,onClick:E,children:(0,r.jsx)(we,{})})}),(0,r.jsx)(U,{style:{flex:1}}),(0,r.jsx)(bb,{content:`Excluir`,children:(0,r.jsx)(J,{variant:`soft`,color:`red`,onClick:()=>{o(),n(!1)},children:(0,r.jsx)(Xt,{})})})]})]}),(0,r.jsx)(U,{p:`3`,style:{borderBottom:`1px solid var(--gray-4)`,backgroundColor:`var(--gray-1)`},children:(0,r.jsx)(X,{placeholder:`Buscar...`,value:v,onChange:e=>y(e.target.value),children:(0,r.jsx)(_b,{children:(0,r.jsx)(ot,{height:`16`,width:`16`})})})}),(0,r.jsxs)(U,{style:{flex:1,overflowY:`auto`,overflowX:`hidden`},children:[k(`Conteúdo`,[`text`,`image`,`url`,`value`,`content`])&&(m.type===`text`||m.type===`text-container`||m.type===`image`)&&(0,r.jsx)(hP,{title:`Conteúdo`,isOpen:g.content,onToggle:()=>w(`content`),children:(0,r.jsxs)(U,{children:[(m.type===`text`||m.type===`text-container`)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Texto`}),(0,r.jsx)(pb,{value:m.content||``,onChange:e=>T({content:e.target.value}),rows:4,placeholder:`Texto ou {{variavel}}...`})]}),m.type===`image`&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`URL da Imagem`}),(0,r.jsx)(X,{value:m.content||``,onChange:e=>T({content:e.target.value}),placeholder:`https://...`})]})]})}),k(`Tipografia`,[`font`,`text`,`color`,`align`,`size`,`weight`,`transform`,`decoration`])&&(0,r.jsx)(hP,{title:`Tipografia`,isOpen:g.typography,onToggle:()=>w(`typography`),onReset:()=>O([`fontFamily`,`fontSize`,`fontWeight`,`color`,`textAlign`,`fontStyle`,`textDecoration`,`textTransform`,`lineHeight`,`letterSpacing`]),children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Família da Fonte`}),(0,r.jsxs)(Wy,{value:M,onValueChange:e=>D({fontFamily:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`},placeholder:`Selecione...`}),(0,r.jsx)(Ky,{style:{zIndex:1e5},children:N.map(e=>(0,r.jsx)(Y,{value:e,children:e},e))})]})]}),(0,r.jsx)(gP,{label:`Tamanho`,value:j(`fontSize`,`16px`),onChange:e=>D({fontSize:e})}),(0,r.jsx)(gP,{label:`Altura da Linha`,value:j(`lineHeight`,`normal`),onChange:e=>D({lineHeight:e}),units:[``,`px`,`em`,`%`],placeholder:`Normal`}),(0,r.jsx)(gP,{label:`Espaçamento`,value:j(`letterSpacing`,`normal`),onChange:e=>D({letterSpacing:e}),units:[`px`,`em`],placeholder:`Normal`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Peso`}),(0,r.jsxs)(Wy,{value:P(),onValueChange:e=>D({fontWeight:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`},placeholder:`Normal`}),(0,r.jsxs)(Ky,{style:{zIndex:1e5},children:[(0,r.jsx)(Y,{value:`100`,children:`100 - Thin`}),(0,r.jsx)(Y,{value:`300`,children:`300 - Light`}),(0,r.jsx)(Y,{value:`400`,children:`400 - Normal`}),(0,r.jsx)(Y,{value:`500`,children:`500 - Medium`}),(0,r.jsx)(Y,{value:`600`,children:`600 - Semi Bold`}),(0,r.jsx)(Y,{value:`700`,children:`700 - Bold`}),(0,r.jsx)(Y,{value:`900`,children:`900 - Black`}),(0,r.jsx)(Y,{value:`normal`,children:`Normal`}),(0,r.jsx)(Y,{value:`bold`,children:`Bold`})]})]})]}),(0,r.jsx)(U,{style:{gridColumn:`span 2`},children:(0,r.jsxs)(W,{justify:`between`,align:`center`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Estilo`}),(0,r.jsxs)(W,{gap:`1`,children:[(0,r.jsx)(J,{variant:j(`fontStyle`)===`italic`?`solid`:`soft`,onClick:()=>D({fontStyle:j(`fontStyle`)===`italic`?`normal`:`italic`}),children:(0,r.jsx)(Ke,{})}),(0,r.jsx)(J,{variant:j(`textDecoration`)===`underline`?`solid`:`soft`,onClick:()=>D({textDecoration:j(`textDecoration`)===`underline`?`none`:`underline`}),children:(0,r.jsx)(Qt,{})}),(0,r.jsx)(J,{variant:j(`textDecoration`)===`line-through`?`solid`:`soft`,onClick:()=>D({textDecoration:j(`textDecoration`)===`line-through`?`none`:`line-through`}),children:(0,r.jsx)(Pt,{})})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Transformação`}),(0,r.jsxs)(Wy,{value:j(`textTransform`,`none`),onValueChange:e=>D({textTransform:e}),children:[(0,r.jsx)(Gy,{style:{width:100}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`none`,children:`Nenhum`}),(0,r.jsx)(Y,{value:`uppercase`,children:`MAIÚSCULA`}),(0,r.jsx)(Y,{value:`lowercase`,children:`minúscula`}),(0,r.jsx)(Y,{value:`capitalize`,children:`Capitalizada`})]})]})]})]})}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Alinhamento`}),(0,r.jsxs)(Ly,{value:j(`textAlign`,`left`),onValueChange:e=>D({textAlign:e}),children:[(0,r.jsx)(Ry,{value:`left`,children:(0,r.jsx)(Wt,{})}),(0,r.jsx)(Ry,{value:`center`,children:(0,r.jsx)(Bt,{})}),(0,r.jsx)(Ry,{value:`right`,children:(0,r.jsx)(Kt,{})}),(0,r.jsx)(Ry,{value:`justify`,children:(0,r.jsx)(Ht,{})})]})]}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor do Texto`}),(0,r.jsx)(tP,{color:j(`color`,`#000000`),onChange:e=>D({color:e})})]})]})}),k(`Aparência`,[`background`,`opacity`,`blend`,`cursor`])&&(0,r.jsxs)(hP,{title:`Aparência`,isOpen:g.appearance,onToggle:()=>w(`appearance`),onReset:()=>O([`backgroundColor`,`backgroundImage`,`backgroundSize`,`opacity`,`mixBlendMode`,`cursor`]),children:[(0,r.jsxs)(sb,{defaultValue:`solid`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`solid`,children:`Sólido`}),(0,r.jsx)(lb,{value:`gradient`,children:`Gradiente`}),(0,r.jsx)(lb,{value:`image`,children:`Imagem`})]}),(0,r.jsxs)(U,{pt:`3`,children:[(0,r.jsxs)(ub,{value:`solid`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor de Fundo`}),(0,r.jsx)(tP,{color:j(`backgroundColor`,`transparent`),onChange:e=>D({backgroundColor:e,backgroundImage:`none`})})]}),(0,r.jsxs)(ub,{value:`gradient`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`CSS Gradient`}),(0,r.jsx)(pb,{value:j(`backgroundImage`,``),onChange:e=>D({backgroundImage:e.target.value}),placeholder:`linear-gradient(to right, red, blue)`,rows:3})]}),(0,r.jsxs)(ub,{value:`image`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`URL da Imagem`}),(0,r.jsx)(X,{value:j(`backgroundImage`,``).replace(/url\(['"]?(.*?)['"]?\)/,`$1`),onChange:e=>D({backgroundImage:`url('${e.target.value}')`}),placeholder:`https://...`,mb:`2`}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Tamanho`}),(0,r.jsxs)(Wy,{value:j(`backgroundSize`,`auto`),onValueChange:e=>D({backgroundSize:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`auto`,children:`Auto`}),(0,r.jsx)(Y,{value:`cover`,children:`Cobrir (Cover)`}),(0,r.jsx)(Y,{value:`contain`,children:`Conter (Contain)`}),(0,r.jsx)(Y,{value:`100% 100%`,children:`Esticar`})]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Repetição`}),(0,r.jsxs)(Wy,{value:j(`backgroundRepeat`,`repeat`),onValueChange:e=>D({backgroundRepeat:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`repeat`,children:`Repetir`}),(0,r.jsx)(Y,{value:`no-repeat`,children:`Não Repetir`}),(0,r.jsx)(Y,{value:`repeat-x`,children:`Horizontal`}),(0,r.jsx)(Y,{value:`repeat-y`,children:`Vertical`})]})]})]})]})]})]})]}),(0,r.jsxs)(U,{mt:`3`,children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Opacidade`}),(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(tb,{min:0,max:1,step:.05,value:[parseFloat(j(`opacity`,`1`))],onValueChange:([e])=>D({opacity:e}),style:{flex:1}}),(0,r.jsxs)(H,{size:`1`,children:[Math.round(parseFloat(j(`opacity`,`1`))*100),`%`]})]})]}),(0,r.jsxs)(K,{columns:`2`,gap:`3`,mt:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Blend Mode`}),(0,r.jsxs)(Wy,{value:j(`mixBlendMode`,`normal`),onValueChange:e=>D({mixBlendMode:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`normal`,children:`Normal`}),(0,r.jsx)(Y,{value:`multiply`,children:`Multiply`}),(0,r.jsx)(Y,{value:`screen`,children:`Screen`}),(0,r.jsx)(Y,{value:`overlay`,children:`Overlay`}),(0,r.jsx)(Y,{value:`darken`,children:`Darken`}),(0,r.jsx)(Y,{value:`lighten`,children:`Lighten`})]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cursor`}),(0,r.jsxs)(Wy,{value:j(`cursor`,`auto`),onValueChange:e=>D({cursor:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`auto`,children:`Auto`}),(0,r.jsx)(Y,{value:`default`,children:`Padrão`}),(0,r.jsx)(Y,{value:`pointer`,children:`Mãozinha`}),(0,r.jsx)(Y,{value:`text`,children:`Texto`}),(0,r.jsx)(Y,{value:`move`,children:`Mover`}),(0,r.jsx)(Y,{value:`not-allowed`,children:`Bloqueado`})]})]})]})]})]}),k(`Layout`,[`width`,`height`,`x`,`y`,`z-index`,`overflow`])&&(0,r.jsx)(hP,{title:`Layout & Dimensões`,isOpen:g.layout,onToggle:()=>w(`layout`),onReset:()=>T({width:100,height:100,x:0,y:0,style:{...m.style,zIndex:void 0,overflow:void 0}}),children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsx)(gP,{label:`Largura`,value:m.width,onChange:e=>T({width:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Altura`,value:m.height,onChange:e=>T({height:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Posição X`,value:m.x,onChange:e=>T({x:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Posição Y`,value:m.y,onChange:e=>T({y:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Z-Index`,value:j(`zIndex`,`auto`),onChange:e=>D({zIndex:e===``?void 0:parseInt(e)}),units:[``],placeholder:`Auto`}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Overflow`}),(0,r.jsxs)(Wy,{value:j(`overflow`,`visible`),onValueChange:e=>D({overflow:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`visible`,children:`Visível`}),(0,r.jsx)(Y,{value:`hidden`,children:`Oculto`}),(0,r.jsx)(Y,{value:`scroll`,children:`Scroll`}),(0,r.jsx)(Y,{value:`auto`,children:`Auto`})]})]})]})]})}),k(`Espaçamento`,[`padding`,`margin`])&&(0,r.jsxs)(hP,{title:`Espaçamento (Margin/Padding)`,isOpen:g.spacing,onToggle:()=>w(`spacing`),onReset:()=>O([`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`]),children:[(0,r.jsx)(U,{mb:`3`,children:(0,r.jsx)(_P,{label:`Padding (Interno)`,values:{top:j(`paddingTop`,j(`padding`)),right:j(`paddingRight`,j(`padding`)),bottom:j(`paddingBottom`,j(`padding`)),left:j(`paddingLeft`,j(`padding`))},onChange:e=>{e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?D({padding:e.top,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0}):D({padding:void 0,paddingTop:e.top,paddingRight:e.right,paddingBottom:e.bottom,paddingLeft:e.left})}})}),(0,r.jsx)(U,{children:(0,r.jsx)(_P,{label:`Margin (Externo)`,values:{top:j(`marginTop`,j(`margin`)),right:j(`marginRight`,j(`margin`)),bottom:j(`marginBottom`,j(`margin`)),left:j(`marginLeft`,j(`margin`))},onChange:e=>{e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?D({margin:e.top,marginTop:void 0,marginRight:void 0,marginBottom:void 0,marginLeft:void 0}):D({margin:void 0,marginTop:e.top,marginRight:e.right,marginBottom:e.bottom,marginLeft:e.left})}})})]}),k(`Bordas`,[`border`,`radius`,`stroke`])&&(0,r.jsxs)(hP,{title:`Bordas & Cantos`,isOpen:g.borders,onToggle:()=>w(`borders`),onReset:()=>O([`border`,`borderWidth`,`borderStyle`,`borderColor`,`borderRadius`,`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`]),children:[(0,r.jsxs)(sb,{defaultValue:`all`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`all`,children:(0,r.jsx)(te,{})}),(0,r.jsx)(lb,{value:`top`,children:(0,r.jsx)(ce,{})}),(0,r.jsx)(lb,{value:`right`,children:(0,r.jsx)(oe,{})}),(0,r.jsx)(lb,{value:`bottom`,children:(0,r.jsx)(ne,{})}),(0,r.jsx)(lb,{value:`left`,children:(0,r.jsx)(ie,{})})]}),(0,r.jsx)(U,{pt:`3`,children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Estilo`}),(0,r.jsxs)(Wy,{value:j(`borderStyle`,`none`),onValueChange:e=>D({borderStyle:e}),children:[(0,r.jsx)(Gy,{style:{width:`100%`}}),(0,r.jsxs)(Ky,{children:[(0,r.jsx)(Y,{value:`none`,children:`Nenhuma`}),(0,r.jsx)(Y,{value:`solid`,children:`Sólida`}),(0,r.jsx)(Y,{value:`dashed`,children:`Tracejada`}),(0,r.jsx)(Y,{value:`dotted`,children:`Pontilhada`}),(0,r.jsx)(Y,{value:`double`,children:`Dupla`})]})]})]}),(0,r.jsx)(gP,{label:`Espessura`,value:j(`borderWidth`,`0px`),onChange:e=>D({borderWidth:e})}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Cor`}),(0,r.jsx)(tP,{color:j(`borderColor`,`#000000`),onChange:e=>D({borderColor:e})})]})]})})]}),(0,r.jsx)(U,{mt:`3`,children:(0,r.jsx)(_P,{label:`Arredondamento (Radius)`,values:{top:j(`borderTopLeftRadius`,j(`borderRadius`)),right:j(`borderTopRightRadius`,j(`borderRadius`)),bottom:j(`borderBottomRightRadius`,j(`borderRadius`)),left:j(`borderBottomLeftRadius`,j(`borderRadius`))},onChange:e=>{e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?D({borderRadius:e.top,borderTopLeftRadius:void 0,borderTopRightRadius:void 0,borderBottomRightRadius:void 0,borderBottomLeftRadius:void 0}):D({borderRadius:void 0,borderTopLeftRadius:e.top,borderTopRightRadius:e.right,borderBottomRightRadius:e.bottom,borderBottomLeftRadius:e.left})}})})]}),k(`Efeitos`,[`shadow`,`sombra`])&&(0,r.jsx)(hP,{title:`Efeitos (Sombra)`,isOpen:g.effects,onToggle:()=>w(`effects`),onReset:()=>O([`boxShadow`,`textShadow`]),children:(0,r.jsxs)(sb,{defaultValue:`box`,children:[(0,r.jsxs)(cb,{children:[(0,r.jsx)(lb,{value:`box`,children:`Box Shadow`}),(0,r.jsx)(lb,{value:`text`,children:`Text Shadow`})]}),(0,r.jsxs)(U,{pt:`3`,children:[(0,r.jsx)(ub,{value:`box`,children:(0,r.jsxs)(U,{p:`2`,style:{backgroundColor:`var(--gray-3)`,borderRadius:`var(--radius-2)`},children:[(0,r.jsxs)(W,{justify:`between`,mb:`2`,children:[(0,r.jsx)(H,{size:`1`,weight:`bold`,children:`Box Shadow`}),(0,r.jsxs)(W,{gap:`2`,align:`center`,children:[(0,r.jsx)(H,{size:`1`,children:`Inset`}),(0,r.jsx)(`input`,{type:`checkbox`,checked:I.inset,onChange:e=>re({inset:e.target.checked})})]})]}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,mb:`2`,children:[(0,r.jsx)(gP,{label:`X`,value:I.x,onChange:e=>re({x:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Y`,value:I.y,onChange:e=>re({y:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Blur`,value:I.blur,onChange:e=>re({blur:parseFloat(e)}),units:[`px`]}),(0,r.jsx)(gP,{label:`Spread`,value:I.spread,onChange:e=>re({spread:parseFloat(e)}),units:[`px`]})]}),(0,r.jsx)(tP,{color:I.color,onChange:e=>re({color:e})})]})}),(0,r.jsx)(ub,{value:`text`,children:(0,r.jsxs)(U,{p:`2`,style:{backgroundColor:`var(--gray-3)`,borderRadius:`var(--radius-2)`},children:[(0,r.jsx)(H,{size:`1`,weight:`bold`,mb:`2`,as:`div`,children:`Text Shadow`}),(0,r.jsxs)(K,{columns:`2`,gap:`2`,mb:`2`,children:[(0,r.jsx)(gP,{label:`X`,value:F(j(`textShadow`,`none`)).x,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${e}px ${t.y}px ${t.blur}px ${t.color}`})},units:[`px`]}),(0,r.jsx)(gP,{label:`Y`,value:F(j(`textShadow`,`none`)).y,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${t.x}px ${e}px ${t.blur}px ${t.color}`})},units:[`px`]}),(0,r.jsx)(gP,{label:`Blur`,value:F(j(`textShadow`,`none`)).blur,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${t.x}px ${t.y}px ${e}px ${t.color}`})},units:[`px`]})]}),(0,r.jsx)(tP,{color:F(j(`textShadow`,`none`)).color,onChange:e=>{let t=F(j(`textShadow`,`none`));D({textShadow:`${t.x}px ${t.y}px ${t.blur}px ${e}`})}})]})})]})]})}),k(`Transform`,[`scale`,`rotate`,`skew`,`translate`])&&(0,r.jsx)(hP,{title:`Transformação`,isOpen:g.transform,onToggle:()=>w(`transform`),onReset:()=>T({rotation:0,style:{...m.style,transform:void 0}}),children:(0,r.jsxs)(K,{columns:`2`,gap:`3`,children:[(0,r.jsx)(gP,{label:`Rotação (deg)`,value:m.rotation,onChange:e=>T({rotation:parseFloat(e)}),units:[`deg`]}),(0,r.jsxs)(U,{style:{gridColumn:`span 2`},children:[(0,r.jsx)(H,{size:`1`,color:`gray`,mb:`1`,as:`div`,children:`Transform CSS (Scale, Skew, Translate)`}),(0,r.jsx)(X,{value:j(`transform`,``),onChange:e=>D({transform:e.target.value}),placeholder:`ex: scale(1.5) skewX(10deg)`}),(0,r.jsxs)(H,{size:`1`,color:`gray`,mt:`1`,children:[`Use sintaxe CSS padrão. Ex: `,(0,r.jsx)(`code`,{children:`scale(1.2)`}),`, `,(0,r.jsx)(`code`,{children:`skewY(10deg)`})]})]})]})}),!h&&(0,r.jsxs)(r.Fragment,{children:[k(`Animação`,[`animation`])&&(0,r.jsx)(hP,{title:`Animação`,isOpen:g.animation,onToggle:()=>w(`animation`),onReset:()=>T({animation:void 0}),children:(0,r.jsx)(rP,{element:m,updateElement:i})}),k(`Regras`,[`condition`])&&(0,r.jsx)(hP,{title:`Regras Condicionais`,isOpen:g.conditions,onToggle:()=>w(`conditions`),onReset:()=>T({conditions:[]}),children:(0,r.jsx)(mP,{element:m,updateElement:i,availableProps:e.availableProps||[]})}),k(`Formatação`,[`format`])&&(0,r.jsx)(hP,{title:`Formatação`,isOpen:g.formatting,onToggle:()=>w(`formatting`),onReset:()=>T({formatting:void 0}),children:(0,r.jsx)(iP,{element:m,updateElement:i})})]})]},m?.id??d.join(`,`))]})})};var xP=20,SP=`#f5f5f5`,CP=`#999`;let wP=({orientation:e})=>{let{state:n}=rS(),{zoom:i,pan:a}=n,o=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let t=o.current;if(!t)return;let n=t.getContext(`2d`);if(!n)return;let r=t.width,s=t.height;n.fillStyle=SP,n.fillRect(0,0,r,s),n.fillStyle=CP,n.font=`10px sans-serif`,n.strokeStyle=CP,n.lineWidth=1;let c=e===`horizontal`?-a.x/i:-a.y/i,l=e===`horizontal`?(r-a.x)/i:(s-a.y)/i,u=100;u=i>2?10:i>.8?50:i>.4?100:200;let d=Math.floor(c/u)*u;n.beginPath();for(let t=d;t<l;t+=u){let r=t*i+(e===`horizontal`?a.x:a.y);e===`horizontal`?(n.moveTo(r,0),n.lineTo(r,xP),n.fillText(t.toString(),r+2,10)):(n.moveTo(0,r),n.lineTo(xP,r),n.save(),n.translate(10,r+2),n.rotate(-Math.PI/2),n.fillText(t.toString(),0,0),n.restore())}n.stroke()},[i,a,e,n.canvasHeight]),(0,t.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{let t=e.parentElement?.getBoundingClientRect();t&&(e.width=t.width,e.height=t.height)});return e.parentElement&&t.observe(e.parentElement),()=>t.disconnect()},[]),(0,r.jsx)(`canvas`,{ref:o,style:{width:`100%`,height:`100%`,display:`block`,pointerEvents:`none`}})};var TP=({icon:e,label:n,keys:i})=>(0,r.jsxs)(W,{align:`center`,justify:`between`,py:`2`,children:[(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(U,{style:{color:`var(--gray-10)`},children:(0,r.jsx)(e,{})}),(0,r.jsx)(H,{size:`2`,children:n})]}),(0,r.jsx)(W,{gap:`1`,children:i.map((e,n)=>(0,r.jsxs)(t.default.Fragment,{children:[(0,r.jsx)(Ey,{children:e}),n<i.length-1&&(0,r.jsx)(H,{size:`1`,color:`gray`,children:`+`})]},n))})]});let EP=()=>(0,r.jsxs)(ny,{children:[(0,r.jsx)(ry,{children:(0,r.jsxs)(G,{variant:`solid`,color:`amber`,radius:`full`,style:{height:36,padding:`0 14px`,boxShadow:`0 4px 6px rgba(0,0,0,0.1)`},title:`Atalhos de Teclado`,children:[(0,r.jsx)(gt,{width:`18`,height:`18`}),`Ajuda`]})}),(0,r.jsxs)(iy,{style:{maxWidth:700},onPointerDown:e=>e.stopPropagation(),children:[(0,r.jsx)(ay,{children:`Atalhos de Teclado`}),(0,r.jsx)(H,{size:`2`,color:`gray`,mb:`4`,as:`p`,children:`Agilize seu fluxo de trabalho com estes atalhos.`}),(0,r.jsxs)(K,{columns:{initial:`1`,sm:`2`},gap:`6`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,color:`blue`,children:`Edição Básica`}),(0,r.jsx)(Qy,{size:`4`,mb:`2`}),(0,r.jsx)(TP,{icon:It,label:`Desfazer`,keys:[`Ctrl`,`Z`]}),(0,r.jsx)(TP,{icon:It,label:`Refazer`,keys:[`Ctrl`,`Y`]}),(0,r.jsx)(TP,{icon:Se,label:`Copiar`,keys:[`Ctrl`,`C`]}),(0,r.jsx)(TP,{icon:Se,label:`Colar`,keys:[`Ctrl`,`V`]}),(0,r.jsx)(TP,{icon:Xt,label:`Excluir`,keys:[`Delete`]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,mb:`2`,color:`blue`,children:`Navegação e Seleção`}),(0,r.jsx)(Qy,{size:`4`,mb:`2`}),(0,r.jsx)(TP,{icon:ut,label:`Mover Elemento`,keys:[`Setas`]}),(0,r.jsx)(TP,{icon:ut,label:`Mover Rápido`,keys:[`Shift`,`Setas`]}),(0,r.jsx)(TP,{icon:Oe,label:`Multiseleção`,keys:[`Shift`,`Click`]}),(0,r.jsx)(TP,{icon:wt,label:`Mover Canvas (Pan)`,keys:[`Espaço`,`Arrastar`]}),(0,r.jsx)(TP,{icon:ot,label:`Zoom`,keys:[`Ctrl`,`Scroll`]})]})]}),(0,r.jsx)(W,{justify:`end`,mt:`5`,children:(0,r.jsx)(sy,{children:(0,r.jsx)(G,{variant:`soft`,color:`gray`,children:`Fechar`})})})]})]}),DP=()=>{let{state:e,updateListSettings:n,setCanvasHeight:i,setGridSize:a}=rS(),[o,s]=(0,t.useState)(!1),[c,l]=(0,t.useState)(``),[u,d]=(0,t.useState)(`asc`),[f,p]=(0,t.useState)(`bottom`),[m,h]=(0,t.useState)(`down`),[g,_]=(0,t.useState)(`150`),[v,y]=(0,t.useState)(``),[b,x]=(0,t.useState)(`0`),[S,C]=(0,t.useState)(`slideIn`),[w,T]=(0,t.useState)(.3),[E,D]=(0,t.useState)(`ease-out`),O=t.default.useRef(!1);return(0,t.useEffect)(()=>{if(o&&!O.current){O.current=!0,l(e.listSettings.sortProp||`__none__`),d(e.listSettings.sortOrder||`asc`),p(e.listSettings.newestPosition||`bottom`),h(e.listSettings.scrollDirection||`down`),y(e.listSettings.containerHeight?String(e.listSettings.containerHeight):``),_(String(e.canvasHeight||150)),x(String(e.gridSize||0));let t=e.listSettings.entryAnimation;C(t?.type||`slideIn`),T(t?.duration||.3),D(t?.timingFunction||`ease-out`)}o||(O.current=!1)},[o]),(0,t.useEffect)(()=>{if(!o)return;let e=parseInt(g,10);!isNaN(e)&&e>0&&i(e);let t=parseInt(b,10);!isNaN(t)&&t>=0&&a(t)},[g,b,o,i,a]),(0,r.jsxs)(ny,{open:o,onOpenChange:s,children:[(0,r.jsx)(ry,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`center`,cursor:`pointer`},children:[(0,r.jsx)(Je,{}),` Configurações`]})}),(0,r.jsxs)(iy,{style:{maxWidth:600},children:[(0,r.jsx)(ay,{children:`Configurações do Editor`}),(0,r.jsx)(oy,{size:`2`,mb:`4`,children:`Configure o comportamento da lista.`}),(0,r.jsx)(U,{pt:`3`,children:(0,r.jsxs)(W,{direction:`column`,gap:`3`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Ordenação`}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Propriedade para Ordenar`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[c===`__none__`?`(Nenhum)`:e.availableProps.find(e=>e.dataName===c)?.name||c,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>l(`__none__`),children:`(Nenhum)`}),e.availableProps.map(e=>(0,r.jsx)(q,{onSelect:()=>l(e.dataName),children:e.name},e.dataName))]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Direção`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:150,justifyContent:`space-between`},children:[u===`asc`?`Crescente (A-Z)`:`Decrescente (Z-A)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>d(`asc`),children:`Crescente (A-Z)`}),(0,r.jsx)(q,{onSelect:()=>d(`desc`),children:`Decrescente (Z-A)`})]})]})]})]}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Posição do Recente`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[f===`top`?`Topo (Início)`:`Base (Final)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>p(`top`),children:`Topo (Início)`}),(0,r.jsx)(q,{onSelect:()=>p(`bottom`),children:`Base (Final)`})]})]})]}),(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Comportamento de Rolagem`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[m===`down`?`Descer (Padrão)`:`Subir (Chat)`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>h(`down`),children:`Descer (Padrão)`}),(0,r.jsx)(q,{onSelect:()=>h(`up`),children:`Subir (Chat)`})]})]})]})]}),(0,r.jsx)(H,{size:`2`,weight:`bold`,mt:`2`,children:`Dimensões`}),(0,r.jsxs)(W,{gap:`3`,align:`center`,children:[(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Altura do Item (Template) (px)`}),(0,r.jsx)(X,{type:`number`,min:`10`,value:g,onChange:e=>_(e.target.value)}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Altura de cada item individual na lista.`})]}),(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Altura da Lista (Container) (px)`}),(0,r.jsx)(X,{type:`number`,min:`0`,placeholder:`Auto (100%)`,value:v,onChange:e=>y(e.target.value)}),(0,r.jsx)(H,{size:`1`,color:`gray`,children:`Altura total da lista. Se exceder, rola. Vazio = 100%.`})]})]}),(0,r.jsx)(H,{size:`2`,weight:`bold`,mt:`2`,children:`Animação de Entrada na Lista`}),(0,r.jsxs)(K,{columns:`3`,gap:`3`,children:[(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Efeito`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[S===`slideIn`?`Slide (Padrão)`:S===`smoothSlideUp`?`Slide Suave (Up)`:S===`fadeIn`?`Fade In`:S===`popIn`?`Pop In`:S===`blurIn`?`Blur In`:S===`slideInLeft`?`Slide (Esq)`:S===`slideInRight`?`Slide (Dir)`:S===`zoomIn`?`Zoom In`:S===`bounceIn`?`Bounce`:`Nenhum`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>C(`none`),children:`Nenhum`}),(0,r.jsx)(q,{onSelect:()=>C(`slideIn`),children:`Slide (Padrão)`}),(0,r.jsx)(q,{onSelect:()=>C(`smoothSlideUp`),children:`Slide Suave (Up)`}),(0,r.jsx)(q,{onSelect:()=>C(`fadeIn`),children:`Fade In`}),(0,r.jsx)(q,{onSelect:()=>C(`popIn`),children:`Pop In`}),(0,r.jsx)(q,{onSelect:()=>C(`blurIn`),children:`Blur In`}),(0,r.jsx)(q,{onSelect:()=>C(`slideInLeft`),children:`Slide (Esq)`}),(0,r.jsx)(q,{onSelect:()=>C(`slideInRight`),children:`Slide (Dir)`}),(0,r.jsx)(q,{onSelect:()=>C(`zoomIn`),children:`Zoom In`}),(0,r.jsx)(q,{onSelect:()=>C(`bounceIn`),children:`Bounce`})]})]})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Duração (s)`}),(0,r.jsx)(X,{type:`number`,step:`0.1`,min:`0.1`,value:w,onChange:e=>T(parseFloat(e.target.value)||.3)})]}),(0,r.jsxs)(U,{children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Curva (Easing)`}),(0,r.jsxs)(ly,{children:[(0,r.jsx)(uy,{children:(0,r.jsxs)(G,{variant:`soft`,color:`gray`,style:{width:`100%`,justifyContent:`space-between`},children:[E===`ease-out`?`Ease Out`:E===`linear`?`Linear`:E===`bounce`?`Bounce`:`Ease`,(0,r.jsx)(ve,{})]})}),(0,r.jsxs)(fy,{style:{zIndex:1e5},children:[(0,r.jsx)(q,{onSelect:()=>D(`ease`),children:`Ease`}),(0,r.jsx)(q,{onSelect:()=>D(`ease-out`),children:`Ease Out`}),(0,r.jsx)(q,{onSelect:()=>D(`linear`),children:`Linear`}),(0,r.jsx)(q,{onSelect:()=>D(`bounce`),children:`Bounce`})]})]})]})]}),(0,r.jsxs)(U,{mt:`2`,children:[(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Grid Snapping (Travar)`}),(0,r.jsx)(W,{gap:`3`,align:`center`,mt:`2`,children:(0,r.jsxs)(U,{flexGrow:`1`,children:[(0,r.jsx)(H,{size:`1`,mb:`1`,as:`div`,children:`Tamanho do Grid (px) - 0 para desativar`}),(0,r.jsx)(X,{type:`number`,value:b,onChange:e=>x(e.target.value),placeholder:`0`})]})})]})]})}),(0,r.jsxs)(W,{gap:`3`,mt:`4`,justify:`end`,children:[(0,r.jsx)(sy,{children:(0,r.jsx)(G,{variant:`soft`,color:`gray`,children:`Cancelar`})}),(0,r.jsx)(sy,{children:(0,r.jsx)(G,{onClick:()=>{let e=parseInt(v,10),t=parseInt(g,10),r=parseInt(b,10),o={type:S,duration:Number(w),delay:0,timingFunction:E};n({sortProp:c===`__none__`?``:c,sortOrder:u,newestPosition:f,scrollDirection:m,containerHeight:!isNaN(e)&&e>0?e:void 0,entryAnimation:o}),!isNaN(t)&&t>0&&i(t),!isNaN(r)&&r>=0&&a(r),s(!1)},children:`Salvar Alterações`})})]})]})]})},OP=({onClose:e})=>{let{state:t,jumpToHistory:n,undo:i,redo:a}=rS(),o=t=>{n(t),e&&e()};return(0,r.jsxs)(W,{direction:`column`,style:{width:`100%`},children:[(0,r.jsxs)(W,{justify:`between`,align:`center`,p:`2`,style:{borderBottom:`1px solid var(--gray-5)`},children:[(0,r.jsxs)(W,{align:`center`,gap:`2`,children:[(0,r.jsx)(vt,{}),(0,r.jsx)(H,{size:`2`,weight:`bold`,children:`Histórico`})]}),(0,r.jsxs)(W,{gap:`2`,children:[(0,r.jsx)(G,{size:`1`,variant:`soft`,onClick:i,disabled:t.historyIndex<=0,children:`Desfazer`}),(0,r.jsx)(G,{size:`1`,variant:`soft`,onClick:a,disabled:t.historyIndex>=t.history.length-1,children:`Refazer`})]})]}),(0,r.jsx)(U,{p:`0`,children:t.history.map((e,n)=>{let i=n===t.historyIndex,a=n>t.historyIndex,s=t.historyDescriptions?.[n]||(n===0?`Estado Inicial`:`Alteração ${n}`);return(0,r.jsx)(U,{p:`2`,style:{backgroundColor:i?`var(--accent-3)`:`transparent`,opacity:a?.5:1,cursor:`pointer`,borderBottom:`1px solid var(--gray-3)`},onClick:()=>o(n),className:`history-item`,children:(0,r.jsxs)(W,{align:`center`,justify:`between`,children:[(0,r.jsx)(H,{size:`2`,weight:i?`bold`:`regular`,children:s}),i&&(0,r.jsx)(H,{size:`1`,color:`blue`,children:`Atual`})]})},n)})})]})};function kP(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return(0,t.useMemo)(()=>e=>{n.forEach(t=>t(e))},n)}var AP=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function jP(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function MP(e){return`nodeType`in e}function NP(e){return e?jP(e)?e:MP(e)?e.ownerDocument?.defaultView??window:window:window}function PP(e){let{Document:t}=NP(e);return e instanceof t}function FP(e){return jP(e)?!1:e instanceof NP(e).HTMLElement}function IP(e){return e instanceof NP(e).SVGElement}function LP(e){return e?jP(e)?e.document:MP(e)?PP(e)?e:FP(e)||IP(e)?e.ownerDocument:document:document:document}var RP=AP?t.useLayoutEffect:t.useEffect;function zP(e){let n=(0,t.useRef)(e);return RP(()=>{n.current=e}),(0,t.useCallback)(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.current==null?void 0:n.current(...t)},[])}function BP(){let e=(0,t.useRef)(null);return[(0,t.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,t.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function VP(e,n){n===void 0&&(n=[e]);let r=(0,t.useRef)(e);return RP(()=>{r.current!==e&&(r.current=e)},n),r}function HP(e,n){let r=(0,t.useRef)();return(0,t.useMemo)(()=>{let t=e(r.current);return r.current=t,t},[...n])}function UP(e){let n=zP(e),r=(0,t.useRef)(null);return[r,(0,t.useCallback)(e=>{e!==r.current&&n?.(e,r.current),r.current=e},[])]}function WP(e){let n=(0,t.useRef)();return(0,t.useEffect)(()=>{n.current=e},[e]),n.current}var GP={};function KP(e,n){return(0,t.useMemo)(()=>{if(n)return n;let t=GP[e]==null?0:GP[e]+1;return GP[e]=t,e+`-`+t},[e,n])}function qP(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var JP=qP(1),YP=qP(-1);function XP(e){return`clientX`in e&&`clientY`in e}function ZP(e){if(!e)return!1;let{KeyboardEvent:t}=NP(e.target);return t&&e instanceof t}function QP(e){if(!e)return!1;let{TouchEvent:t}=NP(e.target);return t&&e instanceof t}function $P(e){if(QP(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return XP(e)?{x:e.clientX,y:e.clientY}:null}var eF=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[eF.Translate.toString(e),eF.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),tF=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function nF(e){return e.matches(tF)?e:e.querySelector(tF)}var rF={display:`none`};function iF(e){let{id:n,value:r}=e;return t.default.createElement(`div`,{id:n,style:rF},r)}function aF(e){let{id:n,announcement:r,ariaLiveType:i=`assertive`}=e;return t.default.createElement(`div`,{id:n,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":i,"aria-atomic":!0},r)}function oF(){let[e,n]=(0,t.useState)(``);return{announce:(0,t.useCallback)(e=>{e!=null&&n(e)},[]),announcement:e}}var sF=(0,t.createContext)(null);function cF(e){let n=(0,t.useContext)(sF);(0,t.useEffect)(()=>{if(!n)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return n(e)},[e,n])}function lF(){let[e]=(0,t.useState)(()=>new Set),n=(0,t.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,t.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),n]}var uF={draggable:`
|
|
58
58
|
To pick up a draggable item, press the space bar.
|
|
59
59
|
While dragging, use the arrow keys to move the item.
|
|
60
60
|
Press space again to drop the item in its new position, or press escape to cancel.
|