@miravo/cli-linux-x64 0.8.1 → 0.10.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 (112) hide show
  1. package/console-dist/assets/AnimatePresence-BZCmb1bq.js +9 -0
  2. package/console-dist/assets/{activity-Cy_niK56.js → activity-Cn48I9qe.js} +1 -1
  3. package/console-dist/assets/api-DybIIqOe.js +1 -0
  4. package/console-dist/assets/api-kPM52mb-.js +1 -0
  5. package/console-dist/assets/asset-detail-tmOrYE8x.js +1 -0
  6. package/console-dist/assets/{auth-screen-backdrop-CgwRhIbi.js → auth-screen-backdrop-hcEYy3K4.js} +1 -1
  7. package/console-dist/assets/badge-D4jktT8T.js +1 -0
  8. package/console-dist/assets/catalog-DN-klsod.js +1 -0
  9. package/console-dist/assets/catalog-M-k7Y9Sp.js +1 -0
  10. package/console-dist/assets/catalog-source-2aT9qob-.js +1 -0
  11. package/console-dist/assets/catalog-template-icons-C7KJdJJX.js +1 -0
  12. package/console-dist/assets/checkbox-AaJhjtZk.js +1 -0
  13. package/console-dist/assets/chevron-down-CAk5w9Wt.js +1 -0
  14. package/console-dist/assets/chevron-right-BfZjrUWh.js +1 -0
  15. package/console-dist/assets/circle-x-CGcRflg7.js +1 -0
  16. package/console-dist/assets/combobox-BFEY6lgO.js +1 -0
  17. package/console-dist/assets/control-CD9UoTvu.js +1 -0
  18. package/console-dist/assets/control-DHa2-a2v.js +1 -0
  19. package/console-dist/assets/copy-button-DHm7RGJ5.js +1 -0
  20. package/console-dist/assets/dialog-Di9Bs0FH.js +1 -0
  21. package/console-dist/assets/{download-DmUZKo9N.js → download-B9e1wNK4.js} +1 -1
  22. package/console-dist/assets/events-D19CzgoQ.js +1 -0
  23. package/console-dist/assets/events-DmftG8n5.js +1 -0
  24. package/console-dist/assets/export-tab-ouFgYEU_.js +1 -0
  25. package/console-dist/assets/factory-CT2VYi0n.js +1 -0
  26. package/console-dist/assets/factory-DSrBtcG2.js +1 -0
  27. package/console-dist/assets/{format-B9CcV2dj.js → format-OUFL_tef.js} +1 -1
  28. package/console-dist/assets/{get-error-message-CFs0lSQP.js → get-error-message-eGdenTLv.js} +1 -1
  29. package/console-dist/assets/index-DuJJSpJp.js +12 -0
  30. package/console-dist/assets/index-iEV9hU2I.css +2 -0
  31. package/console-dist/assets/integration-api-Bg7D1eQc.js +2 -0
  32. package/console-dist/assets/integration-targets-BehiqWyT.js +1 -0
  33. package/console-dist/assets/integrations-DWW9HjH0.js +1 -0
  34. package/console-dist/assets/integrations-DoXNrzD5.js +1 -0
  35. package/console-dist/assets/{label-DTHSKF2S.js → label-DWyy9MeT.js} +1 -1
  36. package/console-dist/assets/local-flag-CPAqDO-L.js +1 -0
  37. package/console-dist/assets/{login-CtfweHfy.js → login-BZKYK0yZ.js} +2 -2
  38. package/console-dist/assets/models-CrDBHBV5.js +1 -0
  39. package/console-dist/assets/models-jBVcY8Xd.js +1 -0
  40. package/console-dist/assets/{not-found-Dw4OTZHH.js → not-found-BqVny4Md.js} +1 -1
  41. package/console-dist/assets/play-TTg_EXSa.js +1 -0
  42. package/console-dist/assets/plus-BbVbvFTe.js +1 -0
  43. package/console-dist/assets/protocol-card-B2SpAJKe.js +1 -0
  44. package/console-dist/assets/{query-fetch-error-2yqCNP9X.js → query-fetch-error-C2Ec4RQS.js} +1 -1
  45. package/console-dist/assets/radio-DRkzblxj.js +1 -0
  46. package/console-dist/assets/rocket-807Pf7C1.js +1 -0
  47. package/console-dist/assets/select-Bg6PPro0.js +1 -0
  48. package/console-dist/assets/{select-display-items-Bqb6Sbg6.js → select-display-items-D-L3PesO.js} +1 -1
  49. package/console-dist/assets/server-CS2Tw__K.js +1 -0
  50. package/console-dist/assets/source-host-miravo-D_AecPVc.js +1 -0
  51. package/console-dist/assets/tabs-bI9sskHy.js +1 -0
  52. package/console-dist/assets/tags-B7e7VYVW.js +1 -0
  53. package/console-dist/assets/tags-DJJKQRZZ.js +4 -0
  54. package/console-dist/assets/{transition-nav-link-CDSeWWsP.js → transition-nav-link-cn4KZD6W.js} +1 -1
  55. package/console-dist/assets/trash-2-BJ-1df0F.js +1 -0
  56. package/console-dist/assets/{triangle-alert-BXrJNk3g.js → triangle-alert-D1AraFcP.js} +1 -1
  57. package/console-dist/assets/use-engine-command-mutation-DMkQxmt9.js +1 -0
  58. package/console-dist/assets/use-transition-navigate-BiV2QCcA.js +2 -0
  59. package/console-dist/assets/validation-q38DYDwu.js +1 -0
  60. package/console-dist/assets/vendor-ui-D8j69UH4.js +1 -0
  61. package/console-dist/index.html +55 -50
  62. package/miravo +2 -2
  63. package/package.json +1 -1
  64. package/console-dist/assets/AnimatePresence-CPmH1DMY.js +0 -9
  65. package/console-dist/assets/api-5BZroqlO.js +0 -1
  66. package/console-dist/assets/api-BwgmLQCC.js +0 -1
  67. package/console-dist/assets/arrow-right-BjBb4z7g.js +0 -1
  68. package/console-dist/assets/arrow-up-down-C1oJAmrw.js +0 -1
  69. package/console-dist/assets/badge-i00PiRCo.js +0 -1
  70. package/console-dist/assets/catalog-B477tO5a.js +0 -1
  71. package/console-dist/assets/catalog-BRYmHbXV.js +0 -1
  72. package/console-dist/assets/catalog-source-DL6GXE84.js +0 -1
  73. package/console-dist/assets/catalog-template-icons-3S8RvUxD.js +0 -1
  74. package/console-dist/assets/checkbox-C84IyqEB.js +0 -1
  75. package/console-dist/assets/circle-question-mark-CJvcT6V6.js +0 -1
  76. package/console-dist/assets/combobox-BJecIYHE.js +0 -1
  77. package/console-dist/assets/control-Dc6xLiUf.js +0 -1
  78. package/console-dist/assets/control-HqgjVMLG.js +0 -1
  79. package/console-dist/assets/copy-button-DnGsXbVV.js +0 -1
  80. package/console-dist/assets/dropdown-menu-82O7jPU6.js +0 -1
  81. package/console-dist/assets/events-BvwhACji.js +0 -1
  82. package/console-dist/assets/events-przfMV9x.js +0 -1
  83. package/console-dist/assets/fleet-C2Ipwzu5.js +0 -1
  84. package/console-dist/assets/fleet-D3Y6h1O_.js +0 -1
  85. package/console-dist/assets/index-AfBFCD9D.js +0 -12
  86. package/console-dist/assets/index-DmjK3skd.css +0 -2
  87. package/console-dist/assets/instance-detail-CQ6RO9hI.js +0 -1
  88. package/console-dist/assets/layers-1figUpjG.js +0 -1
  89. package/console-dist/assets/models-C57soXUz.js +0 -1
  90. package/console-dist/assets/models-CX3jQBRk.js +0 -1
  91. package/console-dist/assets/platform-targets-BIQ1lKOg.js +0 -1
  92. package/console-dist/assets/platforms-DMUEIKyH.js +0 -1
  93. package/console-dist/assets/platforms-nMtu3Mg5.js +0 -1
  94. package/console-dist/assets/proxy-Be4WzmcS.js +0 -1
  95. package/console-dist/assets/select-CMOnuEoT.js +0 -1
  96. package/console-dist/assets/shallow-Cin0mLuv.js +0 -1
  97. package/console-dist/assets/spawn-protocol-scope-picker-DUXJ8giB.js +0 -1
  98. package/console-dist/assets/tabs-D64chVAn.js +0 -1
  99. package/console-dist/assets/tags-BbNGPS4O.js +0 -1
  100. package/console-dist/assets/tags-Cl6Nj2-E.js +0 -4
  101. package/console-dist/assets/tooltip-D1ydB4g3.js +0 -1
  102. package/console-dist/assets/use-engine-command-mutation-CIly3RgV.js +0 -1
  103. package/console-dist/assets/use-platform-stream-BBDJCrNY.js +0 -2
  104. package/console-dist/assets/use-transition-navigate-Bxh77tVE.js +0 -2
  105. package/console-dist/assets/validation-Bt4EQDja.js +0 -1
  106. package/console-dist/assets/vendor-ui-CWUk2ulb.js +0 -1
  107. /package/console-dist/assets/{chunk-OE4NN4TA-DBWZidbW.js → chunk-OE4NN4TA-Q4iNR9l9.js} +0 -0
  108. /package/console-dist/assets/{dist-xY0pK9Wy.js → dist-CtuJWBnP.js} +0 -0
  109. /package/console-dist/assets/{runtime-link-D-uJbw97.js → runtime-link-ChF8TM68.js} +0 -0
  110. /package/console-dist/assets/{transition-types-CPlGtM8w.js → transition-types-049V0Kr0.js} +0 -0
  111. /package/console-dist/assets/{utils-XFKvwlFT.js → utils-BO2u-wC_.js} +0 -0
  112. /package/console-dist/assets/{vendor-table-BAHQgdwg.js → vendor-table-Br-cHaxY.js} +0 -0
