@kaitranntt/ccs 7.74.0 → 7.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/dist/api/services/profile-writer.d.ts +1 -1
  2. package/dist/api/services/profile-writer.d.ts.map +1 -1
  3. package/dist/api/services/profile-writer.js +11 -5
  4. package/dist/api/services/profile-writer.js.map +1 -1
  5. package/dist/bin/ccsxp-runtime.d.ts +8 -0
  6. package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
  7. package/dist/bin/ccsxp-runtime.js +60 -3
  8. package/dist/bin/ccsxp-runtime.js.map +1 -1
  9. package/dist/ccs.js +4 -2
  10. package/dist/ccs.js.map +1 -1
  11. package/dist/cliproxy/account-safety.d.ts.map +1 -1
  12. package/dist/cliproxy/account-safety.js +6 -1
  13. package/dist/cliproxy/account-safety.js.map +1 -1
  14. package/dist/cliproxy/ai-providers/service.d.ts.map +1 -1
  15. package/dist/cliproxy/ai-providers/service.js +10 -3
  16. package/dist/cliproxy/ai-providers/service.js.map +1 -1
  17. package/dist/cliproxy/binary/lifecycle.d.ts.map +1 -1
  18. package/dist/cliproxy/binary/lifecycle.js +2 -1
  19. package/dist/cliproxy/binary/lifecycle.js.map +1 -1
  20. package/dist/cliproxy/codex-plan-compatibility.d.ts.map +1 -1
  21. package/dist/cliproxy/codex-plan-compatibility.js +1 -0
  22. package/dist/cliproxy/codex-plan-compatibility.js.map +1 -1
  23. package/dist/cliproxy/config/generator.d.ts +2 -1
  24. package/dist/cliproxy/config/generator.d.ts.map +1 -1
  25. package/dist/cliproxy/config/generator.js +25 -1
  26. package/dist/cliproxy/config/generator.js.map +1 -1
  27. package/dist/cliproxy/executor/index.d.ts +5 -0
  28. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  29. package/dist/cliproxy/executor/index.js +22 -6
  30. package/dist/cliproxy/executor/index.js.map +1 -1
  31. package/dist/cliproxy/executor/retry-handler.js +2 -2
  32. package/dist/cliproxy/executor/retry-handler.js.map +1 -1
  33. package/dist/cliproxy/management-api-client.d.ts.map +1 -1
  34. package/dist/cliproxy/management-api-client.js +3 -2
  35. package/dist/cliproxy/management-api-client.js.map +1 -1
  36. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  37. package/dist/cliproxy/model-catalog.js +12 -0
  38. package/dist/cliproxy/model-catalog.js.map +1 -1
  39. package/dist/cliproxy/quota-fetcher-claude-normalizer.d.ts.map +1 -1
  40. package/dist/cliproxy/quota-fetcher-claude-normalizer.js +16 -12
  41. package/dist/cliproxy/quota-fetcher-claude-normalizer.js.map +1 -1
  42. package/dist/cliproxy/quota-fetcher-codex.d.ts +18 -3
  43. package/dist/cliproxy/quota-fetcher-codex.d.ts.map +1 -1
  44. package/dist/cliproxy/quota-fetcher-codex.js +74 -24
  45. package/dist/cliproxy/quota-fetcher-codex.js.map +1 -1
  46. package/dist/cliproxy/quota-fetcher-ghcp.d.ts.map +1 -1
  47. package/dist/cliproxy/quota-fetcher-ghcp.js +19 -8
  48. package/dist/cliproxy/quota-fetcher-ghcp.js.map +1 -1
  49. package/dist/cliproxy/quota-manager.d.ts +5 -2
  50. package/dist/cliproxy/quota-manager.d.ts.map +1 -1
  51. package/dist/cliproxy/quota-manager.js +177 -63
  52. package/dist/cliproxy/quota-manager.js.map +1 -1
  53. package/dist/cliproxy/quota-types.d.ts +16 -2
  54. package/dist/cliproxy/quota-types.d.ts.map +1 -1
  55. package/dist/cliproxy/routing-strategy-http.d.ts +1 -0
  56. package/dist/cliproxy/routing-strategy-http.d.ts.map +1 -1
  57. package/dist/cliproxy/routing-strategy-http.js +7 -2
  58. package/dist/cliproxy/routing-strategy-http.js.map +1 -1
  59. package/dist/cliproxy/routing-strategy.d.ts +23 -0
  60. package/dist/cliproxy/routing-strategy.d.ts.map +1 -1
  61. package/dist/cliproxy/routing-strategy.js +148 -2
  62. package/dist/cliproxy/routing-strategy.js.map +1 -1
  63. package/dist/cliproxy/service-manager.d.ts +17 -1
  64. package/dist/cliproxy/service-manager.d.ts.map +1 -1
  65. package/dist/cliproxy/service-manager.js +10 -5
  66. package/dist/cliproxy/service-manager.js.map +1 -1
  67. package/dist/cliproxy/sync/profile-mapper.d.ts.map +1 -1
  68. package/dist/cliproxy/sync/profile-mapper.js +21 -0
  69. package/dist/cliproxy/sync/profile-mapper.js.map +1 -1
  70. package/dist/cliproxy/types.d.ts +11 -0
  71. package/dist/cliproxy/types.d.ts.map +1 -1
  72. package/dist/cliproxy/types.js.map +1 -1
  73. package/dist/commands/api-command/create-command.d.ts.map +1 -1
  74. package/dist/commands/api-command/create-command.js +4 -1
  75. package/dist/commands/api-command/create-command.js.map +1 -1
  76. package/dist/commands/api-command/help.d.ts.map +1 -1
  77. package/dist/commands/api-command/help.js +4 -0
  78. package/dist/commands/api-command/help.js.map +1 -1
  79. package/dist/commands/api-command/shared.d.ts +2 -1
  80. package/dist/commands/api-command/shared.d.ts.map +1 -1
  81. package/dist/commands/api-command/shared.js +9 -0
  82. package/dist/commands/api-command/shared.js.map +1 -1
  83. package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
  84. package/dist/commands/cliproxy/help-subcommand.js +3 -1
  85. package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
  86. package/dist/commands/cliproxy/index.d.ts.map +1 -1
  87. package/dist/commands/cliproxy/index.js +12 -0
  88. package/dist/commands/cliproxy/index.js.map +1 -1
  89. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  90. package/dist/commands/cliproxy/quota-subcommand.js +79 -23
  91. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  92. package/dist/commands/cliproxy/routing-subcommand.d.ts +3 -0
  93. package/dist/commands/cliproxy/routing-subcommand.d.ts.map +1 -1
  94. package/dist/commands/cliproxy/routing-subcommand.js +127 -2
  95. package/dist/commands/cliproxy/routing-subcommand.js.map +1 -1
  96. package/dist/commands/command-catalog.d.ts.map +1 -1
  97. package/dist/commands/command-catalog.js +4 -1
  98. package/dist/commands/command-catalog.js.map +1 -1
  99. package/dist/commands/completion-backend.d.ts.map +1 -1
  100. package/dist/commands/completion-backend.js +16 -1
  101. package/dist/commands/completion-backend.js.map +1 -1
  102. package/dist/commands/config-dashboard-host.d.ts.map +1 -1
  103. package/dist/commands/config-dashboard-host.js +14 -2
  104. package/dist/commands/config-dashboard-host.js.map +1 -1
  105. package/dist/config/unified-config-loader.d.ts.map +1 -1
  106. package/dist/config/unified-config-loader.js +26 -0
  107. package/dist/config/unified-config-loader.js.map +1 -1
  108. package/dist/config/unified-config-types.d.ts +4 -0
  109. package/dist/config/unified-config-types.d.ts.map +1 -1
  110. package/dist/config/unified-config-types.js +2 -0
  111. package/dist/config/unified-config-types.js.map +1 -1
  112. package/dist/delegation/headless-executor.d.ts.map +1 -1
  113. package/dist/delegation/headless-executor.js +17 -2
  114. package/dist/delegation/headless-executor.js.map +1 -1
  115. package/dist/proxy/transformers/request-transformer.d.ts.map +1 -1
  116. package/dist/proxy/transformers/request-transformer.js +0 -8
  117. package/dist/proxy/transformers/request-transformer.js.map +1 -1
  118. package/dist/targets/target-metadata.js +1 -1
  119. package/dist/targets/target-metadata.js.map +1 -1
  120. package/dist/ui/assets/{accounts-D0Z5AVKW.js → accounts-CP_Nosd7.js} +1 -1
  121. package/dist/ui/assets/{alert-dialog-CzJucE0e.js → alert-dialog-CjnZBDj3.js} +1 -1
  122. package/dist/ui/assets/{api-DXAf4i-v.js → api-B7mmrAjt.js} +1 -1
  123. package/dist/ui/assets/{auth-section-BrnnHBi-.js → auth-section-BFQ8Mu15.js} +1 -1
  124. package/dist/ui/assets/{backups-section-DCBcfZ-C.js → backups-section-CPwm9q19.js} +1 -1
  125. package/dist/ui/assets/{channels-BSapONLx.js → channels-B2colnY7.js} +1 -1
  126. package/dist/ui/assets/{checkbox-Bd7X5Xud.js → checkbox-BAMXPp68.js} +1 -1
  127. package/dist/ui/assets/{claude-extension-BYJxm4B5.js → claude-extension-BDVoXHr-.js} +1 -1
  128. package/dist/ui/assets/{cliproxy-G5JuFm2j.js → cliproxy-CuLlmDu7.js} +1 -1
  129. package/dist/ui/assets/{cliproxy-ai-providers-D7r2Us_Y.js → cliproxy-ai-providers-8dH1cHVk.js} +1 -1
  130. package/dist/ui/assets/{cliproxy-control-panel-Cmo3ArVL.js → cliproxy-control-panel-CC8HzA8e.js} +1 -1
  131. package/dist/ui/assets/codex-C6Q9rOwp.js +27 -0
  132. package/dist/ui/assets/{confirm-dialog--zJgz4y0.js → confirm-dialog-D0VQlM7B.js} +1 -1
  133. package/dist/ui/assets/{copilot-2ARJ9YVb.js → copilot-CgG2oaRV.js} +1 -1
  134. package/dist/ui/assets/{cursor-CQNCrVt0.js → cursor-CE1giQU2.js} +1 -1
  135. package/dist/ui/assets/{droid-Dl5wRjDv.js → droid-FG2w7nRu.js} +1 -1
  136. package/dist/ui/assets/{globalenv-section-T1imQsSA.js → globalenv-section-BJbBud4W.js} +1 -1
  137. package/dist/ui/assets/health-Dh7o4wt7.js +1 -0
  138. package/dist/ui/assets/index-0mNJhDEG.js +72 -0
  139. package/dist/ui/assets/{index-CqJFugM4.js → index-B6bIHdvz.js} +1 -1
  140. package/dist/ui/assets/{index-DH916Tyi.js → index-BNTqP5R7.js} +1 -1
  141. package/dist/ui/assets/index-BNW5qVXZ.js +1 -0
  142. package/dist/ui/assets/{index-fV5BBuAO.js → index-Bj8UFR7b.js} +1 -1
  143. package/dist/ui/assets/index-DM5Khyln.css +1 -0
  144. package/dist/ui/assets/{index-DFgCoUVv.js → index-DTAdzUUA.js} +1 -1
  145. package/dist/ui/assets/index-X21iqV9e.js +1 -0
  146. package/dist/ui/assets/{logs-CZsWbq7X.js → logs-CxwEaeVS.js} +1 -1
  147. package/dist/ui/assets/masked-input-DygH0M2a.js +1 -0
  148. package/dist/ui/assets/proxy-g4_N-fbB.js +9 -0
  149. package/dist/ui/assets/proxy-status-widget-BWjGFUas.js +1 -0
  150. package/dist/ui/assets/{raw-json-settings-editor-panel-DNmb_vR-.js → raw-json-settings-editor-panel-DYpsr-1d.js} +1 -1
  151. package/dist/ui/assets/{searchable-select--iFe00dY.js → searchable-select-BKx31cCH.js} +1 -1
  152. package/dist/ui/assets/{separator-CaGbNw8E.js → separator-mG07scBE.js} +1 -1
  153. package/dist/ui/assets/{shared-Cgk48Wu3.js → shared-hbFOfnWU.js} +1 -1
  154. package/dist/ui/assets/{table-CKuoPAz4.js → table-DoECcNZ-.js} +1 -1
  155. package/dist/ui/assets/updates-BSeFQRwL.js +1 -0
  156. package/dist/ui/index.html +2 -2
  157. package/dist/utils/openai-compat-launch-settings.d.ts +7 -0
  158. package/dist/utils/openai-compat-launch-settings.d.ts.map +1 -0
  159. package/dist/utils/openai-compat-launch-settings.js +61 -0
  160. package/dist/utils/openai-compat-launch-settings.js.map +1 -0
  161. package/dist/utils/shell-executor.d.ts +1 -1
  162. package/dist/utils/shell-executor.d.ts.map +1 -1
  163. package/dist/utils/shell-executor.js +11 -1
  164. package/dist/utils/shell-executor.js.map +1 -1
  165. package/dist/web-server/jsonl-parser.d.ts.map +1 -1
  166. package/dist/web-server/jsonl-parser.js +22 -4
  167. package/dist/web-server/jsonl-parser.js.map +1 -1
  168. package/dist/web-server/model-pricing.d.ts +8 -6
  169. package/dist/web-server/model-pricing.d.ts.map +1 -1
  170. package/dist/web-server/model-pricing.js +80 -29
  171. package/dist/web-server/model-pricing.js.map +1 -1
  172. package/dist/web-server/models-dev/pricing-resolver.d.ts +18 -0
  173. package/dist/web-server/models-dev/pricing-resolver.d.ts.map +1 -0
  174. package/dist/web-server/models-dev/pricing-resolver.js +153 -0
  175. package/dist/web-server/models-dev/pricing-resolver.js.map +1 -0
  176. package/dist/web-server/models-dev/registry-cache.d.ts +19 -0
  177. package/dist/web-server/models-dev/registry-cache.d.ts.map +1 -0
  178. package/dist/web-server/models-dev/registry-cache.js +155 -0
  179. package/dist/web-server/models-dev/registry-cache.js.map +1 -0
  180. package/dist/web-server/models-dev/types.d.ts +39 -0
  181. package/dist/web-server/models-dev/types.d.ts.map +1 -0
  182. package/dist/web-server/models-dev/types.js +3 -0
  183. package/dist/web-server/models-dev/types.js.map +1 -0
  184. package/dist/web-server/routes/cliproxy-routing-routes.d.ts.map +1 -1
  185. package/dist/web-server/routes/cliproxy-routing-routes.js +35 -0
  186. package/dist/web-server/routes/cliproxy-routing-routes.js.map +1 -1
  187. package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
  188. package/dist/web-server/routes/profile-routes.js +13 -3
  189. package/dist/web-server/routes/profile-routes.js.map +1 -1
  190. package/dist/web-server/routes/route-helpers.d.ts +1 -0
  191. package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
  192. package/dist/web-server/routes/route-helpers.js +11 -0
  193. package/dist/web-server/routes/route-helpers.js.map +1 -1
  194. package/dist/web-server/usage/aggregator.d.ts +1 -0
  195. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  196. package/dist/web-server/usage/aggregator.js +121 -20
  197. package/dist/web-server/usage/aggregator.js.map +1 -1
  198. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts +0 -15
  199. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts.map +1 -1
  200. package/dist/web-server/usage/cliproxy-usage-syncer.js +159 -55
  201. package/dist/web-server/usage/cliproxy-usage-syncer.js.map +1 -1
  202. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts +23 -7
  203. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -1
  204. package/dist/web-server/usage/cliproxy-usage-transformer.js +191 -28
  205. package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -1
  206. package/dist/web-server/usage/codex-native-usage-collector.d.ts +11 -0
  207. package/dist/web-server/usage/codex-native-usage-collector.d.ts.map +1 -0
  208. package/dist/web-server/usage/codex-native-usage-collector.js +177 -0
  209. package/dist/web-server/usage/codex-native-usage-collector.js.map +1 -0
  210. package/dist/web-server/usage/data-aggregator.d.ts.map +1 -1
  211. package/dist/web-server/usage/data-aggregator.js +45 -46
  212. package/dist/web-server/usage/data-aggregator.js.map +1 -1
  213. package/dist/web-server/usage/droid-native-usage-collector.d.ts +14 -0
  214. package/dist/web-server/usage/droid-native-usage-collector.d.ts.map +1 -0
  215. package/dist/web-server/usage/droid-native-usage-collector.js +201 -0
  216. package/dist/web-server/usage/droid-native-usage-collector.js.map +1 -0
  217. package/dist/web-server/usage/handlers.d.ts +1 -0
  218. package/dist/web-server/usage/handlers.d.ts.map +1 -1
  219. package/dist/web-server/usage/handlers.js +155 -45
  220. package/dist/web-server/usage/handlers.js.map +1 -1
  221. package/dist/web-server/usage/model-identity.d.ts +16 -0
  222. package/dist/web-server/usage/model-identity.d.ts.map +1 -0
  223. package/dist/web-server/usage/model-identity.js +70 -0
  224. package/dist/web-server/usage/model-identity.js.map +1 -0
  225. package/dist/web-server/usage/sqlite-cli.d.ts +3 -0
  226. package/dist/web-server/usage/sqlite-cli.d.ts.map +1 -0
  227. package/dist/web-server/usage/sqlite-cli.js +62 -0
  228. package/dist/web-server/usage/sqlite-cli.js.map +1 -0
  229. package/dist/web-server/usage/types.d.ts +6 -0
  230. package/dist/web-server/usage/types.d.ts.map +1 -1
  231. package/lib/mcp/ccs-browser-server.cjs +309 -121
  232. package/package.json +1 -1
  233. package/scripts/dev-release.sh +4 -2
  234. package/dist/ui/assets/codex-4VNBJ4Nb.js +0 -27
  235. package/dist/ui/assets/health-CNous3WN.js +0 -1
  236. package/dist/ui/assets/index-2X8-14xr.js +0 -72
  237. package/dist/ui/assets/index-BcLnqcxD.js +0 -1
  238. package/dist/ui/assets/index-Be3dhMW3.js +0 -9
  239. package/dist/ui/assets/index-DuTB1_9r.css +0 -1
  240. package/dist/ui/assets/masked-input-_EkW1Pzo.js +0 -1
  241. package/dist/ui/assets/proxy-status-widget-D82T2X4F.js +0 -1
  242. package/dist/ui/assets/updates-Dr8Yq-Pm.js +0 -1
