@accounter/client 0.0.8-alpha-20251021163440-2ab1a9ffaec95fd99fac5495c3a392b97429ce77 → 0.0.8-alpha-20251021225827-178e480c997a9811913e16f85cb94329041b096e

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +27 -3
  2. package/dist/assets/Checkbox-CxedbJAl.js +6 -0
  3. package/dist/assets/Progress-D5SuJtCd.js +1 -0
  4. package/dist/assets/Typography-BQFz-z7L.js +1 -0
  5. package/dist/assets/accordion-COWOBKuq.js +1 -0
  6. package/dist/assets/accountant-approvals-Bd2y8us_.js +1 -0
  7. package/dist/assets/all-charges-SWBnaZu7.js +1 -0
  8. package/dist/assets/arrow-up-down-dZmrBLse.js +6 -0
  9. package/dist/assets/business--GVVfDEa.js +37 -0
  10. package/dist/assets/business-transactions-single-BsbkUf_H.js +1 -0
  11. package/dist/assets/business-trip-ByXPVXdG.js +1 -0
  12. package/dist/assets/charges-filters-D43UbXob.js +1 -0
  13. package/dist/assets/charges-ledger-validation-D0uMH_JE.js +1 -0
  14. package/dist/assets/chart-ClU1KbWe.js +74 -0
  15. package/dist/assets/data-table-pagination-D9Y0_Tn8.js +11 -0
  16. package/dist/assets/editable-business-trip-DhqOQBPa.js +16 -0
  17. package/dist/assets/graphql-document-dedupe-fragments-ByT8-wlV.js +1 -0
  18. package/dist/assets/index-1U6rQgQe.js +6 -0
  19. package/dist/assets/index-3-AKn8tg.js +1 -0
  20. package/dist/assets/index-91A2PLZ6.js +137 -0
  21. package/dist/assets/index-BBHuCWRn.js +1 -0
  22. package/dist/assets/index-BPNuFFtx.js +1 -0
  23. package/dist/assets/index-BXqHnRVY.js +1 -0
  24. package/dist/assets/index-BciOH8FS.js +1 -0
  25. package/dist/assets/index-BjHuUHDO.js +1 -0
  26. package/dist/assets/index-BxKmoNQd.js +1 -0
  27. package/dist/assets/index-C3bqiFIv.js +2 -0
  28. package/dist/assets/index-C5MeepK_.js +11 -0
  29. package/dist/assets/index-CAwm68Mg.js +1 -0
  30. package/dist/assets/index-CJ8OGXxv.js +1 -0
  31. package/dist/assets/index-CJyY-qF6.js +1 -0
  32. package/dist/assets/index-CMYnx46_.js +6 -0
  33. package/dist/assets/index-CNrwxUZ7.js +1 -0
  34. package/dist/assets/index-CvV5z5r9.js +876 -0
  35. package/dist/assets/index-D08H2GXq.js +17 -0
  36. package/dist/assets/index-GFsPY1p4.js +2 -0
  37. package/dist/assets/index-KwNwThNu.js +1 -0
  38. package/dist/assets/index-YA8IBFyB.js +1 -0
  39. package/dist/assets/index-ZpyI3qxW.js +24 -0
  40. package/dist/assets/index-gdTXrWXt.css +1 -0
  41. package/dist/assets/index-ytnIEraq.js +9 -0
  42. package/dist/assets/{index.es-CWwhWGxX.js → index.es-CYeQ4a5s.js} +5 -5
  43. package/dist/assets/issue-document-CdikNnO2.js +1 -0
  44. package/dist/assets/login-page-effgZS3V.js +1 -0
  45. package/dist/assets/missing-info-charges-CnPFTzoZ.js +1 -0
  46. package/dist/assets/page-not-found-D8YlgDOm.js +1 -0
  47. package/dist/assets/pencil-mxW0-tGM.js +6 -0
  48. package/dist/assets/report-commentary-row-DCozKgVE.js +1 -0
  49. package/dist/assets/save-CHlytUqu.js +11 -0
  50. package/dist/assets/sequential-CAnleQny.js +1 -0
  51. package/dist/assets/similar-charges-by-business-modal-Dzbspk_r.js +1 -0
  52. package/dist/assets/sub-Cp_PhKiD.js +1 -0
  53. package/dist/assets/subMonths-DCj_iXAn.js +1 -0
  54. package/dist/index.html +2 -2
  55. package/package.json +1 -1
  56. package/src/components/business-transactions/business-extended-info.tsx +13 -15
  57. package/src/components/business-transactions/business-transactions-single.tsx +3 -3
  58. package/src/components/business-transactions/index.tsx +12 -1
  59. package/src/components/business-trips/business-trip.tsx +3 -3
  60. package/src/components/charges/cells/business-trip.tsx +6 -8
  61. package/src/components/charges/cells/counterparty.tsx +7 -5
  62. package/src/components/common/accounter-table.tsx +6 -5
  63. package/src/components/common/business-trip-report/parts/core-expense-row.tsx +11 -9
  64. package/src/components/common/business-trip-report/parts/uncategorized-transactions.tsx +11 -13
  65. package/src/components/common/buttons/index.ts +0 -2
  66. package/src/components/common/buttons/logout-button.tsx +7 -6
  67. package/src/components/common/documents-to-charge-matcher/selection-handler/index.tsx +4 -2
  68. package/src/components/common/documents-to-charge-matcher/selection-handler/wide-filtered-selection.tsx +5 -7
  69. package/src/components/common/forms/edit-document.tsx +23 -10
  70. package/src/components/common/new-documents-list.tsx +10 -8
  71. package/src/components/documents-table/cells/creditor.tsx +11 -4
  72. package/src/components/documents-table/cells/debtor.tsx +11 -4
  73. package/src/components/error-boundary.tsx +189 -0
  74. package/src/components/layout/breadcrumbs.tsx +77 -0
  75. package/src/components/layout/dashboard-layout.tsx +4 -0
  76. package/src/components/layout/document-title.tsx +31 -0
  77. package/src/components/layout/navigation-progress.tsx +52 -0
  78. package/src/components/layout/page-skeleton.tsx +49 -0
  79. package/src/components/layout/sidelinks.tsx +28 -27
  80. package/src/components/ledger-table/counterparty-cell.tsx +19 -13
  81. package/src/components/login-page.tsx +2 -1
  82. package/src/components/reports/corporate-tax-ruling-compliance-report/index.tsx +3 -3
  83. package/src/components/reports/profit-and-loss-report/index.tsx +3 -3
  84. package/src/components/reports/tax-report/index.tsx +3 -3
  85. package/src/components/screens/businesses/business.tsx +21 -9
  86. package/src/components/screens/charges/charge.tsx +22 -9
  87. package/src/components/transactions-table/cells/counterparty.tsx +9 -2
  88. package/src/components/transactions-table/cells-legacy/counterparty.tsx +9 -2
  89. package/src/index.tsx +4 -22
  90. package/src/providers/auth-guard.tsx +14 -23
  91. package/src/providers/index.tsx +7 -2
  92. package/src/providers/urql-client.ts +86 -0
  93. package/src/providers/urql.tsx +7 -12
  94. package/src/providers/user-provider.tsx +3 -2
  95. package/src/router/config.tsx +534 -0
  96. package/src/router/layouts/dashboard-layout.tsx +20 -0
  97. package/src/router/layouts/root-layout.tsx +69 -0
  98. package/src/router/loaders/auth-loader.ts +32 -0
  99. package/src/router/loaders/business-loader.ts +25 -0
  100. package/src/router/loaders/charge-loader.ts +25 -0
  101. package/src/router/loaders/index.ts +17 -0
  102. package/src/router/routes.ts +88 -0
  103. package/src/router/types.ts +62 -0
  104. package/dist/assets/index-B2UYAO1O.css +0 -1
  105. package/dist/assets/index-BexxGuN6.js +0 -1224
  106. package/src/components/common/buttons/button-with-label.tsx +0 -41
  107. package/src/components/common/buttons/button.tsx +0 -44
@@ -0,0 +1,137 @@
1
+ import{V as it,r as m,d8 as Nc,a6 as V,dd as kc,a7 as ae,j as v,db as vn,dX as It,dY as ge,dZ as Ho,de as Lc,d_ as Vc,d$ as rn,e0 as jc,c_ as rr,u as Wo,ad as zr,ae as $r,bA as Fc,B as ee,d0 as Bc,ag as Ur,ah as Hr,ai as Wr,k as Go,cd as _c,U as zc,bP as An,ch as $c,bU as Bi,bV as _i,Z as sn,aG as Ko,bd as qo,d1 as Uc,p as Yo,e1 as Hc,t as Pe,s as Xo,cN as yn,a as ir,e2 as Wc,dk as Gc,e3 as Kc,dA as qc,dB as Yc,dC as Xc,L as Zo,Q as Gr,dn as Zc,dp as Jc,dq as Nn,dr as Qc,ds as zi,dt as eu,du as $i,dv as Jo,dw as Qo,dx as ea,e4 as tu,e5 as nu,e6 as on,e7 as ru,ab as iu,ac as su,l as ou,ak as au,al as lu,am as cu,aq as uu,ao as du,aw as hu,ax as Ui,dS as fu,e8 as pu,g as gu,an as mu,Y as Hi,e9 as vu,ea as yu,eb as Wi,c3 as bu,P as Tu,b as xu,be as Su,a_ as wu,F as Du,aJ as Cu,ec as Eu,ed as Ou}from"./index-CvV5z5r9.js";import{A as Gi}from"./arrow-up-down-dZmrBLse.js";import{_ as Pu,a as bn,s as we,g as Kr,u as Ki,c as qr,m as wt,d as sr,T as or}from"./Typography-BQFz-z7L.js";import{P as Mu}from"./pencil-mxW0-tGM.js";/**
2
+ * @license lucide-react v0.546.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ru=[["path",{d:"m10.852 19.772-.383.924",key:"r7sl7d"}],["path",{d:"m13.148 14.228.383-.923",key:"1d5zpm"}],["path",{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1ydik7"}],["path",{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1m1vsf"}],["path",{d:"m14.772 15.852.923-.383",key:"660p6e"}],["path",{d:"m14.772 18.148.923.383",key:"hrcpis"}],["path",{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2",key:"j2q98n"}],["path",{d:"m9.228 15.852-.923-.383",key:"1p9ong"}],["path",{d:"m9.228 18.148-.923.383",key:"6558rz"}]],Iu=it("cloud-cog",Ru);/**
7
+ * @license lucide-react v0.546.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Au=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Nu=it("cloud-upload",Au);/**
12
+ * @license lucide-react v0.546.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const ku=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ta=it("ellipsis",ku);/**
17
+ * @license lucide-react v0.546.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Lu=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Vu=it("folder-open",Lu);/**
22
+ * @license lucide-react v0.546.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const ju=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Fu=it("folder-plus",ju);/**
27
+ * @license lucide-react v0.546.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Bu=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],_u=it("folder",Bu);function Kt(t){const e=m.useRef(t);return Nc(()=>{e.current=t}),m.useRef((...n)=>(0,e.current)(...n)).current}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ar(t,e)}function zu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ar(t,e)}const qi=V.createContext(null);function $u(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yr(t,e){var n=function(s){return e&&m.isValidElement(s)?e(s):s},r=Object.create(null);return t&&m.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Uu(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var r=Object.create(null),i=[];for(var s in t)s in e?i.length&&(r[s]=i,i=[]):i.push(s);var o,a={};for(var l in e){if(r[l])for(o=0;o<r[l].length;o++){var c=r[l][o];a[r[l][o]]=n(c)}a[l]=n(l)}for(o=0;o<i.length;o++)a[i[o]]=n(i[o]);return a}function _e(t,e,n){return n[e]!=null?n[e]:t.props[e]}function Hu(t,e){return Yr(t.children,function(n){return m.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:_e(n,"appear",t),enter:_e(n,"enter",t),exit:_e(n,"exit",t)})})}function Wu(t,e,n){var r=Yr(t.children),i=Uu(e,r);return Object.keys(i).forEach(function(s){var o=i[s];if(m.isValidElement(o)){var a=s in e,l=s in r,c=e[s],u=m.isValidElement(c)&&!c.props.in;l&&(!a||u)?i[s]=m.cloneElement(o,{onExited:n.bind(null,o),in:!0,exit:_e(o,"exit",t),enter:_e(o,"enter",t)}):!l&&a&&!u?i[s]=m.cloneElement(o,{in:!1}):l&&a&&m.isValidElement(c)&&(i[s]=m.cloneElement(o,{onExited:n.bind(null,o),in:c.props.in,exit:_e(o,"exit",t),enter:_e(o,"enter",t)}))}}),i}var Gu=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},Ku={component:"div",childFactory:function(e){return e}},Xr=(function(t){zu(e,t);function e(r,i){var s;s=t.call(this,r,i)||this;var o=s.handleExited.bind($u(s));return s.state={contextValue:{isMounting:!0},handleExited:o,firstRender:!0},s}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(i,s){var o=s.children,a=s.handleExited,l=s.firstRender;return{children:l?Hu(i,a):Wu(i,o,a),firstRender:!1}},n.handleExited=function(i,s){var o=Yr(this.props.children);i.key in o||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(a){var l=kc({},a.children);return delete l[i.key],{children:l}}))},n.render=function(){var i=this.props,s=i.component,o=i.childFactory,a=Pu(i,["component","childFactory"]),l=this.state.contextValue,c=Gu(this.state.children).map(o);return delete a.appear,delete a.enter,delete a.exit,s===null?V.createElement(qi.Provider,{value:l},c):V.createElement(qi.Provider,{value:l},V.createElement(s,a,c))},e})(V.Component);Xr.propTypes={};Xr.defaultProps=Ku;const Yi={};function na(t,e){const n=m.useRef(Yi);return n.current===Yi&&(n.current=t(e)),n}const qu=[];function Yu(t){m.useEffect(t,qu)}class Zr{static create(){return new Zr}currentId=null;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Xu(){const t=na(Zr.create).current;return Yu(t.disposeEffect),t}function Xi(t){try{return t.matches(":focus-visible")}catch{}return!1}class an{static create(){return new an}static use(){const e=na(an.create).current,[n,r]=m.useState(!1);return e.shouldMount=n,e.setShouldMount=r,m.useEffect(e.mountEffect,[n]),e}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=Ju(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}}function Zu(){return an.use()}function Ju(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n}function Qu(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:s,rippleSize:o,in:a,onExited:l,timeout:c}=t,[u,d]=m.useState(!1),h=ae(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),f={width:o,height:o,top:-(o/2)+s,left:-(o/2)+i},p=ae(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&d(!0),m.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),v.jsx("span",{className:h,style:f,children:v.jsx("span",{className:p})})}const le=bn("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),lr=550,ed=80,td=It`
32
+ 0% {
33
+ transform: scale(0);
34
+ opacity: 0.1;
35
+ }
36
+
37
+ 100% {
38
+ transform: scale(1);
39
+ opacity: 0.3;
40
+ }
41
+ `,nd=It`
42
+ 0% {
43
+ opacity: 1;
44
+ }
45
+
46
+ 100% {
47
+ opacity: 0;
48
+ }
49
+ `,rd=It`
50
+ 0% {
51
+ transform: scale(1);
52
+ }
53
+
54
+ 50% {
55
+ transform: scale(0.92);
56
+ }
57
+
58
+ 100% {
59
+ transform: scale(1);
60
+ }
61
+ `,id=we("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),sd=we(Qu,{name:"MuiTouchRipple",slot:"Ripple"})`
62
+ opacity: 0;
63
+ position: absolute;
64
+
65
+ &.${le.rippleVisible} {
66
+ opacity: 0.3;
67
+ transform: scale(1);
68
+ animation-name: ${td};
69
+ animation-duration: ${lr}ms;
70
+ animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut};
71
+ }
72
+
73
+ &.${le.ripplePulsate} {
74
+ animation-duration: ${({theme:t})=>t.transitions.duration.shorter}ms;
75
+ }
76
+
77
+ & .${le.child} {
78
+ opacity: 1;
79
+ display: block;
80
+ width: 100%;
81
+ height: 100%;
82
+ border-radius: 50%;
83
+ background-color: currentColor;
84
+ }
85
+
86
+ & .${le.childLeaving} {
87
+ opacity: 0;
88
+ animation-name: ${nd};
89
+ animation-duration: ${lr}ms;
90
+ animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut};
91
+ }
92
+
93
+ & .${le.childPulsate} {
94
+ position: absolute;
95
+ /* @noflip */
96
+ left: 0px;
97
+ top: 0;
98
+ animation-name: ${rd};
99
+ animation-duration: 2500ms;
100
+ animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut};
101
+ animation-iteration-count: infinite;
102
+ animation-delay: 200ms;
103
+ }
104
+ `,od=m.forwardRef(function(e,n){const r=vn({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:s={},className:o,...a}=r,[l,c]=m.useState([]),u=m.useRef(0),d=m.useRef(null);m.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const h=m.useRef(!1),f=Xu(),p=m.useRef(null),g=m.useRef(null),b=m.useCallback(w=>{const{pulsate:S,rippleX:C,rippleY:R,rippleSize:D,cb:N}=w;c(A=>[...A,v.jsx(sd,{classes:{ripple:ae(s.ripple,le.ripple),rippleVisible:ae(s.rippleVisible,le.rippleVisible),ripplePulsate:ae(s.ripplePulsate,le.ripplePulsate),child:ae(s.child,le.child),childLeaving:ae(s.childLeaving,le.childLeaving),childPulsate:ae(s.childPulsate,le.childPulsate)},timeout:lr,pulsate:S,rippleX:C,rippleY:R,rippleSize:D},u.current)]),u.current+=1,d.current=N},[s]),y=m.useCallback((w={},S={},C=()=>{})=>{const{pulsate:R=!1,center:D=i||S.pulsate,fakeElement:N=!1}=S;if(w?.type==="mousedown"&&h.current){h.current=!1;return}w?.type==="touchstart"&&(h.current=!0);const A=N?null:g.current,H=A?A.getBoundingClientRect():{width:0,height:0,left:0,top:0};let q,L,I;if(D||w===void 0||w.clientX===0&&w.clientY===0||!w.clientX&&!w.touches)q=Math.round(H.width/2),L=Math.round(H.height/2);else{const{clientX:U,clientY:Z}=w.touches&&w.touches.length>0?w.touches[0]:w;q=Math.round(U-H.left),L=Math.round(Z-H.top)}if(D)I=Math.sqrt((2*H.width**2+H.height**2)/3),I%2===0&&(I+=1);else{const U=Math.max(Math.abs((A?A.clientWidth:0)-q),q)*2+2,Z=Math.max(Math.abs((A?A.clientHeight:0)-L),L)*2+2;I=Math.sqrt(U**2+Z**2)}w?.touches?p.current===null&&(p.current=()=>{b({pulsate:R,rippleX:q,rippleY:L,rippleSize:I,cb:C})},f.start(ed,()=>{p.current&&(p.current(),p.current=null)})):b({pulsate:R,rippleX:q,rippleY:L,rippleSize:I,cb:C})},[i,b,f]),T=m.useCallback(()=>{y({},{pulsate:!0})},[y]),x=m.useCallback((w,S)=>{if(f.clear(),w?.type==="touchend"&&p.current){p.current(),p.current=null,f.start(0,()=>{x(w,S)});return}p.current=null,c(C=>C.length>0?C.slice(1):C),d.current=S},[f]);return m.useImperativeHandle(n,()=>({pulsate:T,start:y,stop:x}),[T,y,x]),v.jsx(id,{className:ae(le.root,s.root,o),ref:g,...a,children:v.jsx(Xr,{component:null,exit:!0,children:l})})});function ad(t){return Kr("MuiButtonBase",t)}const ld=bn("MuiButtonBase",["root","disabled","focusVisible"]),cd=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,o=qr({root:["root",e&&"disabled",n&&"focusVisible"]},ad,i);return n&&r&&(o.root+=` ${r}`),o},ud=we("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${ld.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),dd=m.forwardRef(function(e,n){const r=vn({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:s=!1,children:o,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:h=!1,focusVisibleClassName:f,LinkComponent:p="a",onBlur:g,onClick:b,onContextMenu:y,onDragLeave:T,onFocus:x,onFocusVisible:w,onKeyDown:S,onKeyUp:C,onMouseDown:R,onMouseLeave:D,onMouseUp:N,onTouchEnd:A,onTouchMove:H,onTouchStart:q,tabIndex:L=0,TouchRippleProps:I,touchRippleRef:U,type:Z,...F}=r,W=m.useRef(null),B=Zu(),fe=Ki(B.ref,U),[k,Ce]=m.useState(!1);c&&k&&Ce(!1),m.useImperativeHandle(i,()=>({focusVisible:()=>{Ce(!0),W.current.focus()}}),[]);const yc=B.shouldMount&&!u&&!c;m.useEffect(()=>{k&&h&&!u&&B.pulsate()},[u,h,k,B]);const bc=ye(B,"start",R,d),Tc=ye(B,"stop",y,d),xc=ye(B,"stop",T,d),Sc=ye(B,"stop",N,d),wc=ye(B,"stop",M=>{k&&M.preventDefault(),D&&D(M)},d),Dc=ye(B,"start",q,d),Cc=ye(B,"stop",A,d),Ec=ye(B,"stop",H,d),Oc=ye(B,"stop",M=>{Xi(M.target)||Ce(!1),g&&g(M)},!1),Pc=Kt(M=>{W.current||(W.current=M.currentTarget),Xi(M.target)&&(Ce(!0),w&&w(M)),x&&x(M)}),In=()=>{const M=W.current;return l&&l!=="button"&&!(M.tagName==="A"&&M.href)},Mc=Kt(M=>{h&&!M.repeat&&k&&M.key===" "&&B.stop(M,()=>{B.start(M)}),M.target===M.currentTarget&&In()&&M.key===" "&&M.preventDefault(),S&&S(M),M.target===M.currentTarget&&In()&&M.key==="Enter"&&!c&&(M.preventDefault(),b&&b(M))}),Rc=Kt(M=>{h&&M.key===" "&&k&&!M.defaultPrevented&&B.stop(M,()=>{B.pulsate(M)}),C&&C(M),b&&M.target===M.currentTarget&&In()&&M.key===" "&&!M.defaultPrevented&&b(M)});let jt=l;jt==="button"&&(F.href||F.to)&&(jt=p);const at={};jt==="button"?(at.type=Z===void 0?"button":Z,at.disabled=c):(!F.href&&!F.to&&(at.role="button"),c&&(at["aria-disabled"]=c));const Ic=Ki(n,W),Fi={...r,centerRipple:s,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:h,tabIndex:L,focusVisible:k},Ac=cd(Fi);return v.jsxs(ud,{as:jt,className:ae(Ac.root,a),ownerState:Fi,onBlur:Oc,onClick:b,onContextMenu:Tc,onFocus:Pc,onKeyDown:Mc,onKeyUp:Rc,onMouseDown:bc,onMouseLeave:wc,onMouseUp:Sc,onDragLeave:xc,onTouchEnd:Cc,onTouchMove:Ec,onTouchStart:Dc,ref:Ic,tabIndex:c?-1:L,type:Z,...at,...F,children:[o,yc?v.jsx(od,{ref:fe,center:s,...I}):null]})});function ye(t,e,n,r=!1){return Kt(i=>(n&&n(i),r||t[e](i),!0))}function hd(t){return Kr("MuiCircularProgress",t)}bn("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","track","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const de=44,cr=It`
105
+ 0% {
106
+ transform: rotate(0deg);
107
+ }
108
+
109
+ 100% {
110
+ transform: rotate(360deg);
111
+ }
112
+ `,ur=It`
113
+ 0% {
114
+ stroke-dasharray: 1px, 200px;
115
+ stroke-dashoffset: 0;
116
+ }
117
+
118
+ 50% {
119
+ stroke-dasharray: 100px, 200px;
120
+ stroke-dashoffset: -15px;
121
+ }
122
+
123
+ 100% {
124
+ stroke-dasharray: 1px, 200px;
125
+ stroke-dashoffset: -126px;
126
+ }
127
+ `,fd=typeof cr!="string"?Ho`
128
+ animation: ${cr} 1.4s linear infinite;
129
+ `:null,pd=typeof ur!="string"?Ho`
130
+ animation: ${ur} 1.4s ease-in-out infinite;
131
+ `:null,gd=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,s={root:["root",n,`color${ge(r)}`],svg:["svg"],track:["track"],circle:["circle",`circle${ge(n)}`,i&&"circleDisableShrink"]};return qr(s,hd,e)},md=we("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${ge(n.color)}`]]}})(wt(({theme:t})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:fd||{animation:`${cr} 1.4s linear infinite`}},...Object.entries(t.palette).filter(sr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),vd=we("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),yd=we("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${ge(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(wt(({theme:t})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink,style:pd||{animation:`${ur} 1.4s ease-in-out infinite`}}]}))),bd=we("circle",{name:"MuiCircularProgress",slot:"Track"})(wt(({theme:t})=>({stroke:"currentColor",opacity:(t.vars||t).palette.action.activatedOpacity}))),Td=m.forwardRef(function(e,n){const r=vn({props:e,name:"MuiCircularProgress"}),{className:i,color:s="primary",disableShrink:o=!1,enableTrackSlot:a=!1,size:l=40,style:c,thickness:u=3.6,value:d=0,variant:h="indeterminate",...f}=r,p={...r,color:s,disableShrink:o,size:l,thickness:u,value:d,variant:h,enableTrackSlot:a},g=gd(p),b={},y={},T={};if(h==="determinate"){const x=2*Math.PI*((de-u)/2);b.strokeDasharray=x.toFixed(3),T["aria-valuenow"]=Math.round(d),b.strokeDashoffset=`${((100-d)/100*x).toFixed(3)}px`,y.transform="rotate(-90deg)"}return v.jsx(md,{className:ae(g.root,i),style:{width:l,height:l,...y,...c},ownerState:p,ref:n,role:"progressbar",...T,...f,children:v.jsxs(vd,{className:g.svg,ownerState:p,viewBox:`${de/2} ${de/2} ${de} ${de}`,children:[a?v.jsx(bd,{className:g.track,ownerState:p,cx:de,cy:de,r:(de-u)/2,fill:"none",strokeWidth:u,"aria-hidden":"true"}):null,v.jsx(yd,{className:g.circle,style:b,ownerState:p,cx:de,cy:de,r:(de-u)/2,fill:"none",strokeWidth:u})]})})});function xd(t){return Kr("MuiIconButton",t)}const Zi=bn("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Sd=t=>{const{classes:e,disabled:n,color:r,edge:i,size:s,loading:o}=t,a={root:["root",o&&"loading",n&&"disabled",r!=="default"&&`color${ge(r)}`,i&&`edge${ge(i)}`,`size${ge(s)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return qr(a,xd,e)},wd=we(dd,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.loading&&e.loading,n.color!=="default"&&e[`color${ge(n.color)}`],n.edge&&e[`edge${ge(n.edge)}`],e[`size${ge(n.size)}`]]}})(wt(({theme:t})=>({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.alpha((t.vars||t).palette.action.active,(t.vars||t).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),wt(({theme:t})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(sr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette).filter(sr()).map(([e])=>({props:{color:e},style:{"--IconButton-hoverBg":t.alpha((t.vars||t).palette[e].main,(t.vars||t).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${Zi.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled},[`&.${Zi.loading}`]:{color:"transparent"}}))),Dd=we("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:t})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(t.vars||t).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Ji=m.forwardRef(function(e,n){const r=vn({props:e,name:"MuiIconButton"}),{edge:i=!1,children:s,className:o,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:d,loading:h=null,loadingIndicator:f,...p}=r,g=Lc(d),b=f??v.jsx(Td,{"aria-labelledby":g,color:"inherit",size:16}),y={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,loading:h,loadingIndicator:b,size:u},T=Sd(y);return v.jsxs(wd,{id:h?g:d,className:ae(T.root,o),centerRipple:!0,focusRipple:!c,disabled:l||h,ref:n,...p,ownerState:y,children:[typeof h=="boolean"&&v.jsx("span",{className:T.loadingWrapper,style:{display:"contents"},children:v.jsx(Dd,{className:T.loadingIndicator,ownerState:y,children:h&&b})}),s]})}),ra=m.createContext({dragDropManager:void 0});function re(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Qi=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),es=function(){return Math.random().toString(36).substring(7).split("").join(".")},ts={INIT:"@@redux/INIT"+es(),REPLACE:"@@redux/REPLACE"+es()};function Cd(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ia(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(re(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(re(1));return n(ia)(t,e)}if(typeof t!="function")throw new Error(re(2));var i=t,s=e,o=[],a=o,l=!1;function c(){a===o&&(a=o.slice())}function u(){if(l)throw new Error(re(3));return s}function d(g){if(typeof g!="function")throw new Error(re(4));if(l)throw new Error(re(5));var b=!0;return c(),a.push(g),function(){if(b){if(l)throw new Error(re(6));b=!1,c();var T=a.indexOf(g);a.splice(T,1),o=null}}}function h(g){if(!Cd(g))throw new Error(re(7));if(typeof g.type>"u")throw new Error(re(8));if(l)throw new Error(re(9));try{l=!0,s=i(s,g)}finally{l=!1}for(var b=o=a,y=0;y<b.length;y++){var T=b[y];T()}return g}function f(g){if(typeof g!="function")throw new Error(re(10));i=g,h({type:ts.REPLACE})}function p(){var g,b=d;return g={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(re(11));function x(){T.next&&T.next(u())}x();var w=b(x);return{unsubscribe:w}}},g[Qi]=function(){return this},g}return h({type:ts.INIT}),r={dispatch:h,subscribe:d,getState:u,replaceReducer:f},r[Qi]=p,r}function P(t,e,...n){if(Ed()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function Ed(){return typeof Vc<"u"&&!0}function Od(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function Pd(t,e){return t.filter(n=>n!==e)}function sa(t){return typeof t=="object"}function Md(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((s,o)=>{s===1&&i.push(o)}),i}function Rd(t,e){return t.filter(n=>e.indexOf(n)>-1)}const Jr="dnd-core/INIT_COORDS",Tn="dnd-core/BEGIN_DRAG",Qr="dnd-core/PUBLISH_DRAG_SOURCE",xn="dnd-core/HOVER",Sn="dnd-core/DROP",wn="dnd-core/END_DRAG";function ns(t,e){return{type:Jr,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const Id={type:Jr,payload:{clientOffset:null,sourceClientOffset:null}};function Ad(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:o}=r,a=t.getMonitor(),l=t.getRegistry();t.dispatch(ns(s)),Nd(n,a,l);const c=Vd(n,a);if(c==null){t.dispatch(Id);return}let u=null;if(s){if(!o)throw new Error("getSourceClientOffset must be defined");kd(o),u=o(c)}t.dispatch(ns(s,u));const h=l.getSource(c).beginDrag(a,c);if(h==null)return;Ld(h),l.pinSource(c);const f=l.getSourceType(c);return{type:Tn,payload:{itemType:f,item:h,sourceId:c,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}function Nd(t,e,n){P(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){P(n.getSource(r),"Expected sourceIds to be registered.")})}function kd(t){P(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ld(t){P(sa(t),"Item must be an object.")}function Vd(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function jd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fd(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){jd(t,i,n[i])})}return t}function Bd(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();_d(r),Ud(r).forEach((o,a)=>{const l=zd(o,a,i,r),c={type:Sn,payload:{dropResult:Fd({},n,l)}};t.dispatch(c)})}}function _d(t){P(t.isDragging(),"Cannot call drop while not dragging."),P(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function zd(t,e,n,r){const i=n.getTarget(t);let s=i?i.drop(r,t):void 0;return $d(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function $d(t){P(typeof t>"u"||sa(t),"Drop result must either be an object or undefined.")}function Ud(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function Hd(t){return function(){const n=t.getMonitor(),r=t.getRegistry();Wd(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:wn}}}function Wd(t){P(t.isDragging(),"Cannot call endDrag while not dragging.")}function dr(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function Gd(t){return function(n,{clientOffset:r}={}){Kd(n);const i=n.slice(0),s=t.getMonitor(),o=t.getRegistry(),a=s.getItemType();return Yd(i,o,a),qd(i,s,o),Xd(i,s,o),{type:xn,payload:{targetIds:i,clientOffset:r||null}}}}function Kd(t){P(Array.isArray(t),"Expected targetIds to be an array.")}function qd(t,e,n){P(e.isDragging(),"Cannot call hover while not dragging."),P(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];P(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(i);P(s,"Expected targetIds to be registered.")}}function Yd(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],s=e.getTargetType(i);dr(s,n)||t.splice(r,1)}}function Xd(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function Zd(t){return function(){if(t.getMonitor().isDragging())return{type:Qr}}}function Jd(t){return{beginDrag:Ad(t),publishDragSource:Zd(t),hover:Gd(t),drop:Bd(t),endDrag:Hd(t)}}class Qd{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...o)=>{const a=s.apply(e,o);typeof a<"u"&&n(a)}}const i=Jd(this);return Object.keys(i).reduce((s,o)=>{const a=i[o];return s[o]=r(a),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function eh(t,e){return{x:t.x+e.x,y:t.y+e.y}}function oa(t,e){return{x:t.x-e.x,y:t.y-e.y}}function th(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:oa(eh(e,r),n)}function nh(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:oa(e,n)}const mt=[],ei=[];mt.__IS_NONE__=!0;ei.__IS_ALL__=!0;function rh(t,e){return t===mt?!1:t===ei||typeof e>"u"?!0:Rd(e,t).length>0}class ih{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;P(typeof e=="function","listener must be a function."),P(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const o=this.store.getState(),a=o.stateId;try{a===i||a===i+1&&!rh(o.dirtyHandlerIds,r)||e()}finally{i=a}};return this.store.subscribe(s)}subscribeToOffsetChange(e){P(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return P(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(P(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return dr(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(P(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),s=this.getItemType();if(s&&!dr(i,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(e);return r?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return th(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return nh(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const rs=typeof rn<"u"?rn:self,aa=rs.MutationObserver||rs.WebKitMutationObserver;function la(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function sh(t){let e=1;const n=new aa(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const oh=typeof aa=="function"?sh:la;class ah{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=oh(this.flush),this.requestErrorThrow=la(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class lh{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class ch{create(e){const n=this.freeTasks,r=n.length?n.pop():new lh(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const ca=new ah,uh=new ch(ca.registerPendingError);function dh(t){ca.enqueueTask(uh.create(t))}const ti="dnd-core/ADD_SOURCE",ni="dnd-core/ADD_TARGET",ri="dnd-core/REMOVE_SOURCE",Dn="dnd-core/REMOVE_TARGET";function hh(t){return{type:ti,payload:{sourceId:t}}}function fh(t){return{type:ni,payload:{targetId:t}}}function ph(t){return{type:ri,payload:{sourceId:t}}}function gh(t){return{type:Dn,payload:{targetId:t}}}function mh(t){P(typeof t.canDrag=="function","Expected canDrag to be a function."),P(typeof t.beginDrag=="function","Expected beginDrag to be a function."),P(typeof t.endDrag=="function","Expected endDrag to be a function.")}function vh(t){P(typeof t.canDrop=="function","Expected canDrop to be a function."),P(typeof t.hover=="function","Expected hover to be a function."),P(typeof t.drop=="function","Expected beginDrag to be a function.")}function hr(t,e){if(e&&Array.isArray(t)){t.forEach(n=>hr(n,!1));return}P(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ce;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(ce||(ce={}));let yh=0;function bh(){return yh++}function Th(t){const e=bh().toString();switch(t){case ce.SOURCE:return`S${e}`;case ce.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function is(t){switch(t[0]){case"S":return ce.SOURCE;case"T":return ce.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function ss(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,s]}=n.next();if(s===e)return!0;r=!!i}while(!r);return!1}class xh{addSource(e,n){hr(e),mh(n);const r=this.addHandler(ce.SOURCE,e,n);return this.store.dispatch(hh(r)),r}addTarget(e,n){hr(e,!0),vh(n);const r=this.addHandler(ce.TARGET,e,n);return this.store.dispatch(fh(r)),r}containsHandler(e){return ss(this.dragSources,e)||ss(this.dropTargets,e)}getSource(e,n=!1){return P(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return P(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return P(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return P(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return is(e)===ce.SOURCE}isTargetId(e){return is(e)===ce.TARGET}removeSource(e){P(this.getSource(e),"Expected an existing source."),this.store.dispatch(ph(e)),dh(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){P(this.getTarget(e),"Expected an existing target."),this.store.dispatch(gh(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);P(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){P(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=Th(e);return this.types.set(i,n),e===ce.SOURCE?this.dragSources.set(i,r):e===ce.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Sh=(t,e)=>t===e;function wh(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function Dh(t,e,n=Sh){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function Ch(t=mt,e){switch(e.type){case xn:break;case ti:case ni:case Dn:case ri:return mt;case Tn:case Qr:case wn:case Sn:default:return ei}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=Md(n,r);if(!(i.length>0||!Dh(n,r)))return mt;const o=r[r.length-1],a=n[n.length-1];return o!==a&&(o&&i.push(o),a&&i.push(a)),i}function Eh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oh(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Eh(t,i,n[i])})}return t}const os={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ph(t=os,e){const{payload:n}=e;switch(e.type){case Jr:case Tn:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case xn:return wh(t.clientOffset,n.clientOffset)?t:Oh({},t,{clientOffset:n.clientOffset});case wn:case Sn:return os;default:return t}}function Mh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ke(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Mh(t,i,n[i])})}return t}const Rh={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Ih(t=Rh,e){const{payload:n}=e;switch(e.type){case Tn:return Ke({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Qr:return Ke({},t,{isSourcePublic:!0});case xn:return Ke({},t,{targetIds:n.targetIds});case Dn:return t.targetIds.indexOf(n.targetId)===-1?t:Ke({},t,{targetIds:Pd(t.targetIds,n.targetId)});case Sn:return Ke({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case wn:return Ke({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Ah(t=0,e){switch(e.type){case ti:case ni:return t+1;case ri:case Dn:return t-1;default:return t}}function Nh(t=0){return t+1}function kh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lh(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){kh(t,i,n[i])})}return t}function Vh(t={},e){return{dirtyHandlerIds:Ch(t.dirtyHandlerIds,{type:e.type,payload:Lh({},e.payload,{prevTargetIds:Od(t,"dragOperation.targetIds",[])})}),dragOffset:Ph(t.dragOffset,e),refCount:Ah(t.refCount,e),dragOperation:Ih(t.dragOperation,e),stateId:Nh(t.stateId)}}function jh(t,e=void 0,n={},r=!1){const i=Fh(r),s=new ih(i,new xh(i)),o=new Qd(i,s),a=t(o,e,n);return o.receiveBackend(a),o}function Fh(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return ia(Vh,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function Bh(t,e){if(t==null)return{};var n=_h(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _h(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let as=0;const qt=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var zh=m.memo(function(e){var{children:n}=e,r=Bh(e,["children"]);const[i,s]=$h(r);return m.useEffect(()=>{if(s){const o=ua();return++as,()=>{--as===0&&(o[qt]=null)}}},[]),v.jsx(ra.Provider,{value:i,children:n})});function $h(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=Uh(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function Uh(t,e=ua(),n,r){const i=e;return i[qt]||(i[qt]={dragDropManager:jh(t,e,n,r)}),i[qt]}function ua(){return typeof rn<"u"?rn:window}var kn,ls;function Hh(){return ls||(ls=1,kn=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}),kn}var Wh=Hh();const Gh=jc(Wh),We=typeof window<"u"?m.useLayoutEffect:m.useEffect;function da(t,e,n){const[r,i]=m.useState(()=>e(t)),s=m.useCallback(()=>{const o=e(t);Gh(r,o)||(i(o),n&&n())},[r,t,n]);return We(s),[r,s]}function Kh(t,e,n){const[r,i]=da(t,e,n);return We(function(){const o=t.getHandlerId();if(o!=null)return t.subscribeToStateChange(i,{handlerIds:[o]})},[t,i]),r}function ha(t,e,n){return Kh(e,t||(()=>({})),()=>n.reconnect())}function fa(t,e){const n=[];return typeof t!="function"&&n.push(t),m.useMemo(()=>typeof t=="function"?t():t,n)}function qh(t){return m.useMemo(()=>t.hooks.dragSource(),[t])}function Yh(t){return m.useMemo(()=>t.hooks.dragPreview(),[t])}let Ln=!1,Vn=!1;class Xh{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){P(!Ln,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ln=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Ln=!1}}isDragging(){if(!this.sourceId)return!1;P(!Vn,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Vn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Vn=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let jn=!1;class Zh{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;P(!jn,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return jn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{jn=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function Jh(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function Qh(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function fr(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),o=Object.keys(e);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(e);for(let l=0;l<s.length;l++){const c=s[l];if(!a(c))return!1;const u=t[c],d=e[c];if(i=void 0,i===!1||i===void 0&&u!==d)return!1}return!0}function pr(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ef(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function tf(t){return(e=null,n=null)=>{if(!m.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return ef(r),nf(r,n?s=>t(s,n):t)}}function pa(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=tf(r);e[n]=()=>i}}),e}function cs(t,e){typeof t=="function"?t(e):t.current=e}function nf(t,e){const n=t.ref;return P(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?m.cloneElement(t,{ref:r=>{cs(n,r),cs(e,r)}}):m.cloneElement(t,{ref:e})}class rf{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!fr(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!fr(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=pa({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,pr(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,pr(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class sf{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!fr(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=pa({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,pr(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function De(){const{dragDropManager:t}=m.useContext(ra);return P(t!=null,"Expected drag drop context"),t}function of(t,e){const n=De(),r=m.useMemo(()=>new rf(n.getBackend()),[n]);return We(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),We(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function af(){const t=De();return m.useMemo(()=>new Xh(t),[t])}class lf{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:s}=r;return s?s(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function cf(t,e,n){const r=m.useMemo(()=>new lf(t,e,n),[e,n]);return m.useEffect(()=>{r.spec=t},[t]),r}function uf(t){return m.useMemo(()=>{const e=t.type;return P(e!=null,"spec.type must be defined"),e},[t])}function df(t,e,n){const r=De(),i=cf(t,e,n),s=uf(t);We(function(){if(s!=null){const[a,l]=Qh(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),l}},[r,e,n,i,s])}function hf(t,e){const n=fa(t);P(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=af(),i=of(n.options,n.previewOptions);return df(n,r,i),[ha(n.collect,r,i),qh(i),Yh(i)]}function ff(t){const n=De().getMonitor(),[r,i]=da(n,t);return m.useEffect(()=>n.subscribeToOffsetChange(i)),m.useEffect(()=>n.subscribeToStateChange(i)),r}function pf(t){return m.useMemo(()=>t.hooks.dropTarget(),[t])}function gf(t){const e=De(),n=m.useMemo(()=>new sf(e.getBackend()),[e]);return We(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function mf(){const t=De();return m.useMemo(()=>new Zh(t),[t])}function vf(t){const{accept:e}=t;return m.useMemo(()=>(P(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class yf{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function bf(t,e){const n=m.useMemo(()=>new yf(t,e),[e]);return m.useEffect(()=>{n.spec=t},[t]),n}function Tf(t,e,n){const r=De(),i=bf(t,e),s=vf(t);We(function(){const[a,l]=Jh(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),l},[r,e,i,n,s.map(o=>o.toString()).join("|")])}function ga(t,e){const n=fa(t),r=mf(),i=gf(n.options);return Tf(n,r,i),[ha(n.collect,r,i),pf(i)]}function ma(t){let e=null;return()=>(e==null&&(e=t()),e)}function xf(t,e){return t.filter(n=>n!==e)}function Sf(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const i=[];return n.forEach(s=>i.push(s)),i}class wf{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=Sf(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=xf(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Df{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const va="__NATIVE_FILE__",ya="__NATIVE_URL__",ba="__NATIVE_TEXT__",Ta="__NATIVE_HTML__",us=Object.freeze(Object.defineProperty({__proto__:null,FILE:va,HTML:Ta,TEXT:ba,URL:ya},Symbol.toStringTag,{value:"Module"}));function Fn(t,e,n){const r=e.reduce((i,s)=>i||t.getData(s),"");return r??n}const gr={[va]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[Ta]:{exposeProperties:{html:(t,e)=>Fn(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[ya]:{exposeProperties:{urls:(t,e)=>Fn(t,e,"").split(`
132
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[ba]:{exposeProperties:{text:(t,e)=>Fn(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function Cf(t,e){const n=gr[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new Df(n);return r.loadDataTransfer(e),r}function Bn(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(gr).filter(n=>{const r=gr[n];return r?.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const Ef=ma(()=>/firefox/i.test(navigator.userAgent)),xa=ma(()=>!!window.safari);class ds{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:s,c3s:o}=this;let a=n.length-1;if(e===n[a])return r[a];let l=0,c=o.length-1,u;for(;l<=c;){u=Math.floor(.5*(l+c));const f=n[u];if(f<e)l=u+1;else if(f>e)c=u-1;else return r[u]}a=Math.max(0,c);const d=e-n[a],h=d*d;return r[a]+i[a]*d+s[a]*h+o[a]*d*h}constructor(e,n){const{length:r}=e,i=[];for(let f=0;f<r;f++)i.push(f);i.sort((f,p)=>e[f]<e[p]?-1:1);const s=[],o=[];let a,l;for(let f=0;f<r-1;f++)a=e[f+1]-e[f],l=n[f+1]-n[f],s.push(a),o.push(l/a);const c=[o[0]];for(let f=0;f<s.length-1;f++){const p=o[f],g=o[f+1];if(p*g<=0)c.push(0);else{a=s[f];const b=s[f+1],y=a+b;c.push(3*y/((y+b)/p+(y+a)/g))}}c.push(o[o.length-1]);const u=[],d=[];let h;for(let f=0;f<c.length-1;f++){h=o[f];const p=c[f],g=1/s[f],b=p+c[f+1]-h-h;u.push((h-p-b)*g),d.push(b*g*g)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=u,this.c3s=d}}const Of=1;function Sa(t){const e=t.nodeType===Of?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ft(t){return{x:t.clientX,y:t.clientY}}function Pf(t){var e;return t.nodeName==="IMG"&&(Ef()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function Mf(t,e,n,r){let i=t?e.width:n,s=t?e.height:r;return xa()&&t&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function Rf(t,e,n,r,i){const s=Pf(e),a=Sa(s?t:e),l={x:n.x-a.x,y:n.y-a.y},{offsetWidth:c,offsetHeight:u}=t,{anchorX:d,anchorY:h}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=Mf(s,e,c,u),g=()=>{let C=new ds([0,.5,1],[l.y,l.y/u*p,l.y+p-u]).interpolate(h);return xa()&&s&&(C+=(window.devicePixelRatio-1)*p),C},b=()=>new ds([0,.5,1],[l.x,l.x/c*f,l.x+f-c]).interpolate(d),{offsetX:y,offsetY:T}=i,x=y===0||y,w=T===0||T;return{x:x?y:b(),y:w?T:g()}}let If=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}};function Af(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Af(t,i,n[i])})}return t}class Nf{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=o=>this.handleDragStart(o,e),s=o=>this.handleSelectStart(o);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=o=>this.handleDragEnter(o,e),i=o=>this.handleDragOver(o,e),s=o=>this.handleDrop(o,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return hs({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return hs({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(us).some(n=>us[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=Cf(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Sa(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=Ft(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=i,l=Bn(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const u=this.monitor.getSourceId(),d=this.sourceNodes.get(u),h=this.sourcePreviewNodes.get(u)||d;if(h){const{anchorX:f,anchorY:p,offsetX:g,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),x=Rf(d,h,o,{anchorX:f,anchorY:p},{offsetX:g,offsetY:b});a.setDragImage(h,x.x,x.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,l=Bn(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Ft(i)}),s.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Ft(i),this.scheduleHover(s),(s||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else Bn(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Ft(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new If(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new wf(this.isNodeInDocument)}}let Bt;function kf(){return Bt||(Bt=new Image,Bt.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Bt}const Lf=function(e,n,r){return new Nf(e,n,r)};var $e=[],Vf=function(){return $e.some(function(t){return t.activeTargets.length>0})},jf=function(){return $e.some(function(t){return t.skippedTargets.length>0})},fs="ResizeObserver loop completed with undelivered notifications.",Ff=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:fs}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=fs),window.dispatchEvent(t)},Dt;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Dt||(Dt={}));var Ue=function(t){return Object.freeze(t)},Bf=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Ue(this)}return t})(),wa=(function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ue(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,s=e.right,o=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:r,top:i,right:s,bottom:o,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),ii=function(t){return t instanceof SVGElement&&"getBBox"in t},Da=function(t){if(ii(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,s=i.offsetWidth,o=i.offsetHeight;return!(s||o||t.getClientRects().length)},ps=function(t){var e;if(t instanceof Element)return!0;var n=(e=t?.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},_f=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},vt=typeof window<"u"?window:{},_t=new WeakMap,gs=/auto|scroll/,zf=/^tb|vertical/,$f=/msie|trident/i.test(vt.navigator&&vt.navigator.userAgent),pe=function(t){return parseFloat(t||"0")},et=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Bf((n?e:t)||0,(n?t:e)||0)},ms=Ue({devicePixelContentBoxSize:et(),borderBoxSize:et(),contentBoxSize:et(),contentRect:new wa(0,0,0,0)}),Ca=function(t,e){if(e===void 0&&(e=!1),_t.has(t)&&!e)return _t.get(t);if(Da(t))return _t.set(t,ms),ms;var n=getComputedStyle(t),r=ii(t)&&t.ownerSVGElement&&t.getBBox(),i=!$f&&n.boxSizing==="border-box",s=zf.test(n.writingMode||""),o=!r&&gs.test(n.overflowY||""),a=!r&&gs.test(n.overflowX||""),l=r?0:pe(n.paddingTop),c=r?0:pe(n.paddingRight),u=r?0:pe(n.paddingBottom),d=r?0:pe(n.paddingLeft),h=r?0:pe(n.borderTopWidth),f=r?0:pe(n.borderRightWidth),p=r?0:pe(n.borderBottomWidth),g=r?0:pe(n.borderLeftWidth),b=d+c,y=l+u,T=g+f,x=h+p,w=a?t.offsetHeight-x-t.clientHeight:0,S=o?t.offsetWidth-T-t.clientWidth:0,C=i?b+T:0,R=i?y+x:0,D=r?r.width:pe(n.width)-C-S,N=r?r.height:pe(n.height)-R-w,A=D+b+S+T,H=N+y+w+x,q=Ue({devicePixelContentBoxSize:et(Math.round(D*devicePixelRatio),Math.round(N*devicePixelRatio),s),borderBoxSize:et(A,H,s),contentBoxSize:et(D,N,s),contentRect:new wa(d,l,D,N)});return _t.set(t,q),q},Ea=function(t,e,n){var r=Ca(t,n),i=r.borderBoxSize,s=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(e){case Dt.DEVICE_PIXEL_CONTENT_BOX:return o;case Dt.BORDER_BOX:return i;default:return s}},Uf=(function(){function t(e){var n=Ca(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Ue([n.borderBoxSize]),this.contentBoxSize=Ue([n.contentBoxSize]),this.devicePixelContentBoxSize=Ue([n.devicePixelContentBoxSize])}return t})(),Oa=function(t){if(Da(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Hf=function(){var t=1/0,e=[];$e.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(c){var u=new Uf(c.target),d=Oa(c.target);a.push(u),c.lastReportedSize=Ea(c.target,c.observedBox),d<t&&(t=d)}),e.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},vs=function(t){$e.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(Oa(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},Wf=function(){var t=0;for(vs(t);Vf();)t=Hf(),vs(t);return jf()&&Ff(),t>0},_n,Pa=[],Gf=function(){return Pa.splice(0).forEach(function(t){return t()})},Kf=function(t){if(!_n){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Gf()}).observe(n,r),_n=function(){n.textContent="".concat(e?e--:e++)}}Pa.push(t),_n()},qf=function(t){Kf(function(){requestAnimationFrame(t)})},Yt=0,Yf=function(){return!!Yt},Xf=250,Zf={attributes:!0,characterData:!0,childList:!0,subtree:!0},ys=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],bs=function(t){return t===void 0&&(t=0),Date.now()+t},zn=!1,Jf=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Xf),!zn){zn=!0;var r=bs(e);qf(function(){var i=!1;try{i=Wf()}finally{if(zn=!1,e=r-bs(),!Yf())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Zf)};document.body?n():vt.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ys.forEach(function(n){return vt.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),ys.forEach(function(n){return vt.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),mr=new Jf,Ts=function(t){!Yt&&t>0&&mr.start(),Yt+=t,!Yt&&mr.stop()},Qf=function(t){return!ii(t)&&!_f(t)&&getComputedStyle(t).display==="inline"},ep=(function(){function t(e,n){this.target=e,this.observedBox=n||Dt.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Ea(this.target,this.observedBox,!0);return Qf(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),tp=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),zt=new WeakMap,xs=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},$t=(function(){function t(){}return t.connect=function(e,n){var r=new tp(e,n);zt.set(e,r)},t.observe=function(e,n,r){var i=zt.get(e),s=i.observationTargets.length===0;xs(i.observationTargets,n)<0&&(s&&$e.push(i),i.observationTargets.push(new ep(n,r&&r.box)),Ts(1),mr.schedule())},t.unobserve=function(e,n){var r=zt.get(e),i=xs(r.observationTargets,n),s=r.observationTargets.length===1;i>=0&&(s&&$e.splice($e.indexOf(r),1),r.observationTargets.splice(i,1),Ts(-1))},t.disconnect=function(e){var n=this,r=zt.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),np=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");$t.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ps(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");$t.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!ps(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");$t.unobserve(this,e)},t.prototype.disconnect=function(){$t.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();const Ma=m.createContext({});function rp(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const si=m.createContext(null),Ra=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function ip(t=!0){const e=m.useContext(si);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=m.useId();m.useEffect(()=>{t&&i(s)},[t]);const o=m.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const oi=typeof window<"u",sp=oi?m.useLayoutEffect:m.useEffect,te=t=>t;let Ia=te;function ai(t){let e;return()=>(e===void 0&&(e=t()),e)}const tt=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Te=t=>t*1e3,xe=t=>t/1e3,op={useManualTiming:!1};function ap(t){let e=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),t()),c(o)}const l={schedule:(c,u=!1,d=!1)=>{const f=d&&r?e:n;return u&&s.add(c),f.has(c)||f.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(o=c,r){i=!0;return}r=!0,[e,n]=[n,e],e.forEach(a),e.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Ut=["read","resolveKeyframes","update","preRender","render","postRender"],lp=40;function Aa(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ut.reduce((y,T)=>(y[T]=ap(s),y),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=o,f=()=>{const y=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,lp),1),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(f))},p=()=>{n=!0,r=!0,i.isProcessing||t(f)};return{schedule:Ut.reduce((y,T)=>{const x=o[T];return y[T]=(w,S=!1,C=!1)=>(n||p(),x.schedule(w,S,C)),y},{}),cancel:y=>{for(let T=0;T<Ut.length;T++)o[Ut[T]].cancel(y)},state:i,steps:o}}const{schedule:j,cancel:Re,state:G,steps:$n}=Aa(typeof requestAnimationFrame<"u"?requestAnimationFrame:te,!0),Na=m.createContext({strict:!1}),Ss={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"]},nt={};for(const t in Ss)nt[t]={isEnabled:e=>Ss[t].some(n=>!!e[n])};function cp(t){for(const e in t)nt[e]={...nt[e],...t[e]}}const up=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"]);function ln(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||up.has(t)}let ka=t=>!ln(t);function dp(t){t&&(ka=e=>e.startsWith("on")?!ln(e):t(e))}try{dp(require("@emotion/is-prop-valid").default)}catch{}function hp(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(ka(i)||n===!0&&ln(i)||!e&&!ln(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}function fp(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const Cn=m.createContext({});function Ct(t){return typeof t=="string"||Array.isArray(t)}function En(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const li=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ci=["initial",...li];function On(t){return En(t.animate)||ci.some(e=>Ct(t[e]))}function La(t){return!!(On(t)||t.variants)}function pp(t,e){if(On(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ct(n)?n:void 0,animate:Ct(r)?r:void 0}}return t.inherit!==!1?e:{}}function gp(t){const{initial:e,animate:n}=pp(t,m.useContext(Cn));return m.useMemo(()=>({initial:e,animate:n}),[ws(e),ws(n)])}function ws(t){return Array.isArray(t)?t.join(" "):t}const mp=Symbol.for("motionComponentSymbol");function qe(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function vp(t,e,n){return m.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):qe(n)&&(n.current=r))},[e])}const ui=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yp="framerAppearId",Va="data-"+ui(yp),{schedule:di}=Aa(queueMicrotask,!1),ja=m.createContext({});function bp(t,e,n,r,i){var s,o;const{visualElement:a}=m.useContext(Cn),l=m.useContext(Na),c=m.useContext(si),u=m.useContext(Ra).reducedMotion,d=m.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=d.current,f=m.useContext(ja);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&Tp(d.current,n,i,f);const p=m.useRef(!1);m.useInsertionEffect(()=>{h&&p.current&&h.update(n,c)});const g=n[Va],b=m.useRef(!!g&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return sp(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),di.render(h.render),b.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),b.current=!1))}),h}function Tp(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Fa(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&qe(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Fa(t){if(t)return t.options.allowProjection!==!1?t.projection:Fa(t.parent)}function xp({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){var s,o;t&&cp(t);function a(c,u){let d;const h={...m.useContext(Ra),...c,layoutId:Sp(c)},{isStatic:f}=h,p=gp(c),g=r(c,f);if(!f&&oi){wp();const b=Dp(h);d=b.MeasureLayout,p.visualElement=bp(i,g,h,e,b.ProjectionNode)}return v.jsxs(Cn.Provider,{value:p,children:[d&&p.visualElement?v.jsx(d,{visualElement:p.visualElement,...h}):null,n(i,c,vp(g,p.visualElement,u),g,f,p.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=m.forwardRef(a);return l[mp]=i,l}function Sp({layoutId:t}){const e=m.useContext(Ma).id;return e&&t!==void 0?e+"-"+t:t}function wp(t,e){m.useContext(Na).strict}function Dp(t){const{drag:e,layout:n}=nt;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Cp=["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 hi(t){return typeof t!="string"||t.includes("-")?!1:!!(Cp.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ds(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function fi(t,e,n,r){if(typeof e=="function"){const[i,s]=Ds(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Ds(r);e=e(n!==void 0?n:t.custom,i,s)}return e}const vr=t=>Array.isArray(t),Ep=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Op=t=>vr(t)?t[t.length-1]||0:t,X=t=>!!(t&&t.getVelocity);function Xt(t){const e=X(t)?t.get():t;return Ep(e)?e.toValue():e}function Pp({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,i,s){const o={latestValues:Mp(r,i,s,t),renderState:e()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Ba=t=>(e,n)=>{const r=m.useContext(Cn),i=m.useContext(si),s=()=>Pp(t,e,r,i);return n?s():rp(s)};function Mp(t,e,n,r){const i={},s=r(t,{});for(const h in s)i[h]=Xt(s[h]);let{initial:o,animate:a}=t;const l=On(t),c=La(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!En(d)){const h=Array.isArray(d)?d:[d];for(let f=0;f<h.length;f++){const p=fi(t,h[f]);if(p){const{transitionEnd:g,transition:b,...y}=p;for(const T in y){let x=y[T];if(Array.isArray(x)){const w=u?x.length-1:0;x=x[w]}x!==null&&(i[T]=x)}for(const T in g)i[T]=g[T]}}}return i}const st=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ge=new Set(st),_a=t=>e=>typeof e=="string"&&e.startsWith(t),za=_a("--"),Rp=_a("var(--"),pi=t=>Rp(t)?Ip.test(t.split("/*")[0].trim()):!1,Ip=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,$a=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Se=(t,e,n)=>n>e?e:n<t?t:n,ot={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Et={...ot,transform:t=>Se(0,1,t)},Ht={...ot,default:1},At=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ee=At("deg"),me=At("%"),E=At("px"),Ap=At("vh"),Np=At("vw"),Cs={...me,parse:t=>me.parse(t)/100,transform:t=>me.transform(t*100)},kp={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,radius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,backgroundPositionX:E,backgroundPositionY:E},Lp={rotate:Ee,rotateX:Ee,rotateY:Ee,rotateZ:Ee,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:Ee,skewX:Ee,skewY:Ee,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:Et,originX:Cs,originY:Cs,originZ:E},Es={...ot,transform:Math.round},gi={...kp,...Lp,zIndex:Es,size:E,fillOpacity:Et,strokeOpacity:Et,numOctaves:Es},Vp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jp=st.length;function Fp(t,e,n){let r="",i=!0;for(let s=0;s<jp;s++){const o=st[s],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=$a(a,gi[o]);if(!l){i=!1;const u=Vp[o]||o;r+=`${u}(${c}) `}n&&(e[o]=c)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function mi(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(Ge.has(l)){o=!0;continue}else if(za(l)){i[l]=c;continue}else{const u=$a(c,gi[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(e.transform||(o||n?r.transform=Fp(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const Bp={offset:"stroke-dashoffset",array:"stroke-dasharray"},_p={offset:"strokeDashoffset",array:"strokeDasharray"};function zp(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?Bp:_p;t[s.offset]=E.transform(-r);const o=E.transform(e),a=E.transform(n);t[s.array]=`${o} ${a}`}function Os(t,e,n){return typeof t=="string"?t:E.transform(e+n*t)}function $p(t,e,n){const r=Os(e,t.x,t.width),i=Os(n,t.y,t.height);return`${r} ${i}`}function vi(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(mi(t,c,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f,dimensions:p}=t;h.transform&&(p&&(f.transform=h.transform),delete h.transform),p&&(i!==void 0||s!==void 0||f.transform)&&(f.transformOrigin=$p(p,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&zp(h,o,a,l,!1)}const yi=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ua=()=>({...yi(),attrs:{}}),bi=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Ha(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const Wa=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 Ga(t,e,n,r){Ha(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(Wa.has(i)?i:ui(i),e.attrs[i])}const cn={};function Up(t){Object.assign(cn,t)}function Ka(t,{layout:e,layoutId:n}){return Ge.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!cn[t]||t==="opacity")}function Ti(t,e,n){var r;const{style:i}=t,s={};for(const o in i)(X(i[o])||e.style&&X(e.style[o])||Ka(o,t)||((r=n?.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function qa(t,e,n){const r=Ti(t,e,n);for(const i in t)if(X(t[i])||X(e[i])){const s=st.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}function Hp(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const Ps=["x","y","width","height","cx","cy","r"],Wp={useVisualState:Ba({scrapeMotionValuesFromProps:qa,createRenderState:Ua,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!t.drag;if(!s){for(const a in i)if(Ge.has(a)){s=!0;break}}if(!s)return;let o=!e;if(e)for(let a=0;a<Ps.length;a++){const l=Ps[a];t[l]!==e[l]&&(o=!0)}o&&j.read(()=>{Hp(n,r),j.render(()=>{vi(r,i,bi(n.tagName),t.transformTemplate),Ga(n,r)})})}})},Gp={useVisualState:Ba({scrapeMotionValuesFromProps:Ti,createRenderState:yi})};function Ya(t,e,n){for(const r in e)!X(e[r])&&!Ka(r,n)&&(t[r]=e[r])}function Kp({transformTemplate:t},e){return m.useMemo(()=>{const n=yi();return mi(n,e,t),Object.assign({},n.vars,n.style)},[e])}function qp(t,e){const n=t.style||{},r={};return Ya(r,n,t),Object.assign(r,Kp(t,e)),r}function Yp(t,e){const n={},r=qp(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}function Xp(t,e,n,r){const i=m.useMemo(()=>{const s=Ua();return vi(s,e,bi(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Ya(s,t.style,t),i.style={...s,...i.style}}return i}function Zp(t=!1){return(n,r,i,{latestValues:s},o)=>{const l=(hi(n)?Xp:Yp)(r,s,o,n),c=hp(r,typeof n=="string",t),u=n!==m.Fragment?{...c,...l,ref:i}:{},{children:d}=r,h=m.useMemo(()=>X(d)?d.get():d,[d]);return m.createElement(n,{...u,children:h})}}function Jp(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...hi(r)?Wp:Gp,preloadedFeatures:t,useRender:Zp(i),createVisualElement:e,Component:r};return xp(o)}}function Xa(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Pn(t,e,n){const r=t.getProps();return fi(r,e,n!==void 0?n:r.custom,t)}const Qp=ai(()=>window.ScrollTimeline!==void 0);class eg{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(i=>{if(Qp()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class tg extends eg{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function xi(t,e){return t?t[e]||t.default||t:void 0}const yr=2e4;function Za(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<yr;)e+=n,r=t.next(e);return e>=yr?1/0:e}function Si(t){return typeof t=="function"}function Ms(t,e){t.timeline=e,t.onfinish=null}const wi=t=>Array.isArray(t)&&typeof t[0]=="number",ng={linearEasing:void 0};function rg(t,e){const n=ai(t);return()=>{var r;return(r=ng[e])!==null&&r!==void 0?r:n()}}const un=rg(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ja=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(tt(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function Qa(t){return!!(typeof t=="function"&&un()||!t||typeof t=="string"&&(t in br||un())||wi(t)||Array.isArray(t)&&t.every(Qa))}const dt=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,br={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dt([0,.65,.55,1]),circOut:dt([.55,0,1,.45]),backIn:dt([.31,.01,.66,-.59]),backOut:dt([.33,1.53,.69,.99])};function el(t,e){if(t)return typeof t=="function"&&un()?Ja(t,e):wi(t)?dt(t):Array.isArray(t)?t.map(n=>el(n,e)||br.easeOut):br[t]}const he={x:!1,y:!1};function tl(){return he.x||he.y}function ig(t,e,n){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function nl(t,e){const n=ig(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function Rs(t){return e=>{e.pointerType==="touch"||tl()||t(e)}}function sg(t,e,n={}){const[r,i,s]=nl(t,n),o=Rs(a=>{const{target:l}=a,c=e(a);if(typeof c!="function"||!l)return;const u=Rs(d=>{c(d),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const rl=(t,e)=>e?t===e?!0:rl(t,e.parentElement):!1,Di=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,og=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ag(t){return og.has(t.tagName)||t.tabIndex!==-1}const ht=new WeakSet;function Is(t){return e=>{e.key==="Enter"&&t(e)}}function Un(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const lg=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Is(()=>{if(ht.has(n))return;Un(n,"down");const i=Is(()=>{Un(n,"up")}),s=()=>Un(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function As(t){return Di(t)&&!tl()}function cg(t,e,n={}){const[r,i,s]=nl(t,n),o=a=>{const l=a.currentTarget;if(!As(a)||ht.has(l))return;ht.add(l);const c=e(a),u=(f,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),!(!As(f)||!ht.has(l))&&(ht.delete(l),typeof c=="function"&&c(f,{success:p}))},d=f=>{u(f,n.useGlobalTarget||rl(l,f.target))},h=f=>{u(f,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return r.forEach(a=>{!ag(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>lg(c,i),i)}),s}function ug(t){return t==="x"||t==="y"?he[t]?null:(he[t]=!0,()=>{he[t]=!1}):he.x||he.y?null:(he.x=he.y=!0,()=>{he.x=he.y=!1})}const il=new Set(["width","height","top","left","right","bottom",...st]);let Zt;function dg(){Zt=void 0}const ve={now:()=>(Zt===void 0&&ve.set(G.isProcessing||op.useManualTiming?G.timestamp:performance.now()),Zt),set:t=>{Zt=t,queueMicrotask(dg)}};function Ci(t,e){t.indexOf(e)===-1&&t.push(e)}function Ei(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Oi{constructor(){this.subscriptions=[]}add(e){return Ci(this.subscriptions,e),()=>Ei(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function sl(t,e){return e?t*(1e3/e):0}const Ns=30,hg=t=>!isNaN(parseFloat(t));class fg{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=ve.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ve.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=hg(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Oi);const r=this.events[e].add(n);return e==="change"?()=>{r(),j.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ve.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ns)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ns);return sl(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ot(t,e){return new fg(t,e)}function pg(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ot(n))}function gg(t,e){const n=Pn(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=Op(s[o]);pg(t,o,a)}}function mg(t){return!!(X(t)&&t.add)}function Tr(t,e){const n=t.getValue("willChange");if(mg(n))return n.add(e)}function ol(t){return t.props[Va]}const al=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,vg=1e-7,yg=12;function bg(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=al(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>vg&&++a<yg);return o}function Nt(t,e,n,r){if(t===e&&n===r)return te;const i=s=>bg(s,0,1,t,n);return s=>s===0||s===1?s:al(i(s),e,r)}const ll=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,cl=t=>e=>1-t(1-e),ul=Nt(.33,1.53,.69,.99),Pi=cl(ul),dl=ll(Pi),hl=t=>(t*=2)<1?.5*Pi(t):.5*(2-Math.pow(2,-10*(t-1))),Mi=t=>1-Math.sin(Math.acos(t)),fl=cl(Mi),pl=ll(Mi),gl=t=>/^0[^.\s]+$/u.test(t);function Tg(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||gl(t):!0}const yt=t=>Math.round(t*1e5)/1e5,Ri=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xg(t){return t==null}const Sg=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ii=(t,e)=>n=>!!(typeof n=="string"&&Sg.test(n)&&n.startsWith(t)||e&&!xg(n)&&Object.prototype.hasOwnProperty.call(n,e)),ml=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Ri);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},wg=t=>Se(0,255,t),Hn={...ot,transform:t=>Math.round(wg(t))},ze={test:Ii("rgb","red"),parse:ml("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Hn.transform(t)+", "+Hn.transform(e)+", "+Hn.transform(n)+", "+yt(Et.transform(r))+")"};function Dg(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const xr={test:Ii("#"),parse:Dg,transform:ze.transform},Ye={test:Ii("hsl","hue"),parse:ml("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+me.transform(yt(e))+", "+me.transform(yt(n))+", "+yt(Et.transform(r))+")"},Y={test:t=>ze.test(t)||xr.test(t)||Ye.test(t),parse:t=>ze.test(t)?ze.parse(t):Ye.test(t)?Ye.parse(t):xr.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ze.transform(t):Ye.transform(t)},Cg=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Eg(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ri))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Cg))===null||n===void 0?void 0:n.length)||0)>0}const vl="number",yl="color",Og="var",Pg="var(",ks="${}",Mg=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pt(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(Mg,l=>(Y.test(l)?(r.color.push(s),i.push(yl),n.push(Y.parse(l))):l.startsWith(Pg)?(r.var.push(s),i.push(Og),n.push(l)):(r.number.push(s),i.push(vl),n.push(parseFloat(l))),++s,ks)).split(ks);return{values:n,split:a,indexes:r,types:i}}function bl(t){return Pt(t).values}function Tl(t){const{split:e,types:n}=Pt(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===vl?s+=yt(i[o]):a===yl?s+=Y.transform(i[o]):s+=i[o]}return s}}const Rg=t=>typeof t=="number"?0:t;function Ig(t){const e=bl(t);return Tl(t)(e.map(Rg))}const Ie={test:Eg,parse:bl,createTransformer:Tl,getAnimatableNone:Ig},Ag=new Set(["brightness","contrast","saturate","opacity"]);function Ng(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Ri)||[];if(!r)return t;const i=n.replace(r,"");let s=Ag.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const kg=/\b([a-z-]*)\(.*?\)/gu,Sr={...Ie,getAnimatableNone:t=>{const e=t.match(kg);return e?e.map(Ng).join(" "):t}},Lg={...gi,color:Y,backgroundColor:Y,outlineColor:Y,fill:Y,stroke:Y,borderColor:Y,borderTopColor:Y,borderRightColor:Y,borderBottomColor:Y,borderLeftColor:Y,filter:Sr,WebkitFilter:Sr},Ai=t=>Lg[t];function xl(t,e){let n=Ai(t);return n!==Sr&&(n=Ie),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Vg=new Set(["auto","none","0"]);function jg(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!Vg.has(s)&&Pt(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=xl(n,i)}const Ls=t=>t===ot||t===E,Vs=(t,e)=>parseFloat(t.split(", ")[e]),js=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Vs(i[1],e);{const s=r.match(/^matrix\((.+)\)$/u);return s?Vs(s[1],t):0}},Fg=new Set(["x","y","z"]),Bg=st.filter(t=>!Fg.has(t));function _g(t){const e=[];return Bg.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const rt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:js(4,13),y:js(5,14)};rt.translateX=rt.x;rt.translateY=rt.y;const He=new Set;let wr=!1,Dr=!1;function Sl(){if(Dr){const t=Array.from(He).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=_g(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Dr=!1,wr=!1,He.forEach(t=>t.complete()),He.clear()}function wl(){He.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Dr=!0)})}function zg(){wl(),Sl()}class Ni{constructor(e,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(He.add(this),wr||(wr=!0,j.read(wl),j.resolveKeyframes(Sl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){const o=i?.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[s]=e[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),He.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,He.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Dl=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),$g=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ug(t){const e=$g.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function Cl(t,e,n=1){const[r,i]=Ug(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return Dl(o)?parseFloat(o):o}return pi(i)?Cl(i,e,n+1):i}const El=t=>e=>e.test(t),Hg={test:t=>t==="auto",parse:t=>t},Ol=[ot,E,me,Ee,Np,Ap,Hg],Fs=t=>Ol.find(El(t));class Pl extends Ni{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),pi(c))){const u=Cl(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!il.has(r)||e.length!==2)return;const[i,s]=e,o=Fs(i),a=Fs(s);if(o!==a)if(Ls(o)&&Ls(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)Tg(e[i])&&r.push(i);r.length&&jg(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=rt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=rt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Bs=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ie.test(t)||t==="0")&&!t.startsWith("url("));function Wg(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Gg(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=Bs(i,e),a=Bs(s,e);return!o||!a?!1:Wg(t)||(n==="spring"||Si(n))&&r}const Kg=t=>t!==null;function Mn(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(Kg),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const qg=40;class Ml{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ve.now(),this.options={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>qg?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&zg(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=ve.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!Gg(e,r,i,s))if(o)this.options.duration=0;else{l&&l(Mn(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const _=(t,e,n)=>t+(e-t)*n;function Wn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Yg({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=Wn(l,a,t+1/3),s=Wn(l,a,t),o=Wn(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function dn(t,e){return n=>n>0?e:t}const Gn=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},Xg=[xr,ze,Ye],Zg=t=>Xg.find(e=>e.test(t));function _s(t){const e=Zg(t);if(!e)return!1;let n=e.parse(t);return e===Ye&&(n=Yg(n)),n}const zs=(t,e)=>{const n=_s(t),r=_s(e);if(!n||!r)return dn(t,e);const i={...n};return s=>(i.red=Gn(n.red,r.red,s),i.green=Gn(n.green,r.green,s),i.blue=Gn(n.blue,r.blue,s),i.alpha=_(n.alpha,r.alpha,s),ze.transform(i))},Jg=(t,e)=>n=>e(t(n)),kt=(...t)=>t.reduce(Jg),Cr=new Set(["none","hidden"]);function Qg(t,e){return Cr.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function em(t,e){return n=>_(t,e,n)}function ki(t){return typeof t=="number"?em:typeof t=="string"?pi(t)?dn:Y.test(t)?zs:rm:Array.isArray(t)?Rl:typeof t=="object"?Y.test(t)?zs:tm:dn}function Rl(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>ki(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function tm(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=ki(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function nm(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][i[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const rm=(t,e)=>{const n=Ie.createTransformer(e),r=Pt(t),i=Pt(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Cr.has(t)&&!i.values.length||Cr.has(e)&&!r.values.length?Qg(t,e):kt(Rl(nm(r,i),i.values),n):dn(t,e)};function Il(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?_(t,e,n):ki(t)(t,e)}const im=5;function Al(t,e,n){const r=Math.max(e-im,0);return sl(n-t(r),e-r)}const z={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Kn=.001;function sm({duration:t=z.duration,bounce:e=z.bounce,velocity:n=z.velocity,mass:r=z.mass}){let i,s,o=1-e;o=Se(z.minDamping,z.maxDamping,o),t=Se(z.minDuration,z.maxDuration,xe(t)),o<1?(i=c=>{const u=c*o,d=u*t,h=u-n,f=Er(c,o),p=Math.exp(-d);return Kn-h/f*p},s=c=>{const d=c*o*t,h=d*n+n,f=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-d),g=Er(Math.pow(c,2),o);return(-i(c)+Kn>0?-1:1)*((h-f)*p)/g}):(i=c=>{const u=Math.exp(-c*t),d=(c-n)*t+1;return-Kn+u*d},s=c=>{const u=Math.exp(-c*t),d=(n-c)*(t*t);return u*d});const a=5/t,l=am(i,s,a);if(t=Te(t),isNaN(l))return{stiffness:z.stiffness,damping:z.damping,duration:t};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:t}}}const om=12;function am(t,e,n){let r=n;for(let i=1;i<om;i++)r=r-t(r)/e(r);return r}function Er(t,e){return t*Math.sqrt(1-e*e)}const lm=["duration","bounce"],cm=["stiffness","damping","mass"];function $s(t,e){return e.some(n=>t[n]!==void 0)}function um(t){let e={velocity:z.velocity,stiffness:z.stiffness,damping:z.damping,mass:z.mass,isResolvedFromDuration:!1,...t};if(!$s(t,cm)&&$s(t,lm))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Se(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:z.mass,stiffness:i,damping:s}}else{const n=sm(t);e={...e,...n,mass:z.mass},e.isResolvedFromDuration=!0}return e}function Nl(t=z.visualDuration,e=z.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=um({...n,velocity:-xe(n.velocity||0)}),p=h||0,g=c/(2*Math.sqrt(l*u)),b=o-s,y=xe(Math.sqrt(l/u)),T=Math.abs(b)<5;r||(r=T?z.restSpeed.granular:z.restSpeed.default),i||(i=T?z.restDelta.granular:z.restDelta.default);let x;if(g<1){const S=Er(y,g);x=C=>{const R=Math.exp(-g*y*C);return o-R*((p+g*y*b)/S*Math.sin(S*C)+b*Math.cos(S*C))}}else if(g===1)x=S=>o-Math.exp(-y*S)*(b+(p+y*b)*S);else{const S=y*Math.sqrt(g*g-1);x=C=>{const R=Math.exp(-g*y*C),D=Math.min(S*C,300);return o-R*((p+g*y*b)*Math.sinh(D)+S*b*Math.cosh(D))/S}}const w={calculatedDuration:f&&d||null,next:S=>{const C=x(S);if(f)a.done=S>=d;else{let R=0;g<1&&(R=S===0?Te(p):Al(x,S,C));const D=Math.abs(R)<=r,N=Math.abs(o-C)<=i;a.done=D&&N}return a.value=a.done?o:C,a},toString:()=>{const S=Math.min(Za(w),yr),C=Ja(R=>w.next(S*R).value,S,30);return S+"ms "+C}};return w}function Us({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=t[0],h={done:!1,value:d},f=D=>a!==void 0&&D<a||l!==void 0&&D>l,p=D=>a===void 0?l:l===void 0||Math.abs(a-D)<Math.abs(l-D)?a:l;let g=n*e;const b=d+g,y=o===void 0?b:o(b);y!==b&&(g=y-d);const T=D=>-g*Math.exp(-D/r),x=D=>y+T(D),w=D=>{const N=T(D),A=x(D);h.done=Math.abs(N)<=c,h.value=h.done?y:A};let S,C;const R=D=>{f(h.value)&&(S=D,C=Nl({keyframes:[h.value,p(h.value)],velocity:Al(x,D,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return R(0),{calculatedDuration:null,next:D=>{let N=!1;return!C&&S===void 0&&(N=!0,w(D),R(D)),S!==void 0&&D>=S?C.next(D-S):(!N&&w(D),h)}}}const dm=Nt(.42,0,1,1),hm=Nt(0,0,.58,1),kl=Nt(.42,0,.58,1),fm=t=>Array.isArray(t)&&typeof t[0]!="number",pm={linear:te,easeIn:dm,easeInOut:kl,easeOut:hm,circIn:Mi,circInOut:pl,circOut:fl,backIn:Pi,backInOut:dl,backOut:ul,anticipate:hl},Hs=t=>{if(wi(t)){Ia(t.length===4);const[e,n,r,i]=t;return Nt(e,n,r,i)}else if(typeof t=="string")return pm[t];return t};function gm(t,e,n){const r=[],i=n||Il,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||te:e;a=kt(l,a)}r.push(a)}return r}function mm(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(Ia(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=gm(e,r,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const h=tt(t[d],t[d+1],u);return a[d](h)};return n?u=>c(Se(t[0],t[s-1],u)):c}function vm(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=tt(0,e,r);t.push(_(n,1,i))}}function ym(t){const e=[0];return vm(e,t.length-1),e}function bm(t,e){return t.map(n=>n*e)}function Tm(t,e){return t.map(()=>e||kl).splice(0,t.length-1)}function hn({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=fm(r)?r.map(Hs):Hs(r),s={done:!1,value:e[0]},o=bm(n&&n.length===e.length?n:ym(e),t),a=mm(o,e,{ease:Array.isArray(i)?i:Tm(e,i)});return{calculatedDuration:t,next:l=>(s.value=a(l),s.done=l>=t,s)}}const xm=t=>{const e=({timestamp:n})=>t(n);return{start:()=>j.update(e,!0),stop:()=>Re(e),now:()=>G.isProcessing?G.timestamp:ve.now()}},Sm={decay:Us,inertia:Us,tween:hn,keyframes:hn,spring:Nl},wm=t=>t/100;class Li extends Ml{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=i?.KeyframeResolver||Ni,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=Si(n)?n:Sm[n]||hn;let l,c;a!==hn&&typeof e[0]!="number"&&(l=kt(wm,Il(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});s==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Za(u));const{calculatedDuration:d}=u,h=d+i,f=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:h,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:f,repeatType:p,repeatDelay:g,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),T=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let x=this.currentTime,w=s;if(f){const D=Math.min(this.currentTime,u)/d;let N=Math.floor(D),A=D%1;!A&&D>=1&&(A=1),A===1&&N--,N=Math.min(N,f+1),!!(N%2)&&(p==="reverse"?(A=1-A,g&&(A-=g/d)):p==="mirror"&&(w=o)),x=Se(0,1,A)*d}const S=T?{done:!1,value:l[0]}:w.next(x);a&&(S.value=a(S.value));let{done:C}=S;!T&&c!==null&&(C=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return R&&i!==void 0&&(S.value=Mn(l,this.options,i)),b&&b(S.value),R&&this.finish(),S}get duration(){const{resolved:e}=this;return e?xe(e.calculatedDuration):0}get time(){return xe(this.currentTime)}set time(e){e=Te(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=xe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=xm,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Dm=new Set(["opacity","clipPath","filter","transform"]);function Cm(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=el(a,i);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const Em=ai(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),fn=10,Om=2e4;function Pm(t){return Si(t.type)||t.type==="spring"||!Qa(t.ease)}function Mm(t,e){const n=new Li({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let s=0;for(;!r.done&&s<Om;)r=n.sample(s),i.push(r.value),s+=fn;return{times:void 0,keyframes:i,duration:s-fn,ease:"linear"}}const Ll={anticipate:hl,backInOut:dl,circInOut:pl};function Rm(t){return t in Ll}class Ws extends Ml{constructor(e){super(e);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Pl(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&un()&&Rm(s)&&(s=Ll[s]),Pm(this.options)){const{onComplete:d,onUpdate:h,motionValue:f,element:p,...g}=this.options,b=Mm(e,g);e=b.keyframes,e.length===1&&(e[1]=e[0]),r=b.duration,i=b.times,s=b.ease,o="keyframes"}const u=Cm(a.owner.current,l,e,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Ms(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(Mn(e,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return xe(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return xe(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Te(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return te;const{animation:r}=n;Ms(r,e)}return te}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:h,...f}=this.options,p=new Li({...f,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),g=Te(this.time);c.setWithVelocity(p.sample(g-fn).value,p.sample(g).value,fn)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Em()&&r&&Dm.has(r)&&!l&&!c&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const Im={type:"spring",stiffness:500,damping:25,restSpeed:10},Am=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Nm={type:"keyframes",duration:.8},km={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Lm=(t,{keyframes:e})=>e.length>2?Nm:Ge.has(t)?t.startsWith("scale")?Am(e[1]):Im:km;function Vm({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Vi=(t,e,n,r={},i,s)=>o=>{const a=xi(r,t)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Te(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i};Vm(a)||(u={...u,...Lm(t,u)}),u.duration&&(u.duration=Te(u.duration)),u.repeatDelay&&(u.repeatDelay=Te(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&e.get()!==void 0){const h=Mn(u.keyframes,a);if(h!==void 0)return j.update(()=>{u.onUpdate(h),u.onComplete()}),new tg([])}return!s&&Ws.supports(u)?new Ws(u):new Li(u)};function jm({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Vl(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;r&&(o=r);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const h=t.getValue(d,(s=t.latestValues[d])!==null&&s!==void 0?s:null),f=l[d];if(f===void 0||u&&jm(u,d))continue;const p={delay:n,...xi(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const y=ol(t);if(y){const T=window.MotionHandoffAnimation(y,d,j);T!==null&&(p.startTime=T,g=!0)}}Tr(t,d),h.start(Vi(d,h,f,t.shouldReduceMotion&&il.has(d)?{type:!1}:p,t,g));const b=h.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{j.update(()=>{a&&gg(t,a)})}),c}function Or(t,e,n={}){var r;const i=Pn(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Vl(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=s;return Fm(t,e,u+c,d,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Fm(t,e,n=0,r=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(t.variantChildren).sort(Bm).forEach((c,u)=>{c.notify("AnimationStart",e),o.push(Or(c,e,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function Bm(t,e){return t.sortNodePosition(e)}function _m(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>Or(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=Or(t,e,n);else{const i=typeof e=="function"?Pn(t,e,n.custom):e;r=Promise.all(Vl(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const zm=ci.length;function jl(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?jl(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<zm;n++){const r=ci[n],i=t.props[r];(Ct(i)||i===!1)&&(e[r]=i)}return e}const $m=[...li].reverse(),Um=li.length;function Hm(t){return e=>Promise.all(e.map(({animation:n,options:r})=>_m(t,n,r)))}function Wm(t){let e=Hm(t),n=Gs(),r=!0;const i=l=>(c,u)=>{var d;const h=Pn(t,u,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(h){const{transition:f,transitionEnd:p,...g}=h;c={...c,...g,...p}}return c};function s(l){e=l(t)}function o(l){const{props:c}=t,u=jl(t.parent)||{},d=[],h=new Set;let f={},p=1/0;for(let b=0;b<Um;b++){const y=$m[b],T=n[y],x=c[y]!==void 0?c[y]:u[y],w=Ct(x),S=y===l?T.isActive:null;S===!1&&(p=b);let C=x===u[y]&&x!==c[y]&&w;if(C&&r&&t.manuallyAnimateOnMount&&(C=!1),T.protectedKeys={...f},!T.isActive&&S===null||!x&&!T.prevProp||En(x)||typeof x=="boolean")continue;const R=Gm(T.prevProp,x);let D=R||y===l&&T.isActive&&!C&&w||b>p&&w,N=!1;const A=Array.isArray(x)?x:[x];let H=A.reduce(i(y),{});S===!1&&(H={});const{prevResolvedValues:q={}}=T,L={...q,...H},I=F=>{D=!0,h.has(F)&&(N=!0,h.delete(F)),T.needsAnimating[F]=!0;const W=t.getValue(F);W&&(W.liveStyle=!1)};for(const F in L){const W=H[F],B=q[F];if(f.hasOwnProperty(F))continue;let fe=!1;vr(W)&&vr(B)?fe=!Xa(W,B):fe=W!==B,fe?W!=null?I(F):h.add(F):W!==void 0&&h.has(F)?I(F):T.protectedKeys[F]=!0}T.prevProp=x,T.prevResolvedValues=H,T.isActive&&(f={...f,...H}),r&&t.blockInitialAnimation&&(D=!1),D&&(!(C&&R)||N)&&d.push(...A.map(F=>({animation:F,options:{type:y}})))}if(h.size){const b={};h.forEach(y=>{const T=t.getBaseTarget(y),x=t.getValue(y);x&&(x.liveStyle=!0),b[y]=T??null}),d.push({animation:b})}let g=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),r=!1,g?e(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(h=>{var f;return(f=h.animationState)===null||f===void 0?void 0:f.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Gs(),r=!0}}}function Gm(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Xa(e,t):!1}function Le(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Gs(){return{animate:Le(!0),whileInView:Le(),whileHover:Le(),whileTap:Le(),whileDrag:Le(),whileFocus:Le(),exit:Le()}}class Ne{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Km extends Ne{constructor(e){super(e),e.animationState||(e.animationState=Wm(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();En(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let qm=0;class Ym extends Ne{constructor(){super(...arguments),this.id=qm++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Xm={animation:{Feature:Km},exit:{Feature:Ym}};function Mt(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Lt(t){return{point:{x:t.pageX,y:t.pageY}}}const Zm=t=>e=>Di(e)&&t(e,Lt(e));function bt(t,e,n,r){return Mt(t,e,Zm(n),r)}const Ks=(t,e)=>Math.abs(t-e);function Jm(t,e){const n=Ks(t.x,e.x),r=Ks(t.y,e.y);return Math.sqrt(n**2+r**2)}class Fl{constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Yn(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=Jm(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:p}=d,{timestamp:g}=G;this.history.push({...p,timestamp:g});const{onStart:b,onMove:y}=this.handlers;h||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=qn(h,this.transformPagePoint),j.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Yn(d.type==="pointercancel"?this.lastMoveEventInfo:qn(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,b),p&&p(d,b)},!Di(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Lt(e),a=qn(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=G;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,Yn(a,this.history)),this.removeListeners=kt(bt(this.contextWindow,"pointermove",this.handlePointerMove),bt(this.contextWindow,"pointerup",this.handlePointerUp),bt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Re(this.updatePoint)}}function qn(t,e){return e?{point:e(t.point)}:t}function qs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Yn({point:t},e){return{point:t,delta:qs(t,Bl(e)),offset:qs(t,Qm(e)),velocity:ev(e,.1)}}function Qm(t){return t[0]}function Bl(t){return t[t.length-1]}function ev(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=Bl(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Te(e)));)n--;if(!r)return{x:0,y:0};const s=xe(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const _l=1e-4,tv=1-_l,nv=1+_l,zl=.01,rv=0-zl,iv=0+zl;function ne(t){return t.max-t.min}function sv(t,e,n){return Math.abs(t-e)<=n}function Ys(t,e,n,r=.5){t.origin=r,t.originPoint=_(e.min,e.max,t.origin),t.scale=ne(n)/ne(e),t.translate=_(n.min,n.max,t.origin)-t.originPoint,(t.scale>=tv&&t.scale<=nv||isNaN(t.scale))&&(t.scale=1),(t.translate>=rv&&t.translate<=iv||isNaN(t.translate))&&(t.translate=0)}function Tt(t,e,n,r){Ys(t.x,e.x,n.x,r?r.originX:void 0),Ys(t.y,e.y,n.y,r?r.originY:void 0)}function Xs(t,e,n){t.min=n.min+e.min,t.max=t.min+ne(e)}function ov(t,e,n){Xs(t.x,e.x,n.x),Xs(t.y,e.y,n.y)}function Zs(t,e,n){t.min=e.min-n.min,t.max=t.min+ne(e)}function xt(t,e,n){Zs(t.x,e.x,n.x),Zs(t.y,e.y,n.y)}function av(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?_(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?_(n,t,r.max):Math.min(t,n)),t}function Js(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function lv(t,{top:e,left:n,bottom:r,right:i}){return{x:Js(t.x,n,i),y:Js(t.y,e,r)}}function Qs(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function cv(t,e){return{x:Qs(t.x,e.x),y:Qs(t.y,e.y)}}function uv(t,e){let n=.5;const r=ne(t),i=ne(e);return i>r?n=tt(e.min,e.max-r,t.min):r>i&&(n=tt(t.min,t.max-i,e.min)),Se(0,1,n)}function dv(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Pr=.35;function hv(t=Pr){return t===!1?t=0:t===!0&&(t=Pr),{x:eo(t,"left","right"),y:eo(t,"top","bottom")}}function eo(t,e,n){return{min:to(t,e),max:to(t,n)}}function to(t,e){return typeof t=="number"?t:t[e]||0}const no=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xe=()=>({x:no(),y:no()}),ro=()=>({min:0,max:0}),$=()=>({x:ro(),y:ro()});function oe(t){return[t("x"),t("y")]}function $l({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function fv({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function pv(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Xn(t){return t===void 0||t===1}function Mr({scale:t,scaleX:e,scaleY:n}){return!Xn(t)||!Xn(e)||!Xn(n)}function Ve(t){return Mr(t)||Ul(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ul(t){return io(t.x)||io(t.y)}function io(t){return t&&t!=="0%"}function pn(t,e,n){const r=t-n,i=e*r;return n+i}function so(t,e,n,r,i){return i!==void 0&&(t=pn(t,i,r)),pn(t,n,r)+e}function Rr(t,e=0,n=1,r,i){t.min=so(t.min,e,n,r,i),t.max=so(t.max,e,n,r,i)}function Hl(t,{x:e,y:n}){Rr(t.x,e.translate,e.scale,e.originPoint),Rr(t.y,n.translate,n.scale,n.originPoint)}const oo=.999999999999,ao=1.0000000000001;function gv(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Je(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Hl(t,o)),r&&Ve(s.latestValues)&&Je(t,s.latestValues))}e.x<ao&&e.x>oo&&(e.x=1),e.y<ao&&e.y>oo&&(e.y=1)}function Ze(t,e){t.min=t.min+e,t.max=t.max+e}function lo(t,e,n,r,i=.5){const s=_(t.min,t.max,i);Rr(t,e,n,s,r)}function Je(t,e){lo(t.x,e.x,e.scaleX,e.scale,e.originX),lo(t.y,e.y,e.scaleY,e.scale,e.originY)}function Wl(t,e){return $l(pv(t.getBoundingClientRect(),e))}function mv(t,e,n){const r=Wl(t,n),{scroll:i}=e;return i&&(Ze(r.x,i.offset.x),Ze(r.y,i.offset.y)),r}const Gl=({current:t})=>t?t.ownerDocument.defaultView:null,vv=new WeakMap;class yv{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=$(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Lt(u).point)},s=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:p}=this.getProps();if(h&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ug(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oe(b=>{let y=this.getAxisMotionValue(b).get()||0;if(me.test(y)){const{projection:T}=this.visualElement;if(T&&T.layout){const x=T.layout.layoutBox[b];x&&(y=ne(x)*(parseFloat(y)/100))}}this.originPoint[b]=y}),p&&j.postRender(()=>p(u,d)),Tr(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:p,onDrag:g}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:b}=d;if(f&&this.currentDirection===null){this.currentDirection=bv(b),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),g&&g(u,d)},a=(u,d)=>this.stop(u,d),l=()=>oe(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Fl(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Gl(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&j.postRender(()=>s(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!Wt(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=av(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;n&&qe(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=lv(i.layoutBox,n):this.constraints=!1,this.elastic=hv(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&oe(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=dv(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!qe(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=mv(r,i.root,this.visualElement.getTransformPagePoint());let o=cv(i.layout.layoutBox,s);if(n){const a=n(fv(o));this.hasMutatedConstraints=!!a,a&&(o=$l(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=oe(u=>{if(!Wt(u,n,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:r?e[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Tr(this.visualElement,e),r.start(Vi(e,r,0,n,this.visualElement,!1))}stopAnimation(){oe(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){oe(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){oe(n=>{const{drag:r}=this.getProps();if(!Wt(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(e[n]-_(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!qe(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};oe(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=uv({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),oe(o=>{if(!Wt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(_(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;vv.set(this.visualElement,this);const e=this.visualElement.current,n=bt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();qe(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),j.read(r);const o=Mt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(oe(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Pr,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Wt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function bv(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Tv extends Ne{constructor(e){super(e),this.removeGroupControls=te,this.removeListeners=te,this.controls=new yv(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||te}unmount(){this.removeGroupControls(),this.removeListeners()}}const co=t=>(e,n)=>{t&&j.postRender(()=>t(e,n))};class xv extends Ne{constructor(){super(...arguments),this.removePointerDownListener=te}onPointerDown(e){this.session=new Fl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Gl(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:co(e),onStart:co(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&j.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=bt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const lt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(E.test(t))t=parseFloat(t);else return t;const n=uo(t,e.target.x),r=uo(t,e.target.y);return`${n}% ${r}%`}},Sv={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Ie.parse(t);if(i.length>5)return r;const s=Ie.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=_(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class wv extends m.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;Up(Dv),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||j.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),di.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Kl(t){const[e,n]=ip(),r=m.useContext(Ma);return v.jsx(wv,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(ja),isPresent:e,safeToRemove:n})}const Dv={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:Sv};function Cv(t,e,n){const r=X(t)?t:Ot(t);return r.start(Vi("",r,e,n)),r.animation}function Ev(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Ov=(t,e)=>t.depth-e.depth;class Pv{constructor(){this.children=[],this.isDirty=!1}add(e){Ci(this.children,e),this.isDirty=!0}remove(e){Ei(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ov),this.isDirty=!1,this.children.forEach(e)}}function Mv(t,e){const n=ve.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(Re(r),t(s-e))};return j.read(r,!0),()=>Re(r)}const ql=["TopLeft","TopRight","BottomLeft","BottomRight"],Rv=ql.length,ho=t=>typeof t=="string"?parseFloat(t):t,fo=t=>typeof t=="number"||E.test(t);function Iv(t,e,n,r,i,s){i?(t.opacity=_(0,n.opacity!==void 0?n.opacity:1,Av(r)),t.opacityExit=_(e.opacity!==void 0?e.opacity:1,0,Nv(r))):s&&(t.opacity=_(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Rv;o++){const a=`border${ql[o]}Radius`;let l=po(e,a),c=po(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||fo(l)===fo(c)?(t[a]=Math.max(_(ho(l),ho(c),r),0),(me.test(c)||me.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=_(e.rotate||0,n.rotate||0,r))}function po(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Av=Yl(0,.5,fl),Nv=Yl(.5,.95,te);function Yl(t,e,n){return r=>r<t?0:r>e?1:n(tt(t,e,r))}function go(t,e){t.min=e.min,t.max=e.max}function ie(t,e){go(t.x,e.x),go(t.y,e.y)}function mo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function vo(t,e,n,r,i){return t-=e,t=pn(t,1/n,r),i!==void 0&&(t=pn(t,1/i,r)),t}function kv(t,e=0,n=1,r=.5,i,s=t,o=t){if(me.test(e)&&(e=parseFloat(e),e=_(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=_(s.min,s.max,r);t===s&&(a-=e),t.min=vo(t.min,e,n,a,i),t.max=vo(t.max,e,n,a,i)}function yo(t,e,[n,r,i],s,o){kv(t,e[n],e[r],e[i],e.scale,s,o)}const Lv=["x","scaleX","originX"],Vv=["y","scaleY","originY"];function bo(t,e,n,r){yo(t.x,e,Lv,n?n.x:void 0,r?r.x:void 0),yo(t.y,e,Vv,n?n.y:void 0,r?r.y:void 0)}function To(t){return t.translate===0&&t.scale===1}function Xl(t){return To(t.x)&&To(t.y)}function xo(t,e){return t.min===e.min&&t.max===e.max}function jv(t,e){return xo(t.x,e.x)&&xo(t.y,e.y)}function So(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Zl(t,e){return So(t.x,e.x)&&So(t.y,e.y)}function wo(t){return ne(t.x)/ne(t.y)}function Do(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Fv{constructor(){this.members=[]}add(e){Ci(this.members,e),e.scheduleRender()}remove(e){if(Ei(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Bv(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=n?.z||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:h,skewX:f,skewY:p}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),f&&(r+=`skewX(${f}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const je={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ft=typeof window<"u"&&window.MotionDebug!==void 0,Zn=["","X","Y","Z"],_v={visibility:"hidden"},Co=1e3;let zv=0;function Jn(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function Jl(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ol(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",j,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&Jl(r)}function Ql({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=zv++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ft&&(je.totalNodes=je.resolvedTargetDeltas=je.recalculatedProjection=0),this.nodes.forEach(Hv),this.nodes.forEach(Yv),this.nodes.forEach(Xv),this.nodes.forEach(Wv),ft&&window.MotionDebug.record(je)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Pv)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Oi),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ev(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),t){let d;const h=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Mv(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(Oo))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||ty,{onLayoutAnimationStart:b,onLayoutAnimationComplete:y}=u.getProps(),T=!this.targetLayout||!Zl(this.targetLayout,p)||f,x=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const w={...xi(g,"layout"),onPlay:b,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||Oo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Re(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(Zv),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Jl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Eo);return}this.isUpdating||this.nodes.forEach(Kv),this.isUpdating=!1,this.nodes.forEach(qv),this.nodes.forEach($v),this.nodes.forEach(Uv),this.clearAllSnapshots();const a=ve.now();G.delta=Se(0,1e3/60,a-G.timestamp),G.timestamp=a,G.isProcessing=!0,$n.update.process(G),$n.preRender.process(G),$n.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,di.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gv),this.sharedNodes.forEach(Jv)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,j.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){j.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=$(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Xl(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||Ve(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),ny(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return $();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(ry))){const{scroll:u}=this.root;u&&(Ze(l.x,u.offset.x),Ze(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=$();if(ie(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&ie(l,o),Ze(l.x,d.offset.x),Ze(l.y,d.offset.y))}return l}applyTransform(o,a=!1){const l=$();ie(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Je(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ve(u.latestValues)&&Je(l,u.latestValues)}return Ve(this.latestValues)&&Je(l,this.latestValues),l}removeTransform(o){const a=$();ie(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ve(c.latestValues))continue;Mr(c.latestValues)&&c.updateSnapshot();const u=$(),d=c.measurePageBox();ie(u,d),bo(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ve(this.latestValues)&&bo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!(!this.layout||!(d||h))){if(this.resolvedRelativeTargetAt=G.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$(),this.relativeTargetOrigin=$(),xt(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),ie(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=$(),this.targetWithTransforms=$()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ov(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ie(this.target,this.layout.layoutBox),Hl(this.target,this.targetDelta)):ie(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$(),this.relativeTargetOrigin=$(),xt(this.relativeTargetOrigin,this.target,f.target),ie(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ft&&je.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Mr(this.parent.latestValues)||Ul(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===G.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;ie(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;gv(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=$());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mo(this.prevProjectionDelta.x,this.projectionDelta.x),mo(this.prevProjectionDelta.y,this.projectionDelta.y)),Tt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Do(this.projectionDelta.x,this.prevProjectionDelta.x)||!Do(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),ft&&je.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Xe(),this.projectionDelta=Xe(),this.projectionDeltaWithTransform=Xe()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Xe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=$(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,b=this.getStack(),y=!b||b.members.length<=1,T=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(ey));this.animationProgress=0;let x;this.mixTargetDelta=w=>{const S=w/1e3;Po(d.x,o.x,S),Po(d.y,o.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Qv(this.relativeTarget,this.relativeTargetOrigin,h,S),x&&jv(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=$()),ie(x,this.relativeTarget)),g&&(this.animationValues=u,Iv(u,c,this.latestValues,S,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Re(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=j.update(()=>{Jt.hasAnimatedSinceResize=!0,this.currentAnimation=Cv(0,Co,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.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);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Co),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&ec(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||$();const d=ne(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=ne(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}ie(a,l),Je(a,u),Tt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Fv),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Jn("z",o,c,this.animationValues);for(let u=0;u<Zn.length;u++)Jn(`rotate${Zn[u]}`,o,c,this.animationValues),Jn(`skew${Zn[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _v;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Xt(o?.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Xt(o?.pointerEvents)||""),this.hasProjected&&!Ve(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const h=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=Bv(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:f,y:p}=this.projectionDelta;c.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const g in cn){if(h[g]===void 0)continue;const{correct:b,applyTo:y}=cn[g],T=c.transform==="none"?h[g]:b(h[g],d);if(y){const x=y.length;for(let w=0;w<x;w++)c[y[w]]=T}else c[g]=T}return this.options.layoutId&&(c.pointerEvents=d===this?Xt(o?.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Eo),this.root.sharedNodes.clear()}}}function $v(t){t.updateLayout()}function Uv(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;s==="size"?oe(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=ne(h);h.min=r[d].min,h.max=h.min+f}):ec(s,n.layoutBox,r)&&oe(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=ne(r[d]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+f)});const a=Xe();Tt(a,r,n.layoutBox);const l=Xe();o?Tt(l,t.applyTransform(i,!0),n.measuredBox):Tt(l,r,n.layoutBox);const c=!Xl(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const p=$();xt(p,n.layoutBox,h.layoutBox);const g=$();xt(g,r,f.layoutBox),Zl(p,g)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Hv(t){ft&&je.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Wv(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Gv(t){t.clearSnapshot()}function Eo(t){t.clearMeasurements()}function Kv(t){t.isLayoutDirty=!1}function qv(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Oo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Yv(t){t.resolveTargetDelta()}function Xv(t){t.calcProjection()}function Zv(t){t.resetSkewAndRotation()}function Jv(t){t.removeLeadSnapshot()}function Po(t,e,n){t.translate=_(e.translate,0,n),t.scale=_(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Mo(t,e,n,r){t.min=_(e.min,n.min,r),t.max=_(e.max,n.max,r)}function Qv(t,e,n,r){Mo(t.x,e.x,n.x,r),Mo(t.y,e.y,n.y,r)}function ey(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ty={duration:.45,ease:[.4,0,.1,1]},Ro=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Io=Ro("applewebkit/")&&!Ro("chrome/")?Math.round:te;function Ao(t){t.min=Io(t.min),t.max=Io(t.max)}function ny(t){Ao(t.x),Ao(t.y)}function ec(t,e,n){return t==="position"||t==="preserve-aspect"&&!sv(wo(e),wo(n),.2)}function ry(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const iy=Ql({attachResizeListener:(t,e)=>Mt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qn={current:void 0},tc=Ql({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Qn.current){const t=new iy({});t.mount(window),t.setOptions({layoutScroll:!0}),Qn.current=t}return Qn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),sy={pan:{Feature:xv},drag:{Feature:Tv,ProjectionNode:tc,MeasureLayout:Kl}};function No(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&j.postRender(()=>s(e,Lt(e)))}class oy extends Ne{mount(){const{current:e}=this.node;e&&(this.unmount=sg(e,n=>(No(this.node,n,"Start"),r=>No(this.node,r,"End"))))}unmount(){}}class ay extends Ne{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=kt(Mt(this.node.current,"focus",()=>this.onFocus()),Mt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ko(t,e,n){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&j.postRender(()=>s(e,Lt(e)))}class ly extends Ne{mount(){const{current:e}=this.node;e&&(this.unmount=cg(e,n=>(ko(this.node,n,"Start"),(r,{success:i})=>ko(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ir=new WeakMap,er=new WeakMap,cy=t=>{const e=Ir.get(t.target);e&&e(t)},uy=t=>{t.forEach(cy)};function dy({root:t,...e}){const n=t||document;er.has(n)||er.set(n,{});const r=er.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(uy,{root:t,...e})),r[i]}function hy(t,e,n){const r=dy(e);return Ir.set(t,n),r.observe(t),()=>{Ir.delete(t),r.unobserve(t)}}const fy={some:0,all:1};class py extends Ne{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:fy[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return hy(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(gy(e,n))&&this.startObserver()}unmount(){}}function gy({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const my={inView:{Feature:py},tap:{Feature:ly},focus:{Feature:ay},hover:{Feature:oy}},vy={layout:{ProjectionNode:tc,MeasureLayout:Kl}},Ar={current:null},nc={current:!1};function yy(){if(nc.current=!0,!!oi)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ar.current=t.matches;t.addListener(e),e()}else Ar.current=!1}const by=[...Ol,Y,Ie],Ty=t=>by.find(El(t)),Lo=new WeakMap;function xy(t,e,n){for(const r in e){const i=e[r],s=n[r];if(X(i))t.addValue(r,i);else if(X(s))t.addValue(r,Ot(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,Ot(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Vo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Sy{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ni,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=()=>{const f=ve.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,j.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=On(n),this.isVariantNode=La(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const p=h[f];l[f]!==void 0&&X(p)&&p.set(l[f],!1)}}mount(e){this.current=e,Lo.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((n,r)=>this.bindToMotionValue(r,n)),nc.current||yy(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ar.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Lo.delete(this.current),this.projection&&this.projection.unmount(),Re(this.notifyUpdate),Re(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Ge.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&j.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),n.owner&&n.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 nt){const n=nt[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Vo.length;r++){const i=Vo[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=xy(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}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){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Ot(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Dl(i)||gl(i))?i=parseFloat(i):!Ty(i)&&Ie.test(n)&&(i=xl(e,n)),this.setBaseTarget(e,X(i)?i.get():i)),X(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=fi(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!X(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Oi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class rc extends Sy{constructor(){super(...arguments),this.KeyframeResolver=Pl}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;X(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function wy(t){return window.getComputedStyle(t)}class Dy extends rc{constructor(){super(...arguments),this.type="html",this.renderInstance=Ha}readValueFromInstance(e,n){if(Ge.has(n)){const r=Ai(n);return r&&r.default||0}else{const r=wy(e),i=(za(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Wl(e,n)}build(e,n,r){mi(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Ti(e,n,r)}}class Cy extends rc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ge.has(n)){const r=Ai(n);return r&&r.default||0}return n=Wa.has(n)?n:ui(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return qa(e,n,r)}build(e,n,r){vi(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){Ga(e,n,r,i)}mount(e){this.isSVGTag=bi(e.tagName),super.mount(e)}}const Ey=(t,e)=>hi(t)?new Cy(e):new Dy(e,{allowProjection:t!==m.Fragment}),Oy=Jp({...Xm,...my,...sy,...vy},Ey),Py=fp(Oy);function jo(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function My({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=m.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=m.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,c=t?typeof t=="number"?t:t.resize:null,u=m.useRef(!1);m.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[d,h,f]=m.useMemo(()=>{const y=()=>{if(!a.current.element)return;const{left:T,top:x,width:w,height:S,bottom:C,right:R,x:D,y:N}=a.current.element.getBoundingClientRect(),A={left:T,top:x,width:w,height:S,bottom:C,right:R,x:D,y:N};a.current.element instanceof HTMLElement&&r&&(A.height=a.current.element.offsetHeight,A.width=a.current.element.offsetWidth),Object.freeze(A),u.current&&!Ny(a.current.lastBounds,A)&&o(a.current.lastBounds=A)};return[y,c?jo(y,c):y,l?jo(y,l):y]},[o,r,l,c]);function p(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(y=>y.removeEventListener("scroll",f,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function g(){a.current.element&&(a.current.resizeObserver=new i(f),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(y=>y.addEventListener("scroll",f,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{f()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const b=y=>{!y||y===a.current.element||(p(),a.current.element=y,a.current.scrollContainers=ic(y),g())};return Iy(f,!!e),Ry(h),m.useEffect(()=>{p(),g()},[e,f,h]),m.useEffect(()=>p,[]),[b,s,d]}function Ry(t){m.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Iy(t,e){m.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function ic(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...ic(t.parentElement)]}const Ay=["x","y","top","bottom","left","right","width","height"],Ny=(t,e)=>Ay.every(n=>t[n]===e[n]);var sc=t=>{throw TypeError(t)},oc=(t,e,n)=>e.has(t)||sc("Cannot "+n),O=(t,e,n)=>(oc(t,e,"read from private field"),n?n.call(t):e.get(t)),se=(t,e,n)=>e.has(t)?sc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Fe=(t,e,n,r)=>(oc(t,e,"write to private field"),e.set(t,n),n),Oe,ky=class{constructor(){se(this,Oe),this.register=t=>{O(this,Oe).push(t)},this.unregister=t=>{for(;O(this,Oe).indexOf(t)!==-1;)O(this,Oe).splice(O(this,Oe).indexOf(t),1)},this.backendChanged=t=>{for(let e of O(this,Oe))e.backendChanged(t)},Fe(this,Oe,[])}};Oe=new WeakMap;var J,pt,Q,be,Be,Nr,kr,Lr,Qt,en,gt,ac=class tn{constructor(e,n,r){if(se(this,J),se(this,pt),se(this,Q),se(this,be),se(this,Be),se(this,Nr,(i,s,o)=>{if(!o.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(o)}`);let a=o.backend(i,s,o.options),l=o.id,c=!o.id&&a&&a.constructor;if(c&&(l=a.constructor.name),!l)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(o)}
133
+ see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(c&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
134
+ This might be unsupported in the future, please specify 'id' explicitely for every backend.`),O(this,Q)[l])throw new Error(`You must specify a unique 'id' property in your Backend entry:
135
+ ${JSON.stringify(o)} (conflicts with: ${JSON.stringify(O(this,Q)[l])})`);return{id:l,instance:a,preview:o.preview??!1,transition:o.transition,skipDispatchOnTransition:o.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(tn.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");tn.isSetUp=!0,O(this,kr).call(this,window),O(this,Q)[O(this,J)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(tn.isSetUp=!1,O(this,Lr).call(this,window),O(this,Q)[O(this,J)].instance.teardown())},this.connectDragSource=(i,s,o)=>O(this,gt).call(this,"connectDragSource",i,s,o),this.connectDragPreview=(i,s,o)=>O(this,gt).call(this,"connectDragPreview",i,s,o),this.connectDropTarget=(i,s,o)=>O(this,gt).call(this,"connectDropTarget",i,s,o),this.profile=()=>O(this,Q)[O(this,J)].instance.profile(),this.previewEnabled=()=>O(this,Q)[O(this,J)].preview,this.previewsList=()=>O(this,pt),this.backendsList=()=>O(this,be),se(this,kr,i=>{for(let s of O(this,be))s.transition&&i.addEventListener(s.transition.event,O(this,Qt))}),se(this,Lr,i=>{for(let s of O(this,be))s.transition&&i.removeEventListener(s.transition.event,O(this,Qt))}),se(this,Qt,i=>{let s=O(this,J);if(O(this,be).some(o=>o.id!==O(this,J)&&o.transition&&o.transition.check(i)?(Fe(this,J,o.id),!0):!1),O(this,J)!==s){O(this,Q)[s].instance.teardown();for(let[c,u]of Object.entries(O(this,Be)))u.unsubscribe(),u.unsubscribe=O(this,en).call(this,u.func,...u.args);O(this,pt).backendChanged(this);let o=O(this,Q)[O(this,J)];if(o.instance.setup(),o.skipDispatchOnTransition)return;let a=i.constructor,l=new a(i.type,i);i.target?.dispatchEvent(l)}}),se(this,en,(i,s,o,a)=>O(this,Q)[O(this,J)].instance[i](s,o,a)),se(this,gt,(i,s,o,a)=>{let l=`${i}_${s}`,c=O(this,en).call(this,i,s,o,a);return O(this,Be)[l]={func:i,args:[s,o,a],unsubscribe:c},()=>{O(this,Be)[l].unsubscribe(),delete O(this,Be)[l]}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
136
+ see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);Fe(this,pt,new ky),Fe(this,Q,{}),Fe(this,be,[]);for(let i of r.backends){let s=O(this,Nr).call(this,e,n,i);O(this,Q)[s.id]=s,O(this,be).push(s)}Fe(this,J,O(this,be)[0].id),Fe(this,Be,{})}};J=new WeakMap,pt=new WeakMap,Q=new WeakMap,be=new WeakMap,Be=new WeakMap,Nr=new WeakMap,kr=new WeakMap,Lr=new WeakMap,Qt=new WeakMap,en=new WeakMap,gt=new WeakMap,ac.isSetUp=!1;var Ly=ac,Vy=(t,e,n)=>new Ly(t,e,n),lc=(t,e)=>({event:t,check:e}),jy=lc("touchstart",t=>{let e=t;return e.touches!==null&&e.touches!==void 0}),Fy=lc("pointerdown",t=>t.pointerType==="mouse"),Me;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(Me||(Me={}));class By{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function _y(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function zy(t,e,n,r,i){if(!i)return!1;const s=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const $y={Left:1},Uy={Left:0};function tr(t){return t.button===void 0||t.button===Uy.Left}function Hy(t){return t.buttons===void 0||(t.buttons&$y.Left)===0}function cc(t){return!!t.targetTouches}const Wy=1;function Gy(t){const e=t.nodeType===Wy?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ky(t,e){if(t.targetTouches.length===1)return gn(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return gn(t.touches[0])}function gn(t,e){return cc(t)?Ky(t,e):{x:t.clientX,y:t.clientY}}const Fo=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),ct={[Me.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Me.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Me.keyboard]:{keydown:"keydown"}};class St{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(P(!St.isSetUp,"Cannot have two Touch backends at the same time."),St.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(St.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,i=!1){const s=Fo?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.addEventListener(a,r,s)})}removeEventListener(e,n,r,i=!1){const s=Fo?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=ct[o][n];a&&e.removeEventListener(a,r,s)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case ct.mouse.move:o={x:s.clientX,y:s.clientY};break;case ct.touch.move:var a,l;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((l=s.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const c=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,u=c&&n.contains(c);if(c===n||u)return this.handleMove(s,e)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Gy(s)},this.handleTopMoveStartCapture=i=>{tr(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!tr(i))return;const s=gn(i);s&&(cc(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!tr(i))return;const s=i.type===ct.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,l=gn(i,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&zy(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&_y(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const c=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(c),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const u=(o||[]).map(p=>this.targetNodes.get(p)).filter(p=>!!p),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,u):this.document.elementsFromPoint(l.x,l.y),h=[];for(const p in d){if(!d.hasOwnProperty(p))continue;let g=d[p];for(g!=null&&h.push(g);g;)g=g.parentElement,g&&h.indexOf(g)===-1&&h.push(g)}const f=h.filter(p=>u.indexOf(p)>-1).map(p=>this._getDropTargetId(p)).filter(p=>!!p).filter((p,g,b)=>b.indexOf(p)===g);if(a)for(const p in this.targetNodes){const g=this.targetNodes.get(p);if(c&&g&&g.contains(c)&&f.indexOf(p)===-1){f.unshift(p);break}}f.reverse(),this.actions.hover(f,{clientOffset:l})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!Hy(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new By(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Me.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Me.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Me.keyboard)}}const qy=function(e,n={},r={}){return new St(e,n,r)};var ue=function(){return ue=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},ue.apply(this,arguments)};function K(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function Yy(t){var e=t.isVisible,n=t.ease,r=n===void 0?"easeIn":n,i=t.duration,s=t.variants,o=s===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:s,a=t.children,l=My({polyfill:np}),c=l[0],u=l[1].height,d=m.useState(e),h=d[0],f=d[1],p=m.useState(e),g=p[0],b=p[1],y=m.useState(!1),T=y[0],x=y[1],w=function(){x(!1),e||f(!1)};m.useEffect(function(){x(!0),e?f(!0):b(!1)},[e]);var S=u===0;return m.useEffect(function(){h&&b(!0)},[S]),V.createElement(Py.div,{style:T?{overflow:"hidden"}:void 0,onAnimationComplete:w,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:o,transition:{ease:r,duration:Xy(u,i)}},V.createElement("div",{ref:c},h&&a))}function Xy(t,e){if(e)return e;if(!t)return 0;var n=t/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var uc=m.createContext({}),Zy={isLock:!1},Jy=function(t){var e=m.useState(Zy.isLock),n=e[0],r=e[1];return V.createElement(uc.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},t.children)},Vt=m.createContext({}),Gt={dropTargetId:void 0,index:void 0},Qy=function(t){var e=m.useState(Gt.dropTargetId),n=e[0],r=e[1],i=m.useState(Gt.index),s=i[0],o=i[1],a=function(c,u){r(c),o(u)},l=function(){r(Gt.dropTargetId),o(Gt.index)};return V.createElement(Vt.Provider,{value:{dropTargetId:n,index:s,showPlaceholder:a,hidePlaceholder:l}},t.children)},e0=function(t,e){return t.text>e.text?1:t.text<e.text?-1:0},ut=function(t,e){return t.find(function(n){return n.id===e})},dc=function(t,e,n){if(n===0)return!1;var r=t.find(function(i){return i.id===n});return r===void 0?!1:r.parent===e?!0:dc(t,e,r.parent)},ji=function(t){return typeof t=="object"&&t!==null&&"id"in t&&"parent"in t&&"text"in t},Ae=function(t,e,n){var r=n.tree,i=n.rootId,s=n.canDrop;if(t===null){if(e===i)return!0;var o=r.find(function(u){return u.id===e});return!!(o&&o.droppable)}else{var a=ji(t)?t.id:null;if(s){var l=s(a,e);if(l!==void 0)return l}if(a===e)return!1;var c=r.find(function(d){return d.id===a}),o=r.find(function(d){return d.id===e});return c===void 0||a===null?e===i||!!o?.droppable:o===void 0?c.parent!==0:c.parent===e||!o.droppable?!1:!dc(r,a,e)}},t0=function(t,e,n){return t.map(function(r){return r.id===e?ue(ue({},r),{parent:n}):r})},hc=function(t,e,n){if(n===0)return 0;var r=t.filter(function(i){return i.parent===e});return r[n]?t.findIndex(function(i){return i.id===r[n].id}):t.findIndex(function(i){return i.id===r[n-1].id})+1},n0=function(t,e){return t.findIndex(function(n){return n.id===e})},fc=function(t,e,n,r){var i=n0(t,e),s=hc(t,n,r);return s=s>i?s-1:s,[i,s]},r0=function(t,e,n){var r=e<0?t.length+e:e;if(r>=0&&r<t.length){var i=n<0?t.length+n:n,s=t.splice(e,1)[0];t.splice(i,0,s)}},i0=function(t,e,n,r){var i=fc(t,e,n,r),s=i[0],o=i[1],a=K([],t,!0);return r0(a,s,o),a.map(function(l){return l.id===e?ue(ue({},l),{parent:n}):l})},s0=function(t,e){var n=t.getBoundingClientRect(),r=n.top+n.height/2;return e>r?"down":"up"},Vr=function(t,e){var n="",r=0;return t.forEach(function(i,s){var o,a=s0(i,((o=e.getClientOffset())===null||o===void 0?void 0:o.y)||0);n===""?n=a:n!==a&&(n=a,r=s),s===t.length-1&&a==="down"&&(r=s+1)}),r},Bo=function(t,e,n){var r=e.closest('[role="list"]'),i=r?.querySelectorAll(':scope > [role="listitem"]');return i?Vr(i,n):null},o0=function(t,e,n){var r=t.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return"middle";var s=r.top+i,o=r.bottom-i;return e>o?"lower":e<s?"upper":"middle"},jr=function(t,e,n,r){var i;if(!e)return null;if(t===null){var s=e.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:Vr(s,n)}}var o=n.getItem(),a=e.querySelector('[role="list"]'),l=o0(e,((i=n.getClientOffset())===null||i===void 0?void 0:i.y)||0,r);if(a){if(l==="upper")if(Ae(o,t.parent,r)){var c=Bo(t,e,n);return c===null?null:{id:t.parent,index:c}}else return{id:t.id,index:0};var s=a.querySelectorAll(':scope > [role="listitem"]');return{id:t.id,index:Vr(s,n)}}else{if(l==="middle")return{id:t.id,index:0};if(Ae(o,t.parent,r)){var c=Bo(t,e,n);return c===null?null:{id:t.parent,index:c}}return null}},mn=function(t,e){var n=[],r=function(i,s){var o=i.filter(function(a){return s.includes(a.parent)});o.length>0&&(n=K(K([],n,!0),o,!0),r(i,o.map(function(a){return a.id})))};return r(t,[e]),n},a0=function(t){return t===void 0&&(t={}),{backends:[{id:"html5",backend:Lf,options:t.html5,transition:Fy},{id:"touch",backend:qy,options:t.touch||{enableMouseEvents:!0},preview:!0,transition:jy}]}},nn=function(t,e){return t.some(function(n){return n.parent===e})},pc=m.createContext({}),l0=function(t){var e=g0(t.tree,t.initialOpen),n=e[0],r=e[1],i=r.handleToggle,s=r.handleCloseAll,o=r.handleOpenAll,a=r.handleOpen,l=r.handleClose;m.useImperativeHandle(t.treeRef,function(){return{open:function(f){return a(f,t.onChangeOpen)},close:function(f){return l(f,t.onChangeOpen)},openAll:function(){return o(t.onChangeOpen)},closeAll:function(){return s(t.onChangeOpen)}}});var c=De().getMonitor(),u=t.canDrop,d=t.canDrag,h=ue(ue({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},t),{openIds:n,onDrop:function(f,p,g){if(f){var b={dragSourceId:f.id,dropTargetId:p,dragSource:f,dropTarget:ut(t.tree,p),monitor:c},y=t.tree;if(ut(y,f.id)||(y=K(K([],y,!0),[f],!1)),t.sort===!1){var T=fc(y,f.id,p,g),x=T[1];b.destinationIndex=x,b.relativeIndex=g,t.onDrop(i0(y,f.id,p,g),b);return}t.onDrop(t0(y,f.id,p),b)}else{var b={dropTargetId:p,dropTarget:ut(t.tree,p),monitor:c};t.sort===!1&&(b.destinationIndex=hc(t.tree,p,g),b.relativeIndex=g),t.onDrop(t.tree,b)}},canDrop:u?function(f,p){return u(t.tree,{dragSourceId:f??void 0,dropTargetId:p,dragSource:c.getItem(),dropTarget:ut(t.tree,p),monitor:c})}:void 0,canDrag:d?function(f){return d(ut(t.tree,f))}:void 0,onToggle:function(f){return i(f,t.onChangeOpen)}});return V.createElement(pc.Provider,{value:h},t.children)},c0=function(t){return V.createElement(l0,ue({},t),V.createElement(Jy,null,V.createElement(Qy,null,t.children)))},u0=function(t){var e=m.useContext(uc);m.useEffect(function(){if(t.current){var n=t.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.lock()},i=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.unlock()},s=function(u){return r(u)},o=function(u){return i(u)},a=function(u){return r(u)},l=function(u){return i(u)},c=new MutationObserver(function(){document.activeElement===document.body&&e.unlock()});return c.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",s),n.addEventListener("mouseout",o),n.addEventListener("focusin",a),n.addEventListener("focusout",l),function(){c.disconnect(),n.removeEventListener("mouseover",s),n.removeEventListener("mouseout",o),n.removeEventListener("focusin",a),n.removeEventListener("focusout",l)}}},[t,e]),m.useEffect(function(){var n;(n=t.current)===null||n===void 0||n.setAttribute("draggable",e.isLock?"false":"true")},[t,e.isLock])},Rn={TREE_ITEM:Symbol()},gc=null,mc=function(t){var e=t.target;if(e instanceof HTMLElement){var n=e.closest('[role="listitem"]');t.currentTarget===n&&(gc=n)}},_o=function(t){return mc(t)},zo=function(t){return mc(t)},d0=function(t,e){var n=ke();m.useEffect(function(){var a=e.current;return a?.addEventListener("dragstart",_o),a?.addEventListener("touchstart",zo,{passive:!0}),function(){a?.removeEventListener("dragstart",_o),a?.removeEventListener("touchstart",zo)}},[e]);var r=hf({type:Rn.TREE_ITEM,item:function(a){var l=ue({ref:e},t);return n.onDragStart&&n.onDragStart(l,a),l},end:function(a,l){var c=a;n.onDragEnd&&n.onDragEnd(c,l)},canDrag:function(){var a=n.canDrag;return gc!==e.current?!1:a?a(t.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),i=r[0].isDragging,s=r[1],o=r[2];return[i,s,o]},h0=function(t,e,n){var r=m.useRef(0),i=m.useRef(0),s=function(){r.current+=1,r.current===1&&!e&&(i.current=window.setTimeout(function(){return n(t)},500))},o=function(){r.current-=1,r.current===0&&window.clearTimeout(i.current)},a=function(){i.current>0&&window.clearTimeout(i.current),r.current=0,i.current=0};return{onDragEnter:s,onDragLeave:o,onDrop:a}},f0=function(t){var e=ke(),n=m.useContext(Vt),r=ga({accept:K([Rn.TREE_ITEM],e.extraAcceptTypes,!0),drop:function(l,c){var u=e.rootId,d=e.onDrop,h=n.dropTargetId,f=n.index;c.isOver({shallow:!0})&&h!==void 0&&f!==void 0&&d(ji(l)?l:null,u,f),n.hidePlaceholder()},canDrop:function(l,c){var u=e.rootId;return c.isOver({shallow:!0})?l===void 0?!1:Ae(l,u,e):!1},hover:function(l,c){if(c.isOver({shallow:!0})){var u=e.rootId,d=n.dropTargetId,h=n.index,f=n.showPlaceholder,p=n.hidePlaceholder,g=jr(null,t.current,c,e);if(g===null||!Ae(l,u,e)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(l){var c=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:c}}}),i=r[0],s=i.isOver,o=i.dragSource,a=r[1];return[s,o,a]},p0=function(t,e){var n=ke(),r=m.useContext(Vt),i=ga({accept:K([Rn.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(c,u){var d=r.dropTargetId,h=r.index;u.isOver({shallow:!0})&&d!==void 0&&h!==void 0&&n.onDrop(ji(c)?c:null,d,h),r.hidePlaceholder()},canDrop:function(c,u){if(u.isOver({shallow:!0})){var d=jr(t,e.current,u,n);return d===null?!1:Ae(c,d.id,n)}return!1},hover:function(c,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,h=r.index,f=r.showPlaceholder,p=r.hidePlaceholder,g=jr(t,e.current,u,n);if(g===null||!Ae(c,g.id,n)){p();return}(g.id!==d||g.index!==h)&&f(g.id,g.index)}},collect:function(c){var u=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:u}}}),s=i[0],o=s.isOver,a=s.dragSource,l=i[1];return[o,a,l]},g0=function(t,e){var n=m.useMemo(function(){return e===!0?t.filter(function(d){return nn(t,d.id)}).map(function(d){return d.id}):Array.isArray(e)?e:[]},[e]),r=m.useState(n),i=r[0],s=r[1];m.useEffect(function(){return s(n)},[n]);var o=function(d,h){var f=i.includes(d)?i.filter(function(p){return p!==d}):K(K([],i,!0),[d],!1);s(f),h&&h(f)},a=function(d){s([]),d&&d([])},l=function(d){var h=t.filter(function(f){return nn(t,f.id)}).map(function(f){return f.id});s(h),d&&d(h)},c=function(d,h){var f=[];if(Array.isArray(d)){var p=t.filter(function(g){return d.includes(g.id)&&nn(t,g.id)});f=K(K([],i,!0),p.map(function(g){return g.id}),!0).filter(function(g,b,y){return y.indexOf(g)===b})}else f=i.includes(d)?i:K(K([],i,!0),[d],!1);s(f),h&&h(f)},u=function(d,h){var f=i.filter(function(p){return Array.isArray(d)?!d.includes(p):p!==d});s(f),h&&h(f)};return[i,{handleToggle:o,handleCloseAll:a,handleOpenAll:l,handleOpen:c,handleClose:u}]},m0=function(){return ff(function(t){var e=t.getItemType();return{item:t.getItem(),clientOffset:t.getClientOffset(),isDragging:t.isDragging()&&e===Rn.TREE_ITEM}})},ke=function(){var t=m.useContext(pc);if(!t)throw new Error("useTreeContext must be used under TreeProvider");return t},v0=function(t,e){var n=ke(),r=n.rootId,i=n.rootProps,s=n.classes,o=s?.container||"";return e&&s?.dropTarget&&(o="".concat(o," ").concat(s.dropTarget)),t===r&&s?.root&&(o="".concat(o," ").concat(s.root)),t===r&&i?.className&&(o="".concat(o," ").concat(i.className)),o=o.trim(),o},y0=function(t,e,n){e.current?n(e):n(t),m.useEffect(function(){e.current?n(e):n(t)},[e.current])},b0=function(t){var e=ke(),n=m.useContext(Vt),r=m.useRef(null),i=m.useRef(null),s=e.tree.find(function(D){return D.id===t.id}),o=e.openIds,a=e.classes,l=e.enableAnimateExpand,c=o.includes(t.id),u=d0(s,r),d=u[0],h=u[1],f=u[2],p=p0(s,r),g=p[0],b=p[1],y=p[2];y0(r,i,h),Ae(b,t.id,e)&&y(r),m.useEffect(function(){e.dragPreviewRender?f(kf(),{captureDraggingState:!0}):i.current&&f(r)},[f,e.dragPreviewRender]),u0(r);var T=m.useCallback(function(){e.onToggle(s.id)},[s.id,e]),x=e.listItemComponent,w=e.canDrag?e.canDrag(t.id):!0,S=n.dropTargetId===t.id,C={depth:t.depth,isOpen:c,isDragging:d,isDropTarget:S,draggable:w,hasChild:nn(e.tree,t.id),containerRef:r,handleRef:i,onToggle:T},R="";return a?.listItem&&(R=typeof a.listItem=="string"?a.listItem:a.listItem(s,C)),g&&a?.dropTarget&&(R="".concat(R," ").concat(a.dropTarget)),d&&a?.draggingSource&&(R="".concat(R," ").concat(a.draggingSource)),V.createElement(x,{ref:r,className:R,role:"listitem"},e.render(s,C),l&&C.hasChild&&V.createElement(Yy,{isVisible:c},V.createElement(Fr,{parentId:t.id,depth:t.depth+1})),!l&&C.hasChild&&c&&V.createElement(Fr,{parentId:t.id,depth:t.depth+1}))},$o=function(t){var e=ke(),n=e.placeholderRender,r=e.placeholderComponent,i=e.classes,s=m.useContext(Vt),o=De(),a=o.getMonitor(),l=a.getItem();if(!n||!l)return null;var c=t.dropTargetId===s.dropTargetId&&(t.index===s.index||t.index===void 0&&t.listCount===s.index),u=a.getTargetIds();return!c||!u.length?null:V.createElement(r,{className:i?.placeholder||""},n(l,{depth:t.depth}))},Fr=function(t){var e=ke(),n=m.useRef(null),r=e.tree.filter(function(g){return g.parent===t.parentId}),i=r,s=typeof e.sort=="function"?e.sort:e0;if(e.insertDroppableFirst){var o=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});e.sort===!1?i=K(K([],o,!0),a,!0):(o=o.sort(s),a=a.sort(s),i=K(K([],o,!0),a,!0))}else e.sort!==!1&&(i=r.sort(s));var l=f0(n),c=l[0],u=l[1],d=l[2];t.parentId===e.rootId&&Ae(u,e.rootId,e)&&d(n);var h=v0(t.parentId,c),f=e.rootProps||{},p=e.listComponent;return V.createElement(p,ue({ref:n,role:"list"},f,{className:h}),i.map(function(g,b){return V.createElement(V.Fragment,{key:g.id},V.createElement($o,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId,index:b}),V.createElement(b0,{id:g.id,depth:t.depth}))}),V.createElement($o,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId}))},T0={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},x0=function(t){var e=t.clientOffset;if(!e)return{};var n=e.x,r=e.y,i="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:i}},S0=function(){var t=ke(),e=m0(),n=e.isDragging,r=e.clientOffset;return!n||!r?null:V.createElement("div",{style:T0},V.createElement("div",{style:x0(e)},t.dragPreviewRender&&t.dragPreviewRender(e)))};function w0(t,e){return V.createElement(c0,ue({},t,{treeRef:e}),t.dragPreviewRender&&V.createElement(S0,null),V.createElement(Fr,{parentId:t.rootId,depth:0}))}var D0=m.forwardRef(w0);function C0(t){return!t||rr(t)?null:encodeURIComponent(JSON.stringify(t))}function E0({filter:t,setFilter:e,closeModal:n}){const[r,i]=m.useState(t.isShowZeroedAccounts??!1),{control:s,handleSubmit:o}=Go({defaultValues:{...t}}),{selectableBusinesses:a,fetching:l}=_c(),{userContext:c}=m.useContext(zc),u=h=>{h.isShowZeroedAccounts=r??!1,h.fromDate?.trim()===""&&(h.fromDate=void 0),h.toDate?.trim()===""&&(h.toDate=void 0),e(h),n()};function d(){e({}),n()}return v.jsxs(v.Fragment,{children:[l?v.jsx("div",{children:"Loading..."}):v.jsx("div",{}),v.jsxs("form",{onSubmit:o(u),className:"flex flex-col gap-2",children:[v.jsx(An,{name:"ownerIds",control:s,defaultValue:void 0,render:({field:h,fieldState:f})=>v.jsx($c,{...h,data:a,value:h.value??(c?.context.adminBusinessId?[c?.context.adminBusinessId]:void 0),disabled:l,label:"Owners",placeholder:"Scroll to see all options",maxDropdownHeight:160,searchable:!0,error:f.error?.message})}),v.jsx(An,{name:"fromDate",control:s,defaultValue:t.fromDate,rules:{pattern:{value:Bi,message:"Date must be im format yyyy-mm-dd"}},render:({field:h,fieldState:f})=>v.jsx(_i,{...h,onChange:p=>{const g=p?typeof p=="string"?p:sn(p,"yyyy-MM-dd"):void 0;g!==h.value&&h.onChange(g)},value:h.value?new Date(h.value):void 0,label:"From Date",error:f.error?.message})}),v.jsx(An,{name:"toDate",control:s,defaultValue:t.toDate,rules:{pattern:{value:Bi,message:"Date must be im format yyyy-mm-dd"}},render:({field:h,fieldState:f})=>v.jsx(_i,{...h,onChange:p=>{const g=p?typeof p=="string"?p:sn(p,"yyyy-MM-dd"):void 0;g!==h.value&&h.onChange(g)},value:h.value?new Date(h.value):void 0,label:"To Date",error:f.error?.message})}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Ko,{checked:r??!1,onCheckedChange:()=>i(h=>!h)}),v.jsx(qo,{htmlFor:"enable-dnd",children:"Show zeroed accounts"})]}),v.jsxs("div",{className:"flex justify-center mt-5 gap-3",children:[v.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",children:"Filter"}),v.jsx("button",{type:"button",className:"text-white bg-orange-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-orange-600 rounded-sm text-lg",onClick:d,children:"Clear"}),v.jsx("button",{type:"button",className:"text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})]})}function O0({filter:t,setFilter:e}){const[n,r]=m.useState(!1),[i,s]=m.useState(!rr(t)),{get:o,set:a}=Wo();function l(u){return Object.entries(u??{}).filter(([h,f])=>f!==void 0&&Array.isArray(f)&&f.length>0).length>0}function c(u){Uc(u,t)||(e(u),s(l(u)))}return m.useEffect(()=>{const u=rr(t)?null:encodeURIComponent(JSON.stringify(t)),d=o(Rt);u!==d&&a(Rt,u)},[t,o,a]),v.jsxs(zr,{open:n,onOpenChange:r,children:[v.jsx($r,{asChild:!0,children:v.jsx(Fc,{inline:!0,size:16,disabled:!i,children:v.jsx(ee,{variant:"outline",onClick:()=>r(!0),className:"p-2",children:v.jsx(Bc,{size:20})})})}),v.jsxs(Ur,{className:"w-100 max-w-screen-md",children:[v.jsx(Hr,{children:v.jsx(Wr,{children:"Conto report filters"})}),v.jsx(E0,{filter:t,setFilter:c,closeModal:()=>r(!1)})]})]})}const P0="deleteDynamicReportTemplate",M0=()=>{const[{fetching:t},e]=Yo(Hc),n=m.useCallback(async r=>{const i=`Error deleting report template "${r.name}"`,s=`${P0}-${r.name}`;Pe.loading("Deleting report template",{id:s});try{const o=await e(r),a=Xo(o,i,s);if(a)return Pe.success("Success",{id:s,description:`Report template "${a.deleteDynamicReportTemplate}" deleted`}),a.deleteDynamicReportTemplate}catch(o){console.error(`${i}: ${o}`),Pe.error("Error",{id:s,description:i,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,deleteDynamicReportTemplate:n}};function R0({closeModal:t,setTemplate:e,template:n}){const[r,i]=m.useState([]),[s,o]=m.useState({}),[a,l]=m.useState([]),[{data:c,fetching:u},d]=ir({query:Wc}),{deleteDynamicReportTemplate:h}=M0(),f=m.useCallback(async y=>{await h({name:y}),d()},[h,d]),p=m.useCallback(y=>{e(y),t()},[e,t]),g=m.useMemo(()=>[{accessorKey:"name",header:({column:T})=>v.jsxs(ee,{variant:"ghost",onClick:()=>T.toggleSorting(T.getIsSorted()==="asc"),children:["Name",v.jsx(Gi,{})]}),cell:({row:T})=>v.jsx("div",{className:"lowercase",children:T.getValue("name")})},{accessorKey:"updated",header:({column:T})=>v.jsxs(ee,{variant:"ghost",onClick:()=>T.toggleSorting(T.getIsSorted()==="asc"),children:["Last Updated",v.jsx(Gi,{})]}),cell:({row:T})=>v.jsx("div",{className:"lowercase",children:sn(T.getValue("updated"),"dd/MM/yyyy HH:mm:ss")})},{id:"actions",cell:({row:T})=>{const{name:x}=T.original;return v.jsxs(Jo,{children:[v.jsx(Qo,{asChild:!0,children:v.jsxs(ee,{variant:"ghost",className:"h-8 w-8 p-0",children:[v.jsx("span",{className:"sr-only",children:"Open menu"}),v.jsx(ta,{})]})}),v.jsxs(ea,{align:"end",children:[v.jsx(tu,{children:"Actions"}),v.jsx(nu,{}),v.jsx(on,{onClick:()=>f(x),children:"Delete"}),v.jsx(on,{onClick:()=>p(x),children:"Select"})]})]})}}],[f,p]),b=Gc({data:c?.allDynamicReports||[],columns:g,onSortingChange:i,getCoreRowModel:Xc(),getPaginationRowModel:Yc(),getSortedRowModel:qc(),onRowSelectionChange:o,onColumnFiltersChange:l,getFilteredRowModel:Kc(),state:{sorting:r,rowSelection:s,columnFilters:a}});return v.jsxs("div",{className:"w-full h-[450px] relative",children:[u&&v.jsx("div",{className:"absolute bg-white/60 z-10 h-full w-full flex items-center justify-center",children:v.jsx("div",{className:"flex items-center",children:v.jsx("span",{className:"text-3xl mr-4",children:v.jsx(Zo,{className:"h-10 w-10 animate-spin mr-2 self-center"})})})}),v.jsx("div",{className:"flex items-center py-4",children:v.jsx(Gr,{placeholder:"Filter templates...",value:b.getColumn("name")?.getFilterValue()??"",onChange:y=>b.getColumn("name")?.setFilterValue(y.target.value),className:"max-w-sm"})}),v.jsx("div",{className:"rounded-md border",children:v.jsxs(Zc,{children:[v.jsx(Jc,{children:b.getHeaderGroups().map(y=>v.jsx(Nn,{children:y.headers.map(T=>v.jsx(Qc,{children:T.isPlaceholder?null:zi(T.column.columnDef.header,T.getContext())},T.id))},y.id))}),v.jsx(eu,{children:b.getRowModel().rows?.length?b.getRowModel().rows.map(y=>v.jsx(Nn,{"data-state":y.original.name===n&&"selected",children:y.getVisibleCells().map(T=>v.jsx($i,{children:zi(T.column.columnDef.cell,T.getContext())},T.id))},y.id)):v.jsx(Nn,{children:v.jsx($i,{colSpan:g.length,className:"h-24 text-center",children:"No results."})})})]})}),v.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[v.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:[b.getFilteredSelectedRowModel().rows.length," of"," ",b.getFilteredRowModel().rows.length," row(s) selected."]}),v.jsxs("div",{className:"space-x-2",children:[v.jsx(ee,{variant:"outline",size:"sm",onClick:()=>b.previousPage(),disabled:!b.getCanPreviousPage(),children:"Previous"}),v.jsx(ee,{variant:"outline",size:"sm",onClick:()=>b.nextPage(),disabled:!b.getCanNextPage(),children:"Next"})]})]})]})}function I0({template:t,setTemplate:e}){const[n,r]=m.useState(!1);return v.jsxs(zr,{open:n,onOpenChange:r,children:[v.jsx($r,{asChild:!0,children:v.jsx(yn,{content:"Manage templates",children:v.jsx(ee,{variant:"outline",onClick:()=>r(!0),className:"p-2",children:v.jsx(Iu,{size:20})})})}),v.jsxs(Ur,{className:"max-w-screen-md",children:[v.jsx(Hr,{children:v.jsx(Wr,{children:"Conto report templates"})}),v.jsx(R0,{closeModal:()=>r(!1),template:t,setTemplate:e})]})]})}const A0="insertDynamicReportTemplate",N0=()=>{const[{fetching:t},e]=Yo(ru),n=m.useCallback(async r=>{const i=`Error inserting report template "${r.name}"`,s=`${A0}-${r.name}`;Pe.loading("Saving report template",{id:s});try{const o=await e(r),a=Xo(o,i,s);if(a)return Pe.success("Success",{id:s,description:`Report template "${a.insertDynamicReportTemplate.name}" saved`}),a.insertDynamicReportTemplate}catch(o){console.error(`${i}: ${o}`),Pe.error("Error",{id:s,description:i,duration:1e5,closeButton:!0})}},[e]);return{fetching:t,insertDynamicReportTemplate:n}},k0=su({name:Ui().min(5,{message:"Name must be at least 5 characters long"}),template:Ui()});function L0({tree:t,setFetching:e,closeModal:n}){const r=m.useMemo(()=>{const l=t.filter(u=>u.data?.sortCode==null&&u.data?.value==null);return JSON.stringify(l.map(u=>({id:u.id,parent:u.parent,text:u.text,droppable:u.droppable??void 0,data:u.data?{hebrewText:u.data.hebrewText??void 0,value:u.data.value,sortCode:u.data.sortCode,isOpen:u.data.isOpen,descendantSortCodes:u.data.descendantSortCodes,descendantFinancialEntities:u.data.descendantFinancialEntities,mergedSortCodes:u.data.mergedSortCodes}:void 0})))},[t]),i=Go({resolver:iu(k0),defaultValues:{name:`template-${sn(new Date,"yyyy-MM-dd")}`,template:r}}),{insertDynamicReportTemplate:s,fetching:o}=N0(),a=m.useCallback(async l=>{try{await s({...l,template:r}),n()}catch(c){console.error(c),i.setError("root",{message:"Failed to save template"})}},[n,i,s,r]);return m.useEffect(()=>{e(o)},[o,e]),v.jsx(ou,{...i,children:v.jsxs("form",{onSubmit:i.handleSubmit(a),className:"flex flex-col gap-2",children:[v.jsx(au,{control:i.control,name:"name",render:({field:l})=>v.jsxs(lu,{children:[v.jsx(cu,{children:"Template Name"}),v.jsx(uu,{children:v.jsx(Gr,{...l,required:!0})}),v.jsx(du,{})]})}),v.jsxs(hu,{children:[v.jsx(ee,{disabled:o,type:"submit",children:"Save"}),v.jsx(ee,{disabled:o,variant:"outline",onClick:n,children:"Cancel"})]})]})})}function V0({tree:t}){const[e,n]=m.useState(!1),[r,i]=m.useState(!1);return v.jsxs(zr,{open:e,onOpenChange:n,children:[v.jsx($r,{asChild:!0,children:v.jsx(yn,{content:"Save template",children:v.jsx(ee,{variant:"outline",disabled:r,onClick:()=>n(!0),className:"p-2",children:v.jsx(Nu,{size:20})})})}),v.jsxs(Ur,{className:"w-100 max-w-screen-md",children:[v.jsx(Hr,{children:v.jsx(Wr,{children:"Save Conto report template"})}),v.jsx(L0,{tree:t,setFetching:i,closeModal:()=>n(!1)})]})]})}const j0=({tree:t,filters:e})=>{const n=m.useCallback(async()=>{const r=F0(e.fromDate,e.toDate),i=B0(t),s="conto_report"+r;return{fileContent:i,fileName:s}},[e.fromDate,e.toDate,t]);return t.length?v.jsx(fu,{createFileVariables:n}):v.jsx("div",{})};function F0(t,e){return t&&e?`_${t}_to_${e}`:t?`_since_${t}`:e?`_until_${e}`:""}const B0=t=>{const e=t.filter(s=>s.parent===_r);if(!e.length)return"No Report Data";const n=[{content:"Account",depth:0,amount:"ILS Amount",suffix:"",type:"CATEGORY"}],{rows:r,maxDepth:i}=vc(e,t,0);return n.push(...r),n.map(s=>{const{depth:o}=s;let a=o,l=i-o;switch(s.type){case"SORT_CODE":a=i-1,l=1;break;case"FINANCIAL_ENTITY":a=i,l=0;break}return`${",".repeat(a)}${nr(s.content)},${nr(s.suffix??"")}${",".repeat(l)},${nr(s.amount)}`}).join(`\r
137
+ `)};function vc(t,e,n){if(t.length===0)return{rows:[],maxDepth:n,sum:0};let r=n;const i=[];let s=0;return t.map(o=>{if(o.data?.value!=null){s+=o.data.value;const d={content:o.text,depth:n,amount:o.data.value,suffix:"",type:"FINANCIAL_ENTITY"};i.push(d);return}const a=mn(e,o.id),l=a.filter(d=>d.parent===o.id),c={content:o.text,suffix:o.data?.sortCode??"",depth:n,amount:a.reduce((d,h)=>d+(h.data?.value??0),0),type:o.data?.sortCode?"SORT_CODE":"CATEGORY"};i.push(c);const u=vc(l,e,n+1);i.push(...u.rows),u.maxDepth>r&&(r=u.maxDepth)}),{rows:i,maxDepth:r,sum:s}}function nr(t){return t===""?"":Number.isNaN(Number(t))?t.replace(/"/g,'""').replace(/,/g,"."):Number(t).toFixed(2)}const Br=t=>t.droppable?t.open?v.jsx(Vu,{size:30}):v.jsx(_u,{size:30}):v.jsx(pu,{}),_0=t=>{const{item:e}=t.monitorProps;return v.jsxs("div",{className:"items-center bg-zinc-600 rounded shadow-[0_12px_24px_-6px_rgba(0,0,0,0.25),0_0_0_1px_rgba(0,0,0,0.08)] text-white text-sm inline-grid grid-cols-[auto_auto] gap-2 py-1 px-2 pointer-events-none",children:[v.jsx("div",{className:"items-center flex",children:v.jsx(Br,{droppable:e.droppable||!1})}),v.jsx("div",{className:"items-center flex",children:e.text})]})},z0=vu(wu.Ils,{trailingZeroDisplay:"stripIfInteger"}),$0=t=>{const{id:e,text:n,droppable:r}=t.node,[i,s]=m.useState(!1),[o,a]=m.useState(n),[l,c]=m.useState(!0),u=t.depth*24,d=T=>{T.stopPropagation(),t.onToggle(t.node.id)},h=()=>{s(!0)},f=()=>{a(n),s(!1)},p=T=>{a(T.target.value)},g=()=>{s(!1),t.onTextChange(e,o)},b=h0(e,t.isOpen,t.onToggle),y=r&&!t.node.data?.sortCode;return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"items-center grid grid-cols-[auto_auto_1fr_auto] h-10 pe-2",style:{paddingInlineStart:u},...b,children:[t.node.droppable?v.jsxs("button",{className:"cursor-pointer",onClick:d,children:[v.jsx(Br,{droppable:r||!1,open:t.isOpen}),!t.isOpen&&v.jsx("div",{className:"relative -top-5 font-bold text-xs",children:t.descendants.filter(T=>!T.droppable).length})]}):v.jsx(Br,{droppable:r||!1,open:t.isOpen}),v.jsx("div",{className:"ps-2",children:i&&y?v.jsxs("div",{className:"items-center grid grid-cols-[repeat(3,auto)] justify-start ",children:[v.jsx(Gr,{className:"text-sm py-2 w-48",value:o,onChange:p}),v.jsx(Ji,{className:"p-1",onClick:g,disabled:o==="",children:v.jsx(gu,{className:"text-xl"})}),v.jsx(Ji,{className:"p-1",onClick:f,children:v.jsx(mu,{className:"text-xl"})})]}):v.jsxs("div",{className:"items-center grid grid-cols-[repeat(4,auto)] justify-start",children:[v.jsx(or,{variant:"body2",className:"pr-2",children:t.node.text}),t.node.data?.sortCode&&v.jsxs(Hi,{variant:"outline",children:["Sort Code ",t.node.data?.sortCode]}),v.jsx(Hi,{children:z0.format(t.node.data?.value==null?t.descendants.filter(T=>!T.droppable).reduce((T,x)=>T+(x.data?.value??0),0):t.node.data.value)}),y&&v.jsxs(Jo,{children:[v.jsx(Qo,{asChild:!0,children:v.jsx(ee,{variant:"ghost",size:"sm",className:"p-1",children:v.jsx(ta,{size:20})})}),v.jsx(ea,{className:"w-56",children:v.jsxs(yu,{children:[v.jsxs(on,{onClick:h,children:["Edit Category",v.jsx(Wi,{children:v.jsx(Mu,{size:15})})]}),y&&v.jsxs(on,{onClick:()=>t.onDeleteCategory(e),children:["Delete Category",v.jsx(Wi,{children:v.jsx(bu,{size:15,color:"red"})})]})]})})]}),!r&&v.jsx("div",{className:"pl-2",children:v.jsx(yn,{content:"Expand records",children:v.jsx(ee,{variant:"outline",size:"icon",className:"size-7.5",onClick:()=>c(T=>!T),children:l?v.jsx(Tu,{className:"size-5"}):v.jsx(xu,{className:"size-5"})})})})]})})]}),!r&&l&&v.jsx("div",{children:v.jsx(Su,{businessID:t.node.id,filter:t.filter})})]})},U0=t=>{const e=t.depth*24;return v.jsx("div",{className:"bg-[#1967d2] h-0.5 absolute -translate-y-2/4 right-0 top-0",style:{left:e}})},Uo=({tree:t,onDrop:e,rootId:n,handleIsOpenChange:r,handleTextChange:i,handleDeleteCategory:s,filter:o,enableDnd:a})=>v.jsx(D0,{tree:t,onDrop:e,rootId:n,classes:{root:"box-border h-full p-4",draggingSource:"opacity-30",placeholder:"relative"},render:m.useCallback((l,{depth:c,isOpen:u,onToggle:d})=>v.jsx($0,{node:l,depth:c,isOpen:u,onToggle:()=>{d(),r(l.id,!u)},onTextChange:i,onDeleteCategory:s,descendants:mn(t,l.id),filter:o}),[t,i,s,r,o]),dragPreviewRender:m.useCallback(l=>v.jsx(_0,{monitorProps:l}),[]),sort:!1,insertDroppableFirst:!1,canDrag:()=>a,canDrop:(l,{dragSource:c,dropTargetId:u})=>{if(!a)return!1;if(c?.parent===u)return!0},dropTargetOffset:10,placeholderRender:(l,{depth:c})=>v.jsx(U0,{node:l,depth:c}),initialOpen:t.filter(l=>l.data?.isOpen).map(l=>l.id)}),Qe="bank",_r="report",Rt="contoReportFilters";function eb(t){const e=new URLSearchParams,n=C0(t);return n&&e.append(Rt,n),`/reports/conto${e.size>0?`?${e}`:""}`}function H0(t){const e=new Map,n=new Map;return t.map(({data:r,id:i})=>{r?.descendantSortCodes?.length&&r.descendantSortCodes.map(s=>e.set(s,i)),r?.descendantFinancialEntities?.length&&r.descendantFinancialEntities.map(s=>n.set(s,i))}),{sortCodeMap:e,financialEntitiesMap:n}}function W0(t,e,n){const r=[...t];return e.map(i=>{if(r.find(o=>o.id===i.id))return;const s=n.get(i.key)??void 0;r.push({id:i.id,parent:s??Qe,droppable:!0,text:i.name,data:{sortCode:i.key,isOpen:!1}})}),r}function G0(t,e,n,r){const i=[...t];return e.map(s=>{const o=s.total.raw*-1;if(!r&&Math.abs(o)<.005)return;const a=i.find(c=>c.id===s.business.id);if(a){a.data?.value!==o&&(a.data={...a.data,isOpen:!1,value:o});return}let l=n.get(s.business.id);l||(i.find(c=>c.id===s.business.sortCode?.id)?l=s.business.sortCode.id:l=Qe),i.push({id:s.business.id,parent:l,droppable:!1,text:s.business.name,data:{value:o,isOpen:!1}})}),i}function K0(t){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");t||=Math.floor(Math.random()*e.length);let n="";for(let r=0;r<t;r++)n+=e[Math.floor(Math.random()*e.length)];return n}const tb=()=>{const{setFiltersContext:t}=m.useContext(Du),[e,n]=m.useState([]),[r,i]=m.useState(!1),[s,o]=m.useState(void 0),{get:a}=Wo(),[l,c]=m.useState(a(Rt)?JSON.parse(decodeURIComponent(a(Rt))):{}),[{data:u,fetching:d,error:h}]=ir({query:Eu,variables:{filters:{fromDate:l?.fromDate,toDate:l?.toDate,ownerIds:l?.ownerIds}}}),{sortCodes:f,fetching:p}=Cu(),[{data:g,fetching:b,error:y},T]=ir({query:Ou,variables:{name:s??""},pause:!0}),x=m.useCallback((L,{dragSourceId:I,dropTargetId:U,dragSource:Z})=>{const F=new Set(L.map(k=>k.id)),W=Z?.parent,B=Z?.data?.sortCode!=null,fe=Z?.data?.value!=null;n([...L,...e.filter(k=>!F.has(k.id))].map(k=>{if(k.id===I)return{...k,parent:U};if(B||fe){if(k.id===U)return{...k,data:{isOpen:!0,...k.data,descendantFinancialEntities:fe?[...k.data?.descendantFinancialEntities??[],I]:k.data?.descendantFinancialEntities,descendantSortCodes:B?[...k.data?.descendantSortCodes??[],I]:k.data?.descendantSortCodes}};if(k.id===W)return{...k,data:{isOpen:!0,...k.data,descendantFinancialEntities:fe&&k.data?.descendantFinancialEntities?.length?k.data.descendantFinancialEntities.filter(Ce=>Ce!==I):k.data?.descendantFinancialEntities,descendantSortCodes:fe&&k.data?.descendantSortCodes?.length?k.data.descendantSortCodes.filter(Ce=>Ce!==I):k.data?.descendantSortCodes}}}return k}))},[n,e]),w=m.useCallback(L=>{n(e.filter(I=>I.id!==L).map(I=>I.parent===L?{...I,parent:Qe}:I))},[n,e]),S=m.useCallback(()=>{const L={id:`synthetic-${K0(8)}`,parent:Qe,droppable:!0,text:"New Category",data:{isOpen:!1}};n([...e,L])},[n,e]),C=(L,I)=>{n(e.map(U=>U.id===L?{...U,text:I}:U))},R=(L,I)=>{n(e.map(U=>U.id===L?{...U,data:{...U.data,isOpen:I}}:U))};m.useEffect(()=>{s&&s!==""&&T()},[s,T]),m.useEffect(()=>{const L=()=>{i(I=>!I)};t(v.jsxs("div",{className:"flex flex-row gap-2",children:[v.jsx(j0,{tree:e,filters:l}),v.jsx(I0,{template:s,setTemplate:o}),v.jsx(V0,{tree:e}),v.jsx(yn,{content:"Add new category",children:v.jsx(ee,{variant:"outline",onClick:S,className:"gap-2 p-2",children:v.jsx(Fu,{size:20})})}),v.jsx(O0,{filter:l,setFilter:c}),v.jsxs("div",{className:"flex items-center space-x-2",children:[v.jsx(Ko,{id:"enable-dnd",checked:r,onCheckedChange:L}),v.jsxs(qo,{htmlFor:"enable-dnd",children:["Form is ",r?"editable":"locked"]})]})]}))},[t,r,l,c,S,e,s]);const D=m.useMemo(()=>u&&u?.businessTransactionsSumFromLedgerRecords.__typename!=="CommonError"?u.businessTransactionsSumFromLedgerRecords.businessTransactionsSum:[],[u]),N=m.useCallback(()=>{n(L=>{const{sortCodeMap:I,financialEntitiesMap:U}=H0(L),Z=W0(L,f,I);return G0(Z,D,U,l.isShowZeroedAccounts)})},[f,D,l.isShowZeroedAccounts,n]);m.useEffect(()=>{if(!b&&g){const L=g.dynamicReport.template.map(I=>({...I,data:{...I.data,hebrewText:I.data.hebrewText??void 0}}));n(L),N()}},[g,b,N]),m.useEffect(()=>{N()},[f,D,l.isShowZeroedAccounts,N]),m.useEffect(()=>{h&&(console.error(h),Pe.error("Error",{description:"Unable to fetch businesses summary"}))},[h]),m.useEffect(()=>{y&&(console.error(y),Pe.error("Error",{description:"Unable to fetch template"}))},[y]);const A=mn(e,_r),H=mn(e,Qe),q=m.useMemo(()=>!f&&p||!u&&d,[f,p,u,d]);return v.jsx(zh,{backend:Vy,options:a0(),children:v.jsxs("div",{className:"h-full grid grid-cols-[auto_1fr] relative",children:[q&&v.jsx("div",{className:"absolute bg-white/60 z-10 h-full w-full flex items-center justify-center",children:v.jsx("div",{className:"flex items-center",children:v.jsx("span",{className:"text-3xl mr-4",children:v.jsx(Zo,{className:"h-10 w-10 animate-spin mr-2 self-center"})})})}),v.jsxs("div",{className:"border-r border-solid corder-color-zinc-100 relative",children:[v.jsx(or,{variant:"h5",className:"px-4",children:"Bank"}),v.jsx(Uo,{rootId:Qe,tree:H,onDrop:x,handleTextChange:C,handleDeleteCategory:w,handleIsOpenChange:R,enableDnd:r,filter:l})]}),v.jsxs("div",{children:[v.jsx(or,{variant:"h5",className:"px-4",children:"Report"}),v.jsx(Uo,{rootId:_r,tree:A,onDrop:x,handleTextChange:C,handleDeleteCategory:w,handleIsOpenChange:R,enableDnd:r,filter:l})]})]})})};export{Rt as CONTO_REPORT_FILTERS_KEY,tb as ContoReport,_r as REPORT_TREE_ROOT_ID,eb as getContoReportHref};