likec4 1.55.1 → 1.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/__app__/chunks/AIChat2.mjs +2 -0
  2. package/__app__/chunks/DiagramActorProvider.mjs +10 -0
  3. package/__app__/chunks/EmbedPage.mjs +1 -0
  4. package/__app__/chunks/ExportPage.mjs +2 -0
  5. package/__app__/chunks/LikeC4Diagram.mjs +19 -0
  6. package/__app__/chunks/LikeC4Styles.mjs +48 -0
  7. package/__app__/chunks/Markdown.mjs +1 -0
  8. package/__app__/chunks/NavigationPanel.mjs +1 -0
  9. package/__app__/chunks/ViewReact.mjs +1 -0
  10. package/__app__/chunks/adhoc-editor.mjs +1 -0
  11. package/__app__/chunks/aichat.mjs +1 -0
  12. package/__app__/chunks/box.mjs +1 -0
  13. package/__app__/chunks/create-style-context.mjs +1 -0
  14. package/__app__/chunks/css.mjs +1 -0
  15. package/__app__/chunks/factory.mjs +1 -0
  16. package/__app__/chunks/hooks.mjs +1 -0
  17. package/__app__/chunks/hstack.mjs +1 -0
  18. package/__app__/chunks/libs/@dagrejs/dagre.mjs +1 -0
  19. package/__app__/chunks/libs/@floating-ui/core.mjs +1 -0
  20. package/__app__/chunks/libs/@floating-ui/dom.mjs +1 -0
  21. package/__app__/chunks/libs/@floating-ui/react.mjs +1 -0
  22. package/__app__/chunks/libs/@mantine/core.mjs +41 -0
  23. package/__app__/chunks/libs/@mantine/hooks.mjs +1 -0
  24. package/__app__/chunks/libs/@nanostores/react.mjs +1 -0
  25. package/__app__/chunks/libs/@react-hookz/web.mjs +1 -0
  26. package/__app__/chunks/libs/@tabler/icons-react.mjs +358 -0
  27. package/__app__/chunks/libs/@tanstack/ai-client.mjs +2 -0
  28. package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +1 -0
  29. package/__app__/chunks/libs/@tanstack/ai-react.mjs +1 -0
  30. package/__app__/chunks/libs/@tanstack/ai.mjs +2 -0
  31. package/__app__/chunks/libs/@tanstack/history.mjs +1 -0
  32. package/__app__/chunks/libs/@tanstack/react-router.mjs +3 -0
  33. package/__app__/chunks/libs/@tanstack/router-core.mjs +1 -0
  34. package/__app__/chunks/libs/@xstate/react.mjs +1 -0
  35. package/__app__/chunks/libs/@xstate/store.mjs +1 -0
  36. package/__app__/chunks/libs/@xyflow/react.mjs +7 -0
  37. package/__app__/chunks/libs/@zag-js/anatomy.mjs +1 -0
  38. package/__app__/chunks/libs/@zag-js/collection.mjs +1 -0
  39. package/__app__/chunks/libs/@zag-js/core.mjs +1 -0
  40. package/__app__/chunks/libs/@zag-js/react.mjs +1 -0
  41. package/__app__/chunks/libs/@zag-js/tree-view.mjs +1 -0
  42. package/__app__/chunks/libs/bezier-js.mjs +1 -0
  43. package/__app__/chunks/libs/copy-anything.mjs +1 -0
  44. package/__app__/chunks/libs/d3-path.mjs +1 -0
  45. package/__app__/chunks/libs/d3-shape.mjs +1 -0
  46. package/__app__/chunks/libs/fast-equals.mjs +1 -0
  47. package/__app__/chunks/libs/framer-motion.mjs +9 -0
  48. package/__app__/chunks/libs/html-to-image.mjs +2 -0
  49. package/__app__/chunks/libs/motion-dom.mjs +1 -0
  50. package/__app__/chunks/libs/nanostores.mjs +1 -0
  51. package/__app__/chunks/libs/react-error-boundary.mjs +1 -0
  52. package/__app__/chunks/libs/react-resizable-panels.mjs +1 -0
  53. package/__app__/chunks/libs/remeda.mjs +1 -0
  54. package/__app__/chunks/libs/superjson.mjs +1 -0
  55. package/__app__/chunks/libs/zod.mjs +64 -0
  56. package/__app__/chunks/rolldown-runtime.mjs +1 -0
  57. package/__app__/chunks/styles.css.mjs +1 -0
  58. package/__app__/chunks/txt.mjs +1 -0
  59. package/__app__/chunks/useLikeC4Project.mjs +1 -0
  60. package/__app__/codegen/react.mjs +11 -0
  61. package/__app__/codegen/webcomponent.mjs +942 -0
  62. package/__app__/src/aichat/index.mjs +1 -0
  63. package/__app__/src/fonts.css +1 -1
  64. package/__app__/src/main.mjs +45 -0
  65. package/__app__/src/pages/AdHocViewEditor.mjs +1 -0
  66. package/__app__/src/pages/EmbedPage.mjs +1 -0
  67. package/__app__/src/pages/ExportPage.mjs +1 -0
  68. package/__app__/src/pages/ProjectsOverview.mjs +1 -0
  69. package/__app__/src/pages/ViewAsD2.mjs +1 -0
  70. package/__app__/src/pages/ViewAsDot.mjs +1 -0
  71. package/__app__/src/pages/ViewAsMmd.mjs +1 -0
  72. package/__app__/src/pages/ViewAsPuml.mjs +1 -0
  73. package/__app__/src/pages/ViewEditor.mjs +1 -0
  74. package/__app__/src/pages/ViewReact.mjs +1 -0
  75. package/__app__/src/style.css +1 -1
  76. package/config/schema.json +14 -41
  77. package/dist/chunks/enableServer.mjs +1 -0
  78. package/dist/chunks/filenames.mjs +17 -0
  79. package/dist/{_chunks → chunks}/index.d.mts +2 -1
  80. package/dist/{_chunks → chunks}/index2.d.mts +639 -388
  81. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -0
  82. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -0
  83. package/dist/chunks/libs/@chevrotain/utils.mjs +1 -0
  84. package/dist/chunks/libs/@hono/mcp.mjs +70 -0
  85. package/dist/chunks/libs/@hono/node-server.mjs +1 -0
  86. package/dist/{_chunks → chunks}/libs/@logtape/logtape.d.mts +2 -0
  87. package/dist/chunks/libs/@logtape/logtape.mjs +4 -0
  88. package/dist/chunks/libs/@lume/kiwi.mjs +1 -0
  89. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +12 -0
  90. package/dist/chunks/libs/@ts-graphviz/ast.mjs +3 -0
  91. package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
  92. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -0
  93. package/dist/chunks/libs/ajv.mjs +1 -0
  94. package/dist/chunks/libs/ansi-align.mjs +2 -0
  95. package/dist/chunks/libs/ansi-regex.mjs +1 -0
  96. package/dist/chunks/libs/ansi-styles.mjs +1 -0
  97. package/dist/chunks/libs/atomically.mjs +1 -0
  98. package/dist/chunks/libs/birpc.mjs +1 -0
  99. package/dist/chunks/libs/boxen.mjs +22 -0
  100. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -0
  101. package/dist/chunks/libs/chevrotain.mjs +58 -0
  102. package/dist/chunks/libs/conf.mjs +1 -0
  103. package/dist/chunks/libs/defu.mjs +1 -0
  104. package/dist/chunks/libs/destr.mjs +1 -0
  105. package/dist/chunks/libs/eventemitter3.mjs +1 -0
  106. package/dist/chunks/libs/find-up-simple.mjs +1 -0
  107. package/dist/chunks/libs/get-port.mjs +1 -0
  108. package/dist/chunks/libs/hono.mjs +1 -0
  109. package/dist/chunks/libs/is-docker.mjs +1 -0
  110. package/dist/chunks/libs/is-error-instance.mjs +1 -0
  111. package/dist/chunks/libs/is-inside-container.mjs +1 -0
  112. package/dist/chunks/libs/is-plain-obj.mjs +1 -0
  113. package/dist/chunks/libs/isexe.mjs +1 -0
  114. package/dist/chunks/libs/json5.mjs +14 -0
  115. package/dist/chunks/libs/khroma.mjs +1 -0
  116. package/dist/chunks/libs/ky.mjs +3 -0
  117. package/dist/{_chunks → chunks}/libs/langium.d.mts +9 -9
  118. package/dist/chunks/libs/langium.mjs +32 -0
  119. package/dist/chunks/libs/merge-error-cause.mjs +2 -0
  120. package/dist/chunks/libs/p-debounce.mjs +1 -0
  121. package/dist/chunks/libs/p-limit.mjs +1 -0
  122. package/dist/chunks/libs/p-queue.mjs +1 -0
  123. package/dist/chunks/libs/p-timeout.mjs +1 -0
  124. package/dist/chunks/libs/package-manager-detector.mjs +1 -0
  125. package/dist/chunks/libs/package-up.mjs +1 -0
  126. package/dist/chunks/libs/pako.mjs +3 -0
  127. package/dist/chunks/libs/parse-ms.mjs +1 -0
  128. package/dist/chunks/libs/pathe.mjs +1 -0
  129. package/dist/chunks/libs/picomatch.mjs +1 -0
  130. package/dist/chunks/libs/pretty-ms.mjs +1 -0
  131. package/dist/chunks/libs/remeda.mjs +1 -0
  132. package/dist/chunks/libs/safe-stringify.mjs +1 -0
  133. package/dist/chunks/libs/strip-indent.mjs +1 -0
  134. package/dist/chunks/libs/tinyrainbow.mjs +1 -0
  135. package/dist/chunks/libs/ts-graphviz.mjs +1 -0
  136. package/dist/chunks/libs/ufo.mjs +1 -0
  137. package/dist/chunks/libs/unctx.mjs +1 -0
  138. package/dist/chunks/libs/unstorage.mjs +1 -0
  139. package/dist/chunks/libs/vscode-languageserver.mjs +1 -0
  140. package/dist/chunks/libs/which.mjs +1 -0
  141. package/dist/chunks/libs/word-wrap.mjs +12 -0
  142. package/dist/{_chunks → chunks}/libs/zod.d.mts +62 -25
  143. package/dist/chunks/node.mjs +93 -0
  144. package/dist/chunks/plugin.mjs +593 -0
  145. package/dist/chunks/rolldown-runtime.mjs +1 -0
  146. package/dist/chunks/sequence-view.mjs +1 -0
  147. package/dist/cli/index.mjs +188 -59
  148. package/dist/config/index.d.mts +1 -2
  149. package/dist/config/index.mjs +1 -1
  150. package/dist/index.d.mts +2 -135
  151. package/dist/index.mjs +1 -1
  152. package/dist/model/index.d.mts +3 -2
  153. package/dist/model/index.mjs +1 -1
  154. package/dist/vite-plugin/index.d.mts +90 -9
  155. package/dist/vite-plugin/index.mjs +1 -1
  156. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +1 -0
  157. package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +1 -0
  158. package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +1 -0
  159. package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +1 -0
  160. package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +1 -0
  161. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +1 -0
  162. package/dist/{_chunks/libs/@nanostores/react.d.mts → vite-plugin/internal/index.d.mts} +103 -45
  163. package/dist/vite-plugin/internal/index.mjs +1 -0
  164. package/package.json +74 -80
  165. package/react/index.d.mts +84 -78
  166. package/react/index.mjs +51954 -53701
  167. package/vite-plugin/internal/package.json +2 -2
  168. package/vite-plugin-modules.d.ts +18 -0
  169. package/__app__/react/likec4.tsx +0 -25
  170. package/__app__/src/ProjectsOverview.js +0 -16
  171. package/__app__/src/const.js +0 -19
  172. package/__app__/src/likec4.js +0 -21254
  173. package/__app__/src/main.js +0 -7
  174. package/__app__/src/routes/index.js +0 -324
  175. package/__app__/src/routes/projects.js +0 -193
  176. package/__app__/src/routes/single.js +0 -1983
  177. package/__app__/src/vendors.js +0 -52683
  178. package/__app__/src/webcomponent.js +0 -68
  179. package/dist/THIRD-PARTY-LICENSES.md +0 -1609
  180. package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +0 -30
  181. package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +0 -9
  182. package/dist/_chunks/libs/@chevrotain/types.d.mts +0 -1
  183. package/dist/_chunks/libs/@chevrotain/utils.mjs +0 -1
  184. package/dist/_chunks/libs/@hono/mcp.mjs +0 -45
  185. package/dist/_chunks/libs/@hono/node-server.mjs +0 -1
  186. package/dist/_chunks/libs/@logtape/logtape.mjs +0 -4
  187. package/dist/_chunks/libs/@lume/kiwi.mjs +0 -1
  188. package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
  189. package/dist/_chunks/libs/@nanostores/react.mjs +0 -1
  190. package/dist/_chunks/libs/ajv.mjs +0 -1
  191. package/dist/_chunks/libs/ansi-align.mjs +0 -2
  192. package/dist/_chunks/libs/ansi-regex.mjs +0 -1
  193. package/dist/_chunks/libs/ansi-styles.mjs +0 -1
  194. package/dist/_chunks/libs/atomically.mjs +0 -1
  195. package/dist/_chunks/libs/birpc.mjs +0 -1
  196. package/dist/_chunks/libs/boxen.mjs +0 -22
  197. package/dist/_chunks/libs/chevrotain-allstar.mjs +0 -2
  198. package/dist/_chunks/libs/chevrotain.mjs +0 -58
  199. package/dist/_chunks/libs/conf.mjs +0 -1
  200. package/dist/_chunks/libs/defu.mjs +0 -1
  201. package/dist/_chunks/libs/destr.mjs +0 -1
  202. package/dist/_chunks/libs/esm-env.mjs +0 -1
  203. package/dist/_chunks/libs/eventemitter3.mjs +0 -1
  204. package/dist/_chunks/libs/fast-equals.mjs +0 -1
  205. package/dist/_chunks/libs/find-up-simple.mjs +0 -1
  206. package/dist/_chunks/libs/get-port.mjs +0 -1
  207. package/dist/_chunks/libs/is-docker.mjs +0 -1
  208. package/dist/_chunks/libs/is-error-instance.mjs +0 -1
  209. package/dist/_chunks/libs/is-inside-container.mjs +0 -1
  210. package/dist/_chunks/libs/is-plain-obj.mjs +0 -1
  211. package/dist/_chunks/libs/isexe.mjs +0 -1
  212. package/dist/_chunks/libs/json5.mjs +0 -14
  213. package/dist/_chunks/libs/khroma.mjs +0 -1
  214. package/dist/_chunks/libs/ky.mjs +0 -3
  215. package/dist/_chunks/libs/langium.mjs +0 -33
  216. package/dist/_chunks/libs/merge-error-cause.mjs +0 -2
  217. package/dist/_chunks/libs/p-limit.mjs +0 -1
  218. package/dist/_chunks/libs/p-queue.mjs +0 -1
  219. package/dist/_chunks/libs/p-timeout.mjs +0 -1
  220. package/dist/_chunks/libs/package-manager-detector.mjs +0 -1
  221. package/dist/_chunks/libs/package-up.mjs +0 -1
  222. package/dist/_chunks/libs/pako.mjs +0 -1
  223. package/dist/_chunks/libs/parse-ms.mjs +0 -1
  224. package/dist/_chunks/libs/pathe.mjs +0 -1
  225. package/dist/_chunks/libs/picomatch.mjs +0 -1
  226. package/dist/_chunks/libs/pretty-ms.mjs +0 -1
  227. package/dist/_chunks/libs/remeda.mjs +0 -2
  228. package/dist/_chunks/libs/safe-stringify.mjs +0 -1
  229. package/dist/_chunks/libs/strip-indent.mjs +0 -1
  230. package/dist/_chunks/libs/tinyrainbow.mjs +0 -1
  231. package/dist/_chunks/libs/ts-graphviz.d.mts +0 -10
  232. package/dist/_chunks/libs/ts-graphviz.mjs +0 -4
  233. package/dist/_chunks/libs/ufo.mjs +0 -1
  234. package/dist/_chunks/libs/unstorage.mjs +0 -1
  235. package/dist/_chunks/libs/vscode-languageserver.mjs +0 -1
  236. package/dist/_chunks/libs/which.mjs +0 -1
  237. package/dist/_chunks/libs/word-wrap.mjs +0 -12
  238. package/dist/_chunks/node.mjs +0 -76
  239. package/dist/_chunks/rolldown-runtime.mjs +0 -1
  240. package/dist/_chunks/sequence.mjs +0 -1
  241. package/dist/_chunks/src.mjs +0 -17
  242. package/dist/_chunks/src2.mjs +0 -499
  243. package/dist/vite-plugin/internal.d.mts +0 -44
  244. package/dist/vite-plugin/internal.mjs +0 -1
