voice-mode 2.34.0__py3-none-any.whl → 2.34.2__py3-none-any.whl

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 (143) hide show
  1. voice_mode/__version__.py +1 -1
  2. voice_mode/config.py +1 -1
  3. voice_mode/frontend/package-lock.json +1 -154
  4. voice_mode/tools/service.py +11 -5
  5. {voice_mode-2.34.0.dist-info → voice_mode-2.34.2.dist-info}/METADATA +1 -1
  6. voice_mode-2.34.2.dist-info/RECORD +116 -0
  7. voice_mode/frontend/.next/BUILD_ID +0 -1
  8. voice_mode/frontend/.next/app-build-manifest.json +0 -28
  9. voice_mode/frontend/.next/app-path-routes-manifest.json +0 -1
  10. voice_mode/frontend/.next/build-manifest.json +0 -32
  11. voice_mode/frontend/.next/export-marker.json +0 -1
  12. voice_mode/frontend/.next/images-manifest.json +0 -1
  13. voice_mode/frontend/.next/next-minimal-server.js.nft.json +0 -1
  14. voice_mode/frontend/.next/next-server.js.nft.json +0 -1
  15. voice_mode/frontend/.next/package.json +0 -1
  16. voice_mode/frontend/.next/prerender-manifest.json +0 -1
  17. voice_mode/frontend/.next/react-loadable-manifest.json +0 -1
  18. voice_mode/frontend/.next/required-server-files.json +0 -1
  19. voice_mode/frontend/.next/routes-manifest.json +0 -1
  20. voice_mode/frontend/.next/server/app/_not-found/page.js +0 -1
  21. voice_mode/frontend/.next/server/app/_not-found/page.js.nft.json +0 -1
  22. voice_mode/frontend/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
  23. voice_mode/frontend/.next/server/app/_not-found.html +0 -1
  24. voice_mode/frontend/.next/server/app/_not-found.meta +0 -6
  25. voice_mode/frontend/.next/server/app/_not-found.rsc +0 -9
  26. voice_mode/frontend/.next/server/app/api/connection-details/route.js +0 -12
  27. voice_mode/frontend/.next/server/app/api/connection-details/route.js.nft.json +0 -1
  28. voice_mode/frontend/.next/server/app/favicon.ico/route.js +0 -12
  29. voice_mode/frontend/.next/server/app/favicon.ico/route.js.nft.json +0 -1
  30. voice_mode/frontend/.next/server/app/favicon.ico.body +0 -0
  31. voice_mode/frontend/.next/server/app/favicon.ico.meta +0 -1
  32. voice_mode/frontend/.next/server/app/index.html +0 -1
  33. voice_mode/frontend/.next/server/app/index.meta +0 -5
  34. voice_mode/frontend/.next/server/app/index.rsc +0 -7
  35. voice_mode/frontend/.next/server/app/page.js +0 -11
  36. voice_mode/frontend/.next/server/app/page.js.nft.json +0 -1
  37. voice_mode/frontend/.next/server/app/page_client-reference-manifest.js +0 -1
  38. voice_mode/frontend/.next/server/app-paths-manifest.json +0 -6
  39. voice_mode/frontend/.next/server/chunks/463.js +0 -1
  40. voice_mode/frontend/.next/server/chunks/682.js +0 -6
  41. voice_mode/frontend/.next/server/chunks/948.js +0 -2
  42. voice_mode/frontend/.next/server/chunks/994.js +0 -2
  43. voice_mode/frontend/.next/server/chunks/font-manifest.json +0 -1
  44. voice_mode/frontend/.next/server/font-manifest.json +0 -1
  45. voice_mode/frontend/.next/server/functions-config-manifest.json +0 -1
  46. voice_mode/frontend/.next/server/interception-route-rewrite-manifest.js +0 -1
  47. voice_mode/frontend/.next/server/middleware-build-manifest.js +0 -1
  48. voice_mode/frontend/.next/server/middleware-manifest.json +0 -6
  49. voice_mode/frontend/.next/server/middleware-react-loadable-manifest.js +0 -1
  50. voice_mode/frontend/.next/server/next-font-manifest.js +0 -1
  51. voice_mode/frontend/.next/server/next-font-manifest.json +0 -1
  52. voice_mode/frontend/.next/server/pages/404.html +0 -1
  53. voice_mode/frontend/.next/server/pages/500.html +0 -1
  54. voice_mode/frontend/.next/server/pages/_app.js +0 -1
  55. voice_mode/frontend/.next/server/pages/_app.js.nft.json +0 -1
  56. voice_mode/frontend/.next/server/pages/_document.js +0 -1
  57. voice_mode/frontend/.next/server/pages/_document.js.nft.json +0 -1
  58. voice_mode/frontend/.next/server/pages/_error.js +0 -1
  59. voice_mode/frontend/.next/server/pages/_error.js.nft.json +0 -1
  60. voice_mode/frontend/.next/server/pages-manifest.json +0 -1
  61. voice_mode/frontend/.next/server/server-reference-manifest.js +0 -1
  62. voice_mode/frontend/.next/server/server-reference-manifest.json +0 -1
  63. voice_mode/frontend/.next/server/webpack-runtime.js +0 -1
  64. voice_mode/frontend/.next/standalone/.next/BUILD_ID +0 -1
  65. voice_mode/frontend/.next/standalone/.next/app-build-manifest.json +0 -28
  66. voice_mode/frontend/.next/standalone/.next/app-path-routes-manifest.json +0 -1
  67. voice_mode/frontend/.next/standalone/.next/build-manifest.json +0 -32
  68. voice_mode/frontend/.next/standalone/.next/package.json +0 -1
  69. voice_mode/frontend/.next/standalone/.next/prerender-manifest.json +0 -1
  70. voice_mode/frontend/.next/standalone/.next/react-loadable-manifest.json +0 -1
  71. voice_mode/frontend/.next/standalone/.next/required-server-files.json +0 -1
  72. voice_mode/frontend/.next/standalone/.next/routes-manifest.json +0 -1
  73. voice_mode/frontend/.next/standalone/.next/server/app/_not-found/page.js +0 -1
  74. voice_mode/frontend/.next/standalone/.next/server/app/_not-found/page.js.nft.json +0 -1
  75. voice_mode/frontend/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
  76. voice_mode/frontend/.next/standalone/.next/server/app/_not-found.html +0 -1
  77. voice_mode/frontend/.next/standalone/.next/server/app/_not-found.meta +0 -6
  78. voice_mode/frontend/.next/standalone/.next/server/app/_not-found.rsc +0 -9
  79. voice_mode/frontend/.next/standalone/.next/server/app/api/connection-details/route.js +0 -12
  80. voice_mode/frontend/.next/standalone/.next/server/app/api/connection-details/route.js.nft.json +0 -1
  81. voice_mode/frontend/.next/standalone/.next/server/app/favicon.ico/route.js +0 -12
  82. voice_mode/frontend/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +0 -1
  83. voice_mode/frontend/.next/standalone/.next/server/app/favicon.ico.body +0 -0
  84. voice_mode/frontend/.next/standalone/.next/server/app/favicon.ico.meta +0 -1
  85. voice_mode/frontend/.next/standalone/.next/server/app/index.html +0 -1
  86. voice_mode/frontend/.next/standalone/.next/server/app/index.meta +0 -5
  87. voice_mode/frontend/.next/standalone/.next/server/app/index.rsc +0 -7
  88. voice_mode/frontend/.next/standalone/.next/server/app/page.js +0 -11
  89. voice_mode/frontend/.next/standalone/.next/server/app/page.js.nft.json +0 -1
  90. voice_mode/frontend/.next/standalone/.next/server/app/page_client-reference-manifest.js +0 -1
  91. voice_mode/frontend/.next/standalone/.next/server/app-paths-manifest.json +0 -6
  92. voice_mode/frontend/.next/standalone/.next/server/chunks/463.js +0 -1
  93. voice_mode/frontend/.next/standalone/.next/server/chunks/682.js +0 -6
  94. voice_mode/frontend/.next/standalone/.next/server/chunks/948.js +0 -2
  95. voice_mode/frontend/.next/standalone/.next/server/chunks/994.js +0 -2
  96. voice_mode/frontend/.next/standalone/.next/server/font-manifest.json +0 -1
  97. voice_mode/frontend/.next/standalone/.next/server/middleware-build-manifest.js +0 -1
  98. voice_mode/frontend/.next/standalone/.next/server/middleware-manifest.json +0 -6
  99. voice_mode/frontend/.next/standalone/.next/server/middleware-react-loadable-manifest.js +0 -1
  100. voice_mode/frontend/.next/standalone/.next/server/next-font-manifest.js +0 -1
  101. voice_mode/frontend/.next/standalone/.next/server/next-font-manifest.json +0 -1
  102. voice_mode/frontend/.next/standalone/.next/server/pages/404.html +0 -1
  103. voice_mode/frontend/.next/standalone/.next/server/pages/500.html +0 -1
  104. voice_mode/frontend/.next/standalone/.next/server/pages/_app.js +0 -1
  105. voice_mode/frontend/.next/standalone/.next/server/pages/_app.js.nft.json +0 -1
  106. voice_mode/frontend/.next/standalone/.next/server/pages/_document.js +0 -1
  107. voice_mode/frontend/.next/standalone/.next/server/pages/_document.js.nft.json +0 -1
  108. voice_mode/frontend/.next/standalone/.next/server/pages/_error.js +0 -1
  109. voice_mode/frontend/.next/standalone/.next/server/pages/_error.js.nft.json +0 -1
  110. voice_mode/frontend/.next/standalone/.next/server/pages-manifest.json +0 -1
  111. voice_mode/frontend/.next/standalone/.next/server/server-reference-manifest.js +0 -1
  112. voice_mode/frontend/.next/standalone/.next/server/server-reference-manifest.json +0 -1
  113. voice_mode/frontend/.next/standalone/.next/server/webpack-runtime.js +0 -1
  114. voice_mode/frontend/.next/standalone/package.json +0 -40
  115. voice_mode/frontend/.next/standalone/server.js +0 -38
  116. voice_mode/frontend/.next/static/VjuJp4LAYPX7t1KdLNI3o/_buildManifest.js +0 -1
  117. voice_mode/frontend/.next/static/VjuJp4LAYPX7t1KdLNI3o/_ssgManifest.js +0 -1
  118. voice_mode/frontend/.next/static/chunks/117-40bc79a2b97edb21.js +0 -2
  119. voice_mode/frontend/.next/static/chunks/144d3bae-2d5f122b82426d88.js +0 -1
  120. voice_mode/frontend/.next/static/chunks/471-bd4b96a33883dfa2.js +0 -3
  121. voice_mode/frontend/.next/static/chunks/app/_not-found/page-5011050e402ab9c8.js +0 -1
  122. voice_mode/frontend/.next/static/chunks/app/layout-8365e4b0b502e273.js +0 -1
  123. voice_mode/frontend/.next/static/chunks/app/page-56c513d637021d6c.js +0 -1
  124. voice_mode/frontend/.next/static/chunks/fd9d1056-af324d327b243cf1.js +0 -1
  125. voice_mode/frontend/.next/static/chunks/framework-f66176bb897dc684.js +0 -1
  126. voice_mode/frontend/.next/static/chunks/main-3163eca598b76a9f.js +0 -1
  127. voice_mode/frontend/.next/static/chunks/main-app-c2e7596a7588072c.js +0 -1
  128. voice_mode/frontend/.next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
  129. voice_mode/frontend/.next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
  130. voice_mode/frontend/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  131. voice_mode/frontend/.next/static/chunks/webpack-0ea9b80f19935b70.js +0 -1
  132. voice_mode/frontend/.next/static/css/a2f49a47752b5010.css +0 -3
  133. voice_mode/frontend/.next/static/media/01099be941da1820-s.woff2 +0 -0
  134. voice_mode/frontend/.next/static/media/39883d31a7792467-s.p.woff2 +0 -0
  135. voice_mode/frontend/.next/static/media/6368404d2e8d66fe-s.woff2 +0 -0
  136. voice_mode/frontend/.next/trace +0 -43
  137. voice_mode/frontend/.next/types/app/api/connection-details/route.ts +0 -343
  138. voice_mode/frontend/.next/types/app/layout.ts +0 -79
  139. voice_mode/frontend/.next/types/app/page.ts +0 -79
  140. voice_mode/frontend/.next/types/package.json +0 -1
  141. voice_mode-2.34.0.dist-info/RECORD +0 -250
  142. {voice_mode-2.34.0.dist-info → voice_mode-2.34.2.dist-info}/WHEEL +0 -0
  143. {voice_mode-2.34.0.dist-info → voice_mode-2.34.2.dist-info}/entry_points.txt +0 -0
@@ -1,3 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[471],{257:function(t,e,n){"use strict";var i,r;t.exports=(null==(i=n.g.process)?void 0:i.env)&&"object"==typeof(null==(r=n.g.process)?void 0:r.env)?n.g.process:n(4227)},4227:function(t){!function(){var e={229:function(t){var e,n,i,r=t.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var l=[],u=!1,c=-1;function h(){u&&i&&(u=!1,i.length?l=i.concat(l):c=-1,l.length&&d())}function d(){if(!u){var t=a(h);u=!0;for(var e=l.length;e;){for(i=l,l=[];++c<e;)i&&i[c].run();c=-1,e=l.length}i=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function p(){}r.nextTick=function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||u||a(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw Error("process.chdir is not supported")},r.umask=function(){return 0}}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}},s=!0;try{e[t](o,o.exports,i),s=!1}finally{s&&delete n[t]}return o.exports}i.ab="//";var r=i(229);t.exports=r}()},2297:function(t,e,n){"use strict";n.d(e,{B:function(){return D},D:function(){return c},M:function(){return y},R:function(){return E},T:function(){return b},V:function(){return T},f:function(){return g}});var i,r,o=n(2265),s=n(7933),a=n(1318),l=n(3819),u=n(9426);let c=o.forwardRef(function(t,e){let{buttonProps:n}=(0,s.c)(t);return o.createElement("button",{ref:e,...n},t.children)}),h=t=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",...t},o.createElement("path",{d:"M1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708L11 10.293V4.5A1.5 1.5 0 0 0 9.5 3H3.707zM0 4.5a1.5 1.5 0 0 1 .943-1.393l9.532 9.533c-.262.224-.603.36-.975.36h-8A1.5 1.5 0 0 1 0 11.5z"}),o.createElement("path",{d:"m15.2 3.6-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4z"})),d=t=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",...t},o.createElement("path",{d:"M0 4.5A1.5 1.5 0 0 1 1.5 3h8A1.5 1.5 0 0 1 11 4.5v7A1.5 1.5 0 0 1 9.5 13h-8A1.5 1.5 0 0 1 0 11.5zM15.2 3.6l-2.8 2.1a1 1 0 0 0-.4.8v3a1 1 0 0 0 .4.8l2.8 2.1a.5.5 0 0 0 .8-.4V4a.5.5 0 0 0-.8-.4z"})),f=t=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",...t},o.createElement("path",{d:"M12.227 11.52a5.477 5.477 0 0 0 1.246-2.97.5.5 0 0 0-.995-.1 4.478 4.478 0 0 1-.962 2.359l-1.07-1.07C10.794 9.247 11 8.647 11 8V3a3 3 0 0 0-6 0v1.293L1.354.646a.5.5 0 1 0-.708.708l14 14a.5.5 0 0 0 .708-.708zM8 12.5c.683 0 1.33-.152 1.911-.425l.743.743c-.649.359-1.378.59-2.154.66V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.502 5.502 0 0 1-4.973-4.929.5.5 0 0 1 .995-.098A4.5 4.5 0 0 0 8 12.5z"}),o.createElement("path",{d:"M8.743 10.907 5 7.164V8a3 3 0 0 0 3.743 2.907z"})),p=t=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",...t},o.createElement("path",{fillRule:"evenodd",d:"M2.975 8.002a.5.5 0 0 1 .547.449 4.5 4.5 0 0 0 8.956 0 .5.5 0 1 1 .995.098A5.502 5.502 0 0 1 8.5 13.478V15h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2v-1.522a5.502 5.502 0 0 1-4.973-4.929.5.5 0 0 1 .448-.547z",clipRule:"evenodd"}),o.createElement("path",{d:"M5 3a3 3 0 1 1 6 0v5a3 3 0 0 1-6 0z"})),m=t=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:16,fill:"none",...t},o.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M0 2.75A2.75 2.75 0 0 1 2.75 0h14.5A2.75 2.75 0 0 1 20 2.75v10.5A2.75 2.75 0 0 1 17.25 16H2.75A2.75 2.75 0 0 1 0 13.25V2.75ZM2.75 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h14.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25H2.75Z",clipRule:"evenodd"}),o.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.47 4.22a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1-1.06 1.06l-.97-.97v4.69a.75.75 0 0 1-1.5 0V6.56l-.97.97a.75.75 0 0 1-1.06-1.06l2.25-2.25Z",clipRule:"evenodd"})),v=t=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:16,fill:"none",...t},o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M7.28 4.22a.75.75 0 0 0-1.06 1.06L8.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L10 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L11.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L10 6.94z"}),o.createElement("path",{fillRule:"evenodd",d:"M2.75 0A2.75 2.75 0 0 0 0 2.75v10.5A2.75 2.75 0 0 0 2.75 16h14.5A2.75 2.75 0 0 0 20 13.25V2.75A2.75 2.75 0 0 0 17.25 0zM1.5 2.75c0-.69.56-1.25 1.25-1.25h14.5c.69 0 1.25.56 1.25 1.25v10.5c0 .69-.56 1.25-1.25 1.25H2.75c-.69 0-1.25-.56-1.25-1.25z",clipRule:"evenodd"}))),y=o.forwardRef(function({kind:t,initialSelection:e,onActiveDeviceChange:n,onDeviceListChange:i,onDeviceSelectError:r,exactMatch:c,track:h,requestPermissions:d,onError:f,...p},m){let v=(0,u.w)(),y=o.useRef("default"),g=o.useCallback(t=>{v&&v.emit(l.TQ.MediaDevicesError,t),null==f||f(t)},[v,f]),{devices:b,activeDeviceId:w,setActiveMediaDevice:x,className:S}=(0,s.e)({kind:t,room:v,track:h,requestPermissions:d,onError:g});o.useEffect(()=>{void 0!==e&&x(e)},[x]),o.useEffect(()=>{"function"==typeof i&&i(b)},[i,b]),o.useEffect(()=>{w!==y.current&&(null==n||n(w)),y.current=w},[w]);let T=async t=>{try{await x(t,{exact:c??!0})}catch(t){if(t instanceof Error)null==r||r(t);else throw t}},P=o.useMemo(()=>(0,a.a)(p,{className:S},{className:"lk-list"}),[S,p]),E=!!b.find(t=>t.label.toLowerCase().startsWith("default"));function A(t,e,n){return t===e||!E&&0===n&&"default"===e}return o.createElement("ul",{ref:m,...P},b.map((t,e)=>o.createElement("li",{key:t.deviceId,id:t.deviceId,"data-lk-active":A(t.deviceId,w,e),"aria-selected":A(t.deviceId,w,e),role:"option"},o.createElement("button",{className:"lk-button",onClick:()=>T(t.deviceId)},t.label))))}),g=o.forwardRef(function({label:t,...e},n){let i=(0,u.f)(),{mergedProps:r,canPlayAudio:a}=(0,s.f)({room:i,props:e}),{mergedProps:l,canPlayVideo:c}=(0,s.g)({room:i,props:r}),{style:h,...d}=l;return h.display=a&&c?"none":"block",o.createElement("button",{ref:n,style:h,...d},t??`Start ${a?"Video":"Audio"}`)}),b=o.forwardRef(function({showIcon:t,...e},n){let{buttonProps:i,enabled:r}=(0,s.h)(e),[a,u]=o.useState(!1);return o.useEffect(()=>{u(!0)},[]),a&&o.createElement("button",{ref:n,...i},(t??!0)&&function(t,e){switch(t){case l.fQ.Source.Microphone:return e?o.createElement(p,null):o.createElement(f,null);case l.fQ.Source.Camera:return e?o.createElement(d,null):o.createElement(h,null);case l.fQ.Source.ScreenShare:return e?o.createElement(v,null):o.createElement(m,null);default:return}}(e.source,r),e.children)});function w(t,e={}){let[n,i]=o.useState((0,u.X)(t)),[r,s]=o.useState(null==n?void 0:n.isMuted),[l,c]=o.useState(null==n?void 0:n.isSubscribed),[h,d]=o.useState(null==n?void 0:n.track),[f,p]=o.useState("landscape"),m=o.useRef(),{className:v,trackObserver:y}=o.useMemo(()=>(0,u.Y)(t),[t.participant.sid??t.participant.identity,t.source,(0,u.a1)(t)&&t.publication.trackSid]);return o.useEffect(()=>{let t=y.subscribe(t=>{u.l.debug("update track",t),i(t),s(null==t?void 0:t.isMuted),c(null==t?void 0:t.isSubscribed),d(null==t?void 0:t.track)});return()=>null==t?void 0:t.unsubscribe()},[y]),o.useEffect(()=>{var n,i;return h&&(m.current&&h.detach(m.current),null!=(n=e.element)&&n.current&&!(t.participant.isLocal&&(null==h?void 0:h.kind)==="audio")&&h.attach(e.element.current)),m.current=null==(i=e.element)?void 0:i.current,()=>{m.current&&(null==h||h.detach(m.current))}},[h,e.element]),o.useEffect(()=>{var t,e;"number"==typeof(null==(t=null==n?void 0:n.dimensions)?void 0:t.width)&&"number"==typeof(null==(e=null==n?void 0:n.dimensions)?void 0:e.height)&&p(n.dimensions.width>n.dimensions.height?"landscape":"portrait")},[n]),{publication:n,isMuted:r,isSubscribed:l,track:h,elementProps:(0,a.a)(e.props,{className:v,"data-lk-local-participant":t.participant.isLocal,"data-lk-source":null==n?void 0:n.source,...(null==n?void 0:n.kind)==="video"&&{"data-lk-orientation":f}})}}var x=function(){if(r)return i;r=1;var t=NaN,e=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof u.ae&&u.ae&&u.ae.Object===Object&&u.ae,c="object"==typeof self&&self&&self.Object===Object&&self,h=l||c||Function("return this")(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return h.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function y(i){if("number"==typeof i)return i;if("symbol"==typeof(r=i)||r&&"object"==typeof r&&"[object Symbol]"==d.call(r))return t;if(v(i)){var r,l="function"==typeof i.valueOf?i.valueOf():i;i=v(l)?l+"":l}if("string"!=typeof i)return 0===i?i:+i;i=i.replace(e,"");var u=o.test(i);return u||s.test(i)?a(i.slice(2),u?2:8):n.test(i)?t:+i}return i=function(t,e,n){var i,r,o,s,a,l,u=0,c=!1,h=!1,d=!0;if("function"!=typeof t)throw TypeError("Expected a function");function g(e){var n=i,o=r;return i=r=void 0,u=e,s=t.apply(o,n)}function b(t){var n=t-l,i=t-u;return void 0===l||n>=e||n<0||h&&i>=o}function w(){var t,n,i,r=m();if(b(r))return x(r);a=setTimeout(w,(t=r-l,n=r-u,i=e-t,h?p(i,o-n):i))}function x(t){return a=void 0,d&&i?g(t):(i=r=void 0,s)}function S(){var t,n=m(),o=b(n);if(i=arguments,r=this,l=n,o){if(void 0===a)return u=t=l,a=setTimeout(w,e),c?g(t):s;if(h)return a=setTimeout(w,e),g(l)}return void 0===a&&(a=setTimeout(w,e)),s}return e=y(e)||0,v(n)&&(c=!!n.leading,o=(h="maxWait"in n)?f(y(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),S.cancel=function(){void 0!==a&&clearTimeout(a),u=0,i=l=r=a=void 0},S.flush=function(){return void 0===a?s:x(m())},S}}();let S=(0,u.af)(x),T=o.forwardRef(function({onTrackClick:t,onClick:e,onSubscriptionStatusChanged:n,trackRef:i,manageSubscription:r,...s},a){let c=(0,u.i)(i),h=o.useRef(null);o.useImperativeHandle(a,()=>h.current);let d=function({threshold:t=0,root:e=null,rootMargin:n="0%",freezeOnceVisible:i=!1,initialIsIntersecting:r=!1,onChange:s}={}){var a;let[l,u]=(0,o.useState)(null),[c,h]=(0,o.useState)(()=>({isIntersecting:r,entry:void 0})),d=(0,o.useRef)();d.current=s;let f=(null==(a=c.entry)?void 0:a.isIntersecting)&&i;(0,o.useEffect)(()=>{if(!l||!("IntersectionObserver"in window)||f)return;let i=new IntersectionObserver(t=>{let e=Array.isArray(i.thresholds)?i.thresholds:[i.thresholds];t.forEach(t=>{let n=t.isIntersecting&&e.some(e=>t.intersectionRatio>=e);h({isIntersecting:n,entry:t}),d.current&&d.current(n,t)})},{threshold:t,root:e,rootMargin:n});return i.observe(l),()=>{i.disconnect()}},[l,JSON.stringify(t),e,n,f,i]);let p=(0,o.useRef)(null);(0,o.useEffect)(()=>{var t;l||null==(t=c.entry)||!t.target||i||f||p.current===c.entry.target||(p.current=c.entry.target,h({isIntersecting:r,entry:void 0}))},[l,c.entry,i,f,r]);let m=[u,!!c.isIntersecting,c.entry];return m.ref=m[0],m.isIntersecting=m[1],m.entry=m[2],m}({root:h.current}),[f]=function(t,e,n){let i=t instanceof Function?t():t,[r,s]=(0,o.useState)(i),a=(0,o.useRef)(i),l=function(t,e=500,n){let i=(0,o.useRef)();!function(t){let e=(0,o.useRef)(t);e.current=t,(0,o.useEffect)(()=>()=>{e.current()},[])}(()=>{i.current&&i.current.cancel()});let r=(0,o.useMemo)(()=>{let r=S(t,e,n),o=(...t)=>r(...t);return o.cancel=()=>{r.cancel()},o.isPending=()=>!!i.current,o.flush=()=>r.flush(),o},[t,e,n]);return(0,o.useEffect)(()=>{i.current=S(t,e,n)},[t,e,n]),r}(s,3e3,void 0);return a.current===i||(l(i),a.current=i),[r,l]}(d,0);o.useEffect(()=>{r&&c.publication instanceof l.E8&&(null==f?void 0:f.isIntersecting)===!1&&(null==d?void 0:d.isIntersecting)===!1&&c.publication.setSubscribed(!1)},[f,c,r]),o.useEffect(()=>{r&&c.publication instanceof l.E8&&(null==d?void 0:d.isIntersecting)===!0&&c.publication.setSubscribed(!0)},[d,c,r]);let{elementProps:p,publication:m,isSubscribed:v}=w(c,{element:h,props:s});return o.useEffect(()=>{null==n||n(!!v)},[v,n]),o.createElement("video",{ref:h,...p,muted:!0,onClick:n=>{null==e||e(n),null==t||t({participant:null==c?void 0:c.participant,track:m})}})}),P=o.forwardRef(function({trackRef:t,onSubscriptionStatusChanged:e,volume:n,...i},r){let s=(0,u.i)(t),a=o.useRef(null);o.useImperativeHandle(r,()=>a.current);let{elementProps:c,isSubscribed:h,track:d,publication:f}=w(s,{element:a,props:i});return o.useEffect(()=>{null==e||e(!!h)},[h,e]),o.useEffect(()=>{void 0===d||void 0===n||(d instanceof l.rl?d.setVolume(n):u.l.warn("Volume can only be set on remote audio tracks."))},[n,d]),o.useEffect(()=>{void 0===f||void 0===i.muted||(f instanceof l.E8?f.setEnabled(!i.muted):u.l.warn("Can only call setEnabled on remote track publications."))},[i.muted,f,d]),o.createElement("audio",{ref:a,...c})});function E({volume:t,muted:e}){let n=(0,s.t)([l.fQ.Source.Microphone,l.fQ.Source.ScreenShareAudio,l.fQ.Source.Unknown],{updateOnlyOn:[],onlySubscribed:!0}).filter(t=>!t.participant.isLocal&&t.publication.kind===l.fQ.Kind.Audio);return o.createElement("div",{style:{display:"none"}},n.map(n=>o.createElement(P,{key:(0,u.p)(n),trackRef:n,volume:t,muted:e})))}let A=t=>{let e=[];for(let n=0;n<t;n++)e.push([n,t-1-n]);return e},k=t=>[[Math.floor(t/2)],[-1]],C=(t,e,n)=>{let[i,r]=(0,o.useState)(0),[s,a]=(0,o.useState)([[]]);(0,o.useEffect)(()=>{"thinking"===t?a(k(e)):"connecting"===t||"initializing"===t?a([...A(e)]):a("listening"===t?k(e):void 0===t||"speaking"===t?[Array(e).fill(0).map((t,e)=>e)]:[[]]),r(0)},[t,e]);let l=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let t=performance.now(),e=i=>{i-t>=n&&(r(t=>t+1),t=i),l.current=requestAnimationFrame(e)};return l.current=requestAnimationFrame(e),()=>{null!==l.current&&cancelAnimationFrame(l.current)}},[n,e,t,s.length]),s[i%s.length]},M=new Map([["connecting",2e3],["initializing",2e3],["listening",500],["thinking",150]]),R=(t,e)=>{if(void 0===t)return 1e3;let n=M.get(t);return n&&"connecting"===t&&(n/=e),n},D=o.forwardRef(function({state:t,options:e,barCount:n=15,trackRef:i,children:r,...l},c){let h=(0,a.a)(l,{className:"lk-audio-bar-visualizer"}),d=(0,u.ab)();i&&(d=i);let f=(0,s.s)(d,{bands:n,loPass:100,hiPass:200}),p=(null==e?void 0:e.minHeight)??20,m=(null==e?void 0:e.maxHeight)??100,v=C(t,n,R(t,n)??100);return o.createElement("div",{ref:c,...h,"data-lk-va-state":t},f.map((t,e)=>r?(0,a.c)(r,{"data-lk-highlighted":v.includes(e),"data-lk-bar-index":e,className:"lk-audio-bar",style:{height:`${Math.min(m,Math.max(p,100*t+5))}%`}}):o.createElement("span",{key:e,"data-lk-highlighted":v.includes(e),"data-lk-bar-index":e,className:`lk-audio-bar ${v.includes(e)&&"lk-highlighted"}`,style:{height:`${Math.min(m,Math.max(p,100*t+5))}%`}})))})},9426:function(t,e,n){"use strict";n.d(e,{$:function(){return e3},B:function(){return nt},E:function(){return eB},N:function(){return eH},O:function(){return eY},R:function(){return ne},S:function(){return e$},T:function(){return ez},U:function(){return eE},V:function(){return eK},W:function(){return eA},X:function(){return eM},Y:function(){return eC},_:function(){return e7},a1:function(){return ev},a2:function(){return eG},a3:function(){return e0},a4:function(){return eJ},a5:function(){return eP},a6:function(){return eT},a7:function(){return e_},ab:function(){return e4},ae:function(){return ta},af:function(){return tl},ao:function(){return eg},ap:function(){return eb},e:function(){return eV},f:function(){return nn},h:function(){return eW},i:function(){return e9},l:function(){return eS},p:function(){return ey},t:function(){return eF},u:function(){return nr},v:function(){return eU},w:function(){return ni},x:function(){return eL},y:function(){return eQ}});var i,r,o=n(3819),s=n(2265);let a=Math.min,l=Math.max,u=Math.round,c=Math.floor,h=t=>({x:t,y:t}),d={left:"right",right:"left",bottom:"top",top:"bottom"},f={start:"end",end:"start"};function p(t,e){return"function"==typeof t?t(e):t}function m(t){return t.split("-")[0]}function v(t){return t.split("-")[1]}function y(t){return"x"===t?"y":"x"}function g(t){return"y"===t?"height":"width"}function b(t){return["top","bottom"].includes(m(t))?"y":"x"}function w(t){return t.replace(/start|end/g,t=>f[t])}function x(t){return t.replace(/left|right|bottom|top/g,t=>d[t])}function S(t){let{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function T(t,e,n){let i,{reference:r,floating:o}=t,s=b(e),a=y(b(e)),l=g(a),u=m(e),c="y"===s,h=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[l]/2-o[l]/2;switch(u){case"top":i={x:h,y:r.y-o.height};break;case"bottom":i={x:h,y:r.y+r.height};break;case"right":i={x:r.x+r.width,y:d};break;case"left":i={x:r.x-o.width,y:d};break;default:i={x:r.x,y:r.y}}switch(v(e)){case"start":i[a]-=f*(n&&c?-1:1);break;case"end":i[a]+=f*(n&&c?-1:1)}return i}let P=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await (null==s.isRTL?void 0:s.isRTL(e)),u=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:h}=T(u,i,l),d=i,f={},p=0;for(let n=0;n<a.length;n++){let{name:o,fn:m}=a[n],{x:v,y:y,data:g,reset:b}=await m({x:c,y:h,initialPlacement:i,placement:d,strategy:r,middlewareData:f,rects:u,platform:s,elements:{reference:t,floating:e}});c=v??c,h=y??h,f={...f,[o]:{...f[o],...g}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(u=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:c,y:h}=T(u,d,l)),n=-1)}return{x:c,y:h,placement:d,strategy:r,middlewareData:f}};async function E(t,e){var n;void 0===e&&(e={});let{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=p(e,t),m="number"!=typeof f?{top:0,right:0,bottom:0,left:0,...f}:{top:f,right:f,bottom:f,left:f},v=a[d?"floating"===h?"reference":"floating":h],y=S(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),g="floating"===h?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await (null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),w=await (null==o.isElement?void 0:o.isElement(b))&&await (null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},x=S(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:b,strategy:l}):g);return{top:(y.top-x.top+m.top)/w.y,bottom:(x.bottom-y.bottom+m.bottom)/w.y,left:(y.left-x.left+m.left)/w.x,right:(x.right-y.right+m.right)/w.x}}async function A(t,e){let{placement:n,platform:i,elements:r}=t,o=await (null==i.isRTL?void 0:i.isRTL(r.floating)),s=m(n),a=v(n),l="y"===b(n),u=["left","top"].includes(s)?-1:1,c=o&&l?-1:1,h=p(e,t),{mainAxis:d,crossAxis:f,alignmentAxis:y}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof y&&(f="end"===a?-1*y:y),l?{x:f*c,y:d*u}:{x:d*u,y:f*c}}function k(){return"u">typeof window}function C(t){return D(t)?(t.nodeName||"").toLowerCase():"#document"}function M(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function R(t){var e;return null==(e=(D(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function D(t){return!!k()&&(t instanceof Node||t instanceof M(t).Node)}function V(t){return!!k()&&(t instanceof Element||t instanceof M(t).Element)}function L(t){return!!k()&&(t instanceof HTMLElement||t instanceof M(t).HTMLElement)}function O(t){return!(!k()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof M(t).ShadowRoot)}function I(t){let{overflow:e,overflowX:n,overflowY:i,display:r}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function j(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function F(t){let e=N(),n=V(t)?U(t):t;return["transform","translate","scale","rotate","perspective"].some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some(t=>(n.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(n.contain||"").includes(t))}function N(){return!(typeof CSS>"u")&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}function B(t){return["html","body","#document"].includes(C(t))}function U(t){return M(t).getComputedStyle(t)}function _(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if("html"===C(t))return t;let e=t.assignedSlot||t.parentNode||O(t)&&t.host||R(t);return O(e)?e.host:e}function z(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);let r=function t(e){let n=$(e);return B(n)?e.ownerDocument?e.ownerDocument.body:e.body:L(n)&&I(n)?n:t(n)}(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),s=M(r);if(o){let t=Q(s);return e.concat(s,s.visualViewport||[],I(r)?r:[],t&&n?z(t):[])}return e.concat(r,z(r,[],n))}function Q(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function W(t){let e=U(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,r=L(t),o=r?t.offsetWidth:n,s=r?t.offsetHeight:i,a=u(n)!==o||u(i)!==s;return a&&(n=o,i=s),{width:n,height:i,$:a}}function H(t){return V(t)?t:t.contextElement}function Y(t){let e=H(t);if(!L(e))return h(1);let n=e.getBoundingClientRect(),{width:i,height:r,$:o}=W(e),s=(o?u(n.width):n.width)/i,a=(o?u(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}let q=h(0);function X(t){let e=M(t);return N()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:q}function K(t,e,n,i){var r;void 0===e&&(e=!1),void 0===n&&(n=!1);let o=t.getBoundingClientRect(),s=H(t),a=h(1);e&&(i?V(i)&&(a=Y(i)):a=Y(t));let l=(void 0===(r=n)&&(r=!1),i&&(!r||i===M(s))&&r)?X(s):h(0),u=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(s){let t=M(s),e=i&&V(i)?M(i):i,n=t,r=Q(n);for(;r&&i&&e!==n;){let t=Y(r),e=r.getBoundingClientRect(),i=U(r),o=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;u*=t.x,c*=t.y,d*=t.x,f*=t.y,u+=o,c+=s,r=Q(n=M(r))}}return S({width:d,height:f,x:u,y:c})}function G(t,e){let n=_(t).scrollLeft;return e?e.left+n:K(R(t)).left+n}function Z(t,e,n){void 0===n&&(n=!1);let i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-(n?0:G(t,i)),y:i.top+e.scrollTop}}function J(t,e,n){let i;if("viewport"===e)i=function(t,e){let n=M(t),i=R(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;let t=N();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a,y:l}}(t,n);else if("document"===e)i=function(t){let e=R(t),n=_(t),i=t.ownerDocument.body,r=l(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=l(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),s=-n.scrollLeft+G(t),a=-n.scrollTop;return"rtl"===U(i).direction&&(s+=l(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:s,y:a}}(R(t));else if(V(e))i=function(t,e){let n=K(t,!0,"fixed"===e),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=L(t)?Y(t):h(1),s=t.clientWidth*o.x;return{width:s,height:t.clientHeight*o.y,x:r*o.x,y:i*o.y}}(e,n);else{let n=X(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return S(i)}function tt(t){return"static"===U(t).position}function te(t,e){if(!L(t)||"fixed"===U(t).position)return null;if(e)return e(t);let n=t.offsetParent;return R(t)===n&&(n=n.ownerDocument.body),n}function tn(t,e){let n=M(t);if(j(t))return n;if(!L(t)){let e=$(t);for(;e&&!B(e);){if(V(e)&&!tt(e))return e;e=$(e)}return n}let i=te(t,e);for(;i&&["table","td","th"].includes(C(i))&&tt(i);)i=te(i,e);return i&&B(i)&&tt(i)&&!F(i)?n:i||function(t){let e=$(t);for(;L(e)&&!B(e);){if(F(e))return e;if(j(e))break;e=$(e)}return null}(t)||n}let ti=async function(t){let e=this.getOffsetParent||tn,n=this.getDimensions,i=await n(t.floating);return{reference:function(t,e,n){let i=L(e),r=R(e),o="fixed"===n,s=K(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=h(0);if(i||!i&&!o){if(("body"!==C(e)||I(r))&&(a=_(e)),i){let t=K(e,!0,o,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=G(r))}let u=!r||i||o?h(0):Z(r,a);return{x:s.left+a.scrollLeft-l.x-u.x,y:s.top+a.scrollTop-l.y-u.y,width:s.width,height:s.height}}(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},tr={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t,o="fixed"===r,s=R(i),a=!!e&&j(e.floating);if(i===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=h(1),c=h(0),d=L(i);if((d||!d&&!o)&&(("body"!==C(i)||I(s))&&(l=_(i)),L(i))){let t=K(i);u=Y(i),c.x=t.x+i.clientLeft,c.y=t.y+i.clientTop}let f=!s||d||o?h(0):Z(s,l,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}},getDocumentElement:R,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t,o=[..."clippingAncestors"===n?j(e)?[]:function(t,e){let n=e.get(t);if(n)return n;let i=z(t,[],!1).filter(t=>V(t)&&"body"!==C(t)),r=null,o="fixed"===U(t).position,s=o?$(t):t;for(;V(s)&&!B(s);){let e=U(s),n=F(s);n||"fixed"!==e.position||(r=null),(o?!n&&!r:!n&&"static"===e.position&&!!r&&["absolute","fixed"].includes(r.position)||I(s)&&!n&&function t(e,n){let i=$(e);return!(i===n||!V(i)||B(i))&&("fixed"===U(i).position||t(i,n))}(t,s))?i=i.filter(t=>t!==s):r=e,s=$(s)}return e.set(t,i),i}(e,this._c):[].concat(n),i],s=o[0],u=o.reduce((t,n)=>{let i=J(e,n,r);return t.top=l(i.top,t.top),t.right=a(i.right,t.right),t.bottom=a(i.bottom,t.bottom),t.left=l(i.left,t.left),t},J(e,s,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:tn,getElementRects:ti,getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){let{width:e,height:n}=W(t);return{width:e,height:n}},getScale:Y,isElement:V,isRTL:function(t){return"rtl"===U(t).direction}};function to(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}let ts=(t,e,n)=>{let i=new Map,r={platform:tr,...n},o={...r.platform,_c:i};return P(t,e,{...r,platform:o})};var ta="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{};function tl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tu,tc={exports:{}},th=tc.exports;let td=tl((tu||(tu=1,i=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],r={},o=null;function s(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch{return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(){for(var n=this.getLevel(),r=0;r<i.length;r++){var o=i[r];this[o]=r<n?t:this.methodFactory(o,n,this.name)}if(this.log=this.debug,typeof console===e&&n<this.levels.SILENT)return"No console available for logging"}function u(t){return function(){typeof console!==e&&(l.call(this),this[t].apply(this,arguments))}}function c(i,r,o){var l;return"debug"===(l=i)&&(l="log"),typeof console!==e&&("trace"===l&&n?a:void 0!==console[l]?s(console,l):void 0!==console.log?s(console,"log"):t)||u.apply(this,arguments)}function h(t,n){var s,a,u,h=this,d="loglevel";function f(){var t;if(!(typeof window===e||!d)){try{t=window.localStorage[d]}catch{}if(typeof t===e)try{var n=window.document.cookie,i=encodeURIComponent(d),r=n.indexOf(i+"=");-1!==r&&(t=/^([^;]+)/.exec(n.slice(r+i.length+1))[1])}catch{}return void 0===h.levels[t]&&(t=void 0),t}}function p(t){var e=t;if("string"==typeof e&&void 0!==h.levels[e.toUpperCase()]&&(e=h.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=h.levels.SILENT)return e;throw TypeError("log.setLevel() called with invalid level: "+t)}"string"==typeof t?d+=":"+t:"symbol"==typeof t&&(d=void 0),h.name=t,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=n||c,h.getLevel=function(){return u??a??s},h.setLevel=function(t,n){return u=p(t),!1!==n&&function(t){var n=(i[t]||"silent").toUpperCase();if(!(typeof window===e||!d)){try{window.localStorage[d]=n;return}catch{}try{window.document.cookie=encodeURIComponent(d)+"="+n+";"}catch{}}}(u),l.call(h)},h.setDefaultLevel=function(t){a=p(t),f()||h.setLevel(t,!1)},h.resetLevel=function(){u=null,function(){if(!(typeof window===e||!d)){try{window.localStorage.removeItem(d)}catch{}try{window.document.cookie=encodeURIComponent(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),l.call(h)},h.enableAll=function(t){h.setLevel(h.levels.TRACE,t)},h.disableAll=function(t){h.setLevel(h.levels.SILENT,t)},h.rebuild=function(){if(o!==h&&(s=p(o.getLevel())),l.call(h),o===h)for(var t in r)r[t].rebuild()},s=p(o?o.getLevel():"WARN");var m=f();null!=m&&(u=p(m)),l.call(h)}(o=new h).getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw TypeError("You must supply a name when creating a logger.");var e=r[t];return e||(e=r[t]=new h(t,o.methodFactory)),e};var d=typeof window!==e?window.log:void 0;return o.noConflict=function(){return typeof window!==e&&window.log===o&&(window.log=d),o},o.getLoggers=function(){return r},o.default=o,o},tc.exports?tc.exports=i():th.log=i()),tc.exports));var tf=function(t,e){return(tf=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function tp(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}tf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function tm(t,e){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=(r=o.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function tv(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ty(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function tg(t,e,n){if(n||2==arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}function tb(t){return this instanceof tb?(this.v=t,this):new tb(t)}function tw(t){return"function"==typeof t}function tx(t){var e=t(function(t){Error.call(t),t.stack=Error().stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var tS=tx(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
2
- `+e.map(function(t,e){return e+1+") "+t.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=e}});function tT(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var tP=function(){var t;function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o){if(this._parentage=null,Array.isArray(o))try{for(var s=tv(o),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this)}var l=this.initialTeardown;if(tw(l))try{l()}catch(t){r=t instanceof tS?t.errors:[t]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var c=tv(u),h=c.next();!h.done;h=c.next()){var d=h.value;try{tk(d)}catch(t){r=r??[],t instanceof tS?r=tg(tg([],ty(r)),ty(t.errors)):r.push(t)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}if(r)throw new tS(r)}},e.prototype.add=function(t){var n;if(t&&t!==this){if(this.closed)tk(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}}},e.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},e.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},e.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&tT(e,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&tT(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),tE=tP.EMPTY;function tA(t){return t instanceof tP||t&&"closed"in t&&tw(t.remove)&&tw(t.add)&&tw(t.unsubscribe)}function tk(t){tw(t)?t():t.unsubscribe()}var tC={Promise:void 0},tM=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,tg([t,e],ty(n)))};function tR(t){tM(function(){throw t})}function tD(){}var tV=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,tA(e)&&e.add(n)):n.destination=tI,n}return tp(e,t),e.create=function(t,e,n){return new tO(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(tP),tL=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){tR(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){tR(t)}else tR(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){tR(t)}},t}(),tO=function(t){function e(e,n,i){var r,o=t.call(this)||this;return r=tw(e)||!e?{next:e??void 0,error:n??void 0,complete:i??void 0}:e,o.destination=new tL(r),o}return tp(e,t),e}(tV),tI={closed:!0,next:tD,error:function(t){throw t},complete:tD},tj="function"==typeof Symbol&&Symbol.observable||"@@observable";function tF(t){return t}var tN=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var i,r,o,s=(i=t)&&i instanceof tV||i&&tw(i.next)&&tw(i.error)&&tw(i.complete)&&tA(i)?t:new tO(t,e,n);return r=this.operator,o=this.source,s.add(r?r.call(s,o):o?this._subscribe(s):this._trySubscribe(s)),s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=tB(e))(function(e,i){var r=new tO({next:function(e){try{t(e)}catch(t){i(t),r.unsubscribe()}},error:i,complete:e});n.subscribe(r)})},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[tj]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0===t.length?tF:1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=tB(t))(function(t,n){var i;e.subscribe(function(t){return i=t},function(t){return n(t)},function(){return t(i)})})},t.create=function(e){return new t(e)},t}();function tB(t){var e;return null!==(e=t??tC.Promise)&&void 0!==e?e:Promise}function tU(t){return function(e){if(tw(null==e?void 0:e.lift))return e.lift(function(e){try{return t(e,this)}catch(t){this.error(t)}});throw TypeError("Unable to lift unknown Observable type")}}function t_(t,e,n,i,r){return new t$(t,e,n,i,r)}var t$=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=r?function(t){try{r(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=i?function(){try{i()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return tp(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),n||null===(e=this.onFinalize)||void 0===e||e.call(this)}},e}(tV),tz=tx(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),tQ=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return tp(e,t),e.prototype.lift=function(t){var e=new tW(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new tz},e.prototype.next=function(t){var e=this;(function(){var n,i;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var r=tv(e.currentObservers),o=r.next();!o.done;o=r.next())o.value.next(t)}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}})()},e.prototype.error=function(t){var e=this;(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}})()},e.prototype.complete=function(){var t=this;(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})()},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this.hasError,i=this.isStopped,r=this.observers;return n||i?tE:(this.currentObservers=null,r.push(t),new tP(function(){e.currentObservers=null,tT(r,t)}))},e.prototype._checkFinalizedStatuses=function(t){var e=this.hasError,n=this.thrownError,i=this.isStopped;e?t.error(n):i&&t.complete()},e.prototype.asObservable=function(){var t=new tN;return t.source=this,t},e.create=function(t,e){return new tW(t,e)},e}(tN),tW=function(t){function e(e,n){var i=t.call(this)||this;return i.destination=e,i.source=n,i}return tp(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:tE},e}(tQ),tH=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return tp(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n.closed||e.next(this._value),n},e.prototype.getValue=function(){var t=this.hasError,e=this.thrownError,n=this._value;if(t)throw e;return this._throwIfClosed(),n},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(tQ),tY=function(){return Date.now()},tq=function(t){function e(e,n){return t.call(this)||this}return tp(e,t),e.prototype.schedule=function(t,e){return this},e}(tP),tX={setInterval:function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setInterval.apply(void 0,tg([t,e],ty(n)))},clearInterval:function(t){return clearInterval(t)}},tK=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.pending=!1,i}return tp(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n,i=this.id,r=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(r,i,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),tX.setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&tX.clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,i=!1;try{this.work(t)}catch(t){i=!0,n=t||Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,i=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,tT(i,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(tq),tG=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=tY,t}();function tZ(t){var e;return(e=t[t.length-1])&&tw(e.schedule)?t.pop():void 0}new(function(t){function e(e,n){void 0===n&&(n=tG.now);var i=t.call(this,e,n)||this;return i.actions=[],i._active=!1,i}return tp(e,t),e.prototype.flush=function(t){var e,n=this.actions;if(this._active){n.push(t);return}this._active=!0;do if(e=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,e){for(;t=n.shift();)t.unsubscribe();throw e}},e}(tG))(tK);var tJ=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function t0(t){return tw(null==t?void 0:t.then)}function t1(t){return Symbol.asyncIterator&&tw(null==t?void 0:t[Symbol.asyncIterator])}function t5(t){return TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var t2="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function t3(t){return tw(null==t?void 0:t[t2])}function t7(t){return function(t,e,n){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(t,e||[]),o=[];return i=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(t){return function(e){return Promise.resolve(e).then(t,u)}}),i[Symbol.asyncIterator]=function(){return this},i;function s(t,e){r[t]&&(i[t]=function(e){return new Promise(function(n,i){o.push([t,e,n,i])>1||a(t,e)})},e&&(i[t]=e(i[t])))}function a(t,e){try{var n;(n=r[t](e)).value instanceof tb?Promise.resolve(n.value.v).then(l,u):c(o[0][2],n)}catch(t){c(o[0][3],t)}}function l(t){a("next",t)}function u(t){a("throw",t)}function c(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}(this,arguments,function(){var e,n,i;return tm(this,function(r){switch(r.label){case 0:e=t.getReader(),r.label=1;case 1:r.trys.push([1,,9,10]),r.label=2;case 2:return[4,tb(e.read())];case 3:return i=(n=r.sent()).value,n.done?[4,tb(void 0)]:[3,5];case 4:return[2,r.sent()];case 5:return[4,tb(i)];case 6:return[4,r.sent()];case 7:return r.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function t6(t){return tw(null==t?void 0:t.getReader)}function t4(t){if(t instanceof tN)return t;if(null!=t){if(tw(t[tj]))return new tN(function(e){var n=t[tj]();if(tw(n.subscribe))return n.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")});if(tJ(t))return new tN(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()});if(t0(t))return new tN(function(e){t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,tR)});if(t1(t))return t9(t);if(t3(t))return new tN(function(e){var n,i;try{for(var r=tv(t),o=r.next();!o.done;o=r.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}e.complete()});if(t6(t))return t9(t7(t))}throw t5(t)}function t9(t){return new tN(function(e){(function(t,e){var n,i,r,o,s,a,l,u;return s=this,a=void 0,l=void 0,u=function(){var s;return tm(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),n=function(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=tv(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise(function(i,r){(function(t,e,n,i){Promise.resolve(i).then(function(e){t({value:e,done:n})},e)})(i,r,(e=t[n](e)).done,e.value)})}}}(t),a.label=1;case 1:return[4,n.next()];case 2:if((i=a.sent()).done)return[3,4];if(s=i.value,e.next(s),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return r={error:a.sent()},[3,11];case 6:return a.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(r)throw r.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})},new(l||(l=Promise))(function(t,e){function n(t){try{r(u.next(t))}catch(t){e(t)}}function i(t){try{r(u.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):((r=e.value)instanceof l?r:new l(function(t){t(r)})).then(n,i)}r((u=u.apply(s,a||[])).next())})})(t,e).catch(function(t){return e.error(t)})})}function t8(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=!1);var o=e.schedule(function(){n(),r?t.add(this.schedule(null,i)):this.unsubscribe()},i);if(t.add(o),!r)return o}function et(t,e){return void 0===e&&(e=0),tU(function(n,i){n.subscribe(t_(i,function(n){return t8(i,t,function(){return i.next(n)},e)},function(){return t8(i,t,function(){return i.complete()},e)},function(n){return t8(i,t,function(){return i.error(n)},e)}))})}function ee(t,e){return void 0===e&&(e=0),tU(function(n,i){i.add(t.schedule(function(){return n.subscribe(i)},e))})}function en(t,e){if(!t)throw Error("Iterable cannot be null");return new tN(function(n){t8(n,e,function(){var i=t[Symbol.asyncIterator]();t8(n,e,function(){i.next().then(function(t){t.done?n.complete():n.next(t.value)})},0,!0)})})}function ei(t,e){return tU(function(n,i){var r=0;n.subscribe(t_(i,function(n){i.next(t.call(e,n,r++))}))})}function er(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(function t(e,n,i){return void 0===i&&(i=1/0),tw(n)?t(function(t,i){return ei(function(e,r){return n(t,e,i,r)})(t4(e(t,i)))},i):("number"==typeof n&&(i=n),tU(function(t,n){var r,o,s,a,l,u,c;return r=i,o=[],s=0,a=0,l=!1,u=function(){!l||o.length||s||n.complete()},c=function(t){s++;var i=!1;t4(e(t,a++)).subscribe(t_(n,function(t){n.next(t)},function(){i=!0},void 0,function(){if(i)try{for(s--;o.length&&s<r;)!function(){var t=o.shift();c(t)}();u()}catch(t){n.error(t)}}))},t.subscribe(t_(n,function(t){return s<r?c(t):o.push(t)},function(){l=!0,u()})),function(){}}))})(tF,1)((t=tZ(e))?function(t,e){if(null!=t){if(tw(t[tj]))return t4(t).pipe(ee(e),et(e));if(tJ(t))return new tN(function(n){var i=0;return e.schedule(function(){i===t.length?n.complete():(n.next(t[i++]),n.closed||this.schedule())})});if(t0(t))return t4(t).pipe(ee(e),et(e));if(t1(t))return en(t,e);if(t3(t))return new tN(function(n){var i;return t8(n,e,function(){i=t[t2](),t8(n,e,function(){var t,e,r;try{e=(t=i.next()).value,r=t.done}catch(t){n.error(t);return}r?n.complete():n.next(e)},0,!0)}),function(){return tw(null==i?void 0:i.return)&&i.return()}});if(t6(t))return en(t7(t),e)}throw t5(t)}(e,t):t4(e))}function eo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tZ(t);return tU(function(e,i){(n?er(t,e,n):er(t,e)).subscribe(i)})}tx(function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}});var es=Object.defineProperty,ea=Object.defineProperties,el=Object.getOwnPropertyDescriptors,eu=Object.getOwnPropertySymbols,ec=Object.prototype.hasOwnProperty,eh=Object.prototype.propertyIsEnumerable,ed=(t,e,n)=>e in t?es(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ef=(t,e)=>{for(var n in e||(e={}))ec.call(e,n)&&ed(t,n,e[n]);if(eu)for(var n of eu(e))eh.call(e,n)&&ed(t,n,e[n]);return t},ep=(t,e)=>ea(t,el(e)),em=(t,e,n)=>new Promise((i,r)=>{var o=t=>{try{a(n.next(t))}catch(t){r(t)}},s=t=>{try{a(n.throw(t))}catch(t){r(t)}},a=t=>t.done?i(t.value):Promise.resolve(t.value).then(o,s);a((n=n.apply(t,e)).next())});function ev(t){var e;return!(typeof t>"u")&&(!!t&&t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("track")&&"u">typeof(null==(e=t.publication)?void 0:e.track)||!!t&&t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("publication")&&"u">typeof t.publication)}function ey(t){if("string"==typeof t||"number"==typeof t)return`${t}`;if(t&&t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&typeof t.publication>"u")return`${t.participant.identity}_${t.source}_placeholder`;if(ev(t))return`${t.participant.identity}_${t.publication.source}_${t.publication.trackSid}`;throw Error(`Can't generate a id for the given track reference: ${t}`)}function eg(t,e,n){return function(t,e,n,i){void 0===i&&(i={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:h=!1}=i,d=H(t),f=r||o?[...d?z(d):[],...z(e)]:[];f.forEach(t=>{r&&t.addEventListener("scroll",n,{passive:!0}),o&&t.addEventListener("resize",n)});let p=d&&u?function(t,e){let n=null,i,r=R(t);function o(){var t;clearTimeout(i),null==(t=n)||t.disconnect(),n=null}return function s(u,h){void 0===u&&(u=!1),void 0===h&&(h=1),o();let d=t.getBoundingClientRect(),{left:f,top:p,width:m,height:v}=d;if(u||e(),!m||!v)return;let y=c(p),g={rootMargin:-y+"px "+-c(r.clientWidth-(f+m))+"px "+-c(r.clientHeight-(p+v))+"px "+-c(f)+"px",threshold:l(0,a(1,h))||1},b=!0;function w(e){let n=e[0].intersectionRatio;if(n!==h){if(!b)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==n||to(d,t.getBoundingClientRect())||s(),b=!1}try{n=new IntersectionObserver(w,{...g,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,g)}n.observe(t)}(!0),o}(d,n):null,m=-1,v=null;s&&(v=new ResizeObserver(t=>{let[i]=t;i&&i.target===d&&v&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var t;null==(t=v)||t.observe(e)})),n()}),d&&!h&&v.observe(d),v.observe(e));let y,g=h?K(t):null;return h&&function e(){let i=K(t);g&&!to(g,i)&&n(),g=i,y=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach(t=>{r&&t.removeEventListener("scroll",n),o&&t.removeEventListener("resize",n)}),null==p||p(),null==(t=v)||t.disconnect(),v=null,h&&cancelAnimationFrame(y)}}(t,e,()=>em(this,null,function*(){var i,r;let{x:o,y:s}=yield ts(t,e,{placement:"top",middleware:[{name:"offset",options:6,async fn(t){var e,n;let{x:i,y:r,placement:o,middlewareData:s}=t,a=await A(t,6);return o===(null==(e=s.offset)?void 0:e.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:o}}}},(void 0===i&&(i={}),{name:"flip",options:i,async fn(t){var e,n,r,o,s;let{placement:a,middlewareData:l,rects:u,initialPlacement:c,platform:h,elements:d}=t,{mainAxis:f=!0,crossAxis:S=!0,fallbackPlacements:T,fallbackStrategy:P="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:k=!0,...C}=p(i,t);if(null!=(e=l.arrow)&&e.alignmentOffset)return{};let M=m(a),R=b(c),D=m(c)===c,V=await (null==h.isRTL?void 0:h.isRTL(d.floating)),L=T||(D||!k?[x(c)]:function(t){let e=x(t);return[w(t),e,w(e)]}(c)),O="none"!==A;!T&&O&&L.push(...function(t,e,n,i){let r=v(t),o=function(t,e,n){let i=["left","right"],r=["right","left"];switch(t){case"top":case"bottom":return n?e?r:i:e?i:r;case"left":case"right":return e?["top","bottom"]:["bottom","top"];default:return[]}}(m(t),"start"===n,i);return r&&(o=o.map(t=>t+"-"+r),e&&(o=o.concat(o.map(w)))),o}(c,k,A,V));let I=[c,...L],j=await E(t,C),F=[],N=(null==(n=l.flip)?void 0:n.overflows)||[];if(f&&F.push(j[M]),S){let t=function(t,e,n){void 0===n&&(n=!1);let i=v(t),r=y(b(t)),o=g(r),s="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=x(s)),[s,x(s)]}(a,u,V);F.push(j[t[0]],j[t[1]])}if(N=[...N,{placement:a,overflows:F}],!F.every(t=>t<=0)){let t=((null==(r=l.flip)?void 0:r.index)||0)+1,e=I[t];if(e)return{data:{index:t,overflows:N},reset:{placement:e}};let n=null==(o=N.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:o.placement;if(!n)switch(P){case"bestFit":{let t=null==(s=N.filter(t=>{if(O){let e=b(t.placement);return e===R||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:s[0];t&&(n=t);break}case"initialPlacement":n=c}if(a!==n)return{reset:{placement:n}}}return{}}}),{name:"shift",options:r={padding:5},async fn(t){let{x:e,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:u={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=p(r,t),h={x:e,y:n},d=await E(t,c),f=b(m(i)),v=y(f),g=h[v],w=h[f];if(o){let t="y"===v?"top":"left",e="y"===v?"bottom":"right",n=g+d[t],i=g-d[e];g=l(n,a(g,i))}if(s){let t="y"===f?"top":"left",e="y"===f?"bottom":"right",n=w+d[t],i=w-d[e];w=l(n,a(w,i))}let x=u.fn({...t,[v]:g,[f]:w});return{...x,data:{x:x.x-e,y:x.y-n,enabled:{[v]:o,[f]:s}}}}}]});null==n||n(o,s)}))}function eb(t,e){return!t.contains(e.target)}var ew=[o.TQ.ConnectionStateChanged,o.TQ.RoomMetadataChanged,o.TQ.ActiveSpeakersChanged,o.TQ.ConnectionQualityChanged,o.TQ.ParticipantConnected,o.TQ.ParticipantDisconnected,o.TQ.ParticipantPermissionsChanged,o.TQ.ParticipantMetadataChanged,o.TQ.ParticipantNameChanged,o.TQ.ParticipantAttributesChanged,o.TQ.TrackMuted,o.TQ.TrackUnmuted,o.TQ.TrackPublished,o.TQ.TrackUnpublished,o.TQ.TrackStreamStateChanged,o.TQ.TrackSubscriptionFailed,o.TQ.TrackSubscriptionPermissionChanged,o.TQ.TrackSubscriptionStatusChanged,o.TQ.LocalTrackPublished,o.TQ.LocalTrackUnpublished],ex=[o.dd.TrackPublished,o.dd.TrackUnpublished,o.dd.TrackMuted,o.dd.TrackUnmuted,o.dd.TrackStreamStateChanged,o.dd.TrackSubscribed,o.dd.TrackUnsubscribed,o.dd.TrackSubscriptionPermissionChanged,o.dd.TrackSubscriptionFailed,o.dd.LocalTrackPublished,o.dd.LocalTrackUnpublished],eS=(o.dd.ConnectionQualityChanged,o.dd.IsSpeakingChanged,o.dd.ParticipantMetadataChanged,o.dd.ParticipantPermissionsChanged,o.dd.TrackMuted,o.dd.TrackUnmuted,o.dd.TrackPublished,o.dd.TrackUnpublished,o.dd.TrackStreamStateChanged,o.dd.TrackSubscriptionFailed,o.dd.TrackSubscriptionPermissionChanged,o.dd.TrackSubscriptionStatusChanged,o.dd.LocalTrackPublished,o.dd.LocalTrackUnpublished,td.getLogger("lk-components-js"));function eT(t,e){var n;return ep(ef({},t),{receivedAtMediaTimestamp:null!=(n=e.rtpTimestamp)?n:0,receivedAt:e.timestamp})}function eP(t,e,n){return[...t,...e].reduceRight((t,e)=>(t.find(t=>t.id===e.id)||t.unshift(e),t),[]).slice(0-n)}function eE(t){return"object"==typeof t}function eA(t){return Array.isArray(t)&&t.filter(eE).length>0}function ek(t){return`lk-${t}`}function eC(t){let e=eM(t),n=eF(t.participant).pipe(ei(()=>eM(t)),eo(e));return{className:ek(t.source===o.fQ.Source.Camera||t.source===o.fQ.Source.ScreenShare?"participant-media-video":"participant-media-audio"),trackObserver:n}}function eM(t){if(ev(t))return t.publication;{let{source:e,name:n,participant:i}=t;if(e&&n)return i.getTrackPublications().find(t=>t.source===e&&t.trackName===n);if(n)return i.getTrackPublicationByName(n);if(e)return i.getTrackPublication(e);throw Error("At least one of source and name needs to be defined")}}function eR(t,...e){return new tN(n=>{let i=()=>{n.next(t)};return e.forEach(e=>{t.on(e,i)}),()=>{e.forEach(e=>{t.off(e,i)})}}).pipe(eo(t))}function eD(t,e){return new tN(n=>{let i=(...t)=>{n.next(t)};return t.on(e,i),()=>{t.off(e,i)}})}function eV(t){return eD(t,o.TQ.ConnectionStateChanged).pipe(ei(([t])=>t),eo(t.state))}function eL(t,e,n=!0){return er(new tN(i=>{o.du.getLocalDevices(t,n).then(t=>{i.next(t),i.complete()}).catch(t=>{null==e||e(t),i.next([]),i.complete()})}),new tN(i=>{var r;let s=()=>em(this,null,function*(){try{let e=yield o.du.getLocalDevices(t,n);i.next(e)}catch(t){null==e||e(t)}});if("u">typeof window){if(!window.isSecureContext)throw Error("Accessing media devices is available only in secure contexts (HTTPS and localhost), in some or all supporting browsers. See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices");null==(r=null==navigator?void 0:navigator.mediaDevices)||r.addEventListener("devicechange",s)}return()=>{var t;null==(t=null==navigator?void 0:navigator.mediaDevices)||t.removeEventListener("devicechange",s)}}))}function eO(t){return eR(t,o.TQ.AudioPlaybackStatusChanged).pipe(ei(t=>({canPlayAudio:t.canPlaybackAudio})))}function eI(t){return eR(t,o.TQ.VideoPlaybackStatusChanged).pipe(ei(t=>({canPlayVideo:t.canPlaybackVideo})))}function ej(t,...e){return new tN(n=>{let i=()=>{n.next(t)};return e.forEach(e=>{t.on(e,i)}),()=>{e.forEach(e=>{t.off(e,i)})}}).pipe(eo(t))}function eF(t){return ej(t,o.dd.TrackMuted,o.dd.TrackUnmuted,o.dd.ParticipantPermissionsChanged,o.dd.TrackPublished,o.dd.TrackUnpublished,o.dd.LocalTrackPublished,o.dd.LocalTrackUnpublished,o.dd.MediaDevicesError,o.dd.TrackSubscriptionStatusChanged).pipe(ei(t=>{let{isMicrophoneEnabled:e,isCameraEnabled:n,isScreenShareEnabled:i}=t,r=t.getTrackPublication(o.fQ.Source.Microphone);return{isCameraEnabled:n,isMicrophoneEnabled:e,isScreenShareEnabled:i,cameraTrack:t.getTrackPublication(o.fQ.Source.Camera),microphoneTrack:r,participant:t}}))}function eN(t,e){return new tN(n=>{let i=(...t)=>{n.next(t)};return t.on(e,i),()=>{t.off(e,i)}})}function eB(t,e={}){var n;let i;let r=new tN(t=>(i=t,()=>a.unsubscribe())).pipe(eo(Array.from(t.remoteParticipants.values()))),s=null!=(n=e.additionalRoomEvents)?n:ew,a=eR(t,...Array.from(new Set([o.TQ.ParticipantConnected,o.TQ.ParticipantDisconnected,o.TQ.ConnectionStateChanged,...s]))).subscribe(t=>null==i?void 0:i.next(Array.from(t.remoteParticipants.values())));return t.remoteParticipants.size>0&&(null==i||i.next(Array.from(t.remoteParticipants.values()))),r}function eU(t){return eN(t,o.dd.ParticipantPermissionsChanged).pipe(ei(()=>t.permissions),eo(t.permissions))}function e_(t){return typeof t>"u"?new tN:eN(t,o.dd.AttributesChanged).pipe(ei(([e])=>({changed:e,attributes:t.attributes})),eo({changed:t.attributes,attributes:t.attributes}))}function e$(t,e,n,i,r){let{localParticipant:s}=e,a=(t,e)=>{let n=!1;switch(t){case o.fQ.Source.Camera:n=e.isCameraEnabled;break;case o.fQ.Source.Microphone:n=e.isMicrophoneEnabled;break;case o.fQ.Source.ScreenShare:n=e.isScreenShareEnabled}return n},l=eF(s).pipe(ei(e=>a(t,e.participant)),eo(a(t,s))),u=new tQ;return{className:ek("button"),toggle:(e,a)=>em(this,null,function*(){try{switch(a??(a=n),u.next(!0),t){case o.fQ.Source.Camera:return yield s.setCameraEnabled(e??!s.isCameraEnabled,a,i),s.isCameraEnabled;case o.fQ.Source.Microphone:return yield s.setMicrophoneEnabled(e??!s.isMicrophoneEnabled,a,i),s.isMicrophoneEnabled;case o.fQ.Source.ScreenShare:return yield s.setScreenShareEnabled(e??!s.isScreenShareEnabled,a,i),s.isScreenShareEnabled;default:throw TypeError("Tried to toggle unsupported source")}}catch(t){if(r&&t instanceof Error){null==r||r(t);return}throw t}finally{u.next(!1)}}),enabledObserver:l,pendingObserver:u.asObservable()}}function ez(){let t=!1,e=new tQ,n=new tQ;return{className:ek("button"),toggle:i=>em(this,null,function*(){n.next(!0),t=i??!t,e.next(t),n.next(!1)}),enabledObserver:e.asObservable(),pendingObserver:n.asObservable()}}function eQ(t,e,n){var i;let r=new tH(void 0),s=eD(e,o.TQ.ActiveDeviceChanged).pipe((i=([e])=>e===t,tU(function(t,e){var n=0;t.subscribe(t_(e,function(t){return i.call(void 0,t,n++)&&e.next(t)}))})),ei(([t,e])=>(eS.debug("activeDeviceObservable | RoomEvent.ActiveDeviceChanged",{kind:t,deviceId:e}),e)));return{className:ek("media-device-select"),activeDeviceObservable:s,setActiveMediaDevice:(n,...i)=>em(this,[n,...i],function*(n,i={}){var s,a,l;if(e){let u;eS.debug(`Switching active device of kind "${t}" with id ${n}.`),yield e.switchActiveDevice(t,n,i.exact);let c=null!=(s=e.getActiveDevice(t))?s:n;c!==n&&"default"!==n&&eS.info(`We tried to select the device with id (${n}), but the browser decided to select the device with id (${c}) instead.`),"audioinput"===t?u=null==(a=e.localParticipant.getTrackPublication(o.fQ.Source.Microphone))?void 0:a.track:"videoinput"===t&&(u=null==(l=e.localParticipant.getTrackPublication(o.fQ.Source.Camera))?void 0:l.track);let h="default"===n&&!u||"default"===n&&(null==u?void 0:u.mediaStreamTrack.label.startsWith("Default"));r.next(h?n:c)}})}}function eW(t){return{className:ek("disconnect-button"),disconnect:e=>{t.disconnect(e)}}}function eH(){return{className:ek("start-audio-button"),roomAudioPlaybackAllowedObservable:eO,handleStartAudioPlayback:t=>em(this,null,function*(){eS.info("Start Audio for room: ",t),yield t.startAudio()})}}function eY(){return{className:ek("start-audio-button"),roomVideoPlaybackAllowedObservable:eI,handleStartVideoPlayback:t=>em(this,null,function*(){eS.info("Start Video for room: ",t),yield t.startVideo()})}}function eq(t,e,n=!0){let i=[t.localParticipant,...Array.from(t.remoteParticipants.values())],r=[];return i.forEach(t=>{e.forEach(e=>{let i=Array.from(t.trackPublications.values()).filter(t=>t.source===e&&(!n||t.track)).map(e=>({participant:t,publication:e,source:e.source}));r.push(...i)})}),{trackReferences:r,participants:i}}function eX(t,e,n=!1){let{sources:i,kind:r,name:o}=e;return Array.from(t.trackPublications.values()).filter(t=>(!i||i.includes(t.source))&&(!r||t.kind===r)&&(!o||t.trackName===o)&&(!n||t.track)).map(e=>({participant:t,publication:e,source:e.source}))}function eK(t,e,n){var i,r;let s=null!=(i=n.additionalRoomEvents)?i:ew,a=null==(r=n.onlySubscribed)||r;return eR(t,...Array.from(new Set([o.TQ.ParticipantConnected,o.TQ.ParticipantDisconnected,o.TQ.ConnectionStateChanged,o.TQ.LocalTrackPublished,o.TQ.LocalTrackUnpublished,o.TQ.TrackPublished,o.TQ.TrackUnpublished,o.TQ.TrackSubscriptionStatusChanged,...s]).values())).pipe(ei(t=>{let n=eq(t,e,a);return eS.debug(`TrackReference[] was updated. (length ${n.trackReferences.length})`,n),n}),eo(eq(t,e,a)))}function eG(t,e){return ej(t,...ex).pipe(ei(t=>{let n=eX(t,e);return eS.debug(`TrackReference[] was updated. (length ${n.length})`,n),n}),eo(eX(t,e)))}function eZ(t,e){return new tN(n=>{let i=(...t)=>{n.next(t)};return t.on(e,i),()=>{t.off(e,i)}})}function eJ(t){return eZ(t,o.vN.TranscriptionReceived)}function e0(t){return eZ(t,o.vN.TimeSyncUpdate).pipe(ei(([t])=>t))}eS.setDefaultLevel("WARN");var e1={videoEnabled:!0,audioEnabled:!0,videoDeviceId:"default",audioDeviceId:"default",username:""},{load:e5,save:e2}=(r="lk-user-choices",{load:()=>(function(t){if(typeof localStorage>"u"){eS.error("Local storage is not available.");return}try{let e=localStorage.getItem(t);if(!e){eS.warn(`Item with key ${t} does not exist in local storage.`);return}return JSON.parse(e)}catch(t){eS.error(`Error getting item from local storage: ${t}`);return}})(r),save:t=>(function(t,e){if(typeof localStorage>"u"){eS.error("Local storage is not available.");return}try{if(e){let n=Object.fromEntries(Object.entries(e).filter(([,t])=>""!==t));localStorage.setItem(t,JSON.stringify(n))}}catch(t){eS.error(`Error setting item to local storage: ${t}`)}})(r,t)});function e3(t,e=!1){!0!==e&&e2(t)}function e7(t,e=!1){var n,i,r,o,s;let a={videoEnabled:null!=(n=null==t?void 0:t.videoEnabled)?n:e1.videoEnabled,audioEnabled:null!=(i=null==t?void 0:t.audioEnabled)?i:e1.audioEnabled,videoDeviceId:null!=(r=null==t?void 0:t.videoDeviceId)?r:e1.videoDeviceId,audioDeviceId:null!=(o=null==t?void 0:t.audioDeviceId)?o:e1.audioDeviceId,username:null!=(s=null==t?void 0:t.username)?s:e1.username};if(e)return a;{let t=e5();return ef(ef({},a),t??{})}}s.createContext(void 0);let e6=s.createContext(void 0);function e4(){return s.useContext(e6)}function e9(t){let e=e4(),n=t??e;if(!n)throw Error("No TrackRef, make sure you are inside a TrackRefContext or pass the TrackRef explicitly");return n}let e8=s.createContext(void 0);function nt(){return s.useContext(e8)}let ne=s.createContext(void 0);function nn(){let t=s.useContext(ne);if(!t)throw Error("tried to access room context outside of livekit room component");return t}function ni(){return s.useContext(ne)}function nr(t){let e=ni(),n=t??e;if(!n)throw Error("No room provided, make sure you are inside a Room context or pass the room explicitly");return n}s.createContext(void 0)},7933:function(t,e,n){"use strict";n.d(e,{A:function(){return h},C:function(){return c},U:function(){return P},V:function(){return A},c:function(){return u},e:function(){return d},f:function(){return p},g:function(){return m},h:function(){return v},s:function(){return x},t:function(){return y},x:function(){return g}});var i=n(2265),r=n(9426),o=n(1318),s=n(3819);function a(t,e,n=!0){let[r,o]=i.useState(e);return i.useEffect(()=>{if(n&&o(e),typeof window>"u"||!t)return;let i=t.subscribe(o);return()=>i.unsubscribe()},[t,n]),r}function l(t){let e=(0,r.u)(t);return a(i.useMemo(()=>(0,r.e)(e),[e]),e.state)}function u(t){let e=(0,r.f)(),n=l(e);return{buttonProps:i.useMemo(()=>{let{className:i,disconnect:a}=(0,r.h)(e);return(0,o.m)(t,{className:i,onClick:()=>a(t.stopTracks??!0),disabled:n===s.em.Disconnected})},[e,t,n])}}function c(t={}){let e=(0,r.u)(t.room),[n,o]=i.useState(e.localParticipant),[s,a]=i.useState(n.isMicrophoneEnabled),[l,u]=i.useState(n.isCameraEnabled),[c,h]=i.useState(n.isScreenShareEnabled),[d,f]=i.useState(n.lastMicrophoneError),[p,m]=i.useState(n.lastCameraError),[v,y]=i.useState(void 0),[g,b]=i.useState(void 0),w=t=>{u(t.isCameraEnabled),a(t.isMicrophoneEnabled),h(t.isScreenShareEnabled),b(t.cameraTrack),y(t.microphoneTrack),f(t.participant.lastMicrophoneError),m(t.participant.lastCameraError),o(t.participant)};return i.useEffect(()=>{let t=(0,r.t)(e.localParticipant).subscribe(w);return()=>t.unsubscribe()},[e]),{isMicrophoneEnabled:s,isScreenShareEnabled:c,isCameraEnabled:l,microphoneTrack:v,cameraTrack:g,lastMicrophoneError:d,lastCameraError:p,localParticipant:n}}function h(){let t=(0,r.f)();return a(i.useMemo(()=>(0,r.v)(t.localParticipant),[t]),t.localParticipant.permissions)}function d({kind:t,room:e,track:n,requestPermissions:o,onError:l}){let u=(0,r.w)(),c=i.useMemo(()=>e??u??new s.du,[e,u]),h=a(i.useMemo(()=>(0,r.x)(t,l,o),[t,o,l]),[]),[d,f]=i.useState((null==c?void 0:c.getActiveDevice(t))??"default"),{className:p,activeDeviceObservable:m,setActiveMediaDevice:v}=i.useMemo(()=>(0,r.y)(t,c),[t,c,n]);return i.useEffect(()=>{let t=m.subscribe(t=>{t&&(r.l.info("setCurrentDeviceId",t),f(t))});return()=>{null==t||t.unsubscribe()}},[m]),{devices:h,className:p,activeDeviceId:d,setActiveMediaDevice:v}}function f(t={}){let e=(0,r.u)(t.room),[n,o]=i.useState([]);return i.useEffect(()=>{let n=(0,r.E)(e,{additionalRoomEvents:t.updateOnlyOn}).subscribe(o);return()=>n.unsubscribe()},[e,JSON.stringify(t.updateOnlyOn)]),n}function p({room:t,props:e}){let n=(0,r.u)(t),{className:s,roomAudioPlaybackAllowedObservable:l,handleStartAudioPlayback:u}=i.useMemo(()=>(0,r.N)(),[]),{canPlayAudio:c}=a(i.useMemo(()=>l(n),[n,l]),{canPlayAudio:n.canPlaybackAudio});return{mergedProps:i.useMemo(()=>(0,o.m)(e,{className:s,onClick:()=>{u(n)},style:{display:c?"none":"block"}}),[e,s,c,u,n]),canPlayAudio:c}}function m({room:t,props:e}){let n=(0,r.u)(t),{className:s,roomVideoPlaybackAllowedObservable:l,handleStartVideoPlayback:u}=i.useMemo(()=>(0,r.O)(),[]),{canPlayVideo:c}=a(i.useMemo(()=>l(n),[n,l]),{canPlayVideo:n.canPlaybackVideo});return{mergedProps:i.useMemo(()=>(0,o.m)(e,{className:s,onClick:()=>{u(n)},style:{display:c?"none":"block"}}),[e,s,c,u,n]),canPlayVideo:c}}function v({source:t,onChange:e,initialState:n,captureOptions:s,publishOptions:l,onDeviceError:u,...c}){var h;let d=(0,r.w)(),f=null==(h=null==d?void 0:d.localParticipant)?void 0:h.getTrackPublication(t),p=i.useRef(!1),{toggle:m,className:v,pendingObserver:y,enabledObserver:g}=i.useMemo(()=>d?(0,r.S)(t,d,s,l,u):(0,r.T)(),[d,t,JSON.stringify(s),l]),b=a(y,!1),w=a(g,n??!!(null!=f&&f.isEnabled));i.useEffect(()=>{null==e||e(w,p.current),p.current=!1},[w,e]),i.useEffect(()=>{void 0!==n&&(r.l.debug("forcing initial toggle state",t,n),m(n))},[]);let x=i.useMemo(()=>(0,o.m)(c,{className:v}),[c,v]),S=i.useCallback(t=>{var e;p.current=!0,m().catch(()=>p.current=!1),null==(e=c.onClick)||e.call(c,t)},[c,m]);return{toggle:m,enabled:w,pending:b,track:f,buttonProps:{...x,"aria-pressed":w,"data-lk-source":t,"data-lk-enabled":w,disabled:b,onClick:S}}}function y(t=[s.fQ.Source.Camera,s.fQ.Source.Microphone,s.fQ.Source.ScreenShare,s.fQ.Source.ScreenShareAudio,s.fQ.Source.Unknown],e={}){let n=(0,r.u)(e.room),[o,a]=i.useState([]),[l,u]=i.useState([]),c=i.useMemo(()=>t.map(t=>(0,r.U)(t)?t.source:t),[JSON.stringify(t)]);return i.useEffect(()=>{let t=(0,r.V)(n,c,{additionalRoomEvents:e.updateOnlyOn,onlySubscribed:e.onlySubscribed}).subscribe(({trackReferences:t,participants:e})=>{r.l.debug("setting track bundles",t,e),a(t),u(e)});return()=>t.unsubscribe()},[n,JSON.stringify(e.onlySubscribed),JSON.stringify(e.updateOnlyOn),JSON.stringify(t)]),i.useMemo(()=>{if(!(0,r.W)(t))return o;{let e=function(t,e){let n=new Map;if((0,r.W)(t)){let i=t.filter(t=>t.withPlaceholder).map(t=>t.source);e.forEach(t=>{let e=t.getTrackPublications().map(t=>{var e;return null==(e=t.track)?void 0:e.source}).filter(t=>void 0!==t),r=Array.from(function(t,e){let n=new Set(t);for(let t of e)n.delete(t);return n}(new Set(i),new Set(e)));r.length>0&&n.set(t.identity,r)})}return n}(t,l),n=Array.from(o);return l.forEach(t=>{e.has(t.identity)&&(e.get(t.identity)??[]).forEach(e=>{o.find(({participant:n,publication:i})=>t.identity===n.identity&&i.source===e)||(r.l.debug(`Add ${e} placeholder for participant ${t.identity}.`),n.push({participant:t,source:e}))})}),n}},[o,l,t])}function g(t={}){let[e,n]=i.useState((0,r._)(t.defaults,t.preventLoad??!1)),o=i.useCallback(t=>{n(e=>({...e,audioEnabled:t}))},[]),s=i.useCallback(t=>{n(e=>({...e,videoEnabled:t}))},[]),a=i.useCallback(t=>{n(e=>({...e,audioDeviceId:t}))},[]),l=i.useCallback(t=>{n(e=>({...e,videoDeviceId:t}))},[]),u=i.useCallback(t=>{n(e=>({...e,username:t}))},[]);return i.useEffect(()=>{(0,r.$)(e,t.preventSave??!1)},[e,t.preventSave]),{userChoices:e,saveAudioInputEnabled:o,saveVideoInputEnabled:s,saveAudioInputDeviceId:a,saveVideoInputDeviceId:l,saveUsername:u}}let b=t=>{let e=t=>Math.sqrt(1- -1*Math.max(-100,Math.min(-10,t))/100);return t.map(t=>t===-1/0?0:e(t))},w={bands:5,loPass:100,hiPass:600,updateInterval:32,analyserOptions:{fftSize:2048}};function x(t,e={}){var n;let r=t instanceof s.fQ?t:null==(n=null==t?void 0:t.publication)?void 0:n.track,o={...w,...e},[a,l]=i.useState(Array(o.bands).fill(0));return i.useEffect(()=>{if(!r||!(null!=r&&r.mediaStream))return;let{analyser:t,cleanup:n}=(0,s.OE)(r,o.analyserOptions),i=new Float32Array(t.frequencyBinCount),a=setInterval(()=>{t.getFloatFrequencyData(i);let n=new Float32Array(i.length);for(let t=0;t<i.length;t++)n[t]=i[t];let r=b(n=n.slice(e.loPass,e.hiPass)),s=Math.ceil(r.length/o.bands),a=[];for(let t=0;t<o.bands;t++){let e=r.slice(t*s,(t+1)*s).reduce((t,e)=>t+=e,0);a.push(e/s)}l(a)},o.updateInterval);return()=>{n(),clearInterval(a)}},[r,null==r?void 0:r.mediaStream,JSON.stringify(e)]),a}function S(t,e){let n=(0,r.B)(),o=f({updateOnlyOn:[]}),s=i.useMemo(()=>e?o.find(t=>t.identity===e):n,[e,o,n]);return a(i.useMemo(()=>{if(s)return(0,r.a2)(s,{sources:t})},[s,JSON.stringify(t)]),[])}let T={bufferSize:100};function P(t,e){var n,o,s;let l={...T,...e},[u,c]=i.useState([]),h=a(i.useMemo(()=>{var e;return null!=(e=null==t?void 0:t.publication)&&e.track?(0,r.a3)(null==t?void 0:t.publication.track):void 0},[null==(n=null==t?void 0:t.publication)?void 0:n.track]),{timestamp:Date.now(),rtpTimestamp:null==(s=null==(o=null==t?void 0:t.publication)?void 0:o.track)?void 0:s.rtpTimestamp}),d=t=>{var e;null==(e=l.onTranscription)||e.call(l,t),c(e=>(0,r.a5)(e,t.map(t=>(0,r.a6)(t,h)),l.bufferSize))};return i.useEffect(()=>{if(!(null!=t&&t.publication))return;let e=(0,r.a4)(t.publication).subscribe(t=>{d(...t)});return()=>{e.unsubscribe()}},[t&&(0,r.p)(t),d]),{segments:u}}let E="lk.agent.state";function A(){let t=f(),e=t.find(t=>t.kind===s.nC.AGENT&&!("lk.publish_on_behalf"in t.attributes)),n=t.find(t=>t.kind===s.nC.AGENT&&t.attributes["lk.publish_on_behalf"]===(null==e?void 0:e.identity)),o=S([s.fQ.Source.Microphone,s.fQ.Source.Camera],null==e?void 0:e.identity),u=S([s.fQ.Source.Microphone,s.fQ.Source.Camera],null==n?void 0:n.identity),c=o.find(t=>t.source===s.fQ.Source.Microphone)??u.find(t=>t.source===s.fQ.Source.Microphone),h=o.find(t=>t.source===s.fQ.Source.Camera)??u.find(t=>t.source===s.fQ.Source.Camera),{segments:d}=P(c),p=l(),{attributes:m}=function(t={}){let e=(0,r.B)(),n=t.participant??e;return a(i.useMemo(()=>(0,r.a7)(n),[n]),{attributes:null==n?void 0:n.attributes})}({participant:e}),v=i.useMemo(()=>p===s.em.Disconnected?"disconnected":p!==s.em.Connecting&&e&&null!=m&&m[E]?m[E]:"connecting",[m,e,p]);return{agent:e,state:v,audioTrack:c,videoTrack:h,agentTranscriptions:d,agentAttributes:m}}},168:function(t,e,n){"use strict";n.d(e,{P6:function(){return c}});var i=n(2265),r=n(1318),o=n(2297),s=n(7933),a=n(9426),l=n(3819);function u({kind:t,initialSelection:e,onActiveDeviceChange:n,tracks:r,requestPermissions:s=!1,...l}){let[u,c]=i.useState(!1),[h,d]=i.useState([]),[f,p]=i.useState(!0),[m,v]=i.useState(s),y=(t,e)=>{a.l.debug("handle device change"),c(!1),null==n||n(t,e)},g=i.useRef(null),b=i.useRef(null);i.useLayoutEffect(()=>{u&&v(!0)},[u]),i.useLayoutEffect(()=>{let t;return g.current&&b.current&&(h||f)&&(t=(0,a.ao)(g.current,b.current,(t,e)=>{b.current&&Object.assign(b.current.style,{left:`${t}px`,top:`${e}px`})})),p(!1),()=>{null==t||t()}},[g,b,h,f]);let w=i.useCallback(t=>{b.current&&t.target!==g.current&&u&&(0,a.ap)(b.current,t)&&c(!1)},[u,b,g]);return i.useEffect(()=>(document.addEventListener("click",w),()=>{document.removeEventListener("click",w)}),[w]),i.createElement(i.Fragment,null,i.createElement("button",{className:"lk-button lk-button-menu","aria-pressed":u,...l,onClick:()=>c(!u),ref:g},l.children),!l.disabled&&i.createElement("div",{className:"lk-device-menu",ref:b,style:{visibility:u?"visible":"hidden"}},t?i.createElement(o.M,{initialSelection:e,onActiveDeviceChange:e=>y(t,e),onDeviceListChange:d,kind:t,track:null==r?void 0:r[t],requestPermissions:m}):i.createElement(i.Fragment,null,i.createElement("div",{className:"lk-device-menu-heading"},"Audio inputs"),i.createElement(o.M,{kind:"audioinput",onActiveDeviceChange:t=>y("audioinput",t),onDeviceListChange:d,track:null==r?void 0:r.audioinput,requestPermissions:m}),i.createElement("div",{className:"lk-device-menu-heading"},"Video inputs"),i.createElement(o.M,{kind:"videoinput",onActiveDeviceChange:t=>y("videoinput",t),onDeviceListChange:d,track:null==r?void 0:r.videoinput,requestPermissions:m}))))}function c({controls:t,saveUserChoices:e=!0,onDeviceError:n,...a}){let c={leave:!0,microphone:!0,...t},h=(0,s.A)(),{microphoneTrack:d,localParticipant:f}=(0,s.C)(),p=i.useMemo(()=>({participant:f,source:l.fQ.Source.Microphone,publication:d}),[f,d]);h?c.microphone??(c.microphone=h.canPublish):c.microphone=!1;let m=(0,r.a)({className:"lk-agent-control-bar"},a),{saveAudioInputEnabled:v,saveAudioInputDeviceId:y}=(0,s.x)({preventSave:!e}),g=i.useCallback((t,e)=>{e&&v(t)},[v]);return i.createElement("div",{...m},c.microphone&&i.createElement("div",{className:"lk-button-group"},i.createElement(o.T,{source:l.fQ.Source.Microphone,showIcon:!0,onChange:g,onDeviceError:t=>null==n?void 0:n({source:l.fQ.Source.Microphone,error:t})},i.createElement(o.B,{trackRef:p,barCount:7,options:{minHeight:5}})),i.createElement("div",{className:"lk-button-group-menu"},i.createElement(u,{kind:"audioinput",onActiveDeviceChange:(t,e)=>y(e??"default")}))),c.leave&&i.createElement(o.D,null,"Disconnect"),i.createElement(o.f,null))}},1318:function(t,e,n){"use strict";n.d(e,{a:function(){return a},c:function(){return l},m:function(){return o}});var i=n(2265);function r(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=function t(e){var n,i,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e){if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(i=t(e[n]))&&(r&&(r+=" "),r+=i)}else for(i in e)e[i]&&(r&&(r+=" "),r+=i)}return r}(t))&&(i&&(i+=" "),i+=e);return i}function o(...t){let e={...t[0]};for(let n=1;n<t.length;n++){let i=t[n];for(let t in i){let n=e[t],o=i[t];"function"==typeof n&&"function"==typeof o&&"o"===t[0]&&"n"===t[1]&&t.charCodeAt(2)>=65&&90>=t.charCodeAt(2)?e[t]=function(...t){return(...e)=>{for(let n of t)if("function"==typeof n)try{n(...e)}catch(t){console.error(t)}}}(n,o):("className"===t||"UNSAFE_className"===t)&&"string"==typeof n&&"string"==typeof o?e[t]=r(n,o):e[t]=void 0!==o?o:n}}return e}function s(t){return void 0!==t}function a(...t){return o(...t.filter(s))}function l(t,e,n){return i.Children.map(t,o=>i.isValidElement(o)&&i.Children.only(t)?(o.props.className&&(e??(e={}),e.className=r(o.props.className,e.className),e.style={...o.props.style,...e.style}),i.cloneElement(o,{...e,key:n})):o)}n(3819),n(257)},8614:function(t,e,n){"use strict";n.d(e,{M:function(){return y}});var i=n(7437),r=n(2265),o=n(8881),s=n(3576),a=n(4252),l=n(5750);class u extends r.Component{getSnapshotBeforeUpdate(t){let e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){let t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function c(t){let{children:e,isPresent:n}=t,o=(0,r.useId)(),s=(0,r.useRef)(null),a=(0,r.useRef)({width:0,height:0,top:0,left:0}),{nonce:c}=(0,r.useContext)(l._);return(0,r.useInsertionEffect)(()=>{let{width:t,height:e,top:i,left:r}=a.current;if(n||!s.current||!t||!e)return;s.current.dataset.motionPopId=o;let l=document.createElement("style");return c&&(l.nonce=c),document.head.appendChild(l),l.sheet&&l.sheet.insertRule('\n [data-motion-pop-id="'.concat(o,'"] {\n position: absolute !important;\n width: ').concat(t,"px !important;\n height: ").concat(e,"px !important;\n top: ").concat(i,"px !important;\n left: ").concat(r,"px !important;\n }\n ")),()=>{document.head.removeChild(l)}},[n]),(0,i.jsx)(u,{isPresent:n,childRef:s,sizeRef:a,children:r.cloneElement(e,{ref:s})})}let h=t=>{let{children:e,initial:n,isPresent:o,onExitComplete:l,custom:u,presenceAffectsLayout:h,mode:f}=t,p=(0,s.h)(d),m=(0,r.useId)(),v=(0,r.useCallback)(t=>{for(let e of(p.set(t,!0),p.values()))if(!e)return;l&&l()},[p,l]),y=(0,r.useMemo)(()=>({id:m,initial:n,isPresent:o,custom:u,onExitComplete:v,register:t=>(p.set(t,!1),()=>p.delete(t))}),h?[Math.random(),v]:[o,v]);return(0,r.useMemo)(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),r.useEffect(()=>{o||p.size||!l||l()},[o]),"popLayout"===f&&(e=(0,i.jsx)(c,{isPresent:o,children:e})),(0,i.jsx)(a.O.Provider,{value:y,children:e})};function d(){return new Map}var f=n(9637);let p=t=>t.key||"";function m(t){let e=[];return r.Children.forEach(t,t=>{(0,r.isValidElement)(t)&&e.push(t)}),e}var v=n(1534);let y=t=>{let{children:e,custom:n,initial:a=!0,onExitComplete:l,presenceAffectsLayout:u=!0,mode:c="sync",propagate:d=!1}=t,[y,g]=(0,f.oO)(d),b=(0,r.useMemo)(()=>m(e),[e]),w=d&&!y?[]:b.map(p),x=(0,r.useRef)(!0),S=(0,r.useRef)(b),T=(0,s.h)(()=>new Map),[P,E]=(0,r.useState)(b),[A,k]=(0,r.useState)(b);(0,v.L)(()=>{x.current=!1,S.current=b;for(let t=0;t<A.length;t++){let e=p(A[t]);w.includes(e)?T.delete(e):!0!==T.get(e)&&T.set(e,!1)}},[A,w.length,w.join("-")]);let C=[];if(b!==P){let t=[...b];for(let e=0;e<A.length;e++){let n=A[e],i=p(n);w.includes(i)||(t.splice(e,0,n),C.push(n))}"wait"===c&&C.length&&(t=C),k(m(t)),E(b);return}let{forceRender:M}=(0,r.useContext)(o.p);return(0,i.jsx)(i.Fragment,{children:A.map(t=>{let e=p(t),r=(!d||!!y)&&(b===A||w.includes(e));return(0,i.jsx)(h,{isPresent:r,initial:(!x.current||!!a)&&void 0,custom:r?void 0:n,presenceAffectsLayout:u,mode:c,onExitComplete:r?void 0:()=>{if(!T.has(e))return;T.set(e,!0);let t=!0;T.forEach(e=>{e||(t=!1)}),t&&(null==M||M(),k(S.current),d&&(null==g||g()),l&&l())},children:t},e)})})}},9637:function(t,e,n){"use strict";n.d(e,{oO:function(){return o}});var i=n(2265),r=n(4252);function o(t=!0){let e=(0,i.useContext)(r.O);if(null===e)return[!0,null];let{isPresent:n,onExitComplete:o,register:s}=e,a=(0,i.useId)();(0,i.useEffect)(()=>{t&&s(a)},[t]);let l=(0,i.useCallback)(()=>t&&o&&o(a),[a,o,t]);return!n&&o?[!1,l]:[!0]}},8881:function(t,e,n){"use strict";n.d(e,{p:function(){return i}});let i=(0,n(2265).createContext)({})},5750:function(t,e,n){"use strict";n.d(e,{_:function(){return i}});let i=(0,n(2265).createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"})},4252:function(t,e,n){"use strict";n.d(e,{O:function(){return i}});let i=(0,n(2265).createContext)(null)},521:function(t,e,n){"use strict";let i;function r(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}n.d(e,{E:function(){return ov}});let o=t=>Array.isArray(t);function s(t,e){if(!Array.isArray(e))return!1;let n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function a(t){return"string"==typeof t||Array.isArray(t)}function l(t){let e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function u(t,e,n,i){if("function"==typeof e){let[r,o]=l(i);e=e(void 0!==n?n:t.custom,r,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[r,o]=l(i);e=e(void 0!==n?n:t.custom,r,o)}return e}function c(t,e,n){let i=t.getProps();return u(i,e,void 0!==n?n:i.custom,t)}let h=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],d=["initial",...h];function f(t){let e;return()=>(void 0===e&&(e=t()),e)}let p=f(()=>void 0!==window.ScrollTimeline);class m{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){let n=this.animations.map(n=>p()&&n.attachTimeline?n.attachTimeline(t):"function"==typeof e?e(n):void 0);return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class v extends m{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}function y(t,e){return t?t[e]||t.default||t:void 0}function g(t){let e=0,n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}function b(t){return"function"==typeof t}function w(t,e){t.timeline=e,t.onfinish=null}let x=t=>Array.isArray(t)&&"number"==typeof t[0],S={linearEasing:void 0},T=function(t,e){let n=f(t);return()=>{var t;return null!==(t=S[e])&&void 0!==t?t:n()}}(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),P=(t,e,n)=>{let i=e-t;return 0===i?1:(n-t)/i},E=(t,e,n=10)=>{let i="",r=Math.max(Math.round(e/n),2);for(let e=0;e<r;e++)i+=t(P(0,r-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`},A=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,k={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:A([0,.65,.55,1]),circOut:A([.55,0,1,.45]),backIn:A([.31,.01,.66,-.59]),backOut:A([.33,1.53,.69,.99])},C={x:!1,y:!1};function M(t,e){let n=function(t,e,n){if(t instanceof Element)return[t];if("string"==typeof t){let e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function R(t){return e=>{"touch"===e.pointerType||C.x||C.y||t(e)}}let D=(t,e)=>!!e&&(t===e||D(t,e.parentElement)),V=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,L=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),O=new WeakSet;function I(t){return e=>{"Enter"===e.key&&t(e)}}function j(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}let F=(t,e)=>{let n=t.currentTarget;if(!n)return;let i=I(()=>{if(O.has(n))return;j(n,"down");let t=I(()=>{j(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>j(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function N(t){return V(t)&&!(C.x||C.y)}let B=t=>1e3*t,U=t=>t/1e3,_=t=>t,$=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=new Set($),Q=new Set(["width","height","top","left","right","bottom",...$]),W=t=>!!(t&&"object"==typeof t&&t.mix&&t.toValue),H=t=>o(t)?t[t.length-1]||0:t,Y={skipAnimations:!1,useManualTiming:!1},q=["read","resolveKeyframes","update","preRender","render","postRender"];function X(t,e){let n=!1,i=!0,r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=q.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,r=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(s)}let l={schedule:(t,r=!1,s=!1)=>{let a=s&&i?e:n;return r&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(s=t,i){r=!0;return}i=!0,[e,n]=[n,e],e.forEach(a),e.clear(),i=!1,r&&(r=!1,l.process(t))}};return l}(o),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=s,f=()=>{let o=Y.useManualTiming?r.timestamp:performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(o-r.timestamp,40),1),r.timestamp=o,r.isProcessing=!0,a.process(r),l.process(r),u.process(r),c.process(r),h.process(r),d.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(f))},p=()=>{n=!0,i=!0,r.isProcessing||t(f)};return{schedule:q.reduce((t,e)=>{let i=s[e];return t[e]=(t,e=!1,r=!1)=>(n||p(),i.schedule(t,e,r)),t},{}),cancel:t=>{for(let e=0;e<q.length;e++)s[q[e]].cancel(t)},state:r,steps:s}}let{schedule:K,cancel:G,state:Z,steps:J}=X("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:_,!0);function tt(){i=void 0}let te={now:()=>(void 0===i&&te.set(Z.isProcessing||Y.useManualTiming?Z.timestamp:performance.now()),i),set:t=>{i=t,queueMicrotask(tt)}};function tn(t,e){-1===t.indexOf(e)&&t.push(e)}function ti(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}class tr{constructor(){this.subscriptions=[]}add(t){return tn(this.subscriptions,t),()=>ti(this.subscriptions,t)}notify(t,e,n){let i=this.subscriptions.length;if(i){if(1===i)this.subscriptions[0](t,e,n);else for(let r=0;r<i;r++){let i=this.subscriptions[r];i&&i(t,e,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let to=t=>!isNaN(parseFloat(t)),ts={current:void 0};class ta{constructor(t,e={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{let n=te.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=te.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=to(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new tr);let n=this.events[t].add(e);return"change"===t?()=>{n(),K.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ts.current&&ts.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=te.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),n?1e3/n*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tl(t,e){return new ta(t,e)}let tu=t=>!!(t&&t.getVelocity);function tc(t,e){let n=t.getValue("willChange");if(tu(n)&&n.add)return n.add(e)}let th=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),td="data-"+th("framerAppearId"),tf={current:!1},tp=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function tm(t,e,n,i){if(t===e&&n===i)return _;let r=e=>(function(t,e,n,i,r){let o,s;let a=0;do(o=tp(s=e+(n-e)/2,i,r)-t)>0?n=s:e=s;while(Math.abs(o)>1e-7&&++a<12);return s})(e,0,1,t,n);return t=>0===t||1===t?t:tp(r(t),e,i)}let tv=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ty=t=>e=>1-t(1-e),tg=tm(.33,1.53,.69,.99),tb=ty(tg),tw=tv(tb),tx=t=>(t*=2)<1?.5*tb(t):.5*(2-Math.pow(2,-10*(t-1))),tS=t=>1-Math.sin(Math.acos(t)),tT=ty(tS),tP=tv(tS),tE=t=>/^0[^.\s]+$/u.test(t),tA=(t,e,n)=>n>e?e:n<t?t:n,tk={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tC={...tk,transform:t=>tA(0,1,t)},tM={...tk,default:1},tR=t=>Math.round(1e5*t)/1e5,tD=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,tV=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tL=(t,e)=>n=>!!("string"==typeof n&&tV.test(n)&&n.startsWith(t)||e&&null!=n&&Object.prototype.hasOwnProperty.call(n,e)),tO=(t,e,n)=>i=>{if("string"!=typeof i)return i;let[r,o,s,a]=i.match(tD);return{[t]:parseFloat(r),[e]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},tI=t=>tA(0,255,t),tj={...tk,transform:t=>Math.round(tI(t))},tF={test:tL("rgb","red"),parse:tO("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+tj.transform(t)+", "+tj.transform(e)+", "+tj.transform(n)+", "+tR(tC.transform(i))+")"},tN={test:tL("#"),parse:function(t){let e="",n="",i="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:tF.transform},tB=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),tU=tB("deg"),t_=tB("%"),t$=tB("px"),tz=tB("vh"),tQ=tB("vw"),tW={...t_,parse:t=>t_.parse(t)/100,transform:t=>t_.transform(100*t)},tH={test:tL("hsl","hue"),parse:tO("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+t_.transform(tR(e))+", "+t_.transform(tR(n))+", "+tR(tC.transform(i))+")"},tY={test:t=>tF.test(t)||tN.test(t)||tH.test(t),parse:t=>tF.test(t)?tF.parse(t):tH.test(t)?tH.parse(t):tN.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?tF.transform(t):tH.transform(t)},tq=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,tX="number",tK="color",tG=/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 tZ(t){let e=t.toString(),n=[],i={color:[],number:[],var:[]},r=[],o=0,s=e.replace(tG,t=>(tY.test(t)?(i.color.push(o),r.push(tK),n.push(tY.parse(t))):t.startsWith("var(")?(i.var.push(o),r.push("var"),n.push(t)):(i.number.push(o),r.push(tX),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:s,indexes:i,types:r}}function tJ(t){return tZ(t).values}function t0(t){let{split:e,types:n}=tZ(t),i=e.length;return t=>{let r="";for(let o=0;o<i;o++)if(r+=e[o],void 0!==t[o]){let e=n[o];e===tX?r+=tR(t[o]):e===tK?r+=tY.transform(t[o]):r+=t[o]}return r}}let t1=t=>"number"==typeof t?0:t,t5={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(tD))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(tq))||void 0===n?void 0:n.length)||0)>0},parse:tJ,createTransformer:t0,getAnimatableNone:function(t){let e=tJ(t);return t0(t)(e.map(t1))}},t2=new Set(["brightness","contrast","saturate","opacity"]);function t3(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[i]=n.match(tD)||[];if(!i)return t;let r=n.replace(i,""),o=t2.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+r+")"}let t7=/\b([a-z-]*)\(.*?\)/gu,t6={...t5,getAnimatableNone:t=>{let e=t.match(t7);return e?e.map(t3).join(" "):t}},t4={...tk,transform:Math.round},t9={borderWidth:t$,borderTopWidth:t$,borderRightWidth:t$,borderBottomWidth:t$,borderLeftWidth:t$,borderRadius:t$,radius:t$,borderTopLeftRadius:t$,borderTopRightRadius:t$,borderBottomRightRadius:t$,borderBottomLeftRadius:t$,width:t$,maxWidth:t$,height:t$,maxHeight:t$,top:t$,right:t$,bottom:t$,left:t$,padding:t$,paddingTop:t$,paddingRight:t$,paddingBottom:t$,paddingLeft:t$,margin:t$,marginTop:t$,marginRight:t$,marginBottom:t$,marginLeft:t$,backgroundPositionX:t$,backgroundPositionY:t$,rotate:tU,rotateX:tU,rotateY:tU,rotateZ:tU,scale:tM,scaleX:tM,scaleY:tM,scaleZ:tM,skew:tU,skewX:tU,skewY:tU,distance:t$,translateX:t$,translateY:t$,translateZ:t$,x:t$,y:t$,z:t$,perspective:t$,transformPerspective:t$,opacity:tC,originX:tW,originY:tW,originZ:t$,zIndex:t4,size:t$,fillOpacity:tC,strokeOpacity:tC,numOctaves:t4},t8={...t9,color:tY,backgroundColor:tY,outlineColor:tY,fill:tY,stroke:tY,borderColor:tY,borderTopColor:tY,borderRightColor:tY,borderBottomColor:tY,borderLeftColor:tY,filter:t6,WebkitFilter:t6},et=t=>t8[t];function ee(t,e){let n=et(t);return n!==t6&&(n=t5),n.getAnimatableNone?n.getAnimatableNone(e):void 0}let en=new Set(["auto","none","0"]),ei=t=>t===tk||t===t$,er=(t,e)=>parseFloat(t.split(", ")[e]),eo=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;let r=i.match(/^matrix3d\((.+)\)$/u);if(r)return er(r[1],e);{let e=i.match(/^matrix\((.+)\)$/u);return e?er(e[1],t):0}},es=new Set(["x","y","z"]),ea=$.filter(t=>!es.has(t)),el={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:eo(4,13),y:eo(5,14)};el.translateX=el.x,el.translateY=el.y;let eu=new Set,ec=!1,eh=!1;function ed(){if(eh){let t=Array.from(eu).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{let e=function(t){let e=[];return ea.forEach(n=>{let i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=n.get(t);e&&e.forEach(([e,n])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}eh=!1,ec=!1,eu.forEach(t=>t.complete()),eu.clear()}function ef(){eu.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(eh=!0)})}class ep{constructor(t,e,n,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(eu.add(this),ec||(ec=!0,K.read(ef),K.resolveKeyframes(ed))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let r=0;r<t.length;r++)if(null===t[r]){if(0===r){let r=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==r)t[0]=r;else if(n&&e){let i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===r&&i.set(t[0])}else t[r]=t[r-1]}}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),eu.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,eu.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let em=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ev=t=>e=>"string"==typeof e&&e.startsWith(t),ey=ev("--"),eg=ev("var(--"),eb=t=>!!eg(t)&&ew.test(t.split("/*")[0].trim()),ew=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,eS=t=>e=>e.test(t),eT=[tk,t$,t_,tU,tQ,tz,{test:t=>"auto"===t,parse:t=>t}],eP=t=>eT.find(eS(t));class eE extends ep{constructor(t,e,n,i,r){super(t,e,n,i,r,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&eb(i=i.trim())){let r=function t(e,n,i=1){_(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=function(t){let e=ex.exec(t);if(!e)return[,];let[,n,i,r]=e;return[`--${null!=n?n:i}`,r]}(e);if(!r)return;let s=window.getComputedStyle(n).getPropertyValue(r);if(s){let t=s.trim();return em(t)?parseFloat(t):t}return eb(o)?t(o,n,i+1):o}(i,e.current);void 0!==r&&(t[n]=r),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Q.has(n)||2!==t.length)return;let[i,r]=t,o=eP(i),s=eP(r);if(o!==s){if(ei(o)&&ei(s))for(let e=0;e<t.length;e++){let n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++){var i;("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||tE(i))&&n.push(e)}n.length&&function(t,e,n){let i,r=0;for(;r<t.length&&!i;){let e=t[r];"string"==typeof e&&!en.has(e)&&tZ(e).values.length&&(i=t[r]),r++}if(i&&n)for(let r of e)t[r]=ee(n,i)}(t,n,e)}measureInitialState(){let{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=el[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;let i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;let{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;let r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);let o=i.length-1,s=i[o];i[o]=el[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}let eA=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(t5.test(t)||"0"===t)&&!t.startsWith("url(")),ek=t=>null!==t;function eC(t,{repeat:e,repeatType:n="loop"},i){let r=t.filter(ek),o=e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}class eM{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=te.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:r,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(ef(),ed()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=te.now(),this.hasAttemptedResolve=!0;let{name:n,type:i,velocity:r,delay:o,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,n,i){let r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;let o=t[t.length-1],s=eA(r,e),a=eA(o,e);return _(s===a,`You are trying to animate ${e} from "${r}" to "${o}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${o} via the \`style\` property.`),!!s&&!!a&&(function(t){let e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||b(n))&&i)}(t,n,i,r)){if(tf.current||!o){a&&a(eC(t,this.options,e)),s&&s(),this.resolveFinishedPromise();return}this.options.duration=0}let u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}let eR=(t,e,n)=>t+(e-t)*n;function eD(t,e,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?t+(e-t)*6*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function eV(t,e){return n=>n>0?e:t}let eL=(t,e,n)=>{let i=t*t,r=n*(e*e-i)+i;return r<0?0:Math.sqrt(r)},eO=[tN,tF,tH],eI=t=>eO.find(e=>e.test(t));function ej(t){let e=eI(t);if(_(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===tH&&(n=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let r=0,o=0,s=0;if(e/=100){let i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;r=eD(a,i,t+1/3),o=eD(a,i,t),s=eD(a,i,t-1/3)}else r=o=s=n;return{red:Math.round(255*r),green:Math.round(255*o),blue:Math.round(255*s),alpha:i}}(n)),n}let eF=(t,e)=>{let n=ej(t),i=ej(e);if(!n||!i)return eV(t,e);let r={...n};return t=>(r.red=eL(n.red,i.red,t),r.green=eL(n.green,i.green,t),r.blue=eL(n.blue,i.blue,t),r.alpha=eR(n.alpha,i.alpha,t),tF.transform(r))},eN=(t,e)=>n=>e(t(n)),eB=(...t)=>t.reduce(eN),eU=new Set(["none","hidden"]);function e_(t,e){return n=>eR(t,e,n)}function e$(t){return"number"==typeof t?e_:"string"==typeof t?eb(t)?eV:tY.test(t)?eF:eW:Array.isArray(t)?ez:"object"==typeof t?tY.test(t)?eF:eQ:eV}function ez(t,e){let n=[...t],i=n.length,r=t.map((t,n)=>e$(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=r[e](t);return n}}function eQ(t,e){let n={...t,...e},i={};for(let r in n)void 0!==t[r]&&void 0!==e[r]&&(i[r]=e$(t[r])(t[r],e[r]));return t=>{for(let e in i)n[e]=i[e](t);return n}}let eW=(t,e)=>{let n=t5.createTransformer(e),i=tZ(t),r=tZ(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?eU.has(t)&&!r.values.length||eU.has(e)&&!i.values.length?eU.has(t)?n=>n<=0?t:e:n=>n>=1?e:t:eB(ez(function(t,e){var n;let i=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){let s=e.types[o],a=t.indexes[s][r[s]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,r[s]++}return i}(i,r),r.values),n):(_(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),eV(t,e))};function eH(t,e,n){return"number"==typeof t&&"number"==typeof e&&"number"==typeof n?eR(t,e,n):e$(t)(t,e)}function eY(t,e,n){var i,r;let o=Math.max(e-5,0);return i=n-t(o),(r=e-o)?1e3/r*i:0}let eq={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 eX(t,e){return t*Math.sqrt(1-e*e)}let eK=["duration","bounce"],eG=["stiffness","damping","mass"];function eZ(t,e){return e.some(e=>void 0!==t[e])}function eJ(t=eq.visualDuration,e=eq.bounce){let n;let i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:r,restDelta:o}=i,s=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:s},{stiffness:u,damping:c,mass:h,duration:d,velocity:f,isResolvedFromDuration:p}=function(t){let e={velocity:eq.velocity,stiffness:eq.stiffness,damping:eq.damping,mass:eq.mass,isResolvedFromDuration:!1,...t};if(!eZ(t,eG)&&eZ(t,eK)){if(t.visualDuration){let n=2*Math.PI/(1.2*t.visualDuration),i=n*n,r=2*tA(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:eq.mass,stiffness:i,damping:r}}else{let n=function({duration:t=eq.duration,bounce:e=eq.bounce,velocity:n=eq.velocity,mass:i=eq.mass}){let r,o;_(t<=B(eq.maxDuration),"Spring duration must be 10 seconds or less");let s=1-e;s=tA(eq.minDamping,eq.maxDamping,s),t=tA(eq.minDuration,eq.maxDuration,U(t)),s<1?(r=e=>{let i=e*s,r=i*t;return .001-(i-n)/eX(e,s)*Math.exp(-r)},o=e=>{let i=e*s*t,o=Math.pow(s,2)*Math.pow(e,2)*t,a=eX(Math.pow(e,2),s);return(i*n+n-o)*Math.exp(-i)*(-r(e)+.001>0?-1:1)/a}):(r=e=>-.001+Math.exp(-e*t)*((e-n)*t+1),o=e=>t*t*(n-e)*Math.exp(-e*t));let a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(r,o,5/t);if(t=B(t),isNaN(a))return{stiffness:eq.stiffness,damping:eq.damping,duration:t};{let e=Math.pow(a,2)*i;return{stiffness:e,damping:2*s*Math.sqrt(i*e),duration:t}}}(t);(e={...e,...n,mass:eq.mass}).isResolvedFromDuration=!0}}return e}({...i,velocity:-U(i.velocity||0)}),m=f||0,v=c/(2*Math.sqrt(u*h)),y=a-s,b=U(Math.sqrt(u/h)),w=5>Math.abs(y);if(r||(r=w?eq.restSpeed.granular:eq.restSpeed.default),o||(o=w?eq.restDelta.granular:eq.restDelta.default),v<1){let t=eX(b,v);n=e=>a-Math.exp(-v*b*e)*((m+v*b*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}else if(1===v)n=t=>a-Math.exp(-b*t)*(y+(m+b*y)*t);else{let t=b*Math.sqrt(v*v-1);n=e=>{let n=Math.exp(-v*b*e),i=Math.min(t*e,300);return a-n*((m+v*b*y)*Math.sinh(i)+t*y*Math.cosh(i))/t}}let x={calculatedDuration:p&&d||null,next:t=>{let e=n(t);if(p)l.done=t>=d;else{let i=0;v<1&&(i=0===t?B(m):eY(n,t,e));let s=Math.abs(i)<=r,u=Math.abs(a-e)<=o;l.done=s&&u}return l.value=l.done?a:e,l},toString:()=>{let t=Math.min(g(x),2e4),e=E(e=>x.next(t*e).value,t,30);return t+"ms "+e}};return x}function e0({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){let h,d;let f=t[0],p={done:!1,value:f},m=t=>void 0!==a&&t<a||void 0!==l&&t>l,v=t=>void 0===a?l:void 0===l?a:Math.abs(a-t)<Math.abs(l-t)?a:l,y=n*e,g=f+y,b=void 0===s?g:s(g);b!==g&&(y=b-f);let w=t=>-y*Math.exp(-t/i),x=t=>b+w(t),S=t=>{let e=w(t),n=x(t);p.done=Math.abs(e)<=u,p.value=p.done?b:n},T=t=>{m(p.value)&&(h=t,d=eJ({keyframes:[p.value,v(p.value)],velocity:eY(x,t,p.value),damping:r,stiffness:o,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return(d||void 0!==h||(e=!0,S(t),T(t)),void 0!==h&&t>=h)?d.next(t-h):(e||S(t),p)}}}let e1=tm(.42,0,1,1),e5=tm(0,0,.58,1),e2=tm(.42,0,.58,1),e3=t=>Array.isArray(t)&&"number"!=typeof t[0],e7={linear:_,easeIn:e1,easeInOut:e2,easeOut:e5,circIn:tS,circInOut:tP,circOut:tT,backIn:tb,backInOut:tw,backOut:tg,anticipate:tx},e6=t=>{if(x(t)){_(4===t.length,"Cubic bezier arrays must contain four numerical values.");let[e,n,i,r]=t;return tm(e,n,i,r)}return"string"==typeof t?(_(void 0!==e7[t],`Invalid easing type '${t}'`),e7[t]):t};function e4({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){let r=e3(i)?i.map(e6):e6(i),o={done:!1,value:e[0]},s=function(t,e,{clamp:n=!0,ease:i,mixer:r}={}){let o=t.length;if(_(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];let s=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=function(t,e,n){let i=[],r=n||eH,o=t.length-1;for(let n=0;n<o;n++){let o=r(t[n],t[n+1]);e&&(o=eB(Array.isArray(e)?e[n]||_:e,o)),i.push(o)}return i}(e,i,r),l=a.length,u=n=>{if(s&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);let r=P(t[i],t[i+1],n);return a[i](r)};return n?e=>u(tA(t[0],t[o-1],e)):u}((n&&n.length===e.length?n:function(t){let e=[0];return function(t,e){let n=t[t.length-1];for(let i=1;i<=e;i++){let r=P(0,e,i);t.push(eR(n,1,r))}}(e,t.length-1),e}(e)).map(e=>e*t),e,{ease:Array.isArray(r)?r:e.map(()=>r||e2).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(o.value=s(e),o.done=e>=t,o)}}let e9=t=>{let e=({timestamp:e})=>t(e);return{start:()=>K.update(e,!0),stop:()=>G(e),now:()=>Z.isProcessing?Z.timestamp:te.now()}},e8={decay:e0,inertia:e0,tween:e4,keyframes:e4,spring:eJ},nt=t=>t/100;class ne extends eM{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:t}=this.options;t&&t()};let{name:e,motionValue:n,element:i,keyframes:r}=this.options,o=(null==i?void 0:i.KeyframeResolver)||ep;this.resolver=new o(r,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let e,n;let{type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:a=0}=this.options,l=b(i)?i:e8[i]||e4;l!==e4&&"number"!=typeof t[0]&&(e=eB(nt,eH(t[0],t[1])),t=[0,100]);let u=l({...this.options,keyframes:t});"mirror"===s&&(n=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),null===u.calculatedDuration&&(u.calculatedDuration=g(u));let{calculatedDuration:c}=u,h=c+o;return{generator:u,mirroredGenerator:n,mapPercentToKeyframes:e,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(r+1)-o}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){let{resolved:n}=this;if(!n){let{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}let{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return r.next(0);let{delay:h,repeat:d,repeatType:f,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let v=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let g=this.currentTime,b=r;if(d){let t=Math.min(this.currentTime,u)/c,e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,(e=Math.min(e,d+1))%2&&("reverse"===f?(n=1-n,p&&(n-=p/c)):"mirror"===f&&(b=o)),g=tA(0,1,n)*c}let w=y?{done:!1,value:a[0]}:b.next(g);s&&(w.value=s(w.value));let{done:x}=w;y||null===l||(x=this.speed>=0?this.currentTime>=u:this.currentTime<=0);let S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&void 0!==i&&(w.value=eC(a,this.options,i)),m&&m(w.value),S&&this.finish(),w}get duration(){let{resolved:t}=this;return t?U(t.calculatedDuration):0}get time(){return U(this.currentTime)}set time(t){t=B(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=U(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=e9,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();let i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}let nn=new Set(["opacity","clipPath","filter","transform"]),ni=f(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),nr={anticipate:tx,backInOut:tw,circInOut:tP};class no extends eM{constructor(t){super(t);let{name:e,motionValue:n,element:i,keyframes:r}=this.options;this.resolver=new eE(r,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:i=300,times:r,ease:o,type:s,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if("string"==typeof o&&T()&&o in nr&&(o=nr[o]),b((n=this.options).type)||"spring"===n.type||!function t(e){return!!("function"==typeof e&&T()||!e||"string"==typeof e&&(e in k||T())||x(e)||Array.isArray(e)&&e.every(t))}(n.ease)){let{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,c=function(t,e){let n=new ne({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0}),i={done:!1,value:t[0]},r=[],o=0;for(;!i.done&&o<2e4;)r.push((i=n.sample(o)).value),o+=10;return{times:void 0,keyframes:r,duration:o-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),i=c.duration,r=c.times,o=c.ease,s="keyframes"}let c=function(t,e,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeInOut",times:l}={}){let u={[e]:n};l&&(u.offset=l);let c=function t(e,n){if(e)return"function"==typeof e&&T()?E(e,n):x(e)?A(e):Array.isArray(e)?e.map(e=>t(e,n)||k.easeOut):k[e]}(a,r);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:i,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,t,{...this.options,duration:i,times:r,ease:o});return c.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(w(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:n}=this.options;a.set(eC(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:i,times:r,type:s,ease:o,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:e}=t;return U(e)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:e}=t;return U(e.currentTime||0)}set time(t){let{resolved:e}=this;if(!e)return;let{animation:n}=e;n.currentTime=B(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:e}=t;return e.playbackRate}set speed(t){let{resolved:e}=this;if(!e)return;let{animation:n}=e;n.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:e}=t;return e.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){let{resolved:e}=this;if(!e)return _;let{animation:n}=e;w(n,t)}else this.pendingTimeline=t;return _}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:e,keyframes:n,duration:i,type:r,ease:o,times:s}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){let{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new ne({...u,keyframes:n,duration:i,type:r,ease:o,times:s,isGenerator:!0}),h=B(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}let{onStop:a}=this.options;a&&a(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:e,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return!1;let{onUpdate:a,transformTemplate:l}=e.owner.getProps();return ni()&&n&&nn.has(n)&&!a&&!l&&!i&&"mirror"!==r&&0!==o&&"inertia"!==s}}let ns={type:"spring",stiffness:500,damping:25,restSpeed:10},na=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),nl={type:"keyframes",duration:.8},nu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nc=(t,{keyframes:e})=>e.length>2?nl:z.has(t)?t.startsWith("scale")?na(e[1]):ns:nu,nh=(t,e,n,i={},r,o)=>s=>{let a=y(i,t)||{},l=a.delay||i.delay||0,{elapsed:u=0}=i;u-=B(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:r};!function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(a)&&(c={...c,...nc(t,c)}),c.duration&&(c.duration=B(c.duration)),c.repeatDelay&&(c.repeatDelay=B(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if(!1!==c.type&&(0!==c.duration||c.repeatDelay)||(c.duration=0,0!==c.delay||(h=!0)),(tf.current||Y.skipAnimations)&&(h=!0,c.duration=0,c.delay=0),h&&!o&&void 0!==e.get()){let t=eC(c.keyframes,a);if(void 0!==t)return K.update(()=>{c.onUpdate(t),c.onComplete()}),new v([])}return!o&&no.supports(c)?new no(c):new ne(c)};function nd(t,e,{delay:n=0,transitionOverride:i,type:r}={}){var o;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(s=i);let u=[],h=r&&t.animationState&&t.animationState.getState()[r];for(let e in l){let i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),r=l[e];if(void 0===r||h&&function({protectedKeys:t,needsAnimating:e},n){let i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}(h,e))continue;let a={delay:n,...y(s||{},e)},c=!1;if(window.MotionHandoffAnimation){let n=t.props[td];if(n){let t=window.MotionHandoffAnimation(n,e,K);null!==t&&(a.startTime=t,c=!0)}}tc(t,e),i.start(nh(e,i,r,t.shouldReduceMotion&&Q.has(e)?{type:!1}:a,t,c));let d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{K.update(()=>{a&&function(t,e){let{transitionEnd:n={},transition:i={},...r}=c(t,e)||{};for(let e in r={...r,...n}){let n=H(r[e]);t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,tl(n))}}(t,a)})}),u}function nf(t,e,n={}){var i;let r=c(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0),{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);let s=r?()=>Promise.all(nd(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{let{delayChildren:r=0,staggerChildren:s,staggerDirection:a}=o;return function(t,e,n=0,i=0,r=1,o){let s=[],a=(t.variantChildren.size-1)*i,l=1===r?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(np).forEach((t,i)=>{t.notify("AnimationStart",e),s.push(nf(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(s)}(t,e,r+i,s,a,n)}:()=>Promise.resolve(),{when:l}=o;if(!l)return Promise.all([s(),a(n.delay)]);{let[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(()=>e())}}function np(t,e){return t.sortNodePosition(e)}let nm=d.length,nv=[...h].reverse(),ny=h.length;function ng(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nb(){return{animate:ng(!0),whileInView:ng(),whileHover:ng(),whileTap:ng(),whileDrag:ng(),whileFocus:ng(),exit:ng()}}class nw{constructor(t){this.isMounted=!1,this.node=t}update(){}}class nx extends nw{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>(function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e))i=Promise.all(e.map(e=>nf(t,e,n)));else if("string"==typeof e)i=nf(t,e,n);else{let r="function"==typeof e?c(t,e,n.custom):e;i=Promise.all(nd(t,r,n))}return i.then(()=>{t.notify("AnimationComplete",e)})})(t,e,n))),n=nb(),i=!0,l=e=>(n,i)=>{var r;let o=c(t,i,"exit"===e?null===(r=t.presenceContext)||void 0===r?void 0:r.custom:void 0);if(o){let{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function u(u){let{props:c}=t,h=function t(e){if(!e)return;if(!e.isControllingVariants){let n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}let n={};for(let t=0;t<nm;t++){let i=d[t],r=e.props[i];(a(r)||!1===r)&&(n[i]=r)}return n}(t.parent)||{},f=[],p=new Set,m={},v=1/0;for(let e=0;e<ny;e++){var y;let d=nv[e],g=n[d],b=void 0!==c[d]?c[d]:h[d],w=a(b),x=d===u?g.isActive:null;!1===x&&(v=e);let S=b===h[d]&&b!==c[d]&&w;if(S&&i&&t.manuallyAnimateOnMount&&(S=!1),g.protectedKeys={...m},!g.isActive&&null===x||!b&&!g.prevProp||r(b)||"boolean"==typeof b)continue;let T=(y=g.prevProp,"string"==typeof b?b!==y:!!Array.isArray(b)&&!s(b,y)),P=T||d===u&&g.isActive&&!S&&w||e>v&&w,E=!1,A=Array.isArray(b)?b:[b],k=A.reduce(l(d),{});!1===x&&(k={});let{prevResolvedValues:C={}}=g,M={...C,...k},R=e=>{P=!0,p.has(e)&&(E=!0,p.delete(e)),g.needsAnimating[e]=!0;let n=t.getValue(e);n&&(n.liveStyle=!1)};for(let t in M){let e=k[t],n=C[t];if(!m.hasOwnProperty(t))(o(e)&&o(n)?s(e,n):e===n)?void 0!==e&&p.has(t)?R(t):g.protectedKeys[t]=!0:null!=e?R(t):p.add(t)}g.prevProp=b,g.prevResolvedValues=k,g.isActive&&(m={...m,...k}),i&&t.blockInitialAnimation&&(P=!1);let D=!(S&&T)||E;P&&D&&f.push(...A.map(t=>({animation:t,options:{type:d}})))}if(p.size){let e={};p.forEach(n=>{let i=t.getBaseTarget(n),r=t.getValue(n);r&&(r.liveStyle=!0),e[n]=null!=i?i:null}),f.push({animation:e})}let g=!!f.length;return i&&(!1===c.initial||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(g=!1),i=!1,g?e(f):Promise.resolve()}return{animateChanges:u,setActive:function(e,i){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;let o=u(e);for(let t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=nb(),i=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();r(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}let nS=0;class nT extends nw{constructor(){super(...arguments),this.id=nS++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;let i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>e(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}function nP(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function nE(t){return{point:{x:t.pageX,y:t.pageY}}}let nA=t=>e=>V(e)&&t(e,nE(e));function nk(t,e,n,i){return nP(t,e,nA(n),i)}let nC=(t,e)=>Math.abs(t-e);class nM{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let n=nV(this.lastMoveEventInfo,this.history),i=null!==this.startEvent,r=(t=n.offset,e={x:0,y:0},Math.sqrt(nC(t.x,e.x)**2+nC(t.y,e.y)**2)>=3);if(!i&&!r)return;let{point:o}=n,{timestamp:s}=Z;this.history.push({...o,timestamp:s});let{onStart:a,onMove:l}=this.handlers;i||(a&&a(this.lastMoveEvent,n),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,n)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=nR(e,this.transformPagePoint),K.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:n,onSessionEnd:i,resumeAnimation:r}=this.handlers;if(this.dragSnapToOrigin&&r&&r(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let o=nV("pointercancel"===t.type?this.lastMoveEventInfo:nR(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!V(t))return;this.dragSnapToOrigin=r,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;let o=nR(nE(t),this.transformPagePoint),{point:s}=o,{timestamp:a}=Z;this.history=[{...s,timestamp:a}];let{onSessionStart:l}=e;l&&l(t,nV(o,this.history)),this.removeListeners=eB(nk(this.contextWindow,"pointermove",this.handlePointerMove),nk(this.contextWindow,"pointerup",this.handlePointerUp),nk(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),G(this.updatePoint)}}function nR(t,e){return e?{point:e(t.point)}:t}function nD(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nV({point:t},e){return{point:t,delta:nD(t,nL(e)),offset:nD(t,e[0]),velocity:function(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null,r=nL(t);for(;n>=0&&(i=t[n],!(r.timestamp-i.timestamp>B(.1)));)n--;if(!i)return{x:0,y:0};let o=U(r.timestamp-i.timestamp);if(0===o)return{x:0,y:0};let s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}(e,0)}}function nL(t){return t[t.length-1]}function nO(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function nI(t){return t.max-t.min}function nj(t,e,n,i=.5){t.origin=i,t.originPoint=eR(e.min,e.max,t.origin),t.scale=nI(n)/nI(e),t.translate=eR(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function nF(t,e,n,i){nj(t.x,e.x,n.x,i?i.originX:void 0),nj(t.y,e.y,n.y,i?i.originY:void 0)}function nN(t,e,n){t.min=n.min+e.min,t.max=t.min+nI(e)}function nB(t,e,n){t.min=e.min-n.min,t.max=t.min+nI(e)}function nU(t,e,n){nB(t.x,e.x,n.x),nB(t.y,e.y,n.y)}function n_(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function n$(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function nz(t,e,n){return{min:nQ(t,e),max:nQ(t,n)}}function nQ(t,e){return"number"==typeof t?t:t[e]||0}let nW=()=>({translate:0,scale:1,origin:0,originPoint:0}),nH=()=>({x:nW(),y:nW()}),nY=()=>({min:0,max:0}),nq=()=>({x:nY(),y:nY()});function nX(t){return[t("x"),t("y")]}function nK({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function nG(t){return void 0===t||1===t}function nZ({scale:t,scaleX:e,scaleY:n}){return!nG(t)||!nG(e)||!nG(n)}function nJ(t){return nZ(t)||n0(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function n0(t){var e,n;return(e=t.x)&&"0%"!==e||(n=t.y)&&"0%"!==n}function n1(t,e,n,i,r){return void 0!==r&&(t=i+r*(t-i)),i+n*(t-i)+e}function n5(t,e=0,n=1,i,r){t.min=n1(t.min,e,n,i,r),t.max=n1(t.max,e,n,i,r)}function n2(t,{x:e,y:n}){n5(t.x,e.translate,e.scale,e.originPoint),n5(t.y,n.translate,n.scale,n.originPoint)}function n3(t,e){t.min=t.min+e,t.max=t.max+e}function n7(t,e,n,i,r=.5){let o=eR(t.min,t.max,r);n5(t,e,n,o,i)}function n6(t,e){n7(t.x,e.x,e.scaleX,e.scale,e.originX),n7(t.y,e.y,e.scaleY,e.scale,e.originY)}function n4(t,e){return nK(function(t,e){if(!e)return t;let n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}let n9=({current:t})=>t?t.ownerDocument.defaultView:null,n8=new WeakMap;class it{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nq(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let{dragSnapToOrigin:i}=this.getProps();this.panSession=new nM(t,{onSessionStart:t=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(nE(t).point)},onStart:(t,e)=>{let{drag:n,dragPropagation:i,onDragStart:r}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===n||"y"===n?C[n]?null:(C[n]=!0,()=>{C[n]=!1}):C.x||C.y?null:(C.x=C.y=!0,()=>{C.x=C.y=!1}),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nX(t=>{let e=this.getAxisMotionValue(t).get()||0;if(t_.test(e)){let{projection:n}=this.visualElement;if(n&&n.layout){let i=n.layout.layoutBox[t];if(i){let t=nI(i);e=parseFloat(e)/100*t}}}this.originPoint[t]=e}),r&&K.postRender(()=>r(t,e)),tc(this.visualElement,"transform");let{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{let{dragPropagation:n,dragDirectionLock:i,onDirectionLock:r,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:s}=e;if(i&&null===this.currentDirection){this.currentDirection=function(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}(s),null!==this.currentDirection&&r&&r(this.currentDirection);return}this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>nX(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:n9(this.visualElement)})}stop(t,e){let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:i}=e;this.startAnimation(i);let{onDragEnd:r}=this.getProps();r&&K.postRender(()=>r(t,e))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){let{drag:i}=this.getProps();if(!n||!ie(t,i,this.currentDirection))return;let r=this.getAxisMotionValue(t),o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?eR(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?eR(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){var t;let{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,r=this.constraints;e&&nO(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=function(t,{top:e,left:n,bottom:i,right:r}){return{x:n_(t.x,n,r),y:n_(t.y,e,i)}}(i.layoutBox,e):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:nz(t,"left","right"),y:nz(t,"top","bottom")}}(n),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&nX(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){let n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!nO(e))return!1;let i=e.current;_(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let o=function(t,e,n){let i=n4(t,n),{scroll:r}=e;return r&&(n3(i.x,r.offset.x),n3(i.y,r.offset.y)),i}(i,r.root,this.visualElement.getTransformPagePoint()),s={x:n$((t=r.layout.layoutBox).x,o.x),y:n$(t.y,o.y)};if(n){let t=n(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(s));this.hasMutatedConstraints=!!t,t&&(s=nK(t))}return s}startAnimation(t){let{drag:e,dragMomentum:n,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{};return Promise.all(nX(s=>{if(!ie(s,e,this.currentDirection))return;let l=a&&a[s]||{};o&&(l={min:0,max:0});let u={type:"inertia",velocity:n?t[s]:0,bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...r,...l};return this.startAxisValueAnimation(s,u)})).then(s)}startAxisValueAnimation(t,e){let n=this.getAxisMotionValue(t);return tc(this.visualElement,t),n.start(nh(t,n,0,e,this.visualElement,!1))}stopAnimation(){nX(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){nX(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){nX(e=>{let{drag:n}=this.getProps();if(!ie(e,n,this.currentDirection))return;let{projection:i}=this.visualElement,r=this.getAxisMotionValue(e);if(i&&i.layout){let{min:n,max:o}=i.layout.layoutBox[e];r.set(t[e]-eR(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!nO(e)||!n||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};nX(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){let n=e.get();i[t]=function(t,e){let n=.5,i=nI(t),r=nI(e);return r>i?n=P(e.min,e.max-i,t.min):i>r&&(n=P(t.min,t.max-r,e.min)),tA(0,1,n)}({min:n,max:n},this.constraints[t])}});let{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),nX(e=>{if(!ie(e,t,null))return;let n=this.getAxisMotionValue(e),{min:r,max:o}=this.constraints[e];n.set(eR(r,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;n8.set(this.visualElement,this);let t=nk(this.visualElement.current,"pointerdown",t=>{let{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{let{dragConstraints:t}=this.getProps();nO(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),K.read(e);let r=nP(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(nX(e=>{let n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),t(),i(),o&&o()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=.35,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:s}}}function ie(t,e,n){return(!0===e||e===t)&&(null===n||n===t)}class ii extends nw{constructor(t){super(t),this.removeGroupControls=_,this.removeListeners=_,this.controls=new it(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_}unmount(){this.removeGroupControls(),this.removeListeners()}}let ir=t=>(e,n)=>{t&&K.postRender(()=>t(e,n))};class io extends nw{constructor(){super(...arguments),this.removePointerDownListener=_}onPointerDown(t){this.session=new nM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:n9(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ir(t),onStart:ir(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&K.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=nk(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}var is,ia,il,iu=n(7437),ic=n(2265),ih=n(9637),id=n(8881);let ip=(0,ic.createContext)({}),im={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function iv(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let iy={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!t$.test(t))return t;t=parseFloat(t)}let n=iv(t,e.target.x),i=iv(t,e.target.y);return`${n}% ${i}%`}},ig={},{schedule:ib,cancel:iw}=X(queueMicrotask,!1);class ix extends ic.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:r}=t;Object.assign(ig,iT),r&&(e.group&&e.group.add(r),n&&n.register&&i&&n.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),im.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:n,drag:i,isPresent:r}=this.props,o=n.projection;return o&&(o.isPresent=r,i||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent===r||(r?o.promote():o.relegate()||K.postRender(()=>{let t=o.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ib.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function iS(t){let[e,n]=(0,ih.oO)(),i=(0,ic.useContext)(id.p);return(0,iu.jsx)(ix,{...t,layoutGroup:i,switchLayoutGroup:(0,ic.useContext)(ip),isPresent:e,safeToRemove:n})}let iT={borderRadius:{...iy,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:iy,borderTopRightRadius:iy,borderBottomLeftRadius:iy,borderBottomRightRadius:iy,boxShadow:{correct:(t,{treeScale:e,projectionDelta:n})=>{let i=t5.parse(t);if(i.length>5)return t;let r=t5.createTransformer(t),o="number"!=typeof i[0]?1:0,s=n.x.scale*e.x,a=n.y.scale*e.y;i[0+o]/=s,i[1+o]/=a;let l=eR(s,a,.5);return"number"==typeof i[2+o]&&(i[2+o]/=l),"number"==typeof i[3+o]&&(i[3+o]/=l),r(i)}}},iP=(t,e)=>t.depth-e.depth;class iE{constructor(){this.children=[],this.isDirty=!1}add(t){tn(this.children,t),this.isDirty=!0}remove(t){ti(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(iP),this.isDirty=!1,this.children.forEach(t)}}function iA(t){let e=tu(t)?t.get():t;return W(e)?e.toValue():e}let ik=["TopLeft","TopRight","BottomLeft","BottomRight"],iC=ik.length,iM=t=>"string"==typeof t?parseFloat(t):t,iR=t=>"number"==typeof t||t$.test(t);function iD(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let iV=iO(0,.5,tT),iL=iO(.5,.95,_);function iO(t,e,n){return i=>i<t?0:i>e?1:n(P(t,e,i))}function iI(t,e){t.min=e.min,t.max=e.max}function ij(t,e){iI(t.x,e.x),iI(t.y,e.y)}function iF(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function iN(t,e,n,i,r){return t-=e,t=i+1/n*(t-i),void 0!==r&&(t=i+1/r*(t-i)),t}function iB(t,e,[n,i,r],o,s){!function(t,e=0,n=1,i=.5,r,o=t,s=t){if(t_.test(e)&&(e=parseFloat(e),e=eR(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=eR(o.min,o.max,i);t===o&&(a-=e),t.min=iN(t.min,e,n,a,r),t.max=iN(t.max,e,n,a,r)}(t,e[n],e[i],e[r],e.scale,o,s)}let iU=["x","scaleX","originX"],i_=["y","scaleY","originY"];function i$(t,e,n,i){iB(t.x,e,iU,n?n.x:void 0,i?i.x:void 0),iB(t.y,e,i_,n?n.y:void 0,i?i.y:void 0)}function iz(t){return 0===t.translate&&1===t.scale}function iQ(t){return iz(t.x)&&iz(t.y)}function iW(t,e){return t.min===e.min&&t.max===e.max}function iH(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function iY(t,e){return iH(t.x,e.x)&&iH(t.y,e.y)}function iq(t){return nI(t.x)/nI(t.y)}function iX(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class iK{constructor(){this.members=[]}add(t){tn(this.members,t),t.scheduleRender()}remove(t){if(ti(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){let e;let n=this.members.findIndex(e=>t===e);if(0===n)return!1;for(let t=n;t>=0;t--){let n=this.members[t];if(!1!==n.isPresent){e=n;break}}return!!e&&(this.promote(e),!0)}promote(t,e){let n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let iG={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},iZ="undefined"!=typeof window&&void 0!==window.MotionDebug,iJ=["","X","Y","Z"],i0={visibility:"hidden"},i1=0;function i5(t,e,n,i){let{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),i&&(i[t]=0))}function i2({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(t={},n=null==e?void 0:e()){this.id=i1++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,iZ&&(iG.totalNodes=iG.resolvedTargetDeltas=iG.recalculatedProjection=0),this.nodes.forEach(i6),this.nodes.forEach(ri),this.nodes.forEach(rr),this.nodes.forEach(i4),iZ&&window.MotionDebug.record(iG)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,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 t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new iE)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new tr),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){let n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;let{layoutId:i,layout:r,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(r||i)&&(this.isLayoutDirty=!0),t){let n;let i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){let n=te.now(),i=({timestamp:e})=>{let r=e-n;r>=250&&(G(i),t(r-250))};return K.read(i,!0),()=>G(i)}(i,0),im.hasAnimatedSinceResize&&(im.hasAnimatedSinceResize=!1,this.nodes.forEach(rn))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||r)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let r=this.options.transition||o.getDefaultTransition()||rc,{onLayoutAnimationStart:s,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!iY(this.targetLayout,i)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);let e={...y(r,"layout"),onPlay:s,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||rn(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,G(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(ro),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:n}=e.options;if(!n)return;let i=n.props[td];if(window.MotionHasOptimisedAnimation(i,"transform")){let{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",K,!(t||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&t(r)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){let e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}let{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;let i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(i8);return}this.isUpdating||this.nodes.forEach(rt),this.isUpdating=!1,this.nodes.forEach(re),this.nodes.forEach(i3),this.nodes.forEach(i7),this.clearAllSnapshots();let t=te.now();Z.delta=tA(0,1e3/60,t-Z.timestamp),Z.timestamp=t,Z.isProcessing=!0,J.update.process(Z),J.preRender.process(Z),J.render.process(Z),Z.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ib.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(i9),this.sharedNodes.forEach(rs)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,K.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){K.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++)this.path[t].updateScroll();let t=this.layout;this.layout=this.measure(!1),this.layoutCorrected=nq(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e){let e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!r)return;let t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!iQ(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&(e||nJ(this.latestValues)||o)&&(r(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){var e;let n=this.measurePageBox(),i=this.removeElementScroll(n);return t&&(i=this.removeTransform(i)),rf((e=i).x),rf(e.y),{animationId:this.root.animationId,measuredBox:n,layoutBox:i,latestValues:{},source:this.id}}measurePageBox(){var t;let{visualElement:e}=this.options;if(!e)return nq();let n=e.measureViewportBox();if(!((null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)||this.path.some(rm))){let{scroll:t}=this.root;t&&(n3(n.x,t.offset.x),n3(n.y,t.offset.y))}return n}removeElementScroll(t){var e;let n=nq();if(ij(n,t),null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)return n;for(let e=0;e<this.path.length;e++){let i=this.path[e],{scroll:r,options:o}=i;i!==this.root&&r&&o.layoutScroll&&(r.wasRoot&&ij(n,t),n3(n.x,r.offset.x),n3(n.y,r.offset.y))}return n}applyTransform(t,e=!1){let n=nq();ij(n,t);for(let t=0;t<this.path.length;t++){let i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&n6(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),nJ(i.latestValues)&&n6(n,i.latestValues)}return nJ(this.latestValues)&&n6(n,this.latestValues),n}removeTransform(t){let e=nq();ij(e,t);for(let t=0;t<this.path.length;t++){let n=this.path[t];if(!n.instance||!nJ(n.latestValues))continue;nZ(n.latestValues)&&n.updateSnapshot();let i=nq();ij(i,n.measurePageBox()),i$(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return nJ(this.latestValues)&&i$(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Z.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e,n,i,r;let o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);let s=!!this.resumingFrom||this!==o;if(!(t||s&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:a,layoutId:l}=this.options;if(this.layout&&(a||l)){if(this.resolvedRelativeTargetAt=Z.timestamp,!this.targetDelta&&!this.relativeTarget){let t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nq(),this.relativeTargetOrigin=nq(),nU(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),ij(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if((this.target||(this.target=nq(),this.targetWithTransforms=nq()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target)?(this.forceRelativeParentToResolveTarget(),n=this.target,i=this.relativeTarget,r=this.relativeParent.target,nN(n.x,i.x,r.x),nN(n.y,i.y,r.y)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ij(this.target,this.layout.layoutBox),n2(this.target,this.targetDelta)):ij(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let t=this.getClosestProjectingParent();t&&!!t.resumingFrom==!!this.resumingFrom&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nq(),this.relativeTargetOrigin=nq(),nU(this.relativeTargetOrigin,this.target,t.target),ij(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}iZ&&iG.resolvedTargetDeltas++}}}getClosestProjectingParent(){return!this.parent||nZ(this.parent.latestValues)||n0(this.parent.latestValues)?void 0:this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;let e=this.getLead(),n=!!this.resumingFrom||this!==e,i=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(i=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===Z.timestamp&&(i=!1),i)return;let{layout:r,layoutId:o}=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||o))return;ij(this.layoutCorrected,this.layout.layoutBox);let s=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,i=!1){let r,o;let s=n.length;if(s){e.x=e.y=1;for(let a=0;a<s;a++){o=(r=n[a]).projectionDelta;let{visualElement:s}=r.options;(!s||!s.props.style||"contents"!==s.props.style.display)&&(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&n6(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,n2(t,o)),i&&nJ(r.latestValues)&&n6(t,r.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,n),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=nq());let{target:l}=e;if(!l){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(iF(this.prevProjectionDelta.x,this.projectionDelta.x),iF(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nF(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&iX(this.projectionDelta.x,this.prevProjectionDelta.x)&&iX(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),iZ&&iG.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=nH(),this.projectionDelta=nH(),this.projectionDeltaWithTransform=nH()}setAnimationOrigin(t,e=!1){let n;let i=this.snapshot,r=i?i.latestValues:{},o={...this.latestValues},s=nH();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=nq(),l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,h=!!(l&&!c&&!0===this.options.crossfade&&!this.path.some(ru));this.animationProgress=0,this.mixTargetDelta=e=>{let i=e/1e3;if(ra(s.x,t.x,i),ra(s.y,t.y,i),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,d,f,p;nU(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),f=this.relativeTarget,p=this.relativeTargetOrigin,rl(f.x,p.x,a.x,i),rl(f.y,p.y,a.y,i),n&&(u=this.relativeTarget,d=n,iW(u.x,d.x)&&iW(u.y,d.y))&&(this.isProjectionDirty=!1),n||(n=nq()),ij(n,this.relativeTarget)}l&&(this.animationValues=o,function(t,e,n,i,r,o){r?(t.opacity=eR(0,void 0!==n.opacity?n.opacity:1,iV(i)),t.opacityExit=eR(void 0!==e.opacity?e.opacity:1,0,iL(i))):o&&(t.opacity=eR(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let r=0;r<iC;r++){let o=`border${ik[r]}Radius`,s=iD(e,o),a=iD(n,o);(void 0!==s||void 0!==a)&&(s||(s=0),a||(a=0),0===s||0===a||iR(s)===iR(a)?(t[o]=Math.max(eR(iM(s),iM(a),i),0),(t_.test(a)||t_.test(s))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=eR(e.rotate||0,n.rotate||0,i))}(o,r,this.latestValues,i,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(G(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=K.update(()=>{im.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){let i=tu(0)?0:tl(0);return i.start(nh("",i,1e3,n)),i.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:n,layout:i,latestValues:r}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&rp(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||nq();let e=nI(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;let i=nI(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}ij(e,n),n6(e,r),nF(this.projectionDeltaWithTransform,this.layoutCorrected,e,r)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new iK),this.sharedNodes.get(t).add(e);let n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){var t;let{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;let{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){let i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;let i={};n.z&&i5("z",t,i,this.animationValues);for(let e=0;e<iJ.length;e++)i5(`rotate${iJ[e]}`,t,i,this.animationValues),i5(`skew${iJ[e]}`,t,i,this.animationValues);for(let e in t.render(),i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){var e,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return i0;let i={visibility:""},r=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=iA(null==t?void 0:t.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none",i;let o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){let e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=iA(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!nJ(this.latestValues)&&(e.transform=r?r({},""):"none",this.hasProjected=!1),e}let s=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=function(t,e,n){let i="",r=t.x.translate/e.x,o=t.y.translate/e.y,s=(null==n?void 0:n.z)||0;if((r||o||s)&&(i=`translate3d(${r}px, ${o}px, ${s}px) `),(1!==e.x||1!==e.y)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){let{transformPerspective:t,rotate:e,rotateX:r,rotateY:o,skewX:s,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),r&&(i+=`rotateX(${r}deg) `),o&&(i+=`rotateY(${o}deg) `),s&&(i+=`skewX(${s}deg) `),a&&(i+=`skewY(${a}deg) `)}let a=t.x.scale*e.x,l=t.y.scale*e.y;return(1!==a||1!==l)&&(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),r&&(i.transform=r(s,i.transform));let{x:a,y:l}=this.projectionDelta;for(let t in i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:i.opacity=o===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0,ig){if(void 0===s[t])continue;let{correct:e,applyTo:n}=ig[t],r="none"===i.transform?s[t]:e(s[t],o);if(n){let t=n.length;for(let e=0;e<t;e++)i[n[e]]=r}else i[t]=r}return this.options.layoutId&&(i.pointerEvents=o===this?iA(null==t?void 0:t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(i8),this.root.sharedNodes.clear()}}}function i3(t){t.updateLayout()}function i7(t){var e;let n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){let{layoutBox:e,measuredBox:i}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;"size"===r?nX(t=>{let i=o?n.measuredBox[t]:n.layoutBox[t],r=nI(i);i.min=e[t].min,i.max=i.min+r}):rp(r,n.layoutBox,e)&&nX(i=>{let r=o?n.measuredBox[i]:n.layoutBox[i],s=nI(e[i]);r.max=r.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+s)});let s=nH();nF(s,e,n.layoutBox);let a=nH();o?nF(a,t.applyTransform(i,!0),n.measuredBox):nF(a,e,n.layoutBox);let l=!iQ(s),u=!1;if(!t.resumeFrom){let i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){let{snapshot:r,layout:o}=i;if(r&&o){let s=nq();nU(s,n.layoutBox,r.layoutBox);let a=nq();nU(a,e,o.layoutBox),iY(s,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function i6(t){iZ&&iG.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function i4(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function i9(t){t.clearSnapshot()}function i8(t){t.clearMeasurements()}function rt(t){t.isLayoutDirty=!1}function re(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function rn(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ri(t){t.resolveTargetDelta()}function rr(t){t.calcProjection()}function ro(t){t.resetSkewAndRotation()}function rs(t){t.removeLeadSnapshot()}function ra(t,e,n){t.translate=eR(e.translate,0,n),t.scale=eR(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function rl(t,e,n,i){t.min=eR(e.min,n.min,i),t.max=eR(e.max,n.max,i)}function ru(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let rc={duration:.45,ease:[.4,0,.1,1]},rh=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),rd=rh("applewebkit/")&&!rh("chrome/")?Math.round:_;function rf(t){t.min=rd(t.min),t.max=rd(t.max)}function rp(t,e,n){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(iq(e)-iq(n)))}function rm(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}let rv=i2({attachResizeListener:(t,e)=>nP(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ry={current:void 0},rg=i2({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ry.current){let t=new rv({});t.mount(window),t.setOptions({layoutScroll:!0}),ry.current=t}return ry.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position});function rb(t,e,n){let{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);let r=i["onHover"+n];r&&K.postRender(()=>r(e,nE(e)))}class rw extends nw{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){let[i,r,o]=M(t,n),s=R(t=>{let{target:n}=t,i=e(t);if("function"!=typeof i||!n)return;let o=R(t=>{i(t),n.removeEventListener("pointerleave",o)});n.addEventListener("pointerleave",o,r)});return i.forEach(t=>{t.addEventListener("pointerenter",s,r)}),o}(t,t=>(rb(this.node,t,"Start"),t=>rb(this.node,t,"End"))))}unmount(){}}class rx extends nw{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=eB(nP(this.node.current,"focus",()=>this.onFocus()),nP(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function rS(t,e,n){let{props:i}=t;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);let r=i["onTap"+("End"===n?"":n)];r&&K.postRender(()=>r(e,nE(e)))}class rT extends nw{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){let[i,r,o]=M(t,n),s=t=>{let i=t.currentTarget;if(!N(t)||O.has(i))return;O.add(i);let o=e(t),s=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),N(t)&&O.has(i)&&(O.delete(i),"function"==typeof o&&o(t,{success:e}))},a=t=>{s(t,n.useGlobalTarget||D(i,t.target))},l=t=>{s(t,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",l,r)};return i.forEach(t=>{L.has(t.tagName)||-1!==t.tabIndex||null!==t.getAttribute("tabindex")||(t.tabIndex=0),(n.useGlobalTarget?window:t).addEventListener("pointerdown",s,r),t.addEventListener("focus",t=>F(t,r),r)}),o}(t,t=>(rS(this.node,t,"Start"),(t,{success:e})=>rS(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}let rP=new WeakMap,rE=new WeakMap,rA=t=>{let e=rP.get(t.target);e&&e(t)},rk=t=>{t.forEach(rA)},rC={some:0,all:1};class rM extends nw{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:r}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:rC[i]};return function(t,e,n){let i=function({root:t,...e}){let n=t||document;rE.has(n)||rE.set(n,{});let i=rE.get(n),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(rk,{root:t,...e})),i[r]}(e);return rP.set(t,n),i.observe(t),()=>{rP.delete(t),i.unobserve(t)}}(this.node.current,o,t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,r&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}let rR=(0,ic.createContext)({strict:!1});var rD=n(5750);let rV=(0,ic.createContext)({});function rL(t){return r(t.animate)||d.some(e=>a(t[e]))}function rO(t){return!!(rL(t)||t.variants)}function rI(t){return Array.isArray(t)?t.join(" "):t}var rj=n(4563);let rF={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"]},rN={};for(let t in rF)rN[t]={isEnabled:e=>rF[t].some(t=>!!e[t])};let rB=Symbol.for("motionComponentSymbol");var rU=n(4252),r_=n(1534);let r$=["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 rz(t){if("string"!=typeof t||t.includes("-"));else if(r$.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}var rQ=n(3576);let rW=t=>(e,n)=>{let i=(0,ic.useContext)(rV),o=(0,ic.useContext)(rU.O),s=()=>(function({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},i,o,s){let a={latestValues:function(t,e,n,i){let o={},s=i(t,{});for(let t in s)o[t]=iA(s[t]);let{initial:a,animate:l}=t,c=rL(t),h=rO(t);e&&h&&!c&&!1!==t.inherit&&(void 0===a&&(a=e.initial),void 0===l&&(l=e.animate));let d=!!n&&!1===n.initial,f=(d=d||!1===a)?l:a;if(f&&"boolean"!=typeof f&&!r(f)){let e=Array.isArray(f)?f:[f];for(let n=0;n<e.length;n++){let i=u(t,e[n]);if(i){let{transitionEnd:t,transition:e,...n}=i;for(let t in n){let e=n[t];if(Array.isArray(e)){let t=d?e.length-1:0;e=e[t]}null!==e&&(o[t]=e)}for(let e in t)o[e]=t[e]}}}return o}(i,o,s,t),renderState:e()};return n&&(a.onMount=t=>n({props:i,current:t,...a}),a.onUpdate=t=>n(t)),a})(t,e,i,o);return n?s():(0,rQ.h)(s)},rH=(t,e)=>e&&"number"==typeof t?e.transform(t):t,rY={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rq=$.length;function rX(t,e,n){let{style:i,vars:r,transformOrigin:o}=t,s=!1,a=!1;for(let t in e){let n=e[t];if(z.has(t)){s=!0;continue}if(ey(t)){r[t]=n;continue}{let e=rH(n,t9[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(!e.transform&&(s||n?i.transform=function(t,e,n){let i="",r=!0;for(let o=0;o<rq;o++){let s=$[o],a=t[s];if(void 0===a)continue;let l=!0;if(!(l="number"==typeof a?a===(s.startsWith("scale")?1:0):0===parseFloat(a))||n){let t=rH(a,t9[s]);if(!l){r=!1;let e=rY[s]||s;i+=`${e}(${t}) `}n&&(e[s]=t)}}return i=i.trim(),n?i=n(e,r?"":i):r&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){let{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}let rK={offset:"stroke-dashoffset",array:"stroke-dasharray"},rG={offset:"strokeDashoffset",array:"strokeDasharray"};function rZ(t,e,n){return"string"==typeof t?t:t$.transform(e+n*t)}function rJ(t,{attrX:e,attrY:n,attrScale:i,originX:r,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(rX(t,u,h),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:d,style:f,dimensions:p}=t;d.transform&&(p&&(f.transform=d.transform),delete d.transform),p&&(void 0!==r||void 0!==o||f.transform)&&(f.transformOrigin=function(t,e,n){let i=rZ(e,t.x,t.width),r=rZ(n,t.y,t.height);return`${i} ${r}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==i&&(d.scale=i),void 0!==s&&function(t,e,n=1,i=0,r=!0){t.pathLength=1;let o=r?rK:rG;t[o.offset]=t$.transform(-i);let s=t$.transform(e),a=t$.transform(n);t[o.array]=`${s} ${a}`}(d,s,a,l,!1)}let r0=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),r1=()=>({...r0(),attrs:{}}),r5=t=>"string"==typeof t&&"svg"===t.toLowerCase();function r2(t,{style:e,vars:n},i,r){for(let o in Object.assign(t.style,e,r&&r.getProjectionStyles(i)),n)t.style.setProperty(o,n[o])}let r3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function r7(t,e,n,i){for(let n in r2(t,e,void 0,i),e.attrs)t.setAttribute(r3.has(n)?n:th(n),e.attrs[n])}function r6(t,{layout:e,layoutId:n}){return z.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ig[t]||"opacity"===t)}function r4(t,e,n){var i;let{style:r}=t,o={};for(let s in r)(tu(r[s])||e.style&&tu(e.style[s])||r6(s,t)||(null===(i=null==n?void 0:n.getValue(s))||void 0===i?void 0:i.liveStyle)!==void 0)&&(o[s]=r[s]);return o}function r9(t,e,n){let i=r4(t,e,n);for(let n in t)(tu(t[n])||tu(e[n]))&&(i[-1!==$.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return i}let r8=["x","y","width","height","cx","cy","r"],ot={useVisualState:rW({scrapeMotionValuesFromProps:r9,createRenderState:r1,onUpdate:({props:t,prevProps:e,current:n,renderState:i,latestValues:r})=>{if(!n)return;let o=!!t.drag;if(!o){for(let t in r)if(z.has(t)){o=!0;break}}if(!o)return;let s=!e;if(e)for(let n=0;n<r8.length;n++){let i=r8[n];t[i]!==e[i]&&(s=!0)}s&&K.read(()=>{!function(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}(n,i),K.render(()=>{rJ(i,r,r5(n.tagName),t.transformTemplate),r7(n,i)})})}})},oe={useVisualState:rW({scrapeMotionValuesFromProps:r4,createRenderState:r0})};function on(t,e,n){for(let i in e)tu(e[i])||r6(i,n)||(t[i]=e[i])}let oi=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function or(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||oi.has(t)}let oo=t=>!or(t);try{(is=require("@emotion/is-prop-valid").default)&&(oo=t=>t.startsWith("on")?!or(t):is(t))}catch(t){}let os={current:null},oa={current:!1},ol=[...eT,tY,t5],ou=t=>ol.find(eS(t)),oc=new WeakMap,oh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class od{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ep,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let t=te.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};let{latestValues:a,renderState:l,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!r,this.isControllingVariants=rL(e),this.isVariantNode=rO(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(let t in h){let e=h[t];void 0!==a[t]&&tu(e)&&e.set(a[t],!1)}}mount(t){this.current=t,oc.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),oa.current||function(){if(oa.current=!0,rj.j){if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>os.current=t.matches;t.addListener(e),e()}else os.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||os.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let t in oc.delete(this.current),this.projection&&this.projection.unmount(),G(this.notifyUpdate),G(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){let n;this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let i=z.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&K.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.on("renderRequest",this.scheduleRender);window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{r(),o(),n&&n(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in rN){let e=rN[t];if(!e)continue;let{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nq()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<oh.length;e++){let n=oh[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(let i in e){let r=e[i],o=n[i];if(tu(r))t.addValue(i,r);else if(tu(o))t.addValue(i,tl(r,{owner:t}));else if(o!==r){if(t.hasValue(i)){let e=t.getValue(i);!0===e.liveStyle?e.jump(r):e.hasAnimated||e.set(r)}else{let e=t.getStaticValue(i);t.addValue(i,tl(void 0!==e?e:r,{owner:t}))}}}for(let i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){let n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=tl(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let i=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(em(i)||tE(i))?i=parseFloat(i):!ou(i)&&t5.test(e)&&(i=ee(t,e)),this.setBaseTarget(t,tu(i)?i.get():i)),tu(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;let n;let{initial:i}=this.props;if("string"==typeof i||"object"==typeof i){let r=u(this.props,i,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);r&&(n=r[t])}if(i&&void 0!==n)return n;let r=this.getBaseTargetFromProps(this.props,t);return void 0===r||tu(r)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:r}on(t,e){return this.events[t]||(this.events[t]=new tr),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class of extends od{constructor(){super(...arguments),this.KeyframeResolver=eE}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;tu(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class op extends of{constructor(){super(...arguments),this.type="html",this.renderInstance=r2}readValueFromInstance(t,e){if(z.has(e)){let t=et(e);return t&&t.default||0}{let n=window.getComputedStyle(t),i=(ey(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof i?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:e}){return n4(t,e)}build(t,e,n){rX(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return r4(t,e,n)}}class om extends of{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=nq}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(z.has(e)){let t=et(e);return t&&t.default||0}return e=r3.has(e)?e:th(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return r9(t,e,n)}build(t,e,n){rJ(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,i){r7(t,e,n,i)}mount(t){this.isSVGTag=r5(t.tagName),super.mount(t)}}let ov=function(t){if("undefined"==typeof Proxy)return t;let e=new Map;return new Proxy((...e)=>t(...e),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}((ia={animation:{Feature:nx},exit:{Feature:nT},inView:{Feature:rM},tap:{Feature:rT},focus:{Feature:rx},hover:{Feature:rw},pan:{Feature:io},drag:{Feature:ii,ProjectionNode:rg,MeasureLayout:iS},layout:{ProjectionNode:rg,MeasureLayout:iS}},il=(t,e)=>rz(t)?new om(e):new op(e,{allowProjection:t!==ic.Fragment}),function(t,{forwardMotionProps:e}={forwardMotionProps:!1}){return function(t){var e,n;let{preloadedFeatures:i,createVisualElement:r,useRender:o,useVisualState:s,Component:l}=t;function u(t,e){var n;let i;let u={...(0,ic.useContext)(rD._),...t,layoutId:function(t){let{layoutId:e}=t,n=(0,ic.useContext)(id.p).id;return n&&void 0!==e?n+"-"+e:e}(t)},{isStatic:c}=u,h=function(t){let{initial:e,animate:n}=function(t,e){if(rL(t)){let{initial:e,animate:n}=t;return{initial:!1===e||a(e)?e:void 0,animate:a(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,ic.useContext)(rV));return(0,ic.useMemo)(()=>({initial:e,animate:n}),[rI(e),rI(n)])}(t),d=s(t,c);if(!c&&rj.j){(0,ic.useContext)(rR).strict;let t=function(t){let{drag:e,layout:n}=rN;if(!e&&!n)return{};let i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(u);i=t.MeasureLayout,h.visualElement=function(t,e,n,i,r){var o,s;let{visualElement:a}=(0,ic.useContext)(rV),l=(0,ic.useContext)(rR),u=(0,ic.useContext)(rU.O),c=(0,ic.useContext)(rD._).reducedMotion,h=(0,ic.useRef)(null);i=i||l.renderer,!h.current&&i&&(h.current=i(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:c}));let d=h.current,f=(0,ic.useContext)(ip);d&&!d.projection&&r&&("html"===d.type||"svg"===d.type)&&function(t,e,n,i){let{layoutId:r,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!s||a&&nO(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}(h.current,n,r,f);let p=(0,ic.useRef)(!1);(0,ic.useInsertionEffect)(()=>{d&&p.current&&d.update(n,u)});let m=n[td],v=(0,ic.useRef)(!!m&&!(null===(o=window.MotionHandoffIsComplete)||void 0===o?void 0:o.call(window,m))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,m)));return(0,r_.L)(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),ib.render(d.render),v.current&&d.animationState&&d.animationState.animateChanges())}),(0,ic.useEffect)(()=>{d&&(!v.current&&d.animationState&&d.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var t;null===(t=window.MotionHandoffMarkAsComplete)||void 0===t||t.call(window,m)}),v.current=!1))}),d}(l,d,u,r,t.ProjectionNode)}return(0,iu.jsxs)(rV.Provider,{value:h,children:[i&&h.visualElement?(0,iu.jsx)(i,{visualElement:h.visualElement,...u}):null,o(l,t,(n=h.visualElement,(0,ic.useCallback)(t=>{t&&d.onMount&&d.onMount(t),n&&(t?n.mount(t):n.unmount()),e&&("function"==typeof e?e(t):nO(e)&&(e.current=t))},[n])),d,c,h.visualElement)]})}i&&function(t){for(let e in t)rN[e]={...rN[e],...t[e]}}(i),u.displayName="motion.".concat("string"==typeof l?l:"create(".concat(null!==(n=null!==(e=l.displayName)&&void 0!==e?e:l.name)&&void 0!==n?n:"",")"));let c=(0,ic.forwardRef)(u);return c[rB]=l,c}({...rz(t)?ot:oe,preloadedFeatures:ia,useRender:function(t=!1){return(e,n,i,{latestValues:r},o)=>{let s=(rz(e)?function(t,e,n,i){let r=(0,ic.useMemo)(()=>{let n=r1();return rJ(n,e,r5(i),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){let e={};on(e,t.style,t),r.style={...e,...r.style}}return r}:function(t,e){let n={},i=function(t,e){let n=t.style||{},i={};return on(i,n,t),Object.assign(i,function({transformTemplate:t},e){return(0,ic.useMemo)(()=>{let n=r0();return rX(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),i}(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n})(n,r,o,e),a=function(t,e,n){let i={};for(let r in t)("values"!==r||"object"!=typeof t.values)&&(oo(r)||!0===n&&or(r)||!e&&!or(r)||t.draggable&&r.startsWith("onDrag"))&&(i[r]=t[r]);return i}(n,"string"==typeof e,t),l=e!==ic.Fragment?{...a,...s,ref:i}:{},{children:u}=n,c=(0,ic.useMemo)(()=>tu(u)?u.get():u,[u]);return(0,ic.createElement)(e,{...l,children:c})}}(e),createVisualElement:il,Component:t})}))},4563:function(t,e,n){"use strict";n.d(e,{j:function(){return i}});let i="undefined"!=typeof window},3576:function(t,e,n){"use strict";n.d(e,{h:function(){return r}});var i=n(2265);function r(t){let e=(0,i.useRef)(null);return null===e.current&&(e.current=t()),e.current}},1534:function(t,e,n){"use strict";n.d(e,{L:function(){return r}});var i=n(2265);let r=n(4563).j?i.useLayoutEffect:i.useEffect}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{7589:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(3634)}])},3634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(7043);let i=n(7437);n(2265);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[971,117,744],function(){return e(e.s=7589)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{2460:function(n,e,t){Promise.resolve().then(t.t.bind(t,5019,23)),Promise.resolve().then(t.t.bind(t,7787,23)),Promise.resolve().then(t.t.bind(t,7960,23))},7960:function(){},7787:function(){},5019:function(n){n.exports={style:{fontFamily:"'__Public_Sans_8ff03a', '__Public_Sans_Fallback_8ff03a'",fontWeight:400,fontStyle:"normal"},className:"__className_8ff03a"}}},function(n){n.O(0,[17,971,117,744],function(){return n(n.s=2460)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{3569:function(e,t,n){Promise.resolve().then(n.bind(n,6924))},6924:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var s=n(7437);function i(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M3.33398 3.33334L12.6673 12.6667M12.6673 3.33334L3.33398 12.6667",stroke:"currentColor","stroke-width":"2","stroke-linecap":"square"})})}var a=n(2265);function r(e){let t=(0,a.useRef)(null),[n,i]=(0,a.useState)(!1),r=(0,a.useRef)(!1);return["listening","thinking","speaking"].includes(e.state)&&!1==r.current&&(r.current=!0),(0,a.useEffect)(()=>("connecting"===e.state?t.current=window.setTimeout(()=>{"connecting"===e.state&&!1===r.current&&i(!0)},1e4):(t.current&&window.clearTimeout(t.current),i(!1)),()=>{t.current&&window.clearTimeout(t.current)}),[e.state]),(0,s.jsx)(s.Fragment,{children:n?(0,s.jsxs)("div",{className:"fixed text-sm left-1/2 max-w-[90vw] -translate-x-1/2 flex top-6 items-center gap-4 bg-[#1F1F1F] px-4 py-3 rounded-lg",children:[(0,s.jsx)("div",{children:(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.85068 3.63564C10.8197 2.00589 13.1793 2.00589 14.1484 3.63564L21.6323 16.2223C22.6232 17.8888 21.4223 20 19.4835 20H4.51555C2.57676 20 1.37584 17.8888 2.36671 16.2223L9.85068 3.63564ZM12 8.5C12.2761 8.5 12.5 8.72386 12.5 9V13.5C12.5 13.7761 12.2761 14 12 14C11.7239 14 11.5 13.7761 11.5 13.5V9C11.5 8.72386 11.7239 8.5 12 8.5ZM12.75 16C12.75 16.4142 12.4142 16.75 12 16.75C11.5858 16.75 11.25 16.4142 11.25 16C11.25 15.5858 11.5858 15.25 12 15.25C12.4142 15.25 12.75 15.5858 12.75 16Z",fill:"#666666"})})}),(0,s.jsx)("p",{className:"text-pretty w-max",children:"It's quiet... too quiet. Is your agent lost? Ensure your agent is properly configured and running on your machine."}),(0,s.jsx)("a",{href:"https://docs.livekit.io/agents/quickstarts/s2s/",target:"_blank",className:"underline whitespace-nowrap",children:"View guide"}),(0,s.jsx)("button",{onClick:()=>i(!1),children:(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M3.16602 3.16666L12.8327 12.8333M12.8327 3.16666L3.16602 12.8333",stroke:"#999999",strokeWidth:"1.5",strokeLinecap:"square"})})})]}):null})}var o=n(7933),l=n(3819);function c(){let e=function(){let{agentTranscriptions:e}=(0,o.V)(),t=function(){let{microphoneTrack:e,localParticipant:t}=(0,o.C)();return(0,a.useMemo)(()=>({participant:t,source:l.fQ.Source.Microphone,publication:e}),[t,e])}(),{segments:n}=(0,o.U)(t);return(0,a.useMemo)(()=>[...e.map(e=>({...e,role:"assistant"})),...n.map(e=>({...e,role:"user"}))].sort((e,t)=>e.firstReceivedTime-t.firstReceivedTime),[e,n])}(),t=a.useRef(null);return a.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[e]),(0,s.jsxs)("div",{className:"relative h-[200px] w-[512px] max-w-[90vw] mx-auto",children:[(0,s.jsx)("div",{className:"absolute top-0 left-0 right-0 h-8 bg-gradient-to-b from-[var(--lk-bg)] to-transparent z-10 pointer-events-none"}),(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-8 bg-gradient-to-t from-[var(--lk-bg)] to-transparent z-10 pointer-events-none"}),(0,s.jsx)("div",{ref:t,className:"h-full flex flex-col gap-2 overflow-y-auto px-4 py-8",children:e.map(e=>(0,s.jsx)("div",{id:e.id,className:"assistant"===e.role?"p-2 self-start fit-content":"bg-gray-800 rounded-md p-2 self-end fit-content",children:e.text},e.id))})]})}var d=n(9426),u=n(2297),p=n(168),x=n(8614),h=n(521),f=n(257);function m(){let[e]=(0,a.useState)(new l.du),[t,n]=(0,a.useState)(""),[i,r]=(0,a.useState)(""),o=(0,a.useCallback)(async()=>{var n;r("");let s=new URL(null!==(n=f.env.NEXT_PUBLIC_CONN_DETAILS_ENDPOINT)&&void 0!==n?n:"/api/connection-details",window.location.origin);s.searchParams.set("password",t);let i=await fetch(s.toString());if(!i.ok){401===i.status?r("Invalid password"):r("Connection failed");return}let a=await i.json();await e.connect(a.serverUrl,a.participantToken),await e.localParticipant.setMicrophoneEnabled(!0)},[e,t]);return(0,a.useEffect)(()=>(e.on(l.TQ.MediaDevicesError,j),()=>{e.off(l.TQ.MediaDevicesError,j)}),[e]),(0,s.jsx)("main",{"data-lk-theme":"default",className:"h-full grid content-center bg-[var(--lk-bg)]",children:(0,s.jsx)(d.R.Provider,{value:e,children:(0,s.jsx)("div",{className:"lk-room-container max-w-[1024px] w-[90vw] mx-auto max-h-[90vh]",children:(0,s.jsx)(w,{onConnectButtonClicked:o,password:t,setPassword:n,error:i})})})})}function w(e){let{state:t}=(0,o.V)();return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(x.M,{mode:"wait",children:"disconnected"===t?(0,s.jsx)(h.E.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3,ease:[.09,1.04,.245,1.055]},className:"grid items-center justify-center h-full",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,s.jsx)("input",{type:"password",placeholder:"Enter password",value:e.password,onChange:t=>e.setPassword(t.target.value),onKeyPress:t=>{"Enter"===t.key&&e.onConnectButtonClicked()},className:"px-4 py-2 bg-gray-800 text-white rounded-md focus:outline-none focus:ring-2 focus:ring-white"}),e.error&&(0,s.jsx)("p",{className:"text-red-500 text-sm",children:e.error}),(0,s.jsx)(h.E.button,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:.1},className:"uppercase px-4 py-2 bg-white text-black rounded-md",onClick:()=>e.onConnectButtonClicked(),children:"Start a conversation"})]})},"disconnected"):(0,s.jsxs)(h.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3,ease:[.09,1.04,.245,1.055]},className:"flex flex-col items-center gap-4 h-full",children:[(0,s.jsx)(g,{}),(0,s.jsx)("div",{className:"flex-1 w-full",children:(0,s.jsx)(c,{})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(v,{onConnectButtonClicked:e.onConnectButtonClicked})}),(0,s.jsx)(u.R,{}),(0,s.jsx)(r,{state:t})]},"connected")})})}function g(){let{state:e,videoTrack:t,audioTrack:n}=(0,o.V)();return t?(0,s.jsx)("div",{className:"h-[512px] w-[512px] rounded-lg overflow-hidden",children:(0,s.jsx)(u.V,{trackRef:t})}):(0,s.jsx)("div",{className:"h-[300px] w-full",children:(0,s.jsx)(u.B,{state:e,barCount:5,trackRef:n,className:"agent-visualizer",options:{minHeight:24}})})}function v(e){let{state:t}=(0,o.V)();return(0,s.jsxs)("div",{className:"relative h-[60px]",children:[(0,s.jsx)(x.M,{children:"disconnected"===t&&(0,s.jsx)(h.E.button,{initial:{opacity:0,top:0},animate:{opacity:1},exit:{opacity:0,top:"-10px"},transition:{duration:1,ease:[.09,1.04,.245,1.055]},className:"uppercase absolute left-1/2 -translate-x-1/2 px-4 py-2 bg-white text-black rounded-md",onClick:()=>e.onConnectButtonClicked(),children:"Start a conversation"})}),(0,s.jsx)(x.M,{children:"disconnected"!==t&&"connecting"!==t&&(0,s.jsxs)(h.E.div,{initial:{opacity:0,top:"10px"},animate:{opacity:1,top:0},exit:{opacity:0,top:"-10px"},transition:{duration:.4,ease:[.09,1.04,.245,1.055]},className:"flex h-8 absolute left-1/2 -translate-x-1/2 justify-center",children:[(0,s.jsx)(p.P6,{controls:{leave:!1}}),(0,s.jsx)(u.D,{children:(0,s.jsx)(i,{})})]})})]})}function j(e){console.error(e),alert("Error acquiring camera or microphone permissions. Please make sure you grant the necessary permissions in your browser and reload the tab")}}},function(e){e.O(0,[481,471,971,117,744],function(){return e(e.s=3569)}),_N_E=e.O()}]);