@agent-spaces/server 0.2.9 → 0.3.1

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 (185) hide show
  1. package/dist/adapters/claude-code-runtime/index.js +48 -6
  2. package/dist/adapters/claude-code-runtime/message-format.js +3 -3
  3. package/dist/adapters/git.js +140 -2
  4. package/dist/agents/agent-designer.js +334 -0
  5. package/dist/agents/agent-message-parts.js +8 -0
  6. package/dist/agents/commit-agent.js +9 -2
  7. package/dist/agents/issue-task-controller.js +14 -4
  8. package/dist/app.js +53 -1
  9. package/dist/package.json +1 -1
  10. package/dist/routes/agent-sse.js +4 -1
  11. package/dist/routes/agent.js +15 -0
  12. package/dist/routes/channel.js +1 -1
  13. package/dist/routes/file.js +97 -1
  14. package/dist/routes/git.js +122 -1
  15. package/dist/routes/iframe-bookmarks.js +33 -0
  16. package/dist/routes/speech-recognition.js +80 -0
  17. package/dist/services/agent.js +48 -5
  18. package/dist/services/builtin-tools.js +67 -1
  19. package/dist/services/channel.js +2 -0
  20. package/dist/services/command-process-manager.js +14 -1
  21. package/dist/services/file.js +86 -6
  22. package/dist/services/gitignore.js +65 -0
  23. package/dist/services/issue-retry.js +2 -1
  24. package/dist/services/issue.js +2 -2
  25. package/dist/services/notification-hub/bot-agent.js +9 -1
  26. package/dist/services/persistent-agent-context.js +155 -0
  27. package/dist/services/pty.js +47 -2
  28. package/dist/services/search.js +11 -3
  29. package/dist/services/speech-recognition/base.js +3 -0
  30. package/dist/services/speech-recognition/index.js +16 -0
  31. package/dist/services/speech-recognition/tencent.js +112 -0
  32. package/dist/storage/iframe-bookmarks-store.js +46 -0
  33. package/dist/storage/speech-recognition-store.js +58 -0
  34. package/dist/web/404.html +1 -1
  35. package/dist/web/__next.__PAGE__.txt +4 -4
  36. package/dist/web/__next._full.txt +31 -26
  37. package/dist/web/__next._head.txt +4 -4
  38. package/dist/web/__next._index.txt +17 -13
  39. package/dist/web/__next._tree.txt +2 -2
  40. package/dist/web/_next/static/chunks/0-mtp2au0a0nh.js +189 -0
  41. package/dist/web/_next/static/chunks/00amm3dvu3po9.js +31 -0
  42. package/dist/web/_next/static/chunks/02unyp1obddyn.js +3 -0
  43. package/dist/web/_next/static/chunks/{0-vgd3j-zh3m8.js → 05iy4.c-1cfhd.js} +1 -1
  44. package/dist/web/_next/static/chunks/0d.v1csiyl.1~.js +2 -0
  45. package/dist/web/_next/static/chunks/0egot8y~i-ge3.js +1 -0
  46. package/dist/web/_next/static/chunks/0e~0o6v_awcod.js +1 -0
  47. package/dist/web/_next/static/chunks/0fpf.rso9mhc0.js +1 -0
  48. package/dist/web/_next/static/chunks/0glol5jdarfma.js +2 -0
  49. package/dist/web/_next/static/chunks/0m1ud--um8kjh.js +1 -0
  50. package/dist/web/_next/static/chunks/0o6w-uw2p.phy.js +5 -0
  51. package/dist/web/_next/static/chunks/0os7q6w~-tmg7.css +1 -0
  52. package/dist/web/_next/static/chunks/0plreh4_gkxf9.js +1 -0
  53. package/dist/web/_next/static/chunks/0u7_qd9hzqwac.js +1 -0
  54. package/dist/web/_next/static/chunks/0vesz93a98px4.js +1 -0
  55. package/dist/web/_next/static/chunks/0w3o.7vi.dlm6.js +1 -0
  56. package/dist/web/_next/static/chunks/0xtmr0y4vo-~p.js +1 -0
  57. package/dist/web/_next/static/chunks/0~3uikgc074il.js +1 -0
  58. package/dist/web/_next/static/chunks/{0y5ipuqgqfrob.js → 0~xn0gfqxa20r.js} +3 -3
  59. package/dist/web/_next/static/chunks/11ozf700niy2z.js +1 -0
  60. package/dist/web/_next/static/chunks/{0jmsjlawtg6oa.js → 145gbwitjxamg.js} +1 -1
  61. package/dist/web/_next/static/chunks/{turbopack-0lxiiw.jhevml.js → turbopack-0kcwat8.leugk.js} +1 -1
  62. package/dist/web/_not-found/__next._full.txt +34 -30
  63. package/dist/web/_not-found/__next._head.txt +4 -4
  64. package/dist/web/_not-found/__next._index.txt +17 -13
  65. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
  66. package/dist/web/_not-found/__next._not-found.txt +3 -3
  67. package/dist/web/_not-found/__next._tree.txt +2 -2
  68. package/dist/web/_not-found.html +1 -1
  69. package/dist/web/_not-found.txt +34 -30
  70. package/dist/web/index.html +1 -1
  71. package/dist/web/index.txt +31 -26
  72. package/dist/web/login/__next._full.txt +35 -29
  73. package/dist/web/login/__next._head.txt +4 -4
  74. package/dist/web/login/__next._index.txt +17 -13
  75. package/dist/web/login/__next._tree.txt +2 -2
  76. package/dist/web/login/__next.login.__PAGE__.txt +4 -4
  77. package/dist/web/login/__next.login.txt +3 -3
  78. package/dist/web/login.html +1 -1
  79. package/dist/web/login.txt +35 -29
  80. package/dist/web/settings/__next._full.txt +36 -34
  81. package/dist/web/settings/__next._head.txt +4 -4
  82. package/dist/web/settings/__next._index.txt +17 -13
  83. package/dist/web/settings/__next._tree.txt +2 -2
  84. package/dist/web/settings/__next.settings.__PAGE__.txt +4 -4
  85. package/dist/web/settings/__next.settings.txt +5 -5
  86. package/dist/web/settings/agents/__next._full.txt +38 -35
  87. package/dist/web/settings/agents/__next._head.txt +4 -4
  88. package/dist/web/settings/agents/__next._index.txt +17 -13
  89. package/dist/web/settings/agents/__next._tree.txt +2 -2
  90. package/dist/web/settings/agents/__next.settings.agents.__PAGE__.txt +4 -4
  91. package/dist/web/settings/agents/__next.settings.agents.txt +3 -3
  92. package/dist/web/settings/agents/__next.settings.txt +5 -5
  93. package/dist/web/settings/agents.html +1 -1
  94. package/dist/web/settings/agents.txt +38 -35
  95. package/dist/web/settings/mcps/__next._full.txt +38 -35
  96. package/dist/web/settings/mcps/__next._head.txt +4 -4
  97. package/dist/web/settings/mcps/__next._index.txt +17 -13
  98. package/dist/web/settings/mcps/__next._tree.txt +2 -2
  99. package/dist/web/settings/mcps/__next.settings.mcps.__PAGE__.txt +4 -4
  100. package/dist/web/settings/mcps/__next.settings.mcps.txt +3 -3
  101. package/dist/web/settings/mcps/__next.settings.txt +5 -5
  102. package/dist/web/settings/mcps.html +1 -1
  103. package/dist/web/settings/mcps.txt +38 -35
  104. package/dist/web/settings/models/__next._full.txt +38 -35
  105. package/dist/web/settings/models/__next._head.txt +4 -4
  106. package/dist/web/settings/models/__next._index.txt +17 -13
  107. package/dist/web/settings/models/__next._tree.txt +2 -2
  108. package/dist/web/settings/models/__next.settings.models.__PAGE__.txt +4 -4
  109. package/dist/web/settings/models/__next.settings.models.txt +3 -3
  110. package/dist/web/settings/models/__next.settings.txt +5 -5
  111. package/dist/web/settings/models.html +1 -1
  112. package/dist/web/settings/models.txt +38 -35
  113. package/dist/web/settings/providers/__next._full.txt +38 -35
  114. package/dist/web/settings/providers/__next._head.txt +4 -4
  115. package/dist/web/settings/providers/__next._index.txt +17 -13
  116. package/dist/web/settings/providers/__next._tree.txt +2 -2
  117. package/dist/web/settings/providers/__next.settings.providers.__PAGE__.txt +4 -4
  118. package/dist/web/settings/providers/__next.settings.providers.txt +3 -3
  119. package/dist/web/settings/providers/__next.settings.txt +5 -5
  120. package/dist/web/settings/providers.html +1 -1
  121. package/dist/web/settings/providers.txt +38 -35
  122. package/dist/web/settings/skills/__next._full.txt +38 -35
  123. package/dist/web/settings/skills/__next._head.txt +4 -4
  124. package/dist/web/settings/skills/__next._index.txt +17 -13
  125. package/dist/web/settings/skills/__next._tree.txt +2 -2
  126. package/dist/web/settings/skills/__next.settings.skills.__PAGE__.txt +4 -4
  127. package/dist/web/settings/skills/__next.settings.skills.txt +3 -3
  128. package/dist/web/settings/skills/__next.settings.txt +5 -5
  129. package/dist/web/settings/skills.html +1 -1
  130. package/dist/web/settings/skills.txt +38 -35
  131. package/dist/web/settings.html +1 -1
  132. package/dist/web/settings.txt +36 -34
  133. package/dist/web/workflows/__next._full.txt +36 -31
  134. package/dist/web/workflows/__next._head.txt +4 -4
  135. package/dist/web/workflows/__next._index.txt +17 -13
  136. package/dist/web/workflows/__next._tree.txt +2 -2
  137. package/dist/web/workflows/__next.workflows.__PAGE__.txt +4 -4
  138. package/dist/web/workflows/__next.workflows.txt +3 -3
  139. package/dist/web/workflows.html +1 -1
  140. package/dist/web/workflows.txt +36 -31
  141. package/dist/web/workspace/_/__next._full.txt +39 -34
  142. package/dist/web/workspace/_/__next._head.txt +4 -4
  143. package/dist/web/workspace/_/__next._index.txt +17 -13
  144. package/dist/web/workspace/_/__next._tree.txt +2 -2
  145. package/dist/web/workspace/_/__next.workspace.$d$id.__PAGE__.txt +3 -3
  146. package/dist/web/workspace/_/__next.workspace.$d$id.txt +3 -3
  147. package/dist/web/workspace/_/__next.workspace.txt +3 -3
  148. package/dist/web/workspace/_.html +1 -1
  149. package/dist/web/workspace/_.txt +39 -34
  150. package/dist/web/workspaces/__next._full.txt +35 -30
  151. package/dist/web/workspaces/__next._head.txt +4 -4
  152. package/dist/web/workspaces/__next._index.txt +17 -13
  153. package/dist/web/workspaces/__next._tree.txt +2 -2
  154. package/dist/web/workspaces/__next.workspaces.__PAGE__.txt +4 -4
  155. package/dist/web/workspaces/__next.workspaces.txt +3 -3
  156. package/dist/web/workspaces.html +1 -1
  157. package/dist/web/workspaces.txt +35 -30
  158. package/dist/ws/agent-prompt.js +48 -18
  159. package/dist/ws/agent-runner.js +4 -1
  160. package/dist/ws/message-parts.js +8 -0
  161. package/dist/ws/terminal-handler.js +1 -1
  162. package/package.json +1 -1
  163. package/public/avatars/1778953228323-5je54x-user.jpg +0 -0
  164. package/public/avatars/1778954057880-g01q6y-user.jpg +0 -0
  165. package/dist/web/_next/static/chunks/0.~n0s82y4zh_.css +0 -1
  166. package/dist/web/_next/static/chunks/002-dxhags4dj.js +0 -2
  167. package/dist/web/_next/static/chunks/02duknlg3rgjp.js +0 -1
  168. package/dist/web/_next/static/chunks/02wkg1tjv~_t2.js +0 -1
  169. package/dist/web/_next/static/chunks/03jy~o.gx._e-.js +0 -3
  170. package/dist/web/_next/static/chunks/04zxh2e-4~-xs.js +0 -1
  171. package/dist/web/_next/static/chunks/07bs5ds68tg38.js +0 -2
  172. package/dist/web/_next/static/chunks/082lp-xqv7r.-.js +0 -183
  173. package/dist/web/_next/static/chunks/0b2tump5duj9j.js +0 -1
  174. package/dist/web/_next/static/chunks/0csqa76ud3h4d.js +0 -1
  175. package/dist/web/_next/static/chunks/0n0j7tw_y1qk2.js +0 -1
  176. package/dist/web/_next/static/chunks/0pep4mkvt3.rh.js +0 -31
  177. package/dist/web/_next/static/chunks/0tkii3.lkbu3u.js +0 -1
  178. package/dist/web/_next/static/chunks/0wz8~mvztv-vq.js +0 -1
  179. package/dist/web/_next/static/chunks/0zl19l5tuoppw.js +0 -1
  180. package/dist/web/_next/static/chunks/0zxtxecpqyoeh.js +0 -1
  181. package/dist/web/_next/static/chunks/12sucjx_z8ftc.js +0 -1
  182. package/dist/web/_next/static/chunks/15_n_khh8cuax.js +0 -5
  183. /package/dist/web/_next/static/{hGfVPALj5nbwettayL9DY → 4dBAEZ275uRqcyeaRmXSx}/_buildManifest.js +0 -0
  184. /package/dist/web/_next/static/{hGfVPALj5nbwettayL9DY → 4dBAEZ275uRqcyeaRmXSx}/_clientMiddlewareManifest.js +0 -0
  185. /package/dist/web/_next/static/{hGfVPALj5nbwettayL9DY → 4dBAEZ275uRqcyeaRmXSx}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,564822,t=>{"use strict";var e=t.i(764556);t.s(["useIsMobile",0,function(){let[t,i]=e.useState(void 0);return e.useEffect(()=>{let t=window.matchMedia("(max-width: 767px)"),e=()=>{i(window.innerWidth<768)};return t.addEventListener("change",e),i(window.innerWidth<768),()=>t.removeEventListener("change",e)},[]),!!t}])},14452,t=>{"use strict";var e=t.i(344180),i=t.i(724966),n=t.i(465458),s=t.i(260218),r=t.i(422373);function a({...t}){return(0,e.jsx)(i.Dialog.Portal,{"data-slot":"sheet-portal",...t})}function o({className:t,...s}){return(0,e.jsx)(i.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,n.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",t),...s})}t.s(["Sheet",0,function({...t}){return(0,e.jsx)(i.Dialog.Root,{"data-slot":"sheet",...t})},"SheetContent",0,function({className:t,children:l,side:h="right",showCloseButton:u=!0,...c}){return(0,e.jsxs)(a,{children:[(0,e.jsx)(o,{}),(0,e.jsxs)(i.Dialog.Popup,{"data-slot":"sheet-content","data-side":h,className:(0,n.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:top-[var(--app-top-inset)] data-[side=left]:bottom-0 data-[side=left]:left-0 data-[side=left]:h-[calc(100dvh-var(--app-top-inset))] data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:top-[var(--app-top-inset)] data-[side=right]:right-0 data-[side=right]:bottom-0 data-[side=right]:h-[calc(100dvh-var(--app-top-inset))] data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-[var(--app-top-inset)] data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...c,children:[l,u&&(0,e.jsxs)(i.Dialog.Close,{"data-slot":"sheet-close",render:(0,e.jsx)(s.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,e.jsx)(r.XIcon,{}),(0,e.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:t,...s}){return(0,e.jsx)(i.Dialog.Description,{"data-slot":"sheet-description",className:(0,n.cn)("text-sm text-muted-foreground",t),...s})},"SheetHeader",0,function({className:t,...i}){return(0,e.jsx)("div",{"data-slot":"sheet-header",className:(0,n.cn)("flex flex-col gap-0.5 p-4",t),...i})},"SheetTitle",0,function({className:t,...s}){return(0,e.jsx)(i.Dialog.Title,{"data-slot":"sheet-title",className:(0,n.cn)("font-heading text-base font-medium text-foreground",t),...s})}])},570606,t=>{"use strict";var e,i,n=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=(e=function(t){return n.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&91>t.charCodeAt(2)},i=Object.create(null),function(t){return void 0===i[t]&&(i[t]=e(t)),i[t]});t.s(["default",0,s],570606)},341807,t=>{"use strict";let e,i,n,s,r=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],a=new Set(r),o=(t,e,i)=>i>e?e:i<t?t:i,l={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},h={...l,transform:t=>o(0,1,t)},u={...l,default:1},c=t=>Math.round(1e5*t)/1e5,d=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,p=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,m=(t,e)=>i=>!!("string"==typeof i&&p.test(i)&&i.startsWith(t)||e&&null!=i&&Object.prototype.hasOwnProperty.call(i,e)),f=(t,e,i)=>n=>{if("string"!=typeof n)return n;let[s,r,a,o]=n.match(d);return{[t]:parseFloat(s),[e]:parseFloat(r),[i]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},y={...l,transform:t=>Math.round(o(0,255,t))},g={test:m("rgb","red"),parse:f("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+y.transform(t)+", "+y.transform(e)+", "+y.transform(i)+", "+c(h.transform(n))+")"},v={test:m("#"),parse:function(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}},transform:g.transform},w=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),x=w("deg"),b=w("%"),S=w("px"),T=w("vh"),k=w("vw"),P={...b,parse:t=>b.parse(t)/100,transform:t=>b.transform(100*t)},A={test:m("hsl","hue"),parse:f("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+b.transform(c(e))+", "+b.transform(c(i))+", "+c(h.transform(n))+")"},C={test:t=>g.test(t)||v.test(t)||A.test(t),parse:t=>g.test(t)?g.parse(t):A.test(t)?A.parse(t):v.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?g.transform(t):A.transform(t),getAnimatableNone:t=>{let e=C.parse(t);return e.alpha=0,C.transform(e)}},E=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,M="number",V="color",D=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function R(t){let e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[],r=0,a=e.replace(D,t=>(C.test(t)?(n.color.push(r),s.push(V),i.push(C.parse(t))):t.startsWith("var(")?(n.var.push(r),s.push("var"),i.push(t)):(n.number.push(r),s.push(M),i.push(parseFloat(t))),++r,"${}")).split("${}");return{values:i,split:a,indexes:n,types:s}}function L({split:t,types:e}){let i=t.length;return n=>{let s="";for(let r=0;r<i;r++)if(s+=t[r],void 0!==n[r]){let t=e[r];t===M?s+=c(n[r]):t===V?s+=C.transform(n[r]):s+=n[r]}return s}}let j={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(d)?.length||0)+(t.match(E)?.length||0)>0},parse:function(t){return R(t).values},createTransformer:function(t){return L(R(t))},getAnimatableNone:function(t){let e=R(t);return L(e)(e.values.map((t,i)=>((t,e)=>"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof t?0:C.test(t)?C.getAnimatableNone(t):t)(t,e.split[i])))}},I=new Set(["brightness","contrast","saturate","opacity"]);function F(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[n]=i.match(d)||[];if(!n)return t;let s=i.replace(n,""),r=+!!I.has(e);return n!==i&&(r*=100),e+"("+r+s+")"}let O=/\b([a-z-]*)\(.*?\)/gu,B={...j,getAnimatableNone:t=>{let e=t.match(O);return e?e.map(F).join(" "):t}},$={...j,getAnimatableNone:t=>{let e=j.parse(t);return j.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},U={...l,transform:Math.round},N={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,rotate:x,rotateX:x,rotateY:x,rotateZ:x,scale:u,scaleX:u,scaleY:u,scaleZ:u,skew:x,skewX:x,skewY:x,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:h,originX:P,originY:P,originZ:S,zIndex:U,fillOpacity:h,strokeOpacity:h,numOctaves:U},W={...N,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:B,WebkitFilter:B,mask:$,WebkitMask:$},z=t=>W[t],H=()=>({translate:0,scale:1,origin:0,originPoint:0}),X=()=>({x:H(),y:H()}),Y=()=>({min:0,max:0}),q=()=>({x:Y(),y:Y()}),K=t=>!!(t&&t.getVelocity),G=new Set(["width","height","top","left","right","bottom",...r]),J=t=>e=>e.test(t),_=[l,S,b,x,k,T,{test:t=>"auto"===t,parse:t=>t}],Z=t=>_.find(J(t));var Q,tt=t.i(8890);let te=()=>{},ti=()=>{};tt.default;let tn=t=>e=>"string"==typeof e&&e.startsWith(t),ts=tn("--"),tr=tn("var(--"),ta=t=>!!tr(t)&&to.test(t.split("/*")[0].trim()),to=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function tl(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}let th=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,tu=t=>180*t/Math.PI,tc=t=>tp(tu(Math.atan2(t[1],t[0]))),td={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:tc,rotateZ:tc,skewX:t=>tu(Math.atan(t[1])),skewY:t=>tu(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tp=t=>((t%=360)<0&&(t+=360),t),tm=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),tf=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ty={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tm,scaleY:tf,scale:t=>(tm(t)+tf(t))/2,rotateX:t=>tp(tu(Math.atan2(t[6],t[5]))),rotateY:t=>tp(tu(Math.atan2(-t[2],t[0]))),rotateZ:tc,rotate:tc,skewX:t=>tu(Math.atan(t[4])),skewY:t=>tu(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function tg(t){return+!!t.includes("scale")}function tv(t,e){let i,n;if(!t||"none"===t)return tg(e);let s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(s)i=ty,n=s;else{let e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=td,n=e}if(!n)return tg(e);let r=i[e],a=n[1].split(",").map(tw);return"function"==typeof r?r(a):a[r]}function tw(t){return parseFloat(t.trim())}let tx=t=>t===l||t===S,tb=new Set(["x","y","z"]),tS=r.filter(t=>!tb.has(t)),tT={width:({x:t},{paddingLeft:e="0",paddingRight:i="0",boxSizing:n})=>{let s=t.max-t.min;return"border-box"===n?s:s-parseFloat(e)-parseFloat(i)},height:({y:t},{paddingTop:e="0",paddingBottom:i="0",boxSizing:n})=>{let s=t.max-t.min;return"border-box"===n?s:s-parseFloat(e)-parseFloat(i)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>tv(e,"x"),y:(t,{transform:e})=>tv(e,"y")};tT.translateX=tT.x,tT.translateY=tT.y;let tk=t=>t,tP={},tA=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tC(t,e){let i=!1,n=!0,s={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,a=tA.reduce((t,i)=>(t[i]=function(t,e){let i=new Set,n=new Set,s=!1,r=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){a.has(e)&&(u.schedule(e),t()),l++,e(o)}let u={schedule:(t,e=!1,r=!1)=>{let o=r&&s?i:n;return e&&a.add(t),o.add(t),t},cancel:t=>{n.delete(t),a.delete(t)},process:t=>{if(o=t,s){r=!0;return}s=!0;let a=i;i=n,n=a,i.forEach(h),e,l=0,i.clear(),s=!1,r&&(r=!1,u.process(t))}};return u}(r,e?i:void 0),t),{}),{setup:o,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=a,f=()=>{let r=tP.useManualTiming,a=r?s.timestamp:performance.now();i=!1,r||(s.delta=n?1e3/60:Math.max(Math.min(a-s.timestamp,40),1)),s.timestamp=a,s.isProcessing=!0,o.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(f))};return{schedule:tA.reduce((e,r)=>{let o=a[r];return e[r]=(e,r=!1,a=!1)=>(!i&&(i=!0,n=!0,s.isProcessing||t(f)),o.schedule(e,r,a)),e},{}),cancel:t=>{for(let e=0;e<tA.length;e++)a[tA[e]].cancel(t)},state:s,steps:a}}let{schedule:tE,cancel:tM,state:tV,steps:tD}=tC("u">typeof requestAnimationFrame?requestAnimationFrame:tk,!0),tR=new Set,tL=!1,tj=!1,tI=!1;function tF(){if(tj){let t=Array.from(tR).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{let e,n=(e=[],tS.forEach(i=>{let n=t.getValue(i);void 0!==n&&(e.push([i,n.get()]),n.set(+!!i.startsWith("scale")))}),e);n.length&&(i.set(t,n),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}tj=!1,tL=!1,tR.forEach(t=>t.complete(tI)),tR.clear()}function tO(){tR.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(tj=!0)})}class tB{constructor(t,e,i,n,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=n,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(tR.add(this),tL||(tL=!0,tE.read(tO),tE.resolveKeyframes(tF))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:i,motionValue:n}=this;if(null===t[0]){let s=n?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(i&&e){let n=i.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===s&&n.set(t[0])}for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),tR.delete(this)}cancel(){"scheduled"===this.state&&(tR.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let t$=new Set([B,$]);function tU(t,e){let i=z(t);return t$.has(i)||(i=j),i.getAnimatableNone?i.getAnimatableNone(e):void 0}let tN=new Set(["auto","none","0"]);class tW extends tB{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let n=t[i];if("string"==typeof n&&ta(n=n.trim())){let s=function t(e,i,n=1){ti(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[s,r]=function(t){let e=th.exec(t);if(!e)return[,];let[,i,n,s]=e;return[`--${i??n}`,s]}(e);if(!s)return;let a=window.getComputedStyle(i).getPropertyValue(s);if(a){let t=a.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t)?parseFloat(t):t}return ta(r)?t(r,i,n+1):r}(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!G.has(i)||2!==t.length)return;let[n,s]=t,r=Z(n),a=Z(s);if(tl(n)!==tl(s)&&tT[i]){this.needsMeasurement=!0;return}if(r!==a)if(tx(r)&&tx(a))for(let e=0;e<t.length;e++){let i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else tT[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||function(t){if("number"==typeof t)return 0===t;if(null===t)return!0;return"none"===t||"0"===t||/^0[^.\s]+$/u.test(t)}(t[e]))&&i.push(e);i.length&&function(t,e,i){let n,s=0;for(;s<t.length&&!n;){let e=t[s];"string"==typeof e&&!tN.has(e)&&R(e).values.length&&(n=t[s]),s++}if(n&&i)for(let s of e)t[s]=tU(i,n)}(t,i,e)}measureInitialState(){let{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tT[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;let n=e[e.length-1];void 0!==n&&t.getValue(i,n).jump(n,!1)}measureEndState(){let{element:t,name:e,unresolvedKeyframes:i}=this;if(!t||!t.current)return;let n=t.getValue(e);n&&n.jump(this.measuredOrigin,!1);let s=i.length-1,r=i[s];i[s]=tT[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}let tz=t=>1e3*t;function tH(t,e){-1===t.indexOf(e)&&t.push(e)}function tX(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)}class tY{constructor(){this.subscriptions=[]}add(t){return tH(this.subscriptions,t),()=>tX(this.subscriptions,t)}notify(t,e,i){let n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,i);else for(let s=0;s<n;s++){let n=this.subscriptions[s];n&&n(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function tq(t,e,i){e.startsWith("--")?t.style.setProperty(e,i):t.style[e]=i}function tK(t){let e;return()=>(void 0===e&&(e=t()),e)}let tG={};function tJ(t,e){let i=tK(t);return()=>tG[e]??i()}let t_=tJ(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),tZ=t=>null!==t;function tQ(t,{repeat:e,repeatType:i="loop"},n,s=1){let r=t.filter(tZ),a=s<0||e&&"loop"!==i&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class t0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}let t1={layout:0,mainThread:0,waapi:0},t2=t=>Array.isArray(t)&&"number"==typeof t[0],t3=tJ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),t5=(t,e,i=10)=>{let n="",s=Math.max(Math.round(e/i),2);for(let e=0;e<s;e++)n+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},t9=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,t4={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:t9([0,.65,.55,1]),circOut:t9([.55,0,1,.45]),backIn:t9([.31,.01,.66,-.59]),backOut:t9([.33,1.53,.69,.99])};function t6(t){return"function"==typeof t&&"applyToOptions"in t}class t7 extends t0{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:n,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=!!s,this.allowFlatten=r,this.options=t,ti("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return t6(t)&&t3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,i,{delay:n=0,duration:s=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},h){let u={[e]:i};l&&(u.offset=l);let c=function t(e,i){if(e)return"function"==typeof e?t3()?t5(e,i):"ease-out":t2(e)?t9(e):Array.isArray(e)?e.map(e=>t(e,i)||t4.easeOut):t4[e]}(o,s);Array.isArray(c)&&(u.easing=c);let d={delay:n,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};h&&(d.pseudoElement=h);let p=t.animate(u,d);return p}(e,i,n,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let t=tQ(n,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),tq(e,i,t),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(t){let e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=tz(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:i,observe:n}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&t_())?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),i&&(this.animation.rangeEnd=i),tk):n(this)}}let t8=new Set(["opacity","clipPath","filter","transform"]),{schedule:et}=tC(queueMicrotask,!1);function ee(){i=void 0}let ei={now:()=>(void 0===i&&ei.set(tV.isProcessing||tP.useManualTiming?tV.timestamp:performance.now()),i),set:t=>{i=t,queueMicrotask(ee)}};class en{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{let e=ei.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=ei.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new tY);let i=this.events[t].add(e);return"change"===t?()=>{i(),tE.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return e&&e.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=ei.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function es(t,e){return new en(t,e)}let er=[..._,C,j],ea=new WeakMap;function eo(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function el(t){return"string"==typeof t||Array.isArray(t)}let eh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],eu=["initial",...eh];function ec(t){return eo(t.animate)||eu.some(e=>el(t[e]))}function ed(t){return!!(ec(t)||t.variants)}let ep={current:null},em={current:!1},ef="u">typeof window;function ey(t){let e=[{},{}];return t?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function eg(t,e,i,n){if("function"==typeof e){let[s,r]=ey(n);e=e(void 0!==i?i:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[s,r]=ey(n);e=e(void 0!==i?i:t.custom,s,r)}return e}let ev=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ew={};class ex{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,skipAnimations:s,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=tB,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let t=ei.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,tE.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=s,this.options=o,this.blockInitialAnimation=!!r,this.isControllingVariants=ec(e),this.isVariantNode=ed(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==l[t]&&K(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(let t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,ea.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(em.current||function(){if(em.current=!0,ef)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ep.current=t.matches;t.addEventListener("change",e),e()}else ep.current=!1}(),this.shouldReduceMotion=ep.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let t in this.projection&&this.projection.unmount(),tM(this.notifyUpdate),tM(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){let i;if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&t8.has(t)&&this.current instanceof HTMLElement){let{factory:i,keyframes:n,times:s,ease:r,duration:a}=e.accelerate,o=new t7({element:this.current,name:t,keyframes:n,times:s,ease:r,duration:tz(a)}),l=i(o);this.valueSubscriptions.set(t,()=>{l(),o.cancel()});return}let n=a.has(t);n&&this.onBindTransform&&this.onBindTransform();let s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tE.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ew){let e=ew[t];if(!e)continue;let{isEnabled:i,Feature:n}=e;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):q()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ev.length;e++){let i=ev[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let n=t["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=function(t,e,i){for(let n in e){let s=e[n],r=i[n];if(K(s))t.addValue(n,s);else if(K(r))t.addValue(n,es(s,{owner:t}));else if(r!==s)if(t.hasValue(n)){let e=t.getValue(n);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{let e=t.getStaticValue(n);t.addValue(n,es(void 0!==e?e:s,{owner:t}))}}for(let n in i)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){let i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=es(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];if(null!=i){let n,s;if("string"==typeof i&&(n=i,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n)||(s=i,/^0[^.\s]+$/u.test(s))))i=parseFloat(i);else{let n;n=i,!er.find(J(n))&&j.test(e)&&(i=tU(t,e))}this.setBaseTarget(t,K(i)?i.get():i)}return K(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){let e,{initial:i}=this.props;if("string"==typeof i||"object"==typeof i){let n=eg(this.props,i,this.presenceContext?.custom);n&&(e=n[t])}if(i&&void 0!==e)return e;let n=this.getBaseTargetFromProps(this.props,t);return void 0===n||K(n)?void 0!==this.initialValues[t]&&void 0===e?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new tY),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){et.render(this.render)}}class eb extends ex{constructor(){super(...arguments),this.KeyframeResolver=tW}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){let i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;K(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function eS(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}let eT=(t,e)=>e&&"number"==typeof t?e.transform(t):t,ek={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eP=r.length;function eA(t,e,i){let{style:n,vars:s,transformOrigin:o}=t,l=!1,h=!1;for(let t in e){let i=e[t];if(a.has(t)){l=!0;continue}if(ts(t)){s[t]=i;continue}{let e=eT(i,N[t]);t.startsWith("origin")?(h=!0,o[t]=e):n[t]=e}}if(!e.transform&&(l||i?n.transform=function(t,e,i){let n="",s=!0;for(let a=0;a<eP;a++){let o=r[a],l=t[o];if(void 0===l)continue;let h=!0;if("number"==typeof l)h=l===+!!o.startsWith("scale");else{let t=parseFloat(l);h=o.startsWith("scale")?1===t:0===t}if(!h||i){let t=eT(l,N[o]);if(!h){s=!1;let e=ek[o]||o;n+=`${e}(${t}) `}i&&(e[o]=t)}}return n=n.trim(),i?n=i(e,s?"":n):s&&(n="none"),n}(e,t.transform,i):n.transform&&(n.transform="none")),h){let{originX:t="50%",originY:e="50%",originZ:i=0}=o;n.transformOrigin=`${t} ${e} ${i}`}}let eC={offset:"stroke-dashoffset",array:"stroke-dasharray"},eE={offset:"strokeDashoffset",array:"strokeDasharray"},eM=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eV(t,{attrX:e,attrY:i,attrScale:n,pathLength:s,pathSpacing:r=1,pathOffset:a=0,...o},l,h,u){if(eA(t,o,h),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:c,style:d}=t;for(let t of(c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox),eM))void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==i&&(c.y=i),void 0!==n&&(c.scale=n),void 0!==s&&function(t,e,i=1,n=0,s=!0){t.pathLength=1;let r=s?eC:eE;t[r.offset]=`${-n}`,t[r.array]=`${e} ${i}`}(c,s,r,a,!1)}let eD=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),eR=t=>"string"==typeof t&&"svg"===t.toLowerCase();function eL(t,{style:e,vars:i},n,s){let r,a=t.style;for(r in e)a[r]=e[r];for(r in s?.applyProjectionStyles(a,n),i)a.setProperty(r,i[r])}function ej(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let eI={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t)if(!S.test(t))return t;else t=parseFloat(t);let i=ej(t,e.target.x),n=ej(t,e.target.y);return`${i}% ${n}%`}},eF=(t,e,i)=>t+(e-t)*i,eO={borderRadius:{...eI,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:eI,borderTopRightRadius:eI,borderBottomLeftRadius:eI,borderBottomRightRadius:eI,boxShadow:{correct:(t,{treeScale:e,projectionDelta:i})=>{let n=j.parse(t);if(n.length>5)return t;let s=j.createTransformer(t),r=+("number"!=typeof n[0]),a=i.x.scale*e.x,o=i.y.scale*e.y;n[0+r]/=a,n[1+r]/=o;let l=eF(a,o,.5);return"number"==typeof n[2+r]&&(n[2+r]/=l),"number"==typeof n[3+r]&&(n[3+r]/=l),s(n)}}};function eB(t,{layout:e,layoutId:i}){return a.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!eO[t]||"opacity"===t)}function e$(t,e,i){let n=t.style,s=e?.style,r={};if(!n)return r;for(let e in n)(K(n[e])||s&&K(s[e])||eB(e,t)||i?.getValue(e)?.liveStyle!==void 0)&&(r[e]=n[e]);return r}function eU(t,e,i){let n=e$(t,e,i);for(let i in t)(K(t[i])||K(e[i]))&&(n[-1!==r.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return n}class eN extends eb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=q}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(a.has(e)){let t=z(e);return t&&t.default||0}return e=eD.has(e)?e:eS(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return eU(t,e,i)}build(t,e,i){eV(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){for(let i in eL(t,e,void 0,n),e.attrs)t.setAttribute(eD.has(i)?i:eS(i),e.attrs[i])}mount(t){this.isSVGTag=eR(t.tagName),super.mount(t)}}function eW({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function ez(t){return void 0===t||1===t}function eH({scale:t,scaleX:e,scaleY:i}){return!ez(t)||!ez(e)||!ez(i)}function eX(t){return eH(t)||eY(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function eY(t){var e,i;return(e=t.x)&&"0%"!==e||(i=t.y)&&"0%"!==i}function eq(t,e,i,n,s){return void 0!==s&&(t=n+s*(t-n)),n+i*(t-n)+e}function eK(t,e=0,i=1,n,s){t.min=eq(t.min,e,i,n,s),t.max=eq(t.max,e,i,n,s)}function eG(t,{x:e,y:i}){eK(t.x,e.translate,e.scale,e.originPoint),eK(t.y,i.translate,i.scale,i.originPoint)}function eJ(t,e){t.min+=e,t.max+=e}function e_(t,e,i,n,s=.5){let r=eF(t.min,t.max,s);eK(t,e,i,r,n)}function eZ(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function eQ(t,e,i){let n=i??t;e_(t.x,eZ(e.x,n.x),e.scaleX,e.scale,e.originX),e_(t.y,eZ(e.y,n.y),e.scaleY,e.scale,e.originY)}function e0(t,e){return eW(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}class e1 extends eb{constructor(){super(...arguments),this.type="html",this.renderInstance=eL}readValueFromInstance(t,e){if(a.has(e))return this.projection?.isProjecting?tg(e):((t,e)=>{let{transform:i="none"}=getComputedStyle(t);return tv(i,e)})(t,e);{let i=window.getComputedStyle(t),n=(ts(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:e}){return e0(t,e)}build(t,e,i){eA(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return e$(t,e,i)}}var e2=t.i(764556);let e3=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function e5(t){if("string"!=typeof t||t.includes("-"));else if(e3.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}var e9=t.i(344180);let e4=(0,e2.createContext)({}),e6=(0,e2.createContext)({strict:!1}),e7=(0,e2.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),e8=(0,e2.createContext)({});function it(t){return Array.isArray(t)?t.join(" "):t}let ie=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ii(t,e,i){for(let n in e)K(e[n])||eB(n,i)||(t[n]=e[n])}let is=()=>({...ie(),attrs:{}}),ir=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ia(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ir.has(t)}let io=t=>!ia(t);try{Q=t.r(570606).default,"function"==typeof Q&&(io=t=>t.startsWith("on")?!ia(t):Q(t))}catch{}function il(t){return K(t)?t.get():t}let ih=(0,e2.createContext)(null),iu=t=>(e,i)=>{let n,s=(0,e2.useContext)(e8),r=(0,e2.useContext)(ih),a=()=>(function({scrapeMotionValuesFromProps:t,createRenderState:e},i,n,s){return{latestValues:function(t,e,i,n){let s={},r=n(t,{});for(let t in r)s[t]=il(r[t]);let{initial:a,animate:o}=t,l=ec(t),h=ed(t);e&&h&&!l&&!1!==t.inherit&&(void 0===a&&(a=e.initial),void 0===o&&(o=e.animate));let u=!!i&&!1===i.initial,c=(u=u||!1===a)?o:a;if(c&&"boolean"!=typeof c&&!eo(c)){let e=Array.isArray(c)?c:[c];for(let i=0;i<e.length;i++){let n=eg(t,e[i]);if(n){let{transitionEnd:t,transition:e,...i}=n;for(let t in i){let e=i[t];if(Array.isArray(e)){let t=u?e.length-1:0;e=e[t]}null!==e&&(s[t]=e)}for(let e in t)s[e]=t[e]}}}return s}(i,n,s,t),renderState:e()}})(t,e,s,r);return i?a():(null===(n=(0,e2.useRef)(null)).current&&(n.current=a()),n.current)},ic=iu({scrapeMotionValuesFromProps:e$,createRenderState:ie}),id=iu({scrapeMotionValuesFromProps:eU,createRenderState:is}),ip={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},im=!1;function iy(){return!function(){if(im)return;let t={};for(let e in ip)t[e]={isEnabled:t=>ip[e].some(e=>!!t[e])};ew=t,im=!0}(),ew}let ig=Symbol.for("motionComponentSymbol"),iv="data-"+eS("framerAppearId"),iw=(0,e2.createContext)({});function ix(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}let ib="u">typeof window?e2.useLayoutEffect:e2.useEffect;function iS(t,{forwardMotionProps:e=!1,type:i}={},n,s){n&&function(t){let e=iy();for(let i in t)e[i]={...e[i],...t[i]};ew=e}(n);let r=i?"svg"===i:e5(t),a=r?id:ic;function o(i,n){var o;let l,h,u,c={...(0,e2.useContext)(e7),...i,layoutId:function({layoutId:t}){let e=(0,e2.useContext)(e4).id;return e&&void 0!==t?e+"-"+t:t}(i)},{isStatic:d}=c,p=function(t){let{initial:e,animate:i}=function(t,e){if(ec(t)){let{initial:e,animate:i}=t;return{initial:!1===e||el(e)?e:void 0,animate:el(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,e2.useContext)(e8));return(0,e2.useMemo)(()=>({initial:e,animate:i}),[it(e),it(i)])}(i),m=a(i,d);if(!d&&"u">typeof window){(0,e2.useContext)(e6).strict;let e=function(t){let{drag:e,layout:i}=iy();if(!e&&!i)return{};let n={...e,...i};return{MeasureLayout:e?.isEnabled(t)||i?.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(c);l=e.MeasureLayout,p.visualElement=function(t,e,i,n,s,r){let{visualElement:a}=(0,e2.useContext)(e8),o=(0,e2.useContext)(e6),l=(0,e2.useContext)(ih),h=(0,e2.useContext)(e7),u=h.reducedMotion,c=h.skipAnimations,d=(0,e2.useRef)(null),p=(0,e2.useRef)(!1);n=n||o.renderer,!d.current&&n&&(d.current=n(t,{visualState:e,parent:a,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:c,isSVG:r}),p.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));let m=d.current,f=(0,e2.useContext)(iw);m&&!m.projection&&s&&("html"===m.type||"svg"===m.type)&&function(t,e,i,n){let{layoutId:s,layout:r,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:h,layoutAnchor:u,layoutCrossfade:c}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:!!a||o&&ix(o),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:n,crossfade:c,layoutScroll:l,layoutRoot:h,layoutAnchor:u})}(d.current,i,s,f);let y=(0,e2.useRef)(!1);(0,e2.useInsertionEffect)(()=>{m&&y.current&&m.update(i,l)});let g=i[iv],v=(0,e2.useRef)(!!g&&"u">typeof window&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return ib(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,e2.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),v.current=!1),m.enteringChildren=void 0)}),m}(t,m,c,s,e.ProjectionNode,r)}return(0,e9.jsxs)(e8.Provider,{value:p,children:[l&&p.visualElement?(0,e9.jsx)(l,{visualElement:p.visualElement,...c}):null,function(t,e,i,{latestValues:n},s,r=!1,a){let o=(a??e5(t)?function(t,e,i,n){let s=(0,e2.useMemo)(()=>{let i=is();return eV(i,e,eR(n),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){let e={};ii(e,t.style,t),s.style={...e,...s.style}}return s}:function(t,e){let i,n,s={},r=(i=t.style||{},ii(n={},i,t),Object.assign(n,function({transformTemplate:t},e){return(0,e2.useMemo)(()=>{let i=ie();return eA(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),n);return t.drag&&!1!==t.dragListener&&(s.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=r,s})(e,n,s,t),l=function(t,e,i){let n={};for(let s in t)("values"!==s||"object"!=typeof t.values)&&!K(t[s])&&(io(s)||!0===i&&ia(s)||!e&&!ia(s)||t.draggable&&s.startsWith("onDrag"))&&(n[s]=t[s]);return n}(e,"string"==typeof t,r),h=t!==e2.Fragment?{...l,...o,ref:i}:{},{children:u}=e,c=(0,e2.useMemo)(()=>K(u)?u.get():u,[u]);return(0,e2.createElement)(t,{...h,children:c})}(t,i,(o=p.visualElement,h=(0,e2.useRef)(n),(0,e2.useInsertionEffect)(()=>{h.current=n}),u=(0,e2.useRef)(null),(0,e2.useCallback)(t=>{t&&m.onMount?.(t);let e=h.current;if("function"==typeof e)if(t){let i=e(t);"function"==typeof i&&(u.current=i)}else u.current?(u.current(),u.current=null):e(t);else e&&(e.current=t);o&&(t?o.mount(t):o.unmount())},[o])),m,d,e,r)]})}o.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;let l=(0,e2.forwardRef)(o);return l[ig]=t,l}class iT{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ik(t,e,i){let n=t.getProps();return eg(n,e,void 0!==i?i:n.custom,t)}function iP(t,e){if(t?.inherit&&e){let{inherit:i,...n}=t;return{...e,...n}}return t}function iA(t,e){let i=t?.[e]??t?.default??t;return i!==t?iP(i,t):i}let iC=t=>Array.isArray(t);function iE(t,e){let i=t.getValue("willChange");if(K(i)&&i.add)return i.add(e);if(!i&&tP.WillChange){let i=new tP.WillChange("auto");t.addValue("willChange",i),i.add(e)}}let iM=(t,e)=>i=>e(t(i)),iV=(...t)=>t.reduce(iM);function iD(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function iR(t,e){return i=>i>0?e:t}let iL=(t,e,i)=>{let n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},ij=[v,g,A];function iI(t){let e=ij.find(e=>e.test(t));if(te(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let i=e.parse(t);return e===A&&(i=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,r=0,a=0;if(e/=100){let n=i<.5?i*(1+e):i+e-i*e,o=2*i-n;s=iD(o,n,t+1/3),r=iD(o,n,t),a=iD(o,n,t-1/3)}else s=r=a=i;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*a),alpha:n}}(i)),i}let iF=(t,e)=>{let i=iI(t),n=iI(e);if(!i||!n)return iR(t,e);let s={...i};return t=>(s.red=iL(i.red,n.red,t),s.green=iL(i.green,n.green,t),s.blue=iL(i.blue,n.blue,t),s.alpha=eF(i.alpha,n.alpha,t),g.transform(s))},iO=new Set(["none","hidden"]);function iB(t,e){return i=>eF(t,e,i)}function i$(t){return"number"==typeof t?iB:"string"==typeof t?ta(t)?iR:C.test(t)?iF:iW:Array.isArray(t)?iU:"object"==typeof t?C.test(t)?iF:iN:iR}function iU(t,e){let i=[...t],n=i.length,s=t.map((t,i)=>i$(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function iN(t,e){let i={...t,...e},n={};for(let s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=i$(t[s])(t[s],e[s]));return t=>{for(let e in n)i[e]=n[e](t);return i}}let iW=(t,e)=>{let i=j.createTransformer(e),n=R(t),s=R(e);if(!(n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length))return te(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),iR(t,e);if(iO.has(t)&&!s.values.length||iO.has(e)&&!n.values.length)return iO.has(t)?i=>i<=0?t:e:i=>i>=1?e:t;return iV(iU(function(t,e){let i=[],n={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let r=e.types[s],a=t.indexes[r][n[r]],o=t.values[a]??0;i[s]=o,n[r]++}return i}(n,s),s.values),i)};function iz(t,e,i){return"number"==typeof t&&"number"==typeof e&&"number"==typeof i?eF(t,e,i):i$(t)(t,e)}let iH=t=>{let e=({timestamp:e})=>t(e);return{start:(t=!0)=>tE.update(e,t),stop:()=>tM(e),now:()=>tV.isProcessing?tV.timestamp:ei.now()}};function iX(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}let iY=.01,iq=2,iK=.005,iG=.5;function iJ(t,e){return t*Math.sqrt(1-e*e)}let i_=["duration","bounce"],iZ=["stiffness","damping","mass"];function iQ(t,e){return e.some(e=>void 0!==t[e])}function i0(t=.3,e=.3){let i,n,s,r,a,l,h="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:u,restDelta:c}=h,d=h.keyframes[0],p=h.keyframes[h.keyframes.length-1],m={done:!1,value:d},{stiffness:f,damping:y,mass:g,duration:v,velocity:w,isResolvedFromDuration:x}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!iQ(t,iZ)&&iQ(t,i_))if(e.velocity=0,t.visualDuration){let i=2*Math.PI/(1.2*t.visualDuration),n=i*i,s=2*o(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:1,stiffness:n,damping:s}}else{let i=function({duration:t=800,bounce:e=.3,velocity:i=0,mass:n=1}){let s,r;te(t<=tz(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=o(.05,1,a),t=o(.01,10,t/1e3),a<1?(s=e=>{let n=e*a,s=n*t;return .001-(n-i)/iJ(e,a)*Math.exp(-s)},r=e=>{let n=e*a*t,r=Math.pow(a,2)*Math.pow(e,2)*t,o=Math.exp(-n),l=iJ(Math.pow(e,2),a);return(n*i+i-r)*o*(-s(e)+.001>0?-1:1)/l}):(s=e=>-.001+Math.exp(-e*t)*((e-i)*t+1),r=e=>t*t*(i-e)*Math.exp(-e*t));let l=function(t,e,i){let n=i;for(let i=1;i<12;i++)n-=t(n)/e(n);return n}(s,r,5/t);if(t=tz(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{let e=Math.pow(l,2)*n;return{stiffness:e,damping:2*a*Math.sqrt(n*e),duration:t}}}({...t,velocity:0});(e={...e,...i,mass:1}).isResolvedFromDuration=!0}return e}({...h,velocity:-((h.velocity||0)/1e3)}),b=w||0,S=y/(2*Math.sqrt(f*g)),T=p-d,k=Math.sqrt(f/g)/1e3,P=5>Math.abs(T);if(u||(u=P?iY:iq),c||(c=P?iK:iG),S<1)s=iJ(k,S),r=(b+S*k*T)/s,i=t=>p-Math.exp(-S*k*t)*(r*Math.sin(s*t)+T*Math.cos(s*t)),a=S*k*r+T*s,l=S*k*T-r*s,n=t=>Math.exp(-S*k*t)*(a*Math.sin(s*t)+l*Math.cos(s*t));else if(1===S){i=t=>p-Math.exp(-k*t)*(T+(b+k*T)*t);let t=b+k*T;n=e=>Math.exp(-k*e)*(k*t*e-b)}else{let t=k*Math.sqrt(S*S-1);i=e=>{let i=Math.exp(-S*k*e),n=Math.min(t*e,300);return p-i*((b+S*k*T)*Math.sinh(n)+t*T*Math.cosh(n))/t};let e=(b+S*k*T)/t,s=S*k*e-T*t,r=S*k*T-e*t;n=e=>{let i=Math.exp(-S*k*e),n=Math.min(t*e,300);return i*(s*Math.sinh(n)+r*Math.cosh(n))}}let A={calculatedDuration:x&&v||null,velocity:t=>tz(n(t)),next:t=>{if(!x&&S<1){let e=Math.exp(-S*k*t),i=Math.sin(s*t),n=Math.cos(s*t),o=p-e*(r*i+T*n);return m.done=Math.abs(tz(e*(a*i+l*n)))<=u&&Math.abs(p-o)<=c,m.value=m.done?p:o,m}let e=i(t);return x?m.done=t>=v:m.done=Math.abs(tz(n(t)))<=u&&Math.abs(p-e)<=c,m.value=m.done?p:e,m},toString:()=>{let t=Math.min(iX(A),2e4),e=t5(e=>A.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return A}function i1(t,e,i){var n,s;let r=Math.max(e-5,0);return n=i-t(r),(s=e-r)?1e3/s*n:0}function i2({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:h=.5,restSpeed:u}){let c,d,p=t[0],m={done:!1,value:p},f=i*e,y=p+f,g=void 0===a?y:a(y);g!==y&&(f=g-p);let v=t=>-f*Math.exp(-t/n),w=t=>g+v(t),x=t=>{let e=v(t),i=w(t);m.done=Math.abs(e)<=h,m.value=m.done?g:i},b=t=>{let e;if(e=m.value,void 0!==o&&e<o||void 0!==l&&e>l){var i;c=t,d=i0({keyframes:[m.value,(i=m.value,void 0===o?l:void 0===l||Math.abs(o-i)<Math.abs(l-i)?o:l)],velocity:i1(w,t,m.value),damping:s,stiffness:r,restDelta:h,restSpeed:u})}};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return(d||void 0!==c||(e=!0,x(t),b(t)),void 0!==c&&t>=c)?d.next(t-c):(e||x(t),m)}}}i0.applyToOptions=t=>{let e=function(t,e=100,i){let n=i({...t,keyframes:[0,e]}),s=Math.min(iX(n),2e4);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:s/1e3}}(t,100,i0);return t.ease=e.ease,t.duration=tz(e.duration),t.type="keyframes",t};let i3=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function i5(t,e,i,n){return t===e&&i===n?tk:s=>0===s||1===s?s:i3(function(t,e,i,n,s){let r,a,o=0;do(r=i3(a=e+(i-e)/2,n,s)-t)>0?i=a:e=a;while(Math.abs(r)>1e-7&&++o<12)return a}(s,0,1,t,i),e,n)}let i9=i5(.42,0,1,1),i4=i5(0,0,.58,1),i6=i5(.42,0,.58,1),i7=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,i8=t=>e=>1-t(1-e),nt=i5(.33,1.53,.69,.99),ne=i8(nt),ni=i7(ne),nn=t=>t>=1?1:(t*=2)<1?.5*ne(t):.5*(2-Math.pow(2,-10*(t-1))),ns=t=>1-Math.sin(Math.acos(t)),nr=i8(ns),na=i7(ns),no={linear:tk,easeIn:i9,easeInOut:i6,easeOut:i4,circIn:ns,circInOut:na,circOut:nr,backIn:ne,backInOut:ni,backOut:nt,anticipate:nn},nl=t=>{if(t2(t)){ti(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,i,n,s]=t;return i5(e,i,n,s)}return"string"==typeof t?(ti(void 0!==no[t],`Invalid easing type '${t}'`,"invalid-easing-type"),no[t]):t},nh=(t,e,i)=>{let n=e-t;return 0===n?1:(i-t)/n};function nu({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){var s;let r,a=Array.isArray(n)&&"number"!=typeof n[0]?n.map(nl):nl(n),l={done:!1,value:e[0]},h=function(t,e,{clamp:i=!0,ease:n,mixer:s}={}){let r=t.length;if(ti(r===e.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];let a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());let l=function(t,e,i){let n=[],s=i||tP.mix||iz,r=t.length-1;for(let i=0;i<r;i++){let r=s(t[i],t[i+1]);e&&(r=iV(Array.isArray(e)?e[i]||tk:e,r)),n.push(r)}return n}(e,n,s),h=l.length,u=i=>{if(a&&i<t[0])return e[0];let n=0;if(h>1)for(;n<t.length-2&&!(i<t[n+1]);n++);let s=nh(t[n],t[n+1],i);return l[n](s)};return i?e=>u(o(t[0],t[r-1],e)):u}((s=i&&i.length===e.length?i:(!function(t,e){let i=t[t.length-1];for(let n=1;n<=e;n++){let s=nh(0,e,n);t.push(eF(i,1,s))}}(r=[0],e.length-1),r),s.map(e=>e*t)),e,{ease:Array.isArray(a)?a:e.map(()=>a||i6).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(l.value=h(e),l.done=e>=t,l)}}let nc={decay:i2,inertia:i2,tween:nu,keyframes:nu,spring:i0};function nd(t){"string"==typeof t.type&&(t.type=nc[t.type])}let np=t=>t/100;class nm extends t0{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==ei.now()&&this.tick(ei.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},t1.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){let{options:t}=this;nd(t);let{type:e=nu,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:r=0}=t,{keyframes:a}=t,o=e||nu;o!==nu&&"number"!=typeof a[0]&&(this.mixKeyframes=iV(np,iz(a[0],a[1])),a=[0,100]);let l=o({...t,keyframes:a});"mirror"===s&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=iX(l));let{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){let e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){let i,{generator:n,totalDuration:s,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:l,calculatedDuration:h}=this;if(null===this.startTime)return n.next(0);let{delay:u=0,keyframes:c,repeat:d,repeatType:p,repeatDelay:m,type:f,onUpdate:y,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);let v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?v<0:v>s;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x=this.currentTime,b=n;if(d){let t=Math.min(this.currentTime,s)/l,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,(e=Math.min(e,d+1))%2&&("reverse"===p?(i=1-i,m&&(i-=m/l)):"mirror"===p&&(b=a)),x=o(0,1,i)*l}w?(this.delayState.value=c[0],i=this.delayState):i=b.next(x),r&&!w&&(i.value=r(i.value));let{done:S}=i;w||null===h||(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return T&&f!==i2&&(i.value=tQ(c,this.options,g,this.speed)),y&&y(i.value),T&&this.finish(),i}then(t,e){return this.finished.then(t,e)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return this.currentTime/1e3}set time(t){t=tz(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let e=this.generator.next(t).value;return i1(t=>this.generator.next(t).value,t,e)}get speed(){return this.playbackSpeed}set speed(t){let e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(ei.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:t=iH,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();let i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ei.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,t1.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}let nf={anticipate:nn,backInOut:ni,circInOut:na};class ny extends t7{constructor(t){!function(t){"string"==typeof t.ease&&t.ease in nf&&(t.ease=nf[t.ease])}(t),nd(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:e,onUpdate:i,onComplete:n,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);let a=new nm({...r,autoplay:!1}),l=Math.max(10,ei.now()-this.startTime),h=o(0,10,l-10),u=a.sample(l).value,{name:c}=this.options;s&&c&&tq(s,c,u),e.setWithVelocity(a.sample(Math.max(0,l-h)).value,u,h),a.stop()}}let ng=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(j.test(t)||"0"===t)&&!t.startsWith("url("));function nv(t){t.duration=0,t.type="keyframes"}let nw=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,nx=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),nb=tK(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class nS extends t0{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ei.now();const c={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:r,name:o,motionValue:l,element:h,...u},d=h?.KeyframeResolver||tB;this.keyframeResolver=new d(a,(t,e,i)=>this.onKeyframesResolved(t,e,c,!i),o,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,n){let s;this.keyframeResolver=void 0;let{name:r,type:a,velocity:o,delay:l,isHandoff:h,onUpdate:u}=i;this.resolvedAt=ei.now();let c=!0;!function(t,e,i,n){let s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;let r=t[t.length-1],a=ng(s,e),o=ng(r,e);return te(a===o,`You are trying to animate ${e} from "${s}" to "${r}". "${a?r:s}" is not an animatable value.`,"value-not-animatable"),!!a&&!!o&&(function(t){let e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||t6(i))&&n)}(t,r,a,o)&&(c=!1,(tP.instantAnimations||!l)&&u?.(tQ(t,i,e)),t[0]=t[t.length-1],nv(i),i.repeat=0);let d={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},p=c&&!h&&function(t){let{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:r,type:a,keyframes:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:h}=e.owner.getProps();return nb()&&i&&(t8.has(i)||nx.has(i)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&nw.test(t[e]))return!0;return!1}(o))&&("transform"!==i||!h)&&!l&&!n&&"mirror"!==s&&0!==r&&"inertia"!==a}(d),m=d.motionValue?.owner?.current;if(p)try{s=new ny({...d,element:m})}catch{s=new nm(d)}else s=new nm(d);s.finished.then(()=>{this.notifyFinished()}).catch(tk),this.pendingTimeline&&(this.stopTimeline=s.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=s}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tI=!0,tO(),tF(),tI=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let nT={type:"spring",stiffness:500,damping:25,restSpeed:10},nk={type:"keyframes",duration:.8},nP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nA=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),nC=(t,e,i,n={},s,r)=>o=>{let l=iA(n,t)||{},h=l.delay||n.delay||0,{elapsed:u=0}=n;u-=tz(h);let c={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};!function(t){for(let e in t)if(!nA.has(e))return!0;return!1}(l)&&Object.assign(c,((t,{keyframes:e})=>e.length>2?nk:a.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:nT:nP)(t,c)),c.duration&&(c.duration=tz(c.duration)),c.repeatDelay&&(c.repeatDelay=tz(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if(!1!==c.type&&(0!==c.duration||c.repeatDelay)||(nv(c),0===c.delay&&(d=!0)),(tP.instantAnimations||tP.skipAnimations||s?.shouldSkipAnimations)&&(d=!0,nv(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==e.get()){let t=tQ(c.keyframes,l);if(void 0!==t)return void tE.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new nm(c):new nS(c)};function nE(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:r,transitionEnd:a,...o}=e,l=t.getDefaultTransition();r=r?iP(r,l):l;let h=r?.reduceMotion;n&&(r=n);let u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(let e in o){let n=t.getValue(e,t.latestValues[e]??null),s=o[e];if(void 0===s||c&&function({protectedKeys:t,needsAnimating:e},i){let n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}(c,e))continue;let a={delay:i,...iA(r||{},e)},l=n.get();if(void 0!==l&&!n.isAnimating()&&!Array.isArray(s)&&s===l&&!a.velocity){tE.update(()=>n.set(s));continue}let d=!1;if(window.MotionHandoffAnimation){let i=t.props[iv];if(i){let t=window.MotionHandoffAnimation(i,e,tE);null!==t&&(a.startTime=t,d=!0)}}iE(t,e);let p=h??t.shouldReduceMotion;n.start(nC(e,n,s,p&&G.has(e)?{type:!1}:a,t,d));let m=n.animation;m&&u.push(m)}if(a){let e=()=>tE.update(()=>{a&&function(t,e){let{transitionEnd:i={},transition:n={},...s}=ik(t,e)||{};for(let e in s={...s,...i}){var r;let i=iC(r=s[e])?r[r.length-1]||0:r;t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,es(i))}}(t,a)});u.length?Promise.all(u).then(e):e()}return u}function nM(t,e,i,n=0,s=1){let r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),a=t.size,o=(a-1)*n;return"function"==typeof i?i(r,a):1===s?r*n:o-r*n}function nV(t,e,i={}){let n=ik(t,e,"exit"===i.type?t.presenceContext?.custom:void 0),{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);let r=n?()=>Promise.all(nE(t,n,i)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(n=0)=>{let{delayChildren:r=0,staggerChildren:a,staggerDirection:o}=s;return function(t,e,i=0,n=0,s=0,r=1,a){let o=[];for(let l of t.variantChildren)l.notify("AnimationStart",e),o.push(nV(l,e,{...a,delay:i+("function"==typeof n?0:n)+nM(t.variantChildren,l,n,s,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}(t,e,n,r,a,o,i)}:()=>Promise.resolve(),{when:o}=s;if(!o)return Promise.all([r(),a(i.delay)]);{let[t,e]="beforeChildren"===o?[r,a]:[a,r];return t().then(()=>e())}}let nD=eu.length;function nR(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}let nL=[...eh].reverse(),nj=eh.length;function nI(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nF(){return{animate:nI(!0),whileInView:nI(),whileHover:nI(),whileTap:nI(),whileDrag:nI(),whileFocus:nI(),exit:nI()}}let nO=0;function nB(t){return[t("x"),t("y")]}function n$(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}let nU={x:!1,y:!1};function nN(t){return t.max-t.min}function nW(t,e,i,n=.5){t.origin=n,t.originPoint=eF(e.min,e.max,t.origin),t.scale=nN(i)/nN(e),t.translate=eF(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function nz(t,e,i,n){nW(t.x,e.x,i.x,n?n.originX:void 0),nW(t.y,e.y,i.y,n?n.originY:void 0)}function nH(t,e,i,n=0){t.min=(n?eF(i.min,i.max,n):i.min)+e.min,t.max=t.min+nN(e)}function nX(t,e,i,n=0){let s=n?eF(i.min,i.max,n):i.min;t.min=e.min-s,t.max=t.min+nN(e)}function nY(t,e,i,n){nX(t.x,e.x,i.x,n?.x),nX(t.y,e.y,i.y,n?.y)}function nq(t){return"object"==typeof t&&null!==t}function nK(t){return nq(t)&&"ownerSVGElement"in t}function nG(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let n=document;e&&(n=e.current);let s=i?.[t]??n.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}let nJ=new WeakMap,n_=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:nK(n)&&"getBBox"in n?n.getBBox()[e]:n[i],nZ=n_("inline","width","offsetWidth"),nQ=n_("block","height","offsetHeight");function n0({target:t,borderBoxSize:e}){nJ.get(t)?.forEach(i=>{i(t,{get width(){return nZ(t,e)},get height(){return nQ(t,e)}})})}function n1(t){t.forEach(n0)}let n2=new Set;function n3(t,e){let i;return"function"==typeof t?(n2.add(t),s||(s=()=>{let t={get width(){return window.innerWidth},get height(){return window.innerHeight}};n2.forEach(e=>e(t))},window.addEventListener("resize",s)),()=>{n2.delete(t),n2.size||"function"!=typeof s||(window.removeEventListener("resize",s),s=void 0)}):(!n&&"u">typeof ResizeObserver&&(n=new ResizeObserver(n1)),(i=nG(t)).forEach(t=>{let i=nJ.get(t);i||(i=new Set,nJ.set(t,i)),i.add(e),n?.observe(t)}),()=>{i.forEach(t=>{let i=nJ.get(t);i?.delete(e),i?.size||n?.unobserve(t)})})}let n5=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),n9=new Set(["INPUT","SELECT","TEXTAREA"]),n4=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function n6(t){return{point:{x:t.pageX,y:t.pageY}}}function n7(t,e,i,n){return n$(t,e,t=>n4(t)&&i(t,n6(t)),n)}let n8=({current:t})=>t?t.ownerDocument.defaultView:null,st=(t,e)=>Math.abs(t-e),se=new Set(["auto","scroll"]);class si{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=sn(this.lastRawMoveEventInfo,this.transformPagePoint));let i=sr(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,s=(t=i.offset,e={x:0,y:0},Math.sqrt(st(t.x,e.x)**2+st(t.y,e.y)**2)>=this.distanceThreshold);if(!n&&!s)return;let{point:r}=i,{timestamp:a}=tV;this.history.push({...r,timestamp:a});let{onStart:o,onMove:l}=this.handlers;n||(o&&o(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,i)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=sn(e,this.transformPagePoint),tE.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&s&&s(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=sr("pointercancel"===t.type?this.lastMoveEventInfo:sn(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,r),n&&n(t,r)},!n4(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=n||window;const o=sn(n6(t),this.transformPagePoint),{point:l}=o,{timestamp:h}=tV;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,sr(o,this.history)),this.removeListeners=iV(n7(this.contextWindow,"pointermove",this.handlePointerMove),n7(this.contextWindow,"pointerup",this.handlePointerUp),n7(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let e=t.parentElement;for(;e;){let t=getComputedStyle(e);(se.has(t.overflowX)||se.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){let e=this.scrollPositions.get(t);if(!e)return;let i=t===window,n=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:n.x-e.x,y:n.y-e.y};(0!==s.x||0!==s.y)&&(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,n),tE.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),tM(this.updatePoint)}}function sn(t,e){return e?{point:e(t.point)}:t}function ss(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sr({point:t},e){return{point:t,delta:ss(t,sa(e)),offset:ss(t,e[0]),velocity:function(t){if(t.length<2)return{x:0,y:0};let e=t.length-1,i=null,n=sa(t);for(;e>=0&&(i=t[e],!(n.timestamp-i.timestamp>tz(.1)));)e--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&n.timestamp-i.timestamp>2*tz(.1)&&(i=t[1]);let s=(n.timestamp-i.timestamp)/1e3;if(0===s)return{x:0,y:0};let r={x:(n.x-i.x)/s,y:(n.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}(e)}}function sa(t){return t[t.length-1]}function so(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function sl(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}function sh(t,e,i){return{min:su(t,e),max:su(t,i)}}function su(t,e){return"number"==typeof t?t:t[e]||0}let sc=new WeakMap;class sd{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=q(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:i}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let s=t=>{e&&this.snapToCursor(n6(t).point),this.stopAnimation()},r=(t,e)=>{let{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(t){if("x"===t||"y"===t)if(nU[t])return null;else return nU[t]=!0,()=>{nU[t]=!1};return nU.x||nU.y?null:(nU.x=nU.y=!0,()=>{nU.x=nU.y=!1})}(i),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nB(t=>{let e=this.getAxisMotionValue(t).get()||0;if(b.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let n=i.layout.layoutBox[t];n&&(e=nN(n)*(parseFloat(e)/100))}}this.originPoint[t]=e}),s&&tE.update(()=>s(t,e),!1,!0),iE(this.visualElement,"transform");let{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},a=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;let{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:r}=this.getProps();if(!i&&!this.openDragLock)return;let{offset:a}=e;if(n&&null===this.currentDirection){this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(a),null!==this.currentDirection&&s&&s(this.currentDirection);return}this.updateAxis("x",e.point,a),this.updateAxis("y",e.point,a),this.visualElement.render(),r&&tE.update(()=>r(t,e),!1,!0)},o=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new si(t,{onSessionStart:s,onStart:r,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:n8(this.visualElement),element:this.visualElement.current})}stop(t,e){let i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;let{velocity:r}=n;this.startAnimation(r);let{onDragEnd:a}=this.getProps();a&&tE.postRender(()=>a(i,n))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){let{drag:n}=this.getProps();if(!i||!sm(t,n,this.currentDirection))return;let s=this.getAxisMotionValue(t),r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},n){return void 0!==e&&t<e?t=n?eF(e,t,n.min):Math.max(t,e):void 0!==i&&t>i&&(t=n?eF(i,t,n.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),s.set(r)}resolveConstraints(){let{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&ix(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=function(t,{top:e,left:i,bottom:n,right:s}){return{x:so(t.x,i,s),y:so(t.y,e,n)}}(i.layoutBox,t):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:sh(t,"left","right"),y:sh(t,"top","bottom")}}(e),n!==this.constraints&&!ix(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&nB(t=>{var e,n;let s;!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=(e=i.layoutBox[t],n=this.constraints[t],s={},void 0!==n.min&&(s.min=n.min-e.min),void 0!==n.max&&(s.max=n.max-e.min),s))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!ix(e))return!1;let n=e.current;ti(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:s}=this.visualElement;if(!s||!s.layout)return!1;let r=function(t,e,i){let n=e0(t,i),{scroll:s}=e;return s&&(eJ(n.x,s.offset.x),eJ(n.y,s.offset.y)),n}(n,s.root,this.visualElement.getTransformPagePoint()),a=(t=s.layout.layoutBox,{x:sl(t.x,r.x),y:sl(t.y,r.y)});if(i){let t=i(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(a));this.hasMutatedConstraints=!!t,t&&(a=eW(t))}return a}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),o=this.constraints||{};return Promise.all(nB(a=>{if(!sm(a,e,this.currentDirection))return;let l=o&&o[a]||{};(!0===r||r===a)&&(l={min:0,max:0});let h={type:"inertia",velocity:i?t[a]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(a,h)})).then(a)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return iE(this.visualElement,t),i.start(nC(t,i,0,e,this.visualElement,!1))}stopAnimation(){nB(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps();return i[e]||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){nB(e=>{let{drag:i}=this.getProps();if(!sm(e,i,this.currentDirection))return;let{projection:n}=this.visualElement,s=this.getAxisMotionValue(e);if(n&&n.layout){let{min:i,max:r}=n.layout.layoutBox[e],a=s.get()||0;s.set(t[e]-eF(i,r,.5)+a)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!ix(e)||!i||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};nB(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){var i,s;let r,a,l,h=e.get();n[t]=(i={min:h,max:h},s=this.constraints[t],r=.5,a=nN(i),(l=nN(s))>a?r=nh(s.min,s.max-a,i.min):a>l&&(r=nh(i.min,i.max-l,s.min)),o(0,1,r))}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),nB(e=>{if(!sm(e,t,null))return;let i=this.getAxisMotionValue(e),{min:s,max:r}=this.constraints[e];i.set(eF(s,r,n[e]))}),this.visualElement.render()}addListeners(){let t;if(!this.visualElement.current)return;sc.set(this.visualElement,this);let e=this.visualElement.current,i=n7(e,"pointerdown",t=>{let{drag:i,dragListener:n=!0}=this.getProps(),s=t.target,r=s!==e&&(n9.has(s.tagName)||!0===s.isContentEditable);i&&n&&!r&&this.start(t)}),n=()=>{var i,n,s;let r,a,{dragConstraints:o}=this.getProps();ix(o)&&o.current&&(this.constraints=this.resolveRefConstraints(),t||(i=e,n=o.current,r=n3(i,sp(s=()=>this.scalePositionWithinConstraints())),a=n3(n,sp(s)),t=()=>{r(),a()}))},{projection:s}=this.visualElement,r=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),tE.read(n);let a=n$(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(nB(e=>{let i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{a(),i(),r(),o&&o(),t&&t()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:r=.35,dragMomentum:a=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:r,dragMomentum:a}}}function sp(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function sm(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}let sf=t=>(e,i)=>{t&&tE.update(()=>t(e,i),!1,!0)},sy={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var sg=e2;let sv=!1;class sw extends sg.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),sv&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),sy.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:r}=i;return r&&(r.isPresent=s,t.layoutDependency!==e&&r.setOptions({...r.options,layoutDependency:e}),sv=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?r.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?r.promote():r.relegate()||tE.postRender(()=>{let t=r.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:t,layoutAnchor:e}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=e,i.root.didUpdate(),et.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;sv=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function sx(t){let[e,i]=function(t=!0){let e=(0,e2.useContext)(ih);if(null===e)return[!0,null];let{isPresent:i,onExitComplete:n,register:s}=e,r=(0,e2.useId)();(0,e2.useEffect)(()=>{if(t)return s(r)},[t]);let a=(0,e2.useCallback)(()=>t&&n&&n(r),[r,n,t]);return!i&&n?[!1,a]:[!0]}(),n=(0,sg.useContext)(e4);return(0,e9.jsx)(sw,{...t,layoutGroup:n,switchLayoutGroup:(0,sg.useContext)(iw),isPresent:e,safeToRemove:i})}let sb=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],sS=sb.length,sT=t=>"string"==typeof t?parseFloat(t):t,sk=t=>"number"==typeof t||S.test(t);function sP(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let sA=sE(0,.5,nr),sC=sE(.5,.95,tk);function sE(t,e,i){return n=>n<t?0:n>e?1:i(nh(t,e,n))}function sM(t,e){t.min=e.min,t.max=e.max}function sV(t,e){sM(t.x,e.x),sM(t.y,e.y)}function sD(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function sR(t,e,i,n,s){return t-=e,t=n+1/i*(t-n),void 0!==s&&(t=n+1/s*(t-n)),t}function sL(t,e,[i,n,s],r,a){!function(t,e=0,i=1,n=.5,s,r=t,a=t){if(b.test(e)&&(e=parseFloat(e),e=eF(a.min,a.max,e/100)-a.min),"number"!=typeof e)return;let o=eF(r.min,r.max,n);t===r&&(o-=e),t.min=sR(t.min,e,i,o,s),t.max=sR(t.max,e,i,o,s)}(t,e[i],e[n],e[s],e.scale,r,a)}let sj=["x","scaleX","originX"],sI=["y","scaleY","originY"];function sF(t,e,i,n){sL(t.x,e,sj,i?i.x:void 0,n?n.x:void 0),sL(t.y,e,sI,i?i.y:void 0,n?n.y:void 0)}function sO(t){return 0===t.translate&&1===t.scale}function sB(t){return sO(t.x)&&sO(t.y)}function s$(t,e){return t.min===e.min&&t.max===e.max}function sU(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function sN(t,e){return sU(t.x,e.x)&&sU(t.y,e.y)}function sW(t){return nN(t.x)/nN(t.y)}function sz(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class sH{constructor(){this.members=[]}add(t){tH(this.members,t);for(let e=this.members.length-1;e>=0;e--){let i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;let n=i.instance;n&&!1!==n.isConnected||i.snapshot||(tX(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(tX(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){let t=this.members[e];if(!1!==t.isPresent&&t.instance?.isConnected!==!1)return this.promote(t),!0}return!1}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();let{layoutDependency:n}=i.options,{layoutDependency:s}=t.options;(void 0===n||n!==s)&&(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}let sX=(t,e)=>t.depth-e.depth;class sY{constructor(){this.children=[],this.isDirty=!1}add(t){tH(this.children,t),this.isDirty=!0}remove(t){tX(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sX),this.isDirty=!1,this.children.forEach(t)}}let sq=["","X","Y","Z"],sK=0;function sG(t,e,i,n){let{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function sJ({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(t={},i=e?.()){this.id=sK++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(sQ),this.nodes.forEach(s7),this.nodes.forEach(s8),this.nodes.forEach(s0)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new sY)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new tY),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){let i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=nK(e)&&!(nK(e)&&"svg"===e.tagName),this.instance=e;let{layoutId:i,layout:n,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||i)&&(this.isLayoutDirty=!0),t){let i,n=0,s=()=>this.root.updateBlockedByResize=!1;tE.read(()=>{n=window.innerWidth}),t(e,()=>{let t=window.innerWidth;if(t!==n){let e,r;n=t,this.root.updateBlockedByResize=!0,i&&i(),e=ei.now(),r=({timestamp:t})=>{let i=t-e;i>=250&&(tM(r),s(i-250))},tE.setup(r,!0),i=()=>tM(r),sy.hasAnimatedSinceResize&&(sy.hasAnimatedSinceResize=!1,this.nodes.forEach(s6))}})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||n)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let r=this.options.transition||s.getDefaultTransition()||rr,{onLayoutAnimationStart:a,onLayoutAnimationComplete:o}=s.getProps(),l=!this.targetLayout||!sN(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let e={...iA(r,"layout"),onPlay:a,onComplete:o};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h)}else e||s6(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),tM(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rt),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:i}=e.options;if(!i)return;let n=i.props[iv];if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",tE,!(t||i))}let{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&t(s)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){let e=this.path[t];e.shouldResetTransform=!0,("string"==typeof e.latestValues.x||"string"==typeof e.latestValues.y)&&(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}let{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let t=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(s3),this.nodes.forEach(s2);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(s5);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(s9),this.nodes.forEach(s4),this.nodes.forEach(s_),this.nodes.forEach(sZ)):this.nodes.forEach(s5),this.clearAllSnapshots();let t=ei.now();tV.delta=o(0,1e3/60,t-tV.timestamp),tV.timestamp=t,tV.isProcessing=!0,tD.update.process(tV),tD.preRender.process(tV),tD.render.process(tV),tV.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,et.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(s1),this.sharedNodes.forEach(re)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tE.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tE.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||nN(this.snapshot.measuredBox.x)||nN(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();let t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=q()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){let e=n(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;let t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!sB(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,r=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||eX(this.latestValues)||r)&&(s(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){var e;let i=this.measurePageBox(),n=this.removeElementScroll(i);return t&&(n=this.removeTransform(n)),rl((e=n).x),rl(e.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:t}=this.options;if(!t)return q();let e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ru))){let{scroll:t}=this.root;t&&(eJ(e.x,t.offset.x),eJ(e.y,t.offset.y))}return e}removeElementScroll(t){let e=q();if(sV(e,t),this.scroll?.wasRoot)return e;for(let i=0;i<this.path.length;i++){let n=this.path[i],{scroll:s,options:r}=n;n!==this.root&&s&&r.layoutScroll&&(s.wasRoot&&sV(e,t),eJ(e.x,s.offset.x),eJ(e.y,s.offset.y))}return e}applyTransform(t,e=!1,i){let n=i||q();sV(n,t);for(let t=0;t<this.path.length;t++){let i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(eJ(n.x,-i.scroll.offset.x),eJ(n.y,-i.scroll.offset.y)),eX(i.latestValues)&&eQ(n,i.latestValues,i.layout?.layoutBox)}return eX(this.latestValues)&&eQ(n,this.latestValues,this.layout?.layoutBox),n}removeTransform(t){let e=q();sV(e,t);for(let t=0;t<this.path.length;t++){let i,n=this.path[t];eX(n.latestValues)&&(n.instance&&(eH(n.latestValues)&&n.updateSnapshot(),sV(i=q(),n.measurePageBox())),sF(e,n.latestValues,n.snapshot?.layoutBox,i))}return eX(this.latestValues)&&sF(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==tV.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){let e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);let i=!!this.resumingFrom||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:n,layoutId:s}=this.options;if(!this.layout||!(n||s))return;this.resolvedRelativeTargetAt=tV.timestamp;let r=this.getClosestProjectingParent();if(r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=q(),this.targetWithTransforms=q()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var a,o,l,h;this.forceRelativeParentToResolveTarget(),a=this.target,o=this.relativeTarget,l=this.relativeParent.target,h=this.options.layoutAnchor||void 0,nH(a.x,o.x,l.x,h?.x),nH(a.y,o.y,l.y,h?.y)}else this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):sV(this.target,this.layout.layoutBox),eG(this.target,this.targetDelta)):sV(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&!!r.resumingFrom==!!this.resumingFrom&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||eH(this.parent.latestValues)||eY(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,i){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=q(),this.relativeTargetOrigin=q(),nY(this.relativeTargetOrigin,e,i,this.options.layoutAnchor||void 0),sV(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let t=this.getLead(),e=!!this.resumingFrom||this!==t,i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===tV.timestamp&&(i=!1),i)return;let{layout:n,layoutId:s}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(n||s))return;sV(this.layoutCorrected,this.layout.layoutBox);let r=this.treeScale.x,a=this.treeScale.y;!function(t,e,i,n=!1){let s,r,a=i.length;if(a){e.x=e.y=1;for(let o=0;o<a;o++){r=(s=i[o]).projectionDelta;let{visualElement:a}=s.options;(!a||!a.props.style||"contents"!==a.props.style.display)&&(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(eJ(t.x,-s.scroll.offset.x),eJ(t.y,-s.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,eG(t,r)),n&&eX(s.latestValues)&&eQ(t,s.latestValues,s.layout?.layoutBox))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,e),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=q());let{target:o}=t;if(!o){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(sD(this.prevProjectionDelta.x,this.projectionDelta.x),sD(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nz(this.projectionDelta,this.layoutCorrected,o,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&sz(this.projectionDelta.x,this.prevProjectionDelta.x)&&sz(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",o))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=X(),this.projectionDelta=X(),this.projectionDeltaWithTransform=X()}setAnimationOrigin(t,e=!1){let i,n=this.snapshot,s=n?n.latestValues:{},r={...this.latestValues},a=X();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let o=q(),l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(rs));this.animationProgress=0,this.mixTargetDelta=e=>{let n=e/1e3;if(ri(a.x,t.x,n),ri(a.y,t.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var h,d,p,m,f,y;nY(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),p=this.relativeTarget,m=this.relativeTargetOrigin,f=o,y=n,rn(p.x,m.x,f.x,y),rn(p.y,m.y,f.y,y),i&&(h=this.relativeTarget,d=i,s$(h.x,d.x)&&s$(h.y,d.y))&&(this.isProjectionDirty=!1),i||(i=q()),sV(i,this.relativeTarget)}l&&(this.animationValues=r,function(t,e,i,n,s,r){s?(t.opacity=eF(0,i.opacity??1,sA(n)),t.opacityExit=eF(e.opacity??1,0,sC(n))):r&&(t.opacity=eF(e.opacity??1,i.opacity??1,n));for(let s=0;s<sS;s++){let r=sb[s],a=sP(e,r),o=sP(i,r);(void 0!==a||void 0!==o)&&(a||(a=0),o||(o=0),0===a||0===o||sk(a)===sk(o)?(t[r]=Math.max(eF(sT(a),sT(o),n),0),(b.test(o)||b.test(a))&&(t[r]+="%")):t[r]=o)}(e.rotate||i.rotate)&&(t.rotate=eF(e.rotate||0,i.rotate||0,n))}(r,s,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(tM(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tE.update(()=>{var e,i,n;let s;sy.hasAnimatedSinceResize=!0,t1.layout++,this.motionValue||(this.motionValue=es(0)),this.motionValue.jump(0,!1),this.currentAnimation=(e=this.motionValue,i=[0,1e3],n={...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{t1.layout--},onComplete:()=>{t1.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}},(s=K(e)?e:es(e)).start(nC("",s,i,n)),s.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&rh(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||q();let e=nN(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let n=nN(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}sV(e,i),eQ(e,s),nz(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sH),this.sharedNodes.get(t).add(e);let i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){let{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){let n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;let n={};i.z&&sG("z",t,n,this.animationValues);for(let e=0;e<sq.length;e++)sG(`rotate${sq[e]}`,t,n,this.animationValues),sG(`skew${sq[e]}`,t,n,this.animationValues);for(let e in t.render(),n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible){t.visibility="hidden";return}let i=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=il(e?.pointerEvents)||"",t.transform=i?i(this.latestValues,""):"none";return}let n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=il(e?.pointerEvents)||""),this.hasProjected&&!eX(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1);return}t.visibility="";let s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let r=function(t,e,i){let n="",s=t.x.translate/e.x,r=t.y.translate/e.y,a=i?.z||0;if((s||r||a)&&(n=`translate3d(${s}px, ${r}px, ${a}px) `),(1!==e.x||1!==e.y)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),i){let{transformPerspective:t,rotate:e,rotateX:s,rotateY:r,skewX:a,skewY:o}=i;t&&(n=`perspective(${t}px) ${n}`),e&&(n+=`rotate(${e}deg) `),s&&(n+=`rotateX(${s}deg) `),r&&(n+=`rotateY(${r}deg) `),a&&(n+=`skewX(${a}deg) `),o&&(n+=`skewY(${o}deg) `)}let o=t.x.scale*e.x,l=t.y.scale*e.y;return(1!==o||1!==l)&&(n+=`scale(${o}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,s);i&&(r=i(s,r)),t.transform=r;let{x:a,y:o}=this.projectionDelta;for(let e in t.transformOrigin=`${100*a.origin}% ${100*o.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0,eO){if(void 0===s[e])continue;let{correct:i,applyTo:a,isCSSVariable:o}=eO[e],l="none"===r?s[e]:i(s[e],n);if(a){let e=a.length;for(let i=0;i<e;i++)t[a[i]]=l}else o?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=n===this?il(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(s2),this.root.sharedNodes.clear()}}}function s_(t){t.updateLayout()}function sZ(t){let e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){let{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,r=e.source!==t.layout.source;if("size"===s)nB(t=>{let n=r?e.measuredBox[t]:e.layoutBox[t],s=nN(n);n.min=i[t].min,n.max=n.min+s});else if("x"===s||"y"===s){let t="x"===s?"y":"x";sM(r?e.measuredBox[t]:e.layoutBox[t],i[t])}else rh(s,e.layoutBox,i)&&nB(n=>{let s=r?e.measuredBox[n]:e.layoutBox[n],a=nN(i[n]);s.max=s.min+a,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+a)});let a=X();nz(a,i,e.layoutBox);let o=X();r?nz(o,t.applyTransform(n,!0),e.measuredBox):nz(o,i,e.layoutBox);let l=!sB(a),h=!1;if(!t.resumeFrom){let n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:s,layout:r}=n;if(s&&r){let a=t.options.layoutAnchor||void 0,o=q();nY(o,e.layoutBox,s.layoutBox,a);let l=q();nY(l,i,r.layoutBox,a),sN(o,l)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=o,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:o,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function sQ(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function s0(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function s1(t){t.clearSnapshot()}function s2(t){t.clearMeasurements()}function s3(t){t.isLayoutDirty=!0,t.updateLayout()}function s5(t){t.isLayoutDirty=!1}function s9(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function s4(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function s6(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function s7(t){t.resolveTargetDelta()}function s8(t){t.calcProjection()}function rt(t){t.resetSkewAndRotation()}function re(t){t.removeLeadSnapshot()}function ri(t,e,i){t.translate=eF(e.translate,0,i),t.scale=eF(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function rn(t,e,i,n){t.min=eF(e.min,i.min,n),t.max=eF(e.max,i.max,n)}function rs(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let rr={duration:.45,ease:[.4,0,.1,1]},ra=t=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ro=ra("applewebkit/")&&!ra("chrome/")?Math.round:tk;function rl(t){t.min=ro(t.min),t.max=ro(t.max)}function rh(t,e,i){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(sW(e)-sW(i)))}function ru(t){return t!==t.root&&t.scroll?.wasRoot}let rc=sJ({attachResizeListener:(t,e)=>n$(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rd={current:void 0},rp=sJ({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rd.current){let t=new rc({});t.mount(window),t.setOptions({layoutScroll:!0}),rd.current=t}return rd.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position});function rm(t,e){let i=nG(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function rf(t,e,i){let{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);let s=n["onHover"+i];s&&tE.postRender(()=>s(e,n6(e)))}let ry=(t,e)=>!!e&&(t===e||ry(t,e.parentElement)),rg=new WeakSet;function rv(t){return e=>{"Enter"===e.key&&t(e)}}function rw(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rx(t){return n4(t)&&!(nU.x||nU.y)}let rb=new WeakSet;function rS(t,e,i){let{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);let s=n["onTap"+("End"===i?"":i)];s&&tE.postRender(()=>s(e,n6(e)))}let rT=new WeakMap,rk=new WeakMap,rP=t=>{let e=rT.get(t.target);e&&e(t)},rA=t=>{t.forEach(rP)},rC={some:0,all:1},rE=function(t,e){if("u"<typeof Proxy)return iS;let i=new Map,n=(i,n)=>iS(i,n,t,e);return new Proxy((t,e)=>n(t,e),{get:(s,r)=>"create"===r?n:(i.has(r)||i.set(r,iS(r,void 0,t,e)),i.get(r))})}({animation:{Feature:class extends iT{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e))n=Promise.all(e.map(e=>nV(t,e,i)));else if("string"==typeof e)n=nV(t,e,i);else{let s="function"==typeof e?ik(t,e,i.custom):e;n=Promise.all(nE(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})})(t,e,i))),i=nF(),n=!0,s=!1,r=e=>(i,n)=>{let s=ik(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){let{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function a(a){let{props:o}=t,l=function t(e){if(!e)return;if(!e.isControllingVariants){let i=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(i.initial=e.props.initial),i}let i={};for(let t=0;t<nD;t++){let n=eu[t],s=e.props[n];(el(s)||!1===s)&&(i[n]=s)}return i}(t.parent)||{},h=[],u=new Set,c={},d=1/0;for(let e=0;e<nj;e++){var p,m;let f=nL[e],y=i[f],g=void 0!==o[f]?o[f]:l[f],v=el(g),w=f===a?y.isActive:null;!1===w&&(d=e);let x=g===l[f]&&g!==o[f]&&v;if(x&&(n||s)&&t.manuallyAnimateOnMount&&(x=!1),y.protectedKeys={...c},!y.isActive&&null===w||!g&&!y.prevProp||eo(g)||"boolean"==typeof g)continue;if("exit"===f&&y.isActive&&!0!==w){y.prevResolvedValues&&(c={...c,...y.prevResolvedValues});continue}let b=(p=y.prevProp,"string"==typeof(m=g)?m!==p:!!Array.isArray(m)&&!nR(m,p)),S=b||f===a&&y.isActive&&!x&&v||e>d&&v,T=!1,k=Array.isArray(g)?g:[g],P=k.reduce(r(f),{});!1===w&&(P={});let{prevResolvedValues:A={}}=y,C={...A,...P},E=e=>{S=!0,u.has(e)&&(T=!0,u.delete(e)),y.needsAnimating[e]=!0;let i=t.getValue(e);i&&(i.liveStyle=!1)};for(let t in C){let e=P[t],i=A[t];if(!c.hasOwnProperty(t))(iC(e)&&iC(i)?nR(e,i):e===i)?void 0!==e&&u.has(t)?E(t):y.protectedKeys[t]=!0:null!=e?E(t):u.add(t)}y.prevProp=g,y.prevResolvedValues=P,y.isActive&&(c={...c,...P}),(n||s)&&t.blockInitialAnimation&&(S=!1);let M=x&&b,V=!M||T;S&&V&&h.push(...k.map(e=>{let i={type:f};if("string"==typeof e&&(n||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){let{parent:n}=t,s=ik(n,e);if(n.enteringChildren&&s){let{delayChildren:e}=s.transition||{};i.delay=nM(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){let e={};if("boolean"!=typeof o.initial){let i=ik(t,Array.isArray(o.initial)?o.initial[0]:o.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{let n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),h.push({animation:e})}let f=!!h.length;return n&&(!1===o.initial||o.initial===o.animate)&&!t.manuallyAnimateOnMount&&(f=!1),n=!1,s=!1,f?e(h):Promise.resolve()}return{animateChanges:a,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;let s=a(e);for(let t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=nF(),s=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();eo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends iT{constructor(){super(...arguments),this.id=nO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&!1===i){if(this.isExitComplete){let{initial:t,custom:e}=this.node.getProps();if("string"==typeof t){let i=ik(this.node,t,e);if(i){let{transition:t,transitionEnd:e,...n}=i;for(let t in n)this.node.getValue(t)?.jump(n[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){let{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}},inView:{Feature:class extends iT{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var t;let e;this.stopObserver?.();let{viewport:i={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:a}=i,o={root:n?n.current:void 0,rootMargin:s,threshold:"number"==typeof r?r:rC[r]},l=t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,a&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),s=e?i:n;s&&s(t)};this.stopObserver=(t=this.node.current,e=function({root:t,...e}){let i=t||document;rk.has(i)||rk.set(i,{});let n=rk.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(rA,{root:t,...e})),n[s]}(o),rT.set(t,l),e.observe(t),()=>{rT.delete(t),e.unobserve(t)})}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends iT{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=function(t,e,i={}){let[n,s,r]=rm(t,i),a=t=>{let n=t.currentTarget;if(!rx(t)||rb.has(t))return;rg.add(n),i.stopPropagation&&rb.add(t);let r=e(n,t),a=(t,e)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),rg.has(n)&&rg.delete(n),rx(t)&&"function"==typeof r&&r(t,{success:e})},o=t=>{a(t,n===window||n===document||i.useGlobalTarget||ry(n,t.target))},l=t=>{a(t,!1)};window.addEventListener("pointerup",o,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{(i.useGlobalTarget?window:t).addEventListener("pointerdown",a,s),nq(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)&&(t.addEventListener("focus",t=>((t,e)=>{let i=t.currentTarget;if(!i)return;let n=rv(()=>{if(rg.has(i))return;rw(i,"down");let t=rv(()=>{rw(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>rw(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),n5.has(t.tagName)||!0===t.isContentEditable||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}(t,(t,e)=>(rS(this.node,e,"Start"),(t,{success:e})=>rS(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:i?.tap===!1})}unmount(){}}},focus:{Feature:class extends iT{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=iV(n$(this.node.current,"focus",()=>this.onFocus()),n$(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends iT{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){let[n,s,r]=rm(t,i);return n.forEach(t=>{let i,n=!1,r=!1,a=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},o=t=>{n=!1,window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o),r&&(r=!1,a(t))},l=t=>{if("touch"!==t.pointerType){if(n){r=!0;return}a(t)}};t.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||nU.x||nU.y)return;r=!1;let a=e(t,n);"function"==typeof a&&(i=a,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",o,s),window.addEventListener("pointercancel",o,s)},s)}),r}(t,(t,e)=>(rf(this.node,e,"Start"),t=>rf(this.node,t,"End"))))}unmount(){}}},pan:{Feature:class extends iT{constructor(){super(...arguments),this.removePointerDownListener=tk}onPointerDown(t){this.session=new si(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:n8(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:sf(t),onStart:sf(e),onMove:sf(i),onEnd:(t,e)=>{delete this.session,n&&tE.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=n7(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends iT{constructor(t){super(t),this.removeGroupControls=tk,this.removeListeners=tk,this.controls=new sd(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tk}update(){let{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:rp,MeasureLayout:sx},layout:{ProjectionNode:rp,MeasureLayout:sx}},(t,e)=>e.isSVG??e5(t)?new eN(e):new e1(e,{allowProjection:t!==e2.Fragment}));t.s(["motion",0,rE],341807)},361421,t=>{"use strict";let e=(0,t.i(433721).default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);t.s(["default",0,e])},592039,t=>{"use strict";let e=(0,t.i(433721).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);t.s(["CircleDot",0,e],592039)},256186,257295,619279,439485,18158,t=>{"use strict";var e,i,n,s,r=t.i(344180);t.s([],790766),t.i(790766),t.i(8890);var a=t.i(764556),o=t.i(29905),l=t.i(969490),h=t.i(535270),u=t.i(277642),c=t.i(139236),d=t.i(602453),p=t.i(742665),m=t.i(427708),f=t.i(254891);function y(t){let{open:e,defaultOpen:i,onOpenChange:n,disabled:s}=t,r=void 0!==e,[l,y]=(0,h.useControlled)({controlled:e,default:i,name:"Collapsible",state:"open"}),{mounted:g,setMounted:v,transitionStatus:w}=(0,f.useTransitionStatus)(l,!0,!0),[x,b]=a.useState(l),[{height:S,width:T},k]=a.useState({height:void 0,width:void 0}),P=(0,c.useBaseUiId)(),[A,C]=a.useState(),E=A??P,[M,V]=a.useState(!1),[D,R]=a.useState(!1),L=a.useRef(null),j=a.useRef(null),I=a.useRef(null),F=a.useRef(null),O=(0,m.useAnimationsFinished)(F,!1),B=(0,o.useStableCallback)(t=>{let e=!l,i=(0,d.createChangeEventDetails)(p.REASONS.triggerPress,t.nativeEvent);if(n(e,i),i.isCanceled)return;let s=F.current;"css-animation"===j.current&&null!=s&&s.style.removeProperty("animation-name"),M||D||(null!=j.current&&"css-animation"!==j.current&&!g&&e&&v(!0),"css-animation"===j.current&&(!x&&e&&b(!0),!g&&e&&v(!0))),y(e),"none"===j.current&&g&&!e&&v(!1)});return(0,u.useIsoLayoutEffect)(()=>{r&&"none"===j.current&&!l&&v(!1)},[r,l,e,v]),a.useMemo(()=>({abortControllerRef:L,animationTypeRef:j,disabled:s,handleTrigger:B,height:S,mounted:g,open:l,panelId:E,panelRef:F,runOnceAnimationsFinish:O,setDimensions:k,setHiddenUntilFound:V,setKeepMounted:R,setMounted:v,setOpen:y,setPanelIdState:C,setVisible:b,transitionDimensionRef:I,transitionStatus:w,visible:x,width:T}),[L,j,s,B,S,g,l,E,F,O,k,V,R,v,y,b,I,w,x,T])}t.s(["useCollapsibleRoot",0,y],257295);var g=t.i(267805);let v=a.createContext(void 0);function w(){let t=a.useContext(v);if(void 0===t)throw Error((0,g.default)(15));return t}t.s(["CollapsibleRootContext",0,v,"useCollapsibleRootContext",0,w],619279);var x=t.i(282458);let b=((e={}).open="data-open",e.closed="data-closed",e[e.startingStyle=x.TransitionStatusDataAttributes.startingStyle]="startingStyle",e[e.endingStyle=x.TransitionStatusDataAttributes.endingStyle]="endingStyle",e),S=((i={}).panelOpen="data-panel-open",i),T={[b.open]:""},k={[b.closed]:""},P={open:t=>t?{[S.panelOpen]:""}:null},A={open:t=>t?T:k};t.s(["collapsibleOpenStateMapping",0,A,"triggerOpenStateMapping",0,P],439485);let C={...A,...x.transitionStatusMapping},E=a.forwardRef(function(t,e){let{render:i,className:n,defaultOpen:s=!1,disabled:h=!1,onOpenChange:u,open:c,style:d,...p}=t,m=(0,o.useStableCallback)(u),f=y({open:c,defaultOpen:s,onOpenChange:m,disabled:h}),g=a.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),w=a.useMemo(()=>({...f,onOpenChange:m,state:g}),[f,m,g]),x=(0,l.useRenderElement)("div",t,{state:g,ref:e,props:p,stateAttributesMapping:C});return(0,r.jsx)(v.Provider,{value:w,children:x})});var M=t.i(931709);let V={...P,...x.transitionStatusMapping},D=a.forwardRef(function(t,e){let{panelId:i,open:n,handleTrigger:s,state:r,disabled:o}=w(),{className:h,disabled:u=o,id:c,render:d,nativeButton:p=!0,style:m,...f}=t,{getButtonProps:y,buttonRef:g}=(0,M.useButton)({disabled:u,focusableWhenDisabled:!0,native:p}),v=a.useMemo(()=>({"aria-controls":n?i:void 0,"aria-expanded":n,onClick:s}),[i,n,s]);return(0,l.useRenderElement)("button",t,{state:r,ref:[e,g],props:[v,f,y],stateAttributesMapping:V})});var R=t.i(422561),L=t.i(204133),j=t.i(130522),I=t.i(859092);let F=((n={}).disabled="data-disabled",n.orientation="data-orientation",n);function O(t){let{abortControllerRef:e,animationTypeRef:i,externalRef:n,height:s,hiddenUntilFound:r,keepMounted:l,id:h,mounted:c,onOpenChange:m,open:f,panelRef:y,runOnceAnimationsFinish:g,setDimensions:v,setMounted:w,setOpen:x,setVisible:S,transitionDimensionRef:T,visible:k,width:P}=t,A=a.useRef(!1),C=a.useRef(null),E=a.useRef(f),M=a.useRef(f),V=(0,I.useAnimationFrame)(),D=a.useMemo(()=>"css-animation"===i.current?!k:!f&&!c,[f,c,k,i]),O=(0,o.useStableCallback)(t=>{if(!t)return;if(null==i.current||null==T.current){let e=getComputedStyle(t),n="none"!==e.animationName&&""!==e.animationName,s="0s"!==e.transitionDuration&&""!==e.transitionDuration;n&&s||("none"===e.animationName&&"0s"!==e.transitionDuration?i.current="css-transition":"none"!==e.animationName&&"0s"===e.transitionDuration?i.current="css-animation":i.current="none"),"horizontal"===t.getAttribute(F.orientation)||e.transitionProperty.indexOf("width")>-1?T.current="width":T.current="height"}if("css-transition"!==i.current)return;(void 0===s||void 0===P)&&(v({height:t.scrollHeight,width:t.scrollWidth}),M.current&&t.style.setProperty("transition-duration","0s"));let e=-1,n=-1;return e=I.AnimationFrame.request(()=>{M.current=!1,n=I.AnimationFrame.request(()=>{setTimeout(()=>{t.style.removeProperty("transition-duration")})})}),()=>{I.AnimationFrame.cancel(e),I.AnimationFrame.cancel(n)}}),B=(0,L.useMergedRefs)(n,y,O);return(0,u.useIsoLayoutEffect)(()=>{if("css-transition"!==i.current)return;let t=y.current;if(!t)return;let n=-1;if(null!=e.current&&(e.current.abort(),e.current=null),f){let e={"justify-content":t.style.justifyContent,"align-items":t.style.alignItems,"align-content":t.style.alignContent,"justify-items":t.style.justifyItems};Object.keys(e).forEach(e=>{t.style.setProperty(e,"initial","important")}),M.current||l||t.setAttribute(b.startingStyle,""),v({height:t.scrollHeight,width:t.scrollWidth}),n=I.AnimationFrame.request(()=>{Object.entries(e).forEach(([e,i])=>{""===i?t.style.removeProperty(e):t.style.setProperty(e,i)})})}else{if(0===t.scrollHeight&&0===t.scrollWidth)return;v({height:t.scrollHeight,width:t.scrollWidth});let i=new AbortController;e.current=i;let n=i.signal,s=null,r=b.endingStyle;return(s=new MutationObserver(a=>{a.some(t=>"attributes"===t.type&&t.attributeName===r)&&(s?.disconnect(),s=null,g(()=>{v({height:0,width:0}),t.style.removeProperty("content-visibility"),w(!1),e.current===i&&(e.current=null)},n))})).observe(t,{attributes:!0,attributeFilter:[r]}),()=>{s?.disconnect(),V.cancel(),e.current===i&&(i.abort(),e.current=null)}}return()=>{I.AnimationFrame.cancel(n)}},[e,i,V,r,l,c,f,y,g,v,w]),(0,u.useIsoLayoutEffect)(()=>{if("css-animation"!==i.current)return;let t=y.current;t&&(C.current=t.style.animationName||C.current,t.style.setProperty("animation-name","none"),v({height:t.scrollHeight,width:t.scrollWidth}),E.current||A.current||t.style.removeProperty("animation-name"),f?(null!=e.current&&(e.current.abort(),e.current=null),w(!0),S(!0)):(e.current=new AbortController,g(()=>{w(!1),S(!1),e.current=null},e.current.signal)))},[e,i,f,y,g,v,w,S,k]),(0,j.useOnMount)(()=>{let t=I.AnimationFrame.request(()=>{E.current=!1});return()=>I.AnimationFrame.cancel(t)}),(0,u.useIsoLayoutEffect)(()=>{if(!r)return;let t=y.current;if(!t)return;let e=-1,i=-1;return f&&A.current&&(t.style.transitionDuration="0s",v({height:t.scrollHeight,width:t.scrollWidth}),e=I.AnimationFrame.request(()=>{A.current=!1,i=I.AnimationFrame.request(()=>{setTimeout(()=>{t.style.removeProperty("transition-duration")})})})),()=>{I.AnimationFrame.cancel(e),I.AnimationFrame.cancel(i)}},[r,f,y,v]),(0,u.useIsoLayoutEffect)(()=>{let t=y.current;t&&r&&D&&(t.setAttribute("hidden","until-found"),"css-transition"===i.current&&t.setAttribute(b.startingStyle,""))},[r,D,i,y]),a.useEffect(function(){let t=y.current;if(t)return(0,R.addEventListener)(t,"beforematch",function(t){A.current=!0,x(!0),m(!0,(0,d.createChangeEventDetails)(p.REASONS.none,t))})},[m,y,x]),a.useMemo(()=>({props:{hidden:D,id:h,ref:B}}),[D,h,B])}t.s(["useCollapsiblePanel",0,O],18158);let B=((s={}).collapsiblePanelHeight="--collapsible-panel-height",s.collapsiblePanelWidth="--collapsible-panel-width",s);var $=t.i(273598);let U=a.forwardRef(function(t,e){let{className:i,hiddenUntilFound:n,keepMounted:s,render:r,id:o,style:h,...c}=t,{abortControllerRef:d,animationTypeRef:p,height:m,mounted:f,onOpenChange:y,open:g,panelId:v,panelRef:x,runOnceAnimationsFinish:b,setDimensions:S,setHiddenUntilFound:T,setKeepMounted:k,setMounted:P,setPanelIdState:A,setOpen:E,setVisible:M,state:V,transitionDimensionRef:D,visible:R,width:L,transitionStatus:j}=w(),I=n??!1,F=s??!1;(0,u.useIsoLayoutEffect)(()=>{if(o)return A(o),()=>{A(void 0)}},[o,A]),(0,u.useIsoLayoutEffect)(()=>{T(I)},[T,I]),(0,u.useIsoLayoutEffect)(()=>{k(F)},[k,F]);let{props:U}=O({abortControllerRef:d,animationTypeRef:p,externalRef:e,height:m,hiddenUntilFound:I,id:v,keepMounted:F,mounted:f,onOpenChange:y,open:g,panelRef:x,runOnceAnimationsFinish:b,setDimensions:S,setMounted:P,setOpen:E,setVisible:M,transitionDimensionRef:D,visible:R,width:L});(0,$.useOpenChangeComplete)({open:g&&"idle"===j,ref:x,onComplete(){g&&S({height:void 0,width:void 0})}});let N=a.useMemo(()=>({...V,transitionStatus:j}),[V,j]),W=(0,l.useRenderElement)("div",t,{state:N,ref:[e,x],props:[U,{style:{[B.collapsiblePanelHeight]:void 0===m?"auto":`${m}px`,[B.collapsiblePanelWidth]:void 0===L?"auto":`${L}px`}},c],stateAttributesMapping:C});return F||I||f?W:null});t.s(["Panel",0,U,"Root",0,E,"Trigger",0,D],917853);var N=t.i(917853),N=N;t.s(["Collapsible",0,function({...t}){return(0,r.jsx)(N.Root,{"data-slot":"collapsible",...t})},"CollapsibleContent",0,function({...t}){return(0,r.jsx)(N.Panel,{"data-slot":"collapsible-content",...t})},"CollapsibleTrigger",0,function({...t}){return(0,r.jsx)(N.Trigger,{"data-slot":"collapsible-trigger",...t})}],256186)},380797,t=>{"use strict";let e=(0,t.i(433721).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);t.s(["default",0,e])},249673,t=>{"use strict";var e=t.i(380797);t.s(["ChevronUp",()=>e.default])},315775,t=>{"use strict";var e=t.i(226651);t.s(["MoreHorizontal",()=>e.default])},36539,t=>{"use strict";let e=(0,t.i(433721).default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);t.s(["default",0,e])},875350,t=>{"use strict";var e=t.i(288556);t.s(["Trash2Icon",()=>e.default])},506037,t=>{"use strict";var e=t.i(816709),i=t.i(437122);let n=(0,e.create)((t,e)=>({notifications:[],loaded:!1,load:async e=>{try{let n=await (0,i.fetchWithAuth)(`/api/workspaces/${e}/notifications`),s=await n.json();t({notifications:s,loaded:!0})}catch{t({loaded:!0})}},addNotification:e=>{t(t=>({notifications:[e,...t.notifications]}))},clearAll:async e=>{await (0,i.fetchWithAuth)(`/api/workspaces/${e}/notifications`,{method:"DELETE"}),t({notifications:[]})},markRead:async(e,n)=>{await (0,i.fetchWithAuth)(`/api/workspaces/${e}/notifications/${n}/read`,{method:"PUT"}),t(t=>({notifications:t.notifications.map(t=>t.id===n?{...t,read:!0}:t)}))},markAllRead:async e=>{await (0,i.fetchWithAuth)(`/api/workspaces/${e}/notifications/read-all`,{method:"PUT"}),t(t=>({notifications:t.notifications.map(t=>({...t,read:!0}))}))},reset:()=>t({notifications:[],loaded:!1})}));t.s(["useNotificationStore",0,n])},227634,157408,31807,t=>{"use strict";let e=(0,t.i(433721).default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);t.s(["Hash",0,e],227634);var i=t.i(816709),n=t.i(523592),s=t.i(437122);class r{workspaceId;ws;handlers;reconnectTimer;url;disposed;constructor(t){this.workspaceId=t,this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.disposed=!1,this.onVisibilityChange=()=>{"visible"!==document.visibilityState||this.disposed||this.ws&&this.ws.readyState!==WebSocket.CLOSED&&this.ws.readyState!==WebSocket.CLOSING||(console.log("[WS] page visible, reconnecting..."),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.connect())};const e=(0,n.getActiveServerUrl)(),i=(0,s.getToken)(),r=new URL("/ws",e??window.location.origin);r.protocol="https:"===r.protocol?"wss:":"ws:",r.searchParams.set("workspaceId",t),i&&r.searchParams.set("token",i),this.url=r.toString(),document.addEventListener("visibilitychange",this.onVisibilityChange)}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[WS] connected")},this.ws.onmessage=t=>{try{let e=JSON.parse(t.data),i=this.handlers.get(e.event);if(i)for(let t of i)t(e.data)}catch{console.error("[WS] parse error")}},this.ws.onclose=t=>{console.log(`[WS] disconnected (${t.code}${t.reason?`: ${t.reason}`:""}), reconnecting...`),this.reconnectTimer=setTimeout(()=>this.connect(),3e3)},this.ws.onerror=()=>{this.ws?.close()}}onVisibilityChange;disconnect(){this.disposed=!0,document.removeEventListener("visibilitychange",this.onVisibilityChange),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.ws?.close(),this.ws=null}send(t,e){this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({event:t,data:e}))}on(t,e){return this.handlers.has(t)||this.handlers.set(t,new Set),this.handlers.get(t).add(e),()=>this.handlers.get(t)?.delete(e)}off(t,e){this.handlers.get(t)?.delete(e)}}let a=null;function o(t){return a&&a.workspaceId!==t&&(a.disconnect(),a=null),a||(a=new r(t)).connect(),a}t.s(["getWS",0,o],157408);let l="agent-spaces:channel:",h=(0,i.create)((t,e)=>({workspaceId:null,channels:[],activeChannelId:null,channelSelectSeq:0,messages:{},loadChannels:async e=>{let i=await fetch(`/api/workspaces/${e}/channels`),n=await i.json(),s=function(t,e){try{let i=localStorage.getItem(l+t);if(i&&e.some(t=>t.id===i))return i}catch{}return e[0]?.id??null}(e,n);t({workspaceId:e,channels:n,activeChannelId:s})},createChannel:async(e,i,n="general",s)=>{let r=await fetch(`/api/workspaces/${e}/channels`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,type:n,members:s})}),a=await r.json();t(t=>({channels:t.channels.some(t=>t.id===a.id)?t.channels.map(t=>t.id===a.id?a:t):[...t.channels,a],activeChannelId:a.id}))},updateChannel:async(e,i,n)=>{let s=await fetch(`/api/workspaces/${e}/channels/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)throw Error("Failed to update channel");let r=await s.json();return t(t=>({channels:t.channels.map(t=>t.id===i?r:t)})),r},setActiveChannel:e=>{let{workspaceId:i}=h.getState();if(i)try{localStorage.setItem(l+i,e)}catch{}t(t=>({activeChannelId:e,channelSelectSeq:t.channelSelectSeq+1}))},loadMessages:async(e,i)=>{let n=await fetch(`/api/workspaces/${e}/channels/${i}/messages`),s=await n.json();t(t=>({messages:{...t.messages,[i]:s}}))},sendMessage:(t,e,i,n=[],s=[],r)=>{o(t).send("channel.message",{channelId:e,content:i,mentions:n,attachments:s,replyToMessageId:r})},addMessage:(e,i)=>{t(t=>({messages:{...t.messages,[e]:[...t.messages[e]||[],i]}}))},updateMessage:(e,i)=>{t(t=>({messages:{...t.messages,[e]:(t.messages[e]||[]).map(t=>t.id===i.id?i:t)}}))},stopProcessingMessages:e=>{t(t=>({messages:{...t.messages,[e]:(t.messages[e]||[]).map(t=>"pending"===t.status||"streaming"===t.status||"waiting_for_user"===t.status?{...t,status:"error",content:t.content||"Stopped by user"}:t)}}))},deleteMessage:(e,i)=>{t(t=>({messages:{...t.messages,[e]:(t.messages[e]||[]).filter(t=>t.id!==i)}}))},clearMessages:async(e,i)=>{await fetch(`/api/workspaces/${e}/channels/${i}/messages`,{method:"DELETE"}),t(t=>({messages:{...t.messages,[i]:[]}}))},deleteChannel:async(t,i)=>{await fetch(`/api/workspaces/${t}/channels/${i}`,{method:"DELETE"}),e().removeChannelLocal(i)},removeChannelLocal:e=>{t(t=>{let i=t.channels.filter(t=>t.id!==e),n={...t.messages};return delete n[e],{channels:i,activeChannelId:t.activeChannelId===e?i[0]?.id??null:t.activeChannelId,messages:n}})},upsertChannel:e=>{t(t=>{let i=t.channels.findIndex(t=>t.id===e.id);if(i<0)return"string"==typeof e.workspaceId&&"string"==typeof e.name&&("general"===e.type||"issue"===e.type||"agent"===e.type)&&Array.isArray(e.members)&&"string"==typeof e.createdAt?{channels:[...t.channels,e]}:{channels:t.channels};let n=[...t.channels],s=n[i];return n[i]={...s,...e,members:Array.isArray(e.members)?e.members:s.members},{channels:n}})},saveDraft:async(e,i,n)=>{let s=h.getState().channels.find(t=>t.id===i);if(s?.draft?.content===n)return;let r={content:n,updatedAt:new Date().toISOString()};t(t=>({channels:t.channels.map(t=>t.id===i?{...t,draft:r}:t)})),await fetch(`/api/workspaces/${e}/channels/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:r})})},clearDraft:async(e,i)=>{t(t=>({channels:t.channels.map(t=>t.id===i?{...t,draft:void 0}:t)})),await fetch(`/api/workspaces/${e}/channels/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:null})})},ensureAndActivateChannel:async(i,n)=>{let{channels:s}=e();if(!s.some(t=>t.id===n)){let e=await fetch(`/api/workspaces/${i}/channels`);e.ok&&t({channels:await e.json()})}e().setActiveChannel(n)}}));t.s(["useChannelStore",0,h],31807)},327964,873111,t=>{"use strict";var e=t.i(816709),i=t.i(31807);let n=(0,e.create)((t,e)=>({tasks:[],loading:!1,loadTasks:async(e,i)=>{t({loading:!0});try{let n=i?`?issueId=${i}`:"",s=await fetch(`/api/workspaces/${e}/tasks${n}`),r=await s.json();t({tasks:r,loading:!1})}catch{t({loading:!1})}},createTask:async(t,i,n,s,r)=>{let a=await fetch(`/api/workspaces/${t}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:i,title:n,description:s,agentConfigId:r})}),o=await a.json();return e().upsertTask(o),o},updateTask:async(t,i,n)=>{let s=await fetch(`/api/workspaces/${t}/tasks/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),r=await s.json();e().upsertTask(r)},deleteTask:async(e,i)=>{await fetch(`/api/workspaces/${e}/tasks/${i}`,{method:"DELETE"}),t(t=>({tasks:t.tasks.filter(t=>t.id!==i)}))},retryTask:async(t,i)=>{let n=await fetch(`/api/workspaces/${t}/tasks/${i}/retry`,{method:"POST"}),s=await n.json();e().upsertTask(s)},cancelTask:async(t,i)=>{let n=await fetch(`/api/workspaces/${t}/tasks/${i}/cancel`,{method:"POST"}),s=await n.json();e().upsertTask(s)},reorderTasks:async(t,e,i)=>{await fetch(`/api/workspaces/${t}/tasks/reorder`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({issueId:e,taskIds:i})})},upsertTask:e=>{t(t=>{let i=t.tasks.findIndex(t=>t.id===e.id);if(i>=0){let n=[...t.tasks];return n[i]=e,{tasks:n}}return{tasks:[...t.tasks,e]}})}}));t.s(["useTaskStore",0,n],873111);let s="agent-spaces:issue:",r=(0,e.create)((t,e)=>({workspaceId:null,issues:[],activeIssueId:null,issueSelectSeq:0,loading:!1,loadIssues:async e=>{t({loading:!0});try{let i=await fetch(`/api/workspaces/${e}/issues`),n=await i.json(),r=function(t,e){try{let i=localStorage.getItem(s+t);if(i&&e.some(t=>t.id===i))return i}catch{}return null}(e,n);t({workspaceId:e,issues:n,activeIssueId:r,loading:!1})}catch{t({loading:!1})}},createIssue:async(t,i,n,s,r)=>{let a=await fetch(`/api/workspaces/${t}/issues`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:i,description:n,members:s,workflowId:r})}),o=await a.json();e().upsertIssue(o),e().setActiveIssue(o.id)},setActiveIssue:e=>{let{workspaceId:i}=r.getState();if(i&&e)try{localStorage.setItem(s+i,e)}catch{}t(t=>({activeIssueId:e,issueSelectSeq:t.issueSelectSeq+1}))},updateIssue:async(t,i,n)=>{let s=await fetch(`/api/workspaces/${t}/issues/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),r=await s.json();e().upsertIssue(r)},updateIssueStatus:async(t,e,i)=>{await fetch(`/api/workspaces/${t}/issues/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:i})})},startIssue:async(t,i)=>{let n=await fetch(`/api/workspaces/${t}/issues/${i}/start`,{method:"POST"}),s=await n.json();e().upsertIssue(s)},resumeIssue:async(t,i)=>{let n=await fetch(`/api/workspaces/${t}/issues/${i}/resume`,{method:"POST"}),s=await n.json();e().upsertIssue(s)},deleteIssue:async(t,s)=>{let r=e().issues.find(t=>t.id===s);if(await fetch(`/api/workspaces/${t}/issues/${s}`,{method:"DELETE"}),e().removeIssue(s),r?.channelId){let{removeChannelLocal:t}=i.useChannelStore.getState();t(r.channelId)}let{tasks:a}=n.getState(),o=a.filter(t=>t.issueId===s);if(o.length>0){let t=new Set(o.map(t=>t.id));n.setState(e=>({tasks:e.tasks.filter(e=>!t.has(e.id))}))}},upsertIssue:e=>{t(t=>{let i=t.issues.findIndex(t=>t.id===e.id);if(i>=0){let n=[...t.issues];return n[i]=e,{issues:n}}return{issues:[...t.issues,e]}})},removeIssue:e=>{t(t=>({issues:t.issues.filter(t=>t.id!==e),activeIssueId:t.activeIssueId===e?null:t.activeIssueId}))}}));t.s(["useIssueStore",0,r],327964)},250226,t=>{"use strict";let e=(0,t.i(816709).create)(t=>({activePanel:"channel-list",setActivePanel:e=>t({activePanel:e})}));t.s(["useMobilePanelStore",0,e])},683640,184591,t=>{"use strict";let e=(0,t.i(433721).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);t.s(["default",0,e],184591),t.s(["Terminal",0,e],683640)},277071,t=>{"use strict";var e=t.i(816709),i=t.i(437122);let n=0,s=(0,e.create)((t,e)=>({tabs:[],bookmarks:[],bookmarksLoaded:!1,activeId:null,ballVisible:!1,add:(i,s,r)=>{let{tabs:a}=e(),o=a.find(t=>t.url===i);if(o)return o.id;let l=`iframe-${++n}`;return t({tabs:[...a,{id:l,url:i,title:s||new URL(i).hostname,size:r}]}),l},remove:i=>{let{tabs:n,activeId:s}=e(),r=n.filter(t=>t.id!==i);t({tabs:r,activeId:s===i?r.length>0?r[r.length-1].id:null:s})},setActive:e=>t({activeId:e}),toggleBall:()=>t(t=>({ballVisible:!t.ballVisible})),loadBookmarks:async()=>{if(!e().bookmarksLoaded)try{let e=await (0,i.fetchWithAuth)("/api/iframe-bookmarks");if(e.ok){let i=await e.json();t({bookmarks:i,bookmarksLoaded:!0})}}catch{}},addBookmark:async(e,n,s)=>{try{let r=await (0,i.fetchWithAuth)("/api/iframe-bookmarks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,url:n,size:s})});if(!r.ok)return null;let a=await r.json();return t(t=>({bookmarks:[...t.bookmarks,a]})),a}catch{return null}},updateBookmark:async(e,n)=>{try{let s=await (0,i.fetchWithAuth)(`/api/iframe-bookmarks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)return null;let r=await s.json();return t(t=>({bookmarks:t.bookmarks.map(t=>t.id===e?r:t)})),r}catch{return null}},removeBookmark:async e=>{try{await (0,i.fetchWithAuth)(`/api/iframe-bookmarks/${e}`,{method:"DELETE"}),t(t=>({bookmarks:t.bookmarks.filter(t=>t.id!==e)}))}catch{}}}));t.s(["useIframeTabs",0,s])},367914,t=>{"use strict";var e=t.i(750012);t.s(["SearchIcon",()=>e.default])},938306,t=>{"use strict";let e=(0,t.i(433721).default)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);t.s(["MessageCircle",0,e],938306)},381253,t=>{"use strict";let e=(0,t.i(433721).default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);t.s(["FileCode",0,e],381253)},691223,t=>{"use strict";var e=t.i(816709);let i="__commit_diff__:";function n(t){return t.startsWith(i)}function s(t){return t.slice(i.length)}let r=null;function a(t){r&&clearTimeout(r),r=setTimeout(()=>{o.getState().saveEditorState(t)},500)}let o=(0,e.create)((t,e)=>({tree:[],treeLoading:!1,loadingDirs:new Set,openFiles:[],activeFilePath:null,pendingJump:null,revealPath:null,commitDiffs:{},loadTree:async e=>{t({treeLoading:!0});try{let i=await fetch(`/api/workspaces/${e}/files/tree?depth=1`),n=await i.json();t({tree:n,treeLoading:!1})}catch{t({treeLoading:!1})}},loadDirectory:async(i,n)=>{let{tree:s,loadingDirs:r}=e(),a=t=>{for(let e of t){if(e.path===n)return e;if(e.children){let t=a(e.children);if(t)return t}}};if(a(s)?.children!==void 0||r.has(n))return;let o=new Set(r);o.add(n),t({loadingDirs:o});try{let s=await fetch(`/api/workspaces/${i}/files/tree?path=${encodeURIComponent(n)}&depth=1`),r=await s.json(),a=t=>t.map(t=>t.path===n?{...t,children:r}:t.children?{...t,children:a(t.children)}:t),o=new Set(e().loadingDirs);o.delete(n),t({tree:a(e().tree),loadingDirs:o})}catch{let i=new Set(e().loadingDirs);i.delete(n),t({loadingDirs:i})}},openFile:async(i,n)=>{if(e().openFiles.find(t=>t.path===n)){t({activeFilePath:n}),a(i);return}let s=await fetch(`/api/workspaces/${i}/files/content?path=${encodeURIComponent(n)}`),r=await s.json(),o=n.split("/").pop()||n;t(t=>({openFiles:[...t.openFiles,{path:n,name:o,content:r.content,modified:!1}],activeFilePath:n})),a(i)},saveFile:async(i,n)=>{let s=e().openFiles.find(t=>t.path===n);s&&(await fetch(`/api/workspaces/${i}/files/content`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:s.content})}),t(t=>({openFiles:t.openFiles.map(t=>t.path===n?{...t,modified:!1}:t)})))},updateContent:(e,i)=>{t(t=>({openFiles:t.openFiles.map(t=>t.path===e?{...t,content:i,modified:!0}:t)}))},closeFile:(e,i)=>{t(t=>{let e=t.openFiles.filter(t=>t.path!==i),r=t.activeFilePath===i?e.length>0?e[e.length-1].path:null:t.activeFilePath,a={...t.commitDiffs};return n(i)&&delete a[s(i)],{openFiles:e,activeFilePath:r,commitDiffs:a}}),a(e)},setActiveFile:(e,i)=>{t({activeFilePath:i}),a(e)},jumpToPosition:async(i,n,s,r)=>{await e().openFile(i,n),t({pendingJump:{line:s,column:r}})},clearPendingJump:()=>t({pendingJump:null}),setRevealPath:e=>t({revealPath:e}),clearRevealPath:()=>t({revealPath:null}),loadEditorState:async e=>{try{let i=await fetch(`/api/workspaces/${e}/files/editor-state`),{openFilePaths:n=[],activeFilePath:s=null}=await i.json();if(0===n.length)return;let r=[];for(let t of n)try{let i=await fetch(`/api/workspaces/${e}/files/content?path=${encodeURIComponent(t)}`),n=await i.json(),s=t.split("/").pop()||t;r.push({path:t,name:s,content:n.content,modified:!1})}catch{}let a=s&&r.find(t=>t.path===s)?s:r.length>0?r[r.length-1].path:null;t({openFiles:r,activeFilePath:a})}catch{}},saveEditorState:async t=>{let{openFiles:i,activeFilePath:s}=e(),r=i.filter(t=>!n(t.path)),a=s&&!n(s)?s:null;try{await fetch(`/api/workspaces/${t}/files/editor-state`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({openFilePaths:r.map(t=>t.path),activeFilePath:a})})}catch{}},openCommitDiff:(e,n,s,r)=>{let a=i+n;t(t=>t.openFiles.find(t=>t.path===a)?{activeFilePath:a,commitDiffs:{...t.commitDiffs,[n]:{diffs:r,message:s}}}:{openFiles:[...t.openFiles,{path:a,name:n.slice(0,7),content:"",modified:!1}],activeFilePath:a,commitDiffs:{...t.commitDiffs,[n]:{diffs:r,message:s}}})},closeCommitDiff:(t,n)=>{let s=i+n;e().closeFile(t,s)}}));t.s(["getCommitHashFromPath",0,s,"isCommitDiffPath",0,n,"useEditorStore",0,o])}]);