@@ -0,0 +1 @@
1
+ const{abs:e,cos:n,sin:r,acos:i,atan2:a,sqrt:o,pow:s}=Math;function c(e){return e<0?-s(-e,1/3):s(e,1/3)}const l=Math.PI,u=2*l,d=l/2,f=2**53-1||9007199254740991,p=-(2**53-1)||-9007199254740991,m={x:0,y:0,z:0},h={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){let r=n(e),i=r.x*r.x+r.y*r.y;return r.z!==void 0&&(i+=r.z*r.z),o(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];let i=n.length-1;if(e===1)return n[i].t=1,n[i];let a=1-e,o=n;if(i===0)return n[0].t=e,n[0];if(i===1){let n={x:a*o[0].x+e*o[1].x,y:a*o[0].y+e*o[1].y,t:e};return r&&(n.z=a*o[0].z+e*o[1].z),n}if(i<4){let n=a*a,s=e*e,c,l,u,d=0;i===2?(o=[o[0],o[1],o[2],m],c=n,l=a*e*2,u=s):i===3&&(c=n*a,l=n*e*3,u=a*s*3,d=e*s);let f={x:c*o[0].x+l*o[1].x+u*o[2].x+d*o[3].x,y:c*o[0].y+l*o[1].y+u*o[2].y+d*o[3].y,t:e};return r&&(f.z=c*o[0].z+l*o[1].z+u*o[2].z+d*o[3].z),f}let s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let n=0;n<s.length-1;n++)s[n]={x:s[n].x+(s[n+1].x-s[n].x)*e,y:s[n].y+(s[n+1].y-s[n].y)*e},s[n].z!==void 0&&(s[n].z=s[n].z+(s[n+1].z-s[n].z)*e);s.splice(s.length-1,1)}return s[0].t=e,s[0]},computeWithRatios:function(e,n,r,i){let a=1-e,o=r,s=n,c=o[0],l=o[1],u=o[2],d=o[3],f;if(c*=a,l*=e,s.length===2)return f=c+l,{x:(c*s[0].x+l*s[1].x)/f,y:(c*s[0].y+l*s[1].y)/f,z:i?(c*s[0].z+l*s[1].z)/f:!1,t:e};if(c*=a,l*=2*a,u*=e*e,s.length===3)return f=c+l+u,{x:(c*s[0].x+l*s[1].x+u*s[2].x)/f,y:(c*s[0].y+l*s[1].y+u*s[2].y)/f,z:i?(c*s[0].z+l*s[1].z+u*s[2].z)/f:!1,t:e};if(c*=a,l*=1.5*a,u*=3*a,d*=e*e*e,s.length===4)return f=c+l+u+d,{x:(c*s[0].x+l*s[1].x+u*s[2].x+d*s[3].x)/f,y:(c*s[0].y+l*s[1].y+u*s[2].y+d*s[3].y)/f,z:i?(c*s[0].z+l*s[1].z+u*s[2].z+d*s[3].z)/f:!1,t:e}},derive:function(e,n){let r=[];for(let i=e,a=i.length,o=a-1;a>1;a--,o--){let e=[];for(let r=0,a;r<o;r++)a={x:o*(i[r+1].x-i[r].x),y:o*(i[r+1].y-i[r].y)},n&&(a.z=o*(i[r+1].z-i[r].z)),e.push(a);r.push(e),i=e}return r},between:function(e,n,r){return n<=e&&e<=r||h.approximately(e,n)||h.approximately(e,r)},approximately:function(n,r,i){return e(n-r)<=(i||1e-6)},length:function(e){let n=.5,r=h.Tvalues.length,i=0;for(let a=0,o;a<r;a++)o=n*h.Tvalues[a]+n,i+=h.Cvalues[a]*h.arcfn(o,e);return n*i},map:function(e,n,r,i,a){let o=r-n;return i+(a-i)*((e-n)/o)},lerp:function(e,n,r){let i={x:n.x+e*(r.x-n.x),y:n.y+e*(r.y-n.y)};return n.z!==void 0&&r.z!==void 0&&(i.z=n.z+e*(r.z-n.z)),i},pointToString:function(e){let n=e.x+`/`+e.y;return e.z!==void 0&&(n+=`/`+e.z),n},pointsToString:function(e){return`[`+e.map(h.pointToString).join(`, `)+`]`},copy:function(e){return JSON.parse(JSON.stringify(e))},angle:function(e,n,r){let i=n.x-e.x,o=n.y-e.y,s=r.x-e.x,c=r.y-e.y;return a(i*c-o*s,i*s+o*c)},round:function(e,n){let r=``+e,i=r.indexOf(`.`);return parseFloat(r.substring(0,i+1+n))},dist:function(e,n){let r=e.x-n.x,i=e.y-n.y;return o(r*r+i*i)},closest:function(e,n){let r=s(2,63),i,a;return e.forEach(function(e,o){a=h.dist(n,e),a<r&&(r=a,i=o)}),{mdist:r,mpos:i}},abcratio:function(n,r){if(r!==2&&r!==3)return!1;if(n===void 0)n=.5;else if(n===0||n===1)return n;let i=s(n,r)+s(1-n,r);return e((i-1)/i)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(e===void 0)e=.5;else if(e===0||e===1)return e;let r=s(1-e,n);return r/(s(e,n)+r)},lli8:function(e,n,r,i,a,o,s,c){let l=(e*i-n*r)*(a-s)-(e-r)*(a*c-o*s),u=(e*i-n*r)*(o-c)-(n-i)*(a*c-o*s),d=(e-r)*(o-c)-(n-i)*(a-s);return d==0?!1:{x:l/d,y:u/d}},lli4:function(e,n,r,i){let a=e.x,o=e.y,s=n.x,c=n.y,l=r.x,u=r.y,d=i.x,f=i.y;return h.lli8(a,o,s,c,l,u,d,f)},lli:function(e,n){return h.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new T(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=f,r=f,i=p,a=p;return e.forEach(function(e){let o=e.bbox();n>o.x.min&&(n=o.x.min),r>o.y.min&&(r=o.y.min),i<o.x.max&&(i=o.x.max),a<o.y.max&&(a=o.y.max)}),{x:{min:n,mid:(n+i)/2,max:i,size:i-n},y:{min:r,mid:(r+a)/2,max:a,size:a-r}}},shapeintersections:function(e,n,r,i,a){if(!h.bboxoverlap(n,i))return[];let o=[],s=[e.startcap,e.forward,e.back,e.endcap],c=[r.startcap,r.forward,r.back,r.endcap];return s.forEach(function(n){n.virtual||c.forEach(function(i){if(i.virtual)return;let s=n.intersects(i,a);s.length>0&&(s.c1=n,s.c2=i,s.s1=e,s.s2=r,o.push(s))})}),o},makeshape:function(e,n,r){let i=n.points.length,a=e.points.length,o=h.makeline(n.points[i-1],e.points[0]),s=h.makeline(e.points[a-1],n.points[0]),c={startcap:o,forward:e,back:n,endcap:s,bbox:h.findbbox([o,e,n,s])};return c.intersections=function(e){return h.shapeintersections(c,c.bbox,e,e.bbox,r)},c},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=f,a=p,o,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let c=0,l=r.length;c<l;c++)o=r[c],s=e.get(o),s[n]<i&&(i=s[n]),s[n]>a&&(a=s[n]);return{min:i,mid:(i+a)/2,max:a,size:a-i}},align:function(e,i){let o=i.p1.x,s=i.p1.y,c=-a(i.p2.y-s,i.p2.x-o);return e.map(function(e){return{x:(e.x-o)*n(c)-(e.y-s)*r(c),y:(e.x-o)*r(c)+(e.y-s)*n(c)}})},roots:function(e,r){r||={p1:{x:0,y:0},p2:{x:1,y:0}};let a=e.length-1,s=h.align(e,r),l=function(e){return 0<=e&&e<=1};if(a===2){let e=s[0].y,n=s[1].y,r=s[2].y,i=e-2*n+r;if(i!==0){let a=-o(n*n-e*r),s=-e+n;return[-(a+s)/i,-(-a+s)/i].filter(l)}else if(n!==r&&i===0)return[(2*n-r)/(2*n-2*r)].filter(l);return[]}let d=s[0].y,f=s[1].y,p=s[2].y,m=s[3].y,g=-d+3*f-3*p+m,_=3*d-6*f+3*p,v=-3*d+3*f,y=d;if(h.approximately(g,0)){if(h.approximately(_,0))return h.approximately(v,0)?[]:[-y/v].filter(l);let e=o(v*v-4*_*y),n=2*_;return[(e-v)/n,(-v-e)/n].filter(l)}_/=g,v/=g,y/=g;let b=(3*v-_*_)/3,x=b/3,S=(2*_*_*_-9*_*v+27*y)/27,C=S/2,w=C*C+x*x*x,T,E,D,O,k;if(w<0){let e=-b/3,r=o(e*e*e),a=-S/(2*r),s=i(a<-1?-1:a>1?1:a),d=2*c(r);return D=d*n(s/3)-_/3,O=d*n((s+u)/3)-_/3,k=d*n((s+2*u)/3)-_/3,[D,O,k].filter(l)}else if(w===0)return T=C<0?c(-C):-c(C),D=2*T-_/3,O=-T-_/3,[D,O].filter(l);else{let e=o(w);return T=c(-C+e),E=c(C+e),[T-E-_/3].filter(l)}},droots:function(e){if(e.length===3){let n=e[0],r=e[1],i=e[2],a=n-2*r+i;if(a!==0){let e=-o(r*r-n*i),s=-n+r;return[-(e+s)/a,-(-e+s)/a]}else if(r!==i&&a===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){let n=e[0],r=e[1];return n===r?[]:[n/(n-r)]}return[]},curvature:function(n,r,i,a,c){let l,u,d,f,p=0,m=0,g=h.compute(n,r),_=h.compute(n,i),v=g.x*g.x+g.y*g.y;if(a?(l=o(s(g.y*_.z-_.y*g.z,2)+s(g.z*_.x-_.z*g.x,2)+s(g.x*_.y-_.x*g.y,2)),u=s(v+g.z*g.z,3/2)):(l=g.x*_.y-g.y*_.x,u=s(v,3/2)),l===0||u===0)return{k:0,r:0};if(p=l/u,m=u/l,!c){let o=h.curvature(n-.001,r,i,a,!0).k,s=h.curvature(n+.001,r,i,a,!0).k;f=(s-p+(p-o))/2,d=(e(s-p)+e(p-o))/2}return{k:p,r:m,dk:f,adk:d}},inflections:function(e){if(e.length<4)return[];let n=h.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,a=n[1].x*n[2].y,o=n[3].x*n[2].y,s=18*(-3*r+2*i+3*a-o),c=18*(3*r-i-3*a),l=18*(a-r);if(h.approximately(s,0)){if(!h.approximately(c,0)){let e=-l/c;if(0<=e&&e<=1)return[e]}return[]}let u=2*s;if(h.approximately(u,0))return[];let d=c*c-4*s*l;if(d<0)return[];let f=Math.sqrt(d);return[(f-c)/u,-(c+f)/u].filter(function(e){return 0<=e&&e<=1})},bboxoverlap:function(n,r){let i=[`x`,`y`],a=i.length;for(let o=0,s,c,l,u;o<a;o++)if(s=i[o],c=n[s].mid,l=r[s].mid,u=(n[s].size+r[s].size)/2,e(c-l)>=u)return!1;return!0},expandbox:function(e,n){n.x.min<e.x.min&&(e.x.min=n.x.min),n.y.min<e.y.min&&(e.y.min=n.y.min),n.z&&n.z.min<e.z.min&&(e.z.min=n.z.min),n.x.max>e.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){let i=e.bbox(),a=n.bbox(),o=1e5,s=r||.5;if(i.x.size+i.y.size<s&&a.x.size+a.y.size<s)return[(o*(e._t1+e._t2)/2|0)/o+`/`+(o*(n._t1+n._t2)/2|0)/o];let c=e.split(.5),l=n.split(.5),u=[{left:c.left,right:l.left},{left:c.left,right:l.right},{left:c.right,right:l.right},{left:c.right,right:l.left}];u=u.filter(function(e){return h.bboxoverlap(e.left.bbox(),e.right.bbox())});let d=[];return u.length===0?d:(u.forEach(function(e){d=d.concat(h.pairiteration(e.left,e.right,s))}),d=d.filter(function(e,n){return d.indexOf(e)===n}),d)},getccenter:function(e,i,o){let s=i.x-e.x,c=i.y-e.y,l=o.x-i.x,f=o.y-i.y,p=s*n(d)-c*r(d),m=s*r(d)+c*n(d),g=l*n(d)-f*r(d),_=l*r(d)+f*n(d),v=(e.x+i.x)/2,y=(e.y+i.y)/2,b=(i.x+o.x)/2,x=(i.y+o.y)/2,S=v+p,C=y+m,w=b+g,T=x+_,E=h.lli8(v,y,S,C,b,x,w,T),D=h.dist(E,e),O=a(e.y-E.y,e.x-E.x),k=a(i.y-E.y,i.x-E.x),A=a(o.y-E.y,o.x-E.x),j;return O<A?((O>k||k>A)&&(O+=u),O>A&&(j=A,A=O,O=j)):A<k&&k<O?(j=A,A=O,O=j):A+=u,E.s=O,E.e=A,E.r=D,E},numberSort:function(e,n){return e-n}};var g=class e{constructor(e){this.curves=[],this._3d=!1,e&&(this.curves=e,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return`[`+this.curves.map(function(e){return h.pointsToString(e.points)}).join(`, `)+`]`}addCurve(e){this.curves.push(e),this._3d=this._3d||e._3d}length(){return this.curves.map(function(e){return e.length()}).reduce(function(e,n){return e+n})}curve(e){return this.curves[e]}bbox(){let e=this.curves;for(var n=e[0].bbox(),r=1;r<e.length;r++)h.expandbox(n,e[r].bbox());return n}offset(n){let r=[];return this.curves.forEach(function(e){r.push(...e.offset(n))}),new e(r)}};const{abs:_,min:v,max:y,cos:b,sin:x,acos:S,sqrt:C}=Math,w=Math.PI;var T=class e{constructor(e){let n=e&&e.forEach?e:Array.from(arguments).slice(),r=!1;if(typeof n[0]==`object`){r=n.length;let e=[];n.forEach(function(n){[`x`,`y`,`z`].forEach(function(r){n[r]!==void 0&&e.push(n[r])})}),n=e}let i=!1,a=n.length;if(r){if(r>4){if(arguments.length!==1)throw Error(`Only new Bezier(point[]) is accepted for 4th and higher order curves`);i=!0}}else if(a!==6&&a!==8&&a!==9&&a!==12&&arguments.length!==1)throw Error(`Only new Bezier(point[]) is accepted for 4th and higher order curves`);let o=this._3d=!i&&(a===9||a===12)||e&&e[0]&&e[0].z!==void 0,s=this.points=[];for(let e=0,r=o?3:2;e<a;e+=r){var c={x:n[e],y:n[e+1]};o&&(c.z=n[e+2]),s.push(c)}let l=this.order=s.length-1,u=this.dims=[`x`,`y`];o&&u.push(`z`),this.dimlen=u.length;let d=h.align(s,{p1:s[0],p2:s[l]}),f=h.dist(s[0],s[l]);this._linear=d.reduce((e,n)=>e+_(n.y),0)<f/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(n,r,i,a){return a===void 0&&(a=.5),a===0?new e(r,r,i):a===1?new e(n,r,r):new e(n,e.getABC(2,n,r,i,a).A,i)}static cubicFromPoints(n,r,i,a,o){a===void 0&&(a=.5);let s=e.getABC(3,n,r,i,a);o===void 0&&(o=h.dist(r,s.C));let c=o*(1-a)/a,l=h.dist(n,i),u=(i.x-n.x)/l,d=(i.y-n.y)/l,f=o*u,p=o*d,m=c*u,g=c*d,_={x:r.x-f,y:r.y-p},v={x:r.x+m,y:r.y+g},y=s.A,b={x:y.x+(_.x-y.x)/(1-a),y:y.y+(_.y-y.y)/(1-a)},x={x:y.x+(v.x-y.x)/a,y:y.y+(v.y-y.y)/a};return new e(n,{x:n.x+(b.x-n.x)/a,y:n.y+(b.y-n.y)/a},{x:i.x+(x.x-i.x)/(1-a),y:i.y+(x.y-i.y)/(1-a)},i)}static getUtils(){return h}getUtils(){return e.getUtils()}static get PolyBezier(){return g}valueOf(){return this.toString()}toString(){return h.pointsToString(this.points)}toSVG(){if(this._3d)return!1;let e=this.points,n=[`M`,e[0].x,e[0].y,this.order===2?`Q`:`C`];for(let r=1,i=e.length;r<i;r++)n.push(e[r].x),n.push(e[r].y);return n.join(` `)}setRatios(e){if(e.length!==this.points.length)throw Error(`incorrect number of ratio values`);this.ratios=e,this._lut=[]}verify(){let e=this.coordDigest();e!==this._print&&(this._print=e,this.update())}coordDigest(){return this.points.map(function(e,n){return``+n+e.x+e.y+(e.z?e.z:0)}).join(``)}update(){this._lut=[],this.dpoints=h.derive(this.points,this._3d),this.computedirection()}computedirection(){let e=this.points,n=h.angle(e[0],e[this.order],e[1]);this.clockwise=n>0}length(){return h.length(this.derivative.bind(this))}static getABC(e=2,n,r,i,a=.5){let o=h.projectionratio(a,e),s=1-o,c={x:o*n.x+s*i.x,y:o*n.y+s*i.y},l=h.abcratio(a,e);return{A:{x:r.x+(r.x-c.x)/l,y:r.y+(r.y-c.y)/l},B:r,C:c,S:n,E:i}}getABC(n,r){r||=this.get(n);let i=this.points[0],a=this.points[this.order];return e.getABC(this.order,i,r,a,n)}getLUT(e){if(this.verify(),e||=100,this._lut.length===e+1)return this._lut;this._lut=[],e++,this._lut=[];for(let n=0,r,i;n<e;n++)i=n/(e-1),r=this.compute(i),r.t=i,this._lut.push(r);return this._lut}on(e,n){n||=5;let r=this.getLUT(),i=[];for(let a=0,o,s=0;a<r.length;a++)o=r[a],h.dist(o,e)<n&&(i.push(o),s+=a/r.length);return i.length?t/=i.length:!1}project(e){let n=this.getLUT(),r=n.length-1,i=h.closest(n,e),a=i.mpos,o=(a-1)/r,s=(a+1)/r,c=.1/r,l=i.mdist,u=o,d=u,f;l+=1;for(let n;u<s+c;u+=c)f=this.compute(u),n=h.dist(e,f),n<l&&(l=n,d=u);return d=d<0?0:d>1?1:d,f=this.compute(d),f.t=d,f.d=l,f}get(e){return this.compute(e)}point(e){return this.points[e]}compute(e){return this.ratios?h.computeWithRatios(e,this.points,this.ratios,this._3d):h.compute(e,this.points,this._3d,this.ratios)}raise(){let n=this.points,r=[n[0]],i=n.length;for(let e=1,a,o;e<i;e++)a=n[e],o=n[e-1],r[e]={x:(i-e)/i*a.x+e/i*o.x,y:(i-e)/i*a.y+e/i*o.y};return r[i]=n[i-1],new e(r)}derivative(e){return h.compute(e,this.dpoints[0],this._3d)}dderivative(e){return h.compute(e,this.dpoints[1],this._3d)}align(){let n=this.points;return new e(h.align(n,{p1:n[0],p2:n[n.length-1]}))}curvature(e){return h.curvature(e,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return h.inflections(this.points)}normal(e){return this._3d?this.__normal3(e):this.__normal2(e)}__normal2(e){let n=this.derivative(e),r=C(n.x*n.x+n.y*n.y);return{t:e,x:-n.y/r,y:n.x/r}}__normal3(e){let n=this.derivative(e),r=this.derivative(e+.01),i=C(n.x*n.x+n.y*n.y+n.z*n.z),a=C(r.x*r.x+r.y*r.y+r.z*r.z);n.x/=i,n.y/=i,n.z/=i,r.x/=a,r.y/=a,r.z/=a;let o={x:r.y*n.z-r.z*n.y,y:r.z*n.x-r.x*n.z,z:r.x*n.y-r.y*n.x},s=C(o.x*o.x+o.y*o.y+o.z*o.z);o.x/=s,o.y/=s,o.z/=s;let c=[o.x*o.x,o.x*o.y-o.z,o.x*o.z+o.y,o.x*o.y+o.z,o.y*o.y,o.y*o.z-o.x,o.x*o.z-o.y,o.y*o.z+o.x,o.z*o.z];return{t:e,x:c[0]*n.x+c[1]*n.y+c[2]*n.z,y:c[3]*n.x+c[4]*n.y+c[5]*n.z,z:c[6]*n.x+c[7]*n.y+c[8]*n.z}}hull(e){let n=this.points,r=[],i=[],a=0;for(i[a++]=n[0],i[a++]=n[1],i[a++]=n[2],this.order===3&&(i[a++]=n[3]);n.length>1;){r=[];for(let o=0,s,c=n.length-1;o<c;o++)s=h.lerp(e,n[o],n[o+1]),i[a++]=s,r.push(s);n=r}return i}split(n,r){if(n===0&&r)return this.split(r).left;if(r===1)return this.split(n).right;let i=this.hull(n),a={left:this.order===2?new e([i[0],i[3],i[5]]):new e([i[0],i[4],i[7],i[9]]),right:this.order===2?new e([i[5],i[4],i[2]]):new e([i[9],i[8],i[6],i[3]]),span:i};return a.left._t1=h.map(0,0,1,this._t1,this._t2),a.left._t2=h.map(n,0,1,this._t1,this._t2),a.right._t1=h.map(n,0,1,this._t1,this._t2),a.right._t2=h.map(1,0,1,this._t1,this._t2),r?(r=h.map(r,n,1,0,1),a.right.split(r).left):a}extrema(){let e={},n=[];return this.dims.forEach(function(r){let i=function(e){return e[r]},a=this.dpoints[0].map(i);e[r]=h.droots(a),this.order===3&&(a=this.dpoints[1].map(i),e[r]=e[r].concat(h.droots(a))),e[r]=e[r].filter(function(e){return e>=0&&e<=1}),n=n.concat(e[r].sort(h.numberSort))}.bind(this)),e.values=n.sort(h.numberSort).filter(function(e,r){return n.indexOf(e)===r}),e}bbox(){let e=this.extrema(),n={};return this.dims.forEach(function(r){n[r]=h.getminmax(this,r,e[r])}.bind(this)),n}overlaps(e){let n=this.bbox(),r=e.bbox();return h.bboxoverlap(n,r)}offset(n,r){if(r!==void 0){let e=this.get(n),i=this.normal(n),a={c:e,n:i,x:e.x+i.x*r,y:e.y+i.y*r};return this._3d&&(a.z=e.z+i.z*r),a}if(this._linear){let r=this.normal(0);return[new e(this.points.map(function(e){let i={x:e.x+n*r.x,y:e.y+n*r.y};return e.z&&r.z&&(i.z=e.z+n*r.z),i}))]}return this.reduce().map(function(e){return e._linear?e.offset(n)[0]:e.scale(n)})}simple(){if(this.order===3){let e=h.angle(this.points[0],this.points[3],this.points[1]),n=h.angle(this.points[0],this.points[3],this.points[2]);if(e>0&&n<0||e<0&&n>0)return!1}let e=this.normal(0),n=this.normal(1),r=e.x*n.x+e.y*n.y;return this._3d&&(r+=e.z*n.z),_(S(r))<w/3}reduce(){let e,n=0,r=0,i=.01,a,o=[],s=[],c=this.extrema().values;for(c.indexOf(0)===-1&&(c=[0].concat(c)),c.indexOf(1)===-1&&c.push(1),n=c[0],e=1;e<c.length;e++)r=c[e],a=this.split(n,r),a._t1=n,a._t2=r,o.push(a),n=r;return o.forEach(function(e){for(n=0,r=0;r<=1;)for(r=n+i;r<=1.01;r+=i)if(a=e.split(n,r),!a.simple()){if(r-=i,_(n-r)<i)return[];a=e.split(n,r),a._t1=h.map(n,0,1,e._t1,e._t2),a._t2=h.map(r,0,1,e._t1,e._t2),s.push(a),n=r;break}n<1&&(a=e.split(n,1),a._t1=h.map(n,0,1,e._t1,e._t2),a._t2=e._t2,s.push(a))}),s}translate(n,r,i){i=typeof i==`number`?i:r;let a=this.order,o=this.points.map((e,n)=>(1-n/a)*r+n/a*i);return new e(this.points.map((e,r)=>({x:e.x+n.x*o[r],y:e.y+n.y*o[r]})))}scale(n){let r=this.order,i=!1;if(typeof n==`function`&&(i=n),i&&r===2)return this.raise().scale(i);let a=this.clockwise,o=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);let s=i?i(0):n,c=i?i(1):n,l=[this.offset(0,10),this.offset(1,10)],u=[],d=h.lli4(l[0],l[0].c,l[1],l[1].c);if(!d)throw Error(`cannot scale this curve. Try reducing it first.`);return[0,1].forEach(function(e){let n=u[e*r]=h.copy(o[e*r]);n.x+=(e?c:s)*l[e].n.x,n.y+=(e?c:s)*l[e].n.y}),i?([0,1].forEach(function(e){if(!(r===2&&e)){var s=o[e+1],c={x:s.x-d.x,y:s.y-d.y},l=i?i((e+1)/r):n;i&&!a&&(l=-l);var f=C(c.x*c.x+c.y*c.y);c.x/=f,c.y/=f,u[e+1]={x:s.x+l*c.x,y:s.y+l*c.y}}}),new e(u)):([0,1].forEach(e=>{if(r===2&&e)return;let n=u[e*r],i=this.derivative(e),a={x:n.x+i.x,y:n.y+i.y};u[e+1]=h.lli4(n,a,d,o[e+1])}),new e(u))}outline(n,r,i,a){if(r=r===void 0?n:r,this._linear){let o=this.normal(0),s=this.points[0],c=this.points[this.points.length-1],l,u,d;i===void 0&&(i=n,a=r),l={x:s.x+o.x*n,y:s.y+o.y*n},d={x:c.x+o.x*i,y:c.y+o.y*i},u={x:(l.x+d.x)/2,y:(l.y+d.y)/2};let f=[l,u,d];l={x:s.x-o.x*r,y:s.y-o.y*r},d={x:c.x-o.x*a,y:c.y-o.y*a},u={x:(l.x+d.x)/2,y:(l.y+d.y)/2};let p=[d,u,l],m=h.makeline(p[2],f[0]),_=h.makeline(f[2],p[0]);return new g([m,new e(f),_,new e(p)])}let o=this.reduce(),s=o.length,c=[],l=[],u,d=0,f=this.length(),p=i!==void 0&&a!==void 0;function m(e,n,r,i,a){return function(o){let s=i/r,c=(i+a)/r,l=n-e;return h.map(o,0,1,e+s*l,e+c*l)}}o.forEach(function(e){let o=e.length();p?(c.push(e.scale(m(n,i,f,d,o))),l.push(e.scale(m(-r,-a,f,d,o)))):(c.push(e.scale(n)),l.push(e.scale(-r))),d+=o}),l=l.map(function(e){return u=e.points,u[3]?e.points=[u[3],u[2],u[1],u[0]]:e.points=[u[2],u[1],u[0]],e}).reverse();let _=c[0].points[0],v=c[s-1].points[c[s-1].points.length-1],y=l[s-1].points[l[s-1].points.length-1],b=l[0].points[0],x=h.makeline(y,_),S=h.makeline(v,b);return new g([x].concat(c,[S],l))}outlineshapes(e,n,r){n||=e;let i=this.outline(e,n).curves,a=[];for(let e=1,n=i.length;e<n/2;e++){let o=h.makeshape(i[e],i[n-e],r);o.startcap.virtual=e>1,o.endcap.virtual=e<n/2-1,a.push(o)}return a}intersects(n,r){return n?n.p1&&n.p2?this.lineIntersects(n):(n instanceof e&&(n=n.reduce()),this.curveintersects(this.reduce(),n,r)):this.selfintersects(r)}lineIntersects(e){let n=v(e.p1.x,e.p2.x),r=v(e.p1.y,e.p2.y),i=y(e.p1.x,e.p2.x),a=y(e.p1.y,e.p2.y);return h.roots(this.points,e).filter(e=>{var o=this.get(e);return h.between(o.x,n,i)&&h.between(o.y,r,a)})}selfintersects(e){let n=this.reduce(),r=n.length-2,i=[];for(let a=0,o,s,c;a<r;a++)s=n.slice(a,a+1),c=n.slice(a+2),o=this.curveintersects(s,c,e),i.push(...o);return i}curveintersects(e,n,r){let i=[];e.forEach(function(e){n.forEach(function(n){e.overlaps(n)&&i.push({left:e,right:n})})});let a=[];return i.forEach(function(e){let n=h.pairiteration(e.left,e.right,r);n.length>0&&(a=a.concat(n))}),a}arcs(e){return e||=.5,this._iterate(e,[])}_error(e,n,r,i){let a=(i-r)/4,o=this.get(r+a),s=this.get(i-a),c=h.dist(e,n),l=h.dist(e,o),u=h.dist(e,s);return _(l-c)+_(u-c)}_iterate(e,n){let r=0,i=1,a;do{a=0,i=1;let o=this.get(r),s,c,l,u,d=!1,f=!1,p,m=i,g=1,_=0;do if(f=d,u=l,m=(r+i)/2,_++,s=this.get(m),c=this.get(i),l=h.getccenter(o,s,c),l.interval={start:r,end:i},d=this._error(l,o,r,i)<=e,p=f&&!d,p||(g=i),d){if(i>=1){if(l.interval.end=g=1,u=l,i>1){let e={x:l.x+l.r*b(l.e),y:l.y+l.r*x(l.e)};l.e+=h.angle({x:l.x,y:l.y},e,this.get(1))}break}i+=(i-r)/2}else i=m;while(!p&&a++<100);if(a>=100)break;u||=l,n.push(u),r=g}while(i<1);return n}};export{T as t};
@@ -0,0 +1 @@
1
+ function e(e){return Object.prototype.toString.call(e).slice(8,-1)}function t(t){return e(t)===`Array`}function n(t){if(e(t)!==`Object`)return!1;let n=Object.getPrototypeOf(t);return!!n&&n.constructor===Object&&n===Object.prototype}function r(e,t,n,r,i){let a={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;a===`enumerable`&&(e[t]=n),i&&a===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function i(e,a={}){if(t(e))return e.map(e=>i(e,a));if(!n(e))return e;let o=Object.getOwnPropertyNames(e),s=Object.getOwnPropertySymbols(e);return[...o,...s].reduce((n,o)=>{if(o===`__proto__`||t(a.props)&&!a.props.includes(o))return n;let s=e[o];return r(n,o,i(s,a),e,a.nonenumerable),n},{})}export{i as t};
@@ -0,0 +1 @@
1
+ const e=Math.PI,t=2*e,n=1e-6,r=t-n;function i(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function a(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return i;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var o=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?i:a(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,r,i,a,o){if(t=+t,r=+r,i=+i,a=+a,o=+o,o<0)throw Error(`negative radius: ${o}`);let s=this._x1,c=this._y1,l=i-t,u=a-r,d=s-t,f=c-r,p=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(p>n)if(!(Math.abs(f*l-u*d)>n)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let m=i-s,h=a-c,g=l*l+u*u,_=m*m+h*h,v=Math.sqrt(g),y=Math.sqrt(p),b=o*Math.tan((e-Math.acos((g+p-_)/(2*v*y)))/2),x=b/y,S=b/v;Math.abs(x-1)>n&&this._append`L${t+x*d},${r+x*f}`,this._append`A${o},${o},0,0,${+(f*m>d*h)},${this._x1=t+S*l},${this._y1=r+S*u}`}}arc(i,a,o,s,c,l){if(i=+i,a=+a,o=+o,l=!!l,o<0)throw Error(`negative radius: ${o}`);let u=o*Math.cos(s),d=o*Math.sin(s),f=i+u,p=a+d,m=1^l,h=l?s-c:c-s;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>n||Math.abs(this._y1-p)>n)&&this._append`L${f},${p}`,o&&(h<0&&(h=h%t+t),h>r?this._append`A${o},${o},0,1,${m},${i-u},${a-d}A${o},${o},0,1,${m},${this._x1=f},${this._y1=p}`:h>n&&this._append`A${o},${o},0,${+(h>=e)},${m},${this._x1=i+o*Math.cos(c)},${this._y1=a+o*Math.sin(c)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function s(){return new o}s.prototype=o.prototype;export{o as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./d3-path.mjs";function t(e){return function(){return e}}const n=Math.PI;n/2,2*n;function r(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);n=t}return t},()=>new e(n)}Array.prototype.slice;function i(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function a(e){this._context=e}a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function o(e){return new a(e)}function s(e){return e[0]}function c(e){return e[1]}function l(e,n){var a=t(!0),l=null,u=o,d=null,f=r(p);e=typeof e==`function`?e:e===void 0?s:t(e),n=typeof n==`function`?n:n===void 0?c:t(n);function p(t){var r,o=(t=i(t)).length,s,c=!1,p;for(l??(d=u(p=f())),r=0;r<=o;++r)!(r<o&&a(s=t[r],r,t))===c&&((c=!c)?d.lineStart():d.lineEnd()),c&&d.point(+e(s,r,t),+n(s,r,t));if(p)return d=null,p+``||null}return p.x=function(n){return arguments.length?(e=typeof n==`function`?n:t(+n),p):e},p.y=function(e){return arguments.length?(n=typeof e==`function`?e:t(+e),p):n},p.defined=function(e){return arguments.length?(a=typeof e==`function`?e:t(!!e),p):a},p.curve=function(e){return arguments.length?(u=e,l!=null&&(d=u(l)),p):u},p.context=function(e){return arguments.length?(e==null?l=d=null:d=u(l=e),p):l},p}function u(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function d(e,t){this._context=e,this._k=(1-t)/6}d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:u(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:u(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new d(e,t)}return n.tension=function(t){return e(+t)},n})(0);function f(e,t){this._context=e,this._k=(1-t)/6}f.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:u(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return new f(e,t)}return n.tension=function(t){return e(+t)},n})(0);function p(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function m(e,t){this._context=e,this._alpha=t}m.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:p(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function e(t){function n(e){return t?new m(e,t):new d(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function h(e,t){this._context=e,this._alpha=t}h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:p(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var g=(function e(t){function n(e){return t?new h(e,t):new f(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);export{l as n,g as t};
@@ -0,0 +1 @@
1
+ const{getOwnPropertyNames:e,getOwnPropertySymbols:t}=Object,{hasOwnProperty:n}=Object.prototype;function r(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function i(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function a(n){return e(n).concat(t(n))}const o=Object.hasOwn||((e,t)=>n.call(e,t)),{getOwnPropertyDescriptor:s,keys:c}=Object,l=Object.is||function(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t};function u(e,t){return e===t}function d(e,t){return e.byteLength===t.byteLength&&S(new Uint8Array(e),new Uint8Array(t))}function f(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function p(e,t){return e.byteLength===t.byteLength&&S(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function m(e,t){return l(e.getTime(),t.getTime())}function h(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function g(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}function _(e,t,n){let r=c(e),i=r.length;if(c(t).length!==i)return!1;for(;i-- >0;)if(!w(e,t,n,r[i]))return!1;return!0}function v(e,t,n){let r=a(e),i=r.length;if(a(t).length!==i)return!1;let o,c,l;for(;i-- >0;)if(o=r[i],!w(e,t,n,o)||(c=s(e,o),l=s(t,o),(c||l)&&(!c||!l||c.configurable!==l.configurable||c.enumerable!==l.enumerable||c.writable!==l.writable)))return!1;return!0}function y(e,t){return l(e.valueOf(),t.valueOf())}function b(e,t){return e.source===t.source&&e.flags===t.flags}function x(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function S(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function C(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function w(e,t,n,r){return(r===`_owner`||r===`__o`||r===`__v`)&&(e.$$typeof||t.$$typeof)?!0:o(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const T=Object.prototype.toString;function E(e){let t=A(e),{areArraysEqual:n,areDatesEqual:r,areFunctionsEqual:i,areMapsEqual:a,areNumbersEqual:o,areObjectsEqual:s,areRegExpsEqual:c,areSetsEqual:l,getUnsupportedCustomComparator:u}=e;return function(e,d,f){if(e===d)return!0;if(e==null||d==null)return!1;let p=typeof e;if(p!==typeof d)return!1;if(p!==`object`)return p===`number`||p===`bigint`?o(e,d,f):p===`function`?i(e,d,f):!1;let m=e.constructor;if(m!==d.constructor)return!1;if(m===Object)return s(e,d,f);if(m===Array)return n(e,d,f);if(m===Date)return r(e,d,f);if(m===RegExp)return c(e,d,f);if(m===Map)return a(e,d,f);if(m===Set)return l(e,d,f);if(m===Promise)return!1;if(Array.isArray(e))return n(e,d,f);let h=T.call(e),g=t[h];if(g)return g(e,d,f);let _=u&&u(e,d,f,h);return _?_(e,d,f):!1}}function D({circular:e,createCustomConfig:t,strict:n}){let a={areArrayBuffersEqual:d,areArraysEqual:n?v:f,areDataViewsEqual:p,areDatesEqual:m,areErrorsEqual:h,areFunctionsEqual:u,areMapsEqual:n?r(g,v):g,areNumbersEqual:l,areObjectsEqual:n?v:_,arePrimitiveWrappersEqual:y,areRegExpsEqual:b,areSetsEqual:n?r(x,v):x,areTypedArraysEqual:n?r(S,v):S,areUrlsEqual:C,getUnsupportedCustomComparator:void 0};if(t&&(a=Object.assign({},a,t(a))),e){let e=i(a.areArraysEqual),t=i(a.areMapsEqual),n=i(a.areObjectsEqual),r=i(a.areSetsEqual);a=Object.assign({},a,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:r})}return a}function O(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function k({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}function A({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p}){return{"[object Arguments]":c,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":a,"[object BigInt]":s,"[object BigInt64Array]":f,"[object BigUint64Array]":f,"[object Boolean]":l,"[object DataView]":n,"[object Date]":r,"[object Error]":i,"[object Float16Array]":f,"[object Float32Array]":f,"[object Float64Array]":f,"[object Function]":a,"[object GeneratorFunction]":a,"[object Int8Array]":f,"[object Int16Array]":f,"[object Int32Array]":f,"[object Map]":o,"[object Number]":l,"[object Object]":(e,t,n)=>typeof e.then!=`function`&&typeof t.then!=`function`&&c(e,t,n),"[object RegExp]":u,"[object Set]":d,"[object String]":l,"[object URL]":p,"[object Uint8Array]":f,"[object Uint8ClampedArray]":f,"[object Uint16Array]":f,"[object Uint32Array]":f}}const j=N();N({strict:!0}),N({circular:!0}),N({circular:!0,strict:!0});const M=N({createInternalComparator:()=>l});N({strict:!0,createInternalComparator:()=>l}),N({circular:!0,createInternalComparator:()=>l}),N({circular:!0,createInternalComparator:()=>l,strict:!0});function N(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=E(D(e));return k({circular:t,comparator:a,createState:r,equals:n?n(a):O(a),strict:i})}export{M as n,j as t};
@@ -0,0 +1,9 @@
1
+ import{r as e}from"../rolldown-runtime.mjs";import*as t from"react";import{Children as n,Component as r,Fragment as i,createContext as a,createElement as o,forwardRef as s,isValidElement as c,useCallback as l,useContext as u,useEffect as d,useId as f,useInsertionEffect as p,useLayoutEffect as m,useMemo as h,useRef as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";const x=a({});function S(e){let t=g(null);return t.current===null&&(t.current=e()),t.current}const C=typeof window<`u`?m:d,w=a(null);function T(e,t){e.indexOf(t)===-1&&e.push(t)}function E(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const D=(e,t,n)=>n>t?t:n<e?e:n,O={},k=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ee(e){return typeof e==`object`&&!!e}const te=e=>/^0[^.\s]+$/u.test(e);function ne(e){let t;return()=>(t===void 0&&(t=e()),t)}const A=e=>e,re=(e,t)=>n=>t(e(n)),ie=(...e)=>e.reduce(re),ae=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r};var oe=class{constructor(){this.subscriptions=[]}add(e){return T(this.subscriptions,e),()=>E(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const j=e=>e*1e3,M=e=>e/1e3;function se(e,t){return t?1e3/t*e:0}const ce=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},le=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ue(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=le(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}function de(e,t,n,r){if(e===t&&n===r)return A;let i=t=>ue(t,0,1,e,n);return e=>e===0||e===1?e:le(i(e),t,r)}const fe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pe=e=>t=>1-e(1-t),me=de(.33,1.53,.69,.99),he=pe(me),ge=fe(he),_e=e=>e>=1?1:(e*=2)<1?.5*he(e):.5*(2-2**(-10*(e-1))),ve=e=>1-Math.sin(Math.acos(e)),ye=pe(ve),be=fe(ve),xe=de(.42,0,1,1),Se=de(0,0,.58,1),Ce=de(.42,0,.58,1),we=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Te(e,t){return we(e)?e[ce(0,e.length,t)]:e}const Ee=e=>Array.isArray(e)&&typeof e[0]==`number`,De={linear:A,easeIn:xe,easeInOut:Ce,easeOut:Se,circIn:ve,circInOut:be,circOut:ye,backIn:he,backInOut:ge,backOut:me,anticipate:_e},Oe=e=>typeof e==`string`,ke=e=>{if(Ee(e)){e.length;let[t,n,r,i]=e;return de(t,n,r,i)}else if(Oe(e))return De[e],`${e}`,De[e];return e},Ae=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],N={value:null,addProjectionMetrics:null};function je(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&N.value&&N.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}function Me(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ae.reduce((e,n)=>(e[n]=je(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=O.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ae.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ae.length;t++)o[Ae[t]].cancel(e)},state:i,steps:o}}const{schedule:P,cancel:F,state:I,steps:Ne}=Me(typeof requestAnimationFrame<`u`?requestAnimationFrame:A,!0);let Pe;function Fe(){Pe=void 0}const L={now:()=>(Pe===void 0&&L.set(I.isProcessing||O.useManualTiming?I.timestamp:performance.now()),Pe),set:e=>{Pe=e,queueMicrotask(Fe)}},Ie={layout:0,mainThread:0,waapi:0},Le=e=>t=>typeof t==`string`&&t.startsWith(e),Re=Le(`--`),ze=Le(`var(--`),Be=e=>ze(e)?Ve.test(e.split(`/*`)[0].trim()):!1,Ve=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function He(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}const Ue={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},We={...Ue,transform:e=>D(0,1,e)},Ge={...Ue,default:1},Ke=e=>Math.round(e*1e5)/1e5,qe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Je(e){return e==null}const Ye=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xe=(e,t)=>n=>!!(typeof n==`string`&&Ye.test(n)&&n.startsWith(e)||t&&!Je(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ze=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(qe);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Qe=e=>D(0,255,e),$e={...Ue,transform:e=>Math.round(Qe(e))},et={test:Xe(`rgb`,`red`),parse:Ze(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+$e.transform(e)+`, `+$e.transform(t)+`, `+$e.transform(n)+`, `+Ke(We.transform(r))+`)`};function tt(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const nt={test:Xe(`#`),parse:tt,transform:et.transform},rt=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),R=rt(`deg`),z=rt(`%`),B=rt(`px`),it=rt(`vh`),at=rt(`vw`),ot={...z,parse:e=>z.parse(e)/100,transform:e=>z.transform(e*100)},st={test:Xe(`hsl`,`hue`),parse:Ze(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+z.transform(Ke(t))+`, `+z.transform(Ke(n))+`, `+Ke(We.transform(r))+`)`},V={test:e=>et.test(e)||nt.test(e)||st.test(e),parse:e=>et.test(e)?et.parse(e):st.test(e)?st.parse(e):nt.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?et.transform(e):st.transform(e),getAnimatableNone:e=>{let t=V.parse(e);return t.alpha=0,V.transform(t)}},ct=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function lt(e){return isNaN(e)&&typeof e==`string`&&(e.match(qe)?.length||0)+(e.match(ct)?.length||0)>0}const ut=`number`,dt=`color`,ft=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pt(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(ft,e=>(V.test(e)?(r.color.push(a),i.push(dt),n.push(V.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(ut),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function mt(e){return pt(e).values}function ht({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===ut?i+=Ke(r[a]):e===dt?i+=V.transform(r[a]):i+=r[a]}return i}}function gt(e){return ht(pt(e))}const _t=e=>typeof e==`number`?0:V.test(e)?V.getAnimatableNone(e):e,vt=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:_t(e);function yt(e){let t=pt(e);return ht(t)(t.values.map((e,n)=>vt(e,t.split[n])))}const H={test:lt,parse:mt,createTransformer:gt,getAnimatableNone:yt};function bt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function xt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=bt(s,r,e+1/3),a=bt(s,r,e),o=bt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function St(e,t){return n=>n>0?t:e}const U=(e,t,n)=>e+(t-e)*n,Ct=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},wt=[nt,et,st],Tt=e=>wt.find(t=>t.test(e));function Et(e){let t=Tt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===st&&(n=xt(n)),n}const Dt=(e,t)=>{let n=Et(e),r=Et(t);if(!n||!r)return St(e,t);let i={...n};return e=>(i.red=Ct(n.red,r.red,e),i.green=Ct(n.green,r.green,e),i.blue=Ct(n.blue,r.blue,e),i.alpha=U(n.alpha,r.alpha,e),et.transform(i))},Ot=new Set([`none`,`hidden`]);function kt(e,t){return Ot.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function At(e,t){return n=>U(e,t,n)}function jt(e){return typeof e==`number`?At:typeof e==`string`?Be(e)?St:V.test(e)?Dt:Ft:Array.isArray(e)?Mt:typeof e==`object`?V.test(e)?Dt:Nt:St}function Mt(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>jt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Nt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=jt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Pt(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}const Ft=(e,t)=>{let n=H.createTransformer(t),r=pt(e),i=pt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ot.has(e)&&!i.values.length||Ot.has(t)&&!r.values.length?kt(e,t):ie(Mt(Pt(r,i),i.values),n):(`${e}${t}`,St(e,t))};function It(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?U(e,t,n):jt(e)(e,t)}const Lt=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>P.update(t,e),stop:()=>F(t),now:()=>I.isProcessing?I.timestamp:L.now()}},Rt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},zt=2e4;function Bt(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Vt(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Bt(r),zt);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:M(i)}}const W={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ht(e,t){return e*Math.sqrt(1-t*t)}function Ut(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const Wt=.001;function Gt({duration:e=W.duration,bounce:t=W.bounce,velocity:n=W.velocity,mass:r=W.mass}){let i,a;W.maxDuration;let o=1-t;o=D(W.minDamping,W.maxDamping,o),e=D(W.minDuration,W.maxDuration,M(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Ht(t,o),c=Math.exp(-i);return Wt-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Ht(t**2,o);return(-i(t)+Wt>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Ut(i,a,s);if(e=j(e),isNaN(c))return{stiffness:W.stiffness,damping:W.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const Kt=[`duration`,`bounce`],qt=[`stiffness`,`damping`,`mass`];function Jt(e,t){return t.some(t=>e[t]!==void 0)}function Yt(e){let t={velocity:W.velocity,stiffness:W.stiffness,damping:W.damping,mass:W.mass,isResolvedFromDuration:!1,...e};if(!Jt(e,qt)&&Jt(e,Kt))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*D(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:W.mass,stiffness:i,damping:a}}else{let n=Gt({...e,velocity:0});t={...t,...n,mass:W.mass},t.isResolvedFromDuration=!0}return t}function Xt(e=W.visualDuration,t=W.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Yt({...n,velocity:-M(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=M(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?W.restSpeed.granular:W.restSpeed.default,i||=v?W.restDelta.granular:W.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Ht(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>j(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=j(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=j(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Bt(T),zt),t=Rt(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Xt.applyToOptions=e=>{let t=Vt(e,100,Xt);return e.ease=t.ease,e.duration=j(t.duration),e.type=`keyframes`,e};function Zt(e,t,n){let r=Math.max(t-5,0);return se(n-e(r),t-r)}function Qt({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Xt({keyframes:[f.value,m(f.value)],velocity:Zt(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function $t(e,t,n){let r=[],i=n||O.mix||It,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=ie(Array.isArray(t)?t[n]||A:t,a)),r.push(a)}return r}function en(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=$t(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ae(e[r],e[r+1],n);return s[r](i)};return n?t=>l(D(e[0],e[a-1],t)):l}function tn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ae(0,t,r);e.push(U(n,1,i))}}function nn(e){let t=[0];return tn(t,e.length-1),t}function rn(e,t){return e.map(e=>e*t)}function an(e,t){return e.map(()=>t||Ce).splice(0,e.length-1)}function on({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=we(r)?r.map(ke):ke(r),a={done:!1,value:t[0]},o=en(rn(n&&n.length===t.length?n:nn(t),e),t,{ease:Array.isArray(i)?i:an(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}const sn=e=>e!==null;function cn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(sn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const ln={decay:Qt,inertia:Qt,tween:on,keyframes:on,spring:Xt};function un(e){typeof e.type==`string`&&(e.type=ln[e.type])}var dn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const fn=e=>e/100;var pn=class extends dn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==L.now()&&this.tick(L.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Ie.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;un(e);let{type:t=on,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||on;s!==on&&typeof o[0]!=`number`&&(this.mixKeyframes=ie(fn,It(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Bt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=D(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Qt&&(b.value=cn(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return M(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+M(e)}get time(){return M(this.currentTime)}set time(e){e=j(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Zt(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(L.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=M(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Lt,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(L.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&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,Ie.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function mn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const hn=e=>e*180/Math.PI,gn=e=>vn(hn(Math.atan2(e[1],e[0]))),_n={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gn,rotateZ:gn,skewX:e=>hn(Math.atan(e[1])),skewY:e=>hn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vn=e=>(e%=360,e<0&&(e+=360),e),yn=gn,bn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Sn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bn,scaleY:xn,scale:e=>(bn(e)+xn(e))/2,rotateX:e=>vn(hn(Math.atan2(e[6],e[5]))),rotateY:e=>vn(hn(Math.atan2(-e[2],e[0]))),rotateZ:yn,rotate:yn,skewX:e=>hn(Math.atan(e[4])),skewY:e=>hn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Cn(e){return+!!e.includes(`scale`)}function wn(e,t){if(!e||e===`none`)return Cn(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Sn,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_n,i=t}if(!i)return Cn(t);let a=r[t],o=i[1].split(`,`).map(En);return typeof a==`function`?a(o):o[a]}const Tn=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wn(n,t)};function En(e){return parseFloat(e.trim())}const Dn=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],On=new Set(Dn),kn=e=>e===Ue||e===B,An=new Set([`x`,`y`,`z`]),jn=Dn.filter(e=>!An.has(e));function Mn(e){let t=[];return jn.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const G={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wn(t,`x`),y:(e,{transform:t})=>wn(t,`y`)};G.translateX=G.x,G.translateY=G.y;const Nn=new Set;let Pn=!1,Fn=!1,In=!1;function Ln(){if(Fn){let e=Array.from(Nn).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Mn(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Fn=!1,Pn=!1,Nn.forEach(e=>e.complete(In)),Nn.clear()}function Rn(){Nn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Fn=!0)})}function zn(){In=!0,Rn(),Ln(),In=!1}var Bn=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Nn.add(this),Pn||(Pn=!0,P.read(Rn),P.resolveKeyframes(Ln))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}mn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Nn.delete(this)}cancel(){this.state===`scheduled`&&(Nn.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Vn=e=>e.startsWith(`--`);function Hn(e,t,n){Vn(t)?e.style.setProperty(t,n):e.style[t]=n}const Un={};function Wn(e,t){let n=ne(e);return()=>Un[t]??n()}const Gn=Wn(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Kn=Wn(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),qn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Jn={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:qn([0,.65,.55,1]),circOut:qn([.55,0,1,.45]),backIn:qn([.31,.01,.66,-.59]),backOut:qn([.33,1.53,.69,.99])};function Yn(e,t){if(e)return typeof e==`function`?Kn()?Rt(e,t):`ease-out`:Ee(e)?qn(e):Array.isArray(e)?e.map(e=>Yn(e,t)||Jn.easeOut):Jn[e]}function Xn(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Yn(s,i);Array.isArray(d)&&(u.easing=d),N.value&&Ie.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return N.value&&p.finished.finally(()=>{Ie.waapi--}),p}function Zn(e){return typeof e==`function`&&`applyToOptions`in e}function Qn({type:e,...t}){return Zn(e)&&Kn()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var $n=class extends dn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Qn(e);this.animation=Xn(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=cn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Hn(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return M(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+M(e)}get time(){return M(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=j(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Gn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),A):r(this)}};const er={anticipate:_e,backInOut:ge,circInOut:be};function tr(e){return e in er}function nr(e){typeof e.ease==`string`&&tr(e.ease)&&(e.ease=er[e.ease])}var rr=class extends $n{constructor(e){nr(e),un(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new pn({...a,autoplay:!1}),s=Math.max(10,L.now()-this.startTime),c=D(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Hn(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const ir=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(H.test(e)||e===`0`)&&!e.startsWith(`url(`));function ar(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function or(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ir(i,t),s=ir(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:ar(e)||(n===`spring`||Zn(n))&&r}function sr(e){e.duration=0,e.type=`keyframes`}const cr=new Set([`opacity`,`clipPath`,`filter`,`transform`]),lr=ne(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function ur(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return lr()&&n&&cr.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var dr=class extends dn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=L.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Bn;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=L.now();let u=!0;or(e,i,a,o)||(u=!1,(O.instantAnimations||!s)&&l?.(cn(e,n,t)),e[0]=e[e.length-1],sr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&ur(d),p=d.motionValue?.owner?.current,m=f?new rr({...d,element:p}):new pn(d);m.finished.then(()=>{this.notifyFinished()}).catch(A),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),zn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},fr=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return pr(this.animations,`duration`)}get iterationDuration(){return pr(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function pr(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var mr=class extends fr{then(e,t){return this.finished.finally(e).then(()=>{})}};function hr(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const gr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _r(e){let t=gr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function vr(e,t,n=1){`${e}`;let[r,i]=_r(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return k(e)?parseFloat(e):e}return Be(i)?vr(i,t,n+1):i}const yr={type:`spring`,stiffness:500,damping:25,restSpeed:10},br=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xr={type:`keyframes`,duration:.8},Sr={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Cr=(e,{keyframes:t})=>t.length>2?xr:On.has(e)?e.startsWith(`scale`)?br(t[1]):yr:Sr,wr=e=>e!==null;function Tr(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(wr),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}function Er(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Dr(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Er(n,e)}function Or({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const kr=(e,t,n,r={},i,a)=>o=>{let s=Dr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=j(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Or(s)||Object.assign(u,Cr(e,u)),u.duration&&=j(u.duration),u.repeatDelay&&=j(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(sr(u),u.delay===0&&(d=!0)),(O.instantAnimations||O.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,sr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Tr(u.keyframes,s);if(e!==void 0){P.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new pn(u):new dr(u)};function Ar(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function jr(e,t,n,r){if(typeof t==`function`){let[i,a]=Ar(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Ar(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Mr(e,t,n){let r=e.getProps();return jr(r,t,n===void 0?r.custom:n,e)}const Nr=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Dn]),Pr=e=>!isNaN(parseFloat(e)),Fr={current:void 0};var Ir=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=L.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=L.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Pr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new oe);let n=this.events[e].add(t);return e===`change`?()=>{n(),P.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Fr.current&&Fr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=L.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return se(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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 K(e,t){return new Ir(e,t)}const Lr=e=>Array.isArray(e);function Rr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,K(n))}function zr(e){return Lr(e)?e[e.length-1]||0:e}function Br(e,t){let{transitionEnd:n={},transition:r={},...i}=Mr(e,t)||{};i={...i,...n};for(let t in i)Rr(e,t,zr(i[t]))}const q=e=>!!(e&&e.getVelocity);function Vr(e){return!!(q(e)&&e.add)}function Hr(e,t){let n=e.getValue(`willChange`);if(Vr(n))return n.add(t);if(!n&&O.WillChange){let n=new O.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Ur(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Wr=`data-`+Ur(`framerAppearId`);function Gr(e){return e.props[Wr]}function Kr({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function qr(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Er(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Kr(d,t))continue;let o={delay:n,...Dr(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===c&&!o.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){let n=Gr(e);if(n){let e=window.MotionHandoffAnimation(n,t,P);e!==null&&(o.startTime=e,f=!0)}}Hr(e,t);let p=l??e.shouldReduceMotion;r.start(kr(t,r,i,p&&Nr.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>P.update(()=>{o&&Br(e,o)});u.length?Promise.all(u).then(t):t()}return u}function Jr(e,t,n={}){let r=Mr(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(qr(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Yr(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Yr(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Jr(c,t,{...o,delay:n+(typeof r==`function`?0:r)+hr(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Xr(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Jr(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Jr(e,t,n);else{let i=typeof t==`function`?Mr(e,t,n.custom):t;r=Promise.all(qr(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const Zr={test:e=>e===`auto`,parse:e=>e},Qr=e=>t=>t.test(e),$r=[Ue,B,z,R,at,it,Zr],ei=e=>$r.find(Qr(e));function ti(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||te(e)}const ni=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ri(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(qe)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ni.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const ii=/\b([a-z-]*)\(.*?\)/gu,ai={...H,getAnimatableNone:e=>{let t=e.match(ii);return t?t.map(ri).join(` `):e}},oi={...H,getAnimatableNone:e=>{let t=H.parse(e);return H.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},si={...Ue,transform:Math.round},ci={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,rotate:R,rotateX:R,rotateY:R,rotateZ:R,scale:Ge,scaleX:Ge,scaleY:Ge,scaleZ:Ge,skew:R,skewX:R,skewY:R,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:We,originX:ot,originY:ot,originZ:B,zIndex:si,fillOpacity:We,strokeOpacity:We,numOctaves:si},li={...ci,color:V,backgroundColor:V,outlineColor:V,fill:V,stroke:V,borderColor:V,borderTopColor:V,borderRightColor:V,borderBottomColor:V,borderLeftColor:V,filter:ai,WebkitFilter:ai,mask:oi,WebkitMask:oi},ui=e=>li[e],di=new Set([ai,oi]);function fi(e,t){let n=ui(e);return di.has(n)||(n=H),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const pi=new Set([`auto`,`none`,`0`]);function mi(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!pi.has(t)&&pt(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=fi(n,i)}var hi=class extends Bn{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Be(r))){let i=vr(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Nr.has(n)||e.length!==2)return;let[r,i]=e,a=ei(r),o=ei(i);if(He(r)!==He(i)&&G[n]){this.needsMeasurement=!0;return}if(a!==o)if(kn(a)&&kn(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else G[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||ti(e[t]))&&n.push(t);n.length&&mi(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=G[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=G[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const gi=new Set([`opacity`,`clipPath`,`filter`,`transform`]);function _i(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const vi=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function yi(e){return ee(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:bi,cancel:xi}=Me(queueMicrotask,!1),J={x:!1,y:!1};function Si(){return J.x||J.y}function Ci(e){return e===`x`||e===`y`?J[e]?null:(J[e]=!0,()=>{J[e]=!1}):J.x||J.y?null:(J.x=J.y=!0,()=>{J.x=J.y=!1})}function wi(e,t){let n=_i(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ti(e){return!(e.pointerType===`touch`||Si())}function Ei(e,t,n={}){let[r,i,a]=wi(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Ti(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const Di=(e,t)=>t?e===t?!0:Di(e,t.parentElement):!1,Oi=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,ki=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ai(e){return ki.has(e.tagName)||e.isContentEditable===!0}const ji=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Mi(e){return ji.has(e.tagName)||e.isContentEditable===!0}const Ni=new WeakSet;function Pi(e){return t=>{t.key===`Enter`&&e(t)}}function Fi(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Ii=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Pi(()=>{if(Ni.has(n))return;Fi(n,`down`);let e=Pi(()=>{Fi(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Fi(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Li(e){return Oi(e)&&!Si()}const Ri=new WeakSet;function zi(e,t,n={}){let[r,i,a]=wi(e,n),o=e=>{let r=e.currentTarget;if(!Li(e)||Ri.has(e))return;Ni.add(r),n.stopPropagation&&Ri.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),Ni.has(r)&&Ni.delete(r),Li(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Di(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),yi(e)&&(e.addEventListener(`focus`,e=>Ii(e,i)),!Ai(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Bi(e){return ee(e)&&`ownerSVGElement`in e}const Vi=new WeakMap;let Hi;const Ui=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Bi(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Wi=Ui(`inline`,`width`,`offsetWidth`),Gi=Ui(`block`,`height`,`offsetHeight`);function Ki({target:e,borderBoxSize:t}){Vi.get(e)?.forEach(n=>{n(e,{get width(){return Wi(e,t)},get height(){return Gi(e,t)}})})}function qi(e){e.forEach(Ki)}function Ji(){typeof ResizeObserver>`u`||(Hi=new ResizeObserver(qi))}function Yi(e,t){Hi||Ji();let n=_i(e);return n.forEach(e=>{let n=Vi.get(e);n||(n=new Set,Vi.set(e,n)),n.add(t),Hi?.observe(e)}),()=>{n.forEach(e=>{let n=Vi.get(e);n?.delete(t),n?.size||Hi?.unobserve(e)})}}const Xi=new Set;let Zi;function Qi(){Zi=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xi.forEach(t=>t(e))},window.addEventListener(`resize`,Zi)}function $i(e){return Xi.add(e),Zi||Qi(),()=>{Xi.delete(e),!Xi.size&&typeof Zi==`function`&&(window.removeEventListener(`resize`,Zi),Zi=void 0)}}function ea(e,t){return typeof e==`function`?$i(e):Yi(e,t)}function ta(e){return Bi(e)&&e.tagName===`svg`}const na=[...$r,V,H],ra=e=>na.find(Qr(e)),ia=()=>({translate:0,scale:1,origin:0,originPoint:0}),aa=()=>({x:ia(),y:ia()}),oa=()=>({min:0,max:0}),Y=()=>({x:oa(),y:oa()}),sa=new WeakMap;function ca(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function la(e){return typeof e==`string`||Array.isArray(e)}const ua=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],da=[`initial`,...ua];function fa(e){return ca(e.animate)||da.some(t=>la(e[t]))}function pa(e){return!!(fa(e)||e.variants)}function ma(e,t,n){for(let r in t){let i=t[r],a=n[r];if(q(i))e.addValue(r,i);else if(q(a))e.addValue(r,K(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,K(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const ha={current:null},ga={current:!1},_a=typeof window<`u`;function va(){if(ga.current=!0,_a)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>ha.current=e.matches;e.addEventListener(`change`,t),t()}else ha.current=!1}const ya=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let ba={};function xa(e){ba=e}function Sa(){return ba}var Ca=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){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=Bn,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 e=L.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,P.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=fa(t),this.isVariantNode=pa(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&q(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,sa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(ga.current||va(),this.shouldReduceMotion=ha.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),F(this.notifyUpdate),F(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&gi.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new $n({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:j(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=On.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&P.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ba){let t=ba[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Y()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ya.length;t++){let n=ya[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=ma(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=K(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(k(n)||te(n))?n=parseFloat(n):!ra(n)&&H.test(t)&&(n=fi(e,t)),this.setBaseTarget(e,q(n)?n.get():n)),q(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=jr(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!q(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new oe),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){bi.render(this.render)}},wa=class extends Ca{constructor(){super(...arguments),this.KeyframeResolver=hi}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;q(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},X=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Ta({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ea({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Da(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Oa(e){return e===void 0||e===1}function ka({scale:e,scaleX:t,scaleY:n}){return!Oa(e)||!Oa(t)||!Oa(n)}function Aa(e){return ka(e)||ja(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ja(e){return Ma(e.x)||Ma(e.y)}function Ma(e){return e&&e!==`0%`}function Na(e,t,n){return n+t*(e-n)}function Pa(e,t,n,r,i){return i!==void 0&&(e=Na(e,i,r)),Na(e,n,r)+t}function Fa(e,t=0,n=1,r,i){e.min=Pa(e.min,t,n,r,i),e.max=Pa(e.max,t,n,r,i)}function Ia(e,{x:t,y:n}){Fa(e.x,t.translate,t.scale,t.originPoint),Fa(e.y,n.translate,n.scale,n.originPoint)}const La=.999999999999,Ra=1.0000000000001;function za(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ua(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ia(e,o)),r&&Aa(a.latestValues)&&Ua(e,a.latestValues,a.layout?.layoutBox))}t.x<Ra&&t.x>La&&(t.x=1),t.y<Ra&&t.y>La&&(t.y=1)}function Ba(e,t){e.min+=t,e.max+=t}function Va(e,t,n,r,i=.5){Fa(e,t,n,U(e.min,e.max,i),r)}function Ha(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Ua(e,t,n){let r=n??e;Va(e.x,Ha(t.x,r.x),t.scaleX,t.scale,t.originX),Va(e.y,Ha(t.y,r.y),t.scaleY,t.scale,t.originY)}function Wa(e,t){return Ta(Da(e.getBoundingClientRect(),t))}function Ga(e,t,n){let r=Wa(e,n),{scroll:i}=t;return i&&(Ba(r.x,i.offset.x),Ba(r.y,i.offset.y)),r}const Ka={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},qa=Dn.length;function Ja(e,t,n){let r=``,i=!0;for(let a=0;a<qa;a++){let o=Dn[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=vi(s,ci[o]);if(!c){i=!1;let t=Ka[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ya(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(On.has(e)){o=!0;continue}else if(Re(e)){i[e]=n;continue}else{let t=vi(n,ci[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ja(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Xa(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Za(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Qa={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(B.test(e))e=parseFloat(e);else return e;return`${Za(e,t.target.x)}% ${Za(e,t.target.y)}%`}},$a={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=H.parse(e);if(i.length>5)return r;let a=H.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=U(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},eo={borderRadius:{...Qa,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Qa,borderTopRightRadius:Qa,borderBottomLeftRadius:Qa,borderBottomRightRadius:Qa,boxShadow:$a};function to(e,{layout:t,layoutId:n}){return On.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!eo[e]||e===`opacity`)}function no(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(q(r[t])||i&&q(i[t])||to(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function ro(e){return window.getComputedStyle(e)}var io=class extends wa{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Xa}readValueFromInstance(e,t){if(On.has(t))return this.projection?.isProjecting?Cn(t):Tn(e,t);{let n=ro(e),r=(Re(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Wa(e,t)}build(e,t,n){Ya(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return no(e,t,n)}};function ao(e,t){return e in t}var oo=class extends Ca{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(ao(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Y()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}};const so={offset:`stroke-dashoffset`,array:`stroke-dasharray`},co={offset:`strokeDashoffset`,array:`strokeDasharray`};function lo(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?so:co;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const uo=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function fo(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ya(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of uo)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&lo(d,i,a,o,!1)}const po=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`]),mo=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ho(e,t,n,r){Xa(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(po.has(n)?n:Ur(n),t.attrs[n])}function go(e,t,n){let r=no(e,t,n);for(let n in e)if(q(e[n])||q(t[n])){let t=Dn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var _o=class extends wa{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(On.has(t)){let e=ui(t);return e&&e.default||0}return t=po.has(t)?t:Ur(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return go(e,t,n)}build(e,t,n){fo(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ho(e,t,n,r)}mount(e){this.isSVGTag=mo(e.tagName),super.mount(e)}};const vo=da.length;function yo(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&yo(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<vo;n++){let r=da[n],i=e.props[r];(la(i)||i===!1)&&(t[r]=i)}return t}function bo(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const xo=[...ua].reverse(),So=ua.length;function Co(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Xr(e,t,n)))}function wo(e){let t=Co(e),n=Do(),r=!0,i=!1,a=t=>(n,r)=>{let i=Mr(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=yo(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<So;t++){let p=xo[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=la(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||ca(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=To(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Lr(t)&&Lr(n)?!bo(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Mr(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=hr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Mr(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Do(),i=!0}}}function To(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!bo(t,e):!1}function Eo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Do(){return{animate:Eo(!0),whileInView:Eo(),whileHover:Eo(),whileTap:Eo(),whileDrag:Eo(),whileFocus:Eo(),exit:Eo()}}function Oo(e,t){e.min=t.min,e.max=t.max}function Z(e,t){Oo(e.x,t.x),Oo(e.y,t.y)}function ko(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Q(e){return e.max-e.min}function Ao(e,t,n){return Math.abs(e-t)<=n}function jo(e,t,n,r=.5){e.origin=r,e.originPoint=U(t.min,t.max,e.origin),e.scale=Q(n)/Q(t),e.translate=U(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Mo(e,t,n,r){jo(e.x,t.x,n.x,r?r.originX:void 0),jo(e.y,t.y,n.y,r?r.originY:void 0)}function No(e,t,n){e.min=n.min+t.min,e.max=e.min+Q(t)}function Po(e,t,n){No(e.x,t.x,n.x),No(e.y,t.y,n.y)}function Fo(e,t,n){e.min=t.min-n.min,e.max=e.min+Q(t)}function Io(e,t,n){Fo(e.x,t.x,n.x),Fo(e.y,t.y,n.y)}function Lo(e,t,n,r,i){return e-=t,e=Na(e,1/n,r),i!==void 0&&(e=Na(e,1/i,r)),e}function Ro(e,t=0,n=1,r=.5,i,a=e,o=e){if(z.test(t)&&(t=parseFloat(t),t=U(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=U(a.min,a.max,r);e===a&&(s-=t),e.min=Lo(e.min,t,n,s,i),e.max=Lo(e.max,t,n,s,i)}function zo(e,t,[n,r,i],a,o){Ro(e,t[n],t[r],t[i],t.scale,a,o)}const Bo=[`x`,`scaleX`,`originX`],Vo=[`y`,`scaleY`,`originY`];function Ho(e,t,n,r){zo(e.x,t,Bo,n?n.x:void 0,r?r.x:void 0),zo(e.y,t,Vo,n?n.y:void 0,r?r.y:void 0)}function Uo(e){return e.translate===0&&e.scale===1}function Wo(e){return Uo(e.x)&&Uo(e.y)}function Go(e,t){return e.min===t.min&&e.max===t.max}function Ko(e,t){return Go(e.x,t.x)&&Go(e.y,t.y)}function qo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Jo(e,t){return qo(e.x,t.x)&&qo(e.y,t.y)}function Yo(e){return Q(e.x)/Q(e.y)}function Xo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $(e){return[e(`x`),e(`y`)]}function Zo(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const Qo=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],$o=Qo.length,es=e=>typeof e==`string`?parseFloat(e):e,ts=e=>typeof e==`number`||B.test(e);function ns(e,t,n,r,i,a){i?(e.opacity=U(0,n.opacity??1,is(r)),e.opacityExit=U(t.opacity??1,0,as(r))):a&&(e.opacity=U(t.opacity??1,n.opacity??1,r));for(let i=0;i<$o;i++){let a=`border${Qo[i]}Radius`,o=rs(t,a),s=rs(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||ts(o)===ts(s)?(e[a]=Math.max(U(es(o),es(s),r),0),(z.test(s)||z.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=U(t.rotate||0,n.rotate||0,r))}function rs(e,t){return e[t]===void 0?e.borderRadius:e[t]}const is=os(0,.5,ye),as=os(.5,.95,A);function os(e,t,n){return r=>r<e?0:r>t?1:n(ae(e,t,r))}function ss(e,t,n){let r=q(e)?e:K(e);return r.start(kr(``,r,t,n)),r.animation}function cs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const ls=(e,t)=>e.depth-t.depth;var us=class{constructor(){this.children=[],this.isDirty=!1}add(e){T(this.children,e),this.isDirty=!0}remove(e){E(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ls),this.isDirty=!1,this.children.forEach(e)}};function ds(e,t){let n=L.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(F(r),e(a-t))};return P.setup(r,!0),()=>F(r)}function fs(e){return q(e)?e.get():e}var ps=class{constructor(){this.members=[]}add(e){T(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(E(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(E(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const ms={hasAnimatedSinceResize:!0,hasEverUpdated:!1},hs={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},gs=[``,`X`,`Y`,`Z`];let _s=0;function vs(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ys(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Gr(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,P,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ys(r)}function bs({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=_s++,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,N.value&&(hs.nodes=hs.calculatedTargetDeltas=hs.calculatedProjections=0),this.nodes.forEach(Cs),this.nodes.forEach(As),this.nodes.forEach(js),this.nodes.forEach(ws),N.addProjectionMetrics&&N.addProjectionMetrics(hs)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new us)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new oe),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Bi(t)&&!ta(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;P.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ds(i,250),ms.hasAnimatedSinceResize&&(ms.hasAnimatedSinceResize=!1,this.nodes.forEach(ks)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Rs,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Jo(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Dr(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||ks(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),F(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(Ms),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ys(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Es);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ds);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Os),this.nodes.forEach(xs),this.nodes.forEach(Ss)):this.nodes.forEach(Ds),this.clearAllSnapshots();let e=L.now();I.delta=D(0,1e3/60,e-I.timestamp),I.timestamp=e,I.isProcessing=!0,Ne.update.process(I),Ne.preRender.process(I),Ne.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ts),this.sharedNodes.forEach(Ns)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,P.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){P.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Q(this.snapshot.measuredBox.x)&&!Q(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Y(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Wo(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Aa(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Hs(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Y();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Ws))){let{scroll:e}=this.root;e&&(Ba(t.x,e.offset.x),Ba(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Y();if(Z(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Z(t,e),Ba(t.x,i.offset.x),Ba(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=Y();Z(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ua(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),Aa(r.latestValues)&&Ua(n,r.latestValues,r.layout?.layoutBox)}return Aa(this.latestValues)&&Ua(n,this.latestValues,this.layout?.layoutBox),n}removeTransform(e){let t=Y();Z(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Aa(n.latestValues))continue;let r;n.instance&&(ka(n.latestValues)&&n.updateSnapshot(),r=Y(),Z(r,n.measurePageBox())),Ho(t,n.latestValues,n.snapshot?.layoutBox,r)}return Aa(this.latestValues)&&Ho(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==I.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=I.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Po(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Z(this.target,this.layout.layoutBox),Ia(this.target,this.targetDelta)):Z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),N.value&&hs.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||ka(this.parent.latestValues)||ja(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),Io(this.relativeTargetOrigin,t,n),Z(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===I.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Z(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;za(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Y());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ko(this.prevProjectionDelta.x,this.projectionDelta.x),ko(this.prevProjectionDelta.y,this.projectionDelta.y)),Mo(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Xo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Xo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),N.value&&hs.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=aa(),this.projectionDelta=aa(),this.projectionDeltaWithTransform=aa()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=aa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=Y(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Ls));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;Ps(a.x,e.x,n),Ps(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Io(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Is(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Ko(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=Y(),Z(d,this.relativeTarget)),s&&(this.animationValues=i,ns(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(F(this.pendingAnimation),void 0),this.pendingAnimation=P.update(()=>{ms.hasAnimatedSinceResize=!0,Ie.layout++,this.motionValue||=K(0),this.motionValue.jump(0,!1),this.currentAnimation=ss(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Ie.layout--},onComplete:()=>{Ie.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Us(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Y();let t=Q(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Q(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Z(t,n),Ua(t,i),Mo(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ps),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&vs(`z`,e,r,this.animationValues);for(let t=0;t<gs.length;t++)vs(`rotate${gs[t]}`,e,r,this.animationValues),vs(`skew${gs[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=fs(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=fs(t?.pointerEvents)||``),this.hasProjected&&!Aa(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Zo(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in eo){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=eo[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?fs(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Es),this.root.sharedNodes.clear()}}}function xs(e){e.updateLayout()}function Ss(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)$(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Q(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Oo(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Us(i,t.layoutBox,n)&&$(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Q(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=aa();Mo(o,n,t.layoutBox);let s=aa();a?Mo(s,e.applyTransform(r,!0),t.measuredBox):Mo(s,n,t.layoutBox);let c=!Wo(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=Y();Io(o,t.layoutBox,i.layoutBox);let s=Y();Io(s,n,a.layoutBox),Jo(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Cs(e){N.value&&hs.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function ws(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ts(e){e.clearSnapshot()}function Es(e){e.clearMeasurements()}function Ds(e){e.isLayoutDirty=!1}function Os(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ks(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function As(e){e.resolveTargetDelta()}function js(e){e.calcProjection()}function Ms(e){e.resetSkewAndRotation()}function Ns(e){e.removeLeadSnapshot()}function Ps(e,t,n){e.translate=U(t.translate,0,n),e.scale=U(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Fs(e,t,n,r){e.min=U(t.min,n.min,r),e.max=U(t.max,n.max,r)}function Is(e,t,n,r){Fs(e.x,t.x,n.x,r),Fs(e.y,t.y,n.y,r)}function Ls(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Rs={duration:.45,ease:[.4,0,.1,1]},zs=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bs=zs(`applewebkit/`)&&!zs(`chrome/`)?Math.round:A;function Vs(e){e.min=Bs(e.min),e.max=Bs(e.max)}function Hs(e){Vs(e.x),Vs(e.y)}function Us(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ao(Yo(t),Yo(n),.2)}function Ws(e){return e!==e.root&&e.scroll?.wasRoot}const Gs=bs({attachResizeListener:(e,t)=>cs(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ks=e=>!e.isLayoutDirty&&e.willUpdate(!1);function qs(){let e=new Set,t=new WeakMap,n=()=>e.forEach(Ks);return{add:r=>{e.add(r),t.set(r,r.addEventListener(`willUpdate`,n))},remove:r=>{e.delete(r);let i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}const Js={current:void 0},Ys=bs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Js.current){let e=new Gs({});e.mount(window),e.setOptions({layoutScroll:!0}),Js.current=e}return Js.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Xs=a({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Zs(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Qs(...e){return t=>{let n=!1,r=e.map(e=>{let r=Zs(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Zs(e[t],null)}}}}function $s(...e){return t.useCallback(Qs(...e),e)}var ec=class extends t.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(yi(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=yi(e)&&e.offsetWidth||0,r=yi(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function tc({children:e,isPresent:n,anchorX:r,anchorY:i,root:a,pop:o}){let s=f(),c=g(null),l=g({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=u(Xs),m=$s(c,e.props?.ref??e?.ref);return p(()=>{let{width:e,height:t,top:u,left:f,right:p,bottom:m}=l.current;if(n||o===!1||!c.current||!e||!t)return;let h=r===`left`?`left: ${f}`:`right: ${p}`,g=i===`bottom`?`bottom: ${m}`:`top: ${u}`;c.current.dataset.motionPopId=s;let _=document.createElement(`style`);d&&(_.nonce=d);let v=a??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
2
+ [data-motion-pop-id="${s}"] {
3
+ position: absolute !important;
4
+ width: ${e}px !important;
5
+ height: ${t}px !important;
6
+ ${h}px !important;
7
+ ${g}px !important;
8
+ }
9
+ `),()=>{c.current?.removeAttribute(`data-motion-pop-id`),v.contains(_)&&v.removeChild(_)}},[n]),y(ec,{isPresent:n,childRef:c,sizeRef:l,pop:o,children:o===!1?e:t.cloneElement(e,{ref:m})})}const nc=({children:e,initial:n,isPresent:r,onExitComplete:i,custom:a,presenceAffectsLayout:o,mode:s,anchorX:c,anchorY:l,root:u})=>{let d=S(rc),p=f(),m=!0,g=h(()=>(m=!1,{id:p,initial:n,isPresent:r,custom:a,onExitComplete:e=>{d.set(e,!0);for(let e of d.values())if(!e)return;i&&i()},register:e=>(d.set(e,!1),()=>d.delete(e))}),[r,d,i]);return o&&m&&(g={...g}),h(()=>{d.forEach((e,t)=>d.set(t,!1))},[r]),t.useEffect(()=>{!r&&!d.size&&i&&i()},[r]),e=y(tc,{pop:s===`popLayout`,isPresent:r,anchorX:c,anchorY:l,root:u,children:e}),y(w.Provider,{value:g,children:e})};function rc(){return new Map}function ic(e=!0){let t=u(w);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=f();d(()=>{if(e)return i(a)},[e]);let o=l(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}function ac(){return oc(u(w))}function oc(e){return e===null?!0:e.isPresent}const sc=e=>e.key||``;function cc(e){let t=[];return n.forEach(e,e=>{c(e)&&t.push(e)}),t}const lc=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[d,f]=ic(o),p=h(()=>cc(e),[e]),m=o&&!d?[]:p.map(sc),b=g(!0),w=g(p),T=S(()=>new Map),E=g(new Set),[D,O]=_(p),[k,ee]=_(p);C(()=>{b.current=!1,w.current=p;for(let e=0;e<k.length;e++){let t=sc(k[e]);m.includes(t)?(T.delete(t),E.current.delete(t)):T.get(t)!==!0&&T.set(t,!1)}},[k,m.length,m.join(`-`)]);let te=[];if(p!==D){let e=[...p];for(let t=0;t<k.length;t++){let n=k[t],r=sc(n);m.includes(r)||(e.splice(t,0,n),te.push(n))}return a===`wait`&&te.length&&(e=te),ee(cc(e)),O(p),null}let{forceRender:ne}=u(x);return y(v,{children:k.map(e=>{let u=sc(e),h=o&&!d?!1:p===k||m.includes(u);return y(nc,{isPresent:h,initial:!b.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:h?void 0:()=>{if(E.current.has(u))return;if(T.has(u))E.current.add(u),T.set(u,!0);else return;let e=!0;T.forEach(t=>{t||(e=!1)}),e&&(ne?.(),ee(w.current),o&&f?.(),r&&r())},anchorX:s,anchorY:c,children:e},u)})})},uc=a(null);function dc(){let e=g(!1);return C(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function fc(){let e=dc(),[t,n]=_(0),r=l(()=>{e.current&&n(t+1)},[t]);return[l(()=>P.postRender(r),[r]),t]}const pc=e=>e===!0,mc=e=>pc(e===!0)||e===`id`,hc=({children:e,id:t,inherit:n=!0})=>{let r=u(x),i=u(uc),[a,o]=fc(),s=g(null),c=r.id||i;s.current===null&&(mc(n)&&c&&(t=t?c+`-`+t:c),s.current={id:t,group:pc(n)&&r.group||qs()});let l=h(()=>({...s.current,forceRender:a}),[o]);return y(x.Provider,{value:l,children:e})},gc=a({strict:!1}),_c={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`]};let vc=!1;function yc(){if(vc)return;let e={};for(let t in _c)e[t]={isEnabled:e=>_c[t].some(t=>!!e[t])};xa(e),vc=!0}function bc(){return yc(),Sa()}function xc(e){let t=bc();for(let n in e)t[n]={...t[n],...e[n]};xa(t)}function Sc({children:e,features:t,strict:n=!1}){let[,r]=_(!Cc(t)),i=g(void 0);if(!Cc(t)){let{renderer:e,...n}=t;i.current=e,xc(n)}return d(()=>{Cc(t)&&t().then(({renderer:e,...t})=>{xc(t),i.current=e,r(!0)})},[]),y(gc.Provider,{value:{renderer:i.current,strict:n},children:e})}function Cc(e){return typeof e==`function`}const wc=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`.split(`.`));function Tc(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||wc.has(e)}let Ec=e=>!Tc(e);function Dc(e){typeof e==`function`&&(Ec=t=>t.startsWith(`on`)?!Tc(t):e(t))}try{Dc(e(`@emotion/is-prop-valid`).default)}catch{}function Oc(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||q(e[i])||(Ec(i)||n===!0&&Tc(i)||!t&&!Tc(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function kc({children:e,isValidProp:t,...n}){t&&Dc(t);let r=u(Xs);n={...r,...n},n.transition=Er(n.transition,r.transition),n.isStatic=S(()=>n.isStatic);let i=h(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return y(Xs.Provider,{value:i,children:e})}const Ac=a({});function jc(e,t){if(fa(e)){let{initial:t,animate:n}=e;return{initial:t===!1||la(t)?t:void 0,animate:la(n)?n:void 0}}return e.inherit===!1?{}:t}function Mc(e){let{initial:t,animate:n}=jc(e,u(Ac));return h(()=>({initial:t,animate:n}),[Nc(t),Nc(n)])}function Nc(e){return Array.isArray(e)?e.join(` `):e}const Pc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Fc(e,t,n){for(let r in t)!q(t[r])&&!to(r,n)&&(e[r]=t[r])}function Ic({transformTemplate:e},t){return h(()=>{let n=Pc();return Ya(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Lc(e,t){let n=e.style||{},r={};return Fc(r,n,e),Object.assign(r,Ic(e,t)),r}function Rc(e,t){let n={},r=Lc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const zc=()=>({...Pc(),attrs:{}});function Bc(e,t,n,r){let i=h(()=>{let n=zc();return fo(n,t,mo(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Fc(t,e.style,e),i.style={...t,...i.style}}return i}const Vc=[`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 Hc(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Vc.indexOf(e)>-1||/[A-Z]/u.test(e))}function Uc(e,t,n,{latestValues:r},a,s=!1,c){let l=(c??Hc(e)?Bc:Rc)(t,r,a,e),u=Oc(t,typeof e==`string`,s),d=e===i?{}:{...u,...l,ref:n},{children:f}=t,p=h(()=>q(f)?f.get():f,[f]);return o(e,{...d,children:p})}function Wc({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Gc(n,r,i,e),renderState:t()}}function Gc(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=fs(a[e]);let{initial:o,animate:s}=e,c=fa(e),l=pa(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!ca(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=jr(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const Kc=e=>(t,n)=>{let r=u(Ac),i=u(w),a=()=>Wc(e,t,r,i);return n?a():S(a)},qc=Kc({scrapeMotionValuesFromProps:no,createRenderState:Pc}),Jc=Kc({scrapeMotionValuesFromProps:go,createRenderState:zc}),Yc=Symbol.for(`motionComponentSymbol`);function Xc(e,t,n){let r=g(n);p(()=>{r.current=n});let i=g(null);return l(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}const Zc=a({});function Qc(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function $c(e,t,n,r,i,a){let{visualElement:o}=u(Ac),s=u(gc),c=u(w),l=u(Xs),f=l.reducedMotion,m=l.skipAnimations,h=g(null),_=g(!1);r||=s.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f,skipAnimations:m,isSVG:a}),_.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));let v=h.current,y=u(Zc);v&&!v.projection&&i&&(v.type===`html`||v.type===`svg`)&&el(h.current,n,i,y);let b=g(!1);p(()=>{v&&b.current&&v.update(n,c)});let x=n[Wr],S=g(!!x&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return C(()=>{_.current=!0,v&&(b.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),d(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),!1),v.enteringChildren=void 0)}),v}function el(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:tl(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Qc(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function tl(e){if(e)return e.options.allowProjection===!1?tl(e.parent):e.projection}function nl(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&xc(r);let a=n?n===`svg`:Hc(e),o=a?Jc:qc;function c(n,s){let c,l={...u(Xs),...n,layoutId:rl(n)},{isStatic:d}=l,f=Mc(n),p=o(n,d);if(!d&&typeof window<`u`){il(l,r);let t=al(l);c=t.MeasureLayout,f.visualElement=$c(e,p,l,i,t.ProjectionNode,a)}return b(Ac.Provider,{value:f,children:[c&&f.visualElement?y(c,{visualElement:f.visualElement,...l}):null,Uc(e,n,Xc(p,f.visualElement,s),p,d,t,a)]})}c.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let l=s(c);return l[Yc]=e,l}function rl({layoutId:e}){let t=u(x).id;return t&&e!==void 0?t+`-`+e:e}function il(e,t){u(gc).strict}function al(e){let{drag:t,layout:n}=bc();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ol(e,t){if(typeof Proxy>`u`)return nl;let n=new Map,r=(n,r)=>nl(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,nl(a,void 0,e,t)),n.get(a))})}const sl=ol(),cl=(e,t)=>t.isSVG??Hc(e)?new _o(t):new io(t,{allowProjection:e!==i});var ll=class extends X{constructor(e){super(e),e.animationState||=wo(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ca(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let ul=0;const dl={animation:{Feature:ll},exit:{Feature:class extends X{constructor(){super(...arguments),this.id=ul++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=Mr(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function fl(e){return{point:{x:e.pageX,y:e.pageY}}}const pl=e=>t=>Oi(t)&&e(t,fl(t));function ml(e,t,n,r){return cs(e,t,pl(n),r)}const hl=({current:e})=>e?e.ownerDocument.defaultView:null,gl=(e,t)=>Math.abs(e-t);function _l(e,t){let n=gl(e.x,t.x),r=gl(e.y,t.y);return Math.sqrt(n**2+r**2)}const vl=new Set([`auto`,`scroll`]);var yl=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bl(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Sl(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=_l(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=I;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=bl(t,this.transformPagePoint),P.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Sl(e.type===`pointercancel`?this.lastMoveEventInfo:bl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Oi(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=bl(fl(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=I;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Sl(s,this.history)),this.removeListeners=ie(ml(this.contextWindow,`pointermove`,this.handlePointerMove),ml(this.contextWindow,`pointerup`,this.handlePointerUp),ml(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(vl.has(e.overflowX)||vl.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),P.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),F(this.updatePoint)}};function bl(e,t){return t?{point:t(e.point)}:e}function xl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sl({point:e},t){return{point:e,delta:xl(e,wl(t)),offset:xl(e,Cl(t)),velocity:Tl(t,.1)}}function Cl(e){return e[0]}function wl(e){return e[e.length-1]}function Tl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=wl(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>j(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>j(t)*2&&(r=e[1]);let a=M(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function El(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?U(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?U(n,e,r.max):Math.min(e,n)),e}function Dl(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Ol(e,{top:t,left:n,bottom:r,right:i}){return{x:Dl(e.x,n,i),y:Dl(e.y,t,r)}}function kl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Al(e,t){return{x:kl(e.x,t.x),y:kl(e.y,t.y)}}function jl(e,t){let n=.5,r=Q(e),i=Q(t);return i>r?n=ae(t.min,t.max-r,e.min):r>i&&(n=ae(e.min,e.max-i,t.min)),D(0,1,n)}function Ml(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Nl=.35;function Pl(e=Nl){return e===!1?e=0:e===!0&&(e=Nl),{x:Fl(e,`left`,`right`),y:Fl(e,`top`,`bottom`)}}function Fl(e,t,n){return{min:Il(e,t),max:Il(e,n)}}function Il(e,t){return typeof e==`number`?e:e[t]||0}const Ll=new WeakMap;var Rl=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Y(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(fl(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ci(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$(e=>{let t=this.getAxisMotionValue(e).get()||0;if(z.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Q(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&P.update(()=>i(e,t),!1,!0),Hr(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Hl(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&P.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new yl(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:hl(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&P.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Vl(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=El(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Qc(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Ol(n.layoutBox,e):this.constraints=!1,this.elastic=Pl(t),r!==this.constraints&&!Qc(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&$(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Ml(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Qc(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Ga(n,r.root,this.visualElement.getTransformPagePoint()),a=Al(r.layout.layoutBox,i);if(t){let e=t(Ea(a));this.hasMutatedConstraints=!!e,e&&(a=Ta(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=$(o=>{if(!Vl(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Hr(this.visualElement,e),n.start(kr(e,n,0,t,this.visualElement,!1))}stopAnimation(){$(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){$(t=>{let{drag:n}=this.getProps();if(!Vl(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-U(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Qc(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};$(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=jl({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),$(t=>{if(!Vl(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(U(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ll.set(this.visualElement,this);let e=this.visualElement.current,t=ml(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Mi(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Qc(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Bl(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),P.read(r);let o=cs(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Nl,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function zl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Bl(e,t,n){let r=ea(e,zl(n)),i=ea(t,zl(n));return()=>{r(),i()}}function Vl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Hl(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Ul=class extends X{constructor(e){super(e),this.removeGroupControls=A,this.removeListeners=A,this.controls=new Rl(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||A}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const Wl=e=>(t,n)=>{e&&P.update(()=>e(t,n),!1,!0)};var Gl=class extends X{constructor(){super(...arguments),this.removePointerDownListener=A}onPointerDown(e){this.session=new yl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hl(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Wl(e),onStart:Wl(t),onMove:Wl(n),onEnd:(e,t)=>{delete this.session,r&&P.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ml(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let Kl=!1;var ql=class extends r{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Kl&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ms.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Kl=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||P.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),bi.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Kl=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Jl(e){let[t,n]=ic(),r=u(x);return y(ql,{...e,layoutGroup:r,switchLayoutGroup:u(Zc),isPresent:t,safeToRemove:n})}const Yl={pan:{Feature:Gl},drag:{Feature:Ul,ProjectionNode:Ys,MeasureLayout:Jl}};function Xl(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&P.postRender(()=>i(t,fl(t)))}var Zl=class extends X{mount(){let{current:e}=this.node;e&&(this.unmount=Ei(e,(e,t)=>(Xl(this.node,t,`Start`),e=>Xl(this.node,e,`End`))))}unmount(){}},Ql=class extends X{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=ie(cs(this.node.current,`focus`,()=>this.onFocus()),cs(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function $l(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&P.postRender(()=>i(t,fl(t)))}var eu=class extends X{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=zi(e,(e,t)=>($l(this.node,t,`Start`),(e,{success:t})=>$l(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const tu=new WeakMap,nu=new WeakMap,ru=e=>{let t=tu.get(e.target);t&&t(e)},iu=e=>{e.forEach(ru)};function au({root:e,...t}){let n=e||document;nu.has(n)||nu.set(n,{});let r=nu.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(iu,{root:e,...t})),r[i]}function ou(e,t,n){let r=au(t);return tu.set(e,n),r.observe(e),()=>{tu.delete(e),r.unobserve(e)}}const su={some:0,all:1};var cu=class extends X{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:su[r]};return ou(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(lu(e,t))&&this.startObserver()}unmount(){}};function lu({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const uu={inView:{Feature:cu},tap:{Feature:eu},focus:{Feature:Ql},hover:{Feature:Zl}},du={layout:{ProjectionNode:Ys,MeasureLayout:Jl}},fu={renderer:cl,...dl,...uu,...Yl,...du};function pu(e){let t=S(()=>K(e)),{isStatic:n}=u(Xs);if(n){let[,n]=_(e);d(()=>t.on(`change`,n),[])}return t}function mu(){!ga.current&&va();let[e]=_(ha.current);return e}function hu(){let e=mu(),{reducedMotion:t}=u(Xs);return t===`never`?!1:t===`always`?!0:e}function gu(e){return typeof e==`object`&&!Array.isArray(e)}function _u(e,t,n,r){return e==null?[]:typeof e==`string`&&gu(t)?_i(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function vu(e,t,n){return e*(t+1)}function yu(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function bu(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(E(e,i),r--)}}function xu(e,t,n,r,i,a){bu(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:U(i,a,r[o]),easing:Te(n,o)})}function Su(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function Cu(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}function wu(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,yu(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=yu(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Du(e),{delay:l=0,times:u=nn(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Zn(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Au(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=j(b));let r=Vt(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&tn(u,T),c.length===1&&c.unshift(null),m){b=vu(b,m);let e=[...c],t=[...u];y=Array.isArray(y)?[...y]:[y];let n=[...y];for(let r=0;r<m;r++){c.push(...e);for(let i=0;i<e.length;i++)u.push(t[i]+(r+1)),y.push(i===0?`linear`:Te(n,i-1))}Su(u,m)}let E=w+b;xu(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(q(p)){let e=Tu(p,s);_(m,h,Eu(`default`,e))}else{let e=_u(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Tu(r,s);for(let e in m)_(m[e],Ou(h,e),Eu(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Cu);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(ae(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(`easeInOut`)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Tu(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Eu(e,t){return t[e]||(t[e]=[]),t[e]}function Du(e){return Array.isArray(e)?e:[e]}function Ou(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const ku=e=>typeof e==`number`,Au=e=>e.every(ku);function ju(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Bi(e)&&!ta(e)?new _o(t):new io(t);n.mount(e),sa.set(e,n)}function Mu(e){let t=new oo({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),sa.set(e,t)}function Nu(e,t){return q(e)||typeof e==`number`||typeof e==`string`&&!gu(t)}function Pu(e,t,n,r){let i=[];if(Nu(e,t))i.push(ss(e,gu(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=_u(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?ju:Mu;sa.has(r)||s(r);let c=sa.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...qr(c,{...t,transition:l},{}))}}return i}function Fu(e,t,n){let r=[];return wu(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=K(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Xt}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Pu(n,e,t))}),r}function Iu(e){return Array.isArray(e)&&e.some(Array.isArray)}function Lu(e={}){let{scope:t,reduceMotion:n}=e;function r(e,r,i){let a=[],o;if(Iu(e)){let{onComplete:i,...s}=r||{};typeof i==`function`&&(o=i),a=Fu(e,n===void 0?s:{reduceMotion:n,...s},t)}else{let{onComplete:s,...c}=i||{};typeof s==`function`&&(o=s),a=Pu(e,r,n===void 0?c:{reduceMotion:n,...c},t)}let s=new mr(a);return o&&s.finished.then(o),t&&(t.animations.push(s),s.finished.then(()=>{E(t.animations,s)})),s}return r}const Ru=Lu();var zu=class{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(n=>{n.start(e.nativeEvent||e,t)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}};const Bu=()=>new zu;function Vu(){return S(Bu)}function Hu(e,t){return nl(e,t)}const Uu=Hu(`button`),Wu=Hu(`div`);export{Dn as C,P as D,F as E,ke as O,Vn as S,en as T,_i as _,hu as a,Fr as b,sl as c,Sc as d,hc as f,vi as g,yi as h,Ru as i,kc as l,ac as m,Wu as n,pu as o,lc as p,Vu as r,fu as s,Uu as t,Tc as u,ci as v,On as w,K as x,Ir as y};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"../rolldown-runtime.mjs";function t(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const n=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function r(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function i(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function a(e){let t=i(e,`border-left-width`),n=i(e,`border-right-width`);return e.clientWidth+t+n}function o(e){let t=i(e,`border-top-width`),n=i(e,`border-bottom-width`);return e.clientHeight+t+n}function s(e,t={}){return{width:t.width||a(e),height:t.height||o(e)}}function c(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const l=16384;function ee(e){(e.width>l||e.height>l)&&(e.width>l&&e.height>l?e.width>e.height?(e.height*=l/e.width,e.width=l):(e.width*=l/e.height,e.height=l):e.width>l?(e.height*=l/e.width,e.width=l):(e.width*=l/e.height,e.height=l))}function u(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:`image/png`,t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(`,`)[1]),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e+=1)a[e]=r.charCodeAt(e);n(new Blob([a],{type:t.type?t.type:`image/png`}))})}function d(e){return new Promise((t,n)=>{let r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function f(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function p(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),f(i)}const m=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||m(n,t)};function te(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function ne(e){return r(e).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function h(e,t,n){let r=`.${e}:${t}`,i=n.cssText?te(n):ne(n);return document.createTextNode(`${r}{${i}}`)}function g(e,t,r){let i=window.getComputedStyle(e,r),a=i.getPropertyValue(`content`);if(a===``||a===`none`)return;let o=n();try{t.className=`${t.className} ${o}`}catch{return}let s=document.createElement(`style`);s.appendChild(h(o,r,i)),t.appendChild(s)}function re(e,t){g(e,t,`:before`),g(e,t,`:after`)}const _=`application/font-woff`,v=`image/jpeg`,y={woff:_,woff2:_,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:v,jpeg:v,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function b(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function x(e){return y[b(e).toLowerCase()]||``}function S(e){return e.split(/,/)[1]}function C(e){return e.search(/^(data:)/)!==-1}function w(e,t){return`data:${t};base64,${e}`}async function T(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}const E={};function ie(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function D(e,t,n){let r=ie(e,t,n.includeQueryParams);if(E[r]!=null)return E[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=w(await T(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,S(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return E[r]=i,i}async function ae(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):d(t)}async function oe(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),d(t.toDataURL())}let n=e.poster;return d(await D(n,x(n),t))}async function se(e){try{if(e?.contentDocument?.body)return await F(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function ce(e,t){return m(e,HTMLCanvasElement)?ae(e):m(e,HTMLVideoElement)?oe(e,t):m(e,HTMLIFrameElement)?se(e):e.cloneNode(!1)}const O=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`;async function k(e,t,n){let i=[];return i=O(e)&&e.assignedNodes?r(e.assignedNodes()):m(e,HTMLIFrameElement)&&e.contentDocument?.body?r(e.contentDocument.body.childNodes):r((e.shadowRoot??e).childNodes),i.length===0||m(e,HTMLVideoElement)||await i.reduce((e,r)=>e.then(()=>F(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function A(e,t){let n=t.style;if(!n)return;let i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):r(i).forEach(r=>{let a=i.getPropertyValue(r);r===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),m(e,HTMLIFrameElement)&&r===`display`&&a===`inline`&&(a=`block`),r===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),n.setProperty(r,a,i.getPropertyPriority(r))})}function j(e,t){m(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),m(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function M(e,t){if(m(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function N(e,t){return m(t,Element)&&(A(e,t),re(e,t),j(e,t),M(e,t)),t}async function P(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await F(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function F(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>ce(e,t)).then(n=>k(e,n,t)).then(t=>N(e,t)).then(e=>P(e,t))}const I=/url\((['"]?)([^'"]+?)\1\)/g,L=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,R=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function z(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function B(e){let t=[];return e.replace(I,(e,n,r)=>(t.push(r),e)),t.filter(e=>!C(e))}async function V(e,n,r,i,a){try{let o=r?t(n,r):n,s=x(n),c;return c=a?w(await a(o),s):await D(o,s,i),e.replace(z(n),`$1${c}$3`)}catch{}return e}function H(e,{preferredFontFormat:t}){return t?e.replace(R,e=>{for(;;){let[n,,r]=L.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function U(e){return e.search(I)!==-1}async function W(e,t,n){if(!U(e))return e;let r=H(e,n);return B(r).reduce((e,r)=>e.then(e=>V(e,r,t,n)),Promise.resolve(r))}async function G(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await W(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function le(e,t){await G(`background`,e,t)||await G(`background-image`,e,t),await G(`mask`,e,t)||await G(`mask-image`,e,t)}async function ue(e,t){let n=m(e,HTMLImageElement);if(!(n&&!C(e.src))&&!(m(e,SVGImageElement)&&!C(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await D(r,x(r),t);await new Promise((t,r)=>{e.onload=t,e.onerror=r;let a=e;a.decode&&=t,a.loading===`lazy`&&(a.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function de(e,t){let n=r(e.childNodes).map(e=>K(e,t));await Promise.all(n).then(()=>e)}async function K(e,t){m(e,Element)&&(await le(e,t),await ue(e,t),await de(e,t))}function fe(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}const q={};async function J(e){let t=q[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},q[e]=t,t)}async function Y(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),T(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function X(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function Z(e,t){let n=[],i=[];return e.forEach(n=>{if(`cssRules`in n)try{r(n.cssRules||[]).forEach((e,r)=>{if(e.type===CSSRule.IMPORT_RULE){let a=r+1,o=e.href,s=J(o).then(e=>Y(e,t)).then(e=>X(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});i.push(s)}})}catch(r){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&i.push(J(n.href).then(e=>Y(e,t)).then(e=>X(e).forEach(e=>{a.insertRule(e,n.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,r)}}),Promise.all(i).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{r(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function pe(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>U(e.style.getPropertyValue(`src`)))}async function me(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return pe(await Z(r(e.ownerDocument.styleSheets),t))}async function he(e,t){let n=await me(e,t);return(await Promise.all(n.map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return W(e.cssText,n,t)}))).join(`
2
+ `)}async function ge(e,t){let n=t.fontEmbedCSS==null?t.skipFonts?null:await he(e,t):t.fontEmbedCSS;if(n){let t=document.createElement(`style`),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}var _e=e({toBlob:()=>ye,toCanvas:()=>$,toJpeg:()=>ve,toSvg:()=>Q});async function Q(e,t={}){let{width:n,height:r}=s(e,t),i=await F(e,t,!0);return await ge(i,t),await K(i,t),fe(i,t),await p(i,n,r)}async function $(e,t={}){let{width:n,height:r}=s(e,t),i=await d(await Q(e,t)),a=document.createElement(`canvas`),o=a.getContext(`2d`),l=t.pixelRatio||c(),u=t.canvasWidth||n,f=t.canvasHeight||r;return a.width=u*l,a.height=f*l,t.skipAutoScale||ee(a),a.style.width=`${u}`,a.style.height=`${f}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(i,0,0,a.width,a.height),a}async function ve(e,t={}){return(await $(e,t)).toDataURL(`image/jpeg`,t.quality||1)}async function ye(e,t={}){return await u(await $(e,t))}export{_e as t};
@@ -0,0 +1 @@
1
+ import{C as e,D as t,E as n,O as r,S as i,T as a,_ as o,b as s,g as c,h as l,v as u,w as d,x as f,y as p}from"./framer-motion.mjs";function m(e){return(t,n)=>{let r=o(t),i=[];for(let t of r){let r=e(t,n);i.push(r)}return()=>{for(let e of i)e()}}}var h=class{constructor(){this.latest={},this.values=new Map}set(e,r,i,a,o=!0){let s=this.values.get(e);s&&s.onRemove();let l=()=>{let n=r.get();o?this.latest[e]=c(n,u[e]):this.latest[e]=n,i&&t.render(i)};l();let d=r.on(`change`,l);a&&r.addDependent(a);let f=()=>{d(),i&&n(i),this.values.delete(e),a&&r.removeDependent(a)};return this.values.set(e,{value:r,onRemove:f}),f}get(e){return this.values.get(e)?.value}};function g(e){let t=new WeakMap;return(n,r)=>{let i=t.get(n)??new h;t.set(n,i);let a=[];for(let t in r){let o=r[t],s=e(n,i,t,o);a.push(s)}return()=>{for(let e of a)e()}}}const _={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`};function v(t){let n=``,r=!0;for(let i=0;i<e.length;i++){let a=e[i],o=t.latest[a];if(o===void 0)continue;let s=!0;if(typeof o==`number`)s=o===+!!a.startsWith(`scale`);else{let e=parseFloat(o);s=a.startsWith(`scale`)?e===1:e===0}if(!s){r=!1;let e=_[a]||a;n+=`${e}(${o}) `}}return r?`none`:n.trim()}const y=new Set([`originX`,`originY`,`originZ`]),b=(e,t,n,r)=>{let a,o;return d.has(n)?(t.get(`transform`)||(!l(e)&&!t.get(`transformBox`)&&b(e,t,`transformBox`,new p(`fill-box`)),t.set(`transform`,new p(`none`),()=>{e.style.transform=v(t)})),o=t.get(`transform`)):y.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new p(``),()=>{let n=t.latest.originX??`50%`,r=t.latest.originY??`50%`,i=t.latest.originZ??0;e.style.transformOrigin=`${n} ${r} ${i}`}),o=t.get(`transformOrigin`)):a=i(n)?()=>{e.style.setProperty(n,t.latest[n])}:()=>{e.style[n]=t.latest[n]},t.set(n,r,a,o)},x=m(g(b));function S(e,t){if(e===`first`)return 0;{let n=t-1;return e===`last`?n:n/2}}function C(e=.1,{startDelay:t=0,from:n=0,ease:i}={}){return(a,o)=>{let s=typeof n==`number`?n:S(n,o),c=e*Math.abs(s-a);if(i){let t=o*e;c=r(i)(c/t)*t}return t+c}}function w(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],o=e[2+n],s=e[3+n],c=a(i,o,s);return t?c(r):c}function T(e,r,i){let a=()=>r.set(i()),o=()=>t.preRender(a,!1,!0),s=e.map(e=>e.on(`change`,o));r.on(`destroy`,()=>{s.forEach(e=>e()),n(a)})}function E(e){let t=[];s.current=t;let n=e();s.current=void 0;let r=f(n);return T(t,r,e),r}function D(e,t,n,r){let i=w(t,n,r);return E(()=>i(e.get()))}export{C as n,x as r,D as t};
@@ -0,0 +1 @@
1
+ let e=[],t=0,n=0;const r=r=>{let i=[],a={get(){return a.lc||a.listen(()=>{})(),a.value},init:r,lc:0,listen(n){return a.lc=i.push(n),()=>{for(let r=t+4;r<e.length;)e[r]===n?e.splice(r,4):r+=4;let r=i.indexOf(n);~r&&(i.splice(r,1),--a.lc||a.off())}},notify(r,o){n++;let s=!e.length;for(let t of i)e.push(t,a.value,r,o);if(s){for(t=0;t<e.length;t+=4)e[t](e[t+1],e[t+2],e[t+3]);e.length=0}},off(){},set(e){let t=a.value;t!==e&&(a.value=e,a.notify(t))},subscribe(e){let t=a.listen(e);return e(a.value),t},value:r};return a};let i=(e,t,n,r)=>(e.events=e.events||{},e.events[n+10]||(e.events[n+10]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+10](),delete e.events[n+10])}),a=(e,t)=>i(e,n=>{let r=t(n);r&&e.events[6].push(r)},5,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[6]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[6])t();e.events[6]=[]}},1e3)},()=>{e.listen=n,e.off=r}}),o=(e,t,i)=>{Array.isArray(e)||(e=[e]);let o,s,c=()=>{if(s===n)return;s=n;let r=e.map(e=>e.get());if(!o||r.some((e,t)=>e!==o[t])){o=r;let e=t(...r);e&&e.then&&e.t?e.then(e=>{o===r&&l.set(e)}):(l.set(e),s=n)}},l=r(void 0),u=l.get;l.get=()=>(c(),u());let d,f=i?()=>{clearTimeout(d),d=setTimeout(c)}:c;return a(l,()=>{let t=e.map(e=>e.listen(f));return c(),()=>{for(let e of t)e()}}),l};const s=(e,t)=>o(e,t,!0);export{a as n,r,s as t};
@@ -0,0 +1 @@
1
+ import{Component as e,createContext as t,createElement as n}from"react";const r=t(null),i={didCatch:!1,error:null};var a=class extends e{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=i}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(i))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&o(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(i))}render(){let{children:e,fallbackRender:t,FallbackComponent:i,fallback:a}=this.props,{didCatch:o,error:s}=this.state,c=e;if(o){let e={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)c=t(e);else if(i)c=n(i,e);else if(a!==void 0)c=a;else throw s}return n(r.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},c)}};function o(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}export{a as t};
@@ -0,0 +1 @@
1
+ import{createContext as e,useCallback as t,useContext as n,useEffect as r,useId as i,useImperativeHandle as a,useLayoutEffect as o,useMemo as s,useRef as c,useState as l,useSyncExternalStore as u}from"react";import{jsx as d}from"react/jsx-runtime";function f(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function p(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function m(e){return e/100*window.innerHeight}function h(e){return e/100*window.innerWidth}function g(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function _({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=g(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=p(t,i);break;case`em`:r=f(t,i);break;case`vh`:r=m(i);break;case`vw`:r=h(i);break}return r}function v(e){return parseFloat(e.toFixed(3))}function y({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function b(e){let{panels:t}=e,n=y({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=v(_({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=v(_({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=v(_({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=v(_({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function x(e,t=`Assertion error`){if(!e)throw Error(t)}function S(e,t){return Array.from(t).sort(e===`horizontal`?C:w)}function C(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function w(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function T(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function E(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function D({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=E(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return x(i,`No rect found`),i}let O;function k(){return O===void 0&&(O=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),O}function A(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=S(n,Array.from(t.children).filter(T).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,D({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=k()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:y({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var j=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}};let M=new Map;const N=new j;function ee(e){M=new Map(M),M.delete(e)}function te(e,t){for(let[t]of M)if(t.id===e)return t}function P(e,t){for(let[t,n]of M)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function F(){return M}function ne(e,t){return N.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function I(e,t){let n=M.get(e);M=new Map(M),M.set(e,t),N.emit(`groupChange`,{group:e,prev:n,next:t})}function re(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=E(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function ie(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ae(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:de(e),b:de(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();x(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:ue(le(n.a)),b:ue(le(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}const oe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function se(e){let t=getComputedStyle(fe(e)??e).display;return t===`flex`||t===`inline-flex`}function ce(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||se(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||oe.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function le(e){let t=e.length;for(;t--;){let n=e[t];if(x(n,`Missing node`),ce(n))return n}return null}function ue(e){return e&&Number(getComputedStyle(e).zIndex)||0}function de(e){let t=[];for(;e;)t.push(e),e=fe(e);return t}function fe(e){let{parentNode:t}=e;return ie(t)?t.host:t}function pe(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function me({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!T(n)||n.contains(e)||e.contains(n))return!0;if(ae(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(pe(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function L(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=A(r),a=re(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&me({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function he(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function R(e,t,n=0){return Math.abs(v(e)-v(t))<=n}function z(e,t){return R(e,t)?0:e>t?1:-1}function B({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(z(r,c)<0)if(a){let e=(i+c)/2;r=z(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=v(r),r}function V({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(R(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;x(u!=null,`Invalid first pivot index`),x(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];x(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(x(n!=null,`Previous layout not found for panel index ${t}`),R(n,i)){let t=o-n;z(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];x(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(x(n!=null,`Previous layout not found for panel index ${t}`),R(n,o)){let t=n-i;z(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];x(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&z(i,c)<0)if(e>0){let t=c-o,n=t/2;z(i+e,c)<0&&(e=z(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;z(i-e,c)<0&&(e=z(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];x(e!=null,`Previous layout not found for panel index ${r}`);let a=B({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];x(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=B({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!R(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(he(c,l))return i;{let t=e<0?d:u,r=s[t];x(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=B({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!R(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];x(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=B({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(R(i,s)||(t-=s-i,l[r]=s),R(t,0))break;e>0?r--:r++}}}if(!R(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function H(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||z(e[n],t[n])!==0)return!1;return!0}function U({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!R(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];x(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];x(i!=null,`No layout data found for index ${e}`);let o=r[e];x(o!=null,`No layout data found for index ${e}`);let s=B({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!R(a,0))for(let e=0;e<t.length;e++){let n=r[e];x(n!=null,`No layout data found for index ${e}`);let i=n+a,o=B({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,R(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function ge({groupId:e,panelId:t}){let n=()=>{let t=F();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&R(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:v(100-e)}}return V({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=U({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});H(c,u)||I(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&R(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=y({group:t});s(v(_({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function _e(e){e.defaultPrevented||L(e,F()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=ge({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function W(e){let t=F();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function ve({groupId:e}){let t=()=>{let t=F();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=U({layout:e,panelConstraints:r});return n?o:(H(o,c)||I(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function G(e,t){let n=W(e),r=P(n.id,!0),i=n.separators.find(t=>t.element===e);x(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);x(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=ve({groupId:n.id}).getLayout(),c=U({layout:V({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});H(s,c)||I(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function ye(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=W(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&G(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&G(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&G(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&G(t,-5);break;case`End`:e.preventDefault(),G(t,100);break;case`Enter`:{e.preventDefault();let n=W(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=P(n.id,!0),o=n.separators.find(e=>e.element===t);x(o,`Matching separator not found`);let s=a.get(o);x(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(x(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];G(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=W(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);x(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),G(t,-100);break}}let K={cursorFlags:0,state:`inactive`};const be=new j;function q(){return K}function xe(e){return be.addListener(`change`,e)}function Se(e){let t=K,n={...K};n.cursorFlags=e,K=n,be.emit(`change`,{prev:t,next:n})}function J(e){let t=K;K=e,be.emit(`change`,{prev:t,next:e})}function Ce(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=F(),n=L(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),J({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}const we=e=>e,Te=()=>{};let Y;function Ee(){return Y===void 0&&(Y=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Y=!0)),Y}function De({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Ee()){let t=(e&1)!=0,n=(e&2)!=0,r=(e&4)!=0,i=(e&8)!=0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Ee()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}const Oe=new WeakMap;function ke(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Oe.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=q();switch(r.state){case`active`:case`hover`:{let e=De({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}Oe.set(e,{prevStyle:t,styleSheet:n})}function Ae({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=V({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(H(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?1:2;break;case`vertical`:s|=d<0?4:8;break}}else I(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&3:c|=s&3,t.movementY===0?c|=o&12:c|=s&12,Se(c),ke(e)}function je(e){let t=F(),n=q();switch(n.state){case`active`:Ae({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Me(e){if(e.defaultPrevented)return;let t=q(),n=F();switch(t.state){case`active`:if(e.buttons===0){J({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=P(e.group.id,!0);I(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Ae({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=L(e,n);r.length===0?t.state!==`inactive`&&J({cursorFlags:0,state:`inactive`}):J({cursorFlags:0,hitRegions:r,state:`hover`}),ke(e.currentTarget);break}}}function Ne(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(q().state){case`hover`:J({cursorFlags:0,state:`inactive`})}}function Pe(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=q();switch(t.state){case`active`:J({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(ke(e.currentTarget),t.hitRegions.forEach(e=>{let t=P(e.group.id,!0);I(e.group,t)}),e.preventDefault())}}function Fe(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=v(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=v((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Ie(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=y({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:v(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Le(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Re({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=v(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=v((r[e]??0)/a*l);else{let e=v(l/c.length);for(let t of c)u[t]=e}return u}function ze(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}const X=new Map;function Be(e){let t=!0;x(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=y({group:e});if(t===0)return;let n=P(e.id);if(!n)return;let r=b(e),i=n.defaultLayoutDeferred?Fe(r):n.layout,a=U({layout:Re({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&H(n.layout,a)&&Le(n.derivedPanelConstraints,r)&&n.groupSize===t)return;I(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Ie(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{x(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=y({group:e}),s=b(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(ze(e.panels,l)||(l=void 0));let u=U({layout:e.mutableState.layouts[c]??l??Fe(s),panelConstraints:s}),d=e.element.ownerDocument;X.set(d,(X.get(d)??0)+1);let f=new Map;return A(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),I(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{x(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,ye)}),X.get(d)===1&&(d.addEventListener(`dblclick`,_e,!0),d.addEventListener(`pointerdown`,Ce,!0),d.addEventListener(`pointerleave`,je),d.addEventListener(`pointermove`,Me),d.addEventListener(`pointerout`,Ne),d.addEventListener(`pointerup`,Pe,!0)),function(){t=!1,X.set(d,Math.max(0,(X.get(d)??0)-1)),ee(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,ye)}),X.get(d)||(d.removeEventListener(`dblclick`,_e,!0),d.removeEventListener(`pointerdown`,Ce,!0),d.removeEventListener(`pointerleave`,je),d.removeEventListener(`pointermove`,Me),d.removeEventListener(`pointerout`,Ne),d.removeEventListener(`pointerup`,Pe,!0)),a.disconnect()}}function Ve(){let[e,n]=l({});return[e,t(()=>n({}),[])]}function He(e){let t=i();return`${e??t}`}const Z=typeof window<`u`?o:r;function Q(e){let n=c(e);return Z(()=>{n.current=e},[e]),t((...e)=>n.current?.(...e),[n])}function Ue(...e){return Q(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function We(e){let t=c({...e});return Z(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}const Ge=e(null);function Ke(e,t){let n=c({getLayout:()=>({}),setLayout:we});a(t,()=>n.current,[]),Z(()=>{Object.assign(n.current,ve({groupId:e}))})}function qe({children:e,className:t,defaultLayout:n,disableCursor:i,disabled:a,elementRef:o,groupRef:l,id:u,onLayoutChange:f,onLayoutChanged:p,orientation:m=`horizontal`,resizeTargetMinimumSize:h={coarse:20,fine:10},style:g,..._}){let v=c({onLayoutChange:{},onLayoutChanged:{}}),y=Q(e=>{H(v.current.onLayoutChange,e)||(v.current.onLayoutChange=e,f?.(e))}),x=Q(e=>{H(v.current.onLayoutChanged,e)||(v.current.onLayoutChanged=e,p?.(e))}),C=He(u),w=c(null),[T,E]=Ve(),D=c({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:h,separators:[]}),O=Ue(w,o);Ke(C,l);let k=Q((e,t)=>{let r=q(),i=te(e),a=P(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),A=We({defaultLayout:n,disableCursor:i}),j=s(()=>({get disableCursor(){return!!A.disableCursor},getPanelStyles:k,id:C,orientation:m,registerPanel:e=>{let t=D.current;return t.panels=S(m,[...t.panels,e]),E(),()=>{t.panels=t.panels.filter(t=>t!==e),E()}},registerSeparator:e=>{let t=D.current;return t.separators=S(m,[...t.separators,e]),E(),()=>{t.separators=t.separators.filter(t=>t!==e),E()}},updatePanelProps:(e,{disabled:t})=>{let n=D.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=te(C),i=P(C);r&&i&&I(r,{...i,derivedPanelConstraints:b(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=D.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[k,C,E,m,A]),M=c(null);return Z(()=>{let e=w.current;if(e===null)return;let t=D.current,n;if(A.defaultLayout!==void 0&&Object.keys(A.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=A.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!a,element:e,id:C,mutableState:{defaultLayout:n,disableCursor:!!A.disableCursor,expandedPanelSizes:D.current.lastExpandedPanelSizes,layouts:D.current.layouts},orientation:m,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};M.current=r;let i=Be(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=P(r.id,!0);!o&&s.length>0&&(y(c),x(c));let l=ne(C,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=R(t.collapsedSize,i[t.panelId]),a=R(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=q().state!==`active`;y(i),o&&x(i)});return()=>{M.current=null,i(),l()}},[a,C,x,y,m,T,A]),r(()=>{let e=M.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!i)}),d(Ge.Provider,{value:j,children:d(`div`,{..._,className:t,"data-group":!0,"data-testid":C,id:C,ref:O,style:{height:`100%`,width:`100%`,overflow:`hidden`,...g,display:`flex`,flexDirection:m===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:m===`horizontal`?`pan-y`:`pan-x`},children:e})})}qe.displayName=`Group`;function $(){let e=n(Ge);return x(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Je(e,t){let{id:n}=$(),r=c({collapse:Te,expand:Te,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Te});a(t,()=>r.current,[]),Z(()=>{Object.assign(r.current,ge({groupId:n,panelId:e}))})}function Ye({children:e,className:t,collapsedSize:n=`0%`,collapsible:i=!1,defaultSize:a,disabled:o,elementRef:s,groupResizeBehavior:l=`preserve-relative-size`,id:f,maxSize:p=`100%`,minSize:m=`0%`,onResize:h,panelRef:g,style:_,...v}){let y=!!f,b=He(f),x=We({disabled:o}),S=c(null),C=Ue(S,s),{getPanelStyles:w,id:T,orientation:E,registerPanel:D,updatePanelProps:O}=$(),k=h!==null,A=Q((e,t,n)=>{h?.(e,f,n)});Z(()=>{let e=S.current;if(e!==null)return D({element:e,id:b,idIsStable:y,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:k?A:void 0,panelConstraints:{groupResizeBehavior:l,collapsedSize:n,collapsible:i,defaultSize:a,disabled:x.disabled,maxSize:p,minSize:m}})},[l,n,i,a,k,b,y,p,m,A,D,x]),r(()=>{O(b,{disabled:o})},[o,b,O]),Je(b,g);let j=()=>{let e=w(T,b);if(e)return JSON.stringify(e)},M=u(e=>ne(T,e),j,j),N;return N=M?JSON.parse(M):a===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:a},d(`div`,{...v,"data-disabled":o||void 0,"data-panel":!0,"data-testid":b,id:b,ref:C,style:{...Xe,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...N},children:d(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,..._,touchAction:E===`horizontal`?`pan-y`:`pan-x`},children:e})})}Ye.displayName=`Panel`;const Xe={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Ze({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=U({layout:V({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=U({layout:V({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Qe({children:e,className:t,disabled:n,disableDoubleClick:i,elementRef:a,id:o,style:s,...u}){let f=He(o),p=We({disabled:n,disableDoubleClick:i}),[m,h]=l({}),[g,_]=l(`inactive`),[v,y]=l(!1),b=c(null),x=Ue(b,a),{disableCursor:S,id:C,orientation:w,registerSeparator:T,updateSeparatorProps:E}=$(),D=w===`horizontal`?`vertical`:`horizontal`;Z(()=>{let e=b.current;if(e!==null){let t={disabled:p.disabled,disableDoubleClick:p.disableDoubleClick,element:e,id:f},n=T(t),r=xe(e=>{_(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=ne(C,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);h(Ze({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[C,f,T,p]),r(()=>{E(f,{disabled:n,disableDoubleClick:i})},[n,i,f,E]);let O;n&&!S&&(O=`not-allowed`);let k;if(n)k=`disabled`;else switch(g){case`active`:k=`active`;break;default:k=v?`focus`:g}return d(`div`,{...u,"aria-controls":m.valueControls,"aria-disabled":n||void 0,"aria-orientation":D,"aria-valuemax":m.valueMax,"aria-valuemin":m.valueMin,"aria-valuenow":m.valueNow,children:e,className:t,"data-separator":k,"data-testid":f,id:f,onBlur:()=>y(!1),onFocus:()=>y(!0),ref:x,role:`separator`,style:{flexBasis:`auto`,cursor:O,...s,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Qe.displayName=`Separator`;export{qe as n,Ye as r,Qe as t};
@@ -0,0 +1 @@
1
+ function e(e,t,n){let r=n=>e(n,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e(t,n,r);throw Error(`Wrong number of arguments`)}const n=e=>(t,n)=>{if(n===0)return e(t);if(!Number.isInteger(n))throw TypeError(`precision must be an integer: ${n.toString()}`);if(n>15||n<-15)throw RangeError(`precision must be between -15 and 15`);return Number.isNaN(t)||!Number.isFinite(t)?e(t):r(e(r(t,n)),-n)};function r(e,t){let[n,r]=e.toString().split(`e`),i=`${n}e${((r===void 0?0:Number.parseInt(r,10))+t).toString()}`;return Number.parseFloat(i)}function i(...e){return t(n(Math.ceil),e)}function a(...e){return t(o,e)}const o=(e,{min:t,max:n})=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e;function s(...e){return t(c,e)}const c=(e,t)=>[...e,...t],l={done:!1,hasNext:!1},ee=e=>({hasNext:!0,next:e,done:!1});function u(e,...t){let n=e,r=t.map(e=>`lazy`in e?f(e):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!te(n)){let e=t[i];n=e(n),i+=1;continue}let e=[];for(let n=i;n<t.length;n++){let t=r[n];if(t===void 0||(e.push(t),t.isSingle))break}let a=[];for(let t of n)if(d(t,a,e))break;let{isSingle:o}=e.at(-1);n=o?a[0]:a,i+=e.length}return n}function d(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=l,a=!1;for(let[e,o]of n.entries()){let{index:s,items:c}=o;if(c.push(r),i=o(r,s,c),o.index+=1,i.hasNext){if(i.hasMany??!1){for(let r of i.next)if(d(r,t,n.slice(e+1)))return!0;return a}r=i.next}if(!i.hasNext)break;i.done&&(a=!0)}return i.hasNext&&t.push(r),a}function f(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function te(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}function p(e,t){let n=t.length-e.length;if(n===1){let[n,...r]=t;return u(n,{lazy:e,lazyArgs:r})}if(n===0){let n={lazy:e,lazyArgs:t};return Object.assign(e=>u(e,n),n)}throw Error(`Wrong number of arguments`)}function m(...e){return p(h,e)}function h(e){if(e.length===0)return ee;let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return e=>{let n=t.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(t.set(e,n-1),l)}}function g(...e){return t(ne,e)}const ne=(e,t)=>e.length>=t,_={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function re(e,t){let[n,...r]=t;if(!ie(n))return e(n,v(...r));let i=v(n,...r);return t=>e(t,i)}function v(e,t,...n){let r=typeof e==`function`?e:e[0],i=typeof e==`function`?`asc`:e[1],{[i]:a}=_,o=t===void 0?void 0:v(t,...n);return(e,t)=>{let n=r(e),i=r(t);return a(n,i)?1:a(i,n)?-1:o?.(e,t)??0}}function ie(e){if(y(e))return!0;if(typeof e!=`object`||!Array.isArray(e))return!1;let[t,n,...r]=e;return y(t)&&typeof n==`string`&&n in _&&r.length===0}const y=e=>typeof e==`function`&&e.length===1;function b(...e){return t(Object.entries,e)}function x(...e){return t(S,e,C)}const S=(e,t)=>e.filter(t),C=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:l,w=e=>Object.assign(e,{single:!0});function T(...e){return t(E,e,w(D))}const E=(e,t)=>e.find(t),D=e=>(t,n,r)=>e(t,n,r)?{done:!0,hasNext:!0,next:t}:l;function O(...e){return t(k,e,w(A))}const k=([e])=>e,A=()=>j,j=e=>({hasNext:!0,next:e,done:!0});function M(...e){return t(N,e,P)}const N=(e,t)=>e.flatMap(t),P=e=>(t,n,r)=>{let i=e(t,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function F(...e){return t(I,e)}function I(e,t){for(let[n,r]of Object.entries(e))t(r,n,e);return e}function L(...e){return t(R,e)}const R=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);if(a!==void 0){let e=n[a];e===void 0?n[a]=[i]:e.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function z(...e){return t(B,e)}function B(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Array.isArray(e))return V(e,t);if(e instanceof Map)return H(e,t);if(e instanceof Set)return U(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[n,r]of Object.entries(e))if(!(n in t)||!B(r,t[n]))return!1;return!0}function V(e,t){if(e.length!==t.length)return!1;for(let[n,r]of e.entries())if(!B(r,t[n]))return!1;return!0}function H(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e.entries())if(!t.has(n)||!B(r,t.get(n)))return!1;return!0}function U(e,t){if(e.size!==t.size)return!1;let n=[...t];for(let t of e){let e=!1;for(let[r,i]of n.entries())if(B(t,i)){e=!0,n.splice(r,1);break}if(!e)return!1}return!0}function W(...e){return t(G,e)}function G(e,t){for(let[n,r]of Object.entries(t))if(!Object.hasOwn(e,n)||!z(r,e[n]))return!1;return!0}function K(e){return Array.isArray(e)}function q(e){return typeof e==`boolean`}function J(e){return e!==void 0}function Y(e){return e===``||e===void 0?!0:Array.isArray(e)?e.length===0:Object.keys(e).length===0}function ae(e){if(e==null||e===``)return!0;if(typeof e!=`object`)return!1;if(`length`in e&&typeof e.length==`number`)return e.length===0;if(`size`in e&&typeof e.size==`number`)return e.size===0;for(let t in e)return!1;return Object.getOwnPropertySymbols(e).length===0}function oe(e){return e instanceof Error}const se=e=>typeof e==`function`;function ce(e){return e!==null}function le(e){return e!=null}function ue(e){return t=>!e(t)}function de(e){return e==null}function fe(e){return typeof e==`number`&&!Number.isNaN(e)}function pe(e){return typeof e==`object`&&!!e}function X(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function me(...e){return t(he,e)}function he(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map)return ge(e,t);if(e instanceof Set&&t instanceof Set)return _e(e,t);let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n){if(!Object.hasOwn(t,r))return!1;let{[r]:n}=e,{[r]:i}=t;if(n!==i||!Object.is(n,i))return!1}return!0}function ge(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(r!==e||!Object.is(r,e))return!1}return!0}function _e(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ve(e){return typeof e==`string`}function ye(e){return!!e}function be(...e){return t(xe,e)}const xe=(e,t)=>e.join(t);function Se(...e){return t(Object.keys,e)}function Ce(...e){return t(we,e)}const we=e=>e.at(-1);function Te(...e){return t(Ee,e,De)}const Ee=(e,t)=>e.map(t),De=e=>(t,n,r)=>({done:!1,hasNext:!0,next:e(t,n,r)});function Oe(...e){return t(ke,e)}function ke(e,t){let n={};for(let[r,i]of e.entries()){let[a,o]=t(i,r,e);n[a]=o}return n}function Ae(...e){return t(je,e)}function je(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r,e);return n}function Me(...e){return t(Z,e)}function Z(e,t){let n={...e,...t};for(let r in t){if(!(r in e))continue;let{[r]:i}=e;if(!X(i))continue;let{[r]:a}=t;X(a)&&(n[r]=Z(i,a))}return n}function Ne(...e){return t(Pe,e)}function Pe(e,t){if(!g(t,1))return{...e};if(!g(t,2)){let{[t[0]]:n,...r}=e;return r}let n={...e};for(let e of t)delete n[e];return n}function Fe(...e){return t(Ie,e)}const Ie=e=>e.length===1?e[0]:void 0;function Le(...e){return t(Re,e)}const Re=(e,t)=>{let n=[[],[]];for(let[r,i]of e.entries())t(i,r,e)?n[0].push(i):n[1].push(i);return n};function ze(...e){return t(Be,e)}function Be(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ve(...e){return t(He,e)}function He(e,t){let n={};for(let[r,i]of Object.entries(e))t(i,r,e)&&(n[r]=i);return n}function Q(...e){return t=>u(t,...e)}function Ue(e,...t){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?n=>$(n,e,...t):$(e,...t)}function $(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}function We(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInteger: The range [${e.toString()},${t.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}function Ge(...e){return t(Ke,e)}const Ke=(e,t,n)=>e.reduce(t,n);function qe(...e){return t(Je,e)}function Je(e){return[...e].reverse()}function Ye(...e){return t(Xe,e)}function Xe(e,t){let n=[...e];return n.sort(t),n}function Ze(...e){return re(Qe,e)}const Qe=(e,t)=>[...e].sort(t);function $e(...e){return t(et,e)}function et(e,t){return t(e),e}function tt(...e){return p(nt,e)}function nt(){let e=new Set;return t=>e.has(t)?l:(e.add(t),{done:!1,hasNext:!0,next:t})}export{le as A,L as B,ve as C,fe as D,pe as E,Y as F,x as G,M as H,J as I,m as J,b as K,q as L,se as M,oe as N,de as O,ae as P,i as Q,K as R,ye as S,X as T,O as U,F as V,T as W,s as X,u as Y,a as Z,Oe as _,qe as a,Se as b,Ue as c,ze as d,Le as f,Ae as g,Me as h,Ye as i,ce as j,ue as k,Q as l,Ne as m,$e as n,Ge as o,Fe as p,g as q,Ze as r,We as s,tt as t,Ve as u,Te as v,me as w,be as x,Ce as y,W as z};