@@ -1 +0,0 @@
1
- import{t as e}from"./models-CX3jQBRk.js";export{e as ModelsPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{A as r,N as i,S as a,k as o,o as s,v as ee}from"./api-5BZroqlO.js";import{i as te,t as c}from"./query-fetch-error-2yqCNP9X.js";import{t as l}from"./proxy-Be4WzmcS.js";import{t as u}from"./AnimatePresence-CPmH1DMY.js";import{a as ne,i as re,l as ie,n as ae,o as d,r as f,s as p}from"./copy-button-DnGsXbVV.js";import{C as m,S as h,_ as g,c as oe,d as _,u as v}from"./format-B9CcV2dj.js";import{n as y,t as b}from"./utils-XFKvwlFT.js";import{t as x}from"./activity-Cy_niK56.js";import{M as S,P as C,j as se,n as w,t as T}from"./use-platform-stream-BBDJCrNY.js";import{l as E}from"./select-CMOnuEoT.js";import{i as D,n as O,r as k,t as A}from"./tabs-D64chVAn.js";import{r as ce}from"./checkbox-C84IyqEB.js";import{a as j,c as M,d as le,i as N,l as P,n as F,o as I,r as ue,s as L,t as R,u as z}from"./catalog-source-DL6GXE84.js";import{c as de,n as B,r as fe,s as V,t as pe}from"./use-engine-command-mutation-CIly3RgV.js";import{t as me}from"./triangle-alert-BXrJNk3g.js";import{t as H}from"./badge-i00PiRCo.js";import{t as he}from"./label-DTHSKF2S.js";import{n as ge}from"./get-error-message-CFs0lSQP.js";import{t as _e}from"./spawn-protocol-scope-picker-DUXJ8giB.js";var U=y(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),ve=y(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),ye=y(`heart-pulse`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]),be=y(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),W=y(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),G=e(t(),1),K=n(),q=new Set([`fault_active`,`fault_count`,`active_fault_code`,`lifecycle_stage`,`health_state`,`availability_state`]);function J(e){let t=[],n=[],r=[],i=[];for(let[a,o]of Object.entries(e)){let e={name:a,kind:o.kind,dataType:o.dataType,access:o.access,unit:o.unit,euRange:o.euRange};q.has(a)?i.push(e):o.kind===`property`?t.push(e):o.access===`readwrite`?n.push(e):r.push(e)}let a=[];return t.length>0&&a.push({key:`nameplate`,label:`Nameplate`,icon:(0,K.jsx)(z,{className:`size-3`}),members:t,accentClass:`text-muted-foreground`}),n.length>0&&a.push({key:`commands`,label:`Commands`,icon:(0,K.jsx)(be,{className:`size-3`}),members:n,accentClass:`text-info`}),r.length>0&&a.push({key:`process`,label:`Process Tags`,icon:(0,K.jsx)(x,{className:`size-3`}),members:r,accentClass:`text-primary`}),i.length>0&&a.push({key:`health`,label:`Health & Status`,icon:(0,K.jsx)(ye,{className:`size-3`}),members:i,accentClass:`text-success`}),a}function xe({modelName:e,onClose:t}){let[n,r]=(0,G.useState)(new Set([`nameplate`,`process`])),i=te({queryKey:ee.catalog.modelSchema(e??``),queryFn:()=>s(`/catalog/models/${e}`,a.catalogModelDetail),enabled:e!==null}),o=i.data,u=i.isPending&&!o,ne=i.isError,re=ge(i.error,`Failed to load model.`);(0,G.useEffect)(()=>{e&&r(new Set([`nameplate`,`process`]))},[e]);let ae=(0,G.useMemo)(()=>o?J(o.members):[],[o]),d=(0,G.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),f=T(),p=f.status===`running`,m=o?Object.keys(o.members).length:0,h=o?Object.keys(o.methods).length:0;return(0,K.jsx)(j,{open:e!==null,onOpenChange:e=>{if(!e){if(p){ie.message(`Deploy still running. Cancel it or wait before closing.`);return}f.reset(),t()}},children:(0,K.jsx)(I,{side:`right`,showCloseButton:!p,className:`flex w-full flex-col gap-4 touch-manipulation`,children:u?null:ne&&!o?(0,K.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,K.jsx)(c,{message:re,onRetry:()=>void i.refetch(),isRetrying:i.isFetching})}):o?(0,K.jsxs)(l.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,K.jsxs)(M,{className:`gap-1 pb-0 pe-12`,children:[(0,K.jsx)(P,{className:`font-heading text-base uppercase tracking-wide`,children:_(o.name)}),o.description&&(0,K.jsx)(L,{className:`text-xs leading-relaxed text-foreground/88`,children:o.description}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(H,{variant:`outline`,className:`font-mono text-xs`,children:[m,` members`]}),(0,K.jsxs)(H,{variant:`outline`,className:`font-mono text-xs`,children:[h,` methods`]}),(0,K.jsxs)(H,{variant:`outline`,className:`font-mono text-xs`,children:[o.faults.length,` faults`]}),o.lifecycle&&(0,K.jsxs)(H,{variant:`outline`,className:`font-mono text-xs text-primary`,children:[o.lifecycle.stages.length,`-stage lifecycle`]}),(0,K.jsx)(w,{stream:f})]})]}),(0,K.jsxs)(A,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,K.jsxs)(k,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,K.jsx)(D,{value:`overview`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Overview`}),(0,K.jsx)(D,{value:`deploy`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Deploy`})]}),(0,K.jsx)(O,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 pb-1 pt-0.5`,children:[ae.map(e=>(0,K.jsx)(Y,{sectionKey:e.key,label:e.label,count:e.members.length,icon:e.icon,accentClass:e.accentClass,expanded:n.has(e.key),onToggle:d,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.members.map(e=>(0,K.jsx)(X,{member:e},e.name))})},e.key)),o.faults.length>0&&(0,K.jsx)(Y,{sectionKey:`faults`,label:`Faults`,count:o.faults.length,icon:(0,K.jsx)(me,{className:`size-3`}),accentClass:`text-warning`,expanded:n.has(`faults`),onToggle:d,children:(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:o.faults.map(e=>(0,K.jsx)(H,{variant:`secondary`,className:`text-[10px] text-warning`,children:g(e)},e))})}),o.lifecycle&&(0,K.jsx)(Y,{sectionKey:`lifecycle`,label:`Lifecycle`,count:o.lifecycle.stages.length,icon:(0,K.jsx)(ve,{className:`size-3`}),accentClass:`text-primary`,expanded:n.has(`lifecycle`),onToggle:d,children:(0,K.jsx)(Q,{lifecycle:o.lifecycle})}),h>0&&(0,K.jsx)(Y,{sectionKey:`methods`,label:`Methods`,count:h,icon:(0,K.jsx)(W,{className:`size-3`}),accentClass:`text-info`,expanded:n.has(`methods`),onToggle:d,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Object.entries(o.methods).map(([e,t])=>(0,K.jsx)(Se,{name:e,method:t},e))})})]})})})}),(0,K.jsx)(O,{value:`deploy`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,K.jsx)(N,{kind:`model`,id:o.name,displayName:_(o.name),yamlPath:`/catalog/models/${o.name}/yaml`,yamlFilename:`${o.name}.twin.yaml`,stream:f})})})]})]},o.name):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Model not found`})})})}function Y({sectionKey:e,label:t,count:n,icon:r,accentClass:i,expanded:a,onToggle:o,children:s}){return(0,K.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left text-xs font-medium transition-colors hover:bg-muted/30`,onClick:()=>o(e),children:[(0,K.jsx)(`span`,{className:i,children:r}),(0,K.jsx)(`span`,{className:`uppercase tracking-wider`,children:t}),(0,K.jsx)(H,{variant:`secondary`,className:`ml-auto text-[10px]`,children:n}),(0,K.jsx)(E,{className:`size-3 text-muted-foreground transition-transform ${a?`rotate-180`:``}`})]}),(0,K.jsx)(u,{initial:!1,children:a&&(0,K.jsx)(l.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,K.jsx)(`div`,{className:`border-t px-2.5 py-1.5`,children:s})},`content`)})]})}function X({member:e}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 py-0.5 text-xs`,children:[(0,K.jsx)(`span`,{title:e.name,className:`min-w-0 truncate font-mono text-foreground`,children:oe(e.name)}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.dataType}),e.unit&&(0,K.jsx)(H,{variant:`outline`,className:`px-1 py-0 text-[10px]`,children:e.unit}),e.euRange&&(0,K.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})}var Z={healthy:`bg-success`,normal:`bg-success`,degraded:`bg-warning`,critical:`bg-destructive`,failed:`bg-destructive`};function Q({lifecycle:e}){let t=e.stages.length;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`div`,{className:`flex h-2.5 w-full overflow-hidden rounded-full bg-muted`,children:e.stages.map((e,n)=>(0,K.jsx)(`div`,{className:`transition-[background-color] ${Z[e]??`bg-chart-1`} ${n===0?`rounded-l-full`:``} ${n===t-1?`rounded-r-full`:``}`,style:{width:`${100/t}%`}},`${e}-${n}`))}),(0,K.jsx)(`div`,{className:`flex items-center gap-3`,children:e.stages.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,K.jsx)(`span`,{className:`size-2 rounded-full ${Z[e]??`bg-chart-1`}`}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:g(e)})]},`${e}-${t}`))}),(0,K.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`~`,v(e.totalHours),` total hours`]})]})}function Se({name:e,method:t}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),t.inputArguments.length>0&&(0,K.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,t.inputArguments.map(e=>`${e.name}: ${e.dataType}`).join(`, `),`)`]})]}),t.description&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.description})]})}var Ce=[`builtin`,`personal`];function we(){let[e,t]=(0,G.useState)(``),[n,ie]=(0,G.useState)(`all`),[g,oe]=(0,G.useState)({}),[v,y]=(0,G.useState)(null),[x,S]=(0,G.useState)(null),[C,w]=(0,G.useState)(``),[T,E]=(0,G.useState)(``),[D,O]=(0,G.useState)([]),[k,A]=(0,G.useState)(null),[j,M]=(0,G.useState)(null),[le,N]=(0,G.useState)(null),P=(0,G.useRef)(null),F=pe();(0,G.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),P.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let I=te({queryKey:ee.catalog.models(),queryFn:()=>s(`/catalog/models`,a.catalogModels)}),L=I.data??[],R=I.isPending&&!I.data,z=I.isError&&!I.data,de=I.isError&&!!I.data,B=ge(I.error,`Failed to load models.`),V=e=>g[e]??1,me=(0,G.useCallback)((e,t)=>{oe(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),U=(0,G.useCallback)(e=>{N(e)},[]),ve=(0,G.useCallback)(e=>{S(e),w(``),E(``),O([]),A(null),M(null)},[]),ye=async e=>{let t=i(C),n=i(T);if(t||n)return A(t),M(n),!1;let r=V(e),a=C.trim(),o=T.trim();y(e);try{return await F.mutateAsync({type:`spawn`,model:e,count:r,...a?{instanceName:a}:{},...o?{instancePrefix:o}:{},...D.length>0?{protocolScope:D}:{}}),!0}catch{return!1}finally{y(null)}},be=(0,G.useMemo)(()=>{let e={all:L.length};for(let t of Ce)e[t]=0;for(let t of L){let n=ue(t.source);e[n]=(e[n]??0)+1}return e},[L]),W=e.toLowerCase(),q=L.filter(e=>n===`all`||ue(e.source)===n).filter(e=>W?e.name.toLowerCase().includes(W)||(e.description?.toLowerCase().includes(W)??!1):!0),J=x,Y=J?V(J):1,X=J?r(J):``,Z=T.trim()||X,Q=C.trim()||(Z?o(Z,1):``);return(0,K.jsxs)(`div`,{className:`@container/models mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Asset Model Library`}),(0,K.jsx)(H,{variant:`outline`,className:`text-xs`,children:z?(0,K.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):R&&L.length===0?(0,K.jsx)(K.Fragment,{children:`Loading...`}):(0,K.jsxs)(K.Fragment,{children:[L.length,` models`]})})]}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Canonical twin models with realistic physics, lifecycle degradation, and fault modes. Inspect to explore schema, copy YAML, or export.`})]}),z&&(0,K.jsx)(c,{message:B,onRetry:()=>void I.refetch(),isRetrying:I.isFetching}),de&&(0,K.jsx)(c,{message:`${B} Showing cached models.`,onRetry:()=>void I.refetch(),isRetrying:I.isFetching}),!z&&(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsxs)(`div`,{className:`relative max-w-xs flex-1 min-w-[14rem]`,children:[(0,K.jsx)(se,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,K.jsx)(h,{ref:P,placeholder:`Filter models...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,K.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-[var(--miravo-radius-tight)] border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),(0,K.jsx)(Ee,{value:n,counts:be,onChange:ie})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/models:grid-cols-2 @[1120px]/models:grid-cols-3`,"aria-busy":R&&!z,children:z?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(u,{children:q.map((e,t)=>(0,K.jsx)(l.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},className:`grid`,children:(0,K.jsx)(Te,{model:e,count:V(e.name),spawning:v===e.name,onCountChange:me,onInspect:U,onSpawn:ve})},e.name))}),q.length===0&&L.length>0&&(0,K.jsx)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:`No models match the current filters.`})]})}),L.length>0&&(0,K.jsx)(`div`,{className:b(fe,`p-0`),children:(0,K.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,K.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,K.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,K.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,K.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,K.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,K.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Models`}),(0,K.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Publish your custom twin models to the Miravo registry. Discover equipment models from other engineers, fork them, and adapt parameters for your use case.`}),(0,K.jsx)(`div`,{children:(0,K.jsx)(H,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,K.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,K.jsxs)(`div`,{className:`community-teaser-module relative flex w-full max-w-[14rem] flex-col items-center justify-center gap-3 border border-primary/15 bg-muted/15 py-8 sm:max-w-[15.5rem] sm:py-10`,"aria-hidden":!0,children:[(0,K.jsx)(`div`,{className:`community-teaser-icon-ring relative z-[1] flex size-[4.25rem] items-center justify-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-gradient-to-br from-primary/18 to-primary/5`,children:(0,K.jsx)(ce,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,K.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,K.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,K.jsx)(ae,{open:x!==null,onOpenChange:e=>{e||S(null)},children:(0,K.jsxs)(f,{className:`min-w-0 sm:max-w-md`,children:[(0,K.jsxs)(d,{children:[(0,K.jsx)(p,{children:`Spawn instances?`}),(0,K.jsx)(re,{children:x!==null&&(0,K.jsxs)(K.Fragment,{children:[`This spawns `,V(x),` instance`,V(x)===1?``:`s`,` of`,` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:_(x)}),` `,`into the running environment. Set exact ID or generated prefix below if you need custom naming.`]})})]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsx)(he,{htmlFor:`spawn-instance-name`,className:`text-xs font-medium text-foreground`,children:`Exact instance ID`}),(0,K.jsx)(h,{id:`spawn-instance-name`,value:C,maxLength:120,onChange:e=>{let t=e.target.value;w(t),t&&(E(``),M(null)),A(i(t))},placeholder:Y===1?Q||`pump-001`:`Count must be 1`,disabled:Y!==1,className:b(`min-w-0 font-mono text-xs`,k&&`border-destructive`),"aria-invalid":k!=null,"aria-describedby":`spawn-instance-name-hint`}),(0,K.jsx)(`p`,{id:`spawn-instance-name-hint`,className:`min-w-0 wrap-break-word text-[11px] text-muted-foreground`,children:`Use exact name for one instance only.`}),k?(0,K.jsx)(`p`,{className:`text-[11px] text-destructive`,children:k}):null]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsx)(he,{htmlFor:`spawn-instance-prefix`,className:`text-xs font-medium text-foreground`,children:`Generated prefix`}),(0,K.jsx)(h,{id:`spawn-instance-prefix`,value:T,maxLength:120,onChange:e=>{let t=e.target.value;E(t),t&&(w(``),A(null)),M(i(t))},placeholder:X||`pump`,className:b(`min-w-0 font-mono text-xs`,j&&`border-destructive`),"aria-invalid":j!=null,"aria-describedby":`spawn-instance-prefix-hint`}),(0,K.jsxs)(`p`,{id:`spawn-instance-prefix-hint`,className:`min-w-0 wrap-break-word text-[11px] text-muted-foreground`,children:[`Preview`,` `,(0,K.jsx)(`span`,{className:`break-all font-mono text-foreground`,children:Q||`${X}-001`})]}),j?(0,K.jsx)(`p`,{className:`text-[11px] text-destructive`,children:j}):null]}),(0,K.jsx)(_e,{value:D,onChange:O})]}),(0,K.jsxs)(ne,{children:[(0,K.jsx)(m,{variant:`outline`,disabled:v!==null,onClick:()=>S(null),children:`Cancel`}),(0,K.jsx)(m,{disabled:v!==null||x===null||k!=null||j!=null,onClick:async()=>{x!==null&&await ye(x)&&S(null)},children:v===x?`Spawning...`:`Spawn`})]})]})}),(0,K.jsx)(xe,{modelName:le,onClose:()=>N(null)})]})}var Te=(0,G.memo)(function({model:e,count:t,spawning:n,onCountChange:r,onInspect:i,onSpawn:a}){return(0,K.jsxs)(`div`,{className:b(V,`flex flex-col gap-4 p-5`),children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,K.jsx)(U,{className:`size-4`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:_(e.name)}),e.description&&(0,K.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-muted-foreground`,children:[(0,K.jsx)($,{label:`mbr`,value:e.memberCount}),(0,K.jsx)($,{label:`mth`,value:e.methodCount}),(0,K.jsx)($,{label:`flt`,value:e.faultCount}),e.hasLifecycle&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 text-primary`,children:[(0,K.jsx)(`span`,{className:`text-[10px]`,children:`◈`}),(0,K.jsxs)(`span`,{children:[e.lifecycleStageCount,`-stage`]})]}),(0,K.jsx)(H,{variant:`outline`,className:b(`ml-auto shrink-0 font-sans text-[10px] font-medium uppercase tracking-wide`,R(e.source)),children:F(e.source)})]}),(0,K.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,K.jsx)(m,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-l-md`,disabled:t<=1,"aria-label":`Decrease count`,onClick:n=>{n.stopPropagation(),r(e.name,t-1)},children:(0,K.jsx)(le,{className:`size-3`})}),(0,K.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,K.jsx)(m,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-r-md`,disabled:t>=10,"aria-label":`Increase count`,onClick:n=>{n.stopPropagation(),r(e.name,t+1)},children:(0,K.jsx)(S,{className:`size-3`})})]}),(0,K.jsxs)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),className:B,children:[(0,K.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,K.jsxs)(m,{size:`sm`,className:`ml-auto`,disabled:n,onClick:()=>a(e.name),children:[(0,K.jsx)(de,{className:`mr-1 size-3`}),n?`...`:`Spawn`]})]})]})});function $({label:e,value:t}){return(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`text-foreground`,children:t}),` `,(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e})]})}function Ee({value:e,counts:t,onChange:n}){return(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`radiogroup`,"aria-label":`Filter by source`,children:[{id:`all`,label:`All`},...Ce.map(e=>({id:e,label:F(e)}))].map(r=>{let i=e===r.id,a=t[r.id]??0,o=r.id!==`all`&&a===0;return(0,K.jsxs)(`label`,{className:b(`inline-flex h-7 items-center gap-1.5 rounded-[var(--miravo-radius-pill)] border px-3 text-xs font-medium transition-colors`,i?`border-primary/60 bg-primary/15 text-primary`:`border-border/60 bg-card/30 text-muted-foreground hover:border-border hover:bg-muted/40 hover:text-foreground`,o?`cursor-not-allowed opacity-40 hover:border-border/60 hover:bg-card/30 hover:text-muted-foreground`:`cursor-pointer`),children:[(0,K.jsx)(`input`,{type:`radio`,name:`models-source-filter`,value:r.id,checked:i,disabled:o,onChange:()=>n(r.id),className:`sr-only`}),(0,K.jsx)(`span`,{children:r.label}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-foreground`,children:a})]},r.id)})})}export{U as n,we as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./utils-XFKvwlFT.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),n=[{id:`litmus-edge`,label:`Litmus Edge`,exportLabel:`Litmus Edge`,shortCode:`LE`,status:`available`},{id:`azure-dtdl`,label:`Azure Digital Twins (DTDL)`,exportLabel:`Azure Digital Twins (DTDL)`,shortCode:`AZ`,status:`coming-soon`},{id:`aws-sitewise`,label:`AWS IoT SiteWise`,exportLabel:`AWS IoT SiteWise`,shortCode:`AWS`,status:`coming-soon`},{id:`ignition-udt`,label:`Ignition UDT`,exportLabel:`Ignition UDT`,shortCode:`IGN`,status:`coming-soon`}],r=n.filter(e=>e.status===`available`),i=n.filter(e=>e.status===`coming-soon`),a=r[0]??n[0];export{t as a,n as i,i as n,a as r,r as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./platforms-nMtu3Mg5.js";export{e as PlatformsPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{S as r,ct as i,o as a,ot as o,st as s,v as c,y as l}from"./api-5BZroqlO.js";import{a as u,c as d,i as f,r as p,t as m}from"./query-fetch-error-2yqCNP9X.js";import{t as h}from"./proxy-Be4WzmcS.js";import{t as g}from"./AnimatePresence-CPmH1DMY.js";import{i as _,r as v}from"./dist-xY0pK9Wy.js";import{n as y}from"./chunk-OE4NN4TA-DBWZidbW.js";import{a as b,i as x,l as S,n as C,o as w,r as ee,s as T,t as E}from"./copy-button-DnGsXbVV.js";import{C as D,S as O,T as k,d as A,h as j,o as M,w as N}from"./format-B9CcV2dj.js";import{n as P,t as F}from"./utils-XFKvwlFT.js";import{t as I}from"./activity-Cy_niK56.js";import{t as L}from"./arrow-right-BjBb4z7g.js";import{A as R,D as z,E as B,M as V,N as te,S as ne,_ as re,a as ie,b as ae,c as H,d as U,f as oe,g as se,h as ce,i as le,j as ue,k as de,l as fe,m as W,n as pe,o as me,p as he,r as ge,s as _e,t as ve,u as ye,v as be,x as xe}from"./use-platform-stream-BBDJCrNY.js";import{n as Se,t as Ce}from"./catalog-template-icons-3S8RvUxD.js";import{c as we,i as G,l as Te,n as Ee,s as De,t as Oe}from"./select-CMOnuEoT.js";import{a as ke,i as Ae,r as K}from"./platform-targets-BIQ1lKOg.js";import{c as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./tabs-D64chVAn.js";import{i as Re,n as q,r as ze,t as Be}from"./checkbox-C84IyqEB.js";import{t as Ve}from"./layers-1figUpjG.js";import{t as He}from"./triangle-alert-BXrJNk3g.js";import{i as Ue,n as We,t as Ge}from"./tooltip-D1ydB4g3.js";import{t as Ke}from"./badge-i00PiRCo.js";import{a as qe,i as Je,n as Ye,o as Xe,r as Ze,s as Qe,t as $e}from"./dropdown-menu-82O7jPU6.js";import{t as et}from"./label-DTHSKF2S.js";import{n as J,t as tt}from"./get-error-message-CFs0lSQP.js";var nt=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:i()})}getOptimisticResult(e){return e.behavior=i(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:c,isRefetchError:l}=r,u=n.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=i&&u===`forward`,p=c&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:o(t,n.data),hasPreviousPage:s(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:a&&!f&&!m}}};function rt(e,t){return u(e,nt,t)}var it=P(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),at=P(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),ot=P(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),st=P(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Y=e(t(),1),X=n(),ct=`rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/55 bg-muted/10`;function lt(){return(0,X.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Add a target to get started.`})}function ut({onClick:e}){return(0,X.jsxs)(D,{type:`button`,size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:e,children:[(0,X.jsx)(V,{className:`size-3.5`,"aria-hidden":!0}),`Add Target`]})}function dt({titleId:e,frameIcon:t,description:n,children:r}){return(0,X.jsx)(`section`,{"aria-labelledby":e,className:ct,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-10 text-center`,children:[(0,X.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:t}),(0,X.jsxs)(`div`,{className:`max-w-sm`,children:[(0,X.jsx)(`h2`,{id:e,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No targets yet`}),n]}),r]})})}function ft({stream:e,onReset:t,catalogTemplates:n}){if(!e.operation&&e.status!==`running`)return null;let{title:r,subtitle:i}=_e(e),a=e.status===`complete`,o=e.status===`error`,s=e.status===`running`,c=a||o,l=e.cancelRequested;async function u(){await e.cancel().catch(()=>{})}return(0,X.jsx)(re,{title:r,subtitle:i,canDismiss:!s,footerAction:s&&e.operation?.operationId?(0,X.jsx)(`div`,{className:`ml-auto shrink-0`,children:(0,X.jsx)(`button`,{type:`button`,onClick:u,disabled:l,"aria-busy":l,className:F(N({variant:`outline`,size:`sm`}),`group h-8 gap-1.5 px-3 text-xs`,l?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),children:l?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Pe,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,X.jsx)(h.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,X.jsx)(h.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})})}):c?(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 w-full flex-1 flex-wrap items-center justify-between gap-x-3 gap-y-1`,children:[(0,X.jsxs)(y,{to:`/platforms?tab=activity`,className:F(N({variant:`ghost`,size:`xs`}),`group inline-flex h-6 shrink-0 items-center gap-1.5 px-2 text-[11px] font-medium text-foreground/80`,`hover:bg-primary/12 hover:text-primary`),children:[(0,X.jsx)(I,{className:`size-3 shrink-0 text-foreground/70 group-hover:text-primary`,"aria-hidden":!0}),`View full activity`,(0,X.jsx)(ke,{className:`size-2.5 shrink-0 text-foreground/50 group-hover:text-primary`,"aria-hidden":!0})]}),(0,X.jsx)(`div`,{className:`flex shrink-0 items-center`,children:(0,X.jsx)(D,{type:`button`,variant:`secondary`,size:`xs`,className:`h-6 px-2.5 text-[11px] font-medium`,onClick:t,children:`Close`})})]}),e.operation?.status===`cancelled`||o&&e.operation?(0,X.jsx)(xe,{type:e.operation.type,errorMessage:e.operation.error,className:`mt-2.5 w-full min-w-0`}):null]}):void 0,onDismiss:t,children:e.operation?(0,X.jsx)(ae,{operation:e.operation,catalogTemplates:n,logs:e.logs}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Pe,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-xs text-foreground/78`,children:`Connecting to Litmus Edge…`})]}),(0,X.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/55`,children:(0,X.jsx)(h.div,{className:`h-full w-2/5 rounded-full bg-primary`,animate:{x:[`-100%`,`250%`]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`}})})]})})}var pt=`miravo:platforms:recent-template-ids`,mt=8,ht=`miravo:platforms:last-target-id`;function Z(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(pt),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function gt(e){if(typeof window>`u`)return;let t=[e,...Z().filter(t=>t!==e)].slice(0,mt);try{window.localStorage.setItem(pt,JSON.stringify(t))}catch{}}function _t(){if(!(typeof window>`u`))try{return window.localStorage.getItem(ht)??void 0}catch{return}}function vt(e){if(!(typeof window>`u`))try{window.localStorage.setItem(ht,e)}catch{}}var yt=50;function bt({open:e,type:t,targetLabel:n,targetHostname:r,templates:i,templatesLoading:a,templatesError:o,onRetryTemplates:s,onOpenChange:c,onSelect:l}){let[u,d]=(0,Y.useState)(``),[f,p]=(0,Y.useState)(Z),m=(0,Y.useDeferredValue)(u);(0,Y.useEffect)(()=>{e&&(d(``),p(Z()))},[e]);let h=(0,Y.useMemo)(()=>{let e=m.trim().toLowerCase(),t=new Map(f.map((e,t)=>[e,t])),n=[],r=new Set;for(let t of i){if(r.has(t.id))continue;r.add(t.id);let i=[t.name,t.id,t.category,t.description??``,t.models.join(` `)].join(` `).toLowerCase();e!==``&&!i.includes(e)||n.push(t)}return n.sort((e,n)=>{let r=t.get(e.id)??1/0,i=t.get(n.id)??1/0;return r===i?e.name.localeCompare(n.name):r-i}),{items:n.slice(0,yt),total:n.length,recentRank:t}},[i,m,f]),g=t===`apply`?`Apply environment`:`Cleanup environment`,_=e=>{gt(e.id),l(e)};return(0,X.jsx)(C,{open:e,onOpenChange:c,children:(0,X.jsxs)(ee,{className:`flex max-h-[82vh] min-h-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-xl`,children:[(0,X.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 px-5 pb-3 pt-5`,children:[(0,X.jsx)(T,{className:`text-sm font-semibold`,children:g}),(0,X.jsxs)(x,{className:`mt-1 text-xs`,children:[n,` / `,r]})]}),(0,X.jsx)(`div`,{className:`shrink-0 border-b border-border/45 px-5 py-3`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(ue,{className:`pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`,"aria-hidden":!0}),(0,X.jsx)(O,{value:u,onChange:e=>d(e.currentTarget.value),className:`h-9 pl-8`,placeholder:`Search environments`,autoFocus:!0})]})}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-3`,children:a&&i.length===0?(0,X.jsx)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 px-3 py-2 text-xs text-muted-foreground`,children:`Loading environments...`}):o&&i.length===0?(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-[var(--miravo-radius-tight)] border border-warning/25 bg-warning/5 px-3 py-2 text-xs text-warning`,children:[(0,X.jsx)(`span`,{children:`Could not load environments.`}),(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 text-warning hover:text-warning`,onClick:s,children:`Retry`})]}):h.items.length===0?(0,X.jsx)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 px-3 py-2 text-xs text-muted-foreground`,children:`No matching environments.`}):(0,X.jsx)(`div`,{className:`flex flex-col gap-1`,children:h.items.map(e=>{let t=h.recentRank.has(e.id);return(0,X.jsxs)(`button`,{type:`button`,className:`flex min-h-12 w-full min-w-0 items-center gap-2 rounded-[var(--miravo-radius-tight)] px-2 py-2 text-left text-xs transition-colors hover:bg-muted/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,onClick:()=>_(e),children:[(0,X.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-border/35 bg-muted/25 text-primary`,children:(0,X.jsx)(Ce,{id:e.id,className:`size-3.5`})}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:e.name}),t?(0,X.jsx)(`span`,{className:`shrink-0 rounded-[var(--miravo-radius-tight)] border border-primary/25 bg-primary/8 px-1.5 py-px font-mono text-[9px] uppercase tracking-wider text-primary`,children:`Recent`}):null]}),(0,X.jsxs)(`span`,{className:`mt-0.5 block truncate font-mono text-[11px] text-muted-foreground`,children:[e.id,` / `,e.instanceCount,` instances`]})]})]},e.id)})})}),h.total>h.items.length?(0,X.jsxs)(`div`,{className:`shrink-0 border-t border-border/45 px-5 py-2 text-[11px] text-muted-foreground`,children:[`Showing `,h.items.length,` of `,h.total,`. Refine search.`]}):null]})})}function xt({targets:e,stream:t}){let[n,i]=(0,Y.useState)(`apply`),[o,s]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(``),[d,p]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(!1),[b,x]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),[ee]=(0,Y.useState)(_t),T=(0,Y.useRef)(0),E=(0,Y.useRef)(null),O=t.status===`running`,A=n===`apply`,j=f({queryKey:c.catalog.templates(),queryFn:()=>a(`/catalog/templates`,r.catalogTemplates)}),M=j.data??[],N=M.find(e=>e.id===l),P=e.find(e=>e.id===o),I=A?!!o&&!!l:!!o&&(d||!!l),L=(0,Y.useCallback)(()=>{T.current+=1,E.current?.abort(),E.current=null,y(!1),_(null)},[]);(0,Y.useEffect)(()=>{if(!(l||M.length===0||d))for(let e of Z()){let t=M.find(t=>t.id===e);if(t){u(t.id);return}}},[l,M,d]);let V=(0,Y.useCallback)(()=>{L(),S.message(`Preview cancelled`)},[L]),te=e=>{O||(i(e),L(),p(!1))},re=(0,Y.useCallback)(async(e,n)=>{if(e===`apply`){if(!o||!l)return}else if(!o||!d&&!l)return;t.operation&&t.status!==`running`&&t.reset(),E.current?.abort(),T.current+=1;let r=T.current,i=new AbortController;E.current=i,y(!0),_(null);try{let t=e===`apply`?await he(B({targetId:o,template:l,result:n}),{signal:i.signal}):await oe(z({targetId:o,template:l,allManaged:d,result:n}),{signal:i.signal});if(r!==T.current)return;_(t.plan)}catch(t){if(r!==T.current||ie(t))return;let n=J(t,e===`apply`?`Plan failed`:`Cleanup plan failed`),i=tt(t);S.error(n,i?{description:i}:void 0)}finally{r===T.current&&y(!1)}},[o,l,d,t]),ae=(0,Y.useCallback)(e=>{x(!1),L(),vt(o),l&&gt(l),n===`apply`?t.startApply(B({targetId:o,template:l,result:e})):t.startCleanup(z({targetId:o,template:l,allManaged:d,result:e}))},[n,o,l,d,t,L]),H=!A&&d,U=I&&!O,se=A?ze:R,ue=`Awaiting selection`;U&&(ue=A?`Review apply`:`Review cleanup`);let fe=H?`All managed resources`:N?.name??`Select environment`,W=(0,X.jsx)(Ve,{className:`size-3.5`,"aria-hidden":!0});H?W=(0,X.jsx)(R,{className:`size-3.5`,"aria-hidden":!0}):N&&(W=(0,X.jsx)(Ce,{id:N.id,className:`size-3.5`}));let me=A?`Provisions devices, tags, and Digital Twin models from the selected environment on the selected target.`:`Removes Miravo-managed resources for this environment from the selected target.`;H&&(me=`Removes all Miravo-managed resources from the target (ignores environment scope).`);let _e=P?`${P.label} / ${fe}`:`Select target and environment`;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,X.jsxs)(`div`,{role:`toolbar`,"aria-label":`Operation mode`,className:`inline-flex items-center gap-0.5 rounded-[var(--miravo-radius-pill)] border border-border/50 bg-muted/15 p-0.5`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":A,className:F(`relative flex items-center gap-1.5 rounded-[var(--miravo-radius-pill)] px-4 py-1.5 text-xs font-medium transition-colors`,A?`text-primary`:`text-muted-foreground hover:text-foreground`),onClick:()=>te(`apply`),disabled:O,children:[A&&(0,X.jsx)(h.span,{layoutId:`mode-pill`,className:`absolute inset-0 rounded-[var(--miravo-radius-pill)] bg-primary/15 shadow-sm`,transition:{type:`spring`,stiffness:500,damping:40}}),(0,X.jsx)(st,{className:`relative z-10 size-3.5`}),(0,X.jsx)(`span`,{className:`relative z-10`,children:`Apply`})]}),(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":!A,className:F(`relative flex items-center gap-1.5 rounded-[var(--miravo-radius-pill)] px-4 py-1.5 text-xs font-medium transition-colors`,A?`text-muted-foreground hover:text-foreground`:`text-destructive`),onClick:()=>te(`cleanup`),disabled:O,children:[!A&&(0,X.jsx)(h.span,{layoutId:`mode-pill`,className:`absolute inset-0 rounded-[var(--miravo-radius-pill)] bg-destructive/15 shadow-sm`,transition:{type:`spring`,stiffness:500,damping:40}}),(0,X.jsx)(R,{className:`relative z-10 size-3.5`}),(0,X.jsx)(`span`,{className:`relative z-10`,children:`Cleanup`})]})]}),(0,X.jsx)(pe,{stream:t})]}),(0,X.jsx)(be,{children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-border/25 pb-3`,children:[(0,X.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-primary/25 bg-primary/9 shadow-[inset_0_1px_0_0_var(--miravo-inset-highlight)]`,children:(0,X.jsx)(Ve,{className:`size-4 text-primary`,"aria-hidden":!0})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.12em] text-foreground`,children:`Litmus Edge`}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-relaxed text-muted-foreground`,children:me})]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(et,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Target`}),(0,X.jsx)(ce,{targets:e,value:o,onValueChange:e=>{s(e),vt(e),L()},preferredTargetId:ee,disabled:O,size:`sm`,className:`min-w-0 w-full text-xs`})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(et,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Environment`}),j.isError&&!j.data&&(0,X.jsx)(m,{message:J(j.error,`Failed to load environments.`),onRetry:()=>void j.refetch(),isRetrying:j.isFetching&&!j.isPending}),(0,X.jsxs)(`button`,{type:`button`,disabled:H||O||!P,onClick:()=>w(!0),className:F(`flex h-9 min-h-9 w-full min-w-0 items-center justify-between gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-2.5 py-0 text-left text-xs outline-none transition-colors select-none`,`hover:bg-input/50 focus-visible:border-primary/35 focus-visible:ring-2 focus-visible:ring-primary/22`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50`),"aria-label":`Environment`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/35 bg-muted/25 text-primary`,children:W}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground`,children:fe})]}),(0,X.jsx)(Te,{className:`pointer-events-none size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0})]})]})]}),(0,X.jsxs)(`button`,{type:`button`,disabled:!U||v,onClick:()=>x(!0),className:F(`group flex w-full min-h-14 min-w-0 items-stretch overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] text-left outline-none`,`transition-[border-color,box-shadow,background-color] duration-200 ease-out`,`focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:pointer-events-none disabled:opacity-55`,U?[`border-2 border-primary/40 bg-background`,`bg-linear-to-r from-primary/12 via-background to-background`,`shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025)]`,`hover:border-primary/56 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025),0_0_14px_-8px_color-mix(in_srgb,var(--primary)_18%,transparent),0_0_22px_-12px_color-mix(in_srgb,var(--primary)_8%,transparent)]`]:[`border border-dashed border-border/65 bg-muted/15`,`hover:bg-muted/22`]),children:[(0,X.jsx)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:(0,X.jsx)(se,{className:F(`relative size-5`,U?`text-primary`:`text-muted-foreground`)})}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-0.5 overflow-hidden px-3 py-2.5 sm:px-4`,children:[(0,X.jsx)(`span`,{className:F(`font-heading text-[11px] font-semibold uppercase tracking-[0.18em]`,U?`text-primary`:`text-muted-foreground`),children:ue}),(0,X.jsx)(`span`,{className:F(`truncate font-mono text-[13px] leading-tight tracking-tight`,U?`text-foreground`:`text-muted-foreground`),children:_e})]}),(0,X.jsx)(`span`,{className:F(`flex shrink-0 items-center pr-2.5 sm:pr-3`,U&&`pl-1`),children:(0,X.jsx)(`span`,{className:F(`flex size-9 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border bg-transparent transition-[border-color,color] duration-200`,U?`border-primary/40 text-primary group-hover:border-primary/55`:`border-border/45 text-muted-foreground`),"aria-hidden":!0,children:(0,X.jsx)(ke,{className:`size-4`,strokeWidth:2.25})})})]}),!A&&(0,X.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-end gap-2`,children:(0,X.jsxs)(et,{id:`all-managed-label`,htmlFor:`all-managed`,"aria-disabled":O,className:F(`inline-flex h-8 w-fit max-w-full cursor-pointer items-center gap-2 text-xs font-medium leading-none`,O&&`pointer-events-none opacity-40`),children:[(0,X.jsx)(Be,{id:`all-managed`,checked:d,onCheckedChange:e=>{p(e===!0),L()},disabled:O}),(0,X.jsx)(`span`,{className:`shrink-0`,children:`Remove all Miravo managed resources`})]})})]})}),(v||g)&&!O&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[v&&(0,X.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-end gap-2`,children:(0,X.jsxs)(D,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:V,children:[(0,X.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),`Cancel preview`]})}),v&&(0,X.jsx)(le,{}),g&&!v&&(0,X.jsx)(ge,{plan:g,planKind:A?`apply`:`cleanup`,onCloseTable:L})]}),P&&C?(0,X.jsx)(bt,{open:!0,type:n,targetLabel:P.label,targetHostname:P.hostname,templates:M,templatesLoading:j.isPending&&j.data===void 0,templatesError:j.isError&&M.length===0,onRetryTemplates:()=>void j.refetch(),onOpenChange:w,onSelect:e=>{u(e.id),gt(e.id),p(!1),L(),A&&t.reset(),w(!1)}}):null,P&&(0,X.jsx)(ne,{open:b,onOpenChange:x,type:n,label:H?`All managed resources`:N?.name??l,targetLabel:P.label,hostname:P.hostname,sourceHostname:P.sourceHostname,onConfirm:ae,defaultNamePrefix:A?l:void 0,metadata:de,applyPreview:A?{onPreview:e=>void re(`apply`,e),planLoading:v,disabled:!o||!l||O}:void 0,cleanupPreview:A?void 0:{onPreview:e=>void re(`cleanup`,e),planLoading:v,disabled:!o||!d&&!l||O}})]})}function St(){return(0,X.jsx)(`section`,{"aria-labelledby":`platforms-operation-log-empty-title`,className:ct,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-8 text-center sm:py-10`,children:[(0,X.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:(0,X.jsx)(I,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,X.jsxs)(`div`,{className:`max-w-sm`,children:[(0,X.jsx)(`h2`,{id:`platforms-operation-log-empty-title`,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No operations yet`}),(0,X.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Run apply or cleanup from the Operations tab. Finished runs show up here with full detail.`})]})]})})}function Ct(e){let t=new Date(e),n=new Date,r=new Date(n);return r.setDate(n.getDate()-1),t.toDateString()===n.toDateString()?`Today`:t.toDateString()===r.toDateString()?`Yesterday`:t.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`})}function wt(e){let t=new Map;for(let n of e){let e=new Date(n.completedAt).toDateString(),r=t.get(e);r?r.push(n):t.set(e,[n])}return Array.from(t.entries()).map(([,e])=>({label:Ct(e[0]?.completedAt??Date.now()),ops:e}))}function Tt(e,t){return e===`device`?t.operationType===`apply`?`Tag/register writes per device step—not a device count.`:`One count per device removed from DeviceHub.`:e===`model`?`One count per model in this run.`:e===`instance`?`One count per twin instance in this run.`:`Sets the device parameter to the bound DeviceHub device.`}var Et={devices:`Devices`,models:`DT models`,instances:`DT instances`},Q={create:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-success/35 bg-success/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-success`,update:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-primary/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-primary`,replace:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-chart-2/35 bg-chart-2/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-chart-2`,delete:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/35 bg-destructive/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-destructive`,noop:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-border/55 bg-muted/55 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-foreground/78`,failed:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/18 px-1.5 py-0.5 font-mono text-[10px] font-semibold tabular-nums text-destructive`};function Dt(e){return[{key:`device`,title:`DeviceHub — protocol tags`,subtitle:Tt(`device`,e),counts:e.resourceCounts.device},{key:`model`,title:`Digital Twin models`,subtitle:Tt(`model`,e),counts:e.resourceCounts.model},{key:`instance`,title:`Twin instances`,subtitle:Tt(`instance`,e),counts:e.resourceCounts.instance},{key:`param-sync`,title:`Parameter sync`,subtitle:Tt(`param-sync`,e),counts:e.resourceCounts[`param-sync`]}].filter(e=>e.counts.total>0||e.counts.failed>0)}function Ot(e){return e.length===0?`Default (devices, models, instances)`:e.map(e=>Et[e]??e).join(` · `)}function kt(e){let t=[];return e.filters.area&&t.push(`Area ${e.filters.area}`),e.filters.line&&t.push(`Line ${e.filters.line}`),e.filters.instance&&t.push(`Instance ${e.filters.instance}`),t.length>0?t.join(` · `):null}function $(e,t,n){if(e===`device`)switch(t){case`create`:return`+${n} tags (new device)`;case`update`:return`${n} tags rewritten`;case`replace`:return`↻${n} tags (device replaced)`;case`delete`:return`−${n} removed`;case`noop`:return`=${n} unchanged`}switch(t){case`create`:return`+${n} created`;case`update`:return`${n} updated`;case`replace`:return`↻${n} replaced`;case`delete`:return`−${n} removed`;case`noop`:return`=${n} unchanged`}}function At({row:e}){let{key:t,counts:n}=e;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`,children:[n.create>0&&(0,X.jsx)(`span`,{className:Q.create,children:$(t,`create`,n.create)}),n.update>0&&(0,X.jsx)(`span`,{className:Q.update,children:$(t,`update`,n.update)}),n.replace>0&&(0,X.jsx)(`span`,{className:Q.replace,children:$(t,`replace`,n.replace)}),n.delete>0&&(0,X.jsx)(`span`,{className:Q.delete,children:$(t,`delete`,n.delete)}),n.noop>0&&(0,X.jsx)(`span`,{className:Q.noop,children:$(t,`noop`,n.noop)}),n.failed>0&&(0,X.jsx)(`span`,{className:Q.failed,children:`${n.failed} failed`})]})}function jt(e){return e.resourceCounts.device.noop+e.resourceCounts.model.noop+e.resourceCounts.instance.noop+e.resourceCounts[`param-sync`].noop}function Mt({op:e}){let t=kt(e),n=jt(e);return(0,X.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 bg-muted/25 px-3 py-2.5`,children:[(0,X.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.16em] text-foreground/72`,children:`Run context`}),(0,X.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[minmax(0,7.5rem)_1fr] gap-x-3 gap-y-1.5 text-xs sm:grid-cols-[9rem_1fr]`,children:[(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Operation`}),(0,X.jsx)(`dd`,{className:`font-medium capitalize text-foreground`,children:e.operationType}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Target host`}),(0,X.jsx)(`dd`,{className:`break-all font-mono text-[11px] text-foreground`,children:e.hostname}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Scope`}),(0,X.jsx)(`dd`,{className:`text-foreground`,children:Ot(e.scope)}),t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Filters`}),(0,X.jsx)(`dd`,{className:`text-foreground`,children:t})]}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Duration`}),(0,X.jsxs)(`dd`,{className:`tabular-nums text-foreground`,children:[(e.durationMs/1e3).toFixed(1),`s`]}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Outcome`}),(0,X.jsxs)(`dd`,{className:`text-foreground`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.successCount}),` steps succeeded`,n>0&&(0,X.jsxs)(`span`,{className:`text-foreground/72`,children:[` `,`· `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:n}),` unchanged`]}),e.failedCount>0&&(0,X.jsxs)(`span`,{className:`text-destructive`,children:[` `,`· `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.failedCount}),` failed`]}),e.blockedCount>0&&(0,X.jsxs)(`span`,{className:`text-warning`,children:[` `,`· `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.blockedCount}),` blocked in plan`]})]})]})]})}function Nt({status:e}){switch(e){case`success`:return(0,X.jsx)(je,{className:`mt-px size-4 shrink-0 text-success`});case`failed`:return(0,X.jsx)(Ie,{className:`mt-px size-4 shrink-0 text-destructive`});case`partial`:case`blocked`:return(0,X.jsx)(He,{className:`mt-px size-4 shrink-0 text-warning`});case`noop`:return(0,X.jsx)(it,{className:`mt-px size-4 shrink-0 text-foreground/55`})}}function Pt(e){let t=e.operationType===`apply`?`Applied`:`Cleaned up`,n=`${(e.durationMs/1e3).toFixed(1)}s`,r=[];e.successCount>0&&r.push(`${e.successCount} resources`);let i=jt(e);return i>0&&r.push(`${i} unchanged`),e.failedCount>0&&r.push(`${e.failedCount} failed`),e.blockedCount>0&&r.push(`${e.blockedCount} blocked`),r.length===0?`${t} · no changes · ${n}`:`${t} · ${r.join(`, `)} · ${n}`}function Ft(e){return e.operationType===`cleanup`&&e.successCount===0&&e.failedCount===0&&e.blockedCount===0?`No Miravo-managed resources were found to clean up.`:e.failedCount>0&&e.blockedCount>0?`No per-phase counts — failures and blocked plan entries.`:e.failedCount>0?`No per-phase counts — run failed.`:e.blockedCount>0?`No per-phase counts — blocked plan entries.`:jt(e)>0?`No resources were mutated. Existing managed resources already matched the desired state.`:`No per-phase counts recorded.`}function It({op:e}){let t=Dt(e);return t.length===0?(0,X.jsx)(`p`,{className:`py-1 text-sm text-foreground/75`,children:Ft(e)}):(0,X.jsxs)(`div`,{className:`space-y-3 pt-1`,children:[(0,X.jsx)(`div`,{className:`flex flex-col divide-y divide-border/45 rounded-[var(--miravo-radius-tight)] border border-border/50`,children:t.map(e=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 py-2.5 sm:flex-row sm:items-start sm:gap-4`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 shrink-0 sm:w-[11.5rem]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium leading-snug text-foreground`,children:e.title}),(0,X.jsxs)(Ge,{children:[(0,X.jsx)(Ue,{type:`button`,className:`inline-flex shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] p-0.5 text-foreground/60 hover:bg-muted/50 hover:text-foreground`,"aria-label":`About ${e.title}`,children:(0,X.jsx)(Re,{className:`size-3.5`,"aria-hidden":!0})}),(0,X.jsx)(We,{side:`top`,className:`max-w-xs text-left`,children:e.subtitle})]})]}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-snug text-foreground/72 sm:hidden`,children:e.subtitle})]}),(0,X.jsx)(At,{row:e})]},e.key))}),e.blockedCount>0&&(0,X.jsxs)(`p`,{className:`rounded-[var(--miravo-radius-tight)] border border-warning/20 bg-warning/5 px-2.5 py-1.5 text-[11px] text-warning`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.blockedCount}),` plan entries were blocked (skipped). Open a `,(0,X.jsx)(`span`,{className:`font-medium`,children:`deploy preview`}),` before running to see block reasons.`]})]})}function Lt({operation:e}){let[t,n]=(0,Y.useState)(!1);return(0,X.jsxs)(`div`,{className:F(`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,`transition-colors duration-150`),children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:F(`flex w-full items-start gap-3 p-3.5 text-left`,`transition-colors duration-100`,`hover:bg-muted/25`,t&&`bg-muted/18`),children:[(0,X.jsx)(Nt,{status:e.status}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,X.jsxs)(`p`,{className:`min-w-0 truncate text-sm`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:A(e.templateId)}),(0,X.jsx)(`span`,{className:`mx-1.5 text-foreground/50`,children:`→`}),(0,X.jsx)(`span`,{className:`text-foreground/82`,children:e.targetLabel})]}),(0,X.jsx)(`time`,{dateTime:new Date(e.completedAt).toISOString(),title:M(e.completedAt),className:`shrink-0 text-xs text-foreground/75`,children:j(e.completedAt)})]}),(0,X.jsx)(`p`,{className:`text-xs text-foreground/78`,children:Pt(e)}),(e.failedCount>0||e.status===`failed`)&&(0,X.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/72`,children:e.error??`The operation ended with an error.`})]}),(0,X.jsx)(Te,{className:F(`mt-0.5 size-3.5 shrink-0 text-foreground/55 transition-transform duration-150`,t&&`rotate-180`)})]}),(0,X.jsx)(g,{initial:!1,children:t&&(0,X.jsx)(h.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,X.jsxs)(`div`,{className:`space-y-3 border-t border-border/45 px-4 pb-3 pt-3`,children:[(0,X.jsx)(Mt,{op:e}),e.error&&(0,X.jsxs)(`div`,{className:`relative rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/15 px-3 py-2 pr-10 text-xs font-medium`,children:[(0,X.jsx)(`div`,{className:`absolute top-1.5 right-1.5 z-10`,children:(0,X.jsx)(E,{value:e.error,label:`Copy error`,className:`text-destructive hover:bg-destructive/25 hover:text-foreground`})}),(0,X.jsx)(`p`,{className:`whitespace-normal break-words text-destructive [overflow-wrap:anywhere]`,children:e.error})]}),(0,X.jsx)(It,{op:e})]})})})]})}function Rt({label:e}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,X.jsx)(`div`,{className:`h-px flex-1 bg-border/65`}),(0,X.jsx)(`span`,{className:`text-xs font-medium text-foreground/78`,children:e}),(0,X.jsx)(`div`,{className:`h-px flex-1 bg-border/65`})]})}var zt={type:``,status:``,target:``,search:``},Bt={_all:`All types`,apply:`Apply`,cleanup:`Cleanup`},Vt={_all:`All statuses`,success:`Success`,partial:`Partial`,failed:`Failed`,blocked:`Blocked`,noop:`No-op`},Ht=`h-7 min-h-7 gap-1.5 border-border/50 bg-transparent px-2 text-xs hover:bg-muted/30 focus:ring-0`;function Ut({filters:e,targetOptions:t,hasFilters:n,searchRef:r,onTypeChange:i,onStatusChange:a,onTargetChange:o,onSearchChange:s,onClear:c}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-border/50 px-3 py-2`,children:[(0,X.jsxs)(Oe,{value:e.type||`_all`,onValueChange:e=>e&&i(e===`_all`?``:e),children:[(0,X.jsx)(De,{size:`sm`,className:Ht,"aria-label":`Operation type`,children:(0,X.jsx)(we,{children:e=>Bt[e??`_all`]??Bt._all})}),(0,X.jsxs)(Ee,{children:[(0,X.jsx)(G,{value:`_all`,children:`All types`}),(0,X.jsx)(G,{value:`apply`,children:`Apply`}),(0,X.jsx)(G,{value:`cleanup`,children:`Cleanup`})]})]}),(0,X.jsxs)(Oe,{value:e.status||`_all`,onValueChange:e=>e&&a(e===`_all`?``:e),children:[(0,X.jsx)(De,{size:`sm`,className:Ht,"aria-label":`Operation status`,children:(0,X.jsx)(we,{children:e=>Vt[e??`_all`]??Vt._all})}),(0,X.jsxs)(Ee,{children:[(0,X.jsx)(G,{value:`_all`,children:`All statuses`}),(0,X.jsx)(G,{value:`success`,children:`Success`}),(0,X.jsx)(G,{value:`partial`,children:`Partial`}),(0,X.jsx)(G,{value:`failed`,children:`Failed`}),(0,X.jsx)(G,{value:`blocked`,children:`Blocked`}),(0,X.jsx)(G,{value:`noop`,children:`No-op`})]})]}),t.length>1&&(0,X.jsxs)(Oe,{value:e.target||`_all`,onValueChange:e=>e&&o(e===`_all`?``:e),children:[(0,X.jsx)(De,{size:`sm`,className:Ht,"aria-label":`Target filter`,children:(0,X.jsx)(we,{children:e=>!e||e===`_all`?`All targets`:e})}),(0,X.jsxs)(Ee,{children:[(0,X.jsx)(G,{value:`_all`,children:`All targets`}),t.map(e=>(0,X.jsx)(G,{value:e,children:e},e))]})]}),(0,X.jsxs)(`div`,{className:`relative flex min-w-[140px] flex-1 items-center`,children:[(0,X.jsx)(`input`,{ref:r,type:`search`,value:e.search,onChange:e=>s(e.target.value),placeholder:`Search environment or target…`,"aria-describedby":`ops-search-shortcut`,className:F(`h-7 w-full rounded-[var(--miravo-radius-tight)] border border-border/50 bg-transparent pl-2 pr-7 text-xs`,`placeholder:text-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring/40`,e.search&&`pr-2`)}),(0,X.jsx)(`span`,{id:`ops-search-shortcut`,className:`sr-only`,children:`Press slash to focus search`}),!e.search&&(0,X.jsx)(`kbd`,{"aria-hidden":!0,className:`pointer-events-none absolute right-2 flex h-4 items-center rounded-[var(--miravo-radius-tight)] border border-border/60 bg-muted/50 px-1 font-mono text-[10px] text-foreground/65`,children:`/`})]}),n&&(0,X.jsxs)(`button`,{type:`button`,onClick:c,className:`flex h-7 items-center gap-1 rounded-[var(--miravo-radius-tight)] px-2 text-xs text-foreground/72 transition-colors hover:bg-muted/40 hover:text-foreground`,children:[(0,X.jsx)(k,{className:`size-3`}),`Clear`]})]})}function Wt({operations:e,totalKnown:t,isLoading:n,error:r,onRefresh:i,hasNextPage:a=!1,isFetchingNextPage:o=!1,loadMoreError:s=null,onRetryLoadMore:c,onLoadMore:l}){let[u,d]=(0,Y.useState)(!1),[f,m]=(0,Y.useState)(zt),_=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),_.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let v=()=>{d(!0),i(),S.success(`Operations refreshed`),setTimeout(()=>d(!1),600)},y=(0,Y.useMemo)(()=>{let t=new Set;for(let n of e){let e=n.targetLabel;t.add(e)}return[...t].sort()},[e]),b=(0,Y.useMemo)(()=>{let t=e;if(f.type&&(t=t.filter(e=>e.operationType===f.type)),f.status&&(t=t.filter(e=>e.status===f.status)),f.target&&(t=t.filter(e=>e.targetLabel===f.target)),f.search){let e=f.search.toLowerCase();t=t.filter(t=>{let n=t.targetLabel;return t.templateId.toLowerCase().includes(e)||A(t.templateId).toLowerCase().includes(e)||n.toLowerCase().includes(e)})}return t},[e,f]),x=f.type!==``||f.status!==``||f.target!==``||f.search!==``,C=(0,Y.useMemo)(()=>wt(b),[b]);return(0,X.jsxs)(`div`,{className:`flex h-full flex-col rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 px-3.5 py-2.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Operation log`}),e.length>0&&(0,X.jsx)(`span`,{className:`font-mono text-xs tabular-nums text-foreground/75`,children:typeof t==`number`&&t>0&&e.length<t?`${e.length} / ${t}`:String(e.length)})]}),(0,X.jsx)(`button`,{type:`button`,onClick:v,disabled:u,"aria-label":`Refresh operation list`,className:`relative rounded-[var(--miravo-radius-tight)] p-1 text-foreground/70 transition-colors before:absolute before:inset-[-10px] before:content-[''] hover:bg-muted/50 hover:text-foreground disabled:pointer-events-none`,children:(0,X.jsx)(p,{className:F(`size-3.5`,u&&`animate-spin`),"aria-hidden":!0})})]}),(0,X.jsx)(Ut,{filters:f,targetOptions:y,hasFilters:x,searchRef:_,onTypeChange:e=>m(t=>({...t,type:e})),onStatusChange:e=>m(t=>({...t,status:e})),onTargetChange:e=>m(t=>({...t,target:e})),onSearchChange:e=>m(t=>({...t,search:e})),onClear:()=>m(zt)}),(0,X.jsxs)(`div`,{className:`flex flex-1 min-h-0 flex-col gap-2 overflow-y-auto overscroll-y-contain p-3`,children:[r&&(0,X.jsxs)(`p`,{className:`py-2 text-xs text-destructive`,children:[`✕ `,r.message]}),n&&e.length===0&&!r&&(0,X.jsx)(`p`,{className:`py-4 text-sm text-foreground/75`,children:`Loading…`}),!n&&e.length===0&&!r&&(0,X.jsx)(St,{}),!n&&e.length>0&&b.length===0&&(0,X.jsxs)(`p`,{className:`py-6 text-center text-sm text-foreground/75`,children:[`No operations match your filters.`,` `,(0,X.jsx)(`button`,{type:`button`,onClick:()=>m(zt),className:`text-primary hover:underline`,children:`Clear filters`})]}),x&&b.length>0&&b.length!==e.length&&(0,X.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:b.length}),` of`,` `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.length}),` loaded`]}),!x&&typeof t==`number`&&t>0&&e.length<t&&(0,X.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:e.length}),` `,`of `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:t}),`. Load more for older entries.`]}),(0,X.jsx)(g,{initial:!1,children:C.map(e=>(0,X.jsxs)(h.div,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(Rt,{label:e.label}),(0,X.jsx)(g,{initial:!1,children:e.ops.map(e=>(0,X.jsx)(h.div,{initial:b.length>40?!1:{opacity:0,x:-6},animate:{opacity:1,x:0},transition:{type:`spring`,stiffness:400,damping:35},children:(0,X.jsx)(Lt,{operation:e})},`${e.operationId}-${e.completedAt}`))})]},e.label))}),s?(0,X.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-col items-center gap-2 border-t border-border/50 pt-3 pb-1 text-center`,children:[(0,X.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Could not load older entries: `,s.message]}),c?(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,onClick:c,children:`Retry`}):null]}):a&&l?(0,X.jsx)(`div`,{className:`flex shrink-0 justify-center border-t border-border/50 pt-3 pb-1`,children:(0,X.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,className:`min-w-[7rem]`,disabled:o,"aria-busy":o,"aria-label":o?`Loading older operations`:`Load older operations`,onClick:l,children:o?`Loading…`:`Load more`})}):null]})]})}function Gt({target:e,templates:t,templatesLoading:n,templatesError:r,isStreaming:i,onRetryTemplates:a,onSelect:o}){let s=t.length===0&&!n&&!r,[c,l]=(0,Y.useState)(null);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`absolute right-3 top-3 z-20`,children:(0,X.jsxs)($e,{children:[(0,X.jsx)(Qe,{render:(0,X.jsx)(D,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:i,className:`border border-border/45 bg-background/70 text-muted-foreground shadow-[inset_0_1px_0_0_var(--miravo-inset-highlight)] hover:border-primary/30 hover:bg-muted/55 hover:text-foreground`,"aria-label":`Open quick actions for ${e.label}`}),children:(0,X.jsx)(at,{className:`size-3.5`,"aria-hidden":!0})}),(0,X.jsx)(Ye,{align:`end`,sideOffset:6,className:`min-w-56`,children:(0,X.jsxs)(Ze,{children:[(0,X.jsx)(qe,{className:`text-[10px] uppercase tracking-[0.14em]`,children:`Quick actions`}),(0,X.jsx)(Xe,{className:`bg-border/60`}),(0,X.jsxs)(Je,{disabled:s,className:`h-9 gap-2 text-xs`,onClick:()=>l(`apply`),children:[(0,X.jsx)(ze,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:`Apply environment...`})]}),(0,X.jsxs)(Je,{disabled:s,className:`h-9 gap-2 text-xs`,onClick:()=>l(`cleanup`),children:[(0,X.jsx)(R,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:`Cleanup environment...`})]}),(0,X.jsx)(Xe,{className:`bg-border/60`}),(0,X.jsxs)(Je,{variant:`destructive`,className:`h-9 gap-2 text-xs`,onClick:()=>o({type:`cleanup`,target:e,allManaged:!0}),children:[(0,X.jsx)(R,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:`Cleanup all managed`})]})]})})]})}),c?(0,X.jsx)(bt,{open:!0,type:c,targetLabel:e.label,targetHostname:e.hostname,templates:t,templatesLoading:n,templatesError:r,onRetryTemplates:a,onOpenChange:e=>{e||l(null)},onSelect:t=>{o({type:c,target:e,templateId:t.id}),l(null)}},c):null]})}function Kt({selection:e,templates:t,stream:n,onSelectionChange:r}){let[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(!1),u=(0,Y.useRef)(0),d=(0,Y.useRef)(null),f=(0,Y.useRef)(!1),p=n.status===`running`,m=(0,Y.useCallback)(()=>{u.current+=1,f.current=!1,d.current?.abort(),d.current=null,l(!1),s(null)},[]);(0,Y.useEffect)(()=>{e&&(m(),a(!0))},[e,m]),(0,Y.useEffect)(()=>()=>{u.current+=1,f.current=!1,d.current?.abort(),d.current=null},[]);let h=e?.templateId==null?void 0:t.find(t=>t.id===e.templateId)?.name??e.templateId,g=e?.type===`cleanup`&&e.allManaged?`All managed resources`:h??``,_=(0,Y.useCallback)(async t=>{if(!e)return;let r=e.templateId;if(e.type===`apply`&&!r||e.type===`cleanup`&&!e.allManaged&&!r)return;n.operation&&n.status!==`running`&&n.reset(),f.current=!0,d.current?.abort(),u.current+=1;let i=u.current,a=new AbortController;d.current=a,l(!0),s(null);try{let n;if(e.type===`apply`){if(!r)return;n=await he(B({targetId:e.target.id,template:r,result:t}),{signal:a.signal})}else n=await oe(z({targetId:e.target.id,template:r,allManaged:e.allManaged,result:t}),{signal:a.signal});if(i!==u.current)return;s(n.plan)}catch(t){if(i!==u.current||ie(t))return;let n=J(t,e.type===`apply`?`Plan failed`:`Cleanup plan failed`),r=tt(t);S.error(n,r?{description:r}:void 0)}finally{i===u.current&&(l(!1),f.current=!1)}},[e,n]),v=(0,Y.useCallback)(t=>{if(e){if(a(!1),m(),r(null),e.type===`apply`){if(!e.templateId)return;n.startApply(B({targetId:e.target.id,template:e.templateId,result:t}));return}n.startCleanup(z({targetId:e.target.id,template:e.templateId,allManaged:e.allManaged,result:t}))}},[e,n,m,r]),y=e=>{a(e),!(e||f.current)&&(m(),r(null))},b=()=>{m(),r(null)};return(0,X.jsxs)(X.Fragment,{children:[e&&(0,X.jsx)(ne,{open:i,onOpenChange:y,type:e.type,label:g,targetLabel:e.target.label,hostname:e.target.hostname,sourceHostname:e.target.sourceHostname,onConfirm:v,defaultNamePrefix:e.type===`apply`?e.templateId:void 0,metadata:de,applyPreview:e.type===`apply`?{onPreview:e=>void _(e),planLoading:c,disabled:!e.templateId||p}:void 0,cleanupPreview:e.type===`cleanup`?{onPreview:e=>void _(e),planLoading:c,disabled:!e.allManaged&&!e.templateId||p}:void 0}),(c||o)&&!p&&e?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,X.jsx)(te,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}),(0,X.jsxs)(`span`,{className:`truncate`,children:[`Preview for `,e.target.label,`: `,g]})]}),(0,X.jsxs)(D,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:b,children:[(0,X.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),`Close preview`]})]}),c?(0,X.jsx)(le,{}):o?(0,X.jsx)(ge,{plan:o,planKind:e.type,onCloseTable:b}):null]}):null]})}function qt(e){return Ae.find(t=>t.id===e)?.label??e}function Jt(e){if(!e)return`var(--tooltip-border)`;switch(e.status){case`success`:return`var(--success)`;case`partial`:case`blocked`:return`var(--warning)`;case`noop`:return`var(--muted-foreground)`;case`failed`:return`var(--destructive)`}}function Yt({status:e}){switch(e){case`success`:return(0,X.jsx)(je,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,X.jsx)(He,{className:`size-3 text-warning`});case`noop`:return(0,X.jsx)(it,{className:`size-3 text-muted-foreground`});case`failed`:return(0,X.jsx)(Ie,{className:`size-3 text-destructive`})}}function Xt({target:e,lastOp:t,onEdit:n,onDelete:r,quickActions:i}){return(0,X.jsxs)(`div`,{className:`env-orbital relative overflow-hidden border`,style:{"--_status":Jt(t)},children:[i,(0,X.jsx)(`div`,{className:`relative z-10 px-4 pt-3.5 pb-3 pr-12`,children:(0,X.jsx)(`p`,{className:`font-heading text-[13px] font-semibold leading-tight tracking-tight text-foreground`,children:e.label})}),(0,X.jsx)(`div`,{className:`relative z-10 px-4 py-0.5`,children:(0,X.jsx)(`p`,{className:`font-mono text-xs tracking-tight text-muted-foreground`,children:e.hostname})}),(0,X.jsxs)(`div`,{className:`relative z-10 mx-4 mb-3 flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground`,children:e.sourceHostname}),(0,X.jsx)(`div`,{className:`env-orbital-path min-w-6 flex-1`}),(0,X.jsx)(L,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,X.jsxs)(`div`,{className:`relative z-10 flex items-center gap-2 border-t border-border/30 px-3 py-1.5`,children:[(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 rounded-full border border-border/40 px-2 py-0.5`,children:[(0,X.jsx)(`span`,{className:`protocol-card-live-dot size-[5px]`}),(0,X.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-muted-foreground`,children:qt(e.platformId)})]}),t&&(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 truncate text-[11px] text-muted-foreground`,children:[(0,X.jsx)(Yt,{status:t.status}),t.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,X.jsx)(`time`,{dateTime:new Date(t.completedAt).toISOString(),title:M(t.completedAt),children:j(t.completedAt)})]}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(D,{variant:`ghost`,size:`icon-sm`,"aria-label":`Edit target`,onClick:n,children:(0,X.jsx)(ot,{className:`size-3`})}),(0,X.jsx)(D,{variant:`ghost`,size:`icon-sm`,className:`text-destructive hover:text-destructive`,"aria-label":`Delete target`,onClick:r,children:(0,X.jsx)(R,{className:`size-3`})})]})]})]})}function Zt({onClick:e}){return(0,X.jsxs)(`button`,{type:`button`,onClick:e,className:`env-orbital group h-full w-full flex flex-col items-center justify-center gap-2 border border-dashed py-10 text-muted-foreground transition-colors hover:border-primary/30 hover:text-primary`,style:{"--_status":`var(--tooltip-border)`},children:[(0,X.jsx)(V,{className:`size-5 transition-transform group-hover:scale-110`}),(0,X.jsx)(`span`,{className:`text-xs`,children:`Add Target`})]})}function Qt({targets:e,onMutate:t,lastOpByTarget:n,templates:r,templatesLoading:i,templatesError:a,onRetryTemplates:o,stream:s}){let[c,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(null),[f,p]=(0,Y.useState)(K.id),[m,_]=(0,Y.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[v,y]=(0,Y.useState)(!1),[E,O]=(0,Y.useState)(!1),{testing:k,runTest:A,cancelInFlight:j}=me(),[M,N]=(0,Y.useState)(null),[P,F]=(0,Y.useState)(null),I=s.status===`running`,L=f===K.id&&m.hostname.trim().length>0&&m.sourceHostname.trim().length>0&&(u!==null||m.apiToken.trim().length>0),R=()=>{d(null),p(K.id),_({label:``,hostname:``,apiToken:``,sourceHostname:``}),O(!1),l(!0)},z=e=>{d(e.id),p(Ae.some(t=>t.id===e.platformId)?e.platformId:K.id),_({label:e.label,hostname:e.hostname,apiToken:``,sourceHostname:e.sourceHostname}),O(!1),l(!0)},B=async()=>{if(f!==K.id){S.error(`${qt(f)} target setup is coming soon.`);return}if(!m.label||!m.hostname||!m.sourceHostname){S.error(`Label, hostname, and source host are required.`);return}if(!u&&!m.apiToken){S.error(`API token is required for new targets.`);return}y(!0);try{u?(await W(u,{platformId:f,label:m.label,hostname:m.hostname,sourceHostname:m.sourceHostname,...m.apiToken?{apiToken:m.apiToken}:{}}),S.success(`Target updated.`)):(await H({...m,platformId:f}),S.success(`Target added.`)),l(!1),t()}catch(e){S.error(J(e,`Failed to save target.`))}finally{y(!1)}};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`h2`,{className:`flex h-5 items-center text-xs font-medium leading-none uppercase tracking-wider text-muted-foreground`,children:`Platform Targets`}),e.length>0?(0,X.jsx)(Ke,{variant:`secondary`,className:`relative -top-px h-5 shrink-0 px-1.5 py-0 font-mono text-[10px] leading-none tabular-nums`,children:e.length}):null]}),(0,X.jsxs)(D,{size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:R,children:[(0,X.jsx)(V,{className:`size-3.5`}),` Add Target`]})]}),e.length===0?(0,X.jsx)(dt,{titleId:`platforms-targets-empty-title`,frameIcon:(0,X.jsx)(q,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0}),description:(0,X.jsx)(lt,{}),children:(0,X.jsx)(ut,{onClick:R})}):(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 @2xl/main:grid-cols-2 @5xl/main:grid-cols-3`,children:(0,X.jsxs)(g,{children:[e.map((e,t)=>(0,X.jsx)(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},children:(0,X.jsx)(Xt,{target:e,lastOp:n.get(e.id),onEdit:()=>z(e),onDelete:()=>N(e),quickActions:(0,X.jsx)(Gt,{target:e,templates:r,templatesLoading:i,templatesError:a,isStreaming:I,onRetryTemplates:o,onSelect:F})})},e.id)),(0,X.jsx)(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:380,damping:30,delay:e.length*.04},children:(0,X.jsx)(Zt,{onClick:R})},`add-card`)]})}),(0,X.jsx)(Kt,{selection:P,templates:r,stream:s,onSelectionChange:F}),(0,X.jsx)(se,{open:c,editing:u!==null,platformId:f,form:m,showToken:E,saving:v,testing:k,canTestConnection:L,onOpenChange:l,onPlatformChange:p,onFormChange:_,onShowTokenChange:O,onSave:()=>void B(),onTestConnection:()=>{L&&A({...u?{targetId:u}:{},hostname:m.hostname.trim(),sourceHostname:m.sourceHostname.trim(),...m.apiToken.trim()?{apiToken:m.apiToken.trim()}:{}})},onCancelInFlight:j}),(0,X.jsx)(C,{open:M!==null,onOpenChange:e=>!e&&N(null),children:(0,X.jsxs)(ee,{children:[(0,X.jsxs)(w,{children:[(0,X.jsx)(T,{children:`Remove Target`}),(0,X.jsxs)(x,{children:[`Remove “`,M?.label,`”? This only deletes the saved credentials — it does not affect resources on the target platform.`]})]}),(0,X.jsxs)(b,{children:[(0,X.jsx)(D,{variant:`outline`,onClick:()=>N(null),children:`Cancel`}),(0,X.jsx)(D,{variant:`destructive`,onClick:async()=>{if(!M)return;let e=M.id;N(null);try{await fe(e),S.success(`Target removed.`),t()}catch(e){S.error(J(e,`Failed to remove target.`))}},children:`Remove`})]})]})})]})}var $t=25;function en({status:e}){switch(e){case`success`:return(0,X.jsx)(je,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,X.jsx)(He,{className:`size-3 text-warning`});case`noop`:return(0,X.jsx)(it,{className:`size-3 text-muted-foreground`});case`failed`:return(0,X.jsx)(Ie,{className:`size-3 text-destructive`})}}function tn({targetCount:e,opCount:t,lastOp:n}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(q,{className:`size-3`}),(0,X.jsx)(`span`,{className:`font-mono`,children:e}),` target`,e===1?``:`s`]}),(0,X.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(g,{mode:`popLayout`,initial:!1,children:(0,X.jsx)(h.span,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{type:`spring`,stiffness:500,damping:35},className:`font-mono tabular-nums`,children:t},t)}),` `,`operation`,t===1?``:`s`]}),n&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(en,{status:n.status}),(0,X.jsxs)(`span`,{children:[n.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,X.jsx)(`time`,{dateTime:new Date(n.completedAt).toISOString(),title:M(n.completedAt),children:j(n.completedAt)})]})]})]})]})}function nn(){let e=f({queryKey:c.platforms.targets(),queryFn:()=>U()}),t=e.data??[],n=rt({queryKey:c.platforms.operationsList(),queryFn:({pageParam:e})=>ye({limit:$t,offset:e}),initialPageParam:0,getNextPageParam:(e,t,n)=>e.hasMore&&e.operations.length>0?n+$t:void 0}),i=(0,Y.useMemo)(()=>n.data?.pages.flatMap(e=>e.operations)??[],[n.data]),o=n.data?.pages[0]?.total??0,s=f({queryKey:c.catalog.templates(),queryFn:()=>a(`/catalog/templates`,r.catalogTemplates)}),u=s.data??[],d=ve(),p=(0,Y.useRef)(d.status);(0,Y.useEffect)(()=>{let e=p.current;p.current=d.status,e===`running`&&d.status===`complete`&&l.invalidateQueries({queryKey:c.platforms.operationsList()})},[d.status]);let y=(0,Y.useMemo)(()=>{let e=new Map;for(let t of i)e.has(t.targetId)||e.set(t.targetId,t);return e},[i]),[b,x]=_(`tab`,v([`targets`,`operations`,`activity`]).withDefault(`targets`)),S;return S=e.isPending&&e.data===void 0?null:e.isError&&e.data===void 0?(0,X.jsx)(m,{message:J(e.error,`Could not load targets.`),onRetry:()=>void e.refetch(),isRetrying:e.isFetching&&!e.isPending}):t.length===0?(0,X.jsx)(dt,{titleId:`platforms-operations-empty-title`,frameIcon:(0,X.jsx)(q,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0}),description:(0,X.jsx)(lt,{}),children:(0,X.jsx)(ut,{onClick:()=>void x(`targets`)})}):(0,X.jsx)(xt,{targets:t,stream:d}),(0,X.jsxs)(`div`,{className:`mx-auto flex h-full w-full min-w-0 max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,X.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,X.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Platforms`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect Platforms as targets, then apply templates or run cleanup from Operations.`}),(0,X.jsx)(tn,{targetCount:t.length,opCount:o,lastOp:i[0]})]}),(0,X.jsxs)(Le,{value:b,onValueChange:e=>{x(e)},className:`flex-1 min-h-0`,children:[(0,X.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,X.jsxs)(Fe,{variant:`line`,className:`h-10! gap-0.5 min-w-max`,children:[(0,X.jsxs)(Me,{value:`targets`,className:`gap-1.5 px-3 text-sm`,children:[(0,X.jsx)(q,{className:`size-3.5 shrink-0`}),`Targets`]}),(0,X.jsxs)(Me,{value:`operations`,className:`gap-1.5 px-3 text-sm`,children:[(0,X.jsx)(Se,{className:`size-3.5 shrink-0`}),`Operations`]}),(0,X.jsxs)(Me,{value:`activity`,className:`gap-1.5 px-3 text-sm`,children:[(0,X.jsx)(I,{className:`size-3.5 shrink-0`}),`Activity`]})]})}),(0,X.jsx)(Ne,{value:`targets`,className:`flex-1 py-2`,children:(0,X.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:e.isError&&e.data===void 0?(0,X.jsx)(m,{message:J(e.error,`Failed to load targets.`),onRetry:()=>void e.refetch(),isRetrying:e.isFetching&&!e.isPending}):(0,X.jsx)(Qt,{targets:t,onMutate:()=>void e.refetch(),lastOpByTarget:y,templates:u,templatesLoading:s.isPending&&s.data===void 0,templatesError:s.isError&&u.length===0,onRetryTemplates:()=>void s.refetch(),stream:d})},`targets`)}),(0,X.jsx)(Ne,{value:`operations`,className:`flex-1 py-2`,children:(0,X.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:S},`operations`)}),(0,X.jsx)(Ne,{value:`activity`,className:`flex flex-col flex-1 min-h-0 py-2`,children:(0,X.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(Wt,{operations:i,totalKnown:o,isLoading:n.isPending&&!n.data,error:n.error,onRefresh:()=>void l.invalidateQueries({queryKey:c.platforms.operationsList()}),hasNextPage:n.hasNextPage,isFetchingNextPage:n.isFetchingNextPage,loadMoreError:n.isFetchNextPageError&&n.error instanceof Error?n.error:null,onRetryLoadMore:()=>void n.fetchNextPage(),onLoadMore:()=>void n.fetchNextPage()})},`activity`)})]}),(0,X.jsx)(g,{children:d.operation||d.status===`running`?(0,X.jsx)(ft,{stream:d,onReset:d.reset,catalogTemplates:u}):null})]})}export{nn as t};
@@ -1 +0,0 @@
1
- import{a as e,i as t,n,r}from"./rolldown-runtime-COnpUsM8.js";import{c as i}from"./vendor-charts-95ykyDlI.js";import{at as a}from"./vendor-ui-CWUk2ulb.js";var o=a(),s=e(i(),1),c=(0,s.createContext)({});function l(e){let t=(0,s.useRef)(null);return t.current===null&&(t.current=e()),t.current}var u=typeof window<`u`?s.useLayoutEffect:s.useEffect,d=(0,s.createContext)(null);function f(e,t){e.indexOf(t)===-1&&e.push(t)}function p(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var m=(e,t,n)=>n>t?t:n<e?e:n,h={},g=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function _(e){return typeof e==`object`&&!!e}var v=e=>/^0[^.\s]+$/u.test(e);function y(e){let t;return()=>(t===void 0&&(t=e()),t)}var b=e=>e,x=(e,t)=>n=>t(e(n)),S=(...e)=>e.reduce(x),C=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},w=class{constructor(){this.subscriptions=[]}add(e){return f(this.subscriptions,e),()=>p(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},T=e=>e*1e3,E=e=>e/1e3;function D(e,t){return t?1e3/t*e:0}var ee=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,te=1e-7,ne=12;function re(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ee(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>te&&++s<ne);return o}function ie(e,t,n,r){if(e===t&&n===r)return b;let i=t=>re(t,0,1,e,n);return e=>e===0||e===1?e:ee(i(e),t,r)}var ae=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,oe=e=>t=>1-e(1-t),se=ie(.33,1.53,.69,.99),ce=oe(se),le=ae(ce),ue=e=>e>=1?1:(e*=2)<1?.5*ce(e):.5*(2-2**(-10*(e-1))),de=e=>1-Math.sin(Math.acos(e)),fe=oe(de),pe=ae(de),me=ie(.42,0,1,1),he=ie(0,0,.58,1),ge=ie(.42,0,.58,1),_e=e=>Array.isArray(e)&&typeof e[0]!=`number`,ve=e=>Array.isArray(e)&&typeof e[0]==`number`,ye={linear:b,easeIn:me,easeInOut:ge,easeOut:he,circIn:de,circInOut:pe,circOut:fe,backIn:ce,backInOut:le,backOut:se,anticipate:ue},be=e=>typeof e==`string`,xe=e=>{if(ve(e)){e.length;let[t,n,r,i]=e;return ie(t,n,r,i)}else if(be(e))return ye[e],`${e}`,ye[e];return e},Se=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],O={value:null,addProjectionMetrics:null};function Ce(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&O.value&&O.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var we=40;function Te(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Se.reduce((e,n)=>(e[n]=Ce(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,g=()=>{let a=h.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,we),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))},_=()=>{n=!0,r=!0,i.isProcessing||e(g)};return{schedule:Se.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||_(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Se.length;t++)o[Se[t]].cancel(e)},state:i,steps:o}}var{schedule:k,cancel:A,state:j,steps:Ee}=Te(typeof requestAnimationFrame<`u`?requestAnimationFrame:b,!0),De;function Oe(){De=void 0}var M={now:()=>(De===void 0&&M.set(j.isProcessing||h.useManualTiming?j.timestamp:performance.now()),De),set:e=>{De=e,queueMicrotask(Oe)}},N={layout:0,mainThread:0,waapi:0},ke=e=>t=>typeof t==`string`&&t.startsWith(e),Ae=ke(`--`),je=ke(`var(--`),Me=e=>je(e)?Ne.test(e.split(`/*`)[0].trim()):!1,Ne=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Pe(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var Fe={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Ie={...Fe,transform:e=>m(0,1,e)},Le={...Fe,default:1},Re=e=>Math.round(e*1e5)/1e5,ze=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Be(e){return e==null}var Ve=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,He=(e,t)=>n=>!!(typeof n==`string`&&Ve.test(n)&&n.startsWith(e)||t&&!Be(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ue=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ze);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},We=e=>m(0,255,e),Ge={...Fe,transform:e=>Math.round(We(e))},P={test:He(`rgb`,`red`),parse:Ue(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ge.transform(e)+`, `+Ge.transform(t)+`, `+Ge.transform(n)+`, `+Re(Ie.transform(r))+`)`};function Ke(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var qe={test:He(`#`),parse:Ke,transform:P.transform},Je=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),F=Je(`deg`),I=Je(`%`),L=Je(`px`),Ye=Je(`vh`),Xe=Je(`vw`),Ze={...I,parse:e=>I.parse(e)/100,transform:e=>I.transform(e*100)},Qe={test:He(`hsl`,`hue`),parse:Ue(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+I.transform(Re(t))+`, `+I.transform(Re(n))+`, `+Re(Ie.transform(r))+`)`},R={test:e=>P.test(e)||qe.test(e)||Qe.test(e),parse:e=>P.test(e)?P.parse(e):Qe.test(e)?Qe.parse(e):qe.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?P.transform(e):Qe.transform(e),getAnimatableNone:e=>{let t=R.parse(e);return t.alpha=0,R.transform(t)}},$e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function et(e){return isNaN(e)&&typeof e==`string`&&(e.match(ze)?.length||0)+(e.match($e)?.length||0)>0}var tt=`number`,nt=`color`,rt=`var`,it=`var(`,at="${}",ot=/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 st(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(ot,e=>(R.test(e)?(r.color.push(a),i.push(nt),n.push(R.parse(e))):e.startsWith(it)?(r.var.push(a),i.push(rt),n.push(e)):(r.number.push(a),i.push(tt),n.push(parseFloat(e))),++a,at)).split(at),indexes:r,types:i}}function ct(e){return st(e).values}function lt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===tt?i+=Re(r[a]):e===nt?i+=R.transform(r[a]):i+=r[a]}return i}}function ut(e){return lt(st(e))}var dt=e=>typeof e==`number`?0:R.test(e)?R.getAnimatableNone(e):e,ft=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:dt(e);function pt(e){let t=st(e);return lt(t)(t.values.map((e,n)=>ft(e,t.split[n])))}var z={test:et,parse:ct,createTransformer:ut,getAnimatableNone:pt};function mt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ht({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=mt(s,r,e+1/3),a=mt(s,r,e),o=mt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function gt(e,t){return n=>n>0?t:e}var B=(e,t,n)=>e+(t-e)*n,_t=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},vt=[qe,P,Qe],yt=e=>vt.find(t=>t.test(e));function bt(e){let t=yt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Qe&&(n=ht(n)),n}var xt=(e,t)=>{let n=bt(e),r=bt(t);if(!n||!r)return gt(e,t);let i={...n};return e=>(i.red=_t(n.red,r.red,e),i.green=_t(n.green,r.green,e),i.blue=_t(n.blue,r.blue,e),i.alpha=B(n.alpha,r.alpha,e),P.transform(i))},St=new Set([`none`,`hidden`]);function Ct(e,t){return St.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wt(e,t){return n=>B(e,t,n)}function Tt(e){return typeof e==`number`?wt:typeof e==`string`?Me(e)?gt:R.test(e)?xt:kt:Array.isArray(e)?Et:typeof e==`object`?R.test(e)?xt:Dt:gt}function Et(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Tt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Dt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Tt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Ot(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var kt=(e,t)=>{let n=z.createTransformer(t),r=st(e),i=st(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?St.has(e)&&!i.values.length||St.has(t)&&!r.values.length?Ct(e,t):S(Et(Ot(r,i),i.values),n):(`${e}${t}`,gt(e,t))};function At(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?B(e,t,n):Tt(e)(e,t)}var jt=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>k.update(t,e),stop:()=>A(t),now:()=>j.isProcessing?j.timestamp:M.now()}},Mt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Nt=2e4;function Pt(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Ft(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Pt(r),Nt);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:E(i)}}var V={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 It(e,t){return e*Math.sqrt(1-t*t)}var Lt=12;function Rt(e,t,n){let r=n;for(let n=1;n<Lt;n++)r-=e(r)/t(r);return r}var zt=.001;function Bt({duration:e=V.duration,bounce:t=V.bounce,velocity:n=V.velocity,mass:r=V.mass}){let i,a;V.maxDuration;let o=1-t;o=m(V.minDamping,V.maxDamping,o),e=m(V.minDuration,V.maxDuration,E(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=It(t,o),c=Math.exp(-i);return zt-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=It(t**2,o);return(-i(t)+zt>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-zt+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Rt(i,a,s);if(e=T(e),isNaN(c))return{stiffness:V.stiffness,damping:V.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Vt=[`duration`,`bounce`],Ht=[`stiffness`,`damping`,`mass`];function Ut(e,t){return t.some(t=>e[t]!==void 0)}function Wt(e){let t={velocity:V.velocity,stiffness:V.stiffness,damping:V.damping,mass:V.mass,isResolvedFromDuration:!1,...e};if(!Ut(e,Ht)&&Ut(e,Vt))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*m(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:V.mass,stiffness:i,damping:a}}else{let n=Bt({...e,velocity:0});t={...t,...n,mass:V.mass},t.isResolvedFromDuration=!0}return t}function Gt(e=V.visualDuration,t=V.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Wt({...n,velocity:-E(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=E(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?V.restSpeed.granular:V.restSpeed.default,i||=v?V.restDelta.granular:V.restDelta.default;let y,b,x,S,C,w;if(h<1)x=It(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let D={calculatedDuration:p&&d||null,velocity:e=>T(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=T(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=T(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Pt(D),Nt),t=Mt(t=>D.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return D}Gt.applyToOptions=e=>{let t=Ft(e,100,Gt);return e.ease=t.ease,e.duration=T(t.duration),e.type=`keyframes`,e};var Kt=5;function qt(e,t,n){let r=Math.max(t-Kt,0);return D(n-e(r),t-r)}function Jt({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Gt({keyframes:[f.value,m(f.value)],velocity:qt(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Yt(e,t,n){let r=[],i=n||h.mix||At,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=S(Array.isArray(t)?t[n]||b:t,a)),r.push(a)}return r}function Xt(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Yt(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=C(e[r],e[r+1],n);return s[r](i)};return n?t=>l(m(e[0],e[a-1],t)):l}function Zt(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=C(0,t,r);e.push(B(n,1,i))}}function Qt(e){let t=[0];return Zt(t,e.length-1),t}function $t(e,t){return e.map(e=>e*t)}function en(e,t){return e.map(()=>t||ge).splice(0,e.length-1)}function tn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=_e(r)?r.map(xe):xe(r),a={done:!1,value:t[0]},o=Xt($t(n&&n.length===t.length?n:Qt(t),e),t,{ease:Array.isArray(i)?i:en(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var nn=e=>e!==null;function rn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(nn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var an={decay:Jt,inertia:Jt,tween:tn,keyframes:tn,spring:Gt};function on(e){typeof e.type==`string`&&(e.type=an[e.type])}var sn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},cn=e=>e/100,ln=class extends sn{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=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==M.now()&&this.tick(M.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},N.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;on(e);let{type:t=tn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||tn;s!==tn&&typeof o[0]!=`number`&&(this.mixKeyframes=S(cn,At(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Pt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:h,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let _=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?_<0:_>r;this.currentTime=Math.max(_,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let y=this.currentTime,b=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(b=a)),y=m(0,1,n)*o}let x;v?(this.delayState.value=l[0],x=this.delayState):x=b.next(y),i&&!v&&(x.value=i(x.value));let{done:S}=x;!v&&s!==null&&(S=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let C=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&S);return C&&p!==Jt&&(x.value=rn(l,this.options,g,this.speed)),h&&h(x.value),C&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return E(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+E(e)}get time(){return E(this.currentTime)}set time(e){e=T(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return qt(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(M.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=E(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=jt,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(M.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,N.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function un(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var dn=e=>e*180/Math.PI,fn=e=>mn(dn(Math.atan2(e[1],e[0]))),pn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fn,rotateZ:fn,skewX:e=>dn(Math.atan(e[1])),skewY:e=>dn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},mn=e=>(e%=360,e<0&&(e+=360),e),hn=fn,gn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),_n=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),vn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gn,scaleY:_n,scale:e=>(gn(e)+_n(e))/2,rotateX:e=>mn(dn(Math.atan2(e[6],e[5]))),rotateY:e=>mn(dn(Math.atan2(-e[2],e[0]))),rotateZ:hn,rotate:hn,skewX:e=>dn(Math.atan(e[4])),skewY:e=>dn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function yn(e){return+!!e.includes(`scale`)}function bn(e,t){if(!e||e===`none`)return yn(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=vn,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=pn,i=t}if(!i)return yn(t);let a=r[t],o=i[1].split(`,`).map(Sn);return typeof a==`function`?a(o):o[a]}var xn=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return bn(n,t)};function Sn(e){return parseFloat(e.trim())}var Cn=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],wn=new Set(Cn),Tn=e=>e===Fe||e===L,En=new Set([`x`,`y`,`z`]),Dn=Cn.filter(e=>!En.has(e));function On(e){let t=[];return Dn.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var H={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>bn(t,`x`),y:(e,{transform:t})=>bn(t,`y`)};H.translateX=H.x,H.translateY=H.y;var U=new Set,kn=!1,An=!1,jn=!1;function Mn(){if(An){let e=Array.from(U).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=On(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}An=!1,kn=!1,U.forEach(e=>e.complete(jn)),U.clear()}function Nn(){U.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(An=!0)})}function Pn(){jn=!0,Nn(),Mn(),jn=!1}var Fn=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(U.add(this),kn||(kn=!0,k.read(Nn),k.resolveKeyframes(Mn))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}un(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),U.delete(this)}cancel(){this.state===`scheduled`&&(U.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},In=e=>e.startsWith(`--`);function Ln(e,t,n){In(t)?e.style.setProperty(t,n):e.style[t]=n}var Rn={};function zn(e,t){let n=y(e);return()=>Rn[t]??n()}var Bn=zn(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Vn=zn(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Hn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Un={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Hn([0,.65,.55,1]),circOut:Hn([.55,0,1,.45]),backIn:Hn([.31,.01,.66,-.59]),backOut:Hn([.33,1.53,.69,.99])};function Wn(e,t){if(e)return typeof e==`function`?Vn()?Mt(e,t):`ease-out`:ve(e)?Hn(e):Array.isArray(e)?e.map(e=>Wn(e,t)||Un.easeOut):Un[e]}function Gn(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Wn(s,i);Array.isArray(d)&&(u.easing=d),O.value&&N.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return O.value&&p.finished.finally(()=>{N.waapi--}),p}function Kn(e){return typeof e==`function`&&`applyToOptions`in e}function qn({type:e,...t}){return Kn(e)&&Vn()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Jn=class extends sn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=qn(e);this.animation=Gn(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=rn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Ln(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return E(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+E(e)}get time(){return E(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=T(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Bn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),b):r(this)}},Yn={anticipate:ue,backInOut:le,circInOut:pe};function Xn(e){return e in Yn}function Zn(e){typeof e.ease==`string`&&Xn(e.ease)&&(e.ease=Yn[e.ease])}var Qn=10,$n=class extends Jn{constructor(e){Zn(e),on(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new ln({...a,autoplay:!1}),s=Math.max(Qn,M.now()-this.startTime),c=m(0,Qn,s-Qn),l=o.sample(s).value,{name:u}=this.options;i&&u&&Ln(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},er=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(z.test(e)||e===`0`)&&!e.startsWith(`url(`));function tr(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function nr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=er(i,t),s=er(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:tr(e)||(n===`spring`||Kn(n))&&r}function rr(e){e.duration=0,e.type=`keyframes`}var ir=new Set([`opacity`,`clipPath`,`filter`,`transform`]),ar=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function or(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ar.test(e[t]))return!0;return!1}var sr=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),cr=y(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function lr(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return cr()&&n&&(ir.has(n)||sr.has(n)&&or(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ur=40,dr=class extends sn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=M.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||Fn)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=M.now();let u=!0;nr(e,i,a,o)||(u=!1,(h.instantAnimations||!s)&&l?.(rn(e,n,t)),e[0]=e[e.length-1],rr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>ur?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&lr(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new $n({...d,element:p})}catch{m=new ln(d)}else m=new ln(d);m.finished.then(()=>{this.notifyFinished()}).catch(b),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Pn()),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 fr(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var pr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mr(e){let t=pr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function hr(e,t,n=1){`${e}`;let[r,i]=mr(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return g(e)?parseFloat(e):e}return Me(i)?hr(i,t,n+1):i}var gr={type:`spring`,stiffness:500,damping:25,restSpeed:10},_r=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),vr={type:`keyframes`,duration:.8},yr={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},br=(e,{keyframes:t})=>t.length>2?vr:wn.has(e)?e.startsWith(`scale`)?_r(t[1]):gr:yr;function xr(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Sr(e,t){let n=e?.[t]??e?.default??e;return n===e?n:xr(n,e)}var Cr=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function wr(e){for(let t in e)if(!Cr.has(t))return!0;return!1}var Tr=(e,t,n,r={},i,a)=>o=>{let s=Sr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=T(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};wr(s)||Object.assign(u,br(e,u)),u.duration&&=T(u.duration),u.repeatDelay&&=T(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(rr(u),u.delay===0&&(d=!0)),(h.instantAnimations||h.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,rr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=rn(u.keyframes,s);if(e!==void 0){k.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ln(u):new dr(u)};function Er(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Dr(e,t,n,r){if(typeof t==`function`){let[i,a]=Er(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Er(r);t=t(n===void 0?e.custom:n,i,a)}return t}function W(e,t,n){let r=e.getProps();return Dr(r,t,n===void 0?r.custom:n,e)}var Or=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Cn]),kr=30,Ar=e=>!isNaN(parseFloat(e)),jr={current:void 0},Mr=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=M.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=M.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ar(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new w);let n=this.events[e].add(t);return e===`change`?()=>{n(),k.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return jr.current&&jr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=M.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>kr)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,kr);return D(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Nr(e,t){return new Mr(e,t)}var Pr=e=>Array.isArray(e);function Fr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Nr(n))}function Ir(e){return Pr(e)?e[e.length-1]||0:e}function Lr(e,t){let{transitionEnd:n={},transition:r={},...i}=W(e,t)||{};i={...i,...n};for(let t in i)Fr(e,t,Ir(i[t]))}var G=e=>!!(e&&e.getVelocity);function Rr(e){return!!(G(e)&&e.add)}function zr(e,t){let n=e.getValue(`willChange`);if(Rr(n))return n.add(t);if(!n&&h.WillChange){let n=new h.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Br(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Vr=`data-`+Br(`framerAppearId`);function Hr(e){return e.props[Vr]}function Ur({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Wr(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?xr(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Ur(d,t))continue;let o={delay:n,...Sr(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){k.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=Hr(e);if(n){let e=window.MotionHandoffAnimation(n,t,k);e!==null&&(o.startTime=e,f=!0)}}zr(e,t);let p=l??e.shouldReduceMotion;r.start(Tr(t,r,i,p&&Or.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>k.update(()=>{o&&Lr(e,o)});u.length?Promise.all(u).then(t):t()}return u}function Gr(e,t,n={}){let r=W(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Wr(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Kr(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Kr(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Gr(c,t,{...o,delay:n+(typeof r==`function`?0:r)+fr(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function qr(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Gr(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Gr(e,t,n);else{let i=typeof t==`function`?W(e,t,n.custom):t;r=Promise.all(Wr(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Jr={test:e=>e===`auto`,parse:e=>e},Yr=e=>t=>t.test(e),Xr=[Fe,L,I,F,Xe,Ye,Jr],Zr=e=>Xr.find(Yr(e));function Qr(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||v(e)}var $r=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ei(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ze)||[];if(!r)return e;let i=n.replace(r,``),a=+!!$r.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var ti=/\b([a-z-]*)\(.*?\)/gu,ni={...z,getAnimatableNone:e=>{let t=e.match(ti);return t?t.map(ei).join(` `):e}},ri={...z,getAnimatableNone:e=>{let t=z.parse(e);return z.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},ii={...Fe,transform:Math.round},ai={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,fontSize:L,backgroundPositionX:L,backgroundPositionY:L,rotate:F,rotateX:F,rotateY:F,rotateZ:F,scale:Le,scaleX:Le,scaleY:Le,scaleZ:Le,skew:F,skewX:F,skewY:F,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:Ie,originX:Ze,originY:Ze,originZ:L,zIndex:ii,fillOpacity:Ie,strokeOpacity:Ie,numOctaves:ii},oi={...ai,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ni,WebkitFilter:ni,mask:ri,WebkitMask:ri},si=e=>oi[e],ci=new Set([ni,ri]);function li(e,t){let n=si(e);return ci.has(n)||(n=z),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var ui=new Set([`auto`,`none`,`0`]);function di(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ui.has(t)&&st(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=li(n,i)}var fi=class extends Fn{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Me(r))){let i=hr(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Or.has(n)||e.length!==2)return;let[r,i]=e,a=Zr(r),o=Zr(i);if(Pe(r)!==Pe(i)&&H[n]){this.needsMeasurement=!0;return}if(a!==o)if(Tn(a)&&Tn(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else H[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Qr(e[t]))&&n.push(t);n.length&&di(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=H[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=H[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function pi(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var mi=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function hi(e){return _(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:gi,cancel:_i}=Te(queueMicrotask,!1),K={x:!1,y:!1};function vi(){return K.x||K.y}function yi(e){return e===`x`||e===`y`?K[e]?null:(K[e]=!0,()=>{K[e]=!1}):K.x||K.y?null:(K.x=K.y=!0,()=>{K.x=K.y=!1})}function bi(e,t){let n=pi(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function xi(e){return!(e.pointerType===`touch`||vi())}function Si(e,t,n={}){let[r,i,a]=bi(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!xi(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Ci=(e,t)=>t?e===t?!0:Ci(e,t.parentElement):!1,wi=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ti=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ei(e){return Ti.has(e.tagName)||e.isContentEditable===!0}var Di=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Oi(e){return Di.has(e.tagName)||e.isContentEditable===!0}var ki=new WeakSet;function Ai(e){return t=>{t.key===`Enter`&&e(t)}}function ji(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Mi=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Ai(()=>{if(ki.has(n))return;ji(n,`down`);let e=Ai(()=>{ji(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>ji(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Ni(e){return wi(e)&&!vi()}var Pi=new WeakSet;function Fi(e,t,n={}){let[r,i,a]=bi(e,n),o=e=>{let r=e.currentTarget;if(!Ni(e)||Pi.has(e))return;ki.add(r),n.stopPropagation&&Pi.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),ki.has(r)&&ki.delete(r),Ni(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Ci(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),hi(e)&&(e.addEventListener(`focus`,e=>Mi(e,i)),!Ei(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Ii(e){return _(e)&&`ownerSVGElement`in e}var Li=new WeakMap,Ri,zi=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Ii(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Bi=zi(`inline`,`width`,`offsetWidth`),Vi=zi(`block`,`height`,`offsetHeight`);function Hi({target:e,borderBoxSize:t}){Li.get(e)?.forEach(n=>{n(e,{get width(){return Bi(e,t)},get height(){return Vi(e,t)}})})}function Ui(e){e.forEach(Hi)}function Wi(){typeof ResizeObserver>`u`||(Ri=new ResizeObserver(Ui))}function Gi(e,t){Ri||Wi();let n=pi(e);return n.forEach(e=>{let n=Li.get(e);n||(n=new Set,Li.set(e,n)),n.add(t),Ri?.observe(e)}),()=>{n.forEach(e=>{let n=Li.get(e);n?.delete(t),n?.size||Ri?.unobserve(e)})}}var Ki=new Set,qi;function Ji(){qi=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ki.forEach(t=>t(e))},window.addEventListener(`resize`,qi)}function Yi(e){return Ki.add(e),qi||Ji(),()=>{Ki.delete(e),!Ki.size&&typeof qi==`function`&&(window.removeEventListener(`resize`,qi),qi=void 0)}}function Xi(e,t){return typeof e==`function`?Yi(e):Gi(e,t)}function Zi(e){return Ii(e)&&e.tagName===`svg`}var Qi=[...Xr,R,z],$i=e=>Qi.find(Yr(e)),ea=()=>({translate:0,scale:1,origin:0,originPoint:0}),ta=()=>({x:ea(),y:ea()}),na=()=>({min:0,max:0}),q=()=>({x:na(),y:na()}),ra=new WeakMap;function ia(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function aa(e){return typeof e==`string`||Array.isArray(e)}var oa=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],sa=[`initial`,...oa];function ca(e){return ia(e.animate)||sa.some(t=>aa(e[t]))}function la(e){return!!(ca(e)||e.variants)}function ua(e,t,n){for(let r in t){let i=t[r],a=n[r];if(G(i))e.addValue(r,i);else if(G(a))e.addValue(r,Nr(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Nr(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var da={current:null},fa={current:!1},pa=typeof window<`u`;function ma(){if(fa.current=!0,pa)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>da.current=e.matches;e.addEventListener(`change`,t),t()}else da.current=!1}var ha=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],ga={};function _a(e){ga=e}function va(){return ga}var ya=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Fn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=M.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,k.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ca(t),this.isVariantNode=la(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&G(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,ra.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(fa.current||ma(),this.shouldReduceMotion=da.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(),A(this.notifyUpdate),A(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ir.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Jn({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:T(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=wn.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&k.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ga){let t=ga[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):q()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ha.length;t++){let n=ha[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=ua(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Nr(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(g(n)||v(n))?n=parseFloat(n):!$i(n)&&z.test(t)&&(n=li(e,t)),this.setBaseTarget(e,G(n)?n.get():n)),G(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Dr(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!G(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new w),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){gi.render(this.render)}},ba=class extends ya{constructor(){super(...arguments),this.KeyframeResolver=fi}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;G(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},J=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function xa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Sa({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ca(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function wa(e){return e===void 0||e===1}function Ta({scale:e,scaleX:t,scaleY:n}){return!wa(e)||!wa(t)||!wa(n)}function Y(e){return Ta(e)||Ea(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ea(e){return Da(e.x)||Da(e.y)}function Da(e){return e&&e!==`0%`}function Oa(e,t,n){return n+t*(e-n)}function ka(e,t,n,r,i){return i!==void 0&&(e=Oa(e,i,r)),Oa(e,n,r)+t}function Aa(e,t=0,n=1,r,i){e.min=ka(e.min,t,n,r,i),e.max=ka(e.max,t,n,r,i)}function ja(e,{x:t,y:n}){Aa(e.x,t.translate,t.scale,t.originPoint),Aa(e.y,n.translate,n.scale,n.originPoint)}var Ma=.999999999999,Na=1.0000000000001;function Pa(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(X(e.x,-a.scroll.offset.x),X(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ja(e,o)),r&&Y(a.latestValues)&&La(e,a.latestValues,a.layout?.layoutBox))}t.x<Na&&t.x>Ma&&(t.x=1),t.y<Na&&t.y>Ma&&(t.y=1)}function X(e,t){e.min+=t,e.max+=t}function Fa(e,t,n,r,i=.5){Aa(e,t,n,B(e.min,e.max,i),r)}function Ia(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function La(e,t,n){let r=n??e;Fa(e.x,Ia(t.x,r.x),t.scaleX,t.scale,t.originX),Fa(e.y,Ia(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ra(e,t){return xa(Ca(e.getBoundingClientRect(),t))}function za(e,t,n){let r=Ra(e,n),{scroll:i}=t;return i&&(X(r.x,i.offset.x),X(r.y,i.offset.y)),r}var Ba={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Va=Cn.length;function Ha(e,t,n){let r=``,i=!0;for(let a=0;a<Va;a++){let o=Cn[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=mi(s,ai[o]);if(!c){i=!1;let t=Ba[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ua(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(wn.has(e)){o=!0;continue}else if(Ae(e)){i[e]=n;continue}else{let t=mi(n,ai[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ha(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Wa(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Ga(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ka={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(L.test(e))e=parseFloat(e);else return e;return`${Ga(e,t.target.x)}% ${Ga(e,t.target.y)}%`}},qa={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=z.parse(e);if(i.length>5)return r;let a=z.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=B(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Ja={borderRadius:{...Ka,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Ka,borderTopRightRadius:Ka,borderBottomLeftRadius:Ka,borderBottomRightRadius:Ka,boxShadow:qa};function Ya(e,{layout:t,layoutId:n}){return wn.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ja[e]||e===`opacity`)}function Xa(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(G(r[t])||i&&G(i[t])||Ya(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Za(e){return window.getComputedStyle(e)}var Qa=class extends ba{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Wa}readValueFromInstance(e,t){if(wn.has(t))return this.projection?.isProjecting?yn(t):xn(e,t);{let n=Za(e),r=(Ae(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ra(e,t)}build(e,t,n){Ua(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Xa(e,t,n)}},$a={offset:`stroke-dashoffset`,array:`stroke-dasharray`},eo={offset:`strokeDashoffset`,array:`strokeDasharray`};function to(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?$a:eo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var no=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ro(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ua(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of no)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&to(d,i,a,o,!1)}var io=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`]),ao=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function oo(e,t,n,r){Wa(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(io.has(n)?n:Br(n),t.attrs[n])}function so(e,t,n){let r=Xa(e,t,n);for(let n in e)if(G(e[n])||G(t[n])){let t=Cn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var co=class extends ba{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=q}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(wn.has(t)){let e=si(t);return e&&e.default||0}return t=io.has(t)?t:Br(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return so(e,t,n)}build(e,t,n){ro(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){oo(e,t,n,r)}mount(e){this.isSVGTag=ao(e.tagName),super.mount(e)}},lo=sa.length;function uo(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&uo(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<lo;n++){let r=sa[n],i=e.props[r];(aa(i)||i===!1)&&(t[r]=i)}return t}function fo(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var po=[...oa].reverse(),mo=oa.length;function ho(e){return t=>Promise.all(t.map(({animation:t,options:n})=>qr(e,t,n)))}function go(e){let t=ho(e),n=yo(),r=!0,i=!1,a=t=>(n,r)=>{let i=W(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=uo(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<mo;t++){let p=po[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=aa(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||ia(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=_o(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Pr(t)&&Pr(n)?!fo(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=W(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=fr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=W(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=yo(),i=!0}}}function _o(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fo(t,e):!1}function vo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yo(){return{animate:vo(!0),whileInView:vo(),whileHover:vo(),whileTap:vo(),whileDrag:vo(),whileFocus:vo(),exit:vo()}}function bo(e,t){e.min=t.min,e.max=t.max}function Z(e,t){bo(e.x,t.x),bo(e.y,t.y)}function xo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var So=1e-4,Co=1-So,wo=1+So,To=.01,Eo=0-To,Do=0+To;function Q(e){return e.max-e.min}function Oo(e,t,n){return Math.abs(e-t)<=n}function ko(e,t,n,r=.5){e.origin=r,e.originPoint=B(t.min,t.max,e.origin),e.scale=Q(n)/Q(t),e.translate=B(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Co&&e.scale<=wo||isNaN(e.scale))&&(e.scale=1),(e.translate>=Eo&&e.translate<=Do||isNaN(e.translate))&&(e.translate=0)}function Ao(e,t,n,r){ko(e.x,t.x,n.x,r?r.originX:void 0),ko(e.y,t.y,n.y,r?r.originY:void 0)}function jo(e,t,n,r=0){e.min=(r?B(n.min,n.max,r):n.min)+t.min,e.max=e.min+Q(t)}function Mo(e,t,n,r){jo(e.x,t.x,n.x,r?.x),jo(e.y,t.y,n.y,r?.y)}function No(e,t,n,r=0){let i=r?B(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Q(t)}function Po(e,t,n,r){No(e.x,t.x,n.x,r?.x),No(e.y,t.y,n.y,r?.y)}function Fo(e,t,n,r,i){return e-=t,e=Oa(e,1/n,r),i!==void 0&&(e=Oa(e,1/i,r)),e}function Io(e,t=0,n=1,r=.5,i,a=e,o=e){if(I.test(t)&&(t=parseFloat(t),t=B(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=B(a.min,a.max,r);e===a&&(s-=t),e.min=Fo(e.min,t,n,s,i),e.max=Fo(e.max,t,n,s,i)}function Lo(e,t,[n,r,i],a,o){Io(e,t[n],t[r],t[i],t.scale,a,o)}var Ro=[`x`,`scaleX`,`originX`],zo=[`y`,`scaleY`,`originY`];function Bo(e,t,n,r){Lo(e.x,t,Ro,n?n.x:void 0,r?r.x:void 0),Lo(e.y,t,zo,n?n.y:void 0,r?r.y:void 0)}function Vo(e){return e.translate===0&&e.scale===1}function Ho(e){return Vo(e.x)&&Vo(e.y)}function Uo(e,t){return e.min===t.min&&e.max===t.max}function Wo(e,t){return Uo(e.x,t.x)&&Uo(e.y,t.y)}function Go(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ko(e,t){return Go(e.x,t.x)&&Go(e.y,t.y)}function qo(e){return Q(e.x)/Q(e.y)}function Jo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $(e){return[e(`x`),e(`y`)]}function Yo(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Xo=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],Zo=Xo.length,Qo=e=>typeof e==`string`?parseFloat(e):e,$o=e=>typeof e==`number`||L.test(e);function es(e,t,n,r,i,a){i?(e.opacity=B(0,n.opacity??1,ns(r)),e.opacityExit=B(t.opacity??1,0,rs(r))):a&&(e.opacity=B(t.opacity??1,n.opacity??1,r));for(let i=0;i<Zo;i++){let a=Xo[i],o=ts(t,a),s=ts(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||$o(o)===$o(s)?(e[a]=Math.max(B(Qo(o),Qo(s),r),0),(I.test(s)||I.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=B(t.rotate||0,n.rotate||0,r))}function ts(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ns=is(0,.5,fe),rs=is(.5,.95,b);function is(e,t,n){return r=>r<e?0:r>t?1:n(C(e,t,r))}function as(e,t,n){let r=G(e)?e:Nr(e);return r.start(Tr(``,r,t,n)),r.animation}function os(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var ss=(e,t)=>e.depth-t.depth,cs=class{constructor(){this.children=[],this.isDirty=!1}add(e){f(this.children,e),this.isDirty=!0}remove(e){p(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ss),this.isDirty=!1,this.children.forEach(e)}};function ls(e,t){let n=M.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(A(r),e(a-t))};return k.setup(r,!0),()=>A(r)}function us(e){return G(e)?e.get():e}var ds=class{constructor(){this.members=[]}add(e){f(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(p(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(p(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},fs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ps={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ms=[``,`X`,`Y`,`Z`],hs=1e3,gs=0;function _s(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function vs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Hr(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,k,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&vs(r)}function ys({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=gs++,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,O.value&&(ps.nodes=ps.calculatedTargetDeltas=ps.calculatedProjections=0),this.nodes.forEach(Ss),this.nodes.forEach(js),this.nodes.forEach(Ms),this.nodes.forEach(Cs),O.addProjectionMetrics&&O.addProjectionMetrics(ps)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new cs)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new w),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Ii(t)&&!Zi(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;k.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ls(i,250),fs.hasAnimatedSinceResize&&(fs.hasAnimatedSinceResize=!1,this.nodes.forEach(As)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||zs,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Ko(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Sr(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||As(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),A(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(Ns),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Es),this.nodes.forEach(Ts);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ds);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Os),this.nodes.forEach(ks),this.nodes.forEach(bs),this.nodes.forEach(xs)):this.nodes.forEach(Ds),this.clearAllSnapshots();let e=M.now();j.delta=m(0,1e3/60,e-j.timestamp),j.timestamp=e,j.isProcessing=!0,Ee.update.process(j),Ee.preRender.process(j),Ee.render.process(j),j.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,gi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ws),this.sharedNodes.forEach(Ps)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,k.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){k.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Q(this.snapshot.measuredBox.x)&&!Q(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=q(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ho(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Y(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Us(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return q();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Gs))){let{scroll:e}=this.root;e&&(X(t.x,e.offset.x),X(t.y,e.offset.y))}return t}removeElementScroll(e){let t=q();if(Z(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Z(t,e),X(t.x,i.offset.x),X(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||q();Z(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(X(r.x,-n.scroll.offset.x),X(r.y,-n.scroll.offset.y)),Y(n.latestValues)&&La(r,n.latestValues,n.layout?.layoutBox)}return Y(this.latestValues)&&La(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=q();Z(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Y(n.latestValues))continue;let r;n.instance&&(Ta(n.latestValues)&&n.updateSnapshot(),r=q(),Z(r,n.measurePageBox())),Bo(t,n.latestValues,n.snapshot?.layoutBox,r)}return Y(this.latestValues)&&Bo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==j.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=j.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=q(),this.targetWithTransforms=q()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Mo(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Z(this.target,this.layout.layoutBox),ja(this.target,this.targetDelta)):Z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),O.value&&ps.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Ta(this.parent.latestValues)||Ea(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=q(),this.relativeTargetOrigin=q(),Po(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Z(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===j.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Z(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Pa(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=q());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xo(this.prevProjectionDelta.x,this.projectionDelta.x),xo(this.prevProjectionDelta.y,this.projectionDelta.y)),Ao(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Jo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Jo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),O.value&&ps.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ta(),this.projectionDelta=ta(),this.projectionDeltaWithTransform=ta()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=ta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=q(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Rs));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;Fs(a.x,e.x,n),Fs(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Po(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ls(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&Wo(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=q(),Z(d,this.relativeTarget)),s&&(this.animationValues=i,es(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(A(this.pendingAnimation),void 0),this.pendingAnimation=k.update(()=>{fs.hasAnimatedSinceResize=!0,N.layout++,this.motionValue||=Nr(0),this.motionValue.jump(0,!1),this.currentAnimation=as(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{N.layout--},onComplete:()=>{N.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Ws(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||q();let t=Q(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Q(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Z(t,n),La(t,i),Ao(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ds),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&_s(`z`,e,r,this.animationValues);for(let t=0;t<ms.length;t++)_s(`rotate${ms[t]}`,e,r,this.animationValues),_s(`skew${ms[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=us(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=us(t?.pointerEvents)||``),this.hasProjected&&!Y(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Yo(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Ja){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Ja[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?us(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Ts),this.root.sharedNodes.clear()}}}function bs(e){e.updateLayout()}function xs(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)$(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Q(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;bo(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Ws(i,t.layoutBox,n)&&$(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Q(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=ta();Ao(o,n,t.layoutBox);let s=ta();a?Ao(s,e.applyTransform(r,!0),t.measuredBox):Ao(s,n,t.layoutBox);let c=!Ho(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=q();Po(s,t.layoutBox,i.layoutBox,o);let c=q();Po(c,n,a.layoutBox,o),Ko(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ss(e){O.value&&ps.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Cs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ws(e){e.clearSnapshot()}function Ts(e){e.clearMeasurements()}function Es(e){e.isLayoutDirty=!0,e.updateLayout()}function Ds(e){e.isLayoutDirty=!1}function Os(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ks(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function As(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function js(e){e.resolveTargetDelta()}function Ms(e){e.calcProjection()}function Ns(e){e.resetSkewAndRotation()}function Ps(e){e.removeLeadSnapshot()}function Fs(e,t,n){e.translate=B(t.translate,0,n),e.scale=B(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Is(e,t,n,r){e.min=B(t.min,n.min,r),e.max=B(t.max,n.max,r)}function Ls(e,t,n,r){Is(e.x,t.x,n.x,r),Is(e.y,t.y,n.y,r)}function Rs(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var zs={duration:.45,ease:[.4,0,.1,1]},Bs=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vs=Bs(`applewebkit/`)&&!Bs(`chrome/`)?Math.round:b;function Hs(e){e.min=Vs(e.min),e.max=Vs(e.max)}function Us(e){Hs(e.x),Hs(e.y)}function Ws(e,t,n){return e===`position`||e===`preserve-aspect`&&!Oo(qo(t),qo(n),.2)}function Gs(e){return e!==e.root&&e.scroll?.wasRoot}var Ks=ys({attachResizeListener:(e,t)=>os(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qs={current:void 0},Js=ys({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qs.current){let e=new Ks({});e.mount(window),e.setOptions({layoutScroll:!0}),qs.current=e}return qs.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Ys=(0,s.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Xs(e=!0){let t=(0,s.useContext)(d);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,s.useId)();(0,s.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,s.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Zs=(0,s.createContext)({strict:!1}),Qs={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`]},$s=!1;function ec(){if($s)return;let e={};for(let t in Qs)e[t]={isEnabled:e=>Qs[t].some(t=>!!e[t])};_a(e),$s=!0}function tc(){return ec(),va()}function nc(e){let t=tc();for(let n in e)t[n]={...t[n],...e[n]};_a(t)}var rc=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function ic(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||rc.has(e)}var ac=r({default:()=>oc}),oc,sc=n((()=>{throw oc={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),cc=e=>!ic(e);function lc(e){typeof e==`function`&&(cc=t=>t.startsWith(`on`)?!ic(t):e(t))}try{lc((sc(),t(ac)).default)}catch{}function uc(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||G(e[i])||(cc(i)||n===!0&&ic(i)||!t&&!ic(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var dc=(0,s.createContext)({});function fc(e,t){if(ca(e)){let{initial:t,animate:n}=e;return{initial:t===!1||aa(t)?t:void 0,animate:aa(n)?n:void 0}}return e.inherit===!1?{}:t}function pc(e){let{initial:t,animate:n}=fc(e,(0,s.useContext)(dc));return(0,s.useMemo)(()=>({initial:t,animate:n}),[mc(t),mc(n)])}function mc(e){return Array.isArray(e)?e.join(` `):e}var hc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gc(e,t,n){for(let r in t)!G(t[r])&&!Ya(r,n)&&(e[r]=t[r])}function _c({transformTemplate:e},t){return(0,s.useMemo)(()=>{let n=hc();return Ua(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vc(e,t){let n=e.style||{},r={};return gc(r,n,e),Object.assign(r,_c(e,t)),r}function yc(e,t){let n={},r=vc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var bc=()=>({...hc(),attrs:{}});function xc(e,t,n,r){let i=(0,s.useMemo)(()=>{let n=bc();return ro(n,t,ao(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};gc(t,e.style,e),i.style={...t,...i.style}}return i}var Sc=[`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 Cc(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Sc.indexOf(e)>-1||/[A-Z]/u.test(e))}function wc(e,t,n,{latestValues:r},i,a=!1,o){let c=(o??Cc(e)?xc:yc)(t,r,i,e),l=uc(t,typeof e==`string`,a),u=e===s.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,s.useMemo)(()=>G(d)?d.get():d,[d]);return(0,s.createElement)(e,{...u,children:f})}function Tc({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Ec(n,r,i,e),renderState:t()}}function Ec(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=us(a[e]);let{initial:o,animate:s}=e,c=ca(e),l=la(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!ia(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Dr(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Dc=e=>(t,n)=>{let r=(0,s.useContext)(dc),i=(0,s.useContext)(d),a=()=>Tc(e,t,r,i);return n?a():l(a)},Oc=Dc({scrapeMotionValuesFromProps:Xa,createRenderState:hc}),kc=Dc({scrapeMotionValuesFromProps:so,createRenderState:bc}),Ac=Symbol.for(`motionComponentSymbol`);function jc(e,t,n){let r=(0,s.useRef)(n);(0,s.useInsertionEffect)(()=>{r.current=n});let i=(0,s.useRef)(null);return(0,s.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var Mc=(0,s.createContext)({});function Nc(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Pc(e,t,n,r,i,a){let{visualElement:o}=(0,s.useContext)(dc),c=(0,s.useContext)(Zs),l=(0,s.useContext)(d),f=(0,s.useContext)(Ys),p=f.reducedMotion,m=f.skipAnimations,h=(0,s.useRef)(null),g=(0,s.useRef)(!1);r||=c.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:a}),g.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));let _=h.current,v=(0,s.useContext)(Mc);_&&!_.projection&&i&&(_.type===`html`||_.type===`svg`)&&Fc(h.current,n,i,v);let y=(0,s.useRef)(!1);(0,s.useInsertionEffect)(()=>{_&&y.current&&_.update(n,l)});let b=n[Vr],x=(0,s.useRef)(!!b&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return u(()=>{g.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),x.current&&_.animationState&&_.animationState.animateChanges())}),(0,s.useEffect)(()=>{_&&(!x.current&&_.animationState&&_.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),!1),_.enteringChildren=void 0)}),_}function Fc(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Ic(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Nc(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Ic(e){if(e)return e.options.allowProjection===!1?Ic(e.parent):e.projection}function Lc(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&nc(r);let a=n?n===`svg`:Cc(e),c=a?kc:Oc;function l(n,l){let u,d={...(0,s.useContext)(Ys),...n,layoutId:Rc(n)},{isStatic:f}=d,p=pc(n),m=c(n,f);if(!f&&typeof window<`u`){zc(d,r);let t=Bc(d);u=t.MeasureLayout,p.visualElement=Pc(e,m,d,i,t.ProjectionNode,a)}return(0,o.jsxs)(dc.Provider,{value:p,children:[u&&p.visualElement?(0,o.jsx)(u,{visualElement:p.visualElement,...d}):null,wc(e,n,jc(m,p.visualElement,l),m,f,t,a)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=(0,s.forwardRef)(l);return u[Ac]=e,u}function Rc({layoutId:e}){let t=(0,s.useContext)(c).id;return t&&e!==void 0?t+`-`+e:e}function zc(e,t){(0,s.useContext)(Zs).strict}function Bc(e){let{drag:t,layout:n}=tc();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Vc(e,t){if(typeof Proxy>`u`)return Lc;let n=new Map,r=(n,r)=>Lc(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Lc(a,void 0,e,t)),n.get(a))})}var Hc=(e,t)=>t.isSVG??Cc(e)?new co(t):new Qa(t,{allowProjection:e!==s.Fragment}),Uc=class extends J{constructor(e){super(e),e.animationState||=go(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ia(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Wc=0,Gc={animation:{Feature:Uc},exit:{Feature:class extends J{constructor(){super(...arguments),this.id=Wc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=W(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Kc(e){return{point:{x:e.pageX,y:e.pageY}}}var qc=e=>t=>wi(t)&&e(t,Kc(t));function Jc(e,t,n,r){return os(e,t,qc(n),r)}var Yc=({current:e})=>e?e.ownerDocument.defaultView:null,Xc=(e,t)=>Math.abs(e-t);function Zc(e,t){let n=Xc(e.x,t.x),r=Xc(e.y,t.y);return Math.sqrt(n**2+r**2)}var Qc=new Set([`auto`,`scroll`]),$c=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=el(this.lastRawMoveEventInfo,this.transformPagePoint));let e=nl(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Zc(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=j;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=el(t,this.transformPagePoint),k.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=nl(e.type===`pointercancel`?this.lastMoveEventInfo:el(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!wi(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=el(Kc(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=j;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,nl(s,this.history)),this.removeListeners=S(Jc(this.contextWindow,`pointermove`,this.handlePointerMove),Jc(this.contextWindow,`pointerup`,this.handlePointerUp),Jc(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Qc.has(e.overflowX)||Qc.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),k.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),A(this.updatePoint)}};function el(e,t){return t?{point:t(e.point)}:e}function tl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nl({point:e},t){return{point:e,delta:tl(e,il(t)),offset:tl(e,rl(t)),velocity:al(t,.1)}}function rl(e){return e[0]}function il(e){return e[e.length-1]}function al(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=il(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>T(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>T(t)*2&&(r=e[1]);let a=E(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ol(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?B(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?B(n,e,r.max):Math.min(e,n)),e}function sl(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function cl(e,{top:t,left:n,bottom:r,right:i}){return{x:sl(e.x,n,i),y:sl(e.y,t,r)}}function ll(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ul(e,t){return{x:ll(e.x,t.x),y:ll(e.y,t.y)}}function dl(e,t){let n=.5,r=Q(e),i=Q(t);return i>r?n=C(t.min,t.max-r,e.min):r>i&&(n=C(e.min,e.max-i,t.min)),m(0,1,n)}function fl(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var pl=.35;function ml(e=pl){return e===!1?e=0:e===!0&&(e=pl),{x:hl(e,`left`,`right`),y:hl(e,`top`,`bottom`)}}function hl(e,t,n){return{min:gl(e,t),max:gl(e,n)}}function gl(e,t){return typeof e==`number`?e:e[t]||0}var _l=new WeakMap,vl=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=q(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Kc(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yi(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$(e=>{let t=this.getAxisMotionValue(e).get()||0;if(I.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Q(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&k.update(()=>i(e,t),!1,!0),zr(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Sl(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&k.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new $c(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Yc(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&k.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!xl(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=ol(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Nc(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=cl(n.layoutBox,e):this.constraints=!1,this.elastic=ml(t),r!==this.constraints&&!Nc(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&$(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=fl(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Nc(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=za(n,r.root,this.visualElement.getTransformPagePoint()),a=ul(r.layout.layoutBox,i);if(t){let e=t(Sa(a));this.hasMutatedConstraints=!!e,e&&(a=xa(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=$(o=>{if(!xl(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return zr(this.visualElement,e),n.start(Tr(e,n,0,t,this.visualElement,!1))}stopAnimation(){$(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){$(t=>{let{drag:n}=this.getProps();if(!xl(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-B(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Nc(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};$(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=dl({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),$(t=>{if(!xl(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(B(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_l.set(this.visualElement,this);let e=this.visualElement.current,t=Jc(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Oi(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Nc(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=bl(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),k.read(r);let o=os(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=pl,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function yl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function bl(e,t,n){let r=Xi(e,yl(n)),i=Xi(t,yl(n));return()=>{r(),i()}}function xl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sl(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Cl=class extends J{constructor(e){super(e),this.removeGroupControls=b,this.removeListeners=b,this.controls=new vl(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||b}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},wl=e=>(t,n)=>{e&&k.update(()=>e(t,n),!1,!0)},Tl=class extends J{constructor(){super(...arguments),this.removePointerDownListener=b}onPointerDown(e){this.session=new $c(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yc(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:wl(e),onStart:wl(t),onMove:wl(n),onEnd:(e,t)=>{delete this.session,r&&k.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Jc(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},El=!1,Dl=class extends s.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),El&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),fs.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),El=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||k.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),gi.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;El=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ol(e){let[t,n]=Xs(),r=(0,s.useContext)(c);return(0,o.jsx)(Dl,{...e,layoutGroup:r,switchLayoutGroup:(0,s.useContext)(Mc),isPresent:t,safeToRemove:n})}var kl={pan:{Feature:Tl},drag:{Feature:Cl,ProjectionNode:Js,MeasureLayout:Ol}};function Al(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&k.postRender(()=>i(t,Kc(t)))}var jl=class extends J{mount(){let{current:e}=this.node;e&&(this.unmount=Si(e,(e,t)=>(Al(this.node,t,`Start`),e=>Al(this.node,e,`End`))))}unmount(){}},Ml=class extends J{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=S(os(this.node.current,`focus`,()=>this.onFocus()),os(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Nl(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&k.postRender(()=>i(t,Kc(t)))}var Pl=class extends J{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Fi(e,(e,t)=>(Nl(this.node,t,`Start`),(e,{success:t})=>Nl(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Fl=new WeakMap,Il=new WeakMap,Ll=e=>{let t=Fl.get(e.target);t&&t(e)},Rl=e=>{e.forEach(Ll)};function zl({root:e,...t}){let n=e||document;Il.has(n)||Il.set(n,{});let r=Il.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Rl,{root:e,...t})),r[i]}function Bl(e,t,n){let r=zl(t);return Fl.set(e,n),r.observe(e),()=>{Fl.delete(e),r.unobserve(e)}}var Vl={some:0,all:1},Hl=class extends J{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Vl[r]};this.stopObserver=Bl(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Ul(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ul({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Wl={inView:{Feature:Hl},tap:{Feature:Pl},focus:{Feature:Ml},hover:{Feature:jl}},Gl={layout:{ProjectionNode:Js,MeasureLayout:Ol}},Kl=Vc({...Gc,...Wl,...kl,...Gl},Hc);export{ma as a,hi as c,u as d,l as f,Ys as i,xr as l,lc as n,fa as o,c as p,Xs as r,da as s,Kl as t,d as u};
@@ -1 +0,0 @@
1
- import{C as e,D as t,E as n,S as r,T as i,_ as a,at as o,b as s,et as c,g as l,h as u,v as d,w as f,x as p,y as m}from"./vendor-ui-CWUk2ulb.js";import{E as h}from"./format-B9CcV2dj.js";import{n as g,t as _}from"./utils-XFKvwlFT.js";var v=g(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),y=o(),b=t;function x({className:e,...t}){return(0,y.jsx)(l,{"data-slot":`select-group`,className:_(`scroll-my-1 p-1`,e),...t})}function S({className:e,...t}){return(0,y.jsx)(i,{"data-slot":`select-value`,className:_(`flex flex-1 text-left`,e),...t})}function C({className:e,size:t=`default`,children:r,...i}){return(0,y.jsxs)(n,{"data-slot":`select-trigger`,"data-size":t,className:_(`flex w-fit min-w-0 items-center justify-between gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none hover:bg-input/50 focus-visible:border-primary/35 focus-visible:ring-2 focus-visible:ring-primary/22 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[var(--miravo-radius-stadium-sm)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...i,children:[r,(0,y.jsx)(f,{render:(0,y.jsx)(v,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function w({className:t,children:n,side:i=`bottom`,sideOffset:a=6,align:o=`center`,alignOffset:c=0,alignItemWithTrigger:l=!1,...u}){return(0,y.jsx)(e,{children:(0,y.jsx)(r,{side:i,sideOffset:a,align:o,alignOffset:c,alignItemWithTrigger:l,className:`isolate z-50`,children:(0,y.jsx)(p,{"data-slot":`select-content`,"data-align-trigger":l,className:_(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--miravo-radius-tight)] bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:data-open:duration-0 motion-reduce:data-closed:duration-0`,t),...u,children:(0,y.jsx)(s,{children:n})})})})}function T({className:e,...t}){return(0,y.jsx)(u,{"data-slot":`select-label`,className:_(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}var E=`relative flex w-full cursor-pointer items-center gap-1.5 rounded-[var(--miravo-radius-tight)] py-1 pr-8 pl-1.5 text-xs text-muted-foreground outline-hidden select-none data-[highlighted]:bg-sidebar-accent data-[highlighted]:text-sidebar-accent-foreground not-data-[variant=destructive]:data-[highlighted]:**:text-sidebar-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`;function D({className:e,children:t,...n}){return(0,y.jsxs)(m,{"data-slot":`select-item`,className:_(E,e),...n,children:[(0,y.jsx)(a,{"data-slot":`select-item-text`,className:`flex min-w-0 flex-1 gap-2 whitespace-nowrap`,children:t}),(0,y.jsx)(d,{render:(0,y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,y.jsx)(h,{className:`pointer-events-none`})})]})}function O({className:e,...t}){return(0,y.jsx)(c,{"data-slot":`select-separator`,className:_(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}export{T as a,S as c,D as i,v as l,w as n,O as o,x as r,C as s,b as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";var n=e(t(),1),r=e=>Symbol.iterator in e,i=e=>`entries`in e,a=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},o=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function s(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:r(e)&&r(t)?i(e)&&i(t)?a(e,t):o(e,t):a({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function c(e){let t=n.useRef(void 0);return n=>{let r=e(n);return s(t.current,r)?t.current:t.current=r}}export{c as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{t as r}from"./utils-XFKvwlFT.js";import{t as i}from"./checkbox-C84IyqEB.js";import{t as a}from"./label-DTHSKF2S.js";var o=e(t(),1),s=n(),c=[{value:`mqtt`,label:`MQTT`},{value:`opcua`,label:`OPC UA`},{value:`modbus`,label:`Modbus`}];function l({value:e,onChange:t,className:n}){let l=(0,o.useId)(),u=new Set(e);return(0,s.jsxs)(`fieldset`,{className:r(`min-w-0`,n),children:[(0,s.jsx)(`legend`,{className:`mb-2 text-xs font-medium text-foreground`,children:`Protocol exposure`}),(0,s.jsx)(`div`,{className:`grid min-w-0 gap-2 sm:grid-cols-3`,children:c.map(n=>(0,s.jsxs)(a,{htmlFor:`${l}-${n.value}`,className:`min-w-0 rounded-[var(--miravo-radius-tight)] border border-border/80 px-2.5 py-2 text-xs`,children:[(0,s.jsx)(i,{id:`${l}-${n.value}`,checked:u.has(n.value),onCheckedChange:r=>{let i=e.filter(e=>e!==n.value);r===!0&&i.push(n.value),t(i)}}),(0,s.jsx)(`span`,{children:n.label})]},n.value))}),(0,s.jsx)(`p`,{className:`mt-2 text-[11px] text-muted-foreground`,children:e.length>0?`${e.length} selected`:`Default: enabled adapters`})]})}export{l as t};