@@ -0,0 +1,9 @@
1
+ import{j as nt}from"./radix-ui-Zb8sVEtn.js";import{r as w}from"./react-vendor-CNOkPC89.js";const Qe=w.createContext({});function tn(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}const ko=typeof window<"u",Hs=ko?w.useLayoutEffect:w.useEffect,le=w.createContext(null);function en(t,e){t.indexOf(e)===-1&&t.push(e)}function Qt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Q=(t,e,n)=>n>e?e:n<t?t:n;let nn=()=>{};const ot={},Gs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function _s(t){return typeof t=="object"&&t!==null}const Xs=t=>/^0[^.\s]+$/u.test(t);function Ys(t){let e;return()=>(e===void 0&&(e=t()),e)}const z=t=>t,Bo=(t,e)=>n=>e(t(n)),Ft=(...t)=>t.reduce(Bo),Rt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class sn{constructor(){this.subscriptions=[]}add(e){return en(this.subscriptions,e),()=>Qt(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const W=t=>t*1e3,$=t=>t/1e3;function qs(t,e){return e?t*(1e3/e):0}const Zs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Fo=1e-7,Io=12;function jo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Zs(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Fo&&++a<Io);return o}function It(t,e,n,s){if(t===e&&n===s)return z;const i=r=>jo(r,0,1,t,n);return r=>r===0||r===1?r:Zs(i(r),e,s)}const Js=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Qs=t=>e=>1-t(1-e),ti=It(.33,1.53,.69,.99),on=Qs(ti),ei=Js(on),ni=t=>t>=1?1:(t*=2)<1?.5*on(t):.5*(2-Math.pow(2,-10*(t-1))),rn=t=>1-Math.sin(Math.acos(t)),si=Qs(rn),ii=Js(rn),Oo=It(.42,0,1,1),No=It(0,0,.58,1),oi=It(.42,0,.58,1),Uo=t=>Array.isArray(t)&&typeof t[0]!="number",ri=t=>Array.isArray(t)&&typeof t[0]=="number",Wo={linear:z,easeIn:Oo,easeInOut:oi,easeOut:No,circIn:rn,circInOut:ii,circOut:si,backIn:on,backInOut:ei,backOut:ti,anticipate:ni},Ko=t=>typeof t=="string",Dn=t=>{if(ri(t)){nn(t.length===4);const[e,n,s,i]=t;return It(e,n,s,i)}else if(Ko(t))return Wo[t];return t},Nt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function $o(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(l){o.has(l)&&(c.schedule(l),t()),l(a)}const c={schedule:(l,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&o.add(l),p.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,i){r=!0;return}i=!0;const h=n;n=s,s=h,n.forEach(u),n.clear(),i=!1,r&&(r=!1,c.process(l))}};return c}const zo=40;function ai(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Nt.reduce((v,T)=>(v[T]=$o(r),v),{}),{setup:a,read:u,resolveKeyframes:c,preUpdate:l,update:h,preRender:f,render:d,postRender:p}=o,m=()=>{const v=ot.useManualTiming,T=v?i.timestamp:performance.now();n=!1,v||(i.delta=s?1e3/60:Math.max(Math.min(T-i.timestamp,zo),1)),i.timestamp=T,i.isProcessing=!0,a.process(i),u.process(i),c.process(i),l.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},g=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Nt.reduce((v,T)=>{const b=o[T];return v[T]=(E,B=!1,A=!1)=>(n||g(),b.schedule(E,B,A)),v},{}),cancel:v=>{for(let T=0;T<Nt.length;T++)o[Nt[T]].cancel(v)},state:i,steps:o}}const{schedule:C,cancel:rt,state:j,steps:de}=ai(typeof requestAnimationFrame<"u"?requestAnimationFrame:z,!0);let zt;function Ho(){zt=void 0}const N={now:()=>(zt===void 0&&N.set(j.isProcessing||ot.useManualTiming?j.timestamp:performance.now()),zt),set:t=>{zt=t,queueMicrotask(Ho)}},li=t=>e=>typeof e=="string"&&e.startsWith(t),ui=li("--"),Go=li("var(--"),an=t=>Go(t)?_o.test(t.split("/*")[0].trim()):!1,_o=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function En(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Lt={...Pt,transform:t=>Q(0,1,t)},Ut={...Pt,default:1},Ct=t=>Math.round(t*1e5)/1e5,ln=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Xo(t){return t==null}const Yo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,un=(t,e)=>n=>!!(typeof n=="string"&&Yo.test(n)&&n.startsWith(t)||e&&!Xo(n)&&Object.prototype.hasOwnProperty.call(n,e)),ci=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(ln);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},qo=t=>Q(0,255,t),pe={...Pt,transform:t=>Math.round(qo(t))},ht={test:un("rgb","red"),parse:ci("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+pe.transform(t)+", "+pe.transform(e)+", "+pe.transform(n)+", "+Ct(Lt.transform(s))+")"};function Zo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const De={test:un("#"),parse:Zo,transform:ht.transform},jt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=jt("deg"),J=jt("%"),P=jt("px"),Jo=jt("vh"),Qo=jt("vw"),Rn={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(t*100)},yt={test:un("hsl","hue"),parse:ci("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+J.transform(Ct(e))+", "+J.transform(Ct(n))+", "+Ct(Lt.transform(s))+")"},L={test:t=>ht.test(t)||De.test(t)||yt.test(t),parse:t=>ht.test(t)?ht.parse(t):yt.test(t)?yt.parse(t):De.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):yt.transform(t),getAnimatableNone:t=>{const e=L.parse(t);return e.alpha=0,L.transform(e)}},tr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function er(t){return isNaN(t)&&typeof t=="string"&&(t.match(ln)?.length||0)+(t.match(tr)?.length||0)>0}const hi="number",fi="color",nr="var",sr="var(",Ln="${}",ir=/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 Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(ir,u=>(L.test(u)?(s.color.push(r),i.push(fi),n.push(L.parse(u))):u.startsWith(sr)?(s.var.push(r),i.push(nr),n.push(u)):(s.number.push(r),i.push(hi),n.push(parseFloat(u))),++r,Ln)).split(Ln);return{values:n,split:a,indexes:s,types:i}}function or(t){return Tt(t).values}function di({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===hi?i+=Ct(s[r]):o===fi?i+=L.transform(s[r]):i+=s[r]}return i}}function rr(t){return di(Tt(t))}const ar=t=>typeof t=="number"?0:L.test(t)?L.getAnimatableNone(t):t,lr=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:ar(t);function ur(t){const e=Tt(t);return di(e)(e.values.map((s,i)=>lr(s,e.split[i])))}const _={test:er,parse:or,createTransformer:rr,getAnimatableNone:ur};function me(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function cr({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;i=me(u,a,t+1/3),r=me(u,a,t),o=me(u,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function te(t,e){return n=>n>0?e:t}const M=(t,e,n)=>t+(e-t)*n,ge=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},hr=[De,ht,yt],fr=t=>hr.find(e=>e.test(t));function kn(t){const e=fr(t);if(!e)return!1;let n=e.parse(t);return e===yt&&(n=cr(n)),n}const Bn=(t,e)=>{const n=kn(t),s=kn(e);if(!n||!s)return te(t,e);const i={...n};return r=>(i.red=ge(n.red,s.red,r),i.green=ge(n.green,s.green,r),i.blue=ge(n.blue,s.blue,r),i.alpha=M(n.alpha,s.alpha,r),ht.transform(i))},Ee=new Set(["none","hidden"]);function dr(t,e){return Ee.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function pr(t,e){return n=>M(t,e,n)}function cn(t){return typeof t=="number"?pr:typeof t=="string"?an(t)?te:L.test(t)?Bn:yr:Array.isArray(t)?pi:typeof t=="object"?L.test(t)?Bn:mr:te}function pi(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>cn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function mr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=cn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function gr(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const yr=(t,e)=>{const n=_.createTransformer(e),s=Tt(t),i=Tt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ee.has(t)&&!i.values.length||Ee.has(e)&&!s.values.length?dr(t,e):Ft(pi(gr(s,i),i.values),n):te(t,e)};function mi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?M(t,e,n):cn(t)(t,e)}const vr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>C.update(e,n),stop:()=>rt(e),now:()=>j.isProcessing?j.timestamp:N.now()}},gi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},ee=2e4;function hn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ee;)e+=n,s=t.next(e);return e>=ee?1/0:e}function xr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(hn(s),ee);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:$(i)}}const R={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 Re(t,e){return t*Math.sqrt(1-e*e)}const Tr=12;function wr(t,e,n){let s=n;for(let i=1;i<Tr;i++)s=s-t(s)/e(s);return s}const ye=.001;function Pr({duration:t=R.duration,bounce:e=R.bounce,velocity:n=R.velocity,mass:s=R.mass}){let i,r,o=1-e;o=Q(R.minDamping,R.maxDamping,o),t=Q(R.minDuration,R.maxDuration,$(t)),o<1?(i=c=>{const l=c*o,h=l*t,f=l-n,d=Re(c,o),p=Math.exp(-h);return ye-f/d*p},r=c=>{const h=c*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),m=Re(Math.pow(c,2),o);return(-i(c)+ye>0?-1:1)*((f-d)*p)/m}):(i=c=>{const l=Math.exp(-c*t),h=(c-n)*t+1;return-ye+l*h},r=c=>{const l=Math.exp(-c*t),h=(n-c)*(t*t);return l*h});const a=5/t,u=wr(i,r,a);if(t=W(t),isNaN(u))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const c=Math.pow(u,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:t}}}const Sr=["duration","bounce"],br=["stiffness","damping","mass"];function Fn(t,e){return e.some(n=>t[n]!==void 0)}function Ar(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!Fn(t,br)&&Fn(t,Sr))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Q(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:R.mass,stiffness:i,damping:r}}else{const n=Pr({...t,velocity:0});e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function ne(t=R.visualDuration,e=R.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:c,mass:l,duration:h,velocity:f,isResolvedFromDuration:d}=Ar({...n,velocity:-$(n.velocity||0)}),p=f||0,m=c/(2*Math.sqrt(u*l)),g=o-r,y=$(Math.sqrt(u/l)),x=Math.abs(g)<5;s||(s=x?R.restSpeed.granular:R.restSpeed.default),i||(i=x?R.restDelta.granular:R.restDelta.default);let v,T,b,E,B,A;if(m<1)b=Re(y,m),E=(p+m*y*g)/b,v=S=>{const D=Math.exp(-m*y*S);return o-D*(E*Math.sin(b*S)+g*Math.cos(b*S))},B=m*y*E+g*b,A=m*y*g-E*b,T=S=>Math.exp(-m*y*S)*(B*Math.sin(b*S)+A*Math.cos(b*S));else if(m===1){v=D=>o-Math.exp(-y*D)*(g+(p+y*g)*D);const S=p+y*g;T=D=>Math.exp(-y*D)*(y*S*D-p)}else{const S=y*Math.sqrt(m*m-1);v=X=>{const et=Math.exp(-m*y*X),Y=Math.min(S*X,300);return o-et*((p+m*y*g)*Math.sinh(Y)+S*g*Math.cosh(Y))/S};const D=(p+m*y*g)/S,F=m*y*D-g*S,tt=m*y*g-D*S;T=X=>{const et=Math.exp(-m*y*X),Y=Math.min(S*X,300);return et*(F*Math.sinh(Y)+tt*Math.cosh(Y))}}const V={calculatedDuration:d&&h||null,velocity:S=>W(T(S)),next:S=>{if(!d&&m<1){const F=Math.exp(-m*y*S),tt=Math.sin(b*S),X=Math.cos(b*S),et=o-F*(E*tt+g*X),Y=W(F*(B*tt+A*X));return a.done=Math.abs(Y)<=s&&Math.abs(o-et)<=i,a.value=a.done?o:et,a}const D=v(S);if(d)a.done=S>=h;else{const F=W(T(S));a.done=Math.abs(F)<=s&&Math.abs(o-D)<=i}return a.value=a.done?o:D,a},toString:()=>{const S=Math.min(hn(V),ee),D=gi(F=>V.next(S*F).value,S,30);return S+"ms "+D},toTransition:()=>{}};return V}ne.applyToOptions=t=>{const e=xr(t,100,ne);return t.ease=e.ease,t.duration=W(e.duration),t.type="keyframes",t};const Vr=5;function yi(t,e,n){const s=Math.max(e-Vr,0);return qs(n-t(s),e-s)}function Le({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:c=.5,restSpeed:l}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||u!==void 0&&A>u,p=A=>a===void 0?u:u===void 0||Math.abs(a-A)<Math.abs(u-A)?a:u;let m=n*e;const g=h+m,y=o===void 0?g:o(g);y!==g&&(m=y-h);const x=A=>-m*Math.exp(-A/s),v=A=>y+x(A),T=A=>{const V=x(A),S=v(A);f.done=Math.abs(V)<=c,f.value=f.done?y:S};let b,E;const B=A=>{d(f.value)&&(b=A,E=ne({keyframes:[f.value,p(f.value)],velocity:yi(v,A,f.value),damping:i,stiffness:r,restDelta:c,restSpeed:l}))};return B(0),{calculatedDuration:null,next:A=>{let V=!1;return!E&&b===void 0&&(V=!0,T(A),B(A)),b!==void 0&&A>=b?E.next(A-b):(!V&&T(A),f)}}}function Cr(t,e,n){const s=[],i=n||ot.mix||mi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||z:e;a=Ft(u,a)}s.push(a)}return s}function Mr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(nn(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Cr(e,s,i),u=a.length,c=l=>{if(o&&l<t[0])return e[0];let h=0;if(u>1)for(;h<t.length-2&&!(l<t[h+1]);h++);const f=Rt(t[h],t[h+1],l);return a[h](f)};return n?l=>c(Q(t[0],t[r-1],l)):c}function Dr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Rt(0,e,s);t.push(M(n,1,i))}}function Er(t){const e=[0];return Dr(e,t.length-1),e}function Rr(t,e){return t.map(n=>n*e)}function Lr(t,e){return t.map(()=>e||oi).splice(0,t.length-1)}function Mt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Uo(s)?s.map(Dn):Dn(s),r={done:!1,value:e[0]},o=Rr(n&&n.length===e.length?n:Er(e),t),a=Mr(o,e,{ease:Array.isArray(i)?i:Lr(e,i)});return{calculatedDuration:t,next:u=>(r.value=a(u),r.done=u>=t,r)}}const kr=t=>t!==null;function ue(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(kr),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Br={decay:Le,inertia:Le,tween:Mt,keyframes:Mt,spring:ne};function vi(t){typeof t.type=="string"&&(t.type=Br[t.type])}class fn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Fr=t=>t/100;class se extends fn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;vi(e);const{type:n=Mt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const u=n||Mt;u!==Mt&&typeof a[0]!="number"&&(this.mixKeyframes=Ft(Fr,mi(a[0],a[1])),a=[0,100]);const c=u({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=hn(c));const{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:l,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,T=s;if(h){const A=Math.min(this.currentTime,i)/a;let V=Math.floor(A),S=A%1;!S&&A>=1&&(S=1),S===1&&V--,V=Math.min(V,h+1),!!(V%2)&&(f==="reverse"?(S=1-S,d&&(S-=d/a)):f==="mirror"&&(T=o)),v=Q(0,1,S)*a}let b;x?(this.delayState.value=l[0],b=this.delayState):b=T.next(v),r&&!x&&(b.value=r(b.value));let{done:E}=b;!x&&u!==null&&(E=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return B&&p!==Le&&(b.value=ue(l,this.options,g,this.speed)),m&&m(b.value),B&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return $(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(this.currentTime)}set time(e){e=W(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return yi(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=$(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=vr,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Ir(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ft=t=>t*180/Math.PI,ke=t=>{const e=ft(Math.atan2(t[1],t[0]));return Be(e)},jr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ke,rotateZ:ke,skewX:t=>ft(Math.atan(t[1])),skewY:t=>ft(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Be=t=>(t=t%360,t<0&&(t+=360),t),In=ke,jn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),On=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Or={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:jn,scaleY:On,scale:t=>(jn(t)+On(t))/2,rotateX:t=>Be(ft(Math.atan2(t[6],t[5]))),rotateY:t=>Be(ft(Math.atan2(-t[2],t[0]))),rotateZ:In,rotate:In,skewX:t=>ft(Math.atan(t[4])),skewY:t=>ft(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Fe(t){return t.includes("scale")?1:0}function Ie(t,e){if(!t||t==="none")return Fe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Or,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=jr,i=a}if(!i)return Fe(e);const r=s[e],o=i[1].split(",").map(Ur);return typeof r=="function"?r(o):o[r]}const Nr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ie(n,e)};function Ur(t){return parseFloat(t.trim())}const St=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=new Set(St),Nn=t=>t===Pt||t===P,Wr=new Set(["x","y","z"]),Kr=St.filter(t=>!Wr.has(t));function $r(t){const e=[];return Kr.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const it={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-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:(t,{transform:e})=>Ie(e,"x"),y:(t,{transform:e})=>Ie(e,"y")};it.translateX=it.x;it.translateY=it.y;const dt=new Set;let je=!1,Oe=!1,Ne=!1;function xi(){if(Oe){const t=Array.from(dt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=$r(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Oe=!1,je=!1,dt.forEach(t=>t.complete(Ne)),dt.clear()}function Ti(){dt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Oe=!0)})}function zr(){Ne=!0,Ti(),xi(),Ne=!1}class dn{constructor(e,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(dt.add(this),je||(je=!0,C.read(Ti),C.resolveKeyframes(xi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Ir(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),dt.delete(this)}cancel(){this.state==="scheduled"&&(dt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Hr=t=>t.startsWith("--");function wi(t,e,n){Hr(e)?t.style.setProperty(e,n):t.style[e]=n}const Gr={};function Pi(t,e){const n=Ys(t);return()=>Gr[e]??n()}const _r=Pi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Si=Pi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Un={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vt([0,.65,.55,1]),circOut:Vt([.55,0,1,.45]),backIn:Vt([.31,.01,.66,-.59]),backOut:Vt([.33,1.53,.69,.99])};function bi(t,e){if(t)return typeof t=="function"?Si()?gi(t,e):"ease-out":ri(t)?Vt(t):Array.isArray(t)?t.map(n=>bi(n,e)||Un.easeOut):Un[t]}function Xr(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},c=void 0){const l={[e]:n};u&&(l.offset=u);const h=bi(a,i);Array.isArray(h)&&(l.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(l,f)}function Ai(t){return typeof t=="function"&&"applyToOptions"in t}function Yr({type:t,...e}){return Ai(t)&&Si()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Vi extends fn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,nn(typeof e.type!="string");const c=Yr(e);this.animation=Xr(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=ue(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),wi(n,s,l),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return $(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=W(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&_r()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),z):i(this)}}const Ci={anticipate:ni,backInOut:ei,circInOut:ii};function qr(t){return t in Ci}function Zr(t){typeof t.ease=="string"&&qr(t.ease)&&(t.ease=Ci[t.ease])}const ve=10;class Jr extends Vi{constructor(e){Zr(e),vi(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new se({...o,autoplay:!1}),u=Math.max(ve,N.now()-this.startTime),c=Q(0,ve,u-ve),l=a.sample(u).value,{name:h}=this.options;r&&h&&wi(r,h,l),n.setWithVelocity(a.sample(Math.max(0,u-c)).value,l,c),a.stop()}}const Wn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function Qr(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ta(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=Wn(i,e),a=Wn(r,e);return!o||!a?!1:Qr(t)||(n==="spring"||Ai(n))&&s}function Ue(t){t.duration=0,t.type="keyframes"}const Mi=new Set(["opacity","clipPath","filter","transform"]),ea=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function na(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&ea.test(t[e]))return!0;return!1}const sa=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ia=Ys(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oa(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=e.owner.getProps();return ia()&&n&&(Mi.has(n)||sa.has(n)&&na(a))&&(n!=="transform"||!l)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const ra=40;class aa extends fn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:u,motionValue:c,element:l,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:u,motionValue:c,element:l,...h},d=l?.KeyframeResolver||dn;this.keyframeResolver=new d(a,(p,m,g)=>this.onKeyframesResolved(p,m,f,!g),u,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:u,isHandoff:c,onUpdate:l}=s;this.resolvedAt=N.now();let h=!0;ta(e,r,o,a)||(h=!1,(ot.instantAnimations||!u)&&l?.(ue(e,s,n)),e[0]=e[e.length-1],Ue(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ra?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=h&&!c&&oa(d),m=d.motionValue?.owner?.current;let g;if(p)try{g=new Jr({...d,element:m})}catch{g=new se(d)}else g=new se(d);g.finished.then(()=>{this.notifyFinished()}).catch(z),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),zr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Di(t,e,n,s=0,i=1){const r=Array.from(t).sort((c,l)=>c.sortNodePosition(l)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const la=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ua(t){const e=la.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Ei(t,e,n=1){const[s,i]=ua(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Gs(o)?parseFloat(o):o}return an(i)?Ei(i,e,n+1):i}const ca={type:"spring",stiffness:500,damping:25,restSpeed:10},ha=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),fa={type:"keyframes",duration:.8},da={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},pa=(t,{keyframes:e})=>e.length>2?fa:bt.has(t)?t.startsWith("scale")?ha(e[1]):ca:da;function Ri(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function pn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ri(n,t):n}const ma=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ga(t){for(const e in t)if(!ma.has(e))return!0;return!1}const mn=(t,e,n,s={},i,r)=>o=>{const a=pn(s,t)||{},u=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-W(u);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};ga(a)||Object.assign(l,pa(t,l)),l.duration&&(l.duration=W(l.duration)),l.repeatDelay&&(l.repeatDelay=W(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let h=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(Ue(l),l.delay===0&&(h=!0)),(ot.instantAnimations||ot.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,Ue(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=ue(l.keyframes,a);if(f!==void 0){C.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new se(l):new aa(l)};function Kn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function gn(t,e,n,s){if(typeof e=="function"){const[i,r]=Kn(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Kn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function pt(t,e,n){const s=t.getProps();return gn(s,e,n!==void 0?n:s.custom,t)}const Li=new Set(["width","height","top","left","right","bottom",...St]),$n=30,ya=t=>!isNaN(parseFloat(t));class va{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=N.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ya(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new sn);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>$n)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,$n);return qs(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wt(t,e){return new va(t,e)}const We=t=>Array.isArray(t);function xa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,wt(n))}function Ta(t){return We(t)?t[t.length-1]||0:t}function wa(t,e){const n=pt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Ta(r[o]);xa(t,o,a)}}const O=t=>!!(t&&t.getVelocity);function Pa(t){return!!(O(t)&&t.add)}function Ke(t,e){const n=t.getValue("willChange");if(Pa(n))return n.add(e);if(!n&&ot.WillChange){const s=new ot.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function yn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Sa="framerAppearId",ki="data-"+yn(Sa);function Bi(t){return t.props[ki]}function ba({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Fi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Ri(r,u):u;const c=r?.reduceMotion;s&&(r=s);const l=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),p=a[f];if(p===void 0||h&&ba(h,f))continue;const m={delay:n,...pn(r||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating()&&!Array.isArray(p)&&p===g&&!m.velocity){C.update(()=>d.set(p));continue}let y=!1;if(window.MotionHandoffAnimation){const T=Bi(t);if(T){const b=window.MotionHandoffAnimation(T,f,C);b!==null&&(m.startTime=b,y=!0)}}Ke(t,f);const x=c??t.shouldReduceMotion;d.start(mn(f,d,p,x&&Li.has(f)?{type:!1}:m,t,y));const v=d.animation;v&&l.push(v)}if(o){const f=()=>C.update(()=>{o&&wa(t,o)});l.length?Promise.all(l).then(f):f()}return l}function $e(t,e,n={}){const s=pt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Fi(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:l,staggerDirection:h}=i;return Aa(t,e,u,c,l,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function Aa(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push($e(u,e,{...o,delay:n+(typeof s=="function"?0:s)+Di(t.variantChildren,u,s,i,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}function Va(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>$e(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=$e(t,e,n);else{const i=typeof e=="function"?pt(t,e,n.custom):e;s=Promise.all(Fi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ca={test:t=>t==="auto",parse:t=>t},Ii=t=>e=>e.test(t),ji=[Pt,P,J,st,Qo,Jo,Ca],zn=t=>ji.find(Ii(t));function Ma(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Xs(t):!0}const Da=new Set(["brightness","contrast","saturate","opacity"]);function Ea(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(ln)||[];if(!s)return t;const i=n.replace(s,"");let r=Da.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ra=/\b([a-z-]*)\(.*?\)/gu,ze={..._,getAnimatableNone:t=>{const e=t.match(Ra);return e?e.map(Ea).join(" "):t}},He={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Hn={...Pt,transform:Math.round},La={rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:st,skewX:st,skewY:st,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:Lt,originX:Rn,originY:Rn,originZ:P},vn={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...La,zIndex:Hn,fillOpacity:Lt,strokeOpacity:Lt,numOctaves:Hn},ka={...vn,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:ze,WebkitFilter:ze,mask:He,WebkitMask:He},Oi=t=>ka[t],Ba=new Set([ze,He]);function Ni(t,e){let n=Oi(t);return Ba.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Fa=new Set(["auto","none","0"]);function Ia(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Fa.has(r)&&Tt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Ni(n,i)}class ja extends dn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let h=e[l];if(typeof h=="string"&&(h=h.trim(),an(h))){const f=Ei(h,n.current);f!==void 0&&(e[l]=f),l===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Li.has(s)||e.length!==2)return;const[i,r]=e,o=zn(i),a=zn(r),u=En(i),c=En(r);if(u!==c&&it[s]){this.needsMeasurement=!0;return}if(o!==a)if(Nn(o)&&Nn(a))for(let l=0;l<e.length;l++){const h=e[l];typeof h=="string"&&(e[l]=parseFloat(h))}else it[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Ma(e[i]))&&s.push(i);s.length&&Ia(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=it[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=it[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u)}),this.resolveNoneKeyframes()}}function Ui(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Wi=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ht(t){return _s(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:xn}=ai(queueMicrotask,!1),G={x:!1,y:!1};function Ki(){return G.x||G.y}function Oa(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function $i(t,e){const n=Ui(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Na(t){return!(t.pointerType==="touch"||Ki())}function Ua(t,e,n={}){const[s,i,r]=$i(t,n);return s.forEach(o=>{let a=!1,u=!1,c;const l=()=>{o.removeEventListener("pointerleave",p)},h=g=>{c&&(c(g),c=void 0),l()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,h(g))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=g=>{if(g.pointerType!=="touch"){if(a){u=!0;return}h(g)}},m=g=>{if(!Na(g))return;u=!1;const y=e(o,g);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",d,i)}),r}const zi=(t,e)=>e?t===e?!0:zi(t,e.parentElement):!1,Tn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Wa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ka(t){return Wa.has(t.tagName)||t.isContentEditable===!0}const $a=new Set(["INPUT","SELECT","TEXTAREA"]);function za(t){return $a.has(t.tagName)||t.isContentEditable===!0}const Gt=new WeakSet;function Gn(t){return e=>{e.key==="Enter"&&t(e)}}function xe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ha=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Gn(()=>{if(Gt.has(n))return;xe(n,"down");const i=Gn(()=>{xe(n,"up")}),r=()=>xe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function _n(t){return Tn(t)&&!Ki()}const Xn=new WeakSet;function Ga(t,e,n={}){const[s,i,r]=$i(t,n),o=a=>{const u=a.currentTarget;if(!_n(a)||Xn.has(a))return;Gt.add(u),n.stopPropagation&&Xn.add(a);const c=e(u,a),l=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Gt.has(u)&&Gt.delete(u),_n(d)&&typeof c=="function"&&c(d,{success:p})},h=d=>{l(d,u===window||u===document||n.useGlobalTarget||zi(u,d.target))},f=d=>{l(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Ht(a)&&(a.addEventListener("focus",c=>Ha(c,i)),!Ka(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function wn(t){return _s(t)&&"ownerSVGElement"in t}const _t=new WeakMap;let Xt;const Hi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:wn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],_a=Hi("inline","width","offsetWidth"),Xa=Hi("block","height","offsetHeight");function Ya({target:t,borderBoxSize:e}){_t.get(t)?.forEach(n=>{n(t,{get width(){return _a(t,e)},get height(){return Xa(t,e)}})})}function qa(t){t.forEach(Ya)}function Za(){typeof ResizeObserver>"u"||(Xt=new ResizeObserver(qa))}function Ja(t,e){Xt||Za();const n=Ui(t);return n.forEach(s=>{let i=_t.get(s);i||(i=new Set,_t.set(s,i)),i.add(e),Xt?.observe(s)}),()=>{n.forEach(s=>{const i=_t.get(s);i?.delete(e),i?.size||Xt?.unobserve(s)})}}const Yt=new Set;let vt;function Qa(){vt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yt.forEach(e=>e(t))},window.addEventListener("resize",vt)}function tl(t){return Yt.add(t),vt||Qa(),()=>{Yt.delete(t),!Yt.size&&typeof vt=="function"&&(window.removeEventListener("resize",vt),vt=void 0)}}function Yn(t,e){return typeof t=="function"?tl(t):Ja(t,e)}function el(t){return wn(t)&&t.tagName==="svg"}const nl=[...ji,L,_],sl=t=>nl.find(Ii(t)),qn=()=>({translate:0,scale:1,origin:0,originPoint:0}),xt=()=>({x:qn(),y:qn()}),Zn=()=>({min:0,max:0}),k=()=>({x:Zn(),y:Zn()}),il=new WeakMap;function ce(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function kt(t){return typeof t=="string"||Array.isArray(t)}const Pn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sn=["initial",...Pn];function he(t){return ce(t.animate)||Sn.some(e=>kt(t[e]))}function Gi(t){return!!(he(t)||t.variants)}function ol(t,e,n){for(const s in e){const i=e[s],r=n[s];if(O(i))t.addValue(s,i);else if(O(r))t.addValue(s,wt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,wt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ge={current:null},_i={current:!1},rl=typeof window<"u";function al(){if(_i.current=!0,!!rl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ge.current=t.matches;t.addEventListener("change",e),e()}else Ge.current=!1}const Jn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ie={};function Xi(t){ie=t}function ll(){return ie}class ul{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=dn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=N.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,C.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=he(n),this.isVariantNode=Gi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];c[d]!==void 0&&O(p)&&p.set(c[d])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,il.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(_i.current||al(),this.shouldReduceMotion=Ge.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),rt(this.notifyUpdate),rt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Mi.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:u,ease:c,duration:l}=n.accelerate,h=new Vi({element:this.current,name:e,keyframes:a,times:u,ease:c,duration:W(l)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=bt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&C.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ie){const n=ie[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):k()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Jn.length;s++){const i=Jn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=ol(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=wt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Gs(s)||Xs(s))?s=parseFloat(s):!sl(s)&&_.test(n)&&(s=Ni(e,n)),this.setBaseTarget(e,O(s)?s.get():s)),O(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=gn(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!O(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new sn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){xn.render(this.render)}}class Yi extends ul{constructor(){super(...arguments),this.KeyframeResolver=ja}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;O(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class at{constructor(e){this.isMounted=!1,this.node=e}update(){}}function qi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function cl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function hl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Te(t){return t===void 0||t===1}function _e({scale:t,scaleX:e,scaleY:n}){return!Te(t)||!Te(e)||!Te(n)}function ct(t){return _e(t)||Zi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Zi(t){return Qn(t.x)||Qn(t.y)}function Qn(t){return t&&t!=="0%"}function oe(t,e,n){const s=t-n,i=e*s;return n+i}function ts(t,e,n,s,i){return i!==void 0&&(t=oe(t,i,s)),oe(t,n,s)+e}function Xe(t,e=0,n=1,s,i){t.min=ts(t.min,e,n,s,i),t.max=ts(t.max,e,n,s,i)}function Ji(t,{x:e,y:n}){Xe(t.x,e.translate,e.scale,e.originPoint),Xe(t.y,n.translate,n.scale,n.originPoint)}const es=.999999999999,ns=1.0000000000001;function fl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:u}=r.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(Z(t.x,-r.scroll.offset.x),Z(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ji(t,o)),s&&ct(r.latestValues)&&qt(t,r.latestValues,r.layout?.layoutBox))}e.x<ns&&e.x>es&&(e.x=1),e.y<ns&&e.y>es&&(e.y=1)}function Z(t,e){t.min+=e,t.max+=e}function ss(t,e,n,s,i=.5){const r=M(t.min,t.max,i);Xe(t,e,n,r,s)}function is(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function qt(t,e,n){const s=n??t;ss(t.x,is(e.x,s.x),e.scaleX,e.scale,e.originX),ss(t.y,is(e.y,s.y),e.scaleY,e.scale,e.originY)}function Qi(t,e){return qi(hl(t.getBoundingClientRect(),e))}function dl(t,e,n){const s=Qi(t,n),{scroll:i}=e;return i&&(Z(s.x,i.offset.x),Z(s.y,i.offset.y)),s}const pl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ml=St.length;function gl(t,e,n){let s="",i=!0;for(let r=0;r<ml;r++){const o=St[r],a=t[o];if(a===void 0)continue;let u=!0;if(typeof a=="number")u=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);u=o.startsWith("scale")?c===1:c===0}if(!u||n){const c=Wi(a,vn[o]);if(!u){i=!1;const l=pl[o]||o;s+=`${l}(${c}) `}n&&(e[o]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function bn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const u in e){const c=e[u];if(bt.has(u)){o=!0;continue}else if(ui(u)){i[u]=c;continue}else{const l=Wi(c,vn[u]);u.startsWith("origin")?(a=!0,r[u]=l):s[u]=l}}if(e.transform||(o||n?s.transform=gl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:u="50%",originY:c="50%",originZ:l=0}=r;s.transformOrigin=`${u} ${c} ${l}`}}function to(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function os(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const At={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=os(t,e.target.x),s=os(t,e.target.y);return`${n}% ${s}%`}},yl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=_.parse(t);if(i.length>5)return s;const r=_.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=u;const c=M(a,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),r(i)}},Ye={borderRadius:{...At,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:At,borderTopRightRadius:At,borderBottomLeftRadius:At,borderBottomRightRadius:At,boxShadow:yl};function eo(t,{layout:e,layoutId:n}){return bt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ye[t]||t==="opacity")}function An(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(O(s[o])||i&&O(i[o])||eo(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function vl(t){return window.getComputedStyle(t)}class xl extends Yi{constructor(){super(...arguments),this.type="html",this.renderInstance=to}readValueFromInstance(e,n){if(bt.has(n))return this.projection?.isProjecting?Fe(n):Nr(e,n);{const s=vl(e),i=(ui(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Qi(e,n)}build(e,n,s){bn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return An(e,n,s)}}const Tl={offset:"stroke-dashoffset",array:"stroke-dasharray"},wl={offset:"strokeDashoffset",array:"strokeDasharray"};function Pl(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Tl:wl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Sl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function no(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},u,c,l){if(bn(t,a,c),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=l?.transformBox??"fill-box",delete h.transformBox);for(const d of Sl)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Pl(h,i,r,o,!1)}const so=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"]),io=t=>typeof t=="string"&&t.toLowerCase()==="svg";function bl(t,e,n,s){to(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(so.has(i)?i:yn(i),e.attrs[i])}function oo(t,e,n){const s=An(t,e,n);for(const i in t)if(O(t[i])||O(e[i])){const r=St.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Al extends Yi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(bt.has(n)){const s=Oi(n);return s&&s.default||0}return n=so.has(n)?n:yn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return oo(e,n,s)}build(e,n,s){no(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){bl(e,n,s,i)}mount(e){this.isSVGTag=io(e.tagName),super.mount(e)}}const Vl=Sn.length;function ro(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ro(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Vl;n++){const s=Sn[n],i=t.props[s];(kt(i)||i===!1)&&(e[s]=i)}return e}function ao(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Cl=[...Pn].reverse(),Ml=Pn.length;function Dl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Va(t,n,s)))}function El(t){let e=Dl(t),n=rs(),s=!0,i=!1;const r=c=>(l,h)=>{const f=pt(t,h,c==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function o(c){e=c(t)}function a(c){const{props:l}=t,h=ro(t.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let y=0;y<Ml;y++){const x=Cl[y],v=n[x],T=l[x]!==void 0?l[x]:h[x],b=kt(T),E=x===c?v.isActive:null;E===!1&&(m=y);let B=T===h[x]&&T!==l[x]&&b;if(B&&(s||i)&&t.manuallyAnimateOnMount&&(B=!1),v.protectedKeys={...p},!v.isActive&&E===null||!T&&!v.prevProp||ce(T)||typeof T=="boolean")continue;if(x==="exit"&&v.isActive&&E!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const A=Rl(v.prevProp,T);let V=A||x===c&&v.isActive&&!B&&b||y>m&&b,S=!1;const D=Array.isArray(T)?T:[T];let F=D.reduce(r(x),{});E===!1&&(F={});const{prevResolvedValues:tt={}}=v,X={...tt,...F},et=I=>{V=!0,d.has(I)&&(S=!0,d.delete(I)),v.needsAnimating[I]=!0;const K=t.getValue(I);K&&(K.liveStyle=!1)};for(const I in X){const K=F[I],lt=tt[I];if(p.hasOwnProperty(I))continue;let mt=!1;We(K)&&We(lt)?mt=!ao(K,lt):mt=K!==lt,mt?K!=null?et(I):d.add(I):K!==void 0&&d.has(I)?et(I):v.protectedKeys[I]=!0}v.prevProp=T,v.prevResolvedValues=F,v.isActive&&(p={...p,...F}),(s||i)&&t.blockInitialAnimation&&(V=!1);const Y=B&&A;V&&(!Y||S)&&f.push(...D.map(I=>{const K={type:x};if(typeof I=="string"&&(s||i)&&!Y&&t.manuallyAnimateOnMount&&t.parent){const{parent:lt}=t,mt=pt(lt,I);if(lt.enteringChildren&&mt){const{delayChildren:Lo}=mt.transition||{};K.delay=Di(lt.enteringChildren,t,Lo)}}return{animation:I,options:K}}))}if(d.size){const y={};if(typeof l.initial!="boolean"){const x=pt(t,Array.isArray(l.initial)?l.initial[0]:l.initial);x&&x.transition&&(y.transition=x.transition)}d.forEach(x=>{const v=t.getBaseTarget(x),T=t.getValue(x);T&&(T.liveStyle=!0),y[x]=v??null}),f.push({animation:y})}let g=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(f):Promise.resolve()}function u(c,l){if(n[c].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(c,l)),n[c].isActive=l;const h=a(c);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=rs(),i=!0}}}function Rl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!ao(e,t):!1}function ut(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rs(){return{animate:ut(!0),whileInView:ut(),whileHover:ut(),whileTap:ut(),whileDrag:ut(),whileFocus:ut(),exit:ut()}}function qe(t,e){t.min=e.min,t.max=e.max}function H(t,e){qe(t.x,e.x),qe(t.y,e.y)}function as(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const lo=1e-4,Ll=1-lo,kl=1+lo,uo=.01,Bl=0-uo,Fl=0+uo;function U(t){return t.max-t.min}function Il(t,e,n){return Math.abs(t-e)<=n}function ls(t,e,n,s=.5){t.origin=s,t.originPoint=M(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=M(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Ll&&t.scale<=kl||isNaN(t.scale))&&(t.scale=1),(t.translate>=Bl&&t.translate<=Fl||isNaN(t.translate))&&(t.translate=0)}function Dt(t,e,n,s){ls(t.x,e.x,n.x,s?s.originX:void 0),ls(t.y,e.y,n.y,s?s.originY:void 0)}function us(t,e,n,s=0){const i=s?M(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+U(e)}function jl(t,e,n,s){us(t.x,e.x,n.x,s?.x),us(t.y,e.y,n.y,s?.y)}function cs(t,e,n,s=0){const i=s?M(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+U(e)}function re(t,e,n,s){cs(t.x,e.x,n.x,s?.x),cs(t.y,e.y,n.y,s?.y)}function hs(t,e,n,s,i){return t-=e,t=oe(t,1/n,s),i!==void 0&&(t=oe(t,1/i,s)),t}function Ol(t,e=0,n=1,s=.5,i,r=t,o=t){if(J.test(e)&&(e=parseFloat(e),e=M(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=M(r.min,r.max,s);t===r&&(a-=e),t.min=hs(t.min,e,n,a,i),t.max=hs(t.max,e,n,a,i)}function fs(t,e,[n,s,i],r,o){Ol(t,e[n],e[s],e[i],e.scale,r,o)}const Nl=["x","scaleX","originX"],Ul=["y","scaleY","originY"];function ds(t,e,n,s){fs(t.x,e,Nl,n?n.x:void 0,s?s.x:void 0),fs(t.y,e,Ul,n?n.y:void 0,s?s.y:void 0)}function ps(t){return t.translate===0&&t.scale===1}function co(t){return ps(t.x)&&ps(t.y)}function ms(t,e){return t.min===e.min&&t.max===e.max}function Wl(t,e){return ms(t.x,e.x)&&ms(t.y,e.y)}function gs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function ho(t,e){return gs(t.x,e.x)&&gs(t.y,e.y)}function ys(t){return U(t.x)/U(t.y)}function vs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function q(t){return[t("x"),t("y")]}function Kl(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:l,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;c&&(s=`perspective(${c}px) ${s}`),l&&(s+=`rotate(${l}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,u=t.y.scale*e.y;return(a!==1||u!==1)&&(s+=`scale(${a}, ${u})`),s||"none"}const fo=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],$l=fo.length,xs=t=>typeof t=="string"?parseFloat(t):t,Ts=t=>typeof t=="number"||P.test(t);function zl(t,e,n,s,i,r){i?(t.opacity=M(0,n.opacity??1,Hl(s)),t.opacityExit=M(e.opacity??1,0,Gl(s))):r&&(t.opacity=M(e.opacity??1,n.opacity??1,s));for(let o=0;o<$l;o++){const a=fo[o];let u=ws(e,a),c=ws(n,a);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||Ts(u)===Ts(c)?(t[a]=Math.max(M(xs(u),xs(c),s),0),(J.test(c)||J.test(u))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function ws(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Hl=po(0,.5,si),Gl=po(.5,.95,z);function po(t,e,n){return s=>s<t?0:s>e?1:n(Rt(t,e,s))}function _l(t,e,n){const s=O(t)?t:wt(t);return s.start(mn("",s,e,n)),s.animation}function Bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Xl=(t,e)=>t.depth-e.depth;class Yl{constructor(){this.children=[],this.isDirty=!1}add(e){en(this.children,e),this.isDirty=!0}remove(e){Qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Xl),this.isDirty=!1,this.children.forEach(e)}}function ql(t,e){const n=N.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(rt(s),t(r-e))};return C.setup(s,!0),()=>rt(s)}function Zt(t){return O(t)?t.get():t}class Zl{constructor(){this.members=[]}add(e){en(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Qt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},we=["","X","Y","Z"],Jl=1e3;let Ql=0;function Pe(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function mo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Bi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&mo(s)}function go({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=Ql++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nu),this.nodes.forEach(lu),this.nodes.forEach(uu),this.nodes.forEach(su)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Yl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new sn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const u=this.eventHandlers.get(o);u&&u.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=wn(o)&&!el(o),this.instance=o;const{layoutId:a,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),t){let l,h=0;const f=()=>this.root.updateBlockedByResize=!1;C.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,l&&l(),l=ql(f,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(bs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||u)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||pu,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=c.getProps(),y=!this.targetLayout||!ho(this.targetLayout,d),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...pn(p,"layout"),onPlay:m,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(l,x)}else h||bs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),rt(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(cu),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&mo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const h=this.path[l];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(ou),this.nodes.forEach(Ps);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ss);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ru),this.nodes.forEach(au),this.nodes.forEach(tu),this.nodes.forEach(eu)):this.nodes.forEach(Ss),this.clearAllSnapshots();const a=N.now();j.delta=Q(0,1e3/60,a-j.timestamp),j.timestamp=a,j.isProcessing=!0,de.update.process(j),de.preRender.process(j),de.render.process(j),j.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(iu),this.sharedNodes.forEach(hu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!U(this.snapshot.measuredBox.x)&&!U(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=k()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const u=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!co(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,l=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ct(this.latestValues)||l)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return o&&(u=this.removeTransform(u)),mu(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return k();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gu))){const{scroll:c}=this.root;c&&(Z(a.x,c.offset.x),Z(a.y,c.offset.y))}return a}removeElementScroll(o){const a=k();if(H(a,o),this.scroll?.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:l,options:h}=c;c!==this.root&&l&&h.layoutScroll&&(l.wasRoot&&H(a,o),Z(a.x,l.offset.x),Z(a.y,l.offset.y))}return a}applyTransform(o,a=!1,u){const c=u||k();H(c,o);for(let l=0;l<this.path.length;l++){const h=this.path[l];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(Z(c.x,-h.scroll.offset.x),Z(c.y,-h.scroll.offset.y)),ct(h.latestValues)&&qt(c,h.latestValues,h.layout?.layoutBox)}return ct(this.latestValues)&&qt(c,this.latestValues,this.layout?.layoutBox),c}removeTransform(o){const a=k();H(a,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!ct(c.latestValues))continue;let l;c.instance&&(_e(c.latestValues)&&c.updateSnapshot(),l=k(),H(l,c.measurePageBox())),ds(a,c.latestValues,c.snapshot?.layoutBox,l)}return ct(this.latestValues)&&ds(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==j.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==a;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:h}=this.options;if(!this.layout||!(l||h))return;this.resolvedRelativeTargetAt=j.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),jl(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):H(this.target,this.layout.layoutBox),Ji(this.target,this.targetDelta)):H(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||_e(this.parent.latestValues)||Zi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=k(),this.relativeTargetOrigin=k(),re(this.relativeTargetOrigin,a,u,this.options.layoutAnchor||void 0),H(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===j.timestamp&&(u=!1),u)return;const{layout:c,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||l))return;H(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;fl(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=k());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(as(this.prevProjectionDelta.x,this.projectionDelta.x),as(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!vs(this.projectionDelta.x,this.prevProjectionDelta.x)||!vs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=xt(),this.projectionDelta=xt(),this.projectionDeltaWithTransform=xt()}setAnimationOrigin(o,a=!1){const u=this.snapshot,c=u?u.latestValues:{},l={...this.latestValues},h=xt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=k(),d=u?u.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,g=this.getStack(),y=!g||g.members.length<=1,x=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(du));this.animationProgress=0;let v;this.mixTargetDelta=T=>{const b=T/1e3;As(h.x,o.x,b),As(h.y,o.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(re(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),fu(this.relativeTarget,this.relativeTargetOrigin,f,b),v&&Wl(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=k()),H(v,this.relativeTarget)),m&&(this.animationValues=l,zl(l,c,this.latestValues,b,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(rt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{Jt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wt(0)),this.motionValue.jump(0,!1),this.currentAnimation=_l(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:u,layout:c,latestValues:l}=o;if(!(!a||!u||!c)){if(this!==o&&this.layout&&c&&yo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||k();const h=U(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+h;const f=U(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+f}H(a,u),qt(a,l),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Zl),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const c={};u.z&&Pe("z",o,c,this.animationValues);for(let l=0;l<we.length;l++)Pe(`rotate${we[l]}`,o,c,this.animationValues),Pe(`skew${we[l]}`,o,c,this.animationValues);o.render();for(const l in c)o.setStaticValue(l,c[l]),this.animationValues&&(this.animationValues[l]=c[l]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Zt(a?.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Zt(a?.pointerEvents)||""),this.hasProjected&&!ct(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=Kl(this.projectionDeltaWithTransform,this.treeScale,l);u&&(h=u(l,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=c===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in Ye){if(l[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=Ye[p],x=h==="none"?l[p]:m(l[p],c);if(g){const v=g.length;for(let T=0;T<v;T++)o[g[T]]=x}else y?this.options.visualElement.renderState.vars[p]=x:o[p]=x}this.options.layoutId&&(o.pointerEvents=c===this?Zt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Ps),this.root.sharedNodes.clear()}}}function tu(t){t.updateLayout()}function eu(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")q(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=U(h);h.min=n[l].min,h.max=h.min+f});else if(i==="x"||i==="y"){const l=i==="x"?"y":"x";qe(r?e.measuredBox[l]:e.layoutBox[l],n[l])}else yo(i,e.layoutBox,n)&&q(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=U(n[l]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const o=xt();Dt(o,n,e.layoutBox);const a=xt();r?Dt(a,t.applyTransform(s,!0),e.measuredBox):Dt(a,n,e.layoutBox);const u=!co(o);let c=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:h,layout:f}=l;if(h&&f){const d=t.options.layoutAnchor||void 0,p=k();re(p,e.layoutBox,h.layoutBox,d);const m=k();re(m,n,f.layoutBox,d),ho(p,m)||(c=!0),l.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function nu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function su(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function iu(t){t.clearSnapshot()}function Ps(t){t.clearMeasurements()}function ou(t){t.isLayoutDirty=!0,t.updateLayout()}function Ss(t){t.isLayoutDirty=!1}function ru(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function au(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function bs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function lu(t){t.resolveTargetDelta()}function uu(t){t.calcProjection()}function cu(t){t.resetSkewAndRotation()}function hu(t){t.removeLeadSnapshot()}function As(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Vs(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function fu(t,e,n,s){Vs(t.x,e.x,n.x,s),Vs(t.y,e.y,n.y,s)}function du(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const pu={duration:.45,ease:[.4,0,.1,1]},Cs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ms=Cs("applewebkit/")&&!Cs("chrome/")?Math.round:z;function Ds(t){t.min=Ms(t.min),t.max=Ms(t.max)}function mu(t){Ds(t.x),Ds(t.y)}function yo(t,e,n){return t==="position"||t==="preserve-aspect"&&!Il(ys(e),ys(n),.2)}function gu(t){return t!==t.root&&t.scroll?.wasRoot}const yu=go({attachResizeListener:(t,e)=>Bt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Se={current:void 0},vo=go({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Se.current){const t=new yu({});t.mount(window),t.setOptions({layoutScroll:!0}),Se.current=t}return Se.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Vn=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Es(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function vu(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Es(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Es(t[i],null)}}}}function xu(...t){return w.useCallback(vu(...t),t)}class Tu extends w.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Ht(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Ht(s)&&s.offsetWidth||0,r=Ht(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function wu({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=w.useId(),a=w.useRef(null),u=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=w.useContext(Vn),l=t.props?.ref??t?.ref,h=xu(a,l);return w.useInsertionEffect(()=>{const{width:f,height:d,top:p,left:m,right:g,bottom:y}=u.current;if(e||r===!1||!a.current||!f||!d)return;const x=n==="left"?`left: ${m}`:`right: ${g}`,v=s==="bottom"?`bottom: ${y}`:`top: ${p}`;a.current.dataset.motionPopId=o;const T=document.createElement("style");c&&(T.nonce=c);const b=i??document.head;return b.appendChild(T),T.sheet&&T.sheet.insertRule(`
2
+ [data-motion-pop-id="${o}"] {
3
+ position: absolute !important;
4
+ width: ${f}px !important;
5
+ height: ${d}px !important;
6
+ ${x}px !important;
7
+ ${v}px !important;
8
+ }
9
+ `),()=>{a.current?.removeAttribute("data-motion-pop-id"),b.contains(T)&&b.removeChild(T)}},[e]),nt.jsx(Tu,{isPresent:e,childRef:a,sizeRef:u,pop:r,children:r===!1?t:w.cloneElement(t,{ref:h})})}const Pu=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:u,root:c})=>{const l=tn(Su),h=w.useId();let f=!0,d=w.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;s&&s()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,s]);return r&&f&&(d={...d}),w.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),w.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=nt.jsx(wu,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:u,root:c,children:t}),nt.jsx(le.Provider,{value:d,children:t})};function Su(){return new Map}function xo(t=!0){const e=w.useContext(le);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=w.useId();w.useEffect(()=>{if(t)return i(r)},[t]);const o=w.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Wt=t=>t.key||"";function Rs(t){const e=[];return w.Children.forEach(t,n=>{w.isValidElement(n)&&e.push(n)}),e}const Fc=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:u="top",root:c})=>{const[l,h]=xo(o),f=w.useMemo(()=>Rs(t),[t]),d=o&&!l?[]:f.map(Wt),p=w.useRef(!0),m=w.useRef(f),g=tn(()=>new Map),y=w.useRef(new Set),[x,v]=w.useState(f),[T,b]=w.useState(f);Hs(()=>{p.current=!1,m.current=f;for(let A=0;A<T.length;A++){const V=Wt(T[A]);d.includes(V)?(g.delete(V),y.current.delete(V)):g.get(V)!==!0&&g.set(V,!1)}},[T,d.length,d.join("-")]);const E=[];if(f!==x){let A=[...f];for(let V=0;V<T.length;V++){const S=T[V],D=Wt(S);d.includes(D)||(A.splice(V,0,S),E.push(S))}return r==="wait"&&E.length&&(A=E),b(Rs(A)),v(f),null}const{forceRender:B}=w.useContext(Qe);return nt.jsx(nt.Fragment,{children:T.map(A=>{const V=Wt(A),S=o&&!l?!1:f===T||d.includes(V),D=()=>{if(y.current.has(V))return;if(g.has(V))y.current.add(V),g.set(V,!0);else return;let F=!0;g.forEach(tt=>{tt||(F=!1)}),F&&(B?.(),b(m.current),o&&h?.(),s&&s())};return nt.jsx(Pu,{isPresent:S,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:c,onExitComplete:S?void 0:D,anchorX:a,anchorY:u,children:A},V)})})},To=w.createContext({strict:!1}),Ls={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 ks=!1;function bu(){if(ks)return;const t={};for(const e in Ls)t[e]={isEnabled:n=>Ls[e].some(s=>!!n[s])};Xi(t),ks=!0}function wo(){return bu(),ll()}function Au(t){const e=wo();for(const n in t)e[n]={...e[n],...t[n]};Xi(e)}const Vu=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 ae(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Vu.has(t)}let Po=t=>!ae(t);function Cu(t){typeof t=="function"&&(Po=e=>e.startsWith("on")?!ae(e):t(e))}try{Cu(require("@emotion/is-prop-valid").default)}catch{}function Mu(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||O(t[i])||(Po(i)||n===!0&&ae(i)||!e&&!ae(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const fe=w.createContext({});function Du(t,e){if(he(t)){const{initial:n,animate:s}=t;return{initial:n===!1||kt(n)?n:void 0,animate:kt(s)?s:void 0}}return t.inherit!==!1?e:{}}function Eu(t){const{initial:e,animate:n}=Du(t,w.useContext(fe));return w.useMemo(()=>({initial:e,animate:n}),[Bs(e),Bs(n)])}function Bs(t){return Array.isArray(t)?t.join(" "):t}const Cn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function So(t,e,n){for(const s in e)!O(e[s])&&!eo(s,n)&&(t[s]=e[s])}function Ru({transformTemplate:t},e){return w.useMemo(()=>{const n=Cn();return bn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Lu(t,e){const n=t.style||{},s={};return So(s,n,t),Object.assign(s,Ru(t,e)),s}function ku(t,e){const n={},s=Lu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const bo=()=>({...Cn(),attrs:{}});function Bu(t,e,n,s){const i=w.useMemo(()=>{const r=bo();return no(r,e,io(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};So(r,t.style,t),i.style={...r,...i.style}}return i}const Fu=["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 Mn(t){return typeof t!="string"||t.includes("-")?!1:!!(Fu.indexOf(t)>-1||/[A-Z]/u.test(t))}function Iu(t,e,n,{latestValues:s},i,r=!1,o){const u=(o??Mn(t)?Bu:ku)(e,s,i,t),c=Mu(e,typeof t=="string",r),l=t!==w.Fragment?{...c,...u,ref:n}:{},{children:h}=e,f=w.useMemo(()=>O(h)?h.get():h,[h]);return w.createElement(t,{...l,children:f})}function ju({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Ou(n,s,i,t),renderState:e()}}function Ou(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=Zt(r[f]);let{initial:o,animate:a}=t;const u=he(t),c=Gi(t);e&&c&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const h=l?a:o;if(h&&typeof h!="boolean"&&!ce(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=gn(t,f[d]);if(p){const{transitionEnd:m,transition:g,...y}=p;for(const x in y){let v=y[x];if(Array.isArray(v)){const T=l?v.length-1:0;v=v[T]}v!==null&&(i[x]=v)}for(const x in m)i[x]=m[x]}}}return i}const Ao=t=>(e,n)=>{const s=w.useContext(fe),i=w.useContext(le),r=()=>ju(t,e,s,i);return n?r():tn(r)},Nu=Ao({scrapeMotionValuesFromProps:An,createRenderState:Cn}),Uu=Ao({scrapeMotionValuesFromProps:oo,createRenderState:bo}),Wu=Symbol.for("motionComponentSymbol");function Ku(t,e,n){const s=w.useRef(n);w.useInsertionEffect(()=>{s.current=n});const i=w.useRef(null);return w.useCallback(r=>{r&&t.onMount?.(r);const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Vo=w.createContext({});function gt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function $u(t,e,n,s,i,r){const{visualElement:o}=w.useContext(fe),a=w.useContext(To),u=w.useContext(le),c=w.useContext(Vn),l=c.reducedMotion,h=c.skipAnimations,f=w.useRef(null),d=w.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:l,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,m=w.useContext(Vo);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&zu(f.current,n,i,m);const g=w.useRef(!1);w.useInsertionEffect(()=>{p&&g.current&&p.update(n,u)});const y=n[ki],x=w.useRef(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Hs(()=>{d.current=!0,p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),x.current&&p.animationState&&p.animationState.animateChanges())}),w.useEffect(()=>{p&&(!x.current&&p.animationState&&p.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),x.current=!1),p.enteringChildren=void 0)}),p}function zu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:c,layoutAnchor:l,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Co(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&gt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:u,layoutRoot:c,layoutAnchor:l})}function Co(t){if(t)return t.options.allowProjection!==!1?t.projection:Co(t.parent)}function be(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Au(s);const r=n?n==="svg":Mn(t),o=r?Uu:Nu;function a(c,l){let h;const f={...w.useContext(Vn),...c,layoutId:Hu(c)},{isStatic:d}=f,p=Eu(c),m=o(c,d);if(!d&&typeof window<"u"){Gu();const g=_u(f);h=g.MeasureLayout,p.visualElement=$u(t,m,f,i,g.ProjectionNode,r)}return nt.jsxs(fe.Provider,{value:p,children:[h&&p.visualElement?nt.jsx(h,{visualElement:p.visualElement,...f}):null,Iu(t,c,Ku(m,p.visualElement,l),m,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=w.forwardRef(a);return u[Wu]=t,u}function Hu({layoutId:t}){const e=w.useContext(Qe).id;return e&&t!==void 0?e+"-"+t:t}function Gu(t,e){w.useContext(To).strict}function _u(t){const e=wo(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Xu(t,e){if(typeof Proxy>"u")return be;const n=new Map,s=(r,o)=>be(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,be(o,void 0,t,e)),n.get(o))})}const Yu=(t,e)=>e.isSVG??Mn(t)?new Al(e):new xl(e,{allowProjection:t!==w.Fragment});class qu extends at{constructor(e){super(e),e.animationState||(e.animationState=El(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ce(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Zu=0;class Ju extends at{constructor(){super(...arguments),this.id=Zu++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"){const a=pt(this.node,r,o);if(a){const{transition:u,transitionEnd:c,...l}=a;for(const h in l)this.node.getValue(h)?.jump(l[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Qu={animation:{Feature:qu},exit:{Feature:Ju}};function Ot(t){return{point:{x:t.pageX,y:t.pageY}}}const tc=t=>e=>Tn(e)&&t(e,Ot(e));function Et(t,e,n,s){return Bt(t,e,tc(n),s)}const Mo=({current:t})=>t?t.ownerDocument.defaultView:null,Fs=(t,e)=>Math.abs(t-e);function ec(t,e){const n=Fs(t.x,e.x),s=Fs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Is=new Set(["auto","scroll"]);class Do{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Kt(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Ae(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=ec(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=d,{timestamp:y}=j;this.history.push({...g,timestamp:y});const{onStart:x,onMove:v}=this.handlers;p||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=Kt(p,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ae(d.type==="pointercancel"?this.lastMoveEventInfo:Kt(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,x),g&&g(d,x)},!Tn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const u=Ot(e),c=Kt(u,this.transformPagePoint),{point:l}=c,{timestamp:h}=j;this.history=[{...l,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ae(c,this.history)),this.removeListeners=Ft(Et(this.contextWindow,"pointermove",this.handlePointerMove),Et(this.contextWindow,"pointerup",this.handlePointerUp),Et(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Is.has(s.overflowX)||Is.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(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),C.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),rt(this.updatePoint)}}function Kt(t,e){return e?{point:e(t.point)}:t}function js(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ae({point:t},e){return{point:t,delta:js(t,Eo(e)),offset:js(t,nc(e)),velocity:sc(e,.1)}}function nc(t){return t[0]}function Eo(t){return t[t.length-1]}function sc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Eo(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>W(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>W(e)*2&&(s=t[1]);const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ic(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?M(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?M(n,t,s.max):Math.min(t,n)),t}function Os(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function oc(t,{top:e,left:n,bottom:s,right:i}){return{x:Os(t.x,n,i),y:Os(t.y,e,s)}}function Ns(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function rc(t,e){return{x:Ns(t.x,e.x),y:Ns(t.y,e.y)}}function ac(t,e){let n=.5;const s=U(t),i=U(e);return i>s?n=Rt(e.min,e.max-s,t.min):s>i&&(n=Rt(t.min,t.max-i,e.min)),Q(0,1,n)}function lc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Ze=.35;function uc(t=Ze){return t===!1?t=0:t===!0&&(t=Ze),{x:Us(t,"left","right"),y:Us(t,"top","bottom")}}function Us(t,e,n){return{min:Ws(t,e),max:Ws(t,n)}}function Ws(t,e){return typeof t=="number"?t:t[e]||0}const cc=new WeakMap;class hc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=k(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Ot(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Oa(d),!this.openDragLock))return;this.latestPointerEvent=h,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),q(y=>{let x=this.getAxisMotionValue(y).get()||0;if(J.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const T=v.layout.layoutBox[y];T&&(x=U(T)*(parseFloat(x)/100))}}this.originPoint[y]=x}),m&&C.update(()=>m(h,f),!1,!0),Ke(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=dc(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&C.update(()=>g(h,f),!1,!0)},u=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Do(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Mo(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&C.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.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(e,n,s){const{drag:i}=this.getProps();if(!s||!$t(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=ic(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&gt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=oc(s.layoutBox,e):this.constraints=!1,this.elastic=uc(n),i!==this.constraints&&!gt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&q(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=lc(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!gt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=dl(s,i.root,this.visualElement.getTransformPagePoint());let o=rc(i.layout.layoutBox,r);if(n){const a=n(cl(o));this.hasMutatedConstraints=!!a,a&&(o=qi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=q(l=>{if(!$t(l,n,this.currentDirection))return;let h=u&&u[l]||{};(o===!0||o===l)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[l]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(l,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ke(this.visualElement,e),s.start(mn(e,s,0,n,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){q(n=>{const{drag:s}=this.getProps();if(!$t(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],u=r.get()||0;r.set(e[n]-M(o,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!gt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};q(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const u=a.get();i[o]=ac({min:u,max:u},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(o=>{if(!$t(o,e,null))return;const a=this.getAxisMotionValue(o),{min:u,max:c}=this.constraints[o];a.set(M(u,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;cc.set(this.visualElement,this);const e=this.visualElement.current,n=Et(e,"pointerdown",c=>{const{drag:l,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&za(f);l&&h&&!d&&this.start(c)});let s;const i=()=>{const{dragConstraints:c}=this.getProps();gt(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),s||(s=fc(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),C.read(i);const a=Bt(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(q(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),u&&u(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Ze,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ks(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function fc(t,e,n){const s=Yn(t,Ks(n)),i=Yn(e,Ks(n));return()=>{s(),i()}}function $t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function dc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class pc extends at{constructor(e){super(e),this.removeGroupControls=z,this.removeListeners=z,this.controls=new hc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||z}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ve=t=>(e,n)=>{t&&C.update(()=>t(e,n),!1,!0)};class mc extends at{constructor(){super(...arguments),this.removePointerDownListener=z}onPointerDown(e){this.session=new Do(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Mo(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ve(e),onStart:Ve(n),onMove:Ve(s),onEnd:(r,o)=>{delete this.session,i&&C.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Et(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Ce=!1;class gc extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Ce&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Ce=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||C.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),xn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Ce=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ro(t){const[e,n]=xo(),s=w.useContext(Qe);return nt.jsx(gc,{...t,layoutGroup:s,switchLayoutGroup:w.useContext(Vo),isPresent:e,safeToRemove:n})}const yc={pan:{Feature:mc},drag:{Feature:pc,ProjectionNode:vo,MeasureLayout:Ro}};function $s(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&C.postRender(()=>r(e,Ot(e)))}class vc extends at{mount(){const{current:e}=this.node;e&&(this.unmount=Ua(e,(n,s)=>($s(this.node,s,"Start"),i=>$s(this.node,i,"End"))))}unmount(){}}class xc extends at{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ft(Bt(this.node.current,"focus",()=>this.onFocus()),Bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function zs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&C.postRender(()=>r(e,Ot(e)))}class Tc extends at{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Ga(e,(i,r)=>(zs(this.node,r,"Start"),(o,{success:a})=>zs(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const Je=new WeakMap,Me=new WeakMap,wc=t=>{const e=Je.get(t.target);e&&e(t)},Pc=t=>{t.forEach(wc)};function Sc({root:t,...e}){const n=t||document;Me.has(n)||Me.set(n,{});const s=Me.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Pc,{root:t,...e})),s[i]}function bc(t,e,n){const s=Sc(e);return Je.set(t,n),s.observe(t),()=>{Je.delete(t),s.unobserve(t)}}const Ac={some:0,all:1};class Vc extends at{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Ac[i]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:l,onViewportLeave:h}=this.node.getProps(),f=c?l:h;f&&f(u)};this.stopObserver=bc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Cc(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Cc({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Mc={inView:{Feature:Vc},tap:{Feature:Tc},focus:{Feature:xc},hover:{Feature:vc}},Dc={layout:{ProjectionNode:vo,MeasureLayout:Ro}},Ec={...Qu,...Mc,...yc,...Dc},Ic=Xu(Ec,Yu);export{Fc as A,Ic as m};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-Zb8sVEtn.js";import{g as Ie,r as b}from"./react-vendor-CNOkPC89.js";import{bB as Ce,bC as Ae,bD as ke,bE as Fe,bF as q,bG as ie,bH as M,bI as Le,bJ as Ue,a as pe,c as I,B as U,d as Z,bx as Ge,aZ as Me,bK as Be,bL as qe,bM as ze,bN as He,bO as Ke,bP as Ze,bQ as Qe,bR as Ye,bS as Je,aM as Xe,M as et,O as tt,r as st,s as nt,t as rt,v as at,w as it,T as ot,p as lt,q as ct,Y as ut}from"./index-0mNJhDEG.js";import{A as dt,a as mt,b as xt,c as pt,d as gt,e as ft,f as ht,g as bt}from"./alert-dialog-CjnZBDj3.js";import{u as Ee,a as yt,b as jt,h as vt}from"./tanstack-CrmUhA7Z.js";import{t as oe}from"./notifications-B2HqRBj7.js";import{be as ye,R as K,t as Nt,s as St,u as wt,A as Ct,bf as At,bg as kt,bh as Et,X as Tt,e as Pt,bi as Vt,bj as $t,U as Ot,v as Rt,m as Dt,w as Wt,aF as _t,T as le,aP as It}from"./icons-DyorC3Xk.js";var ce,je;function Ft(){return je||(je=1,ce={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ce}var Lt=Ft();const Ut=Ie(Lt);var Gt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function ve(t){var s={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(s.name=n[1],(Ut[n[1]]||t.charAt(t.length-2)==="/")&&(s.voidElement=!0),s.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var a=new RegExp(Gt),i=null;(i=a.exec(t))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),u=[o,""];o.indexOf("=")>-1&&(u=o.split("=")),s.attrs[u[0]]=u[1],a.lastIndex--}else i[2]&&(s.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return s}var Mt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Bt=/^\s*$/,qt=Object.create(null);function Te(t,s){switch(s.type){case"text":return t+s.content;case"tag":return t+="<"+s.name+(s.attrs?(function(n){var r=[];for(var a in n)r.push(a+'="'+n[a]+'"');return r.length?" "+r.join(" "):""})(s.attrs):"")+(s.voidElement?"/>":">"),s.voidElement?t:t+s.children.reduce(Te,"")+"</"+s.name+">";case"comment":return t+"<!--"+s.comment+"-->"}}var zt={parse:function(t,s){s||(s={}),s.components||(s.components=qt);var n,r=[],a=[],i=-1,o=!1;if(t.indexOf("<")!==0){var u=t.indexOf("<");r.push({type:"text",content:u===-1?t:t.substring(0,u)})}return t.replace(Mt,function(f,l){if(o){if(f!=="</"+n.name+">")return;o=!1}var x,v=f.charAt(1)!=="/",A=f.startsWith("<!--"),m=l+f.length,d=t.charAt(m);if(A){var O=ve(f);return i<0?(r.push(O),r):((x=a[i]).children.push(O),r)}if(v&&(i++,(n=ve(f)).type==="tag"&&s.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!d||d==="<"||n.children.push({type:"text",content:t.slice(m,t.indexOf("<",m))}),i===0&&r.push(n),(x=a[i-1])&&x.children.push(n),a[i]=n),(!v||n.voidElement)&&(i>-1&&(n.voidElement||n.name===f.slice(2,-1))&&(i--,n=i===-1?r:a[i]),!o&&d!=="<"&&d)){x=i===-1?r:a[i].children;var p=t.indexOf("<",m),P=t.slice(m,p===-1?void 0:p);Bt.test(P)&&(P=" "),(p>-1&&i+x.length>=0||P!==" ")&&x.push({type:"text",content:P})}}),r},stringify:function(t){return t.reduce(function(s,n){return s+Te("",n)},"")}};const ee=(t,s)=>{if(!t)return!1;const n=t.props?.children??t.children;return s?n.length>0:!!n},te=t=>{if(!t)return[];const s=t.props?.children??t.children;return t.props?.i18nIsDynamicList?B(s):s},Ht=t=>Array.isArray(t)&&t.every(b.isValidElement),B=t=>Array.isArray(t)?t:[t],Kt=(t,s)=>{const n={...s};return n.props={...s.props,...t.props},n},Zt=t=>{const s={};if(!t)return s;const n=r=>{B(r).forEach(i=>{q(i)||(ee(i)?n(te(i)):M(i)&&!b.isValidElement(i)&&Object.assign(s,i))})};return n(t),s},Pe=(t,s,n,r)=>{if(!t)return"";let a="";const i=B(t),o=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((u,f)=>{if(q(u)){a+=`${u}`;return}if(b.isValidElement(u)){const{props:l,type:x}=u,v=Object.keys(l).length,A=o.indexOf(x)>-1,m=l.children;if(!m&&A&&!v){a+=`<${x}/>`;return}if(!m&&(!A||v)||l.i18nIsDynamicList){a+=`<${f}></${f}>`;return}if(A&&v===1&&q(m)){a+=`<${x}>${m}</${x}>`;return}const d=Pe(m,s,n,r);a+=`<${f}>${d}</${f}>`;return}if(u===null){ie(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(M(u)){const{format:l,...x}=u,v=Object.keys(x);if(v.length===1){const A=l?`${v[0]}, ${l}`:v[0];a+=`{{${A}}}`;return}ie(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:u});return}ie(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:u})}),a},Qt=(t,s=[],n={})=>{if(!t)return t;const r=Object.keys(n),a=[...s,...r];let i="",o=0;for(;o<t.length;)if(t[o]==="<"){let u=!1;const f=t.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(f){const l=f[1];(/^\d+$/.test(l)||a.includes(l))&&(u=!0,i+=f[0],o+=f[0].length)}if(!u){const l=t.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(l){const x=l[1];(/^\d+$/.test(x)||a.includes(x))&&(u=!0,i+=l[0],o+=l[0].length)}}u||(i+="&lt;",o+=1)}else i+=t[o],o+=1;return i},Yt=(t,s,n,r,a,i,o)=>{if(n==="")return[];const u=a.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(u.map(y=>`<${y}`).join("|")).test(n);if(!t&&!s&&!f&&!o)return[n];const l=s??{},x=y=>{B(y).forEach(N=>{q(N)||(ee(N)?x(te(N)):M(N)&&!b.isValidElement(N)&&Object.assign(l,N))})};x(t);const v=Qt(n,u,l),A=zt.parse(`<0>${v}</0>`),m={...l,...i},d=(y,k,N)=>{const V=te(y),W=p(V,k.children,N);return Ht(V)&&W.length===0||y.props?.i18nIsDynamicList?V:W},O=(y,k,N,V,W)=>{y.dummy?(y.children=k,N.push(b.cloneElement(y,{key:V},W?void 0:k))):N.push(...b.Children.map([y],h=>{const c="data-i18n-is-dynamic-list",S={key:V,[c]:void 0};return h&&h.props&&Object.keys(h.props).forEach($=>{$==="ref"||$==="children"||$==="i18nIsDynamicList"||$===c||(S[$]=h.props[$])}),b.cloneElement(h,S,W?null:k)}))},p=(y,k,N)=>{const V=B(y);return B(k).reduce((h,c,S)=>{const $=c.children?.[0]?.content&&r.services.interpolator.interpolate(c.children[0].content,m,r.language);if(c.type==="tag"){let T=V[parseInt(c.name,10)];!T&&s&&(T=s[c.name]),N.length===1&&!T&&(T=N[0][c.name]),T||(T={});const R={...c.attrs};o&&Object.keys(R).forEach(E=>{const F=R[E];q(F)&&(R[E]=Le(F))});const w=Object.keys(R).length!==0?Kt({props:R},T):T,D=b.isValidElement(w),g=D&&ee(c,!0)&&!c.voidElement,C=f&&M(w)&&w.dummy&&!D,_=M(s)&&Object.hasOwnProperty.call(s,c.name);if(q(w)){const E=r.services.interpolator.interpolate(w,m,r.language);h.push(E)}else if(ee(w)||g){const E=d(w,c,N);O(w,E,h,S)}else if(C){const E=p(V,c.children,N);O(w,E,h,S)}else if(Number.isNaN(parseFloat(c.name)))if(_){const E=d(w,c,N);O(w,E,h,S,c.voidElement)}else if(a.transSupportBasicHtmlNodes&&u.indexOf(c.name)>-1)if(c.voidElement)h.push(b.createElement(c.name,{key:`${c.name}-${S}`}));else{const E=p(V,c.children,N);h.push(b.createElement(c.name,{key:`${c.name}-${S}`},E))}else if(c.voidElement)h.push(`<${c.name} />`);else{const E=p(V,c.children,N);h.push(`<${c.name}>${E}</${c.name}>`)}else if(M(w)&&!D){const E=c.children[0]?$:null;E&&h.push(E)}else O(w,$,h,S,c.children.length!==1||!$)}else if(c.type==="text"){const T=a.transWrapTextNodes,R=typeof a.unescape=="function"?a.unescape:ke().unescape,w=o?R(r.services.interpolator.interpolate(c.content,m,r.language)):r.services.interpolator.interpolate(c.content,m,r.language);T?h.push(b.createElement(T,{key:`${c.name}-${S}`},w)):h.push(w)}return h},[])},P=p([{dummy:!0,children:t||[]}],A,B(t||[]));return te(P[0])},Ve=(t,s,n)=>{const r=t.key||s,a=b.cloneElement(t,{key:r});if(!a.props||!a.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return a;function i(){return b.createElement(b.Fragment,null,a)}return b.createElement(i,{key:r})},Jt=(t,s)=>t.map((n,r)=>Ve(n,r,s)),Xt=(t,s)=>{const n={};return Object.keys(t).forEach(r=>{Object.assign(n,{[r]:Ve(t[r],r,s)})}),n},es=(t,s,n,r)=>t?Array.isArray(t)?Jt(t,s):M(t)?Xt(t,s):(Ce(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,ts=t=>!M(t)||Array.isArray(t)?!1:Object.keys(t).reduce((s,n)=>s&&Number.isNaN(Number.parseFloat(n)),!0);function ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const d=x||Ae();if(!d)return Ce(d,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),t;const O=v||d.t.bind(d)||(Q=>Q),p={...ke(),...d.options?.react};let P=l||O.ns||d.options?.defaultNS;P=q(P)?[P]:P||["translation"];const{transDefaultProps:y}=p,k=y?.tOptions?{...y.tOptions,...i}:i,N=A??y?.shouldUnescape,V=y?.values?{...y.values,...o}:o,W=y?.components?{...y.components,...f}:f,h=Pe(t,p,d,r),c=u||k?.defaultValue||h||p.transEmptyNodeValue||(typeof r=="function"?Fe(r):r),{hashTransKey:S}=p,$=r||(S?S(h||c):h||c);d.options?.interpolation?.defaultVariables?o=V&&Object.keys(V).length>0?{...V,...d.options.interpolation.defaultVariables}:{...d.options.interpolation.defaultVariables}:o=V;const T=Zt(t);T&&typeof T.count=="number"&&s===void 0&&(s=T.count);const R=o||s!==void 0&&!d.options?.interpolation?.alwaysFormat||!t?k.interpolation:{interpolation:{...k.interpolation,prefix:"#$?",suffix:"?$#"}},w={...k,context:a||k.context,count:s,...o,...R,defaultValue:c,ns:P};let D=$?O($,w):c;D===$&&c&&(D=c);const g=es(W,D,d,r);let C=g||t,_=null;ts(g)&&(_=g,C=t);const E=Yt(C,_,D,d,p,w,N),F=n??p.defaultTransParent;return F?b.createElement(F,m,E):E}function Ne({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:u,components:f,ns:l,i18n:x,t:v,shouldUnescape:A,...m}){const{i18n:d,defaultNS:O}=b.useContext(Ue)||{},p=x||d||Ae(),P=v||p?.t.bind(p);return ss({children:t,count:s,parent:n,i18nKey:r,context:a,tOptions:i,values:o,defaults:u,components:f,ns:l||P?.ns||O||p?.options?.defaultNS,i18n:p,t:v,shouldUnescape:A,...m})}async function ns(){const t=await fetch("/api/cliproxy/sync/status");if(!t.ok){let s="Failed to fetch sync status";try{const n=await t.json();s=n.error||n.message||s}catch{}throw new Error(s)}return t.json()}async function rs(){const t=new AbortController,s=setTimeout(()=>t.abort(),3e4);try{const n=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal});if(!n.ok){let r="Sync failed";try{const a=await n.json();r=a.error||a.message||r}catch{}throw new Error(r)}return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):n}finally{clearTimeout(s)}}function as(){return Ee({queryKey:["cliproxy-sync-status"],queryFn:ns,refetchInterval:3e4,retry:1,staleTime:1e4})}function is(){const t=yt(),{t:s}=pe();return jt({mutationFn:rs,onSuccess:n=>{t.invalidateQueries({queryKey:["cliproxy-sync-status"]}),t.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?oe.info(s("toasts.noProfilesToSync")):oe.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{oe.error(s("toasts.syncFailed",{error:n.message}))}})}function Se(t){return t.replace(/-\d+$/,"").split(".").map(Number)}function xe(t,s){const n=Se(t),r=Se(s);for(let a=0;a<3;a+=1){const i=n[a]||0,o=r[a]||0;if(i>o)return 1;if(i<o)return-1}return 0}function ue(t,s){return xe(t,s)>0}function de(t,s,n){return xe(t,s)>=0&&xe(t,n)<=0}const me={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function we({className:t,compact:s=!1,state:n,sessionAffinityState:r,isLoading:a,isSaving:i,error:o,onApply:u,onApplyAffinity:f}){const{t:l}=pe(),x=n?.strategy??"round-robin",v=r?.enabled??!1,A=r?.ttl??"1h",m=r?.manageable??!0,[d,O]=b.useState(x),[p,P]=b.useState(v),[y,k]=b.useState(A),[N,V]=b.useState(!1),W=n?.source==="live"?"Live CLIProxy":"Saved startup default",h=a||i||!n||d===x,c=N?"Hide details":"Show details",S=a||i||!!o||!m,$=l(m?p?"routingGuidance.disableSessionAffinity":"routingGuidance.enableSessionAffinity":"routingGuidance.sessionAffinityUnavailable"),T=b.useRef(null),R=b.useRef(!1);b.useEffect(()=>{O(x)},[x]),b.useEffect(()=>{P(v),k(A)},[v,A]),b.useEffect(()=>{if(i||!T.current)return;const g=T.current;g.enabled===v&&g.ttl===A||(P(v),k(A)),T.current=null},[i,v,A]);const w=()=>{if(!m)return;const g=!p,C=y.trim()||"1h";T.current={enabled:g,ttl:C},P(g),f({enabled:g,ttl:C})},D=()=>{if(!m||o)return;if(R.current){R.current=!1;return}const g=y.trim()||"1h";g!==A&&(T.current={enabled:p,ttl:g},f({enabled:p,ttl:g}))};if(s){const g=C=>{O(C),C!==x&&u(C)};return e.jsxs("div",{className:I("group/routing mt-1 space-y-2 -mx-1 rounded-lg p-1",t),children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg transition-colors hover:bg-primary/5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 text-xs font-medium text-foreground",children:[e.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx(ye,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),e.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),i&&e.jsx(K,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),e.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[e.jsx("div",{className:I("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",d==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(me).map(([C,_])=>{const E=d===C;return e.jsx("button",{type:"button",className:I("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",E?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>g(C),disabled:a||i||!!o,title:_.description,children:_.title},C)})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:l("routingGuidance.sessionAffinity")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:m?l("routingGuidance.ttlBadge",{ttl:A}):l("routingGuidance.localOnlySetting")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[m?e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-6 w-14 rounded border border-border/70 bg-background px-2 text-[10px] text-foreground",value:y,onChange:C=>k(C.target.value),onBlur:D,disabled:S}):null,e.jsx("button",{type:"button","aria-label":$,className:I("rounded border px-2 py-1 text-[10px] font-medium transition-colors",m?"border-border/70 bg-background text-foreground hover:border-primary/40 hover:text-primary":"border-border/60 bg-muted/40 text-muted-foreground"),onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,title:r?.message,children:l(m?p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff":"routingGuidance.sessionAffinityUnavailable")})]})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:r.message}):null]})}return e.jsx("section",{className:I("rounded-xl border border-border/70 bg-background",t),children:e.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:e.jsx(ye,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.routingStrategy")}),e.jsx(U,{variant:"secondary",children:x}),n?e.jsx(U,{variant:"outline",children:W}):null,n?e.jsx(U,{variant:"outline",children:n.target}):null]}),e.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."})]}),e.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[e.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(me).map(([g,C])=>{const _=d===g;return e.jsx("button",{type:"button",className:I("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",_?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>O(g),disabled:a||i||!!o,children:C.title},g)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>V(g=>!g),children:[N?e.jsx(Nt,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(St,{className:"mr-1 h-3.5 w-3.5"}),c]}),e.jsx(Z,{size:"sm",onClick:()=>u(d),disabled:h||!!o,children:i?"Saving...":`Use ${d}`})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[e.jsx("span",{children:l("routingGuidance.roundRobin")}),e.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),e.jsx("span",{children:l("routingGuidance.fillFirst")})]}),e.jsxs("div",{className:"grid gap-3 rounded-lg border border-border/70 bg-muted/20 px-3 py-3 xl:col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionAffinity")}),e.jsx(U,{variant:"secondary",children:l(p?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff")}),r?.ttl?e.jsx(U,{variant:"outline",children:l("routingGuidance.ttlBadge",{ttl:A})}):null,m?null:e.jsx(U,{variant:"outline",children:l("routingGuidance.localOnly")})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionAffinityDescription")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-9 w-24 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground",value:y,onChange:g=>k(g.target.value),onBlur:D,disabled:S}),e.jsx(Z,{type:"button",variant:"outline",onMouseDown:()=>{R.current=!0},onClick:w,disabled:S,"aria-label":$,children:$})]}),r?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground",children:r.message}):null]}),o?e.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:o.message}):null,!o&&n?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:n.message}):null,N?e.jsxs("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:[Object.entries(me).map(([g,C])=>{const _=x===g;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:C.title}),_?e.jsx(U,{variant:"secondary",children:"Current"}):null]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:C.description})]},g)}),e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("div",{className:"text-sm font-medium",children:l("routingGuidance.sessionRecognitionTitle")}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:l("routingGuidance.sessionRecognitionDescription")})]})]}):null]})})}function os(t){if(!t)return"";const s=new Date(t).getTime(),r=Date.now()-s,a=Math.floor(r/(1e3*60*60)),i=Math.floor(r%(1e3*60*60)/(1e3*60));return a>0?`${a}h ${i}m`:`${i}m`}function ls(t,s){if(!t)return"";const n=Date.now()-t,r=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return r<1?s("proxyStatusWidget.justNow"):r<60?s("proxyStatusWidget.minutesAgo",{count:r}):s("proxyStatusWidget.hoursAgo",{count:a})}function X({icon:t,tooltip:s,onClick:n,disabled:r,isPending:a,className:i,variant:o="ghost"}){return e.jsxs(ot,{children:[e.jsx(lt,{asChild:!0,children:e.jsx(Z,{variant:o==="destructive-ghost"?"ghost":o,size:"sm",className:I("h-7 w-7 p-0",o==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:n,disabled:r,children:a?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(t,{className:"w-3.5 h-3.5"})})}),e.jsx(ct,{side:"bottom",className:"text-xs",children:s})]})}function fs(){const{t}=pe(),{data:s,isLoading:n}=Ge(),{data:r}=Me(),{data:a,isLoading:i}=Be(),{data:o,isLoading:u,error:f}=qe(),l=ze(),{data:x,isLoading:v,error:A}=He(),m=Ke(),d=l.isPending||m.isPending,O=f instanceof Error?f:null,p=Ze(),P=Qe(),y=Ye(),k=Je(),{data:N}=as(),{mutate:V,isPending:W}=is(),[h,c]=b.useState(!1),[S,$]=b.useState(""),[T,R]=b.useState(!1),[w,D]=b.useState(null),[g,C]=b.useState(null),{data:_}=Ee({queryKey:["cliproxy-server-config"],queryFn:()=>ut.cliproxyServer.get(),staleTime:3e4}),E=vt({mutationKey:["update-backend"]})>0,F=_?.remote,Q=F?.enabled&&F?.host,G=x??(A instanceof Error?{source:"unsupported",target:o?.target??(Q?"remote":"local"),reachable:!1,manageable:!1,message:A.message}:void 0),Y=s?.running??!1,se=p.isPending||P.isPending||y.isPending||k.isPending||E||W,$e=r?.hasUpdate??!1,z=r?.isStable===!1,ge=r?.currentVersion,J=N?.configured??!1,Oe=t(J?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),ne=z?r?.maxStableVersion||a?.latestStable:r?.latestVersion,fe=a?.maxStableVersion||r?.maxStableVersion||"6.6.80",H=a?.faultyRange,Re=H&&`${H.min.replace(/-\d+$/,"")}-${H.max.replace(/-\d+$/,"")}`,re=(j,L)=>{D(j),C(L),R(!0)},he=async j=>{if(!j)return;const L=ue(j,fe);if(H!==void 0&&de(j,H.min,H.max)){re(j,"faulty");return}if(L){re(j,"experimental");return}try{const be=await k.mutateAsync({version:j});be.requiresConfirmation&&re(j,be.isFaulty?"faulty":"experimental")}catch{}},De=()=>{w&&k.mutate({version:w,force:!0}),R(!1),D(null),C(null)},We=()=>{R(!1),D(null),C(null)},_e=Q?(()=>{const j=F.protocol||"http",L=F.port||(j==="https"?443:80);return j==="https"&&L===443||j==="http"&&L===80?F.host:`${F.host}:${L}`})():null;return Q?e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:t("proxyStatusWidget.remoteProxy")}),e.jsx(U,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t("proxyStatusWidget.active")})]}),e.jsx(Ct,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:_e})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:t("proxyStatusWidget.trafficAutoRouted")})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`remote:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`)]}):e.jsx(Xe,{delayDuration:300,children:e.jsxs("div",{className:I("rounded-lg border p-3 transition-colors",Y?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:I("w-2 h-2 rounded-full",Y?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:r?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(K,{className:"w-3 h-3 animate-spin text-muted-foreground"}):Y?e.jsxs(e.Fragment,{children:[e.jsx(X,{icon:W?K:At,tooltip:t("proxyStatusWidget.tooltipSync"),onClick:()=>V(),disabled:!J||se,isPending:W}),e.jsx(X,{icon:kt,tooltip:t("proxyStatusWidget.tooltipRestart"),onClick:()=>y.mutate(),disabled:se,isPending:y.isPending}),e.jsx(X,{icon:Et,tooltip:t("proxyStatusWidget.tooltipStop"),onClick:()=>P.mutate(),disabled:se,isPending:P.isPending,variant:"destructive-ghost"})]}):null,e.jsx(X,{icon:h?Tt:Pt,tooltip:t(h?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>c(!h),className:h?"bg-muted":void 0})]})]}),ge&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:I("text-xs font-mono text-muted-foreground",z&&"text-amber-600 dark:text-amber-400"),children:["v",ge]}),($e||z)&&ne&&e.jsxs(U,{variant:"secondary",className:I("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",z?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void he(ne),title:t(z?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[z?e.jsx(Vt,{className:"w-2.5 h-2.5"}):e.jsx($t,{className:"w-2.5 h-2.5"}),ne]})]}),Y&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{className:"flex items-center gap-1",children:t("proxyStatusWidget.port",{port:s.port})}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ot,{className:"w-3 h-3"}),t("proxyStatusWidget.sessionCount",{count:s.sessionCount})]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Rt,{className:"w-3 h-3"}),os(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[J?e.jsx(Dt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(Wt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:I("text-xs",J?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Oe})]}),e.jsx(we,{compact:!0,className:"mt-3",state:o,sessionAffinityState:G,isLoading:u||v,isSaving:d,error:O,onApply:j=>l.mutate(j),onApplyAffinity:j=>m.mutate(j)},`local:${o?.strategy??"round-robin"}:${G?.enabled??"na"}:${G?.ttl??"na"}:${G?.manageable??"na"}`),e.jsx(et,{open:h,onOpenChange:c,children:e.jsxs(tt,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:t("proxyStatusWidget.versionManagement")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(st,{value:S,onValueChange:$,disabled:i,children:[e.jsx(nt,{className:"h-8 text-xs flex-1",children:e.jsx(rt,{placeholder:t("proxyStatusWidget.selectVersionPlaceholder")})}),e.jsx(at,{children:a?.versions.slice(0,20).map(j=>{const L=a?.maxStableVersion&&ue(j,a.maxStableVersion),ae=a?.faultyRange&&de(j,a.faultyRange.min,a.faultyRange.max);return e.jsx(it,{value:j,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",j,j===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:t("proxyStatusWidget.stable")}),(ae||L)&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},j)})})]}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void he(S),disabled:k.isPending||!S,children:[k.isPending?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(_t,{className:"w-3.5 h-3.5"}),t("proxyStatusWidget.install")]})]}),S&&a?.maxStableVersion&&ue(S,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsAboveUnstable",{version:a.maxStableVersion})})]}),S&&a?.faultyRange&&de(S,a.faultyRange.min,a.faultyRange.max)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsKnownIssues",{version:S})})]}),r?.checkedAt&&e.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:t("proxyStatusWidget.lastChecked",{time:ls(r.checkedAt,t)})})]})}),!Y&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t("proxyStatusWidget.notRunning")}),e.jsxs(Z,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>p.mutate(),disabled:p.isPending,children:[p.isPending?e.jsx(K,{className:"w-3 h-3 animate-spin"}):e.jsx(It,{className:"w-3 h-3"}),t("proxyStatusWidget.start")]})]}),e.jsx(dt,{open:T,onOpenChange:R,children:e.jsxs(mt,{children:[e.jsxs(xt,{children:[e.jsxs(pt,{className:"flex items-center gap-2",children:[e.jsx(le,{className:"w-5 h-5 text-amber-500"}),t(g==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),e.jsxs(gt,{className:"space-y-2",children:[g==="faulty"?e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:w??"",range:Re||""},components:{strong:e.jsx("strong",{})}})}):e.jsx("p",{children:e.jsx(Ne,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:w??"",maxStable:fe},components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:t(g==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),e.jsx("p",{children:t("proxyStatusWidget.installUnstableConfirm")})]})]}),e.jsxs(ft,{children:[e.jsx(ht,{onClick:We,children:t("proxyStatusWidget.cancel")}),e.jsx(bt,{onClick:De,className:"bg-amber-500 hover:bg-amber-600 text-white",children:t("proxyStatusWidget.installAnyway")})]})]})})]})})}export{fs as P};
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{t as k}from"./notifications-B2HqRBj7.js";import{B as R,d as a,c as E,bc as z,W as S}from"./index-2X8-14xr.js";import{aX as B,L as m,au as L,o as P,R as T}from"./icons-DyorC3Xk.js";function F({title:c,pathLabel:x,loading:t,parseWarning:r,readWarning:i,value:s,dirty:n,readOnly:h=!1,saving:f,saveDisabled:j,onChange:p,onSave:u,onRefresh:b,onDiscard:l,language:v="json",loadingLabel:N="Loading settings.json...",parseWarningLabel:g="Parse warning",ownershipNotice:d}){const[w,o]=y.useState(!1),C=async()=>{s&&(await navigator.clipboard.writeText(s),o(!0),k.success(S.t("commonToast.settingsCopied")),window.setTimeout(()=>o(!1),1500))};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"font-semibold flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-primary"}),c,n&&e.jsx(R,{variant:"secondary",className:"text-[10px]",children:"Unsaved"})]}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:x})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{size:"sm",onClick:u,disabled:j,children:[f?e.jsx(m,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(L,{className:"h-4 w-4 mr-1"}),"Save"]}),l?e.jsx(a,{variant:"outline",size:"sm",onClick:l,disabled:!n||t,children:"Discard"}):null,e.jsxs(a,{variant:"outline",size:"sm",onClick:C,disabled:!s,children:[e.jsx(P,{className:"h-4 w-4 mr-1"}),w?"Copied":"Copy"]}),e.jsx(a,{variant:"outline",size:"sm",onClick:b,"aria-label":"Refresh raw config",children:e.jsx(T,{className:E("h-4 w-4",t?"animate-spin":"")})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:t?e.jsxs("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:[e.jsx(m,{className:"h-5 w-5 animate-spin mr-2"}),N]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[d&&e.jsx("div",{className:"mx-4 mt-4",children:d}),r&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-950/20 dark:text-amber-300",children:[g,": ",r]}),i&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:["Read-only: ",i]}),e.jsx("div",{className:"min-h-0 flex-1 p-4 pt-3",children:e.jsx("div",{className:"h-full rounded-md border overflow-hidden bg-background",children:e.jsx(z,{value:s,onChange:p,language:v,readonly:h,minHeight:"100%",heightMode:"fill-parent"})})})]})})]})}const q=F;export{F as R,q as a};
1
+ import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{t as k}from"./notifications-B2HqRBj7.js";import{B as R,d as a,c as E,bc as z,W as S}from"./index-0mNJhDEG.js";import{aX as B,L as m,au as L,o as P,R as T}from"./icons-DyorC3Xk.js";function F({title:c,pathLabel:x,loading:t,parseWarning:r,readWarning:i,value:s,dirty:n,readOnly:h=!1,saving:f,saveDisabled:j,onChange:p,onSave:u,onRefresh:b,onDiscard:l,language:v="json",loadingLabel:N="Loading settings.json...",parseWarningLabel:g="Parse warning",ownershipNotice:d}){const[w,o]=y.useState(!1),C=async()=>{s&&(await navigator.clipboard.writeText(s),o(!0),k.success(S.t("commonToast.settingsCopied")),window.setTimeout(()=>o(!1),1500))};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"font-semibold flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-primary"}),c,n&&e.jsx(R,{variant:"secondary",className:"text-[10px]",children:"Unsaved"})]}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:x})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{size:"sm",onClick:u,disabled:j,children:[f?e.jsx(m,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(L,{className:"h-4 w-4 mr-1"}),"Save"]}),l?e.jsx(a,{variant:"outline",size:"sm",onClick:l,disabled:!n||t,children:"Discard"}):null,e.jsxs(a,{variant:"outline",size:"sm",onClick:C,disabled:!s,children:[e.jsx(P,{className:"h-4 w-4 mr-1"}),w?"Copied":"Copy"]}),e.jsx(a,{variant:"outline",size:"sm",onClick:b,"aria-label":"Refresh raw config",children:e.jsx(T,{className:E("h-4 w-4",t?"animate-spin":"")})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:t?e.jsxs("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:[e.jsx(m,{className:"h-5 w-5 animate-spin mr-2"}),N]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[d&&e.jsx("div",{className:"mx-4 mt-4",children:d}),r&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-950/20 dark:text-amber-300",children:[g,": ",r]}),i&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:["Read-only: ",i]}),e.jsx("div",{className:"min-h-0 flex-1 p-4 pt-3",children:e.jsx("div",{className:"h-full rounded-md border overflow-hidden bg-background",children:e.jsx(z,{value:s,onChange:p,language:v,readonly:h,minHeight:"100%",heightMode:"fill-parent"})})})]})})]})}const q=F;export{F as R,q as a};
@@ -1 +1 @@
1
- import{j as n}from"./radix-ui-Zb8sVEtn.js";import{r as a}from"./react-vendor-CNOkPC89.js";import{e as P,f as Q,d as $,c as w,g as B,I as G}from"./index-2X8-14xr.js";import{aR as H,av as L,m as V}from"./icons-DyorC3Xk.js";function S(o){return o.trim().toLowerCase()}function M(o,h){return`${o}-option-${h.replace(/[^a-z0-9_-]+/gi,"-")}`}function Z({value:o,onChange:h,options:f,groups:g,placeholder:j,searchPlaceholder:k,emptyText:E,disabled:F,className:R,triggerClassName:q,contentClassName:K}){const[l,T]=a.useState(!1),[y,A]=a.useState(""),[i,c]=a.useState(),m=a.useId(),I=a.useRef(null),N=a.useRef({}),O=a.useMemo(()=>f.find(e=>e.value===o),[f,o]),d=a.useMemo(()=>{const e=S(y);return e?f.filter(t=>[t.searchText,...t.keywords??[]].some(u=>S(u).includes(e))):f},[f,y]),z=a.useMemo(()=>{const e=new Map((g??[]).map(r=>[r.key,r])),t=d.filter(r=>!r.groupKey||!e.has(r.groupKey)),u=(g??[]).map(r=>({...r,options:d.filter(x=>x.groupKey===r.key)})).filter(r=>r.options.length>0);return t.length===0?u:[{key:"__default",options:t},...u]},[d,g]),s=a.useMemo(()=>d.filter(e=>!e.disabled),[d]),D=O?.triggerContent??O?.itemContent,v=e=>{T(e),e||(A(""),c(void 0))},b=()=>I.current?.focus();a.useEffect(()=>{if(l){if(s.length===0){c(void 0);return}c(e=>e&&s.some(t=>t.value===e)?e:s.find(t=>t.value===o)?.value??s[0]?.value)}},[s,l,o]),a.useEffect(()=>{!l||!i||N.current[i]?.scrollIntoView({block:"nearest"})},[i,l]);const p=e=>{if(s.length===0)return;if(e==="first"){c(s[0]?.value);return}if(e==="last"){c(s.at(-1)?.value);return}const t=s.findIndex(_=>_.value===i),u=e==="next"?-1:s.length,r=t>=0?t:u,x=e==="next"?Math.min(r+1,s.length-1):Math.max(r-1,0);c(s[x]?.value)},C=e=>{h(e),v(!1)},U=()=>{if(!i)return;const e=s.find(t=>t.value===i);e&&C(e.value)};return n.jsxs(P,{open:l,onOpenChange:v,children:[n.jsx(Q,{asChild:!0,children:n.jsxs($,{type:"button",variant:"outline","aria-expanded":l,"aria-controls":l?m:void 0,"aria-haspopup":"dialog",disabled:F,onKeyDown:e=>{if(e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;e.preventDefault(),v(!0);const t=()=>{b(),p(e.key==="ArrowDown"?"first":"last")};if(typeof requestAnimationFrame=="function"){requestAnimationFrame(t);return}setTimeout(t,0)},className:w("w-full justify-between font-normal",R,q,!D&&"text-muted-foreground"),children:[n.jsx("div",{className:"min-w-0 flex-1 text-left",children:D??n.jsx("span",{children:j})}),n.jsx(H,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),n.jsxs(B,{align:"start",className:w("w-[var(--radix-popover-trigger-width)] p-0",K),onOpenAutoFocus:e=>{if(e.preventDefault(),typeof requestAnimationFrame=="function"){requestAnimationFrame(b);return}setTimeout(b,0)},children:[n.jsx("div",{className:"border-b p-2",children:n.jsxs("div",{className:"relative",children:[n.jsx(L,{className:"text-muted-foreground absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2"}),n.jsx(G,{ref:I,value:y,onChange:e=>A(e.target.value),role:"combobox","aria-label":k,"aria-autocomplete":"list","aria-expanded":l,"aria-controls":m,"aria-activedescendant":i?M(m,i):void 0,onKeyDown:e=>{if(e.key==="ArrowDown"){e.preventDefault(),p("next");return}if(e.key==="ArrowUp"){e.preventDefault(),p("previous");return}if(e.key==="Home"){e.preventDefault(),p("first");return}if(e.key==="End"){e.preventDefault(),p("last");return}if(e.key==="Enter"){e.preventDefault(),U();return}e.key==="Escape"&&(e.preventDefault(),v(!1))},placeholder:k,className:"pl-8"})]})}),n.jsx("div",{"data-slot":"searchable-select-scroll-container","data-testid":"searchable-select-scroll-container",className:"max-h-72 overflow-y-auto overscroll-contain",children:d.length===0?n.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:E}):n.jsx("div",{id:m,role:"listbox","aria-label":j,className:"p-1",children:z.map(e=>n.jsxs("div",{children:[e.label&&n.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:e.label}),e.options.map(t=>{const u=t.value===i,r=t.value===o;return n.jsxs("button",{id:M(m,t.value),type:"button",role:"option","aria-selected":r,disabled:t.disabled,tabIndex:-1,ref:x=>{N.current[t.value]=x},onMouseMove:()=>{t.disabled||c(t.value)},onFocus:()=>{t.disabled||c(t.value)},onClick:()=>C(t.value),className:w("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none","focus-visible:ring-ring focus-visible:ring-1",u&&"bg-accent text-accent-foreground",r&&"bg-accent text-accent-foreground",t.disabled&&"pointer-events-none opacity-50"),children:[n.jsx("div",{className:"min-w-0 flex-1",children:t.itemContent}),r&&n.jsx(V,{className:"h-4 w-4 shrink-0"})]},t.value)})]},e.key))})})]})]})}export{Z as S};
1
+ import{j as n}from"./radix-ui-Zb8sVEtn.js";import{r as a}from"./react-vendor-CNOkPC89.js";import{e as P,f as Q,d as $,c as w,g as B,I as G}from"./index-0mNJhDEG.js";import{aR as H,av as L,m as V}from"./icons-DyorC3Xk.js";function S(o){return o.trim().toLowerCase()}function M(o,h){return`${o}-option-${h.replace(/[^a-z0-9_-]+/gi,"-")}`}function Z({value:o,onChange:h,options:f,groups:g,placeholder:j,searchPlaceholder:k,emptyText:E,disabled:F,className:R,triggerClassName:q,contentClassName:K}){const[l,T]=a.useState(!1),[y,A]=a.useState(""),[i,c]=a.useState(),m=a.useId(),I=a.useRef(null),N=a.useRef({}),O=a.useMemo(()=>f.find(e=>e.value===o),[f,o]),d=a.useMemo(()=>{const e=S(y);return e?f.filter(t=>[t.searchText,...t.keywords??[]].some(u=>S(u).includes(e))):f},[f,y]),z=a.useMemo(()=>{const e=new Map((g??[]).map(r=>[r.key,r])),t=d.filter(r=>!r.groupKey||!e.has(r.groupKey)),u=(g??[]).map(r=>({...r,options:d.filter(x=>x.groupKey===r.key)})).filter(r=>r.options.length>0);return t.length===0?u:[{key:"__default",options:t},...u]},[d,g]),s=a.useMemo(()=>d.filter(e=>!e.disabled),[d]),D=O?.triggerContent??O?.itemContent,v=e=>{T(e),e||(A(""),c(void 0))},b=()=>I.current?.focus();a.useEffect(()=>{if(l){if(s.length===0){c(void 0);return}c(e=>e&&s.some(t=>t.value===e)?e:s.find(t=>t.value===o)?.value??s[0]?.value)}},[s,l,o]),a.useEffect(()=>{!l||!i||N.current[i]?.scrollIntoView({block:"nearest"})},[i,l]);const p=e=>{if(s.length===0)return;if(e==="first"){c(s[0]?.value);return}if(e==="last"){c(s.at(-1)?.value);return}const t=s.findIndex(_=>_.value===i),u=e==="next"?-1:s.length,r=t>=0?t:u,x=e==="next"?Math.min(r+1,s.length-1):Math.max(r-1,0);c(s[x]?.value)},C=e=>{h(e),v(!1)},U=()=>{if(!i)return;const e=s.find(t=>t.value===i);e&&C(e.value)};return n.jsxs(P,{open:l,onOpenChange:v,children:[n.jsx(Q,{asChild:!0,children:n.jsxs($,{type:"button",variant:"outline","aria-expanded":l,"aria-controls":l?m:void 0,"aria-haspopup":"dialog",disabled:F,onKeyDown:e=>{if(e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;e.preventDefault(),v(!0);const t=()=>{b(),p(e.key==="ArrowDown"?"first":"last")};if(typeof requestAnimationFrame=="function"){requestAnimationFrame(t);return}setTimeout(t,0)},className:w("w-full justify-between font-normal",R,q,!D&&"text-muted-foreground"),children:[n.jsx("div",{className:"min-w-0 flex-1 text-left",children:D??n.jsx("span",{children:j})}),n.jsx(H,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),n.jsxs(B,{align:"start",className:w("w-[var(--radix-popover-trigger-width)] p-0",K),onOpenAutoFocus:e=>{if(e.preventDefault(),typeof requestAnimationFrame=="function"){requestAnimationFrame(b);return}setTimeout(b,0)},children:[n.jsx("div",{className:"border-b p-2",children:n.jsxs("div",{className:"relative",children:[n.jsx(L,{className:"text-muted-foreground absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2"}),n.jsx(G,{ref:I,value:y,onChange:e=>A(e.target.value),role:"combobox","aria-label":k,"aria-autocomplete":"list","aria-expanded":l,"aria-controls":m,"aria-activedescendant":i?M(m,i):void 0,onKeyDown:e=>{if(e.key==="ArrowDown"){e.preventDefault(),p("next");return}if(e.key==="ArrowUp"){e.preventDefault(),p("previous");return}if(e.key==="Home"){e.preventDefault(),p("first");return}if(e.key==="End"){e.preventDefault(),p("last");return}if(e.key==="Enter"){e.preventDefault(),U();return}e.key==="Escape"&&(e.preventDefault(),v(!1))},placeholder:k,className:"pl-8"})]})}),n.jsx("div",{"data-slot":"searchable-select-scroll-container","data-testid":"searchable-select-scroll-container",className:"max-h-72 overflow-y-auto overscroll-contain",children:d.length===0?n.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:E}):n.jsx("div",{id:m,role:"listbox","aria-label":j,className:"p-1",children:z.map(e=>n.jsxs("div",{children:[e.label&&n.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:e.label}),e.options.map(t=>{const u=t.value===i,r=t.value===o;return n.jsxs("button",{id:M(m,t.value),type:"button",role:"option","aria-selected":r,disabled:t.disabled,tabIndex:-1,ref:x=>{N.current[t.value]=x},onMouseMove:()=>{t.disabled||c(t.value)},onFocus:()=>{t.disabled||c(t.value)},onClick:()=>C(t.value),className:w("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none","focus-visible:ring-ring focus-visible:ring-1",u&&"bg-accent text-accent-foreground",r&&"bg-accent text-accent-foreground",t.disabled&&"pointer-events-none opacity-50"),children:[n.jsx("div",{className:"min-w-0 flex-1",children:t.itemContent}),r&&n.jsx(V,{className:"h-4 w-4 shrink-0"})]},t.value)})]},e.key))})})]})]})}export{Z as S};
@@ -1 +1 @@
1
- import{j as i,a0 as n}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-2X8-14xr.js";function m({className:t,orientation:a="horizontal",decorative:o=!0,...r}){return i.jsx(n,{"data-slot":"separator",decorative:o,orientation:a,className:e("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}export{m as S};
1
+ import{j as i,a0 as n}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-0mNJhDEG.js";function m({className:t,orientation:a="horizontal",decorative:o=!0,...r}){return i.jsx(n,{"data-slot":"separator",decorative:o,orientation:a,className:e("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}export{m as S};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{a as q,bq as ee,br as se,bs as te,Q as ae,R as re,U as ne,B as $,bi as S,bj as M,bk as L,d as I,I as le,n as B,c as Q,C as ie,b as de}from"./index-2X8-14xr.js";import{a3 as ce,aa as oe,b7 as me,T as E,R as T,F as he,av as ue,w as xe}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Se(){const{t:s}=q(),[a,l]=j.useState("commands"),t={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents")},[r,d]=j.useState(""),[n,o]=j.useState(null),{data:c,isError:h,error:p,refetch:w}=ee(),{data:m,isLoading:x,isFetching:y,isError:g,error:U,refetch:D}=se(a),N=m?.items??[],C=r.trim().toLowerCase(),b=r.trim(),u=j.useMemo(()=>{const i=m?.items??[];return C?i.filter(v=>[v.name,v.description,v.path].some(Y=>Y.toLowerCase().includes(C))):i},[m,C]),f=j.useMemo(()=>u.length===0?null:n?u.find(i=>i.path===n)??u[0]:u[0],[u,n]),{data:P,isLoading:O,isError:_,error:W,refetch:V}=te(a,f?.path??null),z=[{id:"commands",label:t.commands,icon:ce,count:c?.commands??0},{id:"skills",label:t.skills,icon:oe,count:c?.skills??0},{id:"agents",label:t.agents,icon:me,count:c?.agents??0}],H=z.reduce((i,v)=>i+v.count,0),K=!x&&!g&&N.length===0,Z=!x&&!g&&N.length>0&&u.length===0,G=A(p,"Shared item totals could not be loaded. Listing still works."),J=A(U,`Unable to fetch shared ${a}. Please try again.`),X=A(W,`Unable to load content for ${f?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(ae,{value:a,onValueChange:i=>{l(i),d(""),o(null)},children:e.jsx(re,{className:"h-auto flex-wrap justify-start",children:z.map(i=>e.jsxs(ne,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(F,{label:s("sharedPage.totalShared"),value:H}),e.jsx(F,{label:t[a],value:N.length}),e.jsx(F,{label:s("sharedPage.visible"),value:u.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{variant:"secondary",children:s("sharedPage.markdownDetail")}),b?e.jsxs($,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",b]}):null]})]})]}),c&&!c.symlinkStatus.valid&&e.jsxs(S,{variant:"warning",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.configurationRequired")}),e.jsxs(L,{children:[c.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),h&&e.jsxs(S,{variant:"info",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.countsUnavailable")}),e.jsxs(L,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{w()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:t[a]})]}),!x&&!g&&e.jsxs($,{variant:"outline",className:"text-[10px] h-5",children:[u.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(le,{value:r,onChange:i=>d(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:a}),"aria-label":s("sharedPage.filterPlaceholder",{tab:a}),className:"pl-8 h-9"})]}),!x&&!g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:u.length,total:N.length,tab:a}),b?s("sharedPage.showingQuery",{query:b}):"",y?s("sharedPage.refreshing"):""]})]}),e.jsx(B,{className:"flex-1 min-h-0",children:x?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:a})}):g?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(xe,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:a})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:J})]}),e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{D()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):K?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noSharedFound",{tab:a})}):Z?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:a,query:b})}):e.jsx("div",{className:"p-2 space-y-1",children:u.map(i=>e.jsxs("button",{type:"button",onClick:()=>o(i.path),className:Q("w-full text-left p-3 rounded-md border transition-colors",f?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:f.name}),e.jsx($,{variant:"outline",className:"uppercase text-[10px]",children:f.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(R,{label:s("sharedPage.pathLabel"),value:f.path,mono:!0}),P?.contentPath&&P.contentPath!==f.path&&e.jsx(R,{label:s("sharedPage.resolvedSource"),value:P.contentPath,mono:!0})]})}),e.jsx(ie,{className:"min-h-0 flex-1",children:e.jsx(de,{className:"p-0 h-full",children:e.jsx(B,{className:"h-full px-5 py-4",children:O?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):_?e.jsxs(S,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.failedLoadContent")}),e.jsxs(L,{children:[e.jsx("p",{children:X}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(pe,{content:P?.content??""})})})})]})]}):e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:a.slice(0,-1)})})})]})})})]})}function F({label:s,value:a}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:a})]})}function R({label:s,value:a,mono:l=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:Q("text-xs mt-1 break-words",l?"font-mono":"text-sm"),children:a})]})}function A(s,a){if(!(s instanceof Error))return a;const l=s.message.toLowerCase();return l.includes("failed to fetch")||l.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||a}function pe({content:s}){const{t:a}=q(),l=j.useMemo(()=>fe(s),[s]);return l.blocks.length===0&&l.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[l.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:l.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:ge(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,l.blocks.map((t,r)=>{if(t.type==="heading"){const d=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:d,children:k(t.text,`heading-${r}`)},`heading-${r}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:k(t.text,`paragraph-${r}`)},`paragraph-${r}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ul-item-${r}-${n}`)},`ul-item-${r}-${n}`))},`ul-${r}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ol-item-${r}-${n}`)},`ol-item-${r}-${n}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${r}`)})]})}function ge(s){return s.replace(/[-_]/g," ")}function k(s,a){const l=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let r=0,d=0;for(const n of s.matchAll(l)){const o=n[0],c=n.index??0;if(c>r&&t.push(s.slice(r,c)),n[2])t.push(e.jsx("strong",{className:"font-semibold",children:n[2]},`${a}-strong-${d}`));else if(n[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:n[3]},`${a}-code-${d}`));else if(n[4])t.push(e.jsx("em",{className:"italic",children:n[4]},`${a}-em-${d}`));else if(n[5]&&n[6]){const h=n[6].trim();/^(https?:\/\/|mailto:)/i.test(h)?t.push(e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:n[5]},`${a}-link-${d}`)):t.push(n[5])}else t.push(o);r=c+o.length,d+=1}return r<s.length&&t.push(s.slice(r)),t.length===0?[s]:t}function fe(s){const a=s.replace(/\r\n/g,`
1
+ import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{a as q,bq as ee,br as se,bs as te,Q as ae,R as re,U as ne,B as $,bi as S,bj as M,bk as L,d as I,I as le,n as B,c as Q,C as ie,b as de}from"./index-0mNJhDEG.js";import{a3 as ce,aa as oe,b7 as me,T as E,R as T,F as he,av as ue,w as xe}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Se(){const{t:s}=q(),[a,l]=j.useState("commands"),t={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents")},[r,d]=j.useState(""),[n,o]=j.useState(null),{data:c,isError:h,error:p,refetch:w}=ee(),{data:m,isLoading:x,isFetching:y,isError:g,error:U,refetch:D}=se(a),N=m?.items??[],C=r.trim().toLowerCase(),b=r.trim(),u=j.useMemo(()=>{const i=m?.items??[];return C?i.filter(v=>[v.name,v.description,v.path].some(Y=>Y.toLowerCase().includes(C))):i},[m,C]),f=j.useMemo(()=>u.length===0?null:n?u.find(i=>i.path===n)??u[0]:u[0],[u,n]),{data:P,isLoading:O,isError:_,error:W,refetch:V}=te(a,f?.path??null),z=[{id:"commands",label:t.commands,icon:ce,count:c?.commands??0},{id:"skills",label:t.skills,icon:oe,count:c?.skills??0},{id:"agents",label:t.agents,icon:me,count:c?.agents??0}],H=z.reduce((i,v)=>i+v.count,0),K=!x&&!g&&N.length===0,Z=!x&&!g&&N.length>0&&u.length===0,G=A(p,"Shared item totals could not be loaded. Listing still works."),J=A(U,`Unable to fetch shared ${a}. Please try again.`),X=A(W,`Unable to load content for ${f?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(ae,{value:a,onValueChange:i=>{l(i),d(""),o(null)},children:e.jsx(re,{className:"h-auto flex-wrap justify-start",children:z.map(i=>e.jsxs(ne,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(F,{label:s("sharedPage.totalShared"),value:H}),e.jsx(F,{label:t[a],value:N.length}),e.jsx(F,{label:s("sharedPage.visible"),value:u.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{variant:"secondary",children:s("sharedPage.markdownDetail")}),b?e.jsxs($,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",b]}):null]})]})]}),c&&!c.symlinkStatus.valid&&e.jsxs(S,{variant:"warning",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.configurationRequired")}),e.jsxs(L,{children:[c.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),h&&e.jsxs(S,{variant:"info",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.countsUnavailable")}),e.jsxs(L,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{w()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:t[a]})]}),!x&&!g&&e.jsxs($,{variant:"outline",className:"text-[10px] h-5",children:[u.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(le,{value:r,onChange:i=>d(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:a}),"aria-label":s("sharedPage.filterPlaceholder",{tab:a}),className:"pl-8 h-9"})]}),!x&&!g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:u.length,total:N.length,tab:a}),b?s("sharedPage.showingQuery",{query:b}):"",y?s("sharedPage.refreshing"):""]})]}),e.jsx(B,{className:"flex-1 min-h-0",children:x?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:a})}):g?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(xe,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:a})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:J})]}),e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{D()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):K?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noSharedFound",{tab:a})}):Z?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:a,query:b})}):e.jsx("div",{className:"p-2 space-y-1",children:u.map(i=>e.jsxs("button",{type:"button",onClick:()=>o(i.path),className:Q("w-full text-left p-3 rounded-md border transition-colors",f?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:f.name}),e.jsx($,{variant:"outline",className:"uppercase text-[10px]",children:f.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(R,{label:s("sharedPage.pathLabel"),value:f.path,mono:!0}),P?.contentPath&&P.contentPath!==f.path&&e.jsx(R,{label:s("sharedPage.resolvedSource"),value:P.contentPath,mono:!0})]})}),e.jsx(ie,{className:"min-h-0 flex-1",children:e.jsx(de,{className:"p-0 h-full",children:e.jsx(B,{className:"h-full px-5 py-4",children:O?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):_?e.jsxs(S,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.failedLoadContent")}),e.jsxs(L,{children:[e.jsx("p",{children:X}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(pe,{content:P?.content??""})})})})]})]}):e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:a.slice(0,-1)})})})]})})})]})}function F({label:s,value:a}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:a})]})}function R({label:s,value:a,mono:l=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:Q("text-xs mt-1 break-words",l?"font-mono":"text-sm"),children:a})]})}function A(s,a){if(!(s instanceof Error))return a;const l=s.message.toLowerCase();return l.includes("failed to fetch")||l.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||a}function pe({content:s}){const{t:a}=q(),l=j.useMemo(()=>fe(s),[s]);return l.blocks.length===0&&l.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[l.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:l.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:ge(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,l.blocks.map((t,r)=>{if(t.type==="heading"){const d=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:d,children:k(t.text,`heading-${r}`)},`heading-${r}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:k(t.text,`paragraph-${r}`)},`paragraph-${r}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ul-item-${r}-${n}`)},`ul-item-${r}-${n}`))},`ul-${r}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ol-item-${r}-${n}`)},`ol-item-${r}-${n}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${r}`)})]})}function ge(s){return s.replace(/[-_]/g," ")}function k(s,a){const l=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let r=0,d=0;for(const n of s.matchAll(l)){const o=n[0],c=n.index??0;if(c>r&&t.push(s.slice(r,c)),n[2])t.push(e.jsx("strong",{className:"font-semibold",children:n[2]},`${a}-strong-${d}`));else if(n[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:n[3]},`${a}-code-${d}`));else if(n[4])t.push(e.jsx("em",{className:"italic",children:n[4]},`${a}-em-${d}`));else if(n[5]&&n[6]){const h=n[6].trim();/^(https?:\/\/|mailto:)/i.test(h)?t.push(e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:n[5]},`${a}-link-${d}`)):t.push(n[5])}else t.push(o);r=c+o.length,d+=1}return r<s.length&&t.push(s.slice(r)),t.length===0?[s]:t}function fe(s){const a=s.replace(/\r\n/g,`
2
2
  `).trim();if(!a)return{blocks:[],frontmatter:[]};let l=a;const t=[];if(l.startsWith(`---
3
3
  `)){const r=l.indexOf(`
4
4
  ---
@@ -1 +1 @@
1
- import{j as t}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as l}from"./index-2X8-14xr.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function c({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function m({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,c as a,b,i as c,d,m as e};
1
+ import{j as t}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as l}from"./index-0mNJhDEG.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function c({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function m({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,c as a,b,i as c,d,m as e};