@pi-chamber/web 0.7.2 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/{DiagramEditor-TeJ1G_NN.js → DiagramEditor-D_3eJVSw.js} +1 -1
  3. package/dist/assets/DiagramView-pGYm0-DR.js +1 -0
  4. package/dist/assets/DiffView-BApPTLGp.js +18 -0
  5. package/dist/assets/FilesView-CiPpuGiF.js +6 -0
  6. package/dist/assets/GitView-uW3w_LlQ.js +8 -0
  7. package/dist/assets/JsonTreeView-CpgqCk9_.js +1 -0
  8. package/dist/assets/MarkdownRendererImpl-fI6n3kqT.js +12 -0
  9. package/dist/assets/PatchDiff-BRloGXPs.js +1 -0
  10. package/dist/assets/SessionSwitcherContent-BQc-vW4s.js +1 -0
  11. package/dist/assets/SessionSwitcherDropdown-v_8TaIZm.js +2 -0
  12. package/dist/assets/SessionUnreadDot-A7vSfll2.js +1 -0
  13. package/dist/assets/SettingsView-CphlZvfd.js +2 -0
  14. package/dist/assets/SettingsWindow-D7UDhYd4.js +1 -0
  15. package/dist/assets/ToolOutputDialog-wpU0ylYS.js +8 -0
  16. package/dist/assets/ToolPartDiffPreview-BvoQK5Gm.js +1 -0
  17. package/dist/assets/{VirtualizedFileDiff-sRc4lN0B.js → VirtualizedFileDiff-DdPbLdh7.js} +4 -4
  18. package/dist/assets/{Virtualizer-BxW2CJGB.js → Virtualizer-BSHVMKgK.js} +1 -1
  19. package/dist/assets/{appThemeRegistry-BK0dHKa6.js → appThemeRegistry-gegrE2dq.js} +1 -1
  20. package/dist/assets/collapsible-BO6FIjvn.js +1 -0
  21. package/dist/assets/computeVirtualFileMetrics-DMvXzUJh.js +3 -0
  22. package/dist/assets/contextFileOpenGuard-BwXQVjtS.js +1 -0
  23. package/dist/assets/gitStatusPredicates-CgNk6M2_.js +134 -0
  24. package/dist/assets/index-BebQicw3.css +1 -0
  25. package/dist/assets/index-Bkz23mZq.js +8 -0
  26. package/dist/assets/index-C3SyF-cA.js +1 -0
  27. package/dist/assets/isDiffPlainText-BboRbmcm.js +1 -0
  28. package/dist/assets/isFilePlainText-BpTnLRyI.js +1 -0
  29. package/dist/assets/main-CMOAwZnJ.js +135 -0
  30. package/dist/assets/main-xLwCWLu-.js +2 -0
  31. package/dist/assets/{markdownCore-BfuFM7mg.js → markdownCore-CmFv4H-w.js} +2 -2
  32. package/dist/assets/miniChat-Vwo4K1IK.js +2 -0
  33. package/dist/assets/mobile-BRaxtEoC.js +2 -0
  34. package/dist/assets/{permissionStore-BRcQ9Jgt.js → permissionStore-iKN1K2_x.js} +1 -1
  35. package/dist/assets/registerCustomTheme-DmolaWWZ.js +1 -0
  36. package/dist/assets/renderElectronMiniChatApp-DM4rRUUz.js +2 -0
  37. package/dist/assets/renderMobileApp-DWWewNhc.js +11 -0
  38. package/dist/assets/runtimeEndpointReset-BF60eHSx.js +54 -0
  39. package/dist/assets/{runtimeSurface-DF3VwUlO.js → runtimeSurface-SmPSdfop.js} +1 -1
  40. package/dist/assets/themeResolver-yJ9XpNMI.js +1 -0
  41. package/dist/assets/{WindowsWindowControls-CCnU0ckO.js → useAppFontEffects-Bg-8jtrQ.js} +127 -500
  42. package/dist/assets/useFilesViewSearch-GLcYNIUV.js +7 -0
  43. package/dist/assets/usePushVisibilityBeacon-VSYBfNoY.js +10 -0
  44. package/dist/assets/useSwitcherItems-BkEt9K-N.js +1 -0
  45. package/dist/assets/vendor-base-ui-vkqQ2P9o.js +1 -0
  46. package/dist/assets/{vendor-beautiful-mermaid-r4GK_usS.js → vendor-beautiful-mermaid-DneUawHp.js} +1 -1
  47. package/dist/assets/{vendor-cmdk-BCEUzcHE.js → vendor-cmdk-zXx6sGnS.js} +1 -1
  48. package/dist/assets/{vendor-codemirror-autocomplete-BS2SpSAZ.js → vendor-codemirror-autocomplete-wd6iRebq.js} +1 -1
  49. package/dist/assets/{vendor-codemirror-commands-RrgJ8H_6.js → vendor-codemirror-commands-DYppkHEk.js} +1 -1
  50. package/dist/assets/{vendor-codemirror-lang-angular-ADhO_TUK.js → vendor-codemirror-lang-angular-DU_4KiiW.js} +1 -1
  51. package/dist/assets/{vendor-codemirror-lang-cpp-BGCWj7Om.js → vendor-codemirror-lang-cpp-CmIT9Z5_.js} +1 -1
  52. package/dist/assets/{vendor-codemirror-lang-css-Ba8JZ6fp.js → vendor-codemirror-lang-css-djiuoTi8.js} +1 -1
  53. package/dist/assets/{vendor-codemirror-lang-go-DyTiHXo4.js → vendor-codemirror-lang-go-COZSwZYW.js} +1 -1
  54. package/dist/assets/{vendor-codemirror-lang-html-DK27qQri.js → vendor-codemirror-lang-html-CKHqhW5R.js} +1 -1
  55. package/dist/assets/{vendor-codemirror-lang-java-CvFfnhPQ.js → vendor-codemirror-lang-java-CNMP5hyC.js} +1 -1
  56. package/dist/assets/{vendor-codemirror-lang-javascript-BUlYhQ3o.js → vendor-codemirror-lang-javascript-DuOEwJ3f.js} +1 -1
  57. package/dist/assets/{vendor-codemirror-lang-jinja-wBMtAEvT.js → vendor-codemirror-lang-jinja-DaKn_b1k.js} +1 -1
  58. package/dist/assets/{vendor-codemirror-lang-json-CqayksDf.js → vendor-codemirror-lang-json-CZ07HmNC.js} +1 -1
  59. package/dist/assets/{vendor-codemirror-lang-less-Ct3-H1PB.js → vendor-codemirror-lang-less-wJdQiDBf.js} +1 -1
  60. package/dist/assets/{vendor-codemirror-lang-liquid-XspREksq.js → vendor-codemirror-lang-liquid-0z48Roi8.js} +1 -1
  61. package/dist/assets/{vendor-codemirror-lang-markdown-CvO36Y1p.js → vendor-codemirror-lang-markdown-DtcZDGqe.js} +1 -1
  62. package/dist/assets/{vendor-codemirror-lang-php-BlUF9cCe.js → vendor-codemirror-lang-php-W8plS-JQ.js} +1 -1
  63. package/dist/assets/{vendor-codemirror-lang-python-_2bIYTiJ.js → vendor-codemirror-lang-python-DzzokVau.js} +1 -1
  64. package/dist/assets/{vendor-codemirror-lang-rust-BdTYih_U.js → vendor-codemirror-lang-rust-C4ulBVpf.js} +1 -1
  65. package/dist/assets/{vendor-codemirror-lang-sass-E6MhfOFk.js → vendor-codemirror-lang-sass-BkZJYEwS.js} +1 -1
  66. package/dist/assets/{vendor-codemirror-lang-sql-B1BRhQSF.js → vendor-codemirror-lang-sql-HpQWHJjv.js} +1 -1
  67. package/dist/assets/{vendor-codemirror-lang-vue-BYQJRa1Q.js → vendor-codemirror-lang-vue-DiBPljCc.js} +1 -1
  68. package/dist/assets/{vendor-codemirror-lang-wast-D706yuyC.js → vendor-codemirror-lang-wast-DoABsogh.js} +1 -1
  69. package/dist/assets/{vendor-codemirror-lang-xml--MfWU6Dj.js → vendor-codemirror-lang-xml-BhLJhOCH.js} +1 -1
  70. package/dist/assets/{vendor-codemirror-lang-yaml-CRUFIbRX.js → vendor-codemirror-lang-yaml-D95i1Y5R.js} +1 -1
  71. package/dist/assets/{vendor-codemirror-language-E2vgV9K3.js → vendor-codemirror-language-BByA_dGF.js} +2 -2
  72. package/dist/assets/{vendor-codemirror-language-data-C7_BPMCr.js → vendor-codemirror-language-data-B5cJDWBR.js} +2 -2
  73. package/dist/assets/{vendor-codemirror-search-8kyQdB3f.js → vendor-codemirror-search-BV44140v.js} +1 -1
  74. package/dist/assets/{vendor-codemirror-view-DSzLbZiS.js → vendor-codemirror-view-Ct4T37Ue.js} +1 -1
  75. package/dist/assets/{vendor-dnd-kit-accessibility-Cv52zwWT.js → vendor-dnd-kit-accessibility-DZKKhs9S.js} +1 -1
  76. package/dist/assets/{vendor-dnd-kit-core-GipZW2tY.js → vendor-dnd-kit-core-CP8ck10N.js} +1 -1
  77. package/dist/assets/{vendor-dnd-kit-sortable-Ct2QxIHb.js → vendor-dnd-kit-sortable-B-Icjoj4.js} +1 -1
  78. package/dist/assets/{vendor-dnd-kit-utilities-CrOcp0Bp.js → vendor-dnd-kit-utilities-DTY1C6ST.js} +1 -1
  79. package/dist/assets/{vendor-elkjs-CRCLNXjf.js → vendor-elkjs-mzfkf0ML.js} +1 -1
  80. package/dist/assets/{vendor-floating-ui-dom-Bkw82kL9.js → vendor-floating-ui-dom-WyXykhNi.js} +1 -1
  81. package/dist/assets/{vendor-floating-ui-react-dom-sVFnuruh.js → vendor-floating-ui-react-dom-BZOGXAGe.js} +1 -1
  82. package/dist/assets/vendor-framer-motion-CfplGuM0.js +1 -0
  83. package/dist/assets/{vendor-heic2any-L8hyfc24.js → vendor-heic2any-BHsbokcA.js} +1 -1
  84. package/dist/assets/{vendor-lru_map-B-cPXHXW.js → vendor-lru_map-Cy8fTs3_.js} +1 -1
  85. package/dist/assets/{vendor-motion-dom-DJLgZh4Q.js → vendor-motion-dom-DhJ-sYS5.js} +1 -1
  86. package/dist/assets/{vendor-motion-utils-BGh8QBgx.js → vendor-motion-utils-CKEGc_YG.js} +1 -1
  87. package/dist/assets/{vendor-pierre-theming-C6Z4M5_u.js → vendor-pierre-theming-Dgp7B_O4.js} +1 -1
  88. package/dist/assets/{vendor-qrcode-COsmt6jn.js → vendor-qrcode-B0KNSajT.js} +1 -1
  89. package/dist/assets/{vendor-radix-ui-react-compose-refs-D1GnwnP9.js → vendor-radix-ui-react-compose-refs-8xy6TJML.js} +1 -1
  90. package/dist/assets/{vendor-radix-ui-react-context-CM4yFQ2I.js → vendor-radix-ui-react-context-CFsX-AUC.js} +1 -1
  91. package/dist/assets/{vendor-radix-ui-react-dialog-jX3Dld8c.js → vendor-radix-ui-react-dialog-D2yhEu2p.js} +1 -1
  92. package/dist/assets/{vendor-radix-ui-react-dismissable-layer-M7LsH3yL.js → vendor-radix-ui-react-dismissable-layer-DrorBNg9.js} +1 -1
  93. package/dist/assets/{vendor-radix-ui-react-focus-guards-D5MZ0nQs.js → vendor-radix-ui-react-focus-guards-BfdFmL7c.js} +1 -1
  94. package/dist/assets/{vendor-radix-ui-react-focus-scope-C2K7lNPv.js → vendor-radix-ui-react-focus-scope-D2BkImwt.js} +1 -1
  95. package/dist/assets/{vendor-radix-ui-react-id-BcxRjnbX.js → vendor-radix-ui-react-id-D2kS9K1j.js} +1 -1
  96. package/dist/assets/vendor-radix-ui-react-portal-YgCRIyi7.js +1 -0
  97. package/dist/assets/{vendor-radix-ui-react-presence-Btn-Dp7L.js → vendor-radix-ui-react-presence-D432pCMB.js} +1 -1
  98. package/dist/assets/{vendor-radix-ui-react-primitive-CfpW6_IT.js → vendor-radix-ui-react-primitive-DkH8dMOR.js} +1 -1
  99. package/dist/assets/{vendor-radix-ui-react-slot-BxUc3Pvz.js → vendor-radix-ui-react-slot-BIDFZX0-.js} +1 -1
  100. package/dist/assets/{vendor-radix-ui-react-use-callback-ref-UKEWHtoP.js → vendor-radix-ui-react-use-callback-ref-BwDcSoGV.js} +1 -1
  101. package/dist/assets/{vendor-radix-ui-react-use-controllable-state-C_ecoh35.js → vendor-radix-ui-react-use-controllable-state-LiqmKSXO.js} +1 -1
  102. package/dist/assets/vendor-radix-ui-react-use-effect-event-D94va83M.js +1 -0
  103. package/dist/assets/{vendor-radix-ui-react-use-escape-keydown-Co13lHGj.js → vendor-radix-ui-react-use-escape-keydown-DTkqjenV.js} +1 -1
  104. package/dist/assets/vendor-radix-ui-react-use-layout-effect-C8Yrsaph.js +1 -0
  105. package/dist/assets/{vendor-react-DYyjh7Q0.js → vendor-react-B5Z1Mdn3.js} +1 -1
  106. package/dist/assets/{vendor-react-drawio-Boqanm0j.js → vendor-react-drawio-BYDptOsj.js} +1 -1
  107. package/dist/assets/{vendor-react-remove-scroll-bar-C9YRs2nU.js → vendor-react-remove-scroll-bar-CSAHp1YF.js} +1 -1
  108. package/dist/assets/{vendor-react-remove-scroll-CfeMe0DL.js → vendor-react-remove-scroll-vR1dy1aP.js} +1 -1
  109. package/dist/assets/{vendor-react-style-singleton-B1H4bWSG.js → vendor-react-style-singleton-Ctw6HnYx.js} +1 -1
  110. package/dist/assets/{vendor-replit-codemirror-vim-BJY5fGLS.js → vendor-replit-codemirror-vim-CGHHNQxC.js} +1 -1
  111. package/dist/assets/{vendor-sonner-CW8w438f.js → vendor-sonner-BDtm25td.js} +1 -1
  112. package/dist/assets/{vendor-tanstack-react-virtual-IrbCBGJ4.js → vendor-tanstack-react-virtual-2skouoFw.js} +1 -1
  113. package/dist/assets/{vendor-use-callback-ref-CJB0R85I.js → vendor-use-callback-ref-CVVuCyLj.js} +1 -1
  114. package/dist/assets/{vendor-use-sidecar-C-AuTczP.js → vendor-use-sidecar-Vv4V8Nd1.js} +1 -1
  115. package/dist/assets/{vendor-use-sync-external-store-B7OScDIw.js → vendor-use-sync-external-store-D0AXkdQC.js} +1 -1
  116. package/dist/assets/{vendor-zustand-CnsBKjP5.js → vendor-zustand-GVb4H8HE.js} +1 -1
  117. package/dist/assets/{web-components-BYNCGylQ.js → web-components-0H9kvZwn.js} +2 -2
  118. package/dist/index.html +6 -6
  119. package/dist/mini-chat.html +5 -5
  120. package/dist/mobile.html +5 -5
  121. package/package.json +1 -1
  122. package/server/lib/git/DOCUMENTATION.md +3 -2
  123. package/server/lib/git/routes.js +27 -0
  124. package/server/lib/git/routes.test.js +41 -0
  125. package/server/lib/git/service.js +7 -1
  126. package/server/lib/git/service.test.js +23 -0
  127. package/server/lib/pi/routes.js +263 -6
  128. package/server/lib/pi/routes.test.js +314 -1
  129. package/server/lib/pi/session-daemon/DOCUMENTATION.md +2 -2
  130. package/server/lib/pi/session-daemon/prompt-operations.test.js +318 -0
  131. package/server/lib/pi/session-daemon/session-daemon.js +309 -25
  132. package/server/lib/pi/session-daemon/session-daemon.test.js +137 -0
  133. package/server/lib/pi/session-daemon/supervisor.test.js +1 -1
  134. package/server/lib/pi/snippets-store.js +400 -0
  135. package/server/lib/pi/snippets-store.test.js +252 -0
  136. package/server/lib/relay/host-client.test.js +79 -15
  137. package/server/lib/server/cors.js +4 -0
  138. package/server/lib/server/cors.test.js +8 -5
  139. package/dist/assets/CommitSection-DfAlM30E.js +0 -1
  140. package/dist/assets/DiagramView-DKLIwNth.js +0 -1
  141. package/dist/assets/DiffView-CZyqSs5W.js +0 -18
  142. package/dist/assets/FilesView-rftA7fEL.js +0 -14
  143. package/dist/assets/GitView-D5LMTT2M.js +0 -6
  144. package/dist/assets/JsonTreeView-DMI3-Smy.js +0 -1
  145. package/dist/assets/MarkdownRendererImpl-gdd-5n9J.js +0 -12
  146. package/dist/assets/PatchDiff-GNB1NlAN.js +0 -1
  147. package/dist/assets/PierreDiffViewer-DmJv2AoJ.js +0 -136
  148. package/dist/assets/SessionSwitcherContent-CWdDPll7.js +0 -1
  149. package/dist/assets/SessionSwitcherDropdown-Cx-Jfmvo.js +0 -2
  150. package/dist/assets/SessionUnreadDot-CKe4uVcf.js +0 -1
  151. package/dist/assets/SettingsView-DaxkNy5C.js +0 -4
  152. package/dist/assets/SettingsWindow-D1M_rRDo.js +0 -1
  153. package/dist/assets/ToolOutputDialog-CUKcp77A.js +0 -15
  154. package/dist/assets/ToolPartDiffPreview-CkzwXAC5.js +0 -8
  155. package/dist/assets/collapsible-B0cIItyf.js +0 -1
  156. package/dist/assets/computeVirtualFileMetrics-B1uVA58l.js +0 -3
  157. package/dist/assets/contextFileOpenGuard-BuedQ5EQ.js +0 -1
  158. package/dist/assets/index-BA67uOfZ.js +0 -1
  159. package/dist/assets/index-CcbDTf8Q.js +0 -8
  160. package/dist/assets/index-Cl3XbCeC.css +0 -1
  161. package/dist/assets/isDiffPlainText-DLDFLL6P.js +0 -1
  162. package/dist/assets/isFilePlainText-B2wwrpRU.js +0 -1
  163. package/dist/assets/main-B5k0qpHJ.js +0 -133
  164. package/dist/assets/main-Bepu8Jr9.js +0 -2
  165. package/dist/assets/miniChat-Co0Snpgl.js +0 -2
  166. package/dist/assets/mobile-CSvL_Zyu.js +0 -2
  167. package/dist/assets/registerCustomTheme-BBXUCRnG.js +0 -1
  168. package/dist/assets/renderElectronMiniChatApp-DrMJ1RXX.js +0 -2
  169. package/dist/assets/renderMobileApp-B2toAnMW.js +0 -14
  170. package/dist/assets/themeResolver-BmJyTmjJ.js +0 -1
  171. package/dist/assets/useInlineCommentController-CxMP78jg.js +0 -2
  172. package/dist/assets/usePanelSlide-DUuoQt5X.js +0 -56
  173. package/dist/assets/usePushVisibilityBeacon-CSPdFBaA.js +0 -10
  174. package/dist/assets/useSwitcherItems-zOeC2Cta.js +0 -1
  175. package/dist/assets/vendor-base-ui-DL8r2fgQ.js +0 -1
  176. package/dist/assets/vendor-framer-motion-DJASDzNt.js +0 -1
  177. package/dist/assets/vendor-radix-ui-react-portal-xlJWBfDg.js +0 -1
  178. package/dist/assets/vendor-radix-ui-react-use-effect-event-DkJl_Rn_.js +0 -1
  179. package/dist/assets/vendor-radix-ui-react-use-layout-effect-0fyGwS2_.js +0 -1
  180. package/dist/assets/vendor-remixicon-react-CzPq62YO.js +0 -1
  181. /package/dist/assets/{usePanelSlide-BV3KOtdA.css → runtimeEndpointReset-BV3KOtdA.css} +0 -0
@@ -1 +1 @@
1
- import{f as st,s as rt,c as ct,o as lt,h as ft,a as at,l as ut}from"./vendor-floating-ui-core-CXmKXOXc.js";import{D as N,b as v,E as b,F as m,e as L,G as U,g as R,u as P,i as T,H as A,I as $,k as W,j as z,J as ht,K as Q,L as dt,A as E,z as V,c as _,l as k,M as H,f as D,h as Y}from"./vendor-floating-ui-utils-BzXdqYpP.js";function Z(t){const e=R(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=T(t),r=o?t.offsetWidth:i,s=o?t.offsetHeight:n,c=A(i)!==r||A(n)!==s;return c&&(i=r,n=s),{width:i,height:n,$:c}}function q(t){return v(t)?t:t.contextElement}function F(t){const e=q(t);if(!T(e))return m(1);const i=e.getBoundingClientRect(),{width:n,height:o,$:r}=Z(e);let s=(r?A(i.width):i.width)/n,c=(r?A(i.height):i.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const gt=m(0);function tt(t){const e=L(t);return!Y()||!e.visualViewport?gt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function pt(t,e,i){return e===void 0&&(e=!1),!i||e&&i!==L(t)?!1:e}function O(t,e,i,n){e===void 0&&(e=!1),i===void 0&&(i=!1);const o=t.getBoundingClientRect(),r=q(t);let s=m(1);e&&(n?v(n)&&(s=F(n)):s=F(t));const c=pt(r,i,n)?tt(r):m(0);let l=(o.left+c.x)/s.x,f=(o.top+c.y)/s.y,a=o.width/s.x,h=o.height/s.y;if(r){const d=L(r),u=n&&v(n)?L(n):n;let y=d,p=U(y);for(;p&&n&&u!==y;){const w=F(p),g=p.getBoundingClientRect(),x=R(p),C=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,S=g.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,f*=w.y,a*=w.x,h*=w.y,l+=C,f+=S,y=L(p),p=U(y)}}return P({width:a,height:h,x:l,y:f})}function I(t,e){const i=H(t).scrollLeft;return e?e.left+i:O(b(t)).left+i}function et(t,e){const i=t.getBoundingClientRect(),n=i.left+e.scrollLeft-I(t,i),o=i.top+e.scrollTop;return{x:n,y:o}}function yt(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t;const r=o==="fixed",s=b(n),c=e?$(e.floating):!1;if(n===s||c&&r)return i;let l={scrollLeft:0,scrollTop:0},f=m(1);const a=m(0),h=T(n);if((h||!h&&!r)&&((_(n)!=="body"||k(s))&&(l=H(n)),h)){const u=O(n);f=F(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}const d=s&&!h&&!r?et(s,l):m(0);return{width:i.width*f.x,height:i.height*f.y,x:i.x*f.x-l.scrollLeft*f.x+a.x+d.x,y:i.y*f.y-l.scrollTop*f.y+a.y+d.y}}function wt(t){return Array.from(t.getClientRects())}function mt(t){const e=b(t),i=H(t),n=t.ownerDocument.body,o=E(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=E(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-i.scrollLeft+I(t);const c=-i.scrollTop;return R(n).direction==="rtl"&&(s+=E(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:c}}const j=25;function xt(t,e){const i=L(t),n=b(t),o=i.visualViewport;let r=n.clientWidth,s=n.clientHeight,c=0,l=0;if(o){r=o.width,s=o.height;const a=Y();(!a||a&&e==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const f=I(n);if(f<=0){const a=n.ownerDocument,h=a.body,d=getComputedStyle(h),u=a.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,y=Math.abs(n.clientWidth-h.clientWidth-u);y<=j&&(r-=y)}else f<=j&&(r+=f);return{width:r,height:s,x:c,y:l}}function vt(t,e){const i=O(t,!0,e==="fixed"),n=i.top+t.clientTop,o=i.left+t.clientLeft,r=T(t)?F(t):m(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=o*r.x,f=n*r.y;return{width:s,height:c,x:l,y:f}}function G(t,e,i){let n;if(e==="viewport")n=xt(t,i);else if(e==="document")n=mt(b(t));else if(v(e))n=vt(e,i);else{const o=tt(t);n={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return P(n)}function it(t,e){const i=W(t);return i===e||!v(i)||z(i)?!1:R(i).position==="fixed"||it(i,e)}function Rt(t,e){const i=e.get(t);if(i)return i;let n=N(t,[],!1).filter(c=>v(c)&&_(c)!=="body"),o=null;const r=R(t).position==="fixed";let s=r?W(t):t;for(;v(s)&&!z(s);){const c=R(s),l=Q(s);!l&&c.position==="fixed"&&(o=null),(r?!l&&!o:!l&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||k(s)&&!l&&it(t,s))?n=n.filter(a=>a!==s):o=c,s=W(s)}return e.set(t,n),n}function bt(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const s=[...i==="clippingAncestors"?$(e)?[]:Rt(e,this._c):[].concat(i),n],c=G(e,s[0],o);let l=c.top,f=c.right,a=c.bottom,h=c.left;for(let d=1;d<s.length;d++){const u=G(e,s[d],o);l=E(u.top,l),f=V(u.right,f),a=V(u.bottom,a),h=E(u.left,h)}return{width:f-h,height:a-l,x:h,y:l}}function Ct(t){const{width:e,height:i}=Z(t);return{width:e,height:i}}function Lt(t,e,i){const n=T(e),o=b(e),r=i==="fixed",s=O(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const l=m(0);function f(){l.x=I(o)}if(n||!n&&!r)if((_(e)!=="body"||k(o))&&(c=H(e)),n){const u=O(e,!0,r,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else o&&f();r&&!n&&o&&f();const a=o&&!n&&!r?et(o,c):m(0),h=s.left+c.scrollLeft-l.x-a.x,d=s.top+c.scrollTop-l.y-a.y;return{x:h,y:d,width:s.width,height:s.height}}function M(t){return R(t).position==="static"}function J(t,e){if(!T(t)||R(t).position==="fixed")return null;if(e)return e(t);let i=t.offsetParent;return b(t)===i&&(i=i.ownerDocument.body),i}function nt(t,e){const i=L(t);if($(t))return i;if(!T(t)){let o=W(t);for(;o&&!z(o);){if(v(o)&&!M(o))return o;o=W(o)}return i}let n=J(t,e);for(;n&&ht(n)&&M(n);)n=J(n,e);return n&&z(n)&&M(n)&&!Q(n)?i:n||dt(t)||i}const Ot=async function(t){const e=this.getOffsetParent||nt,i=this.getDimensions,n=await i(t.floating);return{reference:Lt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Tt(t){return R(t).direction==="rtl"}const Et={convertOffsetParentRelativeRectToViewportRelativeRect:yt,getDocumentElement:b,getClippingRect:bt,getOffsetParent:nt,getElementRects:Ot,getClientRects:wt,getDimensions:Ct,getScale:F,isElement:v,isRTL:Tt};function ot(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ft(t,e){let i=null,n;const o=b(t);function r(){var c;clearTimeout(n),(c=i)==null||c.disconnect(),i=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();const f=t.getBoundingClientRect(),{left:a,top:h,width:d,height:u}=f;if(c||e(),!d||!u)return;const y=D(h),p=D(o.clientWidth-(a+d)),w=D(o.clientHeight-(h+u)),g=D(a),C={rootMargin:-y+"px "+-p+"px "+-w+"px "+-g+"px",threshold:E(0,V(1,l))||1};let S=!0;function X(K){const B=K[0].intersectionRatio;if(B!==l){if(!S)return s();B?s(!1,B):n=setTimeout(()=>{s(!1,1e-7)},1e3)}B===1&&!ot(f,t.getBoundingClientRect())&&s(),S=!1}try{i=new IntersectionObserver(X,{...C,root:o.ownerDocument})}catch{i=new IntersectionObserver(X,C)}i.observe(t)}return s(!0),r}function Bt(t,e,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,f=q(t),a=o||r?[...f?N(f):[],...e?N(e):[]]:[];a.forEach(g=>{o&&g.addEventListener("scroll",i,{passive:!0}),r&&g.addEventListener("resize",i)});const h=f&&c?Ft(f,i):null;let d=-1,u=null;s&&(u=new ResizeObserver(g=>{let[x]=g;x&&x.target===f&&u&&e&&(u.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=u)==null||C.observe(e)})),i()}),f&&!l&&u.observe(f),e&&u.observe(e));let y,p=l?O(t):null;l&&w();function w(){const g=O(t);p&&!ot(p,g)&&i(),p=g,y=requestAnimationFrame(w)}return i(),()=>{var g;a.forEach(x=>{o&&x.removeEventListener("scroll",i),r&&x.removeEventListener("resize",i)}),h?.(),(g=u)==null||g.disconnect(),u=null,l&&cancelAnimationFrame(y)}}const Dt=lt,At=at,zt=st,Ht=rt,It=ft,Mt=ut,Nt=(t,e,i)=>{const n=new Map,o={platform:Et,...i},r={...o.platform,_c:n};return ct(t,e,{...o,platform:r})};export{Bt as a,At as b,Nt as c,zt as f,It as h,Mt as l,Dt as o,Et as p,Ht as s};
1
+ import{f as st,s as rt,c as ct,o as lt,h as ft,a as at,l as ut}from"./vendor-floating-ui-core-CXmKXOXc.js";import{D as N,b as v,E as b,F as m,e as L,G as U,g as R,u as P,f as D,i as T,H as A,h as Q,I as $,k as W,j as z,J as ht,K as Y,L as dt,A as E,z as V,c as _,l as k,M as H}from"./vendor-floating-ui-utils-BzXdqYpP.js";function Z(t){const e=R(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=T(t),r=o?t.offsetWidth:i,s=o?t.offsetHeight:n,c=A(i)!==r||A(n)!==s;return c&&(i=r,n=s),{width:i,height:n,$:c}}function q(t){return v(t)?t:t.contextElement}function F(t){const e=q(t);if(!T(e))return m(1);const i=e.getBoundingClientRect(),{width:n,height:o,$:r}=Z(e);let s=(r?A(i.width):i.width)/n,c=(r?A(i.height):i.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const gt=m(0);function tt(t){const e=L(t);return!Q()||!e.visualViewport?gt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function pt(t,e,i){return e===void 0&&(e=!1),!i||e&&i!==L(t)?!1:e}function O(t,e,i,n){e===void 0&&(e=!1),i===void 0&&(i=!1);const o=t.getBoundingClientRect(),r=q(t);let s=m(1);e&&(n?v(n)&&(s=F(n)):s=F(t));const c=pt(r,i,n)?tt(r):m(0);let l=(o.left+c.x)/s.x,f=(o.top+c.y)/s.y,a=o.width/s.x,h=o.height/s.y;if(r){const d=L(r),u=n&&v(n)?L(n):n;let y=d,p=U(y);for(;p&&n&&u!==y;){const w=F(p),g=p.getBoundingClientRect(),x=R(p),C=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,S=g.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,f*=w.y,a*=w.x,h*=w.y,l+=C,f+=S,y=L(p),p=U(y)}}return P({width:a,height:h,x:l,y:f})}function I(t,e){const i=H(t).scrollLeft;return e?e.left+i:O(b(t)).left+i}function et(t,e){const i=t.getBoundingClientRect(),n=i.left+e.scrollLeft-I(t,i),o=i.top+e.scrollTop;return{x:n,y:o}}function yt(t){let{elements:e,rect:i,offsetParent:n,strategy:o}=t;const r=o==="fixed",s=b(n),c=e?$(e.floating):!1;if(n===s||c&&r)return i;let l={scrollLeft:0,scrollTop:0},f=m(1);const a=m(0),h=T(n);if((h||!h&&!r)&&((_(n)!=="body"||k(s))&&(l=H(n)),h)){const u=O(n);f=F(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}const d=s&&!h&&!r?et(s,l):m(0);return{width:i.width*f.x,height:i.height*f.y,x:i.x*f.x-l.scrollLeft*f.x+a.x+d.x,y:i.y*f.y-l.scrollTop*f.y+a.y+d.y}}function wt(t){return Array.from(t.getClientRects())}function mt(t){const e=b(t),i=H(t),n=t.ownerDocument.body,o=E(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=E(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-i.scrollLeft+I(t);const c=-i.scrollTop;return R(n).direction==="rtl"&&(s+=E(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:c}}const j=25;function xt(t,e){const i=L(t),n=b(t),o=i.visualViewport;let r=n.clientWidth,s=n.clientHeight,c=0,l=0;if(o){r=o.width,s=o.height;const a=Q();(!a||a&&e==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}const f=I(n);if(f<=0){const a=n.ownerDocument,h=a.body,d=getComputedStyle(h),u=a.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,y=Math.abs(n.clientWidth-h.clientWidth-u);y<=j&&(r-=y)}else f<=j&&(r+=f);return{width:r,height:s,x:c,y:l}}function vt(t,e){const i=O(t,!0,e==="fixed"),n=i.top+t.clientTop,o=i.left+t.clientLeft,r=T(t)?F(t):m(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=o*r.x,f=n*r.y;return{width:s,height:c,x:l,y:f}}function G(t,e,i){let n;if(e==="viewport")n=xt(t,i);else if(e==="document")n=mt(b(t));else if(v(e))n=vt(e,i);else{const o=tt(t);n={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return P(n)}function it(t,e){const i=W(t);return i===e||!v(i)||z(i)?!1:R(i).position==="fixed"||it(i,e)}function Rt(t,e){const i=e.get(t);if(i)return i;let n=N(t,[],!1).filter(c=>v(c)&&_(c)!=="body"),o=null;const r=R(t).position==="fixed";let s=r?W(t):t;for(;v(s)&&!z(s);){const c=R(s),l=Y(s);!l&&c.position==="fixed"&&(o=null),(r?!l&&!o:!l&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||k(s)&&!l&&it(t,s))?n=n.filter(a=>a!==s):o=c,s=W(s)}return e.set(t,n),n}function bt(t){let{element:e,boundary:i,rootBoundary:n,strategy:o}=t;const s=[...i==="clippingAncestors"?$(e)?[]:Rt(e,this._c):[].concat(i),n],c=G(e,s[0],o);let l=c.top,f=c.right,a=c.bottom,h=c.left;for(let d=1;d<s.length;d++){const u=G(e,s[d],o);l=E(u.top,l),f=V(u.right,f),a=V(u.bottom,a),h=E(u.left,h)}return{width:f-h,height:a-l,x:h,y:l}}function Ct(t){const{width:e,height:i}=Z(t);return{width:e,height:i}}function Lt(t,e,i){const n=T(e),o=b(e),r=i==="fixed",s=O(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const l=m(0);function f(){l.x=I(o)}if(n||!n&&!r)if((_(e)!=="body"||k(o))&&(c=H(e)),n){const u=O(e,!0,r,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else o&&f();r&&!n&&o&&f();const a=o&&!n&&!r?et(o,c):m(0),h=s.left+c.scrollLeft-l.x-a.x,d=s.top+c.scrollTop-l.y-a.y;return{x:h,y:d,width:s.width,height:s.height}}function M(t){return R(t).position==="static"}function J(t,e){if(!T(t)||R(t).position==="fixed")return null;if(e)return e(t);let i=t.offsetParent;return b(t)===i&&(i=i.ownerDocument.body),i}function nt(t,e){const i=L(t);if($(t))return i;if(!T(t)){let o=W(t);for(;o&&!z(o);){if(v(o)&&!M(o))return o;o=W(o)}return i}let n=J(t,e);for(;n&&ht(n)&&M(n);)n=J(n,e);return n&&z(n)&&M(n)&&!Y(n)?i:n||dt(t)||i}const Ot=async function(t){const e=this.getOffsetParent||nt,i=this.getDimensions,n=await i(t.floating);return{reference:Lt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Tt(t){return R(t).direction==="rtl"}const Et={convertOffsetParentRelativeRectToViewportRelativeRect:yt,getDocumentElement:b,getClippingRect:bt,getOffsetParent:nt,getElementRects:Ot,getClientRects:wt,getDimensions:Ct,getScale:F,isElement:v,isRTL:Tt};function ot(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ft(t,e){let i=null,n;const o=b(t);function r(){var c;clearTimeout(n),(c=i)==null||c.disconnect(),i=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();const f=t.getBoundingClientRect(),{left:a,top:h,width:d,height:u}=f;if(c||e(),!d||!u)return;const y=D(h),p=D(o.clientWidth-(a+d)),w=D(o.clientHeight-(h+u)),g=D(a),C={rootMargin:-y+"px "+-p+"px "+-w+"px "+-g+"px",threshold:E(0,V(1,l))||1};let S=!0;function X(K){const B=K[0].intersectionRatio;if(B!==l){if(!S)return s();B?s(!1,B):n=setTimeout(()=>{s(!1,1e-7)},1e3)}B===1&&!ot(f,t.getBoundingClientRect())&&s(),S=!1}try{i=new IntersectionObserver(X,{...C,root:o.ownerDocument})}catch{i=new IntersectionObserver(X,C)}i.observe(t)}return s(!0),r}function Bt(t,e,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,f=q(t),a=o||r?[...f?N(f):[],...e?N(e):[]]:[];a.forEach(g=>{o&&g.addEventListener("scroll",i,{passive:!0}),r&&g.addEventListener("resize",i)});const h=f&&c?Ft(f,i):null;let d=-1,u=null;s&&(u=new ResizeObserver(g=>{let[x]=g;x&&x.target===f&&u&&e&&(u.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=u)==null||C.observe(e)})),i()}),f&&!l&&u.observe(f),e&&u.observe(e));let y,p=l?O(t):null;l&&w();function w(){const g=O(t);p&&!ot(p,g)&&i(),p=g,y=requestAnimationFrame(w)}return i(),()=>{var g;a.forEach(x=>{o&&x.removeEventListener("scroll",i),r&&x.removeEventListener("resize",i)}),h?.(),(g=u)==null||g.disconnect(),u=null,l&&cancelAnimationFrame(y)}}const Dt=lt,At=at,zt=st,Ht=rt,It=ft,Mt=ut,Nt=(t,e,i)=>{const n=new Map,o={platform:Et,...i},r={...o.platform,_c:n};return ct(t,e,{...o,platform:r})};export{Bt as a,At as b,Nt as c,zt as f,It as h,Mt as l,Dt as o,Et as p,Ht as s};
@@ -1 +1 @@
1
- import{f as H,s as I,c as J,o as K,h as N,b as Q,l as T}from"./vendor-floating-ui-dom-Bkw82kL9.js";import{r,b as U}from"./vendor-react-DYyjh7Q0.js";var X=typeof document<"u",Y=function(){},R=X?r.useLayoutEffect:Y;function w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!w(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=n;o--!==0;){const p=a[o];if(!(p==="_owner"&&e.$$typeof)&&!w(e[p],t[p]))return!1}return!0}return e!==e&&t!==t}function z(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function O(e,t){const n=z(e);return Math.round(t*n)/n}function $(e){const t=r.useRef(e);return R(()=>{t.current=e}),t}function te(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:a,elements:{reference:p,floating:A}={},transform:k=!0,whileElementsMounted:D,open:x}=e,[f,C]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[M,q]=r.useState(o);w(M,o)||q(o);const[B,V]=r.useState(null),[W,b]=r.useState(null),_=r.useCallback(s=>{s!==c.current&&(c.current=s,V(s))},[]),v=r.useCallback(s=>{s!==m.current&&(m.current=s,b(s))},[]),i=p||B,u=A||W,c=r.useRef(null),m=r.useRef(null),y=r.useRef(f),G=D!=null,S=$(D),P=$(a),F=$(x),g=r.useCallback(()=>{if(!c.current||!m.current)return;const s={placement:t,strategy:n,middleware:M};P.current&&(s.platform=P.current),J(c.current,m.current,s).then(h=>{const d={...h,isPositioned:F.current!==!1};E.current&&!w(y.current,d)&&(y.current=d,U.flushSync(()=>{C(d)}))})},[M,t,n,P,F]);R(()=>{x===!1&&y.current.isPositioned&&(y.current.isPositioned=!1,C(s=>({...s,isPositioned:!1})))},[x]);const E=r.useRef(!1);R(()=>(E.current=!0,()=>{E.current=!1}),[]),R(()=>{if(i&&(c.current=i),u&&(m.current=u),i&&u){if(S.current)return S.current(i,u,g);g()}},[i,u,g,S,G]);const j=r.useMemo(()=>({reference:c,floating:m,setReference:_,setFloating:v}),[_,v]),l=r.useMemo(()=>({reference:i,floating:u}),[i,u]),L=r.useMemo(()=>{const s={position:n,left:0,top:0};if(!l.floating)return s;const h=O(l.floating,f.x),d=O(l.floating,f.y);return k?{...s,transform:"translate("+h+"px, "+d+"px)",...z(l.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:h,top:d}},[n,k,l.floating,f.x,f.y]);return r.useMemo(()=>({...f,update:g,refs:j,elements:l,floatingStyles:L}),[f,g,j,l,L])}const ne=(e,t)=>{const n=K(e);return{name:n.name,fn:n.fn,options:[e,t]}},re=(e,t)=>{const n=Q(e);return{name:n.name,fn:n.fn,options:[e,t]}},se=(e,t)=>({fn:T(e).fn,options:[e,t]}),oe=(e,t)=>{const n=H(e);return{name:n.name,fn:n.fn,options:[e,t]}},fe=(e,t)=>{const n=I(e);return{name:n.name,fn:n.fn,options:[e,t]}},ie=(e,t)=>{const n=N(e);return{name:n.name,fn:n.fn,options:[e,t]}};export{re as a,oe as f,ie as h,se as l,ne as o,fe as s,te as u};
1
+ import{f as H,s as I,c as J,o as K,h as N,b as Q,l as T}from"./vendor-floating-ui-dom-WyXykhNi.js";import{r,b as U}from"./vendor-react-B5Z1Mdn3.js";var X=typeof document<"u",Y=function(){},R=X?r.useLayoutEffect:Y;function w(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!w(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=n;o--!==0;){const p=a[o];if(!(p==="_owner"&&e.$$typeof)&&!w(e[p],t[p]))return!1}return!0}return e!==e&&t!==t}function z(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function O(e,t){const n=z(e);return Math.round(t*n)/n}function $(e){const t=r.useRef(e);return R(()=>{t.current=e}),t}function te(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:a,elements:{reference:p,floating:A}={},transform:k=!0,whileElementsMounted:D,open:x}=e,[f,C]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[M,q]=r.useState(o);w(M,o)||q(o);const[B,V]=r.useState(null),[W,b]=r.useState(null),_=r.useCallback(s=>{s!==c.current&&(c.current=s,V(s))},[]),v=r.useCallback(s=>{s!==m.current&&(m.current=s,b(s))},[]),i=p||B,u=A||W,c=r.useRef(null),m=r.useRef(null),y=r.useRef(f),G=D!=null,S=$(D),P=$(a),F=$(x),g=r.useCallback(()=>{if(!c.current||!m.current)return;const s={placement:t,strategy:n,middleware:M};P.current&&(s.platform=P.current),J(c.current,m.current,s).then(h=>{const d={...h,isPositioned:F.current!==!1};E.current&&!w(y.current,d)&&(y.current=d,U.flushSync(()=>{C(d)}))})},[M,t,n,P,F]);R(()=>{x===!1&&y.current.isPositioned&&(y.current.isPositioned=!1,C(s=>({...s,isPositioned:!1})))},[x]);const E=r.useRef(!1);R(()=>(E.current=!0,()=>{E.current=!1}),[]),R(()=>{if(i&&(c.current=i),u&&(m.current=u),i&&u){if(S.current)return S.current(i,u,g);g()}},[i,u,g,S,G]);const j=r.useMemo(()=>({reference:c,floating:m,setReference:_,setFloating:v}),[_,v]),l=r.useMemo(()=>({reference:i,floating:u}),[i,u]),L=r.useMemo(()=>{const s={position:n,left:0,top:0};if(!l.floating)return s;const h=O(l.floating,f.x),d=O(l.floating,f.y);return k?{...s,transform:"translate("+h+"px, "+d+"px)",...z(l.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:h,top:d}},[n,k,l.floating,f.x,f.y]);return r.useMemo(()=>({...f,update:g,refs:j,elements:l,floatingStyles:L}),[f,g,j,l,L])}const ne=(e,t)=>{const n=K(e);return{name:n.name,fn:n.fn,options:[e,t]}},re=(e,t)=>{const n=Q(e);return{name:n.name,fn:n.fn,options:[e,t]}},se=(e,t)=>({fn:T(e).fn,options:[e,t]}),oe=(e,t)=>{const n=H(e);return{name:n.name,fn:n.fn,options:[e,t]}},fe=(e,t)=>{const n=I(e);return{name:n.name,fn:n.fn,options:[e,t]}},ie=(e,t)=>{const n=N(e);return{name:n.name,fn:n.fn,options:[e,t]}};export{re as a,oe as f,ie as h,se as l,ne as o,fe as s,te as u};
@@ -0,0 +1 @@
1
+ import{r as ge,m as W,i as Y,d as ve,c as ye,f as Pe,a as Se,b as we,e as Ee,S as Bt,H as Nt,v as $,O as xe,g as Ce,h as Me,j as Ut,s as Ae,G as Ve,k as De,l as zt,n as _t,o as wt,p as Le,q as be,t as Te,u as Ie,w as ke,x as Fe,y as $t,z as Oe,A as Re,B as je,C as Ge,F as L,D as We,E as Kt,I as K,J as Et,K as x,L as He,M as ot,N as Be,P as D,Q as Ne,R as Ue,T as ze,U as xt,V as _e,W as $e,X as Ct,Y as Ke,Z as Xe,_ as Ye,$ as qe,a0 as Xt,a1 as Je,a2 as Ze}from"./vendor-motion-dom-DhJ-sYS5.js";import{w as Yt,u as qt,s as it,a as rt,p as Jt,m as Qe,c as tn,n as _}from"./vendor-motion-utils-CKEGc_YG.js";import{r as d,j as at}from"./vendor-react-B5Z1Mdn3.js";function ct(e){return typeof e=="object"&&!Array.isArray(e)}function Zt(e,t,n,s){return e==null?[]:typeof e=="string"&&ct(t)?ge(e,n,s):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(o=>o!=null):[e]}function en(e,t,n){return e*(t+1)}function Mt(e,t,n,s){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):s.get(t)??e}function nn(e,t,n){for(let s=0;s<e.length;s++){const o=e[s];o.at>t&&o.at<n&&(qt(e,o),s--)}}function sn(e,t,n,s,o,i){nn(e,o,i);for(let r=0;r<t.length;r++)e.push({value:t[r],at:W(o,i,s[r]),easing:Yt(n,r)})}function on(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function rn(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const an="easeInOut";function un(e,{defaultTransition:t={},...n}={},s,o){const i=t.duration||.3,r=new Map,a=new Map,c={},l=new Map;let p=0,u=0,f=0;for(let m=0;m<e.length;m++){const h=e[m];if(typeof h=="string"){l.set(h,u);continue}else if(!Array.isArray(h)){l.set(h.name,Mt(u,h.at,p,l));continue}let[P,y,g={}]=h;g.at!==void 0&&(u=Mt(u,g.at,p,l));let v=0;const S=(E,b,A,T=0,k=0)=>{const w=ln(E),{delay:F=0,times:C=ve(w),type:J=t.type||"keyframes",repeat:B,repeatType:Ds,repeatDelay:Ls=0,...pe}=b;let{ease:V=t.ease||"easeOut",duration:M}=b;const pt=typeof F=="function"?F(T,k):F,gt=w.length,vt=Se(J)?J:o?.[J||"keyframes"];if(gt<=2&&vt){let O=100;if(gt===2&&hn(w)){const R=w[1]-w[0];O=Math.abs(R)}const N={...t,...pe};M!==void 0&&(N.duration=it(M));const U=ye(N,O,vt);V=U.ease,M=U.duration}M??(M=i);const yt=u+pt;C.length===1&&C[0]===0&&(C[1]=1);const Pt=C.length-w.length;if(Pt>0&&Pe(C,Pt),w.length===1&&w.unshift(null),B){M=en(M,B);const O=[...w],N=[...C];V=Array.isArray(V)?[...V]:[V];const U=[...V];for(let R=0;R<B;R++){w.push(...O);for(let j=0;j<O.length;j++)C.push(N[j]+(R+1)),V.push(j===0?"linear":Yt(U,j-1))}on(C,B)}const St=yt+M;sn(A,w,V,C,yt,St),v=Math.max(pt+M,v),f=Math.max(St,f)};if(Y(P)){const E=At(P,a);S(y,g,Vt("default",E))}else{const E=Zt(P,y,s,c),b=E.length;for(let A=0;A<b;A++){y=y,g=g;const T=E[A],k=At(T,a);for(const w in y)S(y[w],cn(g,w),Vt(w,k),A,b)}}p=u,u+=v}return a.forEach((m,h)=>{for(const P in m){const y=m[P];y.sort(rn);const g=[],v=[],S=[];for(let T=0;T<y.length;T++){const{at:k,value:w,easing:F}=y[T];g.push(w),v.push(rt(0,f,k)),S.push(F||"easeOut")}v[0]!==0&&(v.unshift(0),g.unshift(g[0]),S.unshift(an)),v[v.length-1]!==1&&(v.push(1),g.push(null)),r.has(h)||r.set(h,{keyframes:{},transition:{}});const E=r.get(h);E.keyframes[P]=g;const{type:b,...A}=t;E.transition[P]={...A,duration:f,ease:S,times:v,...n}}}),r}function At(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Vt(e,t){return t[e]||(t[e]=[]),t[e]}function ln(e){return Array.isArray(e)?e:[e]}function cn(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const fn=e=>typeof e=="number",hn=e=>e.every(fn);function dn(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=we(e)&&!Ee(e)?new Bt(t):new Nt(t);n.mount(e),$.set(e,n)}function mn(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new xe(t);n.mount(e),$.set(e,n)}function pn(e,t){return Y(e)||typeof e=="number"||typeof e=="string"&&!ct(t)}function Qt(e,t,n,s){const o=[];if(pn(e,t))o.push(Ce(e,ct(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return o;const i=Zt(e,t,s),r=i.length;for(let a=0;a<r;a++){const c=i[a],l=c instanceof Element?dn:mn;$.has(c)||l(c);const p=$.get(c),u={...n};"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(a,r)),o.push(...Me(p,{...t,transition:u},{}))}}return o}function gn(e,t,n){const s=[],o=e.map(r=>{if(Array.isArray(r)&&typeof r[0]=="function"){const a=r[0],c=Ut(0);return c.on("change",a),r.length===1?[c,[0,1]]:r.length===2?[c,[0,1],r[1]]:[c,r[1],r[2]]}return r});return un(o,t,n,{spring:Ae}).forEach(({keyframes:r,transition:a},c)=>{s.push(...Qt(c,r,a))}),s}function vn(e){return Array.isArray(e)&&e.some(Array.isArray)}function yn(e={}){const{scope:t,reduceMotion:n}=e;function s(o,i,r){let a=[],c;if(vn(o))a=gn(o,n!==void 0?{reduceMotion:n,...i}:i,t);else{const{onComplete:p,...u}=r||{};typeof p=="function"&&(c=p),a=Qt(o,i,n!==void 0?{reduceMotion:n,...u}:u,t)}const l=new Ve(a);return c&&l.finished.then(c),t&&(t.animations.push(l),l.finished.then(()=>{qt(t.animations,l)})),l}return s}const ks=yn(),Dt=(e,t)=>Math.abs(e-t);function Pn(e,t){const n=Dt(e.x,t.x),s=Dt(e.y,t.y);return Math.sqrt(n**2+s**2)}const te=d.createContext({});function ee(e){const t=d.useRef(null);return t.current===null&&(t.current=e()),t.current}const ne=typeof window<"u",Sn=ne?d.useLayoutEffect:d.useEffect,ft=d.createContext(null),ht=d.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function wn(e=!0){const t=d.useContext(ft);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=t,i=d.useId();d.useEffect(()=>{if(e)return o(i)},[e]);const r=d.useCallback(()=>e&&s&&s(i),[i,s,e]);return!n&&s?[!1,r]:[!0]}const se=d.createContext({strict:!1}),Lt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let bt=!1;function En(){if(bt)return;const e={};for(const t in Lt)e[t]={isEnabled:n=>Lt[t].some(s=>!!n[s])};zt(e),bt=!0}function oe(){return En(),De()}function xn(e){const t=oe();for(const n in e)t[n]={...t[n],...e[n]};zt(t)}const Cn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function X(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Cn.has(e)}let ie=e=>!X(e);function Mn(e){typeof e=="function"&&(ie=t=>t.startsWith("on")?!X(t):e(t))}try{Mn(require("@emotion/is-prop-valid").default)}catch{}function An(e,t,n){const s={};for(const o in e)o==="values"&&typeof e.values=="object"||(ie(o)||n===!0&&X(o)||!t&&!X(o)||e.draggable&&o.startsWith("onDrag"))&&(s[o]=e[o]);return s}const q=d.createContext({});function Vn(e,t){if(_t(e)){const{initial:n,animate:s}=e;return{initial:n===!1||wt(n)?n:void 0,animate:wt(s)?s:void 0}}return e.inherit!==!1?t:{}}function Dn(e){const{initial:t,animate:n}=Vn(e,d.useContext(q));return d.useMemo(()=>({initial:t,animate:n}),[Tt(t),Tt(n)])}function Tt(e){return Array.isArray(e)?e.join(" "):e}const dt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function re(e,t,n){for(const s in t)!Y(t[s])&&!Le(s,n)&&(e[s]=t[s])}function Ln({transformTemplate:e},t){return d.useMemo(()=>{const n=dt();return be(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bn(e,t){const n=e.style||{},s={};return re(s,n,e),Object.assign(s,Ln(e,t)),s}function Tn(e,t){const n={},s=bn(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const ae=()=>({...dt(),attrs:{}});function In(e,t,n,s){const o=d.useMemo(()=>{const i=ae();return Te(i,t,Ie(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};re(i,e.style,e),o.style={...i,...o.style}}return o}const kn=["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 mt(e){return typeof e!="string"||e.includes("-")?!1:!!(kn.indexOf(e)>-1||/[A-Z]/u.test(e))}function Fn(e,t,n,{latestValues:s},o,i=!1,r){const c=(r??mt(e)?In:Tn)(t,s,o,e),l=An(t,typeof e=="string",i),p=e!==d.Fragment?{...l,...c,ref:n}:{},{children:u}=t,f=d.useMemo(()=>Y(u)?u.get():u,[u]);return d.createElement(e,{...p,children:f})}function On({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,o){return{latestValues:Rn(n,s,o,e),renderState:t()}}function Rn(e,t,n,s){const o={},i=s(e,{});for(const f in i)o[f]=ke(i[f]);let{initial:r,animate:a}=e;const c=_t(e),l=Fe(e);t&&l&&!c&&e.inherit!==!1&&(r===void 0&&(r=t.initial),a===void 0&&(a=t.animate));let p=n?n.initial===!1:!1;p=p||r===!1;const u=p?a:r;if(u&&typeof u!="boolean"&&!$t(u)){const f=Array.isArray(u)?u:[u];for(let m=0;m<f.length;m++){const h=Oe(e,f[m]);if(h){const{transitionEnd:P,transition:y,...g}=h;for(const v in g){let S=g[v];if(Array.isArray(S)){const E=p?S.length-1:0;S=S[E]}S!==null&&(o[v]=S)}for(const v in P)o[v]=P[v]}}}return o}const ue=e=>(t,n)=>{const s=d.useContext(q),o=d.useContext(ft),i=()=>On(e,t,s,o);return n?i():ee(i)},jn=ue({scrapeMotionValuesFromProps:Re,createRenderState:dt}),Gn=ue({scrapeMotionValuesFromProps:je,createRenderState:ae}),Wn=Symbol.for("motionComponentSymbol");function Hn(e,t,n){const s=d.useRef(n);d.useInsertionEffect(()=>{s.current=n});const o=d.useRef(null);return d.useCallback(i=>{i&&e.onMount?.(i),t&&(i?t.mount(i):t.unmount());const r=s.current;if(typeof r=="function")if(i){const a=r(i);typeof a=="function"&&(o.current=a)}else o.current?(o.current(),o.current=null):r(i);else r&&(r.current=i)},[t])}const le=d.createContext({});function I(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Bn(e,t,n,s,o,i){const{visualElement:r}=d.useContext(q),a=d.useContext(se),c=d.useContext(ft),l=d.useContext(ht),p=l.reducedMotion,u=l.skipAnimations,f=d.useRef(null),m=d.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:r,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:p,skipAnimations:u,isSVG:i}),m.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const h=f.current,P=d.useContext(le);h&&!h.projection&&o&&(h.type==="html"||h.type==="svg")&&Nn(f.current,n,o,P);const y=d.useRef(!1);d.useInsertionEffect(()=>{h&&y.current&&h.update(n,c)});const g=n[Ge],v=d.useRef(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Sn(()=>{m.current=!0,h&&(y.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),v.current&&h.animationState&&h.animationState.animateChanges())}),d.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),v.current=!1),h.enteringChildren=void 0)}),h}function Nn(e,t,n,s){const{layoutId:o,layout:i,drag:r,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ce(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!r||a&&I(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:p,layoutScroll:c,layoutRoot:l})}function ce(e){if(e)return e.options.allowProjection!==!1?e.projection:ce(e.parent)}function Z(e,{forwardMotionProps:t=!1,type:n}={},s,o){s&&xn(s);const i=n?n==="svg":mt(e),r=i?Gn:jn;function a(l,p){let u;const f={...d.useContext(ht),...l,layoutId:Un(l)},{isStatic:m}=f,h=Dn(l),P=r(l,m);if(!m&&ne){zn();const y=_n(f);u=y.MeasureLayout,h.visualElement=Bn(e,P,f,o,y.ProjectionNode,i)}return at.jsxs(q.Provider,{value:h,children:[u&&h.visualElement?at.jsx(u,{visualElement:h.visualElement,...f}):null,Fn(e,l,Hn(P,h.visualElement,p),P,m,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=d.forwardRef(a);return c[Wn]=e,c}function Un({layoutId:e}){const t=d.useContext(te).id;return t&&e!==void 0?t+"-"+e:e}function zn(e,t){d.useContext(se).strict}function _n(e){const t=oe(),{drag:n,layout:s}=t;if(!n&&!s)return{};const o={...n,...s};return{MeasureLayout:n?.isEnabled(e)||s?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function $n(e,t){if(typeof Proxy>"u")return Z;const n=new Map,s=(i,r)=>Z(i,r,e,t),o=(i,r)=>s(i,r);return new Proxy(o,{get:(i,r)=>r==="create"?s:(n.has(r)||n.set(r,Z(r,void 0,e,t)),n.get(r))})}const Kn=(e,t)=>t.isSVG??mt(e)?new Bt(t):new Nt(t,{allowProjection:e!==d.Fragment});class Xn extends L{constructor(t){super(t),t.animationState||(t.animationState=We(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Yn=0;class qn extends L{constructor(){super(...arguments),this.id=Yn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Jn={animation:{Feature:Xn},exit:{Feature:qn}};function H(e){return{point:{x:e.pageX,y:e.pageY}}}const Zn=e=>t=>Kt(t)&&e(t,H(t));function G(e,t,n,s){return K(e,t,Zn(n),s)}const fe=({current:e})=>e?e.ownerDocument.defaultView:null,It=new Set(["auto","scroll"]);class he{constructor(t,n,{transformPagePoint:s,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=tt(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,P=Pn(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!P)return;const{point:y}=m,{timestamp:g}=Et;this.history.push({...y,timestamp:g});const{onStart:v,onMove:S}=this.handlers;h||(v&&v(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,m)},this.handlePointerMove=(m,h)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=Q(h,this.transformPagePoint),x.update(this.updatePoint,!0)},this.handlePointerUp=(m,h)=>{this.end();const{onEnd:P,onSessionEnd:y,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tt(m.type==="pointercancel"?this.lastMoveEventInfo:Q(h,this.transformPagePoint),this.history);this.startEvent&&P&&P(m,v),y&&y(m,v)},!Kt(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=o||window;const c=H(t),l=Q(c,this.transformPagePoint),{point:p}=l,{timestamp:u}=Et;this.history=[{...p,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,tt(l,this.history)),this.removeListeners=Jt(G(this.contextWindow,"pointermove",this.handlePointerMove),G(this.contextWindow,"pointerup",this.handlePointerUp),G(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const s=getComputedStyle(n);(It.has(s.overflowX)||It.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const s=t===window,o=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:o.x-n.x,y:o.y-n.y};i.x===0&&i.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,o),x.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),He(this.updatePoint)}}function Q(e,t){return t?{point:t(e.point)}:e}function kt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tt({point:e},t){return{point:e,delta:kt(e,de(t)),offset:kt(e,Qn(t)),velocity:ts(t,.1)}}function Qn(e){return e[0]}function de(e){return e[e.length-1]}function ts(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const o=de(e);for(;n>=0&&(s=e[n],!(o.timestamp-s.timestamp>it(t)));)n--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&o.timestamp-s.timestamp>it(t)*2&&(s=e[1]);const i=Qe(o.timestamp-s.timestamp);if(i===0)return{x:0,y:0};const r={x:(o.x-s.x)/i,y:(o.y-s.y)/i};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function es(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?W(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?W(n,e,s.max):Math.min(e,n)),e}function Ft(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function ns(e,{top:t,left:n,bottom:s,right:o}){return{x:Ft(e.x,n,o),y:Ft(e.y,t,s)}}function Ot(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function ss(e,t){return{x:Ot(e.x,t.x),y:Ot(e.y,t.y)}}function os(e,t){let n=.5;const s=ot(e),o=ot(t);return o>s?n=rt(t.min,t.max-s,e.min):s>o&&(n=rt(e.min,e.max-o,t.min)),tn(0,1,n)}function is(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ut=.35;function rs(e=ut){return e===!1?e=0:e===!0&&(e=ut),{x:Rt(e,"left","right"),y:Rt(e,"top","bottom")}}function Rt(e,t,n){return{min:jt(e,t),max:jt(e,n)}}function jt(e,t){return typeof e=="number"?e:e[t]||0}const as=new WeakMap;class us{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=Be(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=u=>{n&&this.snapToCursor(H(u).point),this.stopAnimation()},r=(u,f)=>{const{drag:m,dragPropagation:h,onDragStart:P}=this.getProps();if(m&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$e(m),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),D(g=>{let v=this.getAxisMotionValue(g).get()||0;if(Ke.test(v)){const{projection:S}=this.visualElement;if(S&&S.layout){const E=S.layout.layoutBox[g];E&&(v=ot(E)*(parseFloat(v)/100))}}this.originPoint[g]=v}),P&&x.update(()=>P(u,f),!1,!0),xt(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(u,f)=>{this.latestPointerEvent=u,this.latestPanInfo=f;const{dragPropagation:m,dragDirectionLock:h,onDirectionLock:P,onDrag:y}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:g}=f;if(h&&this.currentDirection===null){this.currentDirection=cs(g),this.currentDirection!==null&&P&&P(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),y&&x.update(()=>y(u,f),!1,!0)},c=(u,f)=>{this.latestPointerEvent=u,this.latestPanInfo=f,this.stop(u,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:u}=this.getProps();(u||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new he(t,{onSessionStart:i,onStart:r,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:s,contextWindow:fe(this.visualElement),element:this.visualElement.current})}stop(t,n){const s=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!s)return;const{velocity:r}=o;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&x.postRender(()=>a(s,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,s){const{drag:o}=this.getProps();if(!s||!z(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(r=es(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&I(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=ns(s.layoutBox,t):this.constraints=!1,this.elastic=rs(n),o!==this.constraints&&!I(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&D(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=is(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!I(t))return!1;const s=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=Ne(s,o.root,this.visualElement.getTransformPagePoint());let r=ss(o.layout.layoutBox,i);if(n){const a=n(Ue(r));this.hasMutatedConstraints=!!a,a&&(r=ze(a))}return r}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=D(p=>{if(!z(p,n,this.currentDirection))return;let u=c&&c[p]||{};r&&(u={min:0,max:0});const f=o?200:1e6,m=o?40:1e7,h={type:"inertia",velocity:s?t[p]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(p,h)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return xt(this.visualElement,t),s.start(_e(t,s,0,n,this.visualElement,!1))}stopAnimation(){D(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),o=s[n];return o||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){D(n=>{const{drag:s}=this.getProps();if(!z(n,s,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:r,max:a}=o.layout.layoutBox[n],c=i.get()||0;i.set(t[n]-W(r,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!I(n)||!s||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};D(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const c=a.get();o[r]=os({min:c,max:c},this.constraints[r])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),D(r=>{if(!z(r,t,null))return;const a=this.getAxisMotionValue(r),{min:c,max:l}=this.constraints[r];a.set(W(c,l,o[r]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;as.set(this.visualElement,this);const t=this.visualElement.current,n=G(t,"pointerdown",l=>{const{drag:p,dragListener:u=!0}=this.getProps(),f=l.target,m=f!==t&&Xe(f);p&&u&&!m&&this.start(l)});let s;const o=()=>{const{dragConstraints:l}=this.getProps();I(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),s||(s=ls(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,r=i.addEventListener("measure",o);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),x.read(o);const a=K(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:p})=>{this.isDragging&&p&&(D(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{a(),n(),r(),c&&c(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=ut,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:a}}}function Gt(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function ls(e,t,n){const s=Ct(e,Gt(n)),o=Ct(t,Gt(n));return()=>{s(),o()}}function z(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function cs(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class fs extends L{constructor(t){super(t),this.removeGroupControls=_,this.removeListeners=_,this.controls=new us(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const et=e=>(t,n)=>{e&&x.update(()=>e(t,n),!1,!0)};class hs extends L{constructor(){super(...arguments),this.removePointerDownListener=_}onPointerDown(t){this.session=new he(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:o}=this.node.getProps();return{onSessionStart:et(t),onStart:et(n),onMove:et(s),onEnd:(i,r)=>{delete this.session,o&&x.postRender(()=>o(i,r))}}}mount(){this.removePointerDownListener=G(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let nt=!1;class ds extends d.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),s&&s.register&&o&&s.register(i),nt&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),qe.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:o,isPresent:i}=this.props,{projection:r}=s;return r&&(r.isPresent=i,t.layoutDependency!==n&&r.setOptions({...r.options,layoutDependency:n}),nt=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||x.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Ye.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:o}=t;nt=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),s&&s.deregister&&s.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function me(e){const[t,n]=wn(),s=d.useContext(te);return at.jsx(ds,{...e,layoutGroup:s,switchLayoutGroup:d.useContext(le),isPresent:t,safeToRemove:n})}const ms={pan:{Feature:hs},drag:{Feature:fs,ProjectionNode:Xt,MeasureLayout:me}};function Wt(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=s[o];i&&x.postRender(()=>i(t,H(t)))}class ps extends L{mount(){const{current:t}=this.node;t&&(this.unmount=Je(t,(n,s)=>(Wt(this.node,s,"Start"),o=>Wt(this.node,o,"End"))))}unmount(){}}class gs extends L{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{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=Jt(K(this.node.current,"focus",()=>this.onFocus()),K(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ht(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=s[o];i&&x.postRender(()=>i(t,H(t)))}class vs extends L{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Ze(t,(o,i)=>(Ht(this.node,i,"Start"),(r,{success:a})=>Ht(this.node,r,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const lt=new WeakMap,st=new WeakMap,ys=e=>{const t=lt.get(e.target);t&&t(e)},Ps=e=>{e.forEach(ys)};function Ss({root:e,...t}){const n=e||document;st.has(n)||st.set(n,{});const s=st.get(n),o=JSON.stringify(t);return s[o]||(s[o]=new IntersectionObserver(Ps,{root:e,...t})),s[o]}function ws(e,t,n){const s=Ss(t);return lt.set(e,n),s.observe(e),()=>{lt.delete(e),s.unobserve(e)}}const Es={some:0,all:1};class xs extends L{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:o="some",once:i}=t,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof o=="number"?o:Es[o]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:p,onViewportLeave:u}=this.node.getProps(),f=l?p:u;f&&f(c)};return ws(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Cs(t,n))&&this.startObserver()}unmount(){}}function Cs({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Ms={inView:{Feature:xs},tap:{Feature:vs},focus:{Feature:gs},hover:{Feature:ps}},As={layout:{ProjectionNode:Xt,MeasureLayout:me}},Vs={...Jn,...Ms,...ms,...As},Fs=$n(Vs,Kn);function Os(e){const t=ee(()=>Ut(e)),{isStatic:n}=d.useContext(ht);if(n){const[,s]=d.useState(e);d.useEffect(()=>t.on("change",s),[])}return t}export{ks as a,Fs as m,Os as u};