@galacean/cli 2.0.0-alpha.12 → 2.0.0-alpha.14

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 (160) hide show
  1. package/dist/cli.bundle.cjs +134 -135
  2. package/dist/viewport-client/_static/Accordion-3d330bc6.js +1 -0
  3. package/dist/viewport-client/_static/{AmbientLightAsset-f70b95f1.js → AmbientLightAsset-bdbc4e1d.js} +2 -2
  4. package/dist/viewport-client/_static/AnimationClipAsset-9167378a.js +1 -0
  5. package/dist/viewport-client/_static/AnimatorControllerAsset-21dc6332.js +1 -0
  6. package/dist/viewport-client/_static/AnimatorStore-18d3c551.js +1 -0
  7. package/dist/viewport-client/_static/{AssetViewer-bc198e16.js → AssetViewer-64cd01fa.js} +1 -1
  8. package/dist/viewport-client/_static/AudioAsset-0c828c80.js +1 -0
  9. package/dist/viewport-client/_static/AudioComponent-fbff3825.js +1 -0
  10. package/dist/viewport-client/_static/{Callout-cb4a55ff.js → Callout-ba7e2adf.js} +1 -1
  11. package/dist/viewport-client/_static/CameraComponent-74975570.js +1 -0
  12. package/dist/viewport-client/_static/{Component-f923abb1.js → Component-ed7aa0ab.js} +1 -1
  13. package/dist/viewport-client/_static/DirectLight-b884e7db.js +1 -0
  14. package/dist/viewport-client/_static/FontAsset-d1ced18d.js +5 -0
  15. package/dist/viewport-client/_static/FormItemArray-6d69acd4.js +6 -0
  16. package/dist/viewport-client/_static/{GlTFAsset-9c68f862.js → GlTFAsset-2723b84a.js} +9 -9
  17. package/dist/viewport-client/_static/IconEdit-ab77303f.js +6 -0
  18. package/dist/viewport-client/_static/{IconPointFilled-a304fd34.js → IconPointFilled-811fc660.js} +1 -1
  19. package/dist/viewport-client/_static/LightBaseComponent-12dc27d1.js +1 -0
  20. package/dist/viewport-client/_static/LottieAnimationComponent-c48c5eb5.js +1 -0
  21. package/dist/viewport-client/_static/LottieAsset-3692580d.js +6 -0
  22. package/dist/viewport-client/_static/MarkdownAsset-bcb90be4.js +1 -0
  23. package/dist/viewport-client/_static/MaterialAsset-6ef9b4ed.js +1 -0
  24. package/dist/viewport-client/_static/MaterialInspector-e8242674.js +1 -0
  25. package/dist/viewport-client/_static/Menu-0b8da92f.js +17 -0
  26. package/dist/viewport-client/_static/MeshAsset-ca9305e5.js +1 -0
  27. package/dist/viewport-client/_static/MeshRendererBaseComponent-9efd3943.js +1 -0
  28. package/dist/viewport-client/_static/MeshRendererComponent-c9a03641.js +1 -0
  29. package/dist/viewport-client/_static/{MeshThumbnail-49273f71.js → MeshThumbnail-ab28b3b8.js} +1 -1
  30. package/dist/viewport-client/_static/ParticleRendererComponent-96947c1d.js +26 -0
  31. package/dist/viewport-client/_static/PhysicsMaterialAsset-4a1e5ea3.js +1 -0
  32. package/dist/viewport-client/_static/PhysicsStore-33cac578.js +1 -0
  33. package/dist/viewport-client/_static/PointLight-fd514526.js +1 -0
  34. package/dist/viewport-client/_static/PostProcessComponent-d0ea27a4.js +6 -0
  35. package/dist/viewport-client/_static/PrefabAsset-9179b95c.js +1 -0
  36. package/dist/viewport-client/_static/PrimitiveMesh-0572a073.js +1 -0
  37. package/dist/viewport-client/_static/ProxyConfigs-3a5fd860.js +1 -0
  38. package/dist/viewport-client/_static/{ReferencedMaterial-a87818f3.js → ReferencedMaterial-5773c9d2.js} +1 -1
  39. package/dist/viewport-client/_static/RenderTargetAsset-ab6e06d2.js +1 -0
  40. package/dist/viewport-client/_static/SceneAsset-385fa837.js +1 -0
  41. package/dist/viewport-client/_static/{ShaderAsset-cb3ff628.js → ShaderAsset-f4514b03.js} +6 -6
  42. package/dist/viewport-client/_static/ShaderChunkAsset-34116f2c.js +5 -0
  43. package/dist/viewport-client/_static/{ShaderUIScriptAsset-d13fa4e2.js → ShaderUIScriptAsset-fc503291.js} +5 -5
  44. package/dist/viewport-client/_static/SkinnedMeshRendererComponent-494ad439.js +1 -0
  45. package/dist/viewport-client/_static/SpineAnimationComponent-3918d7b5.js +1 -0
  46. package/dist/viewport-client/_static/SpineSkeletonDataAsset-27244892.js +1 -0
  47. package/dist/viewport-client/_static/SpotLight-f9972dc0.js +1 -0
  48. package/dist/viewport-client/_static/SpriteAsset-558ffca8.js +6 -0
  49. package/dist/viewport-client/_static/SpriteAtlasAsset-cdc34386.js +1 -0
  50. package/dist/viewport-client/_static/SpriteBaseComponent-3edafa31.js +1 -0
  51. package/dist/viewport-client/_static/SpriteMaskComponent-de2e5231.js +1 -0
  52. package/dist/viewport-client/_static/SpriteRendererComponent-e999e735.js +1 -0
  53. package/dist/viewport-client/_static/{TextBaseComponent-69233798.js → TextBaseComponent-ce1402c3.js} +2 -2
  54. package/dist/viewport-client/_static/TextRendererComponent-f7c0deae.js +1 -0
  55. package/dist/viewport-client/_static/TextureAsset-39fb07fe.js +36 -0
  56. package/dist/viewport-client/_static/Tooltip-82063435.js +1 -0
  57. package/dist/viewport-client/_static/TrailRendererComponent-37f5c981.js +1 -0
  58. package/dist/viewport-client/_static/TransformBaseComponent-713d57e9.js +1 -0
  59. package/dist/viewport-client/_static/TransformComponent-40a57948.js +1 -0
  60. package/dist/viewport-client/_static/XRReferenceImageAsset-2f6ff226.js +1 -0
  61. package/dist/viewport-client/_static/audio-7120ec91.js +1 -0
  62. package/dist/viewport-client/_static/glTFIO-79bbca27.js +1 -0
  63. package/dist/viewport-client/_static/index-483b5738.js +1 -0
  64. package/dist/viewport-client/_static/{index-98982ce2.js → index-74130ff3.js} +1 -1
  65. package/dist/viewport-client/_static/index-78269e76.js +1 -0
  66. package/dist/viewport-client/_static/index-7834b582.js +1 -0
  67. package/dist/viewport-client/_static/{index-237c84cd.js → index-7917f782.js} +3 -3
  68. package/dist/viewport-client/_static/index-7acd49d2.js +1 -0
  69. package/dist/viewport-client/_static/index-9d3917da.js +1 -0
  70. package/dist/viewport-client/_static/index-a9b2675e.js +1 -0
  71. package/dist/viewport-client/_static/index-aec7e708.js +11487 -0
  72. package/dist/viewport-client/_static/index-b5582401.js +1 -0
  73. package/dist/viewport-client/_static/{index-e46ec5b1.js → index-bfe6f30e.js} +7 -7
  74. package/dist/viewport-client/_static/index-c63c9606.js +2 -0
  75. package/dist/viewport-client/_static/index-cd1fee9d.js +1 -0
  76. package/dist/viewport-client/_static/index-e73ceaed.js +1 -0
  77. package/dist/viewport-client/_static/index-e8a45e82.js +1 -0
  78. package/dist/viewport-client/_static/index-f2cb64af.js +1 -0
  79. package/dist/viewport-client/_static/index-fbe040bf.js +31 -0
  80. package/dist/viewport-client/_static/ktx2-encoder-53b21bdc.js +1 -0
  81. package/dist/viewport-client/_static/{module-5c85b07e.js → module-220b3921.js} +1 -1
  82. package/dist/viewport-client/_static/{module-6406b050.js → module-8816772d.js} +1 -1
  83. package/dist/viewport-client/_static/{module-107b7430.js → module-ffeaf99f.js} +1 -1
  84. package/dist/viewport-client/_static/postmen-2f47f6bb.js +1 -0
  85. package/dist/viewport-client/index.html +2 -2
  86. package/package.json +1 -1
  87. package/dist/viewport-client/_static/Accordion-4897319b.js +0 -6
  88. package/dist/viewport-client/_static/AnimationClipAsset-01f3deb6.js +0 -1
  89. package/dist/viewport-client/_static/AnimatorControllerAsset-b7424e9c.js +0 -1
  90. package/dist/viewport-client/_static/AnimatorStore-fd98c00e.js +0 -1
  91. package/dist/viewport-client/_static/AssetPreviewer-24e31d97.js +0 -6
  92. package/dist/viewport-client/_static/AudioAsset-eae03324.js +0 -1
  93. package/dist/viewport-client/_static/AudioComponent-44070c2c.js +0 -1
  94. package/dist/viewport-client/_static/CameraComponent-907ac745.js +0 -1
  95. package/dist/viewport-client/_static/CanvasRenderer-9dd98cb3.js +0 -1
  96. package/dist/viewport-client/_static/DirectLight-58f5fe9e.js +0 -1
  97. package/dist/viewport-client/_static/FontAsset-abfb9a8a.js +0 -5
  98. package/dist/viewport-client/_static/FormItemArray-66be8701.js +0 -1
  99. package/dist/viewport-client/_static/IconPlayerPlayFilled-b058c98f.js +0 -6
  100. package/dist/viewport-client/_static/InstanceEditorAsset-a70e73fe.js +0 -1
  101. package/dist/viewport-client/_static/LightBaseComponent-fbc3ae49.js +0 -1
  102. package/dist/viewport-client/_static/LottieAnimationComponent-1c3e02a5.js +0 -1
  103. package/dist/viewport-client/_static/LottieAsset-377c1419.js +0 -1
  104. package/dist/viewport-client/_static/MarkdownAsset-7ea387a9.js +0 -1
  105. package/dist/viewport-client/_static/MaterialAsset-74a15124.js +0 -1
  106. package/dist/viewport-client/_static/MaterialInspector-aec1248b.js +0 -1
  107. package/dist/viewport-client/_static/Menu-cd3be298.js +0 -17
  108. package/dist/viewport-client/_static/MeshAsset-73e2cc8e.js +0 -1
  109. package/dist/viewport-client/_static/MeshRendererBaseComponent-3a0e09ed.js +0 -1
  110. package/dist/viewport-client/_static/MeshRendererComponent-5385d30f.js +0 -1
  111. package/dist/viewport-client/_static/ParticleRendererComponent-5a7b57d9.js +0 -21
  112. package/dist/viewport-client/_static/PhysicsMaterialAsset-a5ac9f82.js +0 -1
  113. package/dist/viewport-client/_static/PhysicsStore-0729e76d.js +0 -1
  114. package/dist/viewport-client/_static/PointLight-0e1d1546.js +0 -1
  115. package/dist/viewport-client/_static/PostProcessComponent-8276d33c.js +0 -1
  116. package/dist/viewport-client/_static/PrefabAsset-1a7edfbd.js +0 -1
  117. package/dist/viewport-client/_static/PrimitiveMesh-3ce6fa2f.js +0 -1
  118. package/dist/viewport-client/_static/ProxyConfigs-4de3304c.js +0 -1
  119. package/dist/viewport-client/_static/RenderTargetAsset-33c0d9e7.js +0 -1
  120. package/dist/viewport-client/_static/SceneAsset-8917c210.js +0 -1
  121. package/dist/viewport-client/_static/ShaderChunkAsset-83f923f4.js +0 -5
  122. package/dist/viewport-client/_static/SkinnedMeshRendererComponent-2a8323bf.js +0 -1
  123. package/dist/viewport-client/_static/SpineAnimationComponent-e733d50f.js +0 -1
  124. package/dist/viewport-client/_static/SpineSkeletonDataAsset-b64a3ee3.js +0 -1
  125. package/dist/viewport-client/_static/SpotLight-ca6c0c3b.js +0 -1
  126. package/dist/viewport-client/_static/SpriteAsset-9a31ec24.js +0 -1
  127. package/dist/viewport-client/_static/SpriteAtlasAsset-a862db46.js +0 -1
  128. package/dist/viewport-client/_static/SpriteBaseComponent-f6f1731f.js +0 -1
  129. package/dist/viewport-client/_static/SpriteMaskComponent-778be04f.js +0 -1
  130. package/dist/viewport-client/_static/SpriteRendererComponent-2b4d153b.js +0 -1
  131. package/dist/viewport-client/_static/TextRendererComponent-130b4e99.js +0 -1
  132. package/dist/viewport-client/_static/TextureAsset-28fedf2a.js +0 -36
  133. package/dist/viewport-client/_static/ThumbnailMixin-35997457.js +0 -1
  134. package/dist/viewport-client/_static/ThumbnailRegistry-495c18c9.js +0 -1
  135. package/dist/viewport-client/_static/Tooltip-33f770ba.js +0 -1
  136. package/dist/viewport-client/_static/TrailRendererComponent-148550b5.js +0 -1
  137. package/dist/viewport-client/_static/TransformBaseComponent-02318c5a.js +0 -1
  138. package/dist/viewport-client/_static/TransformComponent-96106065.js +0 -1
  139. package/dist/viewport-client/_static/ViewerManager-202b570a.js +0 -1
  140. package/dist/viewport-client/_static/XRReferenceImageAsset-6a6adb3b.js +0 -1
  141. package/dist/viewport-client/_static/audio-244358e2.js +0 -1
  142. package/dist/viewport-client/_static/glTFIO-45ff9a17.js +0 -1
  143. package/dist/viewport-client/_static/index-0a8702e2.js +0 -11217
  144. package/dist/viewport-client/_static/index-37c74ae9.js +0 -26
  145. package/dist/viewport-client/_static/index-4cca0201.js +0 -1
  146. package/dist/viewport-client/_static/index-59732f86.js +0 -1
  147. package/dist/viewport-client/_static/index-6c8198f6.js +0 -2
  148. package/dist/viewport-client/_static/index-6f827618.js +0 -1
  149. package/dist/viewport-client/_static/index-803ca489.js +0 -1
  150. package/dist/viewport-client/_static/index-85a6cf6a.js +0 -1
  151. package/dist/viewport-client/_static/index-b3d51f87.js +0 -1
  152. package/dist/viewport-client/_static/index-be6bc38a.js +0 -177
  153. package/dist/viewport-client/_static/index-c403cbcd.js +0 -1
  154. package/dist/viewport-client/_static/index-e73966ae.js +0 -1
  155. package/dist/viewport-client/_static/index-e95b4498.js +0 -1
  156. package/dist/viewport-client/_static/index-f5a67a46.js +0 -1
  157. package/dist/viewport-client/_static/ktx-parse.modern-6c9f771f.js +0 -1
  158. package/dist/viewport-client/_static/ktx2-encoder-1e63c1eb.js +0 -1
  159. package/dist/viewport-client/_static/postmen-45d4c238.js +0 -1
  160. package/dist/viewport-client/_static/utilities-e09052e3.js +0 -11
@@ -1,17 +0,0 @@
1
- import{aC as Or,aD as i,aH as T,aJ as a,e9 as dt,e3 as Nc,bx as pe,g6 as $c,g7 as Oc,g8 as Dc,g9 as jc,ga as Lc,gb as kc,gc as Fc,gd as Uc,ge as Gc,gf as Kc,dS as k,dU as me,bJ as Ne,bH as $e,bM as ee,eb as ln,ec as Dr,ed as Bc,ee as Wc,ea as Vc,ef as Hc,bI as U,dR as jr,bL as F,bK as y,dT as xt,dV as Lr,dW as Mt,gg as kr,gh as Fr,gi as Ur,gj as Q,gk as Gr,gl as Kr,gm as Br,gn as Wr,go as Vr,gp as Hr,bE as dn,bF as fn,dX as wt,gq as Oe,dY as Yr,dZ as ge,gr as pn,d_ as Xr,gs as mn,d$ as zr,e0 as St,gt as Yc,gu as $t,gv as Ot,gw as Dt,gx as Re,gy as nr,gz as jt,gA as Lt,gB as kt,gC as Ft,gD as Ut,gE as rr,bR as Xc,gF as zc}from"./index-0a8702e2.js";/**
2
- * @license @tabler/icons-react v3.24.0 - MIT
3
- *
4
- * This source code is licensed under the MIT license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */var Zc=Or("outline","hand-finger","IconHandFinger",[["path",{d:"M8 13v-8.5a1.5 1.5 0 0 1 3 0v7.5",key:"svg-0"}],["path",{d:"M11 11.5v-2a1.5 1.5 0 1 1 3 0v2.5",key:"svg-1"}],["path",{d:"M14 10.5a1.5 1.5 0 0 1 3 0v1.5",key:"svg-2"}],["path",{d:"M17 11.5a1.5 1.5 0 0 1 3 0v4.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47",key:"svg-3"}]]);/**
7
- * @license @tabler/icons-react v3.24.0 - MIT
8
- *
9
- * This source code is licensed under the MIT license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */var qc=Or("outline","hand-two-fingers","IconHandTwoFingers",[["path",{d:"M8 13v-8.5a1.5 1.5 0 0 1 3 0v7.5",key:"svg-0"}],["path",{d:"M17 11.5a1.5 1.5 0 0 1 3 0v4.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47",key:"svg-1"}],["path",{d:"M14 10.5a1.5 1.5 0 0 1 3 0v1.5",key:"svg-2"}],["path",{d:"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5",key:"svg-3"}]]);const Jc=e=>i.jsxs("svg",{width:"14px",height:"14px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[i.jsx("path",{d:"M6 7C6 5.93913 6.42143 4.92172 7.17157 4.17157C7.92172 3.42143 8.93913 3 10 3H14C15.0609 3 16.0783 3.42143 16.8284 4.17157C17.5786 4.92172 18 5.93913 18 7M6 7V17C6 18.0609 6.42143 19.0783 7.17157 19.8284C7.92172 20.5786 8.93913 21 10 21H14C15.0609 21 16.0783 20.5786 16.8284 19.8284C17.5786 19.0783 18 18.0609 18 17V7M6 7V9H18V7"}),i.jsx("path",{d:"M7.17157 4.17157C6.42143 4.92172 6 5.93913 6 7V9H18V7C18 5.93913 17.5786 4.92172 16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H10C8.93913 3 7.92172 3.42143 7.17157 4.17157Z"})]}),Qc=e=>i.jsxs("svg",{width:"14px",height:"14px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[i.jsx("path",{d:"M6 7C6 5.93913 6.42143 4.92172 7.17157 4.17157C7.92172 3.42143 8.93913 3 10 3H11M6 7V17C6 18.0609 6.42143 19.0783 7.17157 19.8284C7.92172 20.5786 8.93913 21 10 21H14C15.0609 21 16.0783 20.5786 16.8284 19.8284C17.5786 19.0783 18 18.0609 18 17V7C18 5.93913 17.5786 4.92172 16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H11M6 7V10H11V3",fill:"var(--colors-grayA2)"}),i.jsx("path",{d:"M7.17157 4.17157C6.42143 4.92172 6 5.93913 6 7V10H11V3H10C8.93913 3 7.92172 3.42143 7.17157 4.17157Z"})]}),ei=e=>i.jsxs("svg",{width:"14px",height:"14px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[i.jsx("path",{d:"M18 7C18 5.93913 17.5786 4.92172 16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H13M18 7V17C18 18.0609 17.5786 19.0783 16.8284 19.8284C16.0783 20.5786 15.0609 21 14 21H10C8.93913 21 7.92172 20.5786 7.17157 19.8284C6.42143 19.0783 6 18.0609 6 17V7C6 5.93913 6.42143 4.92172 7.17157 4.17157C7.92172 3.42143 8.93913 3 10 3H13M18 7V10H13V3",fill:"var(--colors-grayA2)"}),i.jsx("path",{d:"M16.8284 4.17157C16.0783 3.42143 15.0609 3 14 3H13V10H18V7C18 5.93913 17.5786 4.92172 16.8284 4.17157Z"})]}),or={backspace:"⌫",delete:"Del",cmd:"⌘",alt:"⌥",option:"⌥",enter:"↩",ctrl:"⌃",shift:"⇧",tab:"⇥",capslock:"⇪"},ti=["OF","TF","MLD","MRD","MDD"],ni={OF:i.jsx(Zc,{width:"16px",height:"18px",stroke:"var(--colors-gray8)",strokeWidth:1.2,fill:"var(--colors-grayA2)",style:{marginLeft:"2px"}}),TF:i.jsx(qc,{width:"16px",height:"18px",stroke:"var(--colors-gray8)",strokeWidth:1.2,fill:"var(--colors-grayA2)",style:{marginLeft:"2px"}}),MLD:i.jsx(Qc,{width:"18px",height:"18px",stroke:"var(--colors-gray8)",fill:"var(--colors-gray8)",strokeWidth:1.2}),MRD:i.jsx(ei,{width:"18px",height:"18px",stroke:"var(--colors-gray8)",fill:"var(--colors-gray8)",strokeWidth:1.2}),MDD:i.jsx(Jc,{width:"18px",height:"18px",stroke:"var(--colors-gray8)",fill:"var(--colors-gray8)",strokeWidth:1.2})},ri=T("span",{display:"inline-block",marginLeft:"-1",height:"18px",width:"18px",variants:{half:{true:{marginLeft:"-0_5"}}}}),oi=T("kbd",{display:"inline-block",background:"$gray3",fontSize:"10px",minWidth:"$3",height:"$4",lineHeight:"14px",borderRadius:"$2",backgroundColor:"$grayA2",border:"1px solid $grayA4",padding:"0 $1",marginRight:"$1",color:"currentColor",userSelect:"none",variants:{size:{xs:{minWidth:"$3",height:"$3",fontSize:"10px",borderRadius:"$1",padding:"0 $0_5"},sm:{minWidth:"$4",height:"$4",fontSize:"10px"},md:{minWidth:"$5",height:"$5",fontSize:"$1",lineHeight:"$lineHeights$1",borderRadius:"$2",padding:"0 $1_5"}},uppercase:{true:{textTransform:"uppercase"}},lowercase:{true:{textTransform:"lowercase"}}},defaultVariants:{uppercase:!0}}),ar=T("div",{display:"inline-flex",alignItems:"center","& > kbd:last-child":{marginRight:0}}),sr=oi;function ai(e){const{shortcuts:t,uppercase:n=!0,size:r="sm"}=e;if(!t)return null;if(Array.isArray(t))return i.jsx(ar,{children:t.map((s,u)=>ti.indexOf(s)!==-1?i.jsx(ri,{children:ni[s]},u):i.jsx(sr,{uppercase:n,size:r,children:or[s]??s},u))});const o=t.split(/[,+]/).map(s=>or[s]??s);return i.jsx(ar,{children:o.map((s,u)=>i.jsx(sr,{uppercase:n,size:r,children:s},u))})}function D(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function cr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=cr(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():cr(e[o],null)}}}}function ce(...e){return a.useCallback(hn(...e),e)}function Ve(e,t=[]){let n=[];function r(s,u){const c=a.createContext(u),f=n.length;n=[...n,u];const p=l=>{var x;const{scope:m,children:v,...g}=l,h=((x=m==null?void 0:m[e])==null?void 0:x[f])||c,b=a.useMemo(()=>g,Object.values(g));return i.jsx(h.Provider,{value:b,children:v})};p.displayName=s+"Provider";function d(l,m){var h;const v=((h=m==null?void 0:m[e])==null?void 0:h[f])||c,g=a.useContext(v);if(g)return g;if(u!==void 0)return u;throw new Error(`\`${l}\` must be used within \`${s}\``)}return[p,d]}const o=()=>{const s=n.map(u=>a.createContext(u));return function(c){const f=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[r,si(o,...t)]}function si(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const u=r.reduce((c,{useScope:f,scopeName:p})=>{const l=f(s)[`__scope${p}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var ci=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ie=ci.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...u}=r,c=s?dt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ii(e,t){e&&Nc.flushSync(()=>e.dispatchEvent(t))}function Zr(e){const t=e+"CollectionProvider",[n,r]=Ve(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),u=v=>{const{scope:g,children:h}=v,b=pe.useRef(null),x=pe.useRef(new Map).current;return i.jsx(o,{scope:g,itemMap:x,collectionRef:b,children:h})};u.displayName=t;const c=e+"CollectionSlot",f=pe.forwardRef((v,g)=>{const{scope:h,children:b}=v,x=s(c,h),M=ce(g,x.collectionRef);return i.jsx(dt,{ref:M,children:b})});f.displayName=c;const p=e+"CollectionItemSlot",d="data-radix-collection-item",l=pe.forwardRef((v,g)=>{const{scope:h,children:b,...x}=v,M=pe.useRef(null),w=ce(g,M),S=s(p,h);return pe.useEffect(()=>(S.itemMap.set(M,{ref:M,...x}),()=>void S.itemMap.delete(M))),i.jsx(dt,{[d]:"",ref:w,children:b})});l.displayName=p;function m(v){const g=s(e+"CollectionConsumer",v);return pe.useCallback(()=>{const b=g.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((S,R)=>x.indexOf(S.ref.current)-x.indexOf(R.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:u,Slot:f,ItemSlot:l},m,r]}var ui="Arrow",qr=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return i.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});qr.displayName=ui;var li=qr,vn="Popper",[Jr,Qr]=Ve(vn),[di,eo]=Jr(vn),to=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return i.jsx(di,{scope:t,anchor:r,onAnchorChange:o,children:n})};to.displayName=vn;var no="PopperAnchor",ro=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=eo(no,n),u=a.useRef(null),c=ce(t,u);return a.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||u.current)}),r?null:i.jsx(ie.div,{...o,ref:c})});ro.displayName=no;var gn="PopperContent",[fi,pi]=Jr(gn),oo=a.forwardRef((e,t)=>{var G,ae,O,se,Qn,er;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:p=[],collisionPadding:d=0,sticky:l="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:g,...h}=e,b=eo(gn,n),[x,M]=a.useState(null),w=ce(t,De=>M(De)),[S,R]=a.useState(null),I=$c(S),E=(I==null?void 0:I.width)??0,_=(I==null?void 0:I.height)??0,P=r+(s!=="center"?"-"+s:""),N=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},K=Array.isArray(p)?p:[p],W=K.length>0,X={padding:N,boundary:K.filter(hi),altBoundary:W},{refs:Z,floatingStyles:ue,placement:z,isPositioned:le,middlewareData:L}=Oc({strategy:"fixed",placement:P,whileElementsMounted:(...De)=>Dc(...De,{animationFrame:v==="always"}),elements:{reference:b.anchor},middleware:[jc({mainAxis:o+_,alignmentAxis:u}),f&&Lc({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?kc():void 0,...X}),f&&Fc({...X}),Uc({...X,apply:({elements:De,rects:tr,availableWidth:_c,availableHeight:Ic})=>{const{width:Tc,height:Ac}=tr.reference,rt=De.floating.style;rt.setProperty("--radix-popper-available-width",`${_c}px`),rt.setProperty("--radix-popper-available-height",`${Ic}px`),rt.setProperty("--radix-popper-anchor-width",`${Tc}px`),rt.setProperty("--radix-popper-anchor-height",`${Ac}px`)}}),S&&Gc({element:S,padding:c}),vi({arrowWidth:E,arrowHeight:_}),m&&Kc({strategy:"referenceHidden",...X})]}),[C,A]=co(z),$=k(g);me(()=>{le&&($==null||$())},[le,$]);const j=(G=L.arrow)==null?void 0:G.x,q=(ae=L.arrow)==null?void 0:ae.y,J=((O=L.arrow)==null?void 0:O.centerOffset)!==0,[de,B]=a.useState();return me(()=>{x&&B(window.getComputedStyle(x).zIndex)},[x]),i.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...ue,transform:le?ue.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(se=L.transformOrigin)==null?void 0:se.x,(Qn=L.transformOrigin)==null?void 0:Qn.y].join(" "),...((er=L.hide)==null?void 0:er.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(fi,{scope:n,placedSide:C,onArrowChange:R,arrowX:j,arrowY:q,shouldHideArrow:J,children:i.jsx(ie.div,{"data-side":C,"data-align":A,...h,ref:w,style:{...h.style,animation:le?void 0:"none"}})})})});oo.displayName=gn;var ao="PopperArrow",mi={top:"bottom",right:"left",bottom:"top",left:"right"},so=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=pi(ao,r),u=mi[s.placedSide];return i.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:i.jsx(li,{...o,ref:n,style:{...o.style,display:"block"}})})});so.displayName=ao;function hi(e){return e!==null}var vi=e=>({name:"transformOrigin",options:e,fn(t){var b,x,M;const{placement:n,rects:r,middlewareData:o}=t,u=((b=o.arrow)==null?void 0:b.centerOffset)!==0,c=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[p,d]=co(n),l={start:"0%",center:"50%",end:"100%"}[d],m=(((x=o.arrow)==null?void 0:x.x)??0)+c/2,v=(((M=o.arrow)==null?void 0:M.y)??0)+f/2;let g="",h="";return p==="bottom"?(g=u?l:`${m}px`,h=`${-f}px`):p==="top"?(g=u?l:`${m}px`,h=`${r.floating.height+f}px`):p==="right"?(g=`${-f}px`,h=u?l:`${v}px`):p==="left"&&(g=`${r.floating.width+f}px`,h=u?l:`${v}px`),{data:{x:g,y:h}}}});function co(e){const[t,n="center"]=e.split("-");return[t,n]}var io=to,gi=ro,Ci=oo,bi=so;function xi(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var He=e=>{const{present:t,children:n}=e,r=Mi(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=ce(r.ref,wi(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};He.displayName="Presence";function Mi(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),u=e?"mounted":"unmounted",[c,f]=xi(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const p=ot(r.current);s.current=c==="mounted"?p:"none"},[c]),me(()=>{const p=r.current,d=o.current;if(d!==e){const m=s.current,v=ot(p);e?f("MOUNT"):v==="none"||(p==null?void 0:p.display)==="none"?f("UNMOUNT"):f(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),me(()=>{if(t){let p;const d=t.ownerDocument.defaultView??window,l=v=>{const h=ot(r.current).includes(v.animationName);if(v.target===t&&h&&(f("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",p=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=v=>{v.target===t&&(s.current=ot(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{d.clearTimeout(p),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function ot(e){return(e==null?void 0:e.animationName)||"none"}function wi(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gt="rovingFocusGroup.onEntryFocus",Si={bubbles:!1,cancelable:!0},Et="RovingFocusGroup",[zt,uo,Ei]=Zr(Et),[yi,lo]=Ve(Et,[Ei]),[Ri,Pi]=yi(Et),fo=a.forwardRef((e,t)=>i.jsx(zt.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(zt.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(_i,{...e,ref:t})})}));fo.displayName=Et;var _i=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:u,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:d=!1,...l}=e,m=a.useRef(null),v=ce(t,m),g=Ne(s),[h=null,b]=$e({prop:u,defaultProp:c,onChange:f}),[x,M]=a.useState(!1),w=k(p),S=uo(n),R=a.useRef(!1),[I,E]=a.useState(0);return a.useEffect(()=>{const _=m.current;if(_)return _.addEventListener(Gt,w),()=>_.removeEventListener(Gt,w)},[w]),i.jsx(Ri,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:h,onItemFocus:a.useCallback(_=>b(_),[b]),onItemShiftTab:a.useCallback(()=>M(!0),[]),onFocusableItemAdd:a.useCallback(()=>E(_=>_+1),[]),onFocusableItemRemove:a.useCallback(()=>E(_=>_-1),[]),children:i.jsx(ie.div,{tabIndex:x||I===0?-1:0,"data-orientation":r,...l,ref:v,style:{outline:"none",...e.style},onMouseDown:D(e.onMouseDown,()=>{R.current=!0}),onFocus:D(e.onFocus,_=>{const P=!R.current;if(_.target===_.currentTarget&&P&&!x){const N=new CustomEvent(Gt,Si);if(_.currentTarget.dispatchEvent(N),!N.defaultPrevented){const K=S().filter(z=>z.focusable),W=K.find(z=>z.active),X=K.find(z=>z.id===h),ue=[W,X,...K].filter(Boolean).map(z=>z.ref.current);ho(ue,d)}}R.current=!1}),onBlur:D(e.onBlur,()=>M(!1))})})}),po="RovingFocusGroupItem",mo=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...u}=e,c=ee(),f=s||c,p=Pi(po,n),d=p.currentTabStopId===f,l=uo(n),{onFocusableItemAdd:m,onFocusableItemRemove:v}=p;return a.useEffect(()=>{if(r)return m(),()=>v()},[r,m,v]),i.jsx(zt.ItemSlot,{scope:n,id:f,focusable:r,active:o,children:i.jsx(ie.span,{tabIndex:d?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:D(e.onMouseDown,g=>{r?p.onItemFocus(f):g.preventDefault()}),onFocus:D(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:D(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){p.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const h=Ai(g,p.orientation,p.dir);if(h!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=l().filter(M=>M.focusable).map(M=>M.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const M=x.indexOf(g.currentTarget);x=p.loop?Ni(x,M+1):x.slice(M+1)}setTimeout(()=>ho(x))}})})})});mo.displayName=po;var Ii={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ti(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ai(e,t,n){const r=Ti(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ii[r]}function ho(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ni(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $i=fo,Oi=mo,Zt=["Enter"," "],Di=["ArrowDown","PageUp","Home"],vo=["ArrowUp","PageDown","End"],ji=[...Di,...vo],Li={ltr:[...Zt,"ArrowRight"],rtl:[...Zt,"ArrowLeft"]},ki={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ye="Menu",[Fe,Fi,Ui]=Zr(Ye),[Se,go]=Ve(Ye,[Ui,Qr,lo]),Xe=Qr(),Co=lo(),[bo,Ce]=Se(Ye),[Gi,ze]=Se(Ye),xo=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:u=!0}=e,c=Xe(t),[f,p]=a.useState(null),d=a.useRef(!1),l=k(s),m=Ne(o);return a.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(io,{...c,children:i.jsx(bo,{scope:t,open:n,onOpenChange:l,content:f,onContentChange:p,children:i.jsx(Gi,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:m,modal:u,children:r})})})};xo.displayName=Ye;var Ki="MenuAnchor",Cn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xe(n);return i.jsx(gi,{...o,...r,ref:t})});Cn.displayName=Ki;var bn="MenuPortal",[Bi,Mo]=Se(bn,{forceMount:void 0}),wo=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Ce(bn,t);return i.jsx(Bi,{scope:t,forceMount:n,children:i.jsx(He,{present:n||s.open,children:i.jsx(Hc,{asChild:!0,container:o,children:r})})})};wo.displayName=bn;var te="MenuContent",[Wi,xn]=Se(te),So=a.forwardRef((e,t)=>{const n=Mo(te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ce(te,e.__scopeMenu),u=ze(te,e.__scopeMenu);return i.jsx(Fe.Provider,{scope:e.__scopeMenu,children:i.jsx(He,{present:r||s.open,children:i.jsx(Fe.Slot,{scope:e.__scopeMenu,children:u.modal?i.jsx(Vi,{...o,ref:t}):i.jsx(Hi,{...o,ref:t})})})})}),Vi=a.forwardRef((e,t)=>{const n=Ce(te,e.__scopeMenu),r=a.useRef(null),o=ce(t,r);return a.useEffect(()=>{const s=r.current;if(s)return ln(s)},[]),i.jsx(Mn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:D(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hi=a.forwardRef((e,t)=>{const n=Ce(te,e.__scopeMenu);return i.jsx(Mn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Mn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,disableOutsideScroll:g,...h}=e,b=Ce(te,n),x=ze(te,n),M=Xe(n),w=Co(n),S=Fi(n),[R,I]=a.useState(null),E=a.useRef(null),_=ce(t,E,b.onContentChange),P=a.useRef(0),N=a.useRef(""),K=a.useRef(0),W=a.useRef(null),X=a.useRef("right"),Z=a.useRef(0),ue=g?Vc:a.Fragment,z=g?{as:dt,allowPinchZoom:!0}:void 0,le=C=>{var G,ae;const A=N.current+C,$=S().filter(O=>!O.disabled),j=document.activeElement,q=(G=$.find(O=>O.ref.current===j))==null?void 0:G.textValue,J=$.map(O=>O.textValue),de=ou(J,A,q),B=(ae=$.find(O=>O.textValue===de))==null?void 0:ae.ref.current;(function O(se){N.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>O(""),1e3))})(A),B&&setTimeout(()=>B.focus())};a.useEffect(()=>()=>window.clearTimeout(P.current),[]),Dr();const L=a.useCallback(C=>{var $,j;return X.current===(($=W.current)==null?void 0:$.side)&&su(C,(j=W.current)==null?void 0:j.area)},[]);return i.jsx(Wi,{scope:n,searchRef:N,onItemEnter:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),onItemLeave:a.useCallback(C=>{var A;L(C)||((A=E.current)==null||A.focus(),I(null))},[L]),onTriggerLeave:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:a.useCallback(C=>{W.current=C},[]),children:i.jsx(ue,{...z,children:i.jsx(Bc,{asChild:!0,trapped:o,onMountAutoFocus:D(s,C=>{var A;C.preventDefault(),(A=E.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:i.jsx(Wc,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,children:i.jsx($i,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:I,onEntryFocus:D(f,C=>{x.isUsingKeyboardRef.current||C.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Ci,{role:"menu","aria-orientation":"vertical","data-state":Uo(b.open),"data-radix-menu-content":"",dir:x.dir,...M,...h,ref:_,style:{outline:"none",...h.style},onKeyDown:D(h.onKeyDown,C=>{const $=C.target.closest("[data-radix-menu-content]")===C.currentTarget,j=C.ctrlKey||C.altKey||C.metaKey,q=C.key.length===1;$&&(C.key==="Tab"&&C.preventDefault(),!j&&q&&le(C.key));const J=E.current;if(C.target!==J||!ji.includes(C.key))return;C.preventDefault();const B=S().filter(G=>!G.disabled).map(G=>G.ref.current);vo.includes(C.key)&&B.reverse(),nu(B)}),onBlur:D(e.onBlur,C=>{C.currentTarget.contains(C.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:D(e.onPointerMove,Ue(C=>{const A=C.target,$=Z.current!==C.clientX;if(C.currentTarget.contains(A)&&$){const j=C.clientX>Z.current?"right":"left";X.current=j,Z.current=C.clientX}}))})})})})})})});So.displayName=te;var Yi="MenuGroup",wn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ie.div,{role:"group",...r,ref:t})});wn.displayName=Yi;var Xi="MenuLabel",Eo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ie.div,{...r,ref:t})});Eo.displayName=Xi;var ft="MenuItem",ir="menu.itemSelect",yt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=a.useRef(null),u=ze(ft,e.__scopeMenu),c=xn(ft,e.__scopeMenu),f=ce(t,s),p=a.useRef(!1),d=()=>{const l=s.current;if(!n&&l){const m=new CustomEvent(ir,{bubbles:!0,cancelable:!0});l.addEventListener(ir,v=>r==null?void 0:r(v),{once:!0}),ii(l,m),m.defaultPrevented?p.current=!1:u.onClose()}};return i.jsx(yo,{...o,ref:f,disabled:n,onClick:D(e.onClick,d),onPointerDown:l=>{var m;(m=e.onPointerDown)==null||m.call(e,l),p.current=!0},onPointerUp:D(e.onPointerUp,l=>{var m;p.current||(m=l.currentTarget)==null||m.click()}),onKeyDown:D(e.onKeyDown,l=>{const m=c.searchRef.current!=="";n||m&&l.key===" "||Zt.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});yt.displayName=ft;var yo=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,u=xn(ft,n),c=Co(n),f=a.useRef(null),p=ce(t,f),[d,l]=a.useState(!1),[m,v]=a.useState("");return a.useEffect(()=>{const g=f.current;g&&v((g.textContent??"").trim())},[s.children]),i.jsx(Fe.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:i.jsx(Oi,{asChild:!0,...c,focusable:!r,children:i.jsx(ie.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:p,onPointerMove:D(e.onPointerMove,Ue(g=>{r?u.onItemLeave(g):(u.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:D(e.onPointerLeave,Ue(g=>u.onItemLeave(g))),onFocus:D(e.onFocus,()=>l(!0)),onBlur:D(e.onBlur,()=>l(!1))})})})}),zi="MenuCheckboxItem",Ro=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx(Ao,{scope:e.__scopeMenu,checked:n,children:i.jsx(yt,{role:"menuitemcheckbox","aria-checked":pt(n)?"mixed":n,...o,ref:t,"data-state":yn(n),onSelect:D(o.onSelect,()=>r==null?void 0:r(pt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ro.displayName=zi;var Po="MenuRadioGroup",[Zi,qi]=Se(Po,{value:void 0,onValueChange:()=>{}}),_o=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=k(r);return i.jsx(Zi,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(wn,{...o,ref:t})})});_o.displayName=Po;var Io="MenuRadioItem",To=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=qi(Io,e.__scopeMenu),s=n===o.value;return i.jsx(Ao,{scope:e.__scopeMenu,checked:s,children:i.jsx(yt,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":yn(s),onSelect:D(r.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,n)},{checkForDefaultPrevented:!1})})})});To.displayName=Io;var Sn="MenuItemIndicator",[Ao,Ji]=Se(Sn,{checked:!1}),No=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Ji(Sn,n);return i.jsx(He,{present:r||pt(s.checked)||s.checked===!0,children:i.jsx(ie.span,{...o,ref:t,"data-state":yn(s.checked)})})});No.displayName=Sn;var Qi="MenuSeparator",$o=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$o.displayName=Qi;var eu="MenuArrow",Oo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xe(n);return i.jsx(bi,{...o,...r,ref:t})});Oo.displayName=eu;var En="MenuSub",[tu,Do]=Se(En),jo=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=Ce(En,t),u=Xe(t),[c,f]=a.useState(null),[p,d]=a.useState(null),l=k(o);return a.useEffect(()=>(s.open===!1&&l(!1),()=>l(!1)),[s.open,l]),i.jsx(io,{...u,children:i.jsx(bo,{scope:t,open:r,onOpenChange:l,content:p,onContentChange:d,children:i.jsx(tu,{scope:t,contentId:ee(),triggerId:ee(),trigger:c,onTriggerChange:f,children:n})})})};jo.displayName=En;var je="MenuSubTrigger",Lo=a.forwardRef((e,t)=>{const n=Ce(je,e.__scopeMenu),r=ze(je,e.__scopeMenu),o=Do(je,e.__scopeMenu),s=xn(je,e.__scopeMenu),u=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:e.__scopeMenu},d=a.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return a.useEffect(()=>d,[d]),a.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),f(null)}},[c,f]),i.jsx(Cn,{asChild:!0,...p,children:i.jsx(yo,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Uo(n.open),...e,ref:hn(t,o.onTriggerChange),onClick:l=>{var m;(m=e.onClick)==null||m.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:D(e.onPointerMove,Ue(l=>{s.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:D(e.onPointerLeave,Ue(l=>{var v,g;d();const m=(v=n.content)==null?void 0:v.getBoundingClientRect();if(m){const h=(g=n.content)==null?void 0:g.dataset.side,b=h==="right",x=b?-5:5,M=m[b?"left":"right"],w=m[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:l.clientX+x,y:l.clientY},{x:M,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:M,y:m.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(l),l.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:D(e.onKeyDown,l=>{var v;const m=s.searchRef.current!=="";e.disabled||m&&l.key===" "||Li[r.dir].includes(l.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),l.preventDefault())})})})});Lo.displayName=je;var ko="MenuSubContent",Fo=a.forwardRef((e,t)=>{const n=Mo(te,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Ce(te,e.__scopeMenu),u=ze(te,e.__scopeMenu),c=Do(ko,e.__scopeMenu),f=a.useRef(null),p=ce(t,f);return i.jsx(Fe.Provider,{scope:e.__scopeMenu,children:i.jsx(He,{present:r||s.open,children:i.jsx(Fe.Slot,{scope:e.__scopeMenu,children:i.jsx(Mn,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;u.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:D(e.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:D(e.onEscapeKeyDown,d=>{u.onClose(),d.preventDefault()}),onKeyDown:D(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),m=ki[u.dir].includes(d.key);l&&m&&(s.onOpenChange(!1),(v=c.trigger)==null||v.focus(),d.preventDefault())})})})})})});Fo.displayName=ko;function Uo(e){return e?"open":"closed"}function pt(e){return e==="indeterminate"}function yn(e){return pt(e)?"indeterminate":e?"checked":"unchecked"}function nu(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ru(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ou(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let u=ru(e,Math.max(s,0));o.length===1&&(u=u.filter(p=>p!==n));const f=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function au(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const c=t[s].x,f=t[s].y,p=t[u].x,d=t[u].y;f>r!=d>r&&n<(p-c)*(r-f)/(d-f)+c&&(o=!o)}return o}function su(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return au(n,t)}function Ue(e){return t=>t.pointerType==="mouse"?e(t):void 0}var cu=xo,iu=Cn,uu=wo,lu=So,du=wn,fu=Eo,pu=yt,mu=Ro,hu=_o,vu=To,gu=No,Cu=$o,bu=Oo,xu=jo,Mu=Lo,wu=Fo,Rn="DropdownMenu",[Su,ym]=Ve(Rn,[go]),V=go(),[Eu,Go]=Su(Rn),Ko=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:u,modal:c=!0}=e,f=V(t),p=a.useRef(null),[d=!1,l]=$e({prop:o,defaultProp:s,onChange:u});return i.jsx(Eu,{scope:t,triggerId:ee(),triggerRef:p,contentId:ee(),open:d,onOpenChange:l,onOpenToggle:a.useCallback(()=>l(m=>!m),[l]),modal:c,children:i.jsx(cu,{...f,open:d,onOpenChange:l,dir:r,modal:c,children:n})})};Ko.displayName=Rn;var Bo="DropdownMenuTrigger",Wo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Go(Bo,n),u=V(n);return i.jsx(iu,{asChild:!0,...u,children:i.jsx(ie.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:hn(t,s.triggerRef),onPointerDown:D(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:D(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Wo.displayName=Bo;var yu="DropdownMenuPortal",Vo=e=>{const{__scopeDropdownMenu:t,...n}=e,r=V(t);return i.jsx(uu,{...r,...n})};Vo.displayName=yu;var Ho="DropdownMenuContent",Yo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Go(Ho,n),s=V(n),u=a.useRef(!1);return i.jsx(lu,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:D(e.onCloseAutoFocus,c=>{var f;u.current||(f=o.triggerRef.current)==null||f.focus(),u.current=!1,c.preventDefault()}),onInteractOutside:D(e.onInteractOutside,c=>{const f=c.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0,d=f.button===2||p;(!o.modal||d)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Yo.displayName=Ho;var Ru="DropdownMenuGroup",Xo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(du,{...o,...r,ref:t})});Xo.displayName=Ru;var Pu="DropdownMenuLabel",zo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(fu,{...o,...r,ref:t})});zo.displayName=Pu;var _u="DropdownMenuItem",Zo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(pu,{...o,...r,ref:t})});Zo.displayName=_u;var Iu="DropdownMenuCheckboxItem",qo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(mu,{...o,...r,ref:t})});qo.displayName=Iu;var Tu="DropdownMenuRadioGroup",Jo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(hu,{...o,...r,ref:t})});Jo.displayName=Tu;var Au="DropdownMenuRadioItem",Qo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(vu,{...o,...r,ref:t})});Qo.displayName=Au;var Nu="DropdownMenuItemIndicator",ea=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(gu,{...o,...r,ref:t})});ea.displayName=Nu;var $u="DropdownMenuSeparator",ta=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(Cu,{...o,...r,ref:t})});ta.displayName=$u;var Ou="DropdownMenuArrow",Du=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(bu,{...o,...r,ref:t})});Du.displayName=Ou;var ju=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,u=V(t),[c=!1,f]=$e({prop:r,defaultProp:s,onChange:o});return i.jsx(xu,{...u,open:c,onOpenChange:f,children:n})},Lu="DropdownMenuSubTrigger",na=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(Mu,{...o,...r,ref:t})});na.displayName=Lu;var ku="DropdownMenuSubContent",ra=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V(n);return i.jsx(wu,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ra.displayName=ku;var oa=Ko,Fu=Wo,aa=Vo,Uu=Yo,Gu=Xo,Ku=zo,Bu=Zo,Wu=qo,Vu=Jo,Hu=Qo,Yu=ea,Xu=ta,zu=ju,Zu=na,qu=ra,Ju="DismissableLayer",qt="dismissableLayer.update",Qu="dismissableLayer.pointerDownOutside",el="dismissableLayer.focusOutside",ur,sa=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ca=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:u,onDismiss:c,...f}=e,p=a.useContext(sa),[d,l]=a.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=U(t,E=>l(E)),h=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=h.indexOf(b),M=d?h.indexOf(d):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,S=M>=x,R=rl(E=>{const _=E.target,P=[...p.branches].some(N=>N.contains(_));!S||P||(o==null||o(E),u==null||u(E),E.defaultPrevented||c==null||c())},m),I=ol(E=>{const _=E.target;[...p.branches].some(N=>N.contains(_))||(s==null||s(E),u==null||u(E),E.defaultPrevented||c==null||c())},m);return jr(E=>{M===p.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),a.useEffect(()=>{if(d)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(ur=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),lr(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ur)}},[d,m,n,p]),a.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),lr())},[d,p]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(qt,E),()=>document.removeEventListener(qt,E)},[]),i.jsx(F.div,{...f,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:y(e.onFocusCapture,I.onFocusCapture),onBlurCapture:y(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:y(e.onPointerDownCapture,R.onPointerDownCapture)})});ca.displayName=Ju;var tl="DismissableLayerBranch",nl=a.forwardRef((e,t)=>{const n=a.useContext(sa),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(F.div,{...e,ref:o})});nl.displayName=tl;function rl(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){ia(Qu,n,p,{discrete:!0})};const p={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ol(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&ia(el,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lr(){const e=new CustomEvent(qt);document.dispatchEvent(e)}function ia(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xt(o,s):o.dispatchEvent(s)}var Kt=0;function al(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??dr()),document.body.insertAdjacentElement("beforeend",e[1]??dr()),Kt++,()=>{Kt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kt--}},[])}function dr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Bt="focusScope.autoFocusOnMount",Wt="focusScope.autoFocusOnUnmount",fr={bubbles:!1,cancelable:!0},sl="FocusScope",ua=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...u}=e,[c,f]=a.useState(null),p=k(o),d=k(s),l=a.useRef(null),m=U(t,h=>f(h)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let h=function(w){if(v.paused||!c)return;const S=w.target;c.contains(S)?l.current=S:he(l.current,{select:!0})},b=function(w){if(v.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||he(l.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&he(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const M=new MutationObserver(x);return c&&M.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),M.disconnect()}}},[r,c,v.paused]),a.useEffect(()=>{if(c){mr.add(v);const h=document.activeElement;if(!c.contains(h)){const x=new CustomEvent(Bt,fr);c.addEventListener(Bt,p),c.dispatchEvent(x),x.defaultPrevented||(cl(fl(la(c)),{select:!0}),document.activeElement===h&&he(c))}return()=>{c.removeEventListener(Bt,p),setTimeout(()=>{const x=new CustomEvent(Wt,fr);c.addEventListener(Wt,d),c.dispatchEvent(x),x.defaultPrevented||he(h??document.body,{select:!0}),c.removeEventListener(Wt,d),mr.remove(v)},0)}}},[c,p,d,v]);const g=a.useCallback(h=>{if(!n&&!r||v.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,x=document.activeElement;if(b&&x){const M=h.currentTarget,[w,S]=il(M);w&&S?!h.shiftKey&&x===S?(h.preventDefault(),n&&he(w,{select:!0})):h.shiftKey&&x===w&&(h.preventDefault(),n&&he(S,{select:!0})):x===M&&h.preventDefault()}},[n,r,v.paused]);return i.jsx(F.div,{tabIndex:-1,...u,ref:m,onKeyDown:g})});ua.displayName=sl;function cl(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(he(r,{select:t}),document.activeElement!==n)return}function il(e){const t=la(e),n=pr(t,e),r=pr(t.reverse(),e);return[n,r]}function la(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pr(e,t){for(const n of e)if(!ul(n,{upTo:t}))return n}function ul(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ll(e){return e instanceof HTMLInputElement&&"select"in e}function he(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ll(e)&&t&&e.select()}}var mr=dl();function dl(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hr(e,t),e.unshift(t)},remove(t){var n;e=hr(e,t),(n=e[0])==null||n.resume()}}}function hr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fl(e){return e.filter(t=>t.tagName!=="A")}var pl="Portal",da=a.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,s]=a.useState(!1);me(()=>s(!0),[]);const u=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?Lr.createPortal(i.jsx(F.div,{...r,ref:t}),u):null});da.displayName=pl;var fa=a.forwardRef((e,t)=>{const{children:n,...r}=e,o=a.Children.toArray(n),s=o.find(hl);if(s){const u=s.props.children,c=o.map(f=>f===s?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return i.jsx(Jt,{...r,ref:t,children:a.isValidElement(u)?a.cloneElement(u,void 0,c):null})}return i.jsx(Jt,{...r,ref:t,children:n})});fa.displayName="Slot";var Jt=a.forwardRef((e,t)=>{const{children:n,...r}=e;if(a.isValidElement(n)){const o=gl(n);return a.cloneElement(n,{...vl(r,n.props),ref:t?Mt(t,o):o})}return a.Children.count(n)>1?a.Children.only(null):null});Jt.displayName="SlotClone";var ml=({children:e})=>i.jsx(i.Fragment,{children:e});function hl(e){return a.isValidElement(e)&&e.type===ml}function vl(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{s(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function gl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pa=kr(),Vt=function(){},Rt=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Vt,onWheelCapture:Vt,onTouchMoveCapture:Vt}),o=r[0],s=r[1],u=e.forwardProps,c=e.children,f=e.className,p=e.removeScrollBar,d=e.enabled,l=e.shards,m=e.sideCar,v=e.noIsolation,g=e.inert,h=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,M=e.gapMode,w=Fr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,R=Ur([n,t]),I=Q(Q({},w),o);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:pa,removeScrollBar:p,shards:l,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:M}),u?a.cloneElement(a.Children.only(c),Q(Q({},I),{ref:R})):a.createElement(x,Q({},I,{className:f,ref:R}),c))});Rt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rt.classNames={fullWidth:Gr,zeroRight:Kr};var Qt=!1;if(typeof window<"u")try{var at=Object.defineProperty({},"passive",{get:function(){return Qt=!0,!0}});window.addEventListener("test",at,at),window.removeEventListener("test",at,at)}catch{Qt=!1}var Pe=Qt?{passive:!1}:!1,Cl=function(e){return e.tagName==="TEXTAREA"},ma=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Cl(e)&&n[t]==="visible")},bl=function(e){return ma(e,"overflowY")},xl=function(e){return ma(e,"overflowX")},vr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ha(e,r);if(o){var s=va(e,r),u=s[1],c=s[2];if(u>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ml=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},wl=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ha=function(e,t){return e==="v"?bl(t):xl(t)},va=function(e,t){return e==="v"?Ml(t):wl(t)},Sl=function(e,t){return e==="h"&&t==="rtl"?-1:1},El=function(e,t,n,r,o){var s=Sl(e,window.getComputedStyle(t).direction),u=s*r,c=n.target,f=t.contains(c),p=!1,d=u>0,l=0,m=0;do{var v=va(e,c),g=v[0],h=v[1],b=v[2],x=h-b-s*g;(g||x)&&ha(e,c)&&(l+=x,m+=g),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(d&&(o&&Math.abs(l)<1||!o&&u>l)||!d&&(o&&Math.abs(m)<1||!o&&-u>m))&&(p=!0),p},st=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gr=function(e){return[e.deltaX,e.deltaY]},Cr=function(e){return e&&"current"in e?e.current:e},yl=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rl=function(e){return`
12
- .block-interactivity-`.concat(e,` {pointer-events: none;}
13
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
14
- `)},Pl=0,_e=[];function _l(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(Pl++)[0],s=a.useState(Br)[0],u=a.useRef(e);a.useEffect(function(){u.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Wr([e.lockRef.current],(e.shards||[]).map(Cr),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(h,b){if("touches"in h&&h.touches.length===2)return!u.current.allowPinchZoom;var x=st(h),M=n.current,w="deltaX"in h?h.deltaX:M[0]-x[0],S="deltaY"in h?h.deltaY:M[1]-x[1],R,I=h.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in h&&E==="h"&&I.type==="range")return!1;var _=vr(E,I);if(!_)return!0;if(_?R=E:(R=E==="v"?"h":"v",_=vr(E,I)),!_)return!1;if(!r.current&&"changedTouches"in h&&(w||S)&&(r.current=R),!R)return!0;var P=r.current||R;return El(P,b,h,P==="h"?w:S,!0)},[]),f=a.useCallback(function(h){var b=h;if(!(!_e.length||_e[_e.length-1]!==s)){var x="deltaY"in b?gr(b):st(b),M=t.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&yl(R.delta,x)})[0];if(M&&M.should){b.cancelable&&b.preventDefault();return}if(!M){var w=(u.current.shards||[]).map(Cr).filter(Boolean).filter(function(R){return R.contains(b.target)}),S=w.length>0?c(b,w[0]):!u.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),p=a.useCallback(function(h,b,x,M){var w={name:h,delta:b,target:x,should:M,shadowParent:Il(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=a.useCallback(function(h){n.current=st(h),r.current=void 0},[]),l=a.useCallback(function(h){p(h.type,gr(h),h.target,c(h,e.lockRef.current))},[]),m=a.useCallback(function(h){p(h.type,st(h),h.target,c(h,e.lockRef.current))},[]);a.useEffect(function(){return _e.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Pe),document.addEventListener("touchmove",f,Pe),document.addEventListener("touchstart",d,Pe),function(){_e=_e.filter(function(h){return h!==s}),document.removeEventListener("wheel",f,Pe),document.removeEventListener("touchmove",f,Pe),document.removeEventListener("touchstart",d,Pe)}},[]);var v=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(s,{styles:Rl(o)}):null,v?a.createElement(Vr,{gapMode:e.gapMode}):null)}function Il(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tl=Hr(pa,_l);var ga=a.forwardRef(function(e,t){return a.createElement(Rt,Q({},e,{ref:t,sideCar:Tl}))});ga.classNames=Rt.classNames;const Al=ga;var en=["Enter"," "],Nl=["ArrowDown","PageUp","Home"],Ca=["ArrowUp","PageDown","End"],$l=[...Nl,...Ca],Ol={ltr:[...en,"ArrowRight"],rtl:[...en,"ArrowLeft"]},Dl={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ze="Menu",[Ge,jl,Ll]=dn(Ze),[Ee,ba]=fn(Ze,[Ll,wt,Oe]),qe=wt(),xa=Oe(),[Ma,be]=Ee(Ze),[kl,Je]=Ee(Ze),wa=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:u=!0}=e,c=qe(t),[f,p]=a.useState(null),d=a.useRef(!1),l=k(s),m=Ne(o);return a.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(St,{...c,children:i.jsx(Ma,{scope:t,open:n,onOpenChange:l,content:f,onContentChange:p,children:i.jsx(kl,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:m,modal:u,children:r})})})};wa.displayName=Ze;var Fl="MenuAnchor",Pn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=qe(n);return i.jsx(Yr,{...o,...r,ref:t})});Pn.displayName=Fl;var _n="MenuPortal",[Ul,Sa]=Ee(_n,{forceMount:void 0}),Ea=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=be(_n,t);return i.jsx(Ul,{scope:t,forceMount:n,children:i.jsx(ge,{present:n||s.open,children:i.jsx(da,{asChild:!0,container:o,children:r})})})};Ea.displayName=_n;var ne="MenuContent",[Gl,In]=Ee(ne),ya=a.forwardRef((e,t)=>{const n=Sa(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=be(ne,e.__scopeMenu),u=Je(ne,e.__scopeMenu);return i.jsx(Ge.Provider,{scope:e.__scopeMenu,children:i.jsx(ge,{present:r||s.open,children:i.jsx(Ge.Slot,{scope:e.__scopeMenu,children:u.modal?i.jsx(Kl,{...o,ref:t}):i.jsx(Bl,{...o,ref:t})})})})}),Kl=a.forwardRef((e,t)=>{const n=be(ne,e.__scopeMenu),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return ln(s)},[]),i.jsx(Tn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:y(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Bl=a.forwardRef((e,t)=>{const n=be(ne,e.__scopeMenu);return i.jsx(Tn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Tn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,disableOutsideScroll:g,...h}=e,b=be(ne,n),x=Je(ne,n),M=qe(n),w=xa(n),S=jl(n),[R,I]=a.useState(null),E=a.useRef(null),_=U(t,E,b.onContentChange),P=a.useRef(0),N=a.useRef(""),K=a.useRef(0),W=a.useRef(null),X=a.useRef("right"),Z=a.useRef(0),ue=g?Al:a.Fragment,z=g?{as:fa,allowPinchZoom:!0}:void 0,le=C=>{var G,ae;const A=N.current+C,$=S().filter(O=>!O.disabled),j=document.activeElement,q=(G=$.find(O=>O.ref.current===j))==null?void 0:G.textValue,J=$.map(O=>O.textValue),de=td(J,A,q),B=(ae=$.find(O=>O.textValue===de))==null?void 0:ae.ref.current;(function O(se){N.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>O(""),1e3))})(A),B&&setTimeout(()=>B.focus())};a.useEffect(()=>()=>window.clearTimeout(P.current),[]),al();const L=a.useCallback(C=>{var $,j;return X.current===(($=W.current)==null?void 0:$.side)&&rd(C,(j=W.current)==null?void 0:j.area)},[]);return i.jsx(Gl,{scope:n,searchRef:N,onItemEnter:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),onItemLeave:a.useCallback(C=>{var A;L(C)||((A=E.current)==null||A.focus(),I(null))},[L]),onTriggerLeave:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:a.useCallback(C=>{W.current=C},[]),children:i.jsx(ue,{...z,children:i.jsx(ua,{asChild:!0,trapped:o,onMountAutoFocus:y(s,C=>{var A;C.preventDefault(),(A=E.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:i.jsx(ca,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,children:i.jsx(pn,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:I,onEntryFocus:y(f,C=>{x.isUsingKeyboardRef.current||C.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Xr,{role:"menu","aria-orientation":"vertical","data-state":Ka(b.open),"data-radix-menu-content":"",dir:x.dir,...M,...h,ref:_,style:{outline:"none",...h.style},onKeyDown:y(h.onKeyDown,C=>{const $=C.target.closest("[data-radix-menu-content]")===C.currentTarget,j=C.ctrlKey||C.altKey||C.metaKey,q=C.key.length===1;$&&(C.key==="Tab"&&C.preventDefault(),!j&&q&&le(C.key));const J=E.current;if(C.target!==J||!$l.includes(C.key))return;C.preventDefault();const B=S().filter(G=>!G.disabled).map(G=>G.ref.current);Ca.includes(C.key)&&B.reverse(),Ql(B)}),onBlur:y(e.onBlur,C=>{C.currentTarget.contains(C.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:y(e.onPointerMove,Ke(C=>{const A=C.target,$=Z.current!==C.clientX;if(C.currentTarget.contains(A)&&$){const j=C.clientX>Z.current?"right":"left";X.current=j,Z.current=C.clientX}}))})})})})})})});ya.displayName=ne;var Wl="MenuGroup",An=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"group",...r,ref:t})});An.displayName=Wl;var Vl="MenuLabel",Ra=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{...r,ref:t})});Ra.displayName=Vl;var mt="MenuItem",br="menu.itemSelect",Pt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=a.useRef(null),u=Je(mt,e.__scopeMenu),c=In(mt,e.__scopeMenu),f=U(t,s),p=a.useRef(!1),d=()=>{const l=s.current;if(!n&&l){const m=new CustomEvent(br,{bubbles:!0,cancelable:!0});l.addEventListener(br,v=>r==null?void 0:r(v),{once:!0}),xt(l,m),m.defaultPrevented?p.current=!1:u.onClose()}};return i.jsx(Pa,{...o,ref:f,disabled:n,onClick:y(e.onClick,d),onPointerDown:l=>{var m;(m=e.onPointerDown)==null||m.call(e,l),p.current=!0},onPointerUp:y(e.onPointerUp,l=>{var m;p.current||(m=l.currentTarget)==null||m.click()}),onKeyDown:y(e.onKeyDown,l=>{const m=c.searchRef.current!=="";n||m&&l.key===" "||en.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});Pt.displayName=mt;var Pa=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,u=In(mt,n),c=xa(n),f=a.useRef(null),p=U(t,f),[d,l]=a.useState(!1),[m,v]=a.useState("");return a.useEffect(()=>{const g=f.current;g&&v((g.textContent??"").trim())},[s.children]),i.jsx(Ge.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:i.jsx(mn,{asChild:!0,...c,focusable:!r,children:i.jsx(F.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:p,onPointerMove:y(e.onPointerMove,Ke(g=>{r?u.onItemLeave(g):(u.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:y(e.onPointerLeave,Ke(g=>u.onItemLeave(g))),onFocus:y(e.onFocus,()=>l(!0)),onBlur:y(e.onBlur,()=>l(!1))})})})}),Hl="MenuCheckboxItem",_a=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx($a,{scope:e.__scopeMenu,checked:n,children:i.jsx(Pt,{role:"menuitemcheckbox","aria-checked":ht(n)?"mixed":n,...o,ref:t,"data-state":On(n),onSelect:y(o.onSelect,()=>r==null?void 0:r(ht(n)?!0:!n),{checkForDefaultPrevented:!1})})})});_a.displayName=Hl;var Ia="MenuRadioGroup",[Yl,Xl]=Ee(Ia,{value:void 0,onValueChange:()=>{}}),Ta=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=k(r);return i.jsx(Yl,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(An,{...o,ref:t})})});Ta.displayName=Ia;var Aa="MenuRadioItem",Na=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=Xl(Aa,e.__scopeMenu),s=n===o.value;return i.jsx($a,{scope:e.__scopeMenu,checked:s,children:i.jsx(Pt,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":On(s),onSelect:y(r.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,n)},{checkForDefaultPrevented:!1})})})});Na.displayName=Aa;var Nn="MenuItemIndicator",[$a,zl]=Ee(Nn,{checked:!1}),Oa=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=zl(Nn,n);return i.jsx(ge,{present:r||ht(s.checked)||s.checked===!0,children:i.jsx(F.span,{...o,ref:t,"data-state":On(s.checked)})})});Oa.displayName=Nn;var Zl="MenuSeparator",Da=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Da.displayName=Zl;var ql="MenuArrow",ja=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=qe(n);return i.jsx(zr,{...o,...r,ref:t})});ja.displayName=ql;var $n="MenuSub",[Jl,La]=Ee($n),ka=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=be($n,t),u=qe(t),[c,f]=a.useState(null),[p,d]=a.useState(null),l=k(o);return a.useEffect(()=>(s.open===!1&&l(!1),()=>l(!1)),[s.open,l]),i.jsx(St,{...u,children:i.jsx(Ma,{scope:t,open:r,onOpenChange:l,content:p,onContentChange:d,children:i.jsx(Jl,{scope:t,contentId:ee(),triggerId:ee(),trigger:c,onTriggerChange:f,children:n})})})};ka.displayName=$n;var Le="MenuSubTrigger",Fa=a.forwardRef((e,t)=>{const n=be(Le,e.__scopeMenu),r=Je(Le,e.__scopeMenu),o=La(Le,e.__scopeMenu),s=In(Le,e.__scopeMenu),u=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:e.__scopeMenu},d=a.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return a.useEffect(()=>d,[d]),a.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),f(null)}},[c,f]),i.jsx(Pn,{asChild:!0,...p,children:i.jsx(Pa,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ka(n.open),...e,ref:Mt(t,o.onTriggerChange),onClick:l=>{var m;(m=e.onClick)==null||m.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:y(e.onPointerMove,Ke(l=>{s.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:y(e.onPointerLeave,Ke(l=>{var v,g;d();const m=(v=n.content)==null?void 0:v.getBoundingClientRect();if(m){const h=(g=n.content)==null?void 0:g.dataset.side,b=h==="right",x=b?-5:5,M=m[b?"left":"right"],w=m[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:l.clientX+x,y:l.clientY},{x:M,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:M,y:m.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(l),l.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:y(e.onKeyDown,l=>{var v;const m=s.searchRef.current!=="";e.disabled||m&&l.key===" "||Ol[r.dir].includes(l.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),l.preventDefault())})})})});Fa.displayName=Le;var Ua="MenuSubContent",Ga=a.forwardRef((e,t)=>{const n=Sa(ne,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=be(ne,e.__scopeMenu),u=Je(ne,e.__scopeMenu),c=La(Ua,e.__scopeMenu),f=a.useRef(null),p=U(t,f);return i.jsx(Ge.Provider,{scope:e.__scopeMenu,children:i.jsx(ge,{present:r||s.open,children:i.jsx(Ge.Slot,{scope:e.__scopeMenu,children:i.jsx(Tn,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;u.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:y(e.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:y(e.onEscapeKeyDown,d=>{u.onClose(),d.preventDefault()}),onKeyDown:y(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),m=Dl[u.dir].includes(d.key);l&&m&&(s.onOpenChange(!1),(v=c.trigger)==null||v.focus(),d.preventDefault())})})})})})});Ga.displayName=Ua;function Ka(e){return e?"open":"closed"}function ht(e){return e==="indeterminate"}function On(e){return ht(e)?"indeterminate":e?"checked":"unchecked"}function Ql(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ed(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function td(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let u=ed(e,Math.max(s,0));o.length===1&&(u=u.filter(p=>p!==n));const f=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function nd(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const c=t[s].x,f=t[s].y,p=t[u].x,d=t[u].y;f>r!=d>r&&n<(p-c)*(r-f)/(d-f)+c&&(o=!o)}return o}function rd(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nd(n,t)}function Ke(e){return t=>t.pointerType==="mouse"?e(t):void 0}var od=wa,ad=Pn,sd=Ea,cd=ya,id=An,ud=Ra,ld=Pt,dd=_a,fd=Ta,pd=Na,md=Oa,hd=Da,vd=ja,gd=ka,Cd=Fa,bd=Ga,Dn="ContextMenu",[xd,Rm]=fn(Dn,[ba]),H=ba(),[Md,Ba]=xd(Dn),Wa=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:o,modal:s=!0}=e,[u,c]=a.useState(!1),f=H(t),p=k(r),d=a.useCallback(l=>{c(l),p(l)},[p]);return i.jsx(Md,{scope:t,open:u,onOpenChange:d,modal:s,children:i.jsx(od,{...f,dir:o,open:u,onOpenChange:d,modal:s,children:n})})};Wa.displayName=Dn;var Va="ContextMenuTrigger",Ha=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=e,s=Ba(Va,n),u=H(n),c=a.useRef({x:0,y:0}),f=a.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),p=a.useRef(0),d=a.useCallback(()=>window.clearTimeout(p.current),[]),l=m=>{c.current={x:m.clientX,y:m.clientY},s.onOpenChange(!0)};return a.useEffect(()=>d,[d]),a.useEffect(()=>void(r&&d()),[r,d]),i.jsxs(i.Fragment,{children:[i.jsx(ad,{...u,virtualRef:f}),i.jsx(F.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:y(e.onContextMenu,m=>{d(),l(m),m.preventDefault()}),onPointerDown:r?e.onPointerDown:y(e.onPointerDown,ct(m=>{d(),p.current=window.setTimeout(()=>l(m),700)})),onPointerMove:r?e.onPointerMove:y(e.onPointerMove,ct(d)),onPointerCancel:r?e.onPointerCancel:y(e.onPointerCancel,ct(d)),onPointerUp:r?e.onPointerUp:y(e.onPointerUp,ct(d))})]})});Ha.displayName=Va;var wd="ContextMenuPortal",Ya=e=>{const{__scopeContextMenu:t,...n}=e,r=H(t);return i.jsx(sd,{...r,...n})};Ya.displayName=wd;var Xa="ContextMenuContent",za=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=Ba(Xa,n),s=H(n),u=a.useRef(!1);return i.jsx(cd,{...s,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{var f;(f=e.onCloseAutoFocus)==null||f.call(e,c),!c.defaultPrevented&&u.current&&c.preventDefault(),u.current=!1},onInteractOutside:c=>{var f;(f=e.onInteractOutside)==null||f.call(e,c),!c.defaultPrevented&&!o.modal&&(u.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});za.displayName=Xa;var Sd="ContextMenuGroup",Za=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(id,{...o,...r,ref:t})});Za.displayName=Sd;var Ed="ContextMenuLabel",qa=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(ud,{...o,...r,ref:t})});qa.displayName=Ed;var yd="ContextMenuItem",Ja=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(ld,{...o,...r,ref:t})});Ja.displayName=yd;var Rd="ContextMenuCheckboxItem",Qa=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(dd,{...o,...r,ref:t})});Qa.displayName=Rd;var Pd="ContextMenuRadioGroup",es=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(fd,{...o,...r,ref:t})});es.displayName=Pd;var _d="ContextMenuRadioItem",ts=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(pd,{...o,...r,ref:t})});ts.displayName=_d;var Id="ContextMenuItemIndicator",ns=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(md,{...o,...r,ref:t})});ns.displayName=Id;var Td="ContextMenuSeparator",rs=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(hd,{...o,...r,ref:t})});rs.displayName=Td;var Ad="ContextMenuArrow",Nd=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(vd,{...o,...r,ref:t})});Nd.displayName=Ad;var $d="ContextMenuSub",os=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:o,defaultOpen:s}=e,u=H(t),[c,f]=$e({prop:o,defaultProp:s,onChange:r});return i.jsx(gd,{...u,open:c,onOpenChange:f,children:n})};os.displayName=$d;var Od="ContextMenuSubTrigger",as=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(Cd,{...o,...r,ref:t})});as.displayName=Od;var Dd="ContextMenuSubContent",ss=a.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,o=H(n);return i.jsx(bd,{...o,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ss.displayName=Dd;function ct(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var cs=Wa,jd=Ha,is=Ya,Ld=za,kd=Za,Fd=qa,Ud=Ja,Gd=Qa,Kd=es,Bd=ts,Wd=ns,Vd=rs,Hd=os,Yd=as,Xd=ss;function us(e,t=[]){let n=[];function r(s,u){const c=a.createContext(u),f=n.length;n=[...n,u];const p=l=>{var x;const{scope:m,children:v,...g}=l,h=((x=m==null?void 0:m[e])==null?void 0:x[f])||c,b=a.useMemo(()=>g,Object.values(g));return i.jsx(h.Provider,{value:b,children:v})};p.displayName=s+"Provider";function d(l,m){var h;const v=((h=m==null?void 0:m[e])==null?void 0:h[f])||c,g=a.useContext(v);if(g)return g;if(u!==void 0)return u;throw new Error(`\`${l}\` must be used within \`${s}\``)}return[p,d]}const o=()=>{const s=n.map(u=>a.createContext(u));return function(c){const f=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[r,zd(o,...t)]}function zd(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const u=r.reduce((c,{useScope:f,scopeName:p})=>{const l=f(s)[`__scope${p}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var Zd="DismissableLayer",tn="dismissableLayer.update",qd="dismissableLayer.pointerDownOutside",Jd="dismissableLayer.focusOutside",xr,ls=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ds=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:u,onDismiss:c,...f}=e,p=a.useContext(ls),[d,l]=a.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=U(t,E=>l(E)),h=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=h.indexOf(b),M=d?h.indexOf(d):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,S=M>=x,R=tf(E=>{const _=E.target,P=[...p.branches].some(N=>N.contains(_));!S||P||(o==null||o(E),u==null||u(E),E.defaultPrevented||c==null||c())},m),I=nf(E=>{const _=E.target;[...p.branches].some(N=>N.contains(_))||(s==null||s(E),u==null||u(E),E.defaultPrevented||c==null||c())},m);return jr(E=>{M===p.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),a.useEffect(()=>{if(d)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(xr=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(d)),p.layers.add(d),Mr(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=xr)}},[d,m,n,p]),a.useEffect(()=>()=>{d&&(p.layers.delete(d),p.layersWithOutsidePointerEventsDisabled.delete(d),Mr())},[d,p]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(tn,E),()=>document.removeEventListener(tn,E)},[]),i.jsx(F.div,{...f,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:y(e.onFocusCapture,I.onFocusCapture),onBlurCapture:y(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:y(e.onPointerDownCapture,R.onPointerDownCapture)})});ds.displayName=Zd;var Qd="DismissableLayerBranch",ef=a.forwardRef((e,t)=>{const n=a.useContext(ls),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(F.div,{...e,ref:o})});ef.displayName=Qd;function tf(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){fs(qd,n,p,{discrete:!0})};const p={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nf(e,t=globalThis==null?void 0:globalThis.document){const n=k(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&fs(Jd,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Mr(){const e=new CustomEvent(tn);document.dispatchEvent(e)}function fs(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?xt(o,s):o.dispatchEvent(s)}var Ht="focusScope.autoFocusOnMount",Yt="focusScope.autoFocusOnUnmount",wr={bubbles:!1,cancelable:!0},rf="FocusScope",ps=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...u}=e,[c,f]=a.useState(null),p=k(o),d=k(s),l=a.useRef(null),m=U(t,h=>f(h)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let h=function(w){if(v.paused||!c)return;const S=w.target;c.contains(S)?l.current=S:ve(l.current,{select:!0})},b=function(w){if(v.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||ve(l.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&ve(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const M=new MutationObserver(x);return c&&M.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),M.disconnect()}}},[r,c,v.paused]),a.useEffect(()=>{if(c){Er.add(v);const h=document.activeElement;if(!c.contains(h)){const x=new CustomEvent(Ht,wr);c.addEventListener(Ht,p),c.dispatchEvent(x),x.defaultPrevented||(of(lf(ms(c)),{select:!0}),document.activeElement===h&&ve(c))}return()=>{c.removeEventListener(Ht,p),setTimeout(()=>{const x=new CustomEvent(Yt,wr);c.addEventListener(Yt,d),c.dispatchEvent(x),x.defaultPrevented||ve(h??document.body,{select:!0}),c.removeEventListener(Yt,d),Er.remove(v)},0)}}},[c,p,d,v]);const g=a.useCallback(h=>{if(!n&&!r||v.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,x=document.activeElement;if(b&&x){const M=h.currentTarget,[w,S]=af(M);w&&S?!h.shiftKey&&x===S?(h.preventDefault(),n&&ve(w,{select:!0})):h.shiftKey&&x===w&&(h.preventDefault(),n&&ve(S,{select:!0})):x===M&&h.preventDefault()}},[n,r,v.paused]);return i.jsx(F.div,{tabIndex:-1,...u,ref:m,onKeyDown:g})});ps.displayName=rf;function of(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ve(r,{select:t}),document.activeElement!==n)return}function af(e){const t=ms(e),n=Sr(t,e),r=Sr(t.reverse(),e);return[n,r]}function ms(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Sr(e,t){for(const n of e)if(!sf(n,{upTo:t}))return n}function sf(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cf(e){return e instanceof HTMLInputElement&&"select"in e}function ve(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cf(e)&&t&&e.select()}}var Er=uf();function uf(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yr(e,t),e.unshift(t)},remove(t){var n;e=yr(e,t),(n=e[0])==null||n.resume()}}}function yr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lf(e){return e.filter(t=>t.tagName!=="A")}var df="Portal",hs=a.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,s]=a.useState(!1);me(()=>s(!0),[]);const u=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?Lr.createPortal(i.jsx(F.div,{...r,ref:t}),u):null});hs.displayName=df;function ff(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var Qe=e=>{const{present:t,children:n}=e,r=pf(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=U(r.ref,mf(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};Qe.displayName="Presence";function pf(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),u=e?"mounted":"unmounted",[c,f]=ff(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const p=it(r.current);s.current=c==="mounted"?p:"none"},[c]),me(()=>{const p=r.current,d=o.current;if(d!==e){const m=s.current,v=it(p);e?f("MOUNT"):v==="none"||(p==null?void 0:p.display)==="none"?f("UNMOUNT"):f(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),me(()=>{if(t){let p;const d=t.ownerDocument.defaultView??window,l=v=>{const h=it(r.current).includes(v.animationName);if(v.target===t&&h&&(f("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",p=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=v=>{v.target===t&&(s.current=it(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",l),t.addEventListener("animationend",l),()=>{d.clearTimeout(p),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",l),t.removeEventListener("animationend",l)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function it(e){return(e==null?void 0:e.animationName)||"none"}function mf(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vs=a.forwardRef((e,t)=>{const{children:n,...r}=e,o=a.Children.toArray(n),s=o.find(vf);if(s){const u=s.props.children,c=o.map(f=>f===s?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:f);return i.jsx(nn,{...r,ref:t,children:a.isValidElement(u)?a.cloneElement(u,void 0,c):null})}return i.jsx(nn,{...r,ref:t,children:n})});vs.displayName="Slot";var nn=a.forwardRef((e,t)=>{const{children:n,...r}=e;if(a.isValidElement(n)){const o=Cf(n);return a.cloneElement(n,{...gf(r,n.props),ref:t?Mt(t,o):o})}return a.Children.count(n)>1?a.Children.only(null):null});nn.displayName="SlotClone";var hf=({children:e})=>i.jsx(i.Fragment,{children:e});function vf(e){return a.isValidElement(e)&&e.type===hf}function gf(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{s(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Cf(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gs=kr(),Xt=function(){},_t=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Xt,onWheelCapture:Xt,onTouchMoveCapture:Xt}),o=r[0],s=r[1],u=e.forwardProps,c=e.children,f=e.className,p=e.removeScrollBar,d=e.enabled,l=e.shards,m=e.sideCar,v=e.noIsolation,g=e.inert,h=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,M=e.gapMode,w=Fr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,R=Ur([n,t]),I=Q(Q({},w),o);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:gs,removeScrollBar:p,shards:l,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!h,lockRef:n,gapMode:M}),u?a.cloneElement(a.Children.only(c),Q(Q({},I),{ref:R})):a.createElement(x,Q({},I,{className:f,ref:R}),c))});_t.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_t.classNames={fullWidth:Gr,zeroRight:Kr};var rn=!1;if(typeof window<"u")try{var ut=Object.defineProperty({},"passive",{get:function(){return rn=!0,!0}});window.addEventListener("test",ut,ut),window.removeEventListener("test",ut,ut)}catch{rn=!1}var Ie=rn?{passive:!1}:!1,bf=function(e){return e.tagName==="TEXTAREA"},Cs=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bf(e)&&n[t]==="visible")},xf=function(e){return Cs(e,"overflowY")},Mf=function(e){return Cs(e,"overflowX")},Rr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=bs(e,r);if(o){var s=xs(e,r),u=s[1],c=s[2];if(u>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wf=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Sf=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bs=function(e,t){return e==="v"?xf(t):Mf(t)},xs=function(e,t){return e==="v"?wf(t):Sf(t)},Ef=function(e,t){return e==="h"&&t==="rtl"?-1:1},yf=function(e,t,n,r,o){var s=Ef(e,window.getComputedStyle(t).direction),u=s*r,c=n.target,f=t.contains(c),p=!1,d=u>0,l=0,m=0;do{var v=xs(e,c),g=v[0],h=v[1],b=v[2],x=h-b-s*g;(g||x)&&bs(e,c)&&(l+=x,m+=g),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(d&&(o&&Math.abs(l)<1||!o&&u>l)||!d&&(o&&Math.abs(m)<1||!o&&-u>m))&&(p=!0),p},lt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pr=function(e){return[e.deltaX,e.deltaY]},_r=function(e){return e&&"current"in e?e.current:e},Rf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pf=function(e){return`
15
- .block-interactivity-`.concat(e,` {pointer-events: none;}
16
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
17
- `)},_f=0,Te=[];function If(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(_f++)[0],s=a.useState(Br)[0],u=a.useRef(e);a.useEffect(function(){u.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=Wr([e.lockRef.current],(e.shards||[]).map(_r),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(h,b){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!u.current.allowPinchZoom;var x=lt(h),M=n.current,w="deltaX"in h?h.deltaX:M[0]-x[0],S="deltaY"in h?h.deltaY:M[1]-x[1],R,I=h.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in h&&E==="h"&&I.type==="range")return!1;var _=Rr(E,I);if(!_)return!0;if(_?R=E:(R=E==="v"?"h":"v",_=Rr(E,I)),!_)return!1;if(!r.current&&"changedTouches"in h&&(w||S)&&(r.current=R),!R)return!0;var P=r.current||R;return yf(P,b,h,P==="h"?w:S,!0)},[]),f=a.useCallback(function(h){var b=h;if(!(!Te.length||Te[Te.length-1]!==s)){var x="deltaY"in b?Pr(b):lt(b),M=t.current.filter(function(R){return R.name===b.type&&(R.target===b.target||b.target===R.shadowParent)&&Rf(R.delta,x)})[0];if(M&&M.should){b.cancelable&&b.preventDefault();return}if(!M){var w=(u.current.shards||[]).map(_r).filter(Boolean).filter(function(R){return R.contains(b.target)}),S=w.length>0?c(b,w[0]):!u.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),p=a.useCallback(function(h,b,x,M){var w={name:h,delta:b,target:x,should:M,shadowParent:Tf(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=a.useCallback(function(h){n.current=lt(h),r.current=void 0},[]),l=a.useCallback(function(h){p(h.type,Pr(h),h.target,c(h,e.lockRef.current))},[]),m=a.useCallback(function(h){p(h.type,lt(h),h.target,c(h,e.lockRef.current))},[]);a.useEffect(function(){return Te.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Ie),document.addEventListener("touchmove",f,Ie),document.addEventListener("touchstart",d,Ie),function(){Te=Te.filter(function(h){return h!==s}),document.removeEventListener("wheel",f,Ie),document.removeEventListener("touchmove",f,Ie),document.removeEventListener("touchstart",d,Ie)}},[]);var v=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(s,{styles:Pf(o)}):null,v?a.createElement(Vr,{gapMode:e.gapMode}):null)}function Tf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Af=Hr(gs,If);var Ms=a.forwardRef(function(e,t){return a.createElement(_t,Q({},e,{ref:t,sideCar:Af}))});Ms.classNames=_t.classNames;const Nf=Ms;var on=["Enter"," "],$f=["ArrowDown","PageUp","Home"],ws=["ArrowUp","PageDown","End"],Of=[...$f,...ws],Df={ltr:[...on,"ArrowRight"],rtl:[...on,"ArrowLeft"]},jf={ltr:["ArrowLeft"],rtl:["ArrowRight"]},et="Menu",[Be,Lf,kf]=dn(et),[ye,Ff]=us(et,[kf,wt,Oe]),tt=wt(),Ss=Oe(),[Es,xe]=ye(et),[Uf,nt]=ye(et),ys=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:u=!0}=e,c=tt(t),[f,p]=a.useState(null),d=a.useRef(!1),l=k(s),m=Ne(o);return a.useEffect(()=>{const v=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),i.jsx(St,{...c,children:i.jsx(Es,{scope:t,open:n,onOpenChange:l,content:f,onContentChange:p,children:i.jsx(Uf,{scope:t,onClose:a.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:m,modal:u,children:r})})})};ys.displayName=et;var Gf="MenuAnchor",jn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=tt(n);return i.jsx(Yr,{...o,...r,ref:t})});jn.displayName=Gf;var Ln="MenuPortal",[Kf,Rs]=ye(Ln,{forceMount:void 0}),Ps=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=xe(Ln,t);return i.jsx(Kf,{scope:t,forceMount:n,children:i.jsx(Qe,{present:n||s.open,children:i.jsx(hs,{asChild:!0,container:o,children:r})})})};Ps.displayName=Ln;var re="MenuContent",[Bf,kn]=ye(re),_s=a.forwardRef((e,t)=>{const n=Rs(re,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xe(re,e.__scopeMenu),u=nt(re,e.__scopeMenu);return i.jsx(Be.Provider,{scope:e.__scopeMenu,children:i.jsx(Qe,{present:r||s.open,children:i.jsx(Be.Slot,{scope:e.__scopeMenu,children:u.modal?i.jsx(Wf,{...o,ref:t}):i.jsx(Vf,{...o,ref:t})})})})}),Wf=a.forwardRef((e,t)=>{const n=xe(re,e.__scopeMenu),r=a.useRef(null),o=U(t,r);return a.useEffect(()=>{const s=r.current;if(s)return ln(s)},[]),i.jsx(Fn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:y(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Vf=a.forwardRef((e,t)=>{const n=xe(re,e.__scopeMenu);return i.jsx(Fn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,disableOutsideScroll:g,...h}=e,b=xe(re,n),x=nt(re,n),M=tt(n),w=Ss(n),S=Lf(n),[R,I]=a.useState(null),E=a.useRef(null),_=U(t,E,b.onContentChange),P=a.useRef(0),N=a.useRef(""),K=a.useRef(0),W=a.useRef(null),X=a.useRef("right"),Z=a.useRef(0),ue=g?Nf:a.Fragment,z=g?{as:vs,allowPinchZoom:!0}:void 0,le=C=>{var G,ae;const A=N.current+C,$=S().filter(O=>!O.disabled),j=document.activeElement,q=(G=$.find(O=>O.ref.current===j))==null?void 0:G.textValue,J=$.map(O=>O.textValue),de=rp(J,A,q),B=(ae=$.find(O=>O.textValue===de))==null?void 0:ae.ref.current;(function O(se){N.current=se,window.clearTimeout(P.current),se!==""&&(P.current=window.setTimeout(()=>O(""),1e3))})(A),B&&setTimeout(()=>B.focus())};a.useEffect(()=>()=>window.clearTimeout(P.current),[]),Dr();const L=a.useCallback(C=>{var $,j;return X.current===(($=W.current)==null?void 0:$.side)&&ap(C,(j=W.current)==null?void 0:j.area)},[]);return i.jsx(Bf,{scope:n,searchRef:N,onItemEnter:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),onItemLeave:a.useCallback(C=>{var A;L(C)||((A=E.current)==null||A.focus(),I(null))},[L]),onTriggerLeave:a.useCallback(C=>{L(C)&&C.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:a.useCallback(C=>{W.current=C},[]),children:i.jsx(ue,{...z,children:i.jsx(ps,{asChild:!0,trapped:o,onMountAutoFocus:y(s,C=>{var A;C.preventDefault(),(A=E.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:i.jsx(ds,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:m,onDismiss:v,children:i.jsx(pn,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:I,onEntryFocus:y(f,C=>{x.isUsingKeyboardRef.current||C.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(Xr,{role:"menu","aria-orientation":"vertical","data-state":Vs(b.open),"data-radix-menu-content":"",dir:x.dir,...M,...h,ref:_,style:{outline:"none",...h.style},onKeyDown:y(h.onKeyDown,C=>{const $=C.target.closest("[data-radix-menu-content]")===C.currentTarget,j=C.ctrlKey||C.altKey||C.metaKey,q=C.key.length===1;$&&(C.key==="Tab"&&C.preventDefault(),!j&&q&&le(C.key));const J=E.current;if(C.target!==J||!Of.includes(C.key))return;C.preventDefault();const B=S().filter(G=>!G.disabled).map(G=>G.ref.current);ws.includes(C.key)&&B.reverse(),tp(B)}),onBlur:y(e.onBlur,C=>{C.currentTarget.contains(C.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:y(e.onPointerMove,We(C=>{const A=C.target,$=Z.current!==C.clientX;if(C.currentTarget.contains(A)&&$){const j=C.clientX>Z.current?"right":"left";X.current=j,Z.current=C.clientX}}))})})})})})})});_s.displayName=re;var Hf="MenuGroup",Un=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"group",...r,ref:t})});Un.displayName=Hf;var Yf="MenuLabel",Is=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{...r,ref:t})});Is.displayName=Yf;var vt="MenuItem",Ir="menu.itemSelect",It=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=a.useRef(null),u=nt(vt,e.__scopeMenu),c=kn(vt,e.__scopeMenu),f=U(t,s),p=a.useRef(!1),d=()=>{const l=s.current;if(!n&&l){const m=new CustomEvent(Ir,{bubbles:!0,cancelable:!0});l.addEventListener(Ir,v=>r==null?void 0:r(v),{once:!0}),xt(l,m),m.defaultPrevented?p.current=!1:u.onClose()}};return i.jsx(Ts,{...o,ref:f,disabled:n,onClick:y(e.onClick,d),onPointerDown:l=>{var m;(m=e.onPointerDown)==null||m.call(e,l),p.current=!0},onPointerUp:y(e.onPointerUp,l=>{var m;p.current||(m=l.currentTarget)==null||m.click()}),onKeyDown:y(e.onKeyDown,l=>{const m=c.searchRef.current!=="";n||m&&l.key===" "||on.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});It.displayName=vt;var Ts=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,u=kn(vt,n),c=Ss(n),f=a.useRef(null),p=U(t,f),[d,l]=a.useState(!1),[m,v]=a.useState("");return a.useEffect(()=>{const g=f.current;g&&v((g.textContent??"").trim())},[s.children]),i.jsx(Be.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:i.jsx(mn,{asChild:!0,...c,focusable:!r,children:i.jsx(F.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:p,onPointerMove:y(e.onPointerMove,We(g=>{r?u.onItemLeave(g):(u.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:y(e.onPointerLeave,We(g=>u.onItemLeave(g))),onFocus:y(e.onFocus,()=>l(!0)),onBlur:y(e.onBlur,()=>l(!1))})})})}),Xf="MenuCheckboxItem",As=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return i.jsx(js,{scope:e.__scopeMenu,checked:n,children:i.jsx(It,{role:"menuitemcheckbox","aria-checked":gt(n)?"mixed":n,...o,ref:t,"data-state":Bn(n),onSelect:y(o.onSelect,()=>r==null?void 0:r(gt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});As.displayName=Xf;var Ns="MenuRadioGroup",[zf,Zf]=ye(Ns,{value:void 0,onValueChange:()=>{}}),$s=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=k(r);return i.jsx(zf,{scope:e.__scopeMenu,value:n,onValueChange:s,children:i.jsx(Un,{...o,ref:t})})});$s.displayName=Ns;var Os="MenuRadioItem",Ds=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=Zf(Os,e.__scopeMenu),s=n===o.value;return i.jsx(js,{scope:e.__scopeMenu,checked:s,children:i.jsx(It,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Bn(s),onSelect:y(r.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,n)},{checkForDefaultPrevented:!1})})})});Ds.displayName=Os;var Gn="MenuItemIndicator",[js,qf]=ye(Gn,{checked:!1}),Ls=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=qf(Gn,n);return i.jsx(Qe,{present:r||gt(s.checked)||s.checked===!0,children:i.jsx(F.span,{...o,ref:t,"data-state":Bn(s.checked)})})});Ls.displayName=Gn;var Jf="MenuSeparator",ks=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(F.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ks.displayName=Jf;var Qf="MenuArrow",Fs=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=tt(n);return i.jsx(zr,{...o,...r,ref:t})});Fs.displayName=Qf;var Kn="MenuSub",[ep,Us]=ye(Kn),Gs=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,s=xe(Kn,t),u=tt(t),[c,f]=a.useState(null),[p,d]=a.useState(null),l=k(o);return a.useEffect(()=>(s.open===!1&&l(!1),()=>l(!1)),[s.open,l]),i.jsx(St,{...u,children:i.jsx(Es,{scope:t,open:r,onOpenChange:l,content:p,onContentChange:d,children:i.jsx(ep,{scope:t,contentId:ee(),triggerId:ee(),trigger:c,onTriggerChange:f,children:n})})})};Gs.displayName=Kn;var ke="MenuSubTrigger",Ks=a.forwardRef((e,t)=>{const n=xe(ke,e.__scopeMenu),r=nt(ke,e.__scopeMenu),o=Us(ke,e.__scopeMenu),s=kn(ke,e.__scopeMenu),u=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=s,p={__scopeMenu:e.__scopeMenu},d=a.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return a.useEffect(()=>d,[d]),a.useEffect(()=>{const l=c.current;return()=>{window.clearTimeout(l),f(null)}},[c,f]),i.jsx(jn,{asChild:!0,...p,children:i.jsx(Ts,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Vs(n.open),...e,ref:Mt(t,o.onTriggerChange),onClick:l=>{var m;(m=e.onClick)==null||m.call(e,l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:y(e.onPointerMove,We(l=>{s.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(s.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:y(e.onPointerLeave,We(l=>{var v,g;d();const m=(v=n.content)==null?void 0:v.getBoundingClientRect();if(m){const h=(g=n.content)==null?void 0:g.dataset.side,b=h==="right",x=b?-5:5,M=m[b?"left":"right"],w=m[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:l.clientX+x,y:l.clientY},{x:M,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:M,y:m.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(l),l.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:y(e.onKeyDown,l=>{var v;const m=s.searchRef.current!=="";e.disabled||m&&l.key===" "||Df[r.dir].includes(l.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),l.preventDefault())})})})});Ks.displayName=ke;var Bs="MenuSubContent",Ws=a.forwardRef((e,t)=>{const n=Rs(re,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=xe(re,e.__scopeMenu),u=nt(re,e.__scopeMenu),c=Us(Bs,e.__scopeMenu),f=a.useRef(null),p=U(t,f);return i.jsx(Be.Provider,{scope:e.__scopeMenu,children:i.jsx(Qe,{present:r||s.open,children:i.jsx(Be.Slot,{scope:e.__scopeMenu,children:i.jsx(Fn,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var l;u.isUsingKeyboardRef.current&&((l=f.current)==null||l.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:y(e.onFocusOutside,d=>{d.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:y(e.onEscapeKeyDown,d=>{u.onClose(),d.preventDefault()}),onKeyDown:y(e.onKeyDown,d=>{var v;const l=d.currentTarget.contains(d.target),m=jf[u.dir].includes(d.key);l&&m&&(s.onOpenChange(!1),(v=c.trigger)==null||v.focus(),d.preventDefault())})})})})})});Ws.displayName=Bs;function Vs(e){return e?"open":"closed"}function gt(e){return e==="indeterminate"}function Bn(e){return gt(e)?"indeterminate":e?"checked":"unchecked"}function tp(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function np(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function rp(e,t,n){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let u=np(e,Math.max(s,0));o.length===1&&(u=u.filter(p=>p!==n));const f=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function op(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,u=t.length-1;s<t.length;u=s++){const c=t[s].x,f=t[s].y,p=t[u].x,d=t[u].y;f>r!=d>r&&n<(p-c)*(r-f)/(d-f)+c&&(o=!o)}return o}function ap(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return op(n,t)}function We(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sp=ys,cp=jn,ip=Ps,up=_s,lp=Un,dp=Is,fp=It,pp=As,mp=$s,hp=Ds,vp=Ls,gp=ks,Cp=Fs,bp=Gs,xp=Ks,Mp=Ws,Tt="Menubar",[an,wp,Sp]=dn(Tt),[Hs,Pm]=us(Tt,[Sp,Oe]),Y=Ff(),Ys=Oe(),[Ep,Wn]=Hs(Tt),Xs=a.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:o,defaultValue:s,loop:u=!0,dir:c,...f}=e,p=Ne(c),d=Ys(n),[l="",m]=$e({prop:r,onChange:o,defaultProp:s}),[v,g]=a.useState(null);return i.jsx(Ep,{scope:n,value:l,onMenuOpen:a.useCallback(h=>{m(h),g(h)},[m]),onMenuClose:a.useCallback(()=>m(""),[m]),onMenuToggle:a.useCallback(h=>{m(b=>b?"":h),g(h)},[m]),dir:p,loop:u,children:i.jsx(an.Provider,{scope:n,children:i.jsx(an.Slot,{scope:n,children:i.jsx(pn,{asChild:!0,...d,orientation:"horizontal",loop:u,dir:p,currentTabStopId:v,onCurrentTabStopIdChange:g,children:i.jsx(F.div,{role:"menubar",...f,ref:t})})})})})});Xs.displayName=Tt;var Vn="MenubarMenu",[yp,zs]=Hs(Vn),Zs=e=>{const{__scopeMenubar:t,value:n,...r}=e,o=ee(),s=n||o||"LEGACY_REACT_AUTO_VALUE",u=Wn(Vn,t),c=Y(t),f=a.useRef(null),p=a.useRef(!1),d=u.value===s;return a.useEffect(()=>{d||(p.current=!1)},[d]),i.jsx(yp,{scope:t,value:s,triggerId:ee(),triggerRef:f,contentId:ee(),wasKeyboardTriggerOpenRef:p,children:i.jsx(sp,{...c,open:d,onOpenChange:l=>{l||u.onMenuClose()},modal:!1,dir:u.dir,...r})})};Zs.displayName=Vn;var sn="MenubarTrigger",qs=a.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...o}=e,s=Ys(n),u=Y(n),c=Wn(sn,n),f=zs(sn,n),p=a.useRef(null),d=U(t,p,f.triggerRef),[l,m]=a.useState(!1),v=c.value===f.value;return i.jsx(an.ItemSlot,{scope:n,value:f.value,disabled:r,children:i.jsx(mn,{asChild:!0,...s,focusable:!r,tabStopId:f.value,children:i.jsx(cp,{asChild:!0,...u,children:i.jsx(F.button,{type:"button",role:"menuitem",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":v,"aria-controls":v?f.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":v?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:d,onPointerDown:y(e.onPointerDown,g=>{!r&&g.button===0&&g.ctrlKey===!1&&(c.onMenuOpen(f.value),v||g.preventDefault())}),onPointerEnter:y(e.onPointerEnter,()=>{var h;!!c.value&&!v&&(c.onMenuOpen(f.value),(h=p.current)==null||h.focus())}),onKeyDown:y(e.onKeyDown,g=>{r||(["Enter"," "].includes(g.key)&&c.onMenuToggle(f.value),g.key==="ArrowDown"&&c.onMenuOpen(f.value),["Enter"," ","ArrowDown"].includes(g.key)&&(f.wasKeyboardTriggerOpenRef.current=!0,g.preventDefault()))}),onFocus:y(e.onFocus,()=>m(!0)),onBlur:y(e.onBlur,()=>m(!1))})})})})});qs.displayName=sn;var Rp="MenubarPortal",Js=e=>{const{__scopeMenubar:t,...n}=e,r=Y(t);return i.jsx(ip,{...r,...n})};Js.displayName=Rp;var cn="MenubarContent",Qs=a.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...o}=e,s=Y(n),u=Wn(cn,n),c=zs(cn,n),f=wp(n),p=a.useRef(!1);return i.jsx(up,{id:c.contentId,"aria-labelledby":c.triggerId,"data-radix-menubar-content":"",...s,...o,ref:t,align:r,onCloseAutoFocus:y(e.onCloseAutoFocus,d=>{var m;!!!u.value&&!p.current&&((m=c.triggerRef.current)==null||m.focus()),p.current=!1,d.preventDefault()}),onFocusOutside:y(e.onFocusOutside,d=>{const l=d.target;f().some(v=>{var g;return(g=v.ref.current)==null?void 0:g.contains(l)})&&d.preventDefault()}),onInteractOutside:y(e.onInteractOutside,()=>{p.current=!0}),onEntryFocus:d=>{c.wasKeyboardTriggerOpenRef.current||d.preventDefault()},onKeyDown:y(e.onKeyDown,d=>{if(["ArrowRight","ArrowLeft"].includes(d.key)){const l=d.target,m=l.hasAttribute("data-radix-menubar-subtrigger"),v=l.closest("[data-radix-menubar-content]")!==d.currentTarget,h=(u.dir==="rtl"?"ArrowRight":"ArrowLeft")===d.key;if(!h&&m||v&&h)return;let M=f().filter(R=>!R.disabled).map(R=>R.value);h&&M.reverse();const w=M.indexOf(c.value);M=u.loop?Up(M,w+1):M.slice(w+1);const[S]=M;S&&u.onMenuOpen(S)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});Qs.displayName=cn;var Pp="MenubarGroup",ec=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(lp,{...o,...r,ref:t})});ec.displayName=Pp;var _p="MenubarLabel",tc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(dp,{...o,...r,ref:t})});tc.displayName=_p;var Ip="MenubarItem",nc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(fp,{...o,...r,ref:t})});nc.displayName=Ip;var Tp="MenubarCheckboxItem",rc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(pp,{...o,...r,ref:t})});rc.displayName=Tp;var Ap="MenubarRadioGroup",oc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(mp,{...o,...r,ref:t})});oc.displayName=Ap;var Np="MenubarRadioItem",ac=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(hp,{...o,...r,ref:t})});ac.displayName=Np;var $p="MenubarItemIndicator",sc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(vp,{...o,...r,ref:t})});sc.displayName=$p;var Op="MenubarSeparator",cc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(gp,{...o,...r,ref:t})});cc.displayName=Op;var Dp="MenubarArrow",jp=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(Cp,{...o,...r,ref:t})});jp.displayName=Dp;var Lp="MenubarSub",ic=e=>{const{__scopeMenubar:t,children:n,open:r,onOpenChange:o,defaultOpen:s}=e,u=Y(t),[c=!1,f]=$e({prop:r,defaultProp:s,onChange:o});return i.jsx(bp,{...u,open:c,onOpenChange:f,children:n})};ic.displayName=Lp;var kp="MenubarSubTrigger",uc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(xp,{"data-radix-menubar-subtrigger":"",...o,...r,ref:t})});uc.displayName=kp;var Fp="MenubarSubContent",lc=a.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,o=Y(n);return i.jsx(Mp,{...o,"data-radix-menubar-content":"",...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});lc.displayName=Fp;function Up(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dc=Xs,Gp=Zs,fc=qs,pc=Js,Kp=Qs,Bp=ec,Wp=tc,Vp=nc,Hp=rc,Yp=oc,Xp=ac,zp=sc,Zp=cc,qp=ic,Jp=uc,Qp=lc;function em(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var Hn="ScrollArea",[mc,_m]=fn(Hn),[tm,oe]=mc(Hn),hc=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...u}=e,[c,f]=a.useState(null),[p,d]=a.useState(null),[l,m]=a.useState(null),[v,g]=a.useState(null),[h,b]=a.useState(null),[x,M]=a.useState(0),[w,S]=a.useState(0),[R,I]=a.useState(!1),[E,_]=a.useState(!1),P=U(t,K=>f(K)),N=Ne(o);return i.jsx(tm,{scope:n,type:r,dir:N,scrollHideDelay:s,scrollArea:c,viewport:p,onViewportChange:d,content:l,onContentChange:m,scrollbarX:v,onScrollbarXChange:g,scrollbarXEnabled:R,onScrollbarXEnabledChange:I,scrollbarY:h,onScrollbarYChange:b,scrollbarYEnabled:E,onScrollbarYEnabledChange:_,onCornerWidthChange:M,onCornerHeightChange:S,children:i.jsx(F.div,{dir:N,...u,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});hc.displayName=Hn;var vc="ScrollAreaViewport",gc=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,u=oe(vc,n),c=a.useRef(null),f=U(t,c,u.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),i.jsx(F.div,{"data-radix-scroll-area-viewport":"",...s,ref:f,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});gc.displayName=vc;var fe="ScrollAreaScrollbar",Cc=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=oe(fe,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:u}=o,c=e.orientation==="horizontal";return a.useEffect(()=>(c?s(!0):u(!0),()=>{c?s(!1):u(!1)}),[c,s,u]),o.type==="hover"?i.jsx(nm,{...r,ref:t,forceMount:n}):o.type==="scroll"?i.jsx(rm,{...r,ref:t,forceMount:n}):o.type==="auto"?i.jsx(bc,{...r,ref:t,forceMount:n}):o.type==="always"?i.jsx(Yn,{...r,ref:t}):null});Cc.displayName=fe;var nm=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=oe(fe,e.__scopeScrollArea),[s,u]=a.useState(!1);return a.useEffect(()=>{const c=o.scrollArea;let f=0;if(c){const p=()=>{window.clearTimeout(f),u(!0)},d=()=>{f=window.setTimeout(()=>u(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",p),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",p),c.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),i.jsx(ge,{present:n||s,children:i.jsx(bc,{"data-state":s?"visible":"hidden",...r,ref:t})})}),rm=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=oe(fe,e.__scopeScrollArea),s=e.orientation==="horizontal",u=Nt(()=>f("SCROLL_END"),100),[c,f]=em("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay,f]),a.useEffect(()=>{const p=o.viewport,d=s?"scrollLeft":"scrollTop";if(p){let l=p[d];const m=()=>{const v=p[d];l!==v&&(f("SCROLL"),u()),l=v};return p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[o.viewport,s,f,u]),i.jsx(ge,{present:n||c!=="hidden",children:i.jsx(Yn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:y(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:y(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),bc=a.forwardRef((e,t)=>{const n=oe(fe,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,u]=a.useState(!1),c=e.orientation==="horizontal",f=Nt(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;u(c?p:d)}},10);return Ae(n.viewport,f),Ae(n.content,f),i.jsx(ge,{present:r||s,children:i.jsx(Yn,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Yn=a.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=oe(fe,e.__scopeScrollArea),s=a.useRef(null),u=a.useRef(0),[c,f]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=Ec(c.viewport,c.content),d={...r,sizes:c,onSizesChange:f,hasThumb:p>0&&p<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:m=>u.current=m};function l(m,v){return um(m,u.current,c,v)}return n==="horizontal"?i.jsx(om,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollLeft,v=Tr(m,c,o.dir);s.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=l(m,o.dir))}}):n==="vertical"?i.jsx(am,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollTop,v=Tr(m,c);s.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=l(m))}}):null}),om=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=oe(fe,e.__scopeScrollArea),[u,c]=a.useState(),f=a.useRef(null),p=U(t,f,s.onScrollbarXChange);return a.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),i.jsx(Mc,{"data-orientation":"horizontal",...o,ref:p,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":At(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,l)=>{if(s.viewport){const m=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),Rc(m,l)&&d.preventDefault()}},onResize:()=>{f.current&&s.viewport&&u&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:bt(u.paddingLeft),paddingEnd:bt(u.paddingRight)}})}})}),am=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=oe(fe,e.__scopeScrollArea),[u,c]=a.useState(),f=a.useRef(null),p=U(t,f,s.onScrollbarYChange);return a.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),i.jsx(Mc,{"data-orientation":"vertical",...o,ref:p,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":At(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,l)=>{if(s.viewport){const m=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),Rc(m,l)&&d.preventDefault()}},onResize:()=>{f.current&&s.viewport&&u&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:bt(u.paddingTop),paddingEnd:bt(u.paddingBottom)}})}})}),[sm,xc]=mc(fe),Mc=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:u,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:d,onResize:l,...m}=e,v=oe(fe,n),[g,h]=a.useState(null),b=U(t,P=>h(P)),x=a.useRef(null),M=a.useRef(""),w=v.viewport,S=r.content-r.viewport,R=k(d),I=k(f),E=Nt(l,10);function _(P){if(x.current){const N=P.clientX-x.current.left,K=P.clientY-x.current.top;p({x:N,y:K})}}return a.useEffect(()=>{const P=N=>{const K=N.target;(g==null?void 0:g.contains(K))&&R(N,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[w,g,S,R]),a.useEffect(I,[r,I]),Ae(g,E),Ae(v.content,E),i.jsx(sm,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:k(s),onThumbPointerUp:k(u),onThumbPositionChange:I,onThumbPointerDown:k(c),children:i.jsx(F.div,{...m,ref:b,style:{position:"absolute",...m.style},onPointerDown:y(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),x.current=g.getBoundingClientRect(),M.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),_(P))}),onPointerMove:y(e.onPointerMove,_),onPointerUp:y(e.onPointerUp,P=>{const N=P.target;N.hasPointerCapture(P.pointerId)&&N.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=M.current,v.viewport&&(v.viewport.style.scrollBehavior=""),x.current=null})})})}),Ct="ScrollAreaThumb",wc=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xc(Ct,e.__scopeScrollArea);return i.jsx(ge,{present:n||o.hasThumb,children:i.jsx(cm,{ref:t,...r})})}),cm=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=oe(Ct,n),u=xc(Ct,n),{onThumbPositionChange:c}=u,f=U(t,l=>u.onThumbChange(l)),p=a.useRef(),d=Nt(()=>{p.current&&(p.current(),p.current=void 0)},100);return a.useEffect(()=>{const l=s.viewport;if(l){const m=()=>{if(d(),!p.current){const v=lm(l,c);p.current=v,c()}};return c(),l.addEventListener("scroll",m),()=>l.removeEventListener("scroll",m)}},[s.viewport,d,c]),i.jsx(F.div,{"data-state":u.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:y(e.onPointerDownCapture,l=>{const v=l.target.getBoundingClientRect(),g=l.clientX-v.left,h=l.clientY-v.top;u.onThumbPointerDown({x:g,y:h})}),onPointerUp:y(e.onPointerUp,u.onThumbPointerUp)})});wc.displayName=Ct;var Xn="ScrollAreaCorner",Sc=a.forwardRef((e,t)=>{const n=oe(Xn,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(im,{...e,ref:t}):null});Sc.displayName=Xn;var im=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=oe(Xn,n),[s,u]=a.useState(0),[c,f]=a.useState(0),p=!!(s&&c);return Ae(o.scrollbarX,()=>{var l;const d=((l=o.scrollbarX)==null?void 0:l.offsetHeight)||0;o.onCornerHeightChange(d),f(d)}),Ae(o.scrollbarY,()=>{var l;const d=((l=o.scrollbarY)==null?void 0:l.offsetWidth)||0;o.onCornerWidthChange(d),u(d)}),p?i.jsx(F.div,{...r,ref:t,style:{width:s,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function bt(e){return e?parseInt(e,10):0}function Ec(e,t){const n=e/t;return isNaN(n)?0:n}function At(e){const t=Ec(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function um(e,t,n,r="ltr"){const o=At(n),s=o/2,u=t||s,c=o-u,f=n.scrollbar.paddingStart+u,p=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,l=r==="ltr"?[0,d]:[d*-1,0];return yc([f,p],l)(e)}function Tr(e,t,n="ltr"){const r=At(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,u=t.content-t.viewport,c=s-r,f=n==="ltr"?[0,u]:[u*-1,0],p=Yc(e,f);return yc([0,u],[0,c])(p)}function yc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rc(e,t){return e>0&&e<t}var lm=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},u=n.left!==s.left,c=n.top!==s.top;(u||c)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Nt(e,t){const n=k(e),r=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(r.current),[]),a.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ae(e,t){const n=k(t);me(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var dm=hc,fm=gc,pm=Cc,mm=wc,hm=Sc;const vm=T(dm,{position:"relative",width:"100%",overflow:"hidden",maxHeight:"inherit",variants:{fullHeight:{true:{height:"100%"}}},defaultVariants:{fullHeight:!0}}),gm=T(fm,{width:"100%",height:"100%",maxHeight:"inherit",borderRadius:"inherit","& > div[style]":{display:"block !important"},variants:{asContainer:{true:{padding:"$1"}}}}),un=4,Ar=T(pm,{display:"flex",userSelect:"none",touchAction:"none",margin:"$0_5",background:"$scrollbarTrack",'&[data-orientation="vertical"]':{width:un},'&[data-orientation="horizontal"]':{flexDirection:"column",height:un},variants:{subtle:{true:{padding:"$0_5 0 $0_5 $0_5",margin:0,background:"transparent","&:hover":{background:"$scrollbarTrackHover"}}}},defaultVariants:{subtle:!0}}),Nr=T(mm,{flex:1,background:"$scrollbarThumb",borderRadius:un,position:"relative","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:8,minHeight:8}}),Cm=T(hm,{backgroundColor:"$scrollbarTrackHover"});function zn(e){const{fullHeight:t,subtle:n,css:r,asContainer:o,...s}=e;return i.jsxs(vm,{fullHeight:t,children:[i.jsx(gm,{css:r,asContainer:o,...s}),i.jsx(Ar,{orientation:"horizontal",subtle:n,children:i.jsx(Nr,{})}),i.jsx(Ar,{orientation:"vertical",subtle:n,children:i.jsx(Nr,{})}),i.jsx(Cm,{})]})}const Zn=T("span",{display:"flex",alignItems:"center","& > svg":{marginRight:"$1_5",width:"$4",height:"$4"}}),bm={context:{Root:cs,Group:kd,Sub:Hd,Portal:is,RadioGroup:T(Kd,$t),MenuLabel:T(Fd,Ot),MenuItem:T(Ud,Dt),Content:T(Ld,Re,nr),SubContent:T(Xd,Re,nr),SubMenuItem:T(Yd,jt),Separator:T(Vd,Lt),CheckboxItem:T(Gd,kt),RadioItem:T(Bd,Ft),ItemIndicator:T(Wd,Ut)},dropdown:{Root:oa,Group:Gu,RadioGroup:T(Vu,$t),Sub:zu,Portal:aa,MenuLabel:T(Ku,Ot),MenuItem:T(Bu,Dt),Content:T(Uu,Re,rr),SubContent:T(qu,Re,rr),SubMenuItem:T(Zu,jt),Separator:T(Xu,Lt),CheckboxItem:T(Wu,kt),RadioItem:T(Hu,Ft),ItemIndicator:T(Yu,Ut)},menubar:{Root:dc,Group:Bp,RadioGroup:T(Yp,$t),Sub:qp,Portal:pc,MenuLabel:T(Wp,Ot),MenuItem:T(Vp,Dt),Content:T(Kp,Re),SubContent:T(Qp,Re),SubMenuItem:T(Jp,jt),Separator:T(Zp,Lt),CheckboxItem:T(Hp,kt),RadioItem:T(Xp,Ft),ItemIndicator:T(zp,Ut)}};function Me(){const e=a.useContext(we),t=bm[e.type];if(!t)throw new Error(`Cannot resolve Primitive Component by type ${e.type}`);return t}const we=a.createContext({type:"dropdown",size:"sm"});we.displayName="MenuContext";const qn=function(t){return i.jsx(we.Provider,{value:{type:t.type,size:t.size},children:t.children})},Im=a.forwardRef(function(t,n){const{icon:r,name:o,shortcuts:s,label:u,disabled:c,onSelect:f,onClick:p,asChild:d,critical:l,children:m,...v}=t,{size:g}=a.useContext(we),{MenuItem:h}=Me();return i.jsx(h,{ref:n,disabled:c,onSelect:f,onClick:p,size:g,critical:l,asChild:d,...v,children:a.isValidElement(m)?m:i.jsxs(a.Fragment,{children:[i.jsxs(Zn,{children:[r,o]}),i.jsx(ai,{shortcuts:s})]})})}),Jn=a.forwardRef(function(t,n){const{Content:r}=Me(),{size:o}=a.useContext(we);return i.jsx(r,{size:o,ref:n,...t})});function Tm(e){const{name:t,icon:n,disabled:r,children:o}=e,{size:s}=a.useContext(we),{SubMenuItem:u,SubContent:c,Sub:f,Portal:p}=Me();return i.jsxs(f,{children:[i.jsxs(u,{size:s,disabled:r,children:[i.jsxs(Zn,{children:[n,t]}),i.jsx(Xc,{size:"12px"})]}),i.jsx(p,{children:i.jsx(c,{children:i.jsx(zn,{type:"always",subtle:!1,asContainer:!0,children:o})})})]})}function Am(e){const{Group:t,MenuLabel:n}=Me(),{label:r,divider:o,children:s,...u}=e,c=typeof o=="boolean"&&o?"bottom":o,f=c==="top"||c==="both",p=c==="bottom"||c==="both";return i.jsxs(pe.Fragment,{children:[f&&i.jsx($r,{}),i.jsxs(t,{...u,children:[r&&i.jsx(n,{children:r}),s]}),p&&i.jsx($r,{})]})}function Nm(e){const{name:t,icon:n,...r}=e,{size:o}=a.useContext(we),{CheckboxItem:s,ItemIndicator:u}=Me();return i.jsxs(s,{...r,size:o,children:[i.jsx(u,{children:i.jsx(zc,{})}),i.jsxs(Zn,{children:[n,t]})]})}const xm=T("div",{height:"$1",width:"$1",borderRadius:"$round",backgroundColor:"currentColor"});function Mm(e){const{value:t,onSelect:n,name:r}=e,{RadioItem:o,ItemIndicator:s}=Me();return i.jsxs(o,{value:t,onSelect:n,children:[i.jsx(s,{children:i.jsx(xm,{})}),r]})}function $m(e){const{items:t,label:n,...r}=e,{RadioGroup:o,MenuLabel:s}=Me(),{size:u}=a.useContext(we);return i.jsxs(o,{...r,size:u,children:[n&&i.jsx(s,{children:n}),t.map((c,f)=>i.jsx(Mm,{...c},f))]})}function $r(){const{Separator:e}=Me();return i.jsx(e,{})}function Om(e){const{children:t,portal:n=!0,size:r="sm",side:o,sideOffset:s=4,align:u="start",alignOffset:c,disabled:f=!1,...p}=e;let d=a.Fragment,l;n&&(d=aa,typeof n=="object"&&(l=n));const m=d===a.Fragment?{}:{container:l};return i.jsx(qn,{type:"dropdown",size:r,children:i.jsxs(oa,{modal:!1,...p,children:[i.jsx(Fu,{disabled:f,asChild:!0,children:e.trigger}),i.jsx(d,{...m,children:i.jsx(Jn,{side:o,sideOffset:s,align:u,alignOffset:c,children:i.jsx(zn,{type:"always",subtle:!1,asContainer:!0,children:t})})})]})})}function Dm(e){const{trigger:t,size:n="sm",children:r,onOpenChange:o,onPointerDownOutside:s,portal:u=!0,asChild:c,disabled:f=!1,hidden:p}=e;let d=a.Fragment,l;return u&&(d=is,typeof u=="object"&&(l=u)),i.jsx(qn,{type:"context",size:n,children:i.jsxs(cs,{onOpenChange:o,children:[i.jsx(jd,{disabled:f,asChild:c,children:t}),i.jsx(d,{container:l,children:i.jsx(Jn,{hidden:p,onPointerDownOutside:s,children:i.jsx(zn,{type:"always",subtle:!1,asContainer:!0,children:r})})})]})})}const wm=T(fc,{all:"unset",display:"flex",height:"$6",alignItems:"center",padding:"0 $2",fontSize:"$sm",outline:"none",cursor:"default",userSelect:"none",borderRadius:"$2","&:hover":{backgroundColor:"$grayA4",color:"$gray12"},"&:focus":{backgroundColor:"$grayA4",color:"$gray12"},"&[data-state=open]":{backgroundColor:"$grayA4",color:"$gray12"}}),Pc=pe.forwardRef((e,t)=>i.jsx(wm,{ref:t,...e}));Pc.displayName=fc.displayName;function jm(e){const{name:t}=e;return i.jsxs(Gp,{children:[i.jsx(Pc,{children:t}),i.jsx(pc,{children:i.jsx(Jn,{align:"start",alignOffset:-4,sideOffset:4,children:e.children})})]})}const Sm=T(dc,{display:"flex",height:"100%",alignItems:"center",padding:"0 $2",flexWrap:"nowrap"});function Lm(e){const{size:t="sm"}=e;return i.jsx(qn,{type:"menubar",size:t,children:i.jsx(Sm,{children:e.children})})}export{Dm as C,Om as D,sr as K,Im as M,Tm as S,Jc as a,Qc as b,ei as c,ai as d,Lm as e,jm as f,$r as g,Nm as h,$m as i,Am as j,zn as k};
@@ -1 +0,0 @@
1
- var E=Object.defineProperty;var U=(n,e,t)=>e in n?E(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>(U(n,typeof e!="symbol"?e+"":e,t),t);import{bW as v,bX as f,bt as g,ae as i,bY as u,aD as c,aV as b,O as y,bZ as T,j as m,e as x,n as C}from"./index-0a8702e2.js";import{a as V}from"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import"./postmen-45d4c238.js";import{F as d}from"./index-98982ce2.js";import{M}from"./MeshThumbnail-49273f71.js";import{A}from"./AssetViewer-bc198e16.js";import{e as N}from"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";class O{static createMesh(e,t){const s=new v(e);return O.setMeshData(s,t),s}static setMeshData(e,t){var s,r;return e.setPositions([...t.positions]),e.setNormals(t.normals),e.setUVs(t.uvs),t.uv1&&e.setUVs(t.uv1,1),t.uv2&&e.setUVs(t.uv2,2),t.uv3&&e.setUVs(t.uv3,3),t.uv4&&e.setUVs(t.uv4,4),t.uv5&&e.setUVs(t.uv5,5),t.uv6&&e.setUVs(t.uv6,6),t.uv7&&e.setUVs(t.uv7,7),t.bounds?(e.bounds.min.copyFrom(t.bounds.min),e.bounds.max.copyFrom(t.bounds.max)):O.calculateBounds(t.positions,e.bounds),(s=t.blendShapes)==null||s.forEach(o=>{const l=new f(o.name);o.frames.forEach(a=>{l.addFrame(a.weight,a.positions,a.normals,a.uvs)}),e.addBlendShape(l)}),(r=t.subMeshes)==null||r.forEach(o=>{e.addSubMesh(o)}),t.indices&&(t.positions.length<=65535?e.setIndices(new Uint16Array(t.indices)):e.setIndices(new Uint32Array(t.indices))),e.uploadData(!1),e}static calculateBounds(e,t){const{min:s,max:r}=t,o=e.length;s.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<o;l++){const a=e[l];s.x=Math.min(a.x,s.x),s.y=Math.min(a.y,s.y),s.z=Math.min(a.z,s.z),r.x=Math.max(a.x,r.x),r.y=Math.max(a.y,r.y),r.z=Math.max(a.z,r.z)}}}class R extends g{constructor(e,t){super(e),this.meshData=t}restoreContent(){O.setMeshData(this.resource,this.meshData)}}var p=(n=>(n.POSITION="Position",n.NORMAL="Normal",n.COLOR_0="Color",n.TANGENT="Tangent",n.WEIGHTS_0="BoneWeight",n.JOINTS_0="BoneIndex",n.TEXCOORD_0="UV",n.TEXCOORD_1="UV1",n.TEXCOORD_2="UV2",n.TEXCOORD_3="UV3",n.TEXCOORD_4="UV4",n.TEXCOORD_5="UV5",n.TEXCOORD_6="UV6",n.TEXCOORD_7="UV7",n))(p||{});const X=["POSITION","NORMAL","COLOR_0","TANGENT","WEIGHTS_0","JOINTS_0","TEXCOORD_0","TEXCOORD_1","TEXCOORD_2","TEXCOORD_3","TEXCOORD_4","TEXCOORD_5","TEXCOORD_6","TEXCOORD_7"],L={[i.Float]:"4 bytes",[i.Vector2]:"8 bytes",[i.Vector3]:"12 bytes",[i.Vector4]:"16 bytes",[i.Byte4]:"4 bytes",[i.UByte4]:"4 bytes",[i.NormalizedByte4]:"4 bytes",[i.NormalizedUByte4]:"4 bytes",[i.NormalizedShort2]:"4 bytes",[i.NormalizedShort4]:"8 bytes",[i.Short2]:"4 bytes",[i.UShort2]:"4 bytes",[i.NormalizedUShort2]:"4 bytes",[i.Short4]:"8 bytes",[i.UShort4]:"8 bytes",[i.NormalizedUShort4]:"8 bytes"};u.Triangles+"",u.TriangleStrip+"",u.TriangleFan+"",u.LineLoop+"",u.LineStrip+"",u.Lines+"",u.Points+"";function w(n){switch(n.topology){case u.Triangles:return`${n.count/3} triangles`;case u.TriangleFan:case u.TriangleStrip:return`${n.count-2} triangles`;case u.Lines:return`${n.count/2} lines`;case u.LineStrip:return`${n.count-1} lines`;case u.LineLoop:return`${n.count} lines`;case u.Points:return`${n.count} points`}}function I(n){if(n instanceof Uint8Array)return"Uint8";if(n instanceof Uint16Array)return"Uint16";if(n instanceof Uint32Array)return"Uint32"}const S=n=>{const e=n.asset.engineObject,t=e.vertexCount,s=e.getIndices(),r=e.subMeshes;return c.jsxs(c.Fragment,{children:[c.jsx(b,{title:`Vertices: ${t}`,defaultOpen:!0,children:X.map(o=>e.vertexElements.find(l=>l.semantic===o)).filter(o=>o!=null).map(o=>c.jsx(d,{label:p[o.attribute],value:`${i[o.format]} (${L[o.format]})`},o.attribute))}),s?c.jsx(b,{title:`Indices: ${s.length}`,defaultOpen:!0,children:c.jsx(d,{label:"Format",value:I(s)})}):null,c.jsx(b,{title:`SubMesh: ${r.length}`,defaultOpen:!0,children:r.map((o,l)=>c.jsx(d,{label:`# ${l}`,value:w(o)},l))})]})};class j extends A{setViewAsset(e,t){const s=t.createChild("mesh_entity"),r=s.addComponent(y);r.mesh=e.engineObject;const o=new T(e.engine);o.baseColor.set(.5,.5,.5,1),r.setMaterial(o),this._entity=s}}var B=Object.defineProperty,F=Object.getOwnPropertyDescriptor,z=(n,e,t,s)=>{for(var r=s>1?void 0:s?F(e,t):e,o=n.length-1,l;o>=0;o--)(l=n[o])&&(r=(s?l(e,t,r):l(r))||r);return s&&r&&B(e,t,r),r};let h=class extends m{constructor(e){super(e);_(this,"meshData",null)}beforeDelete(){return null}afterDelete(){return null}async initByMain(e){const{engine:t}=this,s=JSON.parse(await e.text());this.meshData=s;const r=new v(t);O.setMeshData(r,s),t.resourceManager.addContentRestorer(new R(r,s)),this.bindEngineObject(r),this._releaseMeshCache()}initByEngineObject(e){this.bindEngineObject(e),this._name=e.name,this.meshData={positions:[],subMeshes:[]}}_releaseMeshCache(){const e=this.engineObject;e._verticesUint8=null,e._indices=null,e._verticesFloat32=null,e._positions=null,e._tangents=null,e._normals=null,e._colors=null,e._uv=null,e._uv1=null,e._uv2=null,e._uv3=null,e._uv4=null,e._uv5=null,e._uv6=null,e._uv7=null}};h=z([V({type:"Mesh",label:x("asset.mesh.title"),icon:{},loaderType:"Mesh",extname:"mesh",customInspector:S,viewer:j,thumbnail:M,dragLayer:C.Mesh,async bundle({content:n}){const e=JSON.parse(await n.text()),t=N(e,{type:"Mesh",name:"mesh"});return{content:new Blob([t])}}})],h);export{h as MeshAsset};
@@ -1 +0,0 @@
1
- var c=Object.defineProperty;var f=(e,r,t)=>r in e?c(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var s=(e,r,t)=>(f(e,typeof r!="symbol"?r+"":r,t),t);import{p as n,C as d,s as p,f as u,w as v,E as b,v as y,u as P,J as w}from"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./AssetPreviewer-24e31d97.js";var M=Object.defineProperty,O=Object.getOwnPropertyDescriptor,i=(e,r,t,l)=>{for(var a=l>1?void 0:l?O(r,t):r,h=e.length-1,m;h>=0;h--)(m=e[h])&&(a=(l?m(r,t,a):m(a))||a);return l&&a&&M(r,t,a),a};class o extends b{constructor(){super(...arguments);s(this,"mesh",null);s(this,"material",{refId:"0000200"});s(this,"receiveShadows",!0);s(this,"castShadows",!0);s(this,"priority",0);s(this,"materialOpen",!1)}setMaterialOpen(t){this.materialOpen=t}}i([n({type:d.AssetPicker,assetType:["Mesh"],label:"mesh-renderer.mesh.title",info:"mesh-renderer.mesh.info",bindPath:"mesh"}),p()],o.prototype,"mesh",2);i([n({type:d.AssetPicker,assetType:"Material",label:"mesh-renderer.material.title",info:"mesh-renderer.material.info",customFilter:e=>{var r;return((r=e.engineObject.shader)==null?void 0:r.name)!=="particle-shader"}}),u({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:v.ReferResource,getEngineValue:e=>e.getMaterial()}),p({type:"methods",key:"setMaterial",onSerialize:e=>e?[[e]]:void 0,onDeserialize(e){return e?e[0][0]:void 0}})],o.prototype,"material",2);i([n({label:"mesh-renderer.receive-shadows.title",info:"mesh-renderer.receive-shadows.info",bindPath:"receiveShadows"}),y(),p()],o.prototype,"receiveShadows",2);i([n({label:"mesh-renderer.cast-shadows.title",info:"mesh-renderer.cast-shadows.info",bindPath:"castShadows"}),y(),p()],o.prototype,"castShadows",2);i([n({label:"mesh-renderer.priority.title",info:"mesh-renderer.priority.info",bindPath:"priority"}),p()],o.prototype,"priority",2);i([P],o.prototype,"materialOpen",2);i([w],o.prototype,"setMaterialOpen",1);export{o as M};
@@ -1 +0,0 @@
1
- import{u as l}from"./InstanceEditorAsset-a70e73fe.js";import{aT as f,aJ as i,aD as m,aY as h,p as d}from"./index-0a8702e2.js";import"./AssetPreviewer-24e31d97.js";import{c as u}from"./Component-f923abb1.js";import{c as M}from"./createOnModelChange-b57a0da8.js";import{R}from"./ReferencedMaterial-a87818f3.js";import{M as v}from"./MeshRendererBaseComponent-3a0e09ed.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./MaterialInspector-aec1248b.js";import"./IconPointFilled-a304fd34.js";const x=f(function(o){const[r,s]=i.useState(null),e=o.data,{assetStore:t,inspectorFacade:n}=l();return i.useEffect(()=>{t.getAssetByRef(e.material).then(a=>{s(a)})},[e.material]),m.jsxs(m.Fragment,{children:[m.jsx(h.List,{model:e,configs:e.formSchema.items,onModelChange:M("component",e.id,n,e)}),r&&m.jsx(R,{materialAsset:r})]})});var C=Object.defineProperty,j=Object.getOwnPropertyDescriptor,c=(o,r,s,e)=>{for(var t=e>1?void 0:e?j(r,s):r,n=o.length-1,a;n>=0;n--)(a=o[n])&&(t=(e?a(r,s,t):a(t))||t);return e&&t&&C(r,s,t),t};let p=class extends v{constructor(o,r){super(o,r)}};c([d({assetType:["PrimitiveMesh","Mesh"]})],p.prototype,"mesh",2);p=c([u({type:"MeshRenderer",customInspector:x,componentsMenu:{label:"component.renderer.mesh.title"}})],p);export{p as MeshRendererComponent};
@@ -1,21 +0,0 @@
1
- var Wt=Object.defineProperty;var Jt=(a,e,t)=>e in a?Wt(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var S=(a,e,t)=>(Jt(a,typeof e!="symbol"?e+"":e,t),t);import{aC as _e,bH as Oe,aD as p,aE as ve,bx as we,cn as ye,b5 as Et,b6 as Tt,co as se,cm as ie,eR as Pe,aT as Y,aJ as X,aY as Ut,aH as Qt,f0 as ea,aK as jt,aG as ta,ct as aa,aU as $,b9 as ra,cH as ee,b8 as nt,f1 as Ce,f2 as ue,bz as oa,cK as _,f3 as na,b$ as Lt,f4 as sa,f5 as ia,f6 as la,f7 as ca,f8 as pa,f9 as q,fa as ua,fb as ma,fc as da,fd as me,cF as ha,ck as Ee,cl as Te,bT as be,cq as xt,x as St,cr as Mt,eX as fa,E as ya,C as A,fe as H,ff as F,fg as fe,e as n,u as U,f as R,w as ba,p as z,s as O}from"./index-0a8702e2.js";import{u as _t}from"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import{c as va}from"./Component-f923abb1.js";import"./postmen-45d4c238.js";import{c as ga}from"./createOnModelChange-b57a0da8.js";import{R as xa}from"./ReferencedMaterial-a87818f3.js";import"./TextureAsset-28fedf2a.js";import"./GlTFAsset-9c68f862.js";import"./MaterialAsset-74a15124.js";import{MeshAsset as Sa}from"./MeshAsset-73e2cc8e.js";import"./AnimatorControllerAsset-b7424e9c.js";import"./AnimationClipAsset-01f3deb6.js";import"./SpriteAsset-9a31ec24.js";import"./SpriteAtlasAsset-a862db46.js";import"./AmbientLightAsset-f70b95f1.js";import"./LottieAsset-377c1419.js";import"./ShaderChunkAsset-83f923f4.js";import"./SpineSkeletonDataAsset-b64a3ee3.js";import"./FontAsset-abfb9a8a.js";import"./SceneAsset-8917c210.js";import"./ShaderAsset-cb3ff628.js";import"./PrimitiveMesh-3ce6fa2f.js";import"./XRReferenceImageAsset-6a6adb3b.js";import"./PrefabAsset-1a7edfbd.js";import"./PhysicsMaterialAsset-a5ac9f82.js";import"./RenderTargetAsset-33c0d9e7.js";import"./AudioAsset-eae03324.js";import"./index-59732f86.js";import"./MarkdownAsset-7ea387a9.js";import{n as Ma}from"./index-be6bc38a.js";import{B as et}from"./index-37c74ae9.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./MaterialInspector-aec1248b.js";import"./IconPointFilled-a304fd34.js";import"./enum-58295f88.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-33f770ba.js";import"./AssetViewer-bc198e16.js";import"./ktx2-encoder-1e63c1eb.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./glTFIO-45ff9a17.js";import"./ProxyConfigs-4de3304c.js";import"./index-98982ce2.js";import"./MeshThumbnail-49273f71.js";import"./bundlers-9b0d37fc.js";import"./assetEditorActions-c4e5962f.js";import"./module-6406b050.js";import"./module-107b7430.js";import"./FormItemArray-66be8701.js";import"./Accordion-4897319b.js";import"./utilities-e09052e3.js";import"./ShaderUIScriptAsset-d13fa4e2.js";import"./module-5c85b07e.js";import"./Menu-cd3be298.js";/**
2
- * @license @tabler/icons-react v3.24.0 - MIT
3
- *
4
- * This source code is licensed under the MIT license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */var At=_e("outline","ease-in","IconEaseIn",[["path",{d:"M3 20c8 0 18 -16 18 -16",key:"svg-0"}]]);/**
7
- * @license @tabler/icons-react v3.24.0 - MIT
8
- *
9
- * This source code is licensed under the MIT license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */var Rt=_e("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
12
- * @license @tabler/icons-react v3.24.0 - MIT
13
- *
14
- * This source code is licensed under the MIT license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */var Vt=_e("outline","plus-minus","IconPlusMinus",[["path",{d:"M4 7h6",key:"svg-0"}],["path",{d:"M7 4v6",key:"svg-1"}],["path",{d:"M20 18h-6",key:"svg-2"}],["path",{d:"M5 19l14 -14",key:"svg-3"}]]);/**
17
- * @license @tabler/icons-react v3.24.0 - MIT
18
- *
19
- * This source code is licensed under the MIT license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */var kt=_e("outline","vector-bezier-2","IconVectorBezier2",[["path",{d:"M3 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M17 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M7 5l7 0",key:"svg-2"}],["path",{d:"M10 19l7 0",key:"svg-3"}],["path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}],["path",{d:"M7 5.5a5 6.5 0 0 1 5 6.5a5 6.5 0 0 0 5 6.5",key:"svg-6"}]]);const Pt=[{type:"constant",icon:p.jsx(Rt,{size:"14px"}),columns:"1fr 32px"},{type:"gradient",icon:p.jsx(At,{size:"14px"}),columns:"1fr 32px"},{type:"two-constant",icon:p.jsx(Vt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-gradient",icon:p.jsx(kt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function Pa(a){return a.map(e=>{const{type:t,value:r}=e;return t==="constant"?{type:t,label:e.label,value:se(r)}:t==="two-constant"?{type:t,label:e.label,value:[se(r[0]),se(r[1])]}:t==="gradient"?{type:t,label:e.label,value:{color:r.color.map(o=>({value:se(o.value),time:o.position})),alpha:r.alpha.map(o=>({value:o.value.a,time:o.position}))}}:t==="two-gradient"?{type:t,label:e.label,value:[{color:r[0].color.map(o=>({value:se(o.value),time:o.position})),alpha:r[0].alpha.map(o=>({value:o.value.a,time:o.position}))},{color:r[1].color.map(o=>({value:se(o.value),time:o.position})),alpha:r[1].alpha.map(o=>({value:o.value.a,time:o.position}))}]}:e})}function Ca(a){return a.map(e=>{const{type:t,value:r}=e;return t==="constant"?{type:t,label:e.label,value:ie(r)}:t==="two-constant"?{type:t,label:e.label,value:[ie(r[0]),ie(r[1])]}:t==="gradient"?{type:t,label:e.label,value:{color:r.color.map(o=>({value:ie(o.value),position:o.time})),alpha:r.alpha.map(o=>({value:{r:255,g:255,b:255,a:o.value},position:o.time}))}}:t==="two-gradient"?{type:t,label:e.label,value:[{color:r[0].color.map(o=>({value:ie(o.value),position:o.time})),alpha:r[0].alpha.map(o=>({value:{r:255,g:255,b:255,a:o.value},position:o.time}))},{color:r[1].color.map(o=>({value:ie(o.value),position:o.time})),alpha:r[1].alpha.map(o=>({value:{r:255,g:255,b:255,a:o.value},position:o.time}))}]}:e})}function tt({hdr:a,value:e,onValueChange:t,...r}){return a?p.jsx(ye,{...r,mode:"hdr",value:e,onValueChange:t}):p.jsx(ye,{...r,mode:"constant",value:e,onValueChange:t})}function Bt(a){var h;const{label:e,labelFirst:t,info:r,value:o,hdr:i=!1}=a,[y,u]=Oe({prop:Ca(o),onChange:s=>{a.onValueChange&&a.onValueChange(Pa(s),P)}}),[P,g]=Oe({prop:a.type,defaultProp:"constant",onChange:s=>{a.onValueChange&&a.onValueChange(o,s)}});function d(s,v){var f;return v==="trigger"?(f=Pt.find(m=>m.type===s))==null?void 0:f.icon:s}const b=s=>{u(v=>v.map(f=>f.type!==P?f:{...f,value:s}))},C=s=>v=>{u(f=>f.map(m=>{if(m.type!==P)return m;const{value:T}=m;if(m.type==="two-constant"){if(s===0)return{...m,value:[v,T[1]]};if(s===1)return{...m,value:[T[0],v]}}return m}))},l=s=>{u(v=>v.map(f=>f.type!==P?f:f.type==="gradient"?{...f,value:s}:f))},c=s=>v=>{u(f=>f.map(m=>{if(m.type!==P)return m;if(m.type==="two-gradient"){const{value:T}=m;if(s===0)return{...m,value:[v,T[1]]};if(s===1)return{...m,value:[T[0],v]}}return m}))};return p.jsxs(ve,{label:e,info:r,fieldCss:{gridTemplateColumns:(h=Pt.find(s=>s.type===P))==null?void 0:h.columns},children:[y.map(s=>{const{type:v,value:f}=s;if(!v||P!==v)return null;switch(v){case"constant":return p.jsx(tt,{fullsize:!0,hdr:i,value:f,onValueChange:b},"constant");case"gradient":return p.jsx(ye,{fullsize:!0,mode:"particle",value:f,onValueChange:l},"gradient");case"two-constant":return p.jsxs(we.Fragment,{children:[p.jsx(tt,{fullsize:!0,hdr:i,value:f[0],onValueChange:C(0)}),p.jsx(tt,{fullsize:!0,hdr:i,value:f[1],onValueChange:C(1)})]},"two-constant");case"two-gradient":return p.jsxs(we.Fragment,{children:[p.jsx(ye,{fullsize:!0,mode:"particle",value:f[0],onValueChange:c(0)}),p.jsx(ye,{fullsize:!0,mode:"particle",value:f[1],onValueChange:c(1)})]},"two-gradient");default:return null}}),p.jsx(Et,{defaultValue:"constant",position:"item-aligned",cornerArrow:!0,value:P,valueRenderer:d,onValueChange:s=>g(s),children:y.map(s=>p.jsx(Tt,{value:s.type,children:s.label||s.type},s.type))})]})}const Dt=[{type:"constant",icon:p.jsx(Rt,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"curve",icon:p.jsx(At,{size:"14px"}),columns:"minmax(0, 12fr) 32px"},{type:"two-constant",icon:p.jsx(Vt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"},{type:"two-curve",icon:p.jsx(kt,{size:"14px"}),columns:"repeat(2, minmax(0, 12fr)) 32px"}];function za(a,e){var t;return e==="trigger"?(t=Dt.find(r=>r.type===a))==null?void 0:t.icon:a}const at=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function je(a){var E;const{label:e,info:t,value:r,onValueChange:o,algo:i="bezier",yRangeMode:y,yTickScale:u,yTickScaleMin:P,yTickScaleMax:g,onYTickScaleChange:d,onYTickScaleCommit:b,hideTypeSelector:C,...l}=a,[c,h]=Oe({prop:a.type,defaultProp:"constant",onChange:w=>{o&&o(r,w)}}),[s,v]=Oe({prop:r,onChange:w=>{o&&o(w,c)},defaultProp:[{value:0,type:"constant"},{value:at,type:"curve"},{value:[0,0],type:"two-constant"},{value:[at,at],type:"two-curve"}]}),f=w=>{v(V=>V.map(j=>j.type!==c?j:{...j,value:w}))},m=w=>V=>{v(j=>j.map(k=>{if(k.type!==c)return k;const{value:Z}=k;return w===0?{...k,value:[V,Z[1]]}:w===1?{...k,value:[Z[0],V]}:k}))},T=w=>{v(V=>V.map(j=>j.type!==c?j:{...j,value:w}))},L=w=>V=>{v(j=>j.map(k=>{if(k.type!==c)return k;const{value:Z}=k;return w===0?{...k,value:[V,Z[1]]}:w===1?{...k,value:[Z[0],V]}:k}))},I={algo:i,yRangeMode:y,yTickScale:u,yTickScaleMin:P,yTickScaleMax:g,onYTickScaleChange:d,onYTickScaleCommit:b};return p.jsxs(ve,{label:e,info:t,fieldCss:{gridTemplateColumns:(E=Dt.find(w=>w.type===c))==null?void 0:E.columns,columnGap:"$1"},...l,children:[s.map(w=>{const{type:V,value:j,min:k,max:Z,step:J}=w;if(!V||c!==V)return null;switch(V){case"constant":return p.jsx(Pe,{min:k,max:Z,dragStep:J,step:J,value:j,onValueChange:f},"constant");case"curve":return p.jsx(et,{...I,value:j,onChange:T},"curve");case"two-constant":return p.jsxs(we.Fragment,{children:[p.jsx(Pe,{size:"sm",startSlot:"min",value:j[0],min:k,max:Z,dragStep:J,step:J,onValueChange:m(0)}),p.jsx(Pe,{size:"sm",startSlot:"max",value:j[1],min:k,max:Z,dragStep:J,step:J,onValueChange:m(1)})]},"two-constant");case"two-curve":return p.jsxs(we.Fragment,{children:[p.jsx(et,{...I,value:j[0],onChange:L(0)}),p.jsx(et,{...I,value:j[1],onChange:L(1)})]},"two-curve");default:return null}}),!C&&p.jsx(Et,{value:c,position:"item-aligned",cornerArrow:!0,valueRenderer:za,onValueChange:w=>h(w),children:s.map(w=>p.jsx(Tt,{value:w.type,children:w.label||w.type},w.type))})]})}const Oa=Y(function(a){const[e,t]=X.useState(null),r=a.data,{assetStore:o,inspectorFacade:i}=_t();return X.useEffect(()=>{o.getAssetByRef(r.material).then(y=>{t(y)})},[r.material]),p.jsxs(p.Fragment,{children:[p.jsx(Ut.List,{model:r,configs:r.formSchema.items,onModelChange:ga("component",r.id,i,r)}),e&&p.jsx(xa,{materialAsset:e})]})});Qt(ea,{height:"6px",width:"6px",transform:"rotate(-90deg)",variants:{open:{true:{transform:"rotate(0)"}}}});const wa=function(e){const{title:t,controlOpenKey:r,onCheckedChange:o,model:i}=e;return p.jsxs(jt,{align:"v",gap:"xs",css:{borderTop:"1px solid $gray4",paddingTop:"$1_5"},justifyContent:"between",children:[p.jsx(ta,{size:"sm",muted:!0,children:t}),p.jsx(aa,{checked:i[r],onCheckedChange:o})]})},Ea=Y(wa);async function Ta(a,e){await a.assetStore.getAssetByRef(e)}function ja(a,e,t,r){a.inspectorFacade.componentChange(e,t,r)}var B=(a=>(a.BoxShape="BoxShape",a.CircleShape="CircleShape",a.ConeShape="ConeShape",a.HemisphereShape="HemisphereShape",a.SphereShape="SphereShape",a.MeshShape="MeshShape",a))(B||{});function W(a,e){return{class:a.class,props:{...a.props,...e}}}const La=Y(({item:a,onModelChange:e})=>{const{t}=$();return p.jsx(p.Fragment,{children:p.jsx(ra,{label:t("effects.shape.size"),value:{x:a.props.size.x,y:a.props.size.y,z:a.props.size.z},onChange:(r,o)=>{const i=W(a,{size:{...a.props.size,[o]:r[o]}});e==null||e("shape",i)}})})}),_a=Y(({item:a,onModelChange:e})=>{const{t}=$();return p.jsxs(p.Fragment,{children:[p.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const o=W(a,{radius:r});e==null||e("shape",o)}}),p.jsx(ee,{label:t("effects.shape.arc"),min:0,max:360,value:a.props.arc,onChange:r=>{const o=W(a,{arc:r});e==null||e("shape",o)}}),p.jsx(nt,{label:t("effects.shape.arc-mode.label"),options:[{label:t("effects.shape.loop"),value:Ce.Loop},{label:t("effects.shape.random"),value:Ce.Random}],value:a.props.arcMode,onChange:r=>{const o=W(a,{arcMode:r});e==null||e("shape",o)}}),a.props.arcMode===Ce.Loop?p.jsx(ee,{label:t("effects.shape.arc-speed.label"),step:.1,dragStep:.1,value:a.props.arcSpeed,onChange:r=>{const o=W(a,{arcSpeed:r});e==null||e("shape",o)}}):null]})}),Aa=Y(({item:a,onModelChange:e})=>{const{t}=$();return p.jsxs(p.Fragment,{children:[p.jsx(nt,{label:t("effects.shape.emit-type.label"),options:[{label:t("effects.shape.cone-base"),value:ue.Base},{label:t("effects.shape.volume"),value:ue.Volume}],value:a.props.emitType,onChange:r=>{const o=W(a,{emitType:r});e==null||e("shape",o)}}),p.jsx(ee,{label:t("effects.shape.angle"),min:1e-4,max:90,step:.05,dragStep:.05,value:a.props.angle,onChange:r=>{const o=W(a,{angle:r});e==null||e("shape",o)}}),p.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const o=W(a,{radius:r});e==null||e("shape",o)}}),p.jsx(ee,{label:t("effects.shape.length"),min:1e-4,step:.1,dragStep:.1,value:a.props.length,disabled:a.props.emitType===ue.Base,onChange:r=>{const o=W(a,{length:r});e==null||e("shape",o)}})]})}),Ra=Y(({item:a,onModelChange:e})=>{const{t}=$();return p.jsx(p.Fragment,{children:p.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const o=W(a,{radius:r});e==null||e("shape",o)}})})}),Va=Y(({item:a,onModelChange:e})=>{const{t}=$();return p.jsx(p.Fragment,{children:p.jsx(ee,{label:t("effects.shape.radius"),min:1e-4,step:.05,dragStep:.05,value:a.props.radius,onChange:r=>{const o=W(a,{radius:r});e==null||e("shape",o)}})})}),ka=Y(({item:a,onModelChange:e})=>{const{t}=$(),{assetStore:r}=_t(),o=Object.values(r.assets).filter(u=>u instanceof Sa),[i,y]=X.useState("");return X.useEffect(()=>{let u=!1;return(async()=>{if(!a.props.mesh){y("");return}try{const g=await r.getAssetByRef(a.props.mesh);u||y((g==null?void 0:g.name)??"")}catch{u||y("")}})(),()=>{u=!0}},[r,a.props.mesh]),p.jsx(oa,{label:t("effects.renderer.render-mode.options.mesh"),assets:o,dropLayer:0,value:i,onSelect:async u=>{y(u.name);const P=!!u.engineObject;P||Ma.error("Mesh asset is not initialized");const g={class:a.class,props:{...a.props,mesh:u.getCurrentRef(),enabled:P}};e==null||e("shape",g)}})}),Ba=Y(({item:a,onModelChange:e})=>{const{t}=$();return p.jsx(ee,{label:t("effects.shape.random-direction-amount"),info:t("effects.shape.random-direction-amount-tip"),min:0,step:1,dragStep:.05,value:a.props.randomDirectionAmount||0,onChange:r=>{const o=W(a,{randomDirectionAmount:r});e==null||e("shape",o)}})}),ot=new Map;function Da(a,e){let t;switch(e.class){case B.BoxShape:{t=new pa;const r=t.size;r.copyFrom(e.props.size),t.size=r;break}case B.CircleShape:{t=new ca,t.radius=e.props.radius,t.arc=e.props.arc,t.arcMode=e.props.arcMode,t.arcSpeed=e.props.arcSpeed;break}case B.ConeShape:{t=new la,t.angle=e.props.angle,t.radius=e.props.radius,t.length=e.props.length,t.emitType=e.props.emitType;break}case B.HemisphereShape:{t=new ia,t.radius=e.props.radius;break}case B.SphereShape:{t=new sa,t.radius=e.props.radius;break}case B.MeshShape:{t=new na;const r=e.props.mesh;if(r!=null&&r.refId){const o=a.root.assetStore.assets[r.refId];t.mesh=o==null?void 0:o.engineObject}t.mesh||(t.mesh=Lt.createSphere(a.engineObject.engine));break}}return t&&(e.props.randomDirectionAmount=e.props.randomDirectionAmount??0,t.randomDirectionAmount=e.props.randomDirectionAmount,t.enabled=e.props.enabled),t}const Ia=(a,e,t)=>{let r=ot.get(`${a.id}-${t.class}`);r&&(r=JSON.parse(r),ot.delete(`${a.id}-${t.class}`),Object.assign(t.props,r));const o=Da(a,t);o&&a.applyEmissionShape(o)},Fa={BoxShape:La,CircleShape:_a,ConeShape:Aa,HemisphereShape:Ra,SphereShape:Va,MeshShape:ka},Ya={BoxShape:{class:B.BoxShape,props:{size:{x:1,y:1,z:1},randomDirectionAmount:0,enabled:!0}},CircleShape:{class:B.CircleShape,props:{radius:1,arc:360,arcMode:Ce.Random,arcSpeed:1,randomDirectionAmount:0,enabled:!0}},ConeShape:{class:B.ConeShape,props:{angle:25,radius:1,length:5,emitType:ue.Base,randomDirectionAmount:0,enabled:!0}},HemisphereShape:{class:B.HemisphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0}},SphereShape:{class:B.SphereShape,props:{radius:1,randomDirectionAmount:0,enabled:!0}},MeshShape:{class:B.MeshShape,props:{randomDirectionAmount:0,enabled:!0,mesh:void 0}}},Za=Y(({model:a,onModelChange:e})=>{const{t}=$(),r=a.shape;if(!r.class)return;const o=Fa[r.class];return p.jsxs(p.Fragment,{children:[p.jsx(nt,{label:t("effects.shape.type.label"),info:t("effects.shape.type.info"),value:r.class,options:[{label:t("effects.shape.options.box"),value:B.BoxShape},{label:t("effects.shape.options.circle"),value:B.CircleShape},{label:t("effects.shape.options.cone"),value:B.ConeShape},{label:t("effects.shape.options.hemisphere"),value:B.HemisphereShape},{label:t("effects.shape.options.sphere"),value:B.SphereShape},{label:t("effects.shape.options.mesh"),value:B.MeshShape}],onChange:i=>{const y=Ya[i];if(a.shape&&a.shape.class!==i&&ot.set(`${a.id}-${a.shape.class}`,JSON.stringify(a.shape.props)),y.class!==r.class){const u=_(y);e==null||e("shape",u)}}}),p.jsx(o,{item:r,component:a.engineObject,onModelChange:e}),p.jsx(Ba,{item:r,component:a.engineObject,onModelChange:e})]})}),st=["constant","two-constant","curve","two-curve"],te=[{x:0,y:0},{x:.25,y:.25},{x:.75,y:.75},{x:1,y:1}];function Le(a){return a.map(e=>({x:e.constructParams[0],y:e.constructParams[1]}))}const Ct={class:"ParticleCurve",constructParams:[{class:"CurveKey",constructParams:[0,0]},{class:"CurveKey",constructParams:[.25,.25]},{class:"CurveKey",constructParams:[.75,.75]},{class:"CurveKey",constructParams:[1,1]}]};function D(a,e=0,t=0,r=q.Constant){return{module:a,mode:r,constantMin:t,constantMax:e,curveMax:_(Ct),curveMin:_(Ct)}}function le(a,e=0,t=0,r=q.Constant){return{enabled:!1,x:D(a,e,t,r),y:D(a,e,t,r),z:D(a,e,t,r)}}const Xa={class:"Burst",constructParams:[0,{class:"ParticleCompositeCurve",constructParams:[15],props:{mode:q.Constant,constantMax:15,constantMin:0}}]},qa=Y(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=$(),{label:o,info:i}=e,y=a.bursts,u=l=>{const c=_(y);l(c),t==null||t("bursts",c)},P=(l,c)=>{u(h=>{const s=h[l];s&&c(s)})},g=l=>{const c=y.indexOf(l);c!==-1&&u(h=>{h.splice(c,1)})},d=()=>{u(l=>{l.push(_(Xa))})},b=[{title:r("effects.burst.time.label")},{title:r("effects.burst.count.label")}],C=(l,c)=>{const h=Math.max(1,l.constructParams[1].props.constantMax??0,l.constructParams[1].props.constantMin??0);return{data:l,cells:[p.jsx(ve,{children:p.jsx(Pe,{min:0,max:a.duration,step:.05,dragStep:.05,value:l.constructParams[0],onValueChange:s=>{P(c,v=>{v.constructParams[0]=s})}})},`time-${c}`),p.jsx(je,{type:st[l.constructParams[1].props.mode],direction:"column",algo:"bezier",yRangeMode:"positive",yTickScale:h,yTickScaleMin:0,yTickScaleMax:h,onYTickScaleChange:()=>{},onYTickScaleCommit:()=>{},value:[{value:l.constructParams[1].props.constantMax,type:"constant",min:0,step:1},{value:[l.constructParams[1].props.constantMin,l.constructParams[1].props.constantMax],type:"two-constant",min:0,step:1}],onValueChange:(s,v)=>{const f=s.find(m=>m.type===v);f&&P(c,m=>{switch(v){case"constant":{m.constructParams[1].props.mode=q.Constant,m.constructParams[1].props.constantMax=f.value;break}case"two-constant":{m.constructParams[1].props.mode=q.TwoConstants,m.constructParams[1].props.constantMin=f.value[0],m.constructParams[1].props.constantMax=f.value[1];break}}})}},`count-${c}`)]}};return p.jsx(ua,{columns:b,items:y.map((l,c)=>C(l,c)),label:r(o),info:r(i),addable:!0,onAdd:d,onDelete:g,addText:r("effects.burst.add"),emptyText:r("effects.burst.empty","No bursts")})}),$a=(a,e,t)=>{const r=a.engineObject.generator.emission,o=r.bursts;for(let i=o.length-1;i>=0;i--)r.removeBurst(o[i]);for(let i=0;i<t.length;i++){const y=t[i];if(!y||!y.constructParams||!Array.isArray(y.constructParams)||y.constructParams.length<2){console.warn(`Invalid burst item at index ${i}:`,y);continue}const u=y.constructParams[0],P=y.constructParams[1];if(!P||!P.props){console.warn(`Invalid burst count data at index ${i}:`,P);continue}const g=P.props,d=new ma(g.constantMax);d.mode=g.mode,d.constantMin=g.constantMin,d.constantMax=g.constantMax,d.constant=g.constantMax,r.addBurst(new da(u,d))}};function zt(a="colorOverLifetime"){return{module:a,mode:me.Gradient,gradientMax:{class:"ParticleGradient",constructParams:[[{color:{r:1,g:1,b:1,a:1},time:0},{color:{r:1,g:1,b:1,a:1},time:.3},{color:{r:1,g:1,b:1,a:1},time:.6},{color:{r:1,g:1,b:1,a:1},time:1}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]},gradientMin:{class:"ParticleGradient",constructParams:[[{time:0,color:{r:1,g:1,b:1,a:1}},{time:.3,color:{r:1,g:1,b:1,a:1}},{time:.6,color:{r:1,g:1,b:1,a:1}},{time:1,color:{r:1,g:1,b:1,a:1}}],[{time:0,alpha:0},{time:.25,alpha:.25},{time:.5,alpha:.5},{time:1,alpha:1}]]}}}const Me=["x","y","z"],Ka={constant:q.Constant,"two-constant":q.TwoConstants,curve:q.Curve,"two-curve":q.TwoCurves},de=Y(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=$(),o=e.property,{mainAxis:i}=e,y=a[o],[u,P]=X.useState({x:{max:te,min:te},y:{max:te,min:te},z:{max:te,min:te}}),[g,d]=X.useState(e.yTickScale??1),b=st[y.x.mode];function C(s){return(v,f)=>{const m=v.find(E=>E.type===f);if(!m)return;const T=_(y),L=T[s],I=Ka[f];for(const E of Me)T[E].mode=I;switch(f){case"constant":L.constantMax=m.value;break;case"two-constant":L.constantMin=m.value[0],L.constantMax=m.value[1];break;case"curve":{if(m.value.length>4)return;P(E=>({...E,[s]:{...E[s],max:m.value}})),m.value.forEach((E,w)=>{L.curveMax.constructParams[w].constructParams[0]=E.x,L.curveMax.constructParams[w].constructParams[1]=E.y*g});break}case"two-curve":{if(m.value[0].length>4||m.value[1].length>4)return;P(E=>({...E,[s]:{min:m.value[0],max:m.value[1]}})),m.value[0].forEach((E,w)=>{L.curveMin.constructParams[w].constructParams[0]=E.x,L.curveMin.constructParams[w].constructParams[1]=E.y*g}),m.value[1].forEach((E,w)=>{L.curveMax.constructParams[w].constructParams[0]=E.x,L.curveMax.constructParams[w].constructParams[1]=E.y*g});break}}a[o]=T,t==null||t(o,T)}}function l(s){return[{value:y[s].constantMax,type:"constant",label:r("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[y[s].constantMin,y[s].constantMax],type:"two-constant",label:r("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:u[s].max,type:"curve",label:r("effects.curve.curve")},{value:[u[s].min,u[s].max],type:"two-curve",label:r("effects.curve.two-curve")}]}const c=s=>{const v=s/g,f=_(y);for(const m of Me){const T=f[m];T.curveMax.constructParams.forEach(L=>{L.constructParams[1]*=v}),T.curveMin.constructParams.forEach(L=>{L.constructParams[1]*=v})}d(s),a[o]=f,t==null||t(o,f)},h={algo:"linear",yRangeMode:e.yRangeMode,yTickScale:g,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:c,onYTickScaleCommit:()=>{}};return X.useEffect(()=>{const s={};for(const v of Me)s[v]={max:Le(y[v].curveMax.constructParams).map(f=>({...f,y:f.y/g})),min:Le(y[v].curveMin.constructParams).map(f=>({...f,y:f.y/g}))};P(s)},[]),p.jsxs(p.Fragment,{children:[p.jsx(ha,{label:e.toggleLabel?r(e.toggleLabel):r("effects.curve.3d-prefix")+" "+r(e.label||o),info:r(e.info),value:y.enabled,onChange:s=>{const v=_(y);v.enabled=s,a[o]=v,t==null||t(o,v)}}),y.enabled?p.jsx(ve,{label:"",children:p.jsx(jt,{direction:"column",gap:"xxs",children:Me.map((s,v)=>p.jsx(je,{label:r(s).toLocaleUpperCase(),type:b,css:{gridTemplateColumns:"$4 repeat(3, minmax(0px, 1fr))"},...h,value:l(s),hideTypeSelector:v!==0,onValueChange:C(s)},s))})}):p.jsx(je,{label:r(e.label||o),type:b,...h,value:l(i),onValueChange:C(i)})]})}),he=a=>(e,t,r)=>{var y,u;const o=(u=(y=e.engineObject)==null?void 0:y.generator)==null?void 0:u[r.x.module];if(!o){console.warn(`Module container not found for: ${r.x.module}`);return}o[a]=r.enabled;const i={x:o[t+"X"],y:o[t+"Y"],z:o[t+"Z"]};for(const P in i){const g=r[P],d=i[P];if(!d){console.warn(`Axis module not found for: ${P} in ${t}`);continue}d.mode=g.mode,d.constantMax=g.constantMax,d.constantMin=g.constantMin,d.curveMax=new Ee,g.curveMax.constructParams.forEach(b=>{const C=b.constructParams[0],l=b.constructParams[1];d.curveMax.addKey(new Te(C,l))}),d.curveMin=new Ee,g.curveMin.constructParams.forEach(b=>{const C=b.constructParams[0],l=b.constructParams[1];d.curveMin.addKey(new Te(C,l))})}},K=Y(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=$(),o=e.property,i=a[o],[y,u]=X.useState(te),[P,g]=X.useState(te),[d,b]=X.useState(e.yTickScale??1);X.useEffect(()=>{const l=Le(i.curveMax.constructParams),c=Le(i.curveMin.constructParams);u(l),g(c)},[]);const C=(l,c)=>{const h=l.find(v=>v.type===c);if(!h)return;const s=_(i);switch(c){case"constant":s.mode=q.Constant,s.constantMax=h.value;break;case"two-constant":s.mode=q.TwoConstants,s.constantMin=h.value[0],s.constantMax=h.value[1];break;case"curve":{if(h.value.length>4)return;u(h.value),s.mode=q.Curve,h.value.forEach((v,f)=>{s.curveMax.constructParams[f].constructParams[0]=v.x,s.curveMax.constructParams[f].constructParams[1]=v.y});break}case"two-curve":{if(h.value[0].length>4||h.value[1].length>4)return;s.mode=q.TwoCurves,g(h.value[0]),u(h.value[1]),h.value[0].forEach((v,f)=>{s.curveMin.constructParams[f].constructParams[0]=v.x,s.curveMin.constructParams[f].constructParams[1]=v.y}),h.value[1].forEach((v,f)=>{s.curveMax.constructParams[f].constructParams[0]=v.x,s.curveMax.constructParams[f].constructParams[1]=v.y});break}}a[o]=s,t==null||t(o,s)};return p.jsx(p.Fragment,{children:p.jsx(je,{label:r(e.label||e.property),info:r(e.info),type:st[i.mode],algo:"linear",yRangeMode:e.yRangeMode,yTickScale:d,yTickScaleMin:e.yTickScaleMin,yTickScaleMax:e.yTickScaleMax,onYTickScaleChange:b,onYTickScaleCommit:()=>{},value:[{value:i.constantMax,type:"constant",label:r("effects.curve.constant"),min:e.min,max:e.max,step:e.step},{value:[i.constantMin,i.constantMax],type:"two-constant",label:r("effects.curve.two-constant"),min:e.min,max:e.max,step:e.step},{value:y,type:"curve",label:r("effects.curve.curve")},{value:[P,y],type:"two-curve",label:r("effects.curve.two-curve")}],onValueChange:C})})}),G=(a,e,t)=>{var i,y;const r=(y=(i=a.engineObject)==null?void 0:i.generator)==null?void 0:y[t.module];if(!r){console.warn(`Module container not found for: ${t.module}`);return}const o=r[e];if(!o){console.warn(`Module not found for property: ${e} in ${t.module}`);return}o.mode=t.mode,o.constantMax=t.constantMax,o.constantMin=t.constantMin,o.curveMax=new Ee,t.curveMax.constructParams.forEach(u=>{const P=u.constructParams[0],g=u.constructParams[1];o.curveMax.addKey(new Te(P,g))}),o.curveMin=new Ee,t.curveMin.constructParams.forEach(u=>{const P=u.constructParams[0],g=u.constructParams[1];o.curveMin.addKey(new Te(P,g))})},Ga=["constant","two-constant"],Na=Y(({model:a,inspectorConfig:e,onModelChange:t})=>{var g,d;const{t:r}=$(),o=e.property,i=a[o],y={...be(i.constantMax),intensity:((g=i.constantMax)==null?void 0:g.intensity)??1},u={...be(i.constantMin),intensity:((d=i.constantMin)==null?void 0:d.intensity)??1},P=(b,C)=>{const l=b.find(h=>h.type===C);if(!l)return;const c=_(i);switch(C){case"constant":{c.mode=me.Constant,c.constantMax=l.value;break}case"two-constant":{const h=l.value[0],s=l.value[1];c.mode=me.TwoConstants,c.constantMin=h,c.constantMax=s;break}}a[o]=c,t==null||t(o,c)};return p.jsx(Bt,{label:r(e.label||e.property),type:Ga[i.mode],info:r(e.info),hdr:!0,value:[{value:y,type:"constant",label:r("effects.curve.constant")},{value:[u,y],type:"two-constant",label:r("effects.curve.two-constant")}],onValueChange:P})}),Ha=(a,e,t)=>{const r=a.engineObject.generator.main.startColor;r.mode=t.mode;const{constantMax:o,constantMin:i}=t,y=o.intensity??1,u=i.intensity??1;r.constantMax.set(o.r*y,o.g*y,o.b*y,o.a),r.constantMin.set(i.r*u,i.g*u,i.b*u,i.a)},Wa=["gradient","two-gradient"],Ja=Y(({model:a,inspectorConfig:e,onModelChange:t})=>{const{t:r}=$(),o=e.property,i=a[o],y=(u,P)=>{var b,C;if(!u.find(l=>l.type===P))return;const d=_(i);switch(P){case"gradient":{const l=u.find(c=>c.type===P);if(!((b=l==null?void 0:l.value)!=null&&b.color)||!((C=l==null?void 0:l.value)!=null&&C.alpha)){console.warn(`Invalid gradient value structure for ${o}`);return}if(l.value.color.length>4||l.value.alpha.length>4)return;d.mode=me.Gradient,d.gradientMax.constructParams=[l.value.color.map(c=>({color:c.value,time:c.time})),l.value.alpha.map(c=>({alpha:c.value,time:c.time}))];break}case"two-gradient":{const l=u.find(c=>c.type===P);if(l.value[0].color.length>4||l.value[0].alpha.length>4||l.value[1].color.length>4||l.value[1].alpha.length>4)return;d.mode=me.TwoGradients,d.gradientMin.constructParams=[l.value[0].color.map(c=>({color:c.value,time:c.time})),l.value[0].alpha.map(c=>({alpha:c.value,time:c.time}))],d.gradientMax.constructParams=[l.value[1].color.map(c=>({color:c.value,time:c.time})),l.value[1].alpha.map(c=>({alpha:c.value,time:c.time}))];break}}a[o]=d,t==null||t(o,d)};return p.jsx(p.Fragment,{children:p.jsx(Bt,{label:r(e.property),type:Wa[i.mode-2],info:r(e.info),value:[{value:{color:i.gradientMax.constructParams[0].map(u=>({value:be(u.color),time:u.time})),alpha:i.gradientMax.constructParams[1].map(u=>({value:u.alpha,time:u.time}))},type:"gradient",label:r("effects.curve.gradient")},{value:[{color:i.gradientMin.constructParams[0].map(u=>({value:be(u.color),time:u.time})),alpha:i.gradientMin.constructParams[1].map(u=>({value:u.alpha,time:u.time}))},{color:i.gradientMax.constructParams[0].map(u=>({value:be(u.color),time:u.time})),alpha:i.gradientMax.constructParams[1].map(u=>({value:u.alpha,time:u.time}))}],type:"two-gradient",label:r("effects.curve.two-gradient")}],onValueChange:y})})}),ce=[],pe=[],Ua=(a,e,t)=>{var P,g,d;const r=(g=(P=a.engineObject)==null?void 0:P.generator)==null?void 0:g[t.module];if(!r){console.warn(`Module container not found for: ${t.module}`);return}const o=r[e];if(!o){console.warn(`Module not found for property: ${e} in ${t.module}`);return}if(o.mode=t.mode,ce.length=0,pe.length=0,!((d=t.gradientMax)!=null&&d.constructParams)||!Array.isArray(t.gradientMax.constructParams)){console.warn(`Invalid gradientMax.constructParams for ${e}`);return}const i=t.gradientMax.constructParams,y=i[0]||[],u=i[1]||[];Array.isArray(y)&&y.forEach(b=>{if(b&&b.color&&typeof b.time=="number"){const C=b.color;ce.push(new xt(b.time,new St(C.r??0,C.g??0,C.b??0,C.a??1)))}}),Array.isArray(u)&&u.forEach(b=>{b&&typeof b.time=="number"&&typeof b.alpha=="number"&&pe.push(new Mt(b.time,b.alpha))}),o.gradientMax.setKeys(ce,pe),ce.length=0,pe.length=0,t.gradientMin.constructParams[0].forEach(b=>{ce.push(new xt(b.time,new St(b.color.r,b.color.g,b.color.b,b.color.a)))}),t.gradientMin.constructParams[1].forEach(b=>{pe.push(new Mt(b.time,b.alpha))}),o.gradientMin.setKeys(ce,pe)};function ze(a){return a-Math.floor(a*(1/289))*289}function N(a){return ze((34*a+1)*a)}function rt(a,e,t){const r=.16666666666666666,o=1/3,i=(a+e+t)*o,y=Math.floor(a+i),u=Math.floor(e+i),P=Math.floor(t+i),g=(y+u+P)*r,d=a-y+g,b=e-u+g,C=t-P+g;let l,c,h,s,v,f;d>=b?b>=C?(l=1,c=0,h=0,s=1,v=1,f=0):d>=C?(l=1,c=0,h=0,s=1,v=0,f=1):(l=0,c=0,h=1,s=1,v=0,f=1):b<C?(l=0,c=0,h=1,s=0,v=1,f=1):d<C?(l=0,c=1,h=0,s=0,v=1,f=1):(l=0,c=1,h=0,s=1,v=1,f=0);const m=d-l+r,T=b-c+r,L=C-h+r,I=d-s+o,E=b-v+o,w=C-f+o,V=d-.5,j=b-.5,k=C-.5,Z=ze(y),J=ze(u),ge=ze(P),It=N(N(N(ge)+J)+Z),Ft=N(N(N(ge+h)+J+c)+Z+l),Yt=N(N(N(ge+f)+J+v)+Z+s),Zt=N(N(N(ge+1)+J+1)+Z+1),Ae=.142857142857,it=Ae*2-0,lt=Ae*.5-1,Re=Ae*1-0;function xe(mt){const dt=mt-49*Math.floor(mt*Re*Re),ht=Math.floor(dt*Re),Gt=Math.floor(dt-7*ht),ft=ht*it+lt,yt=Gt*it+lt,Se=1-Math.abs(ft)-Math.abs(yt),bt=ft,vt=yt,Nt=Math.floor(bt)*2+1,Ht=Math.floor(vt)*2+1,gt=-(Se<0?1:0),Je=bt+Nt*gt,Ue=vt+Ht*gt,Qe=1.79284291400159-.85373472095314*(Je*Je+Ue*Ue+Se*Se);return[Je*Qe,Ue*Qe,Se*Qe]}const ae=xe(It),re=xe(Ft),oe=xe(Yt),ne=xe(Zt),Ve=Math.max(.6-(d*d+b*b+C*C),0),ke=Math.max(.6-(m*m+T*T+L*L),0),Be=Math.max(.6-(I*I+E*E+w*w),0),De=Math.max(.6-(V*V+j*j+k*k),0),Ie=Ve*Ve,Fe=ke*ke,Ye=Be*Be,Ze=De*De,Xe=Ie*Ie,qe=Fe*Fe,$e=Ye*Ye,Ke=Ze*Ze,Xt=ae[0]*d+ae[1]*b+ae[2]*C,qt=re[0]*m+re[1]*T+re[2]*L,$t=oe[0]*I+oe[1]*E+oe[2]*w,Kt=ne[0]*V+ne[1]*j+ne[2]*k,Ge=Ie*Ve*Xt,Ne=Fe*ke*qt,He=Ye*Be*$t,We=Ze*De*Kt;let ct=-8*(Ge*d+Ne*m+He*I+We*V),pt=-8*(Ge*b+Ne*T+He*E+We*j),ut=-8*(Ge*C+Ne*L+He*w+We*k);return ct+=Xe*ae[0]+qe*re[0]+$e*oe[0]+Ke*ne[0],pt+=Xe*ae[1]+qe*re[1]+$e*oe[1]+Ke*ne[1],ut+=Xe*ae[2]+qe*re[2]+$e*oe[2]+Ke*ne[2],[ct*42,pt*42,ut*42]}function Ot(a,e,t){rt(t,e,a);const o=rt(a+100,t,e);return rt(e,a+100,t)[1]-o[2]}function Qa(a,e,t,r,o,i,y){let u=Ot(a*r,e*r,t*r),P=1,g=r,d=1;for(let b=1;b<o;b++)d*=y,g*=i,P+=d,u+=d*Ot(a*g,e*g,t*g);return u/P}const Q=80,wt=5,er=({model:a})=>{const e=X.useRef(null),t=X.useRef(0);return X.useEffect(()=>{const r=e.current;if(!r)return;const o=r.getContext("2d");if(!o)return;const i=fa(()=>{var c,h;const y=((h=(c=a.noiseStrength)==null?void 0:c.x)==null?void 0:h.constantMax)??1,u=a.noiseFrequency??.5,P=a.noiseScrollSpeed??0,g=a.noiseOctaveCount??1,d=a.noiseOctaveIntensityMultiplier??.5,b=a.noiseOctaveFrequencyMultiplier??2;cancelAnimationFrame(t.current);const C=performance.now(),l=s=>{const v=(s-C)/1e3*P,f=o.createImageData(Q,Q),m=f.data;for(let T=0;T<Q;T++){const L=(1-T/Q)*wt;for(let I=0;I<Q;I++){const E=I/Q*wt,w=Qa(E,L,v,u,g,b,d),V=Math.max(0,Math.min(255,Math.round((w*y*(.5/7)+.5)*255))),j=(T*Q+I)*4;m[j]=V,m[j+1]=V,m[j+2]=V,m[j+3]=255}}o.putImageData(f,0,0),P>0&&(t.current=requestAnimationFrame(l))};t.current=requestAnimationFrame(l)});return()=>{cancelAnimationFrame(t.current),i()}},[a]),p.jsx(ve,{label:" ",labelCss:{visibility:"hidden"},children:p.jsxs("div",{style:{position:"relative",width:80,height:80},children:[p.jsx("canvas",{ref:e,width:Q,height:Q,style:{width:80,height:80,borderRadius:4,border:"1px solid var(--color-border-default, rgba(255,255,255,0.12))",display:"block"}}),p.jsx("span",{style:{position:"absolute",bottom:2,left:0,right:0,textAlign:"center",fontSize:9,color:"rgba(255,255,255,0.6)",textShadow:"0 1px 2px rgba(0,0,0,0.8)",pointerEvents:"none"},children:"Preview"})]})})};var tr=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,M=(a,e,t,r)=>{for(var o=r>1?void 0:r?ar(e,t):e,i=a.length-1,y;i>=0;i--)(y=a[i])&&(o=(r?y(e,t,o):y(o))||o);return r&&o&&tr(e,t,o),o};let x=class extends ya{constructor(e,t){super(e,t);S(this,"_emissionModuleEnabled",!0);S(this,"_emissionShapeModuleEnabled",!0);S(this,"_rotationOverLifetimeModuleEnabled",!1);S(this,"_sizeOverLifetimeModuleEnabled",!1);S(this,"_textureSheetAnimationModuleEnabled",!1);S(this,"_velocityOverLifetimeModuleEnabled",!1);S(this,"_forceOverLifetimeModuleEnabled",!1);S(this,"_limitVelocityOverLifetimeModuleEnabled",!1);S(this,"_colorOverLifetimeModuleEnabled",!1);S(this,"_noiseModuleEnabled",!1);S(this,"material",{refId:"0000202"});S(this,"priority",0);S(this,"velocityScale",0);S(this,"lengthScale",2);S(this,"pivot",{x:0,y:0,z:0});S(this,"renderMode",H.Billboard);S(this,"mesh",null);S(this,"duration",5);S(this,"isLoop",!0);S(this,"startDelay",D("main"));S(this,"startLifetime",D("main",5));S(this,"startSpeed",D("main",5));S(this,"startSize",le("main",1));S(this,"startRotation",le("main"));S(this,"flipRotation",0);S(this,"startColor",{module:"main",mode:me.Constant,constantMax:{r:1,g:1,b:1,a:1,intensity:1},constantMin:{r:1,g:1,b:1,a:1,intensity:1}});S(this,"gravityModifier",D("main"));S(this,"simulationSpace",F.Local);S(this,"simulationSpeed",1);S(this,"scalingMode",fe.Local);S(this,"playOnEnabled",!0);S(this,"maxParticles",1e3);S(this,"rateOverTime",D("emission",10));S(this,"shape",{class:B.ConeShape,props:{angle:25,radius:1,length:5,emitType:ue.Base,enabled:!0}});S(this,"bursts",[]);S(this,"size",le("sizeOverLifetime",1));S(this,"rotation",le("rotationOverLifetime",45));S(this,"textureSheetAnimationType",0);S(this,"cycleCount",1);S(this,"tiling",{x:1,y:1});S(this,"frameOverTime",D("textureSheetAnimation",1,0,q.Curve));S(this,"spaceMode",F.Local);S(this,"forceSpaceMode",F.Local);S(this,"velocityX",D("velocityOverLifetime"));S(this,"velocityY",D("velocityOverLifetime"));S(this,"velocityZ",D("velocityOverLifetime"));S(this,"speed",le("limitVelocityOverLifetime",1));S(this,"limitVelocitySpaceMode",F.Local);S(this,"dampen",0);S(this,"drag",D("limitVelocityOverLifetime"));S(this,"multiplyDragByParticleSize",!1);S(this,"multiplyDragByParticleVelocity",!1);S(this,"forceX",D("forceOverLifetime"));S(this,"forceY",D("forceOverLifetime"));S(this,"forceZ",D("forceOverLifetime"));S(this,"color",zt());S(this,"noisePreview",null);S(this,"noiseStrength",le("noise",1));S(this,"noiseFrequency",.5);S(this,"noiseScrollSpeed",0);S(this,"noiseOctaveCount",1);S(this,"noiseOctaveIntensityMultiplier",.5);S(this,"noiseOctaveFrequencyMultiplier",2);const r=this.formSchema;r.addGroup(n("effects.renderer.sections.main"),["duration","isLoop","startDelay","startLifetime","startSpeed","startSize","startRotation","flipRotation","startColor","gravityModifier","simulationSpace","simulationSpeed","scalingMode","playOnEnabled","maxParticles"]);const o=(i,y,u,P,g)=>{r.addGroup(n(i),y,{collapsible:!1,controlOpenKey:u,customTitle:p.jsx(Ea,{model:this,title:n(i),controlOpenKey:u,onCheckedChange:d=>{g==null||g(d),ja(this.root,this.id,u,d),this.applyBoundPathChange(P,A.Toggle,d)}})})};o("effects.renderer.sections.emission",["rateOverTime","bursts"],"_emissionModuleEnabled","generator.emission.enabled"),o("effects.renderer.sections.shape",["shape"],"_emissionShapeModuleEnabled","generator.emission.shape.enabled",i=>{this.shape.props.enabled=i}),o("effects.renderer.sections.size-over-lifetime",["size"],"_sizeOverLifetimeModuleEnabled","generator.sizeOverLifetime.enabled"),o("effects.renderer.sections.rotation-over-lifetime",["rotation"],"_rotationOverLifetimeModuleEnabled","generator.rotationOverLifetime.enabled"),o("effects.renderer.sections.force-over-lifetime",["forceSpaceMode","forceX","forceY","forceZ"],"_forceOverLifetimeModuleEnabled","generator.forceOverLifetime.enabled"),o("effects.renderer.sections.velocity-over-lifetime",["spaceMode","velocityX","velocityY","velocityZ"],"_velocityOverLifetimeModuleEnabled","generator.velocityOverLifetime.enabled"),o("effects.renderer.sections.limit-velocity-over-lifetime",["speed","limitVelocitySpaceMode","dampen","drag","multiplyDragByParticleSize","multiplyDragByParticleVelocity"],"_limitVelocityOverLifetimeModuleEnabled","generator.limitVelocityOverLifetime.enabled"),o("effects.renderer.sections.texture-sheet-animation",["textureSheetAnimationType","cycleCount","tiling","frameOverTime"],"_textureSheetAnimationModuleEnabled","generator.textureSheetAnimation.enabled"),o("effects.renderer.sections.color-over-lifetime",["color"],"_colorOverLifetimeModuleEnabled","generator.colorOverLifetime.enabled"),o("effects.renderer.sections.noise",["noisePreview","noiseStrength","noiseFrequency","noiseScrollSpeed","noiseOctaveCount","noiseOctaveIntensityMultiplier","noiseOctaveFrequencyMultiplier"],"_noiseModuleEnabled","generator.noise.enabled"),r.addGroup(n("effects.renderer.sections.rendering"),["renderMode","mesh","material","velocityScale","lengthScale","pivot","priority"])}applyEmissionShape(e){this.applyBoundPathChange("generator.emission.shape",A.Input,e)}onInitComplete(){const{_engineObject:{generator:e}}=this;if(this.applyBoundPathChange("enabled",A.Toggle,this._enabled),this.applyBoundPathChange("renderMode",A.Select,this.renderMode),e.emission.enabled=this._emissionModuleEnabled,e.emission.shape.enabled=this._emissionShapeModuleEnabled,this.shape.class===B.MeshShape){const t=e.emission.shape,r=this.shape.props.mesh;r?(t.enabled=!1,Ta(this.root,r).then(()=>{this.applyBoundPathChange("generator.emission.shape.mesh",A.AssetPicker,r),t.enabled=this._emissionShapeModuleEnabled})):this.applyBoundPathChange("generator.emission.shape.mesh",A.Input,Lt.createSphere(this.engineObject.engine))}e.rotationOverLifetime.enabled=this._rotationOverLifetimeModuleEnabled,e.sizeOverLifetime.enabled=this._sizeOverLifetimeModuleEnabled,e.textureSheetAnimation.enabled=this._textureSheetAnimationModuleEnabled,e.velocityOverLifetime.enabled=this._velocityOverLifetimeModuleEnabled,e.limitVelocityOverLifetime.enabled=this._limitVelocityOverLifetimeModuleEnabled,e.forceOverLifetime.enabled=this._forceOverLifetimeModuleEnabled,e.main.simulationSpeed=0,e.colorOverLifetime.enabled=this._colorOverLifetimeModuleEnabled,e.noise.enabled=this._noiseModuleEnabled,this.renderMode===H.Mesh&&this._applyRendererMeshFromRef()}_applyRendererMeshFromRef(){this.applyBoundPathChange("mesh",A.AssetPicker,this.mesh??null)}async bindEngineObject(e){e.enabled=!1,await super.bindEngineObject(e)}deserialize(e){var r,o,i,y,u,P;if(this._enabled=((r=e.props)==null?void 0:r.enabled)??!0,(o=e.props)!=null&&o.generator){const{props:g}=e;this.priority=g.priority??this.priority,this.velocityScale=g.velocityScale??this.velocityScale,this.lengthScale=g.lengthScale??this.lengthScale,this.pivot=g.pivot??this.pivot,this.renderMode=g.renderMode??this.renderMode,this.mesh=g.mesh??null;const{main:d,emission:b,sizeOverLifetime:C,rotationOverLifetime:l,velocityOverLifetime:c,limitVelocityOverLifetime:h,colorOverLifetime:s,textureSheetAnimation:v,forceOverLifetime:f,noise:m}=e.props.generator;this.duration=d.duration,this.isLoop=d.isLoop,this.startDelay=d.startDelay,this.startLifetime=d.startLifetime,this.startSpeed=d.startSpeed,this.startSize.enabled=d.startSize3D,this.startSize.x=d.startSizeX,this.startSize.y=d.startSizeY,this.startSize.z=d.startSizeZ,this.startRotation.enabled=d.startRotation3D,this.startRotation.x=d.startRotationX,this.startRotation.y=d.startRotationY,this.startRotation.z=d.startRotationZ,this.flipRotation=d.flipRotation,this.startColor=d.startColor,this.gravityModifier=d.gravityModifier,this.simulationSpace=d.simulationSpace,this.simulationSpeed=d.simulationSpeed,this.scalingMode=d.scalingMode,this.playOnEnabled=d.playOnEnabled,this.maxParticles=d.maxParticles,this._emissionModuleEnabled=b.enabled,this.rateOverTime=b.rateOverTime,this.shape=b.shape,(((i=b.shape)==null?void 0:i.class)==="Null"||b.shape===null)&&(this.shape={class:B.ConeShape,props:{angle:25,radius:1,length:5,emitType:ue.Base,enabled:!1}}),this._emissionShapeModuleEnabled=((u=(y=b==null?void 0:b.shape)==null?void 0:y.props)==null?void 0:u.enabled)??!0;const T=[];if((P=b==null?void 0:b.methods)!=null&&P.addBurst&&Array.isArray(b.methods.addBurst))for(let E=0;E<b.methods.addBurst.length;E++)b.methods.addBurst[E]&&b.methods.addBurst[E][0]&&T.push(b.methods.addBurst[E][0]);this.bursts=T,this._sizeOverLifetimeModuleEnabled=(C==null?void 0:C.enabled)??!1,this.size.enabled=(C==null?void 0:C.separateAxes)??!1,this.size.x=C!=null&&C.sizeX?{...C.sizeX,module:"sizeOverLifetime"}:{..._(this.size.x),module:"sizeOverLifetime"},this.size.y=C!=null&&C.sizeY?{...C.sizeY,module:"sizeOverLifetime"}:{..._(this.size.y),module:"sizeOverLifetime"},this.size.z=C!=null&&C.sizeZ?{...C.sizeZ,module:"sizeOverLifetime"}:{..._(this.size.z),module:"sizeOverLifetime"},this._rotationOverLifetimeModuleEnabled=(l==null?void 0:l.enabled)??!1,this.rotation.enabled=(l==null?void 0:l.separateAxes)??!1,this.rotation.x=l!=null&&l.rotationX?{...l.rotationX,module:"rotationOverLifetime"}:{..._(this.rotation.x),module:"rotationOverLifetime"},this.rotation.y=l!=null&&l.rotationY?{...l.rotationY,module:"rotationOverLifetime"}:{..._(this.rotation.y),module:"rotationOverLifetime"},this.rotation.z=l!=null&&l.rotationZ?{...l.rotationZ,module:"rotationOverLifetime"}:{..._(this.rotation.z),module:"rotationOverLifetime"},this._velocityOverLifetimeModuleEnabled=(c==null?void 0:c.enabled)??!1,this.velocityX=(c==null?void 0:c.velocityX)??_(this.velocityX),this.velocityY=(c==null?void 0:c.velocityY)??_(this.velocityY),this.velocityZ=(c==null?void 0:c.velocityZ)??_(this.velocityZ),this.spaceMode=(c==null?void 0:c.space)??F.Local,this._limitVelocityOverLifetimeModuleEnabled=(h==null?void 0:h.enabled)??!1,this.speed.enabled=(h==null?void 0:h.separateAxes)??!1;const L=(h==null?void 0:h.speedX)??(h==null?void 0:h.speed);this.speed.x=L?{...L,module:"limitVelocityOverLifetime"}:{..._(this.speed.x),module:"limitVelocityOverLifetime"},this.speed.y=h!=null&&h.speedY?{...h.speedY,module:"limitVelocityOverLifetime"}:{..._(this.speed.y),module:"limitVelocityOverLifetime"},this.speed.z=h!=null&&h.speedZ?{...h.speedZ,module:"limitVelocityOverLifetime"}:{..._(this.speed.z),module:"limitVelocityOverLifetime"},this.dampen=(h==null?void 0:h.dampen)??0,this.drag=h!=null&&h.drag?{...h.drag,module:"limitVelocityOverLifetime"}:D("limitVelocityOverLifetime"),this.multiplyDragByParticleSize=(h==null?void 0:h.multiplyDragByParticleSize)??!1,this.multiplyDragByParticleVelocity=(h==null?void 0:h.multiplyDragByParticleVelocity)??!1,this.limitVelocitySpaceMode=(h==null?void 0:h.space)??F.Local,this._forceOverLifetimeModuleEnabled=(f==null?void 0:f.enabled)??!1,this.forceX=(f==null?void 0:f.forceX)??D("forceOverLifetime"),this.forceY=(f==null?void 0:f.forceY)??D("forceOverLifetime"),this.forceZ=(f==null?void 0:f.forceZ)??D("forceOverLifetime"),this.forceSpaceMode=(f==null?void 0:f.space)??F.Local,s?(this._colorOverLifetimeModuleEnabled=s.enabled,this.color=s.color):(this._colorOverLifetimeModuleEnabled=!0,this.color=zt()),this._textureSheetAnimationModuleEnabled=v.enabled,this.textureSheetAnimationType=v.type,this.cycleCount=v.cycleCount,this.tiling=v.tiling,this.frameOverTime=v.frameOverTime,this._noiseModuleEnabled=(m==null?void 0:m.enabled)??!1,this.noiseStrength.enabled=(m==null?void 0:m.separateAxes)??!1;const I=m==null?void 0:m.strengthX;this.noiseStrength.x=I?{...I,module:"noise"}:{..._(this.noiseStrength.x),module:"noise"},this.noiseStrength.y=m!=null&&m.strengthY?{...m.strengthY,module:"noise"}:{..._(this.noiseStrength.y),module:"noise"},this.noiseStrength.z=m!=null&&m.strengthZ?{...m.strengthZ,module:"noise"}:{..._(this.noiseStrength.z),module:"noise"},this.noiseFrequency=(m==null?void 0:m.frequency)??.5,this.noiseScrollSpeed=(m==null?void 0:m.scrollSpeed)??0,this.noiseOctaveCount=(m==null?void 0:m.octaveCount)??1,this.noiseOctaveIntensityMultiplier=(m==null?void 0:m.octaveIntensityMultiplier)??.5,this.noiseOctaveFrequencyMultiplier=(m==null?void 0:m.octaveFrequencyMultiplier)??2}e.methods&&(this.material=e.methods.setMaterial[0][0]);const t=e.methods?e:{...e,methods:{setMaterial:[[this.material]]}};super.deserialize(t)}toJSON(){const e=[];return this.bursts.forEach(r=>{e.push([r])}),{id:this.id,class:this.type,props:{enabled:this.enabled,priority:this.priority,velocityScale:this.velocityScale,lengthScale:this.lengthScale,pivot:this.pivot,renderMode:this.renderMode,mesh:this.mesh,generator:{main:{duration:this.duration,isLoop:this.isLoop,startDelay:this.startDelay,startLifetime:this.startLifetime,startSpeed:this.startSpeed,startSize3D:this.startSize.enabled,startSizeX:this.startSize.x,startSizeY:this.startSize.y,startSizeZ:this.startSize.z,startRotation3D:this.startRotation.enabled,startRotationX:this.startRotation.x,startRotationY:this.startRotation.y,startRotationZ:this.startRotation.z,flipRotation:this.flipRotation,startColor:this.startColor,gravityModifier:this.gravityModifier,simulationSpace:this.simulationSpace,simulationSpeed:this.simulationSpeed,scalingMode:this.scalingMode,playOnEnabled:this.playOnEnabled,maxParticles:this.maxParticles},emission:{enabled:this._emissionModuleEnabled,rateOverTime:this.rateOverTime,shape:this.shape,methods:{addBurst:e}},sizeOverLifetime:{enabled:this._sizeOverLifetimeModuleEnabled,separateAxes:this.size.enabled,sizeX:this.size.x,sizeY:this.size.y,sizeZ:this.size.z},rotationOverLifetime:{enabled:this._rotationOverLifetimeModuleEnabled,separateAxes:this.rotation.enabled,rotationX:this.rotation.x,rotationY:this.rotation.y,rotationZ:this.rotation.z},velocityOverLifetime:{enabled:this._velocityOverLifetimeModuleEnabled,space:this.spaceMode,velocityX:this.velocityX,velocityY:this.velocityY,velocityZ:this.velocityZ},limitVelocityOverLifetime:{enabled:this._limitVelocityOverLifetimeModuleEnabled,separateAxes:this.speed.enabled,speedX:this.speed.x,speedY:this.speed.y,speedZ:this.speed.z,dampen:this.dampen,drag:this.drag,multiplyDragByParticleSize:this.multiplyDragByParticleSize,multiplyDragByParticleVelocity:this.multiplyDragByParticleVelocity,space:this.limitVelocitySpaceMode},forceOverLifetime:{enabled:this._forceOverLifetimeModuleEnabled,space:this.forceSpaceMode,forceX:this.forceX,forceY:this.forceY,forceZ:this.forceZ},colorOverLifetime:{enabled:this._colorOverLifetimeModuleEnabled,color:this.color},textureSheetAnimation:{enabled:this._textureSheetAnimationModuleEnabled,type:this.textureSheetAnimationType,cycleCount:this.cycleCount,tiling:this.tiling,frameOverTime:this.frameOverTime},noise:{enabled:this._noiseModuleEnabled,separateAxes:this.noiseStrength.enabled,strengthX:this.noiseStrength.x,strengthY:this.noiseStrength.y,strengthZ:this.noiseStrength.z,frequency:this.noiseFrequency,scrollSpeed:this.noiseScrollSpeed,octaveCount:this.noiseOctaveCount,octaveIntensityMultiplier:this.noiseOctaveIntensityMultiplier,octaveFrequencyMultiplier:this.noiseOctaveFrequencyMultiplier}}},methods:{setMaterial:[[this.material]]}}}};M([U],x.prototype,"_emissionModuleEnabled",2);M([U],x.prototype,"_emissionShapeModuleEnabled",2);M([U],x.prototype,"_rotationOverLifetimeModuleEnabled",2);M([U],x.prototype,"_sizeOverLifetimeModuleEnabled",2);M([U],x.prototype,"_textureSheetAnimationModuleEnabled",2);M([U],x.prototype,"_velocityOverLifetimeModuleEnabled",2);M([U],x.prototype,"_forceOverLifetimeModuleEnabled",2);M([U],x.prototype,"_limitVelocityOverLifetimeModuleEnabled",2);M([U],x.prototype,"_colorOverLifetimeModuleEnabled",2);M([U],x.prototype,"_noiseModuleEnabled",2);M([R({engineKey:"setMaterial",setPath:"setMaterial()",getPath:"getMaterial()",valueType:ba.ReferResource,getEngineValue:a=>a.getMaterial()}),z({type:A.AssetPicker,assetType:"Material",customFilter:a=>{var e;return((e=a.engineObject.shader)==null?void 0:e.name)==="particle-shader"},priority:-100,label:n("effects.renderer.material.label"),info:n("effects.renderer.material.info")}),O()],x.prototype,"material",2);M([z({bindPath:"priority",min:0,step:1,dragStep:1,priority:-100,label:n("effects.renderer.priority.label"),info:n("effects.renderer.priority.info")}),O()],x.prototype,"priority",2);M([z({bindPath:"velocityScale",priority:-100,label:n("effects.renderer.velocity-scale.label"),info:n("effects.renderer.velocity-scale.info"),when:a=>a.renderMode===H.StretchBillboard}),O()],x.prototype,"velocityScale",2);M([z({bindPath:"lengthScale",priority:-100,label:n("effects.renderer.length-scale.label"),info:n("effects.renderer.length-scale.info"),when:a=>a.renderMode===H.StretchBillboard}),O()],x.prototype,"lengthScale",2);M([z({type:A.Vector3,bindPath:"pivot",label:n("effects.renderer.pivot.label"),priority:-100}),O()],x.prototype,"pivot",2);M([R({getPath:"renderMode",setPath:"renderMode"}),z({type:A.Select,value:H.Billboard,label:n("effects.renderer.render-mode.label"),options:[{label:n("effects.renderer.render-mode.options.billboard"),value:H.Billboard},{label:n("effects.renderer.render-mode.options.stretch-billboard"),value:H.StretchBillboard},{label:n("effects.renderer.render-mode.options.horizontal-billboard"),value:H.HorizontalBillboard},{label:n("effects.renderer.render-mode.options.mesh"),value:H.Mesh},{label:n("effects.renderer.render-mode.options.none"),value:H.None}],onChange(a){a.renderMode===H.Mesh&&a._applyRendererMeshFromRef()},priority:-100}),O()],x.prototype,"renderMode",2);M([z({type:A.AssetPicker,assetType:"Mesh",label:n("effects.renderer.mesh.label"),info:n("effects.renderer.mesh.info"),when:a=>a.renderMode===H.Mesh,onChange:async(a,e,t)=>{a.mesh=t?t.getCurrentRef():null;try{await a.applyBoundPathChange("mesh",A.AssetPicker,a.mesh)}catch(r){console.warn(r)}},priority:-100}),O()],x.prototype,"mesh",2);M([R({getPath:"generator.main.duration",setPath:"generator.main.duration"}),z({bindPath:"generator.main.duration",min:.05,step:.05,dragStep:.05,label:n("effects.renderer.duration.label"),info:n("effects.renderer.duration.info")}),O()],x.prototype,"duration",2);M([R({getPath:"generator.main.isLoop",setPath:"generator.main.isLoop"}),z({bindPath:"generator.main.isLoop",label:n("effects.renderer.loop.label"),info:n("effects.renderer.loop.info")}),O()],x.prototype,"isLoop",2);M([z({customComponent:K,min:0,yRangeMode:"positive",onChange:G,info:n("effects.renderer.start.delay.info"),label:n("effects.renderer.start.delay.label")}),O()],x.prototype,"startDelay",2);M([z({customComponent:K,onChange:G,min:1e-4,yRangeMode:"positive",label:n("effects.renderer.start.lifetime.label"),info:n("effects.renderer.start.lifetime.info")}),O()],x.prototype,"startLifetime",2);M([z({customComponent:K,onChange:G,label:n("effects.renderer.start.speed.label")}),O()],x.prototype,"startSpeed",2);M([z({module:"main",toggleProps:"startSize3D",axisX:"startSizeX",axisY:"startSizeY",axisZ:"startSizeZ",mainAxis:"x",customComponent:de,onChange:he("startSize3D"),label:n("effects.renderer.start.size.label"),info:n("effects.renderer.start.size.info"),min:0,yRangeMode:"positive"}),O()],x.prototype,"startSize",2);M([z({module:"main",toggleProps:"startRotation3D",axisX:"startRotationX",axisY:"startRotationY",axisZ:"startRotationZ",mainAxis:"z",customComponent:de,onChange:he("startRotation3D"),label:n("effects.renderer.start.rotation.label"),info:n("effects.renderer.start.rotation.info"),step:1}),O()],x.prototype,"startRotation",2);M([R({getPath:"generator.main.flipRotation",setPath:"generator.main.flipRotation"}),z({bindPath:"generator.main.flipRotation",min:0,max:1,step:.05,dragStep:.05,label:n("effects.renderer.flip-rotation.label")}),O()],x.prototype,"flipRotation",2);M([z({customComponent:Na,onChange:Ha,label:n("effects.renderer.start.color.label")}),O()],x.prototype,"startColor",2);M([z({customComponent:K,info:n("effects.renderer.gravity-modifier.info"),onChange:G,label:n("effects.renderer.gravity-modifier.label")}),O()],x.prototype,"gravityModifier",2);M([R({getPath:"generator.main.simulationSpace",setPath:"generator.main.simulationSpace"}),z({type:A.Select,bindPath:"generator.main.simulationSpace",value:F.Local,label:n("effects.renderer.simulation.space.label"),info:n("effects.renderer.simulation.space.info"),options:[{label:n("effects.renderer.simulation.space.options.local"),value:F.Local},{label:n("effects.renderer.simulation.space.options.world"),value:F.World}]}),O()],x.prototype,"simulationSpace",2);M([R({getPath:"generator.main.simulationSpeed",setPath:"generator.main.simulationSpeed"}),z({bindPath:"generator.main.simulationSpeed",step:.05,dragStep:.05,label:n("effects.renderer.simulation.speed.label"),info:n("effects.renderer.simulation.speed.info")}),O()],x.prototype,"simulationSpeed",2);M([R({getPath:"generator.main.scalingMode",setPath:"generator.main.scalingMode"}),z({type:A.Select,bindPath:"generator.main.scalingMode",label:n("effects.renderer.scaling-mode.label"),info:n("effects.renderer.scaling-mode.info"),value:fe.Local,options:[{label:n("effects.renderer.scaling-mode.options.hierarchy"),value:fe.Hierarchy},{label:n("effects.renderer.scaling-mode.options.local"),value:fe.Local},{label:n("effects.renderer.scaling-mode.options.world"),value:fe.World}]}),O()],x.prototype,"scalingMode",2);M([R({getPath:"generator.main.playOnEnabled",setPath:"generator.main.playOnEnabled"}),z({type:A.Toggle,bindPath:"generator.main.playOnEnabled",label:n("effects.renderer.play-on-enabled.label"),info:n("effects.renderer.play-on-enabled.info")}),O()],x.prototype,"playOnEnabled",2);M([R({getPath:"generator.main.maxParticles",setPath:"generator.main.maxParticles"}),z({type:A.Number,bindPath:"generator.main.maxParticles",min:1,dragStep:1,label:n("effects.renderer.max-particles.label"),info:n("effects.renderer.max-particles.info")}),O()],x.prototype,"maxParticles",2);M([z({customComponent:K,onChange:G,min:0,yRangeMode:"positive",label:n("effects.renderer.rate-over-time.label"),info:n("effects.renderer.rate-over-time.info")}),O()],x.prototype,"rateOverTime",2);M([z({customComponent:Za,onChange:Ia}),O()],x.prototype,"shape",2);M([O({type:"methods",key:"addBurst"}),z({label:n("effects.renderer.bursts.label"),info:n("effects.renderer.bursts.info"),customComponent:qa,onChange:$a})],x.prototype,"bursts",2);M([z({module:"sizeOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"sizeX",axisY:"sizeY",axisZ:"sizeZ",mainAxis:"x",customComponent:de,onChange:he("separateAxes"),min:0,yRangeMode:"positive",label:n("effects.renderer.over-lifetime.size.label")}),O()],x.prototype,"size",2);M([z({module:"rotationOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"rotationX",axisY:"rotationY",axisZ:"rotationZ",mainAxis:"z",customComponent:de,onChange:he("separateAxes"),step:1,yTickScale:45,label:n("effects.renderer.over-lifetime.rotation.label")}),O()],x.prototype,"rotation",2);M([R({getPath:"generator.textureSheetAnimation.type",setPath:"generator.textureSheetAnimation.type"}),z({type:A.Select,value:0,label:n("effects.renderer.texture-sheet.type.label"),info:n("effects.renderer.texture-sheet.type.info"),options:[{label:n("effects.renderer.texture-sheet.type.options.whole-sheet"),value:0},{label:n("effects.renderer.texture-sheet.type.options.single-row"),value:1}]}),O()],x.prototype,"textureSheetAnimationType",2);M([R({getPath:"generator.textureSheetAnimation.cycleCount",setPath:"generator.textureSheetAnimation.cycleCount"}),z({bindPath:"generator.textureSheetAnimation.cycleCount",min:1e-4,step:1,dragStep:1,label:n("effects.renderer.texture-sheet.cycle-count.label"),info:n("effects.renderer.texture-sheet.cycle-count.info")}),O()],x.prototype,"cycleCount",2);M([z({type:A.Vector2,min:1,label:n("effects.renderer.texture-sheet.tiling.label"),info:n("effects.renderer.texture-sheet.tiling.info"),onChange(a,e,t){a.applyBoundPathChange("generator.textureSheetAnimation.tiling",A.Vector2,t)}}),O()],x.prototype,"tiling",2);M([z({customComponent:K,onChange:G,min:0,max:1,yRangeMode:"positive",label:n("effects.renderer.over-lifetime.frame.label")}),O()],x.prototype,"frameOverTime",2);M([R({getPath:"generator.velocityOverLifetime.space",setPath:"generator.velocityOverLifetime.space"}),z({type:A.Select,bindPath:"generator.velocityOverLifetime.space",value:0,label:n("effects.renderer.space-mode.label"),info:n("effects.renderer.space-mode.info"),options:[{label:n("effects.renderer.space-mode.options.local"),value:F.Local},{label:n("effects.renderer.space-mode.options.world"),value:F.World}]}),O()],x.prototype,"spaceMode",2);M([R({getPath:"generator.forceOverLifetime.space",setPath:"generator.forceOverLifetime.space"}),z({type:A.Select,bindPath:"generator.forceOverLifetime.space",value:0,label:n("effects.renderer.space-mode.label"),info:n("effects.renderer.space-mode.info-force"),options:[{label:"Local",value:F.Local},{label:"World",value:F.World}]}),O()],x.prototype,"forceSpaceMode",2);M([z({customComponent:K,onChange:G,label:n("effects.renderer.velocity.x.label"),info:n("effects.renderer.velocity.x.info")}),O()],x.prototype,"velocityX",2);M([z({customComponent:K,onChange:G,label:n("effects.renderer.velocity.y.label")}),O()],x.prototype,"velocityY",2);M([z({customComponent:K,onChange:G,label:n("effects.renderer.velocity.z.label")}),O()],x.prototype,"velocityZ",2);M([z({module:"limitVelocityOverLifetime",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"speedX",axisY:"speedY",axisZ:"speedZ",mainAxis:"x",customComponent:de,onChange:he("separateAxes"),min:0,yRangeMode:"positive",label:n("effects.renderer.limit-velocity.limit.label")}),O()],x.prototype,"speed",2);M([R({getPath:"generator.limitVelocityOverLifetime.space",setPath:"generator.limitVelocityOverLifetime.space"}),z({type:A.Select,bindPath:"generator.limitVelocityOverLifetime.space",value:0,when:a=>a.speed.enabled,label:n("effects.renderer.space-mode.label"),info:n("effects.renderer.limit-velocity.space.info"),options:[{label:n("effects.renderer.space-mode.options.local"),value:F.Local},{label:n("effects.renderer.space-mode.options.world"),value:F.World}]}),O()],x.prototype,"limitVelocitySpaceMode",2);M([R({getPath:"generator.limitVelocityOverLifetime.dampen",setPath:"generator.limitVelocityOverLifetime.dampen"}),z({bindPath:"generator.limitVelocityOverLifetime.dampen",min:0,max:1,step:.01,dragStep:.01,label:n("effects.renderer.limit-velocity.dampen.label"),info:n("effects.renderer.limit-velocity.dampen.info")}),O()],x.prototype,"dampen",2);M([z({customComponent:K,onChange:G,min:0,yRangeMode:"positive",label:n("effects.renderer.limit-velocity.drag.label"),info:n("effects.renderer.limit-velocity.drag.info")}),O()],x.prototype,"drag",2);M([R({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize"}),z({type:A.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleSize",label:n("effects.renderer.limit-velocity.multiply-drag-by-size.label"),info:n("effects.renderer.limit-velocity.multiply-drag-by-size.info")}),O()],x.prototype,"multiplyDragByParticleSize",2);M([R({getPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",setPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity"}),z({type:A.Toggle,bindPath:"generator.limitVelocityOverLifetime.multiplyDragByParticleVelocity",label:n("effects.renderer.limit-velocity.multiply-drag-by-velocity.label"),info:n("effects.renderer.limit-velocity.multiply-drag-by-velocity.info")}),O()],x.prototype,"multiplyDragByParticleVelocity",2);M([z({customComponent:K,onChange:G}),O()],x.prototype,"forceX",2);M([z({customComponent:K,onChange:G}),O()],x.prototype,"forceY",2);M([z({customComponent:K,onChange:G}),O()],x.prototype,"forceZ",2);M([z({customComponent:Ja,onChange:Ua,label:n("effects.renderer.color-over-lifetime.label")}),O()],x.prototype,"color",2);M([z({customComponent:er,label:n("effects.renderer.noise.preview.label")})],x.prototype,"noisePreview",2);M([z({module:"noise",toggleProps:"separateAxes",toggleLabel:"effects.curve.separate-axes",axisX:"strengthX",axisY:"strengthY",axisZ:"strengthZ",mainAxis:"x",customComponent:de,onChange:(a,e,t)=>{he("separateAxes")(a,"strength",t)},label:n("effects.renderer.noise.strength.label")}),O()],x.prototype,"noiseStrength",2);M([R({getPath:"generator.noise.frequency",setPath:"generator.noise.frequency"}),z({bindPath:"generator.noise.frequency",min:1e-6,step:.1,dragStep:.1,label:n("effects.renderer.noise.frequency.label")}),O()],x.prototype,"noiseFrequency",2);M([R({getPath:"generator.noise.scrollSpeed",setPath:"generator.noise.scrollSpeed"}),z({bindPath:"generator.noise.scrollSpeed",min:0,step:.01,dragStep:.01,label:n("effects.renderer.noise.scroll-speed.label")}),O()],x.prototype,"noiseScrollSpeed",2);M([R({getPath:"generator.noise.octaveCount",setPath:"generator.noise.octaveCount"}),z({bindPath:"generator.noise.octaveCount",min:1,max:3,step:1,dragStep:1,label:n("effects.renderer.noise.octave-count.label")}),O()],x.prototype,"noiseOctaveCount",2);M([R({getPath:"generator.noise.octaveIntensityMultiplier",setPath:"generator.noise.octaveIntensityMultiplier"}),z({bindPath:"generator.noise.octaveIntensityMultiplier",min:0,max:1,step:.01,dragStep:.01,when:a=>a.noiseOctaveCount>1,label:n("effects.renderer.noise.octave-intensity-multiplier.label")}),O()],x.prototype,"noiseOctaveIntensityMultiplier",2);M([R({getPath:"generator.noise.octaveFrequencyMultiplier",setPath:"generator.noise.octaveFrequencyMultiplier"}),z({bindPath:"generator.noise.octaveFrequencyMultiplier",min:1,max:4,step:.1,dragStep:.1,when:a=>a.noiseOctaveCount>1,label:n("effects.renderer.noise.octave-frequency-multiplier.label")}),O()],x.prototype,"noiseOctaveFrequencyMultiplier",2);x=M([va({type:"ParticleRenderer",customInspector:Oa,componentsMenu:{group:"effects",label:n("component.particle-renderer.title")}})],x);export{x as ParticleRendererComponent};
@@ -1 +0,0 @@
1
- var y=Object.defineProperty;var M=(t,i,e)=>i in t?y(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var r=(t,i,e)=>(M(t,typeof i!="symbol"?i+"":i,e),e);import{j as h,P as a,k as d,p as l,C as m,m as b,e as v,n as C}from"./index-0a8702e2.js";import{a as F,A as P}from"./InstanceEditorAsset-a70e73fe.js";import"./AssetPreviewer-24e31d97.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,c=(t,i,e,n)=>{for(var o=n>1?void 0:n?g(i,e):i,p=t.length-1,u;p>=0;p--)(u=t[p])&&(o=(n?u(i,e,o):u(o))||o);return n&&o&&f(i,e,o),o};let s=class extends h{constructor(i){super(i);r(this,"dynamicFriction",.6);r(this,"staticFriction",.6);r(this,"bounciness",0);r(this,"frictionCombine",a.Average);r(this,"bounceCombine",a.Average)}async initByMain(i){const e=JSON.parse(await i.text()),n=new d;n.dynamicFriction=this.dynamicFriction=e.dynamicFriction,n.staticFriction=this.staticFriction=e.staticFriction,n.bounciness=this.bounciness=e.bounciness,n.frictionCombine=this.frictionCombine=e.frictionCombine,n.bounceCombine=this.bounceCombine=e.bounceCombine,this.bindEngineObject(n)}async initByCreation(){return this.getMainData()}destroy(){var i;super.destroy(),(i=this.engineObject)==null||i.destroy()}};c([l({type:m.Number,label:"DynamicFriction",bindPath:"dynamicFriction"}),b()],s.prototype,"dynamicFriction",2);c([l({type:m.Number,label:"StaticFriction",bindPath:"staticFriction"}),b()],s.prototype,"staticFriction",2);c([l({type:m.Number,min:0,max:1,label:"Bounciness",bindPath:"bounciness"}),b()],s.prototype,"bounciness",2);c([l({type:m.Select,label:"FrictionCombine",bindPath:"frictionCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),b()],s.prototype,"frictionCombine",2);c([l({type:m.Select,label:"BounceCombine",bindPath:"bounceCombine",options:[{label:"Average",value:a.Average},{label:"Minimum",value:a.Minimum},{label:"Multiply",value:a.Multiply},{label:"Maximum",value:a.Maximum}]}),b()],s.prototype,"bounceCombine",2);s=c([F({type:"PhysicsMaterial",label:v("asset.physics-material.title"),extname:"physMat",importMenuConfig:{type:P.Add},dragLayer:C.PhysicsMaterial,async bundle({content:t}){return{content:t}}})],s);export{s as PhysicsMaterialAsset};