@lunora/studio 1.0.0-alpha.95 → 1.0.0-alpha.97

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 (160) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/mount.js +1 -1
  3. package/dist/packem_chunks/AdvisorHealthPanel.js +1 -1
  4. package/dist/packem_chunks/AuditPanel.js +1 -1
  5. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -1
  6. package/dist/packem_chunks/ExportImportPanel.js +1 -1
  7. package/dist/packem_chunks/FileBrowser.js +1 -1
  8. package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
  9. package/dist/packem_chunks/HealthPanel.js +1 -1
  10. package/dist/packem_chunks/InsightsPanel.js +1 -1
  11. package/dist/packem_chunks/LogsPanel.js +1 -1
  12. package/dist/packem_chunks/MailPanel.js +1 -1
  13. package/dist/packem_chunks/MetricsPanel.js +1 -1
  14. package/dist/packem_chunks/NotificationsPanel.js +1 -1
  15. package/dist/packem_chunks/SchemaViewer.js +1 -1
  16. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
  17. package/dist/packem_chunks/SettingsPanel.js +1 -1
  18. package/dist/packem_chunks/SqlEditorPanel.js +6 -6
  19. package/dist/packem_chunks/TableEditor.js +1 -1
  20. package/dist/packem_chunks/agents-panel.js +1 -1
  21. package/dist/packem_chunks/analytics-panel.js +1 -1
  22. package/dist/packem_chunks/auth-audit-panel.js +1 -1
  23. package/dist/packem_chunks/auth-config-panel.js +1 -1
  24. package/dist/packem_chunks/auth-sessions-panel.js +1 -1
  25. package/dist/packem_chunks/containers-panel.js +1 -1
  26. package/dist/packem_chunks/dashboards-panel.js +1 -1
  27. package/dist/packem_chunks/fanout-panel.js +1 -1
  28. package/dist/packem_chunks/flags-panel.js +1 -1
  29. package/dist/packem_chunks/issues-panel.js +1 -1
  30. package/dist/packem_chunks/kv-browser.js +1 -1
  31. package/dist/packem_chunks/log-drains-panel.js +2 -2
  32. package/dist/packem_chunks/migrations-route.js +1 -1
  33. package/dist/packem_chunks/organizations-panel.js +1 -1
  34. package/dist/packem_chunks/payments-panel.js +1 -1
  35. package/dist/packem_chunks/permissions-panel.js +1 -1
  36. package/dist/packem_chunks/queues-panel.js +1 -1
  37. package/dist/packem_chunks/rls-panel.js +1 -1
  38. package/dist/packem_chunks/schedule-panel.js +1 -1
  39. package/dist/packem_chunks/sparkline.js +1 -1
  40. package/dist/packem_chunks/storage-rules-panel.js +1 -1
  41. package/dist/packem_chunks/subscriptions-panel.js +1 -1
  42. package/dist/packem_chunks/sync-client-panel.js +1 -1
  43. package/dist/packem_chunks/traces-panel.js +1 -1
  44. package/dist/packem_chunks/users-panel.js +1 -1
  45. package/dist/packem_chunks/vector-browser.js +1 -1
  46. package/dist/packem_chunks/workflows-panel.js +1 -1
  47. package/dist/packem_shared/{DataBrowser-H4oUFkPJ.js → DataBrowser-CPNKM0KZ.js} +1 -1
  48. package/dist/packem_shared/{GlobalDataBrowser-CeA8bDjX.js → GlobalDataBrowser-BSmyOO0n.js} +1 -1
  49. package/dist/packem_shared/{HomePanel-DLP1nQdC.js → HomePanel-BUO6BcYQ.js} +1 -1
  50. package/dist/packem_shared/{MigrationsPanel-dm_M75mR.js → MigrationsPanel-BAnvY79E.js} +1 -1
  51. package/dist/packem_shared/{ScheduledJobs-DDJG9Je7.js → ScheduledJobs-pHVlh2xU.js} +1 -1
  52. package/dist/packem_shared/{Studio-BYg65qWq.js → Studio-DG_n-8Pc.js} +1 -1
  53. package/dist/packem_shared/{StudioApp-D0UOg0a_.js → StudioApp-bavavhpe.js} +1 -1
  54. package/dist/packem_shared/advisor-view-CGcwvlMo.js +1 -0
  55. package/dist/packem_shared/bar-chart-B8oDHgnw.js +6 -0
  56. package/dist/packem_shared/{card-CIDGUN6K.js → card-BMKx5UdA.js} +1 -1
  57. package/dist/packem_shared/{dropdown-menu-C3RQ_HlW.js → dropdown-menu-BgS2zw1i.js} +1 -1
  58. package/dist/packem_shared/error-alert-_2q2VtVG.js +1 -0
  59. package/dist/packem_shared/{grid-features-Db_BNYRo.js → grid-features-Y2YSjhCf.js} +2 -2
  60. package/dist/packem_shared/home-panel-Ir3YHReO.js +3 -0
  61. package/dist/packem_shared/result-chart-0VgP_3FP.js +1 -0
  62. package/dist/packem_shared/schema-diagram-GVgnLWTf.js +2 -0
  63. package/dist/packem_shared/{select-Bul-DeII.js → select-BssZMiFY.js} +1 -1
  64. package/dist/packem_shared/{sparkline-CgjeUU2I.js → sparkline-BNvxiJj_.js} +1 -1
  65. package/dist/packem_shared/{stat-card-fm_TF1mo.js → stat-card-BGJdhfm6.js} +1 -1
  66. package/dist/packem_shared/studio-C9Qvg13j.js +2 -0
  67. package/dist/packem_shared/{table-DdJBrClo.js → table-DZAB8cs3.js} +1 -1
  68. package/dist/packem_shared/{trace-handoff-Dw7mwjxu.js → trace-handoff-CuZ6WGgo.js} +1 -1
  69. package/dist/packem_shared/use-async-submit-B32whHJO.js +1 -0
  70. package/dist/standalone/{chunk-BN4CIAXU.js → chunk-2KRXOCZ2.js} +1 -1
  71. package/dist/standalone/{chunk-D62SDRMM.js → chunk-3626PHEZ.js} +1 -1
  72. package/dist/standalone/{chunk-TITX6XEA.js → chunk-3IF75YS7.js} +1 -1
  73. package/dist/standalone/chunk-3SCGCJYS.js +1 -0
  74. package/dist/standalone/{chunk-2OUIHY7G.js → chunk-3SGYSFRC.js} +1 -1
  75. package/dist/standalone/{chunk-7YJNH3RB.js → chunk-4EHNOASW.js} +1 -1
  76. package/dist/standalone/{chunk-YD5O2NWK.js → chunk-5A7NIX77.js} +1 -1
  77. package/dist/standalone/{chunk-UIGAA3GV.js → chunk-5L2VKBAJ.js} +1 -1
  78. package/dist/standalone/{chunk-NNKN2XEZ.js → chunk-5L63KFHD.js} +1 -1
  79. package/dist/standalone/{chunk-ZNAGZU6H.js → chunk-6F7KP54M.js} +1 -1
  80. package/dist/standalone/{chunk-3FIN5PH4.js → chunk-6V27P65N.js} +2 -2
  81. package/dist/standalone/{chunk-2T22UR7E.js → chunk-73B3T2SA.js} +1 -1
  82. package/dist/standalone/chunk-7CWPU3LW.js +1 -0
  83. package/dist/standalone/{chunk-PE7TI4TQ.js → chunk-A6NAMYVS.js} +1 -1
  84. package/dist/standalone/{chunk-RNOSWEMO.js → chunk-AB5WGAX6.js} +2 -2
  85. package/dist/standalone/{chunk-IBVBIKUI.js → chunk-ATLV7KWK.js} +1 -1
  86. package/dist/standalone/{chunk-IUUSMC2R.js → chunk-BLHSTFG3.js} +1 -1
  87. package/dist/standalone/chunk-C2ZFQARQ.js +11 -0
  88. package/dist/standalone/chunk-CXBXUT5A.js +3 -0
  89. package/dist/standalone/chunk-CZZWYUTR.js +1 -0
  90. package/dist/standalone/{chunk-LZKU262J.js → chunk-D264UAKY.js} +1 -1
  91. package/dist/standalone/{chunk-VVNQP4CI.js → chunk-DDO5EGID.js} +1 -1
  92. package/dist/standalone/{chunk-DMJDUC4L.js → chunk-E3Z4QXAD.js} +1 -1
  93. package/dist/standalone/{chunk-WI4XINU2.js → chunk-EZKBI7SZ.js} +1 -1
  94. package/dist/standalone/{chunk-BNAMPDZ2.js → chunk-FHZ5WDTU.js} +1 -1
  95. package/dist/standalone/{chunk-TMNKNTC4.js → chunk-FXBBFE7Y.js} +1 -1
  96. package/dist/standalone/{chunk-JYLYJT27.js → chunk-G2O3XP7Y.js} +5 -5
  97. package/dist/standalone/{chunk-SCKKQIAE.js → chunk-H5ZYPSLB.js} +1 -1
  98. package/dist/standalone/{chunk-Z4AX76YZ.js → chunk-HH5CZ6KD.js} +1 -1
  99. package/dist/standalone/{chunk-UGU5GYDV.js → chunk-I7V54EDS.js} +1 -1
  100. package/dist/standalone/{chunk-6K46XGR5.js → chunk-II64XEZV.js} +1 -1
  101. package/dist/standalone/{chunk-U6KDYJJC.js → chunk-IZFPJXB3.js} +1 -1
  102. package/dist/standalone/{chunk-QNHU4SKL.js → chunk-J4UYSDWF.js} +1 -1
  103. package/dist/standalone/{chunk-JWXKUXYA.js → chunk-JNY7CFF4.js} +1 -1
  104. package/dist/standalone/{chunk-DYMO6MDG.js → chunk-KP6VHTO4.js} +1 -1
  105. package/dist/standalone/{chunk-SKYFKPJC.js → chunk-LAEO6D34.js} +1 -1
  106. package/dist/standalone/{chunk-VNQB6HY4.js → chunk-LHAHIDNT.js} +1 -1
  107. package/dist/standalone/{chunk-4LCY5XUR.js → chunk-M2M3RYJU.js} +1 -1
  108. package/dist/standalone/{chunk-3KXDX76D.js → chunk-M3Z2YAHD.js} +1 -1
  109. package/dist/standalone/{chunk-YTWBHPAT.js → chunk-MW5YIENZ.js} +1 -1
  110. package/dist/standalone/chunk-NBANYYGB.js +1 -0
  111. package/dist/standalone/{chunk-465RIA2L.js → chunk-NCKRVNF2.js} +1 -1
  112. package/dist/standalone/{chunk-A3DBEJLO.js → chunk-NDO6YSEG.js} +1 -1
  113. package/dist/standalone/{chunk-O3UMJLO3.js → chunk-NJRW66LJ.js} +1 -1
  114. package/dist/standalone/{chunk-AQ4JNJF3.js → chunk-OKZP3YY3.js} +1 -1
  115. package/dist/standalone/{chunk-2O65JEMI.js → chunk-ON2FIVI2.js} +1 -1
  116. package/dist/standalone/chunk-OQIGV6FX.js +59 -0
  117. package/dist/standalone/{chunk-QXECM52Z.js → chunk-OZA2RA45.js} +1 -1
  118. package/dist/standalone/{chunk-XNGYYOLS.js → chunk-P33WK7YI.js} +4 -4
  119. package/dist/standalone/{chunk-KEVIGWKP.js → chunk-PKWJ7UOG.js} +1 -1
  120. package/dist/standalone/chunk-PLFTCTMX.js +1 -0
  121. package/dist/standalone/{chunk-7ONX5YGW.js → chunk-PMGTIUU2.js} +1 -1
  122. package/dist/standalone/{chunk-ABYJC3LS.js → chunk-QC4T2L6I.js} +1 -1
  123. package/dist/standalone/{chunk-3DJ3IUUG.js → chunk-QEVFPILV.js} +1 -1
  124. package/dist/standalone/{chunk-PGVJE5F5.js → chunk-QQYX5WN4.js} +1 -1
  125. package/dist/standalone/{chunk-G6GX5TVB.js → chunk-S7ZOM3NK.js} +1 -1
  126. package/dist/standalone/{chunk-M7AWSDGY.js → chunk-SPE3AB54.js} +1 -1
  127. package/dist/standalone/{chunk-OM36OEHZ.js → chunk-STESBRLN.js} +1 -1
  128. package/dist/standalone/{chunk-QM4EXWKF.js → chunk-SZXVX6PY.js} +1 -1
  129. package/dist/standalone/{chunk-EQZTSISX.js → chunk-TMGHRD6W.js} +1 -1
  130. package/dist/standalone/{chunk-ZA5YIHZM.js → chunk-UYPXC3OO.js} +1 -1
  131. package/dist/standalone/{chunk-ZVAGD3FT.js → chunk-VH2IO643.js} +1 -1
  132. package/dist/standalone/{chunk-5TDGHWYU.js → chunk-WLXH4ECM.js} +1 -1
  133. package/dist/standalone/{chunk-UZERI5YC.js → chunk-WQH3LT2P.js} +1 -1
  134. package/dist/standalone/{chunk-DBMFI2HC.js → chunk-XPOUF2XH.js} +1 -1
  135. package/dist/standalone/{chunk-JEZDJ7D6.js → chunk-YP7WZ6YM.js} +1 -1
  136. package/dist/standalone/chunk-YZIR7PL5.js +1 -0
  137. package/dist/standalone/studio.js +1 -1
  138. package/dist/styles.css +1 -1
  139. package/package.json +6 -6
  140. package/dist/packem_shared/advisor-view-Coipc04R.js +0 -1
  141. package/dist/packem_shared/bar-chart-DraN_srt.js +0 -9
  142. package/dist/packem_shared/error-alert--Ie7ofJ0.js +0 -1
  143. package/dist/packem_shared/home-panel-BtxdqXDe.js +0 -3
  144. package/dist/packem_shared/result-chart-Gywg9DOk.js +0 -1
  145. package/dist/packem_shared/schema-diagram-DTRaCp6Y.js +0 -2
  146. package/dist/packem_shared/studio-Drf4en3j.js +0 -2
  147. package/dist/packem_shared/use-async-submit-BFIMhRqh.js +0 -1
  148. package/dist/standalone/chunk-5KCULF7S.js +0 -11
  149. package/dist/standalone/chunk-GZMKPBTJ.js +0 -1
  150. package/dist/standalone/chunk-ILNELDFC.js +0 -1
  151. package/dist/standalone/chunk-MV4A2PAK.js +0 -1
  152. package/dist/standalone/chunk-Q2Q7FR3R.js +0 -1
  153. package/dist/standalone/chunk-S3DWUXGY.js +0 -62
  154. package/dist/standalone/chunk-UBIPFCOZ.js +0 -1
  155. package/dist/standalone/chunk-ZQPWVALL.js +0 -3
  156. package/dist/standalone/chunk-ZZJ7VUVZ.js +0 -1
  157. /package/dist/standalone/{chunk-7H7LZRLP.js → chunk-4KIQ5RLS.js} +0 -0
  158. /package/dist/standalone/{chunk-UU2QJMGJ.js → chunk-MKYEFQCA.js} +0 -0
  159. /package/dist/standalone/{chunk-KUVMORDQ.js → chunk-PKSAWP56.js} +0 -0
  160. /package/dist/standalone/{chunk-MIQTKZAR.js → chunk-WJQLNYGX.js} +0 -0
@@ -0,0 +1 @@
1
+ import{a as i,b as un,e as F,f as G,h as mn}from"./chunk-3XIESWL4.js";function zt(t,e){t.indexOf(e)===-1&&t.push(e)}i(zt,"addUniqueItem");function Mt(t,e){let o=t.indexOf(e);o>-1&&t.splice(o,1)}i(Mt,"removeItem");var U=i((t,e,o)=>o>e?e:o<t?t:o,"clamp");var vt=i(()=>{},"warning"),ot=i(()=>{},"invariant");var X={};var Be=i(t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),"isNumericalString");var Ie=i(t=>typeof t=="object"&&t!==null,"isObject");var Fe=i(t=>/^0[^.\s]+$/u.test(t),"isZeroValueString");function Oe(t){let e;return()=>(e===void 0&&(e=t()),e)}i(Oe,"memo");var k=i(t=>t,"noop");var lt=i((...t)=>t.reduce((e,o)=>r=>o(e(r))),"pipe");var ft=i((t,e,o)=>{let r=e-t;return r?(o-t)/r:1},"progress");var Tt=class{static{i(this,"SubscriptionManager")}constructor(){this.subscriptions=[]}add(e){return zt(this.subscriptions,e),()=>Mt(this.subscriptions,e)}notify(e,o,r){let n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](e,o,r);else for(let a=0;a<n;a++){let s=this.subscriptions[a];s&&s(e,o,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var j=i(t=>t*1e3,"secondsToMilliseconds"),H=i(t=>t/1e3,"millisecondsToSeconds");var je=i((t,e)=>e?t*(1e3/e):0,"velocityPerSecond");var fn=i((t,e,o)=>(((1-3*o+3*e)*t+(3*o-6*e))*t+3*e)*t,"calcBezier"),Vl=1e-7,Sl=12;function Pl(t,e,o,r,n){let a,s,l=0;do s=e+(o-e)/2,a=fn(s,r,n)-t,a>0?o=s:e=s;while(Math.abs(a)>Vl&&++l<Sl);return s}i(Pl,"binarySubdivide");function Ct(t,e,o,r){if(t===e&&o===r)return k;let n=i(a=>Pl(a,0,1,t,o),"getTForX");return a=>a===0||a===1?a:fn(n(a),e,r)}i(Ct,"cubicBezier");var bo=i(t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,"mirrorEasing");var wo=i(t=>e=>1-t(1-e),"reverseEasing");var Ao=Ct(.33,1.53,.69,.99),me=wo(Ao),Ne=bo(me);var Ge=i(t=>t>=1?1:(t*=2)<1?.5*me(t):.5*(2-Math.pow(2,-10*(t-1))),"anticipate");var We=i(t=>1-Math.sin(Math.acos(t)),"circIn"),Ue=wo(We),Ke=bo(We);var _r=Ct(.42,0,1,1),Yr=Ct(0,0,.58,1),ze=Ct(.42,0,.58,1);var Xr=i(t=>Array.isArray(t)&&typeof t[0]!="number","isEasingArray");var He=i(t=>Array.isArray(t)&&typeof t[0]=="number","isBezierDefinition");var pn={linear:k,easeIn:_r,easeInOut:ze,easeOut:Yr,circIn:We,circInOut:Ke,circOut:Ue,backIn:me,backInOut:Ne,backOut:Ao,anticipate:Ge},bl=i(t=>typeof t=="string","isValidEasing"),Mo=i(t=>{if(He(t)){ot(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,o,r,n]=t;return Ct(e,o,r,n)}else if(bl(t))return ot(pn[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),pn[t];return t},"easingDefinitionToFunction");var $e=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hn(t){let e=new Set,o=new Set,r=!1,n=!1,a=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function l(c){a.has(c)&&(u.schedule(c),t()),c(s)}i(l,"triggerCallback");let u={schedule:i((c,m=!1,f=!1)=>{let d=f&&r?e:o;return m&&a.add(c),d.add(c),c},"schedule"),cancel:i(c=>{o.delete(c),a.delete(c)},"cancel"),process:i(c=>{if(s=c,r){n=!0;return}r=!0;let m=e;e=o,o=m,e.forEach(l),e.clear(),r=!1,n&&(n=!1,u.process(c))},"process")};return u}i(hn,"createRenderStep");var wl=40;function Co(t,e){let o=!1,r=!0,n={delta:0,timestamp:0,isProcessing:!1},a=i(()=>o=!0,"flagRunNextFrame"),s=$e.reduce((T,S)=>(T[S]=hn(a),T),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:m,update:f,preRender:p,render:d,postRender:h}=s,g=i(()=>{let T=X.useManualTiming,S=T?n.timestamp:performance.now();o=!1,T||(n.delta=r?1e3/60:Math.max(Math.min(S-n.timestamp,wl),1)),n.timestamp=S,n.isProcessing=!0,l.process(n),u.process(n),c.process(n),m.process(n),f.process(n),p.process(n),d.process(n),h.process(n),n.isProcessing=!1,o&&e&&(r=!1,t(g))},"processBatch"),x=i(()=>{o=!0,r=!0,n.isProcessing||t(g)},"wake");return{schedule:$e.reduce((T,S)=>{let M=s[S];return T[S]=(E,D=!1,b=!1)=>(o||x(),M.schedule(E,D,b)),T},{}),cancel:i(T=>{for(let S=0;S<$e.length;S++)s[$e[S]].cancel(T)},"cancel"),state:n,steps:s}}i(Co,"createRenderBatcher");var{schedule:w,cancel:J,state:O,steps:_e}=Co(typeof requestAnimationFrame<"u"?requestAnimationFrame:k,!0);var Do;function Al(){Do=void 0}i(Al,"clearTime");var B={now:i(()=>(Do===void 0&&B.set(O.isProcessing||X.useManualTiming?O.timestamp:performance.now()),Do),"now"),set:i(t=>{Do=t,queueMicrotask(Al)},"set")};var dn=i(t=>e=>typeof e=="string"&&e.startsWith(t),"checkStringStartsWith"),Eo=dn("--"),Ml=dn("var(--"),fe=i(t=>Ml(t)?Cl.test(t.split("/*")[0].trim()):!1,"isCSSVariableToken"),Cl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function qr(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}i(qr,"containsCSSVariable");var pt={test:i(t=>typeof t=="number","test"),parse:parseFloat,transform:i(t=>t,"transform")},Vt={...pt,transform:i(t=>U(0,1,t),"transform")},Ye={...pt,default:1};var Dt=i(t=>Math.round(t*1e5)/1e5,"sanitize");var pe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function gn(t){return t==null}i(gn,"isNullish");var xn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var he=i((t,e)=>o=>!!(typeof o=="string"&&xn.test(o)&&o.startsWith(t)||e&&!gn(o)&&Object.prototype.hasOwnProperty.call(o,e)),"isColorString"),Ro=i((t,e,o)=>r=>{if(typeof r!="string")return r;let[n,a,s,l]=r.match(pe);return{[t]:parseFloat(n),[e]:parseFloat(a),[o]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},"splitColor");var Dl=i(t=>U(0,255,t),"clampRgbUnit"),Zr={...pt,transform:i(t=>Math.round(Dl(t)),"transform")},ht={test:he("rgb","red"),parse:Ro("red","green","blue"),transform:i(({red:t,green:e,blue:o,alpha:r=1})=>"rgba("+Zr.transform(t)+", "+Zr.transform(e)+", "+Zr.transform(o)+", "+Dt(Vt.transform(r))+")","transform")};function El(t){let e="",o="",r="",n="";return t.length>5?(e=t.substring(1,3),o=t.substring(3,5),r=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),o=t.substring(2,3),r=t.substring(3,4),n=t.substring(4,5),e+=e,o+=o,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(o,16),blue:parseInt(r,16),alpha:n?parseInt(n,16)/255:1}}i(El,"parseHex");var Xe={test:he("#"),parse:El,transform:ht.transform};var qe=i(t=>({test:i(e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,"test"),parse:parseFloat,transform:i(e=>`${e}${t}`,"transform")}),"createUnitType"),rt=qe("deg"),Y=qe("%"),v=qe("px"),Jr=qe("vh"),Qr=qe("vw"),Lo={...Y,parse:i(t=>Y.parse(t)/100,"parse"),transform:i(t=>Y.transform(t*100),"transform")};var Et={test:he("hsl","hue"),parse:Ro("hue","saturation","lightness"),transform:i(({hue:t,saturation:e,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+Y.transform(Dt(e))+", "+Y.transform(Dt(o))+", "+Dt(Vt.transform(r))+")","transform")};var R={test:i(t=>ht.test(t)||Xe.test(t)||Et.test(t),"test"),parse:i(t=>ht.test(t)?ht.parse(t):Et.test(t)?Et.parse(t):Xe.parse(t),"parse"),transform:i(t=>typeof t=="string"?t:t.hasOwnProperty("red")?ht.transform(t):Et.transform(t),"transform"),getAnimatableNone:i(t=>{let e=R.parse(t);return e.alpha=0,R.transform(e)},"getAnimatableNone")};var yn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rl(t){return isNaN(t)&&typeof t=="string"&&(t.match(pe)?.length||0)+(t.match(yn)?.length||0)>0}i(Rl,"test");var Tn="number",Vn="color",Ll="var",kl="var(",vn="${}",Bl=/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 Rt(t){let e=t.toString(),o=[],r={color:[],number:[],var:[]},n=[],a=0,l=e.replace(Bl,u=>(R.test(u)?(r.color.push(a),n.push(Vn),o.push(R.parse(u))):u.startsWith(kl)?(r.var.push(a),n.push(Ll),o.push(u)):(r.number.push(a),n.push(Tn),o.push(parseFloat(u))),++a,vn)).split(vn);return{values:o,split:l,indexes:r,types:n}}i(Rt,"analyseComplexValue");function Il(t){return Rt(t).values}i(Il,"parseComplexValue");function Sn({split:t,types:e}){let o=t.length;return r=>{let n="";for(let a=0;a<o;a++)if(n+=t[a],r[a]!==void 0){let s=e[a];s===Tn?n+=Dt(r[a]):s===Vn?n+=R.transform(r[a]):n+=r[a]}return n}}i(Sn,"buildTransformer");function Fl(t){return Sn(Rt(t))}i(Fl,"createTransformer");var Ol=i(t=>typeof t=="number"?0:R.test(t)?R.getAnimatableNone(t):t,"convertNumbersToZero"),jl=i((t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:Ol(t),"convertToZero");function Nl(t){let e=Rt(t);return Sn(e)(e.values.map((r,n)=>jl(r,e.split[n])))}i(Nl,"getAnimatableNone");var K={test:Rl,parse:Il,createTransformer:Fl,getAnimatableNone:Nl};function ti(t,e,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(e-t)*6*o:o<1/2?e:o<2/3?t+(e-t)*(2/3-o)*6:t}i(ti,"hueToRgb");function Pn({hue:t,saturation:e,lightness:o,alpha:r}){t/=360,e/=100,o/=100;let n=0,a=0,s=0;if(!e)n=a=s=o;else{let l=o<.5?o*(1+e):o+e-o*e,u=2*o-l;n=ti(u,l,t+1/3),a=ti(u,l,t),s=ti(u,l,t-1/3)}return{red:Math.round(n*255),green:Math.round(a*255),blue:Math.round(s*255),alpha:r}}i(Pn,"hslaToRgba");function de(t,e){return o=>o>0?e:t}i(de,"mixImmediate");var A=i((t,e,o)=>t+(e-t)*o,"mixNumber");var ei=i((t,e,o)=>{let r=t*t,n=o*(e*e-r)+r;return n<0?0:Math.sqrt(n)},"mixLinearColor"),Gl=[Xe,ht,Et],Wl=i(t=>Gl.find(e=>e.test(t)),"getColorType");function bn(t){let e=Wl(t);if(vt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let o=e.parse(t);return e===Et&&(o=Pn(o)),o}i(bn,"asRGBA");var oi=i((t,e)=>{let o=bn(t),r=bn(e);if(!o||!r)return de(t,e);let n={...o};return a=>(n.red=ei(o.red,r.red,a),n.green=ei(o.green,r.green,a),n.blue=ei(o.blue,r.blue,a),n.alpha=A(o.alpha,r.alpha,a),ht.transform(n))},"mixColor");var ko=new Set(["none","hidden"]);function wn(t,e){return ko.has(t)?o=>o<=0?t:e:o=>o>=1?e:t}i(wn,"mixVisibility");function Ul(t,e){return o=>A(t,e,o)}i(Ul,"mixNumber");function Bo(t){return typeof t=="number"?Ul:typeof t=="string"?fe(t)?de:R.test(t)?oi:Hl:Array.isArray(t)?An:typeof t=="object"?R.test(t)?oi:Kl:de}i(Bo,"getMixer");function An(t,e){let o=[...t],r=o.length,n=t.map((a,s)=>Bo(a)(a,e[s]));return a=>{for(let s=0;s<r;s++)o[s]=n[s](a);return o}}i(An,"mixArray");function Kl(t,e){let o={...t,...e},r={};for(let n in o)t[n]!==void 0&&e[n]!==void 0&&(r[n]=Bo(t[n])(t[n],e[n]));return n=>{for(let a in r)o[a]=r[a](n);return o}}i(Kl,"mixObject");function zl(t,e){let o=[],r={color:0,var:0,number:0};for(let n=0;n<e.values.length;n++){let a=e.types[n],s=t.indexes[a][r[a]],l=t.values[s]??0;o[n]=l,r[a]++}return o}i(zl,"matchOrder");var Hl=i((t,e)=>{let o=K.createTransformer(e),r=Rt(t),n=Rt(e);return r.indexes.var.length===n.indexes.var.length&&r.indexes.color.length===n.indexes.color.length&&r.indexes.number.length>=n.indexes.number.length?ko.has(t)&&!n.values.length||ko.has(e)&&!r.values.length?wn(t,e):lt(An(zl(r,n),n.values),o):(vt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),de(t,e))},"mixComplex");function Io(t,e,o){return typeof t=="number"&&typeof e=="number"&&typeof o=="number"?A(t,e,o):Bo(t)(t,e)}i(Io,"mix");var Mn=i(t=>{let e=i(({timestamp:o})=>t(o),"passTimestamp");return{start:i((o=!0)=>w.update(e,o),"start"),stop:i(()=>J(e),"stop"),now:i(()=>O.isProcessing?O.timestamp:B.now(),"now")}},"frameloopDriver");var Fo=i((t,e,o=10)=>{let r="",n=Math.max(Math.round(e/o),2);for(let a=0;a<n;a++)r+=Math.round(t(a/(n-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},"generateLinearEasing");function ge(t){let e=0,o=50,r=t.next(e);for(;!r.done&&e<2e4;)e+=o,r=t.next(e);return e>=2e4?1/0:e}i(ge,"calcGeneratorDuration");function Cn(t,e=100,o){let r=o({...t,keyframes:[0,e]}),n=Math.min(ge(r),2e4);return{type:"keyframes",ease:i(a=>r.next(n*a).value/e,"ease"),duration:H(n)}}i(Cn,"createGeneratorEasing");var I={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 ni(t,e){return t*Math.sqrt(1-e*e)}i(ni,"calcAngularFreq");var $l=12;function _l(t,e,o){let r=o;for(let n=1;n<$l;n++)r=r-t(r)/e(r);return r}i(_l,"approximateRoot");var ii=.001;function Yl({duration:t=I.duration,bounce:e=I.bounce,velocity:o=I.velocity,mass:r=I.mass}){let n,a;vt(t<=j(I.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-e;s=U(I.minDamping,I.maxDamping,s),t=U(I.minDuration,I.maxDuration,H(t)),s<1?(n=i(c=>{let m=c*s,f=m*t,p=m-o,d=ni(c,s),h=Math.exp(-f);return ii-p/d*h},"envelope"),a=i(c=>{let f=c*s*t,p=f*o+o,d=Math.pow(s,2)*Math.pow(c,2)*t,h=Math.exp(-f),g=ni(Math.pow(c,2),s);return(-n(c)+ii>0?-1:1)*((p-d)*h)/g},"derivative")):(n=i(c=>{let m=Math.exp(-c*t),f=(c-o)*t+1;return-ii+m*f},"envelope"),a=i(c=>{let m=Math.exp(-c*t),f=(o-c)*(t*t);return m*f},"derivative"));let l=5/t,u=_l(n,a,l);if(t=j(t),isNaN(u))return{stiffness:I.stiffness,damping:I.damping,duration:t};{let c=Math.pow(u,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:t}}}i(Yl,"findSpring");var Xl=["duration","bounce"],ql=["stiffness","damping","mass"];function Dn(t,e){return e.some(o=>t[o]!==void 0)}i(Dn,"isSpringType");function Zl(t){let e={velocity:I.velocity,stiffness:I.stiffness,damping:I.damping,mass:I.mass,isResolvedFromDuration:!1,...t};if(!Dn(t,ql)&&Dn(t,Xl))if(e.velocity=0,t.visualDuration){let o=t.visualDuration,r=2*Math.PI/(o*1.2),n=r*r,a=2*U(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:I.mass,stiffness:n,damping:a}}else{let o=Yl({...t,velocity:0});e={...e,...o,mass:I.mass},e.isResolvedFromDuration=!0}return e}i(Zl,"getSpringOptions");function xe(t=I.visualDuration,e=I.bounce){let o=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:r,restDelta:n}=o,a=o.keyframes[0],s=o.keyframes[o.keyframes.length-1],l={done:!1,value:a},{stiffness:u,damping:c,mass:m,duration:f,velocity:p,isResolvedFromDuration:d}=Zl({...o,velocity:-H(o.velocity||0)}),h=p||0,g=c/(2*Math.sqrt(u*m)),x=s-a,y=H(Math.sqrt(u/m)),V=Math.abs(x)<5;r||(r=V?I.restSpeed.granular:I.restSpeed.default),n||(n=V?I.restDelta.granular:I.restDelta.default);let T,S,M,E,D,b;if(g<1)M=ni(y,g),E=(h+g*y*x)/M,T=i(P=>{let N=Math.exp(-g*y*P);return s-N*(E*Math.sin(M*P)+x*Math.cos(M*P))},"resolveSpring"),D=g*y*E+x*M,b=g*y*x-E*M,S=i(P=>Math.exp(-g*y*P)*(D*Math.sin(M*P)+b*Math.cos(M*P)),"resolveVelocity");else if(g===1){T=i(N=>s-Math.exp(-y*N)*(x+(h+y*x)*N),"resolveSpring");let P=h+y*x;S=i(N=>Math.exp(-y*N)*(y*P*N-h),"resolveVelocity")}else{let P=y*Math.sqrt(g*g-1);T=i(ut=>{let yt=Math.exp(-g*y*ut),mt=Math.min(P*ut,300);return s-yt*((h+g*y*x)*Math.sinh(mt)+P*x*Math.cosh(mt))/P},"resolveSpring");let N=(h+g*y*x)/P,Z=g*y*N-x*P,Ut=g*y*x-N*P;S=i(ut=>{let yt=Math.exp(-g*y*ut),mt=Math.min(P*ut,300);return yt*(Z*Math.sinh(mt)+Ut*Math.cosh(mt))},"resolveVelocity")}let $={calculatedDuration:d&&f||null,velocity:i(P=>j(S(P)),"velocity"),next:i(P=>{if(!d&&g<1){let Z=Math.exp(-g*y*P),Ut=Math.sin(M*P),ut=Math.cos(M*P),yt=s-Z*(E*Ut+x*ut),mt=j(Z*(D*Ut+b*ut));return l.done=Math.abs(mt)<=r&&Math.abs(s-yt)<=n,l.value=l.done?s:yt,l}let N=T(P);if(d)l.done=P>=f;else{let Z=j(S(P));l.done=Math.abs(Z)<=r&&Math.abs(s-N)<=n}return l.value=l.done?s:N,l},"next"),toString:i(()=>{let P=Math.min(ge($),2e4),N=Fo(Z=>$.next(P*Z).value,P,30);return P+"ms "+N},"toString"),toTransition:i(()=>{},"toTransition")};return $}i(xe,"spring");xe.applyToOptions=t=>{let e=Cn(t,100,xe);return t.ease=e.ease,t.duration=j(e.duration),t.type="keyframes",t};var Jl=5;function Oo(t,e,o){let r=Math.max(e-Jl,0);return je(o-t(r),e-r)}i(Oo,"getGeneratorVelocity");function Ze({keyframes:t,velocity:e=0,power:o=.8,timeConstant:r=325,bounceDamping:n=10,bounceStiffness:a=500,modifyTarget:s,min:l,max:u,restDelta:c=.5,restSpeed:m}){let f=t[0],p={done:!1,value:f},d=i(b=>l!==void 0&&b<l||u!==void 0&&b>u,"isOutOfBounds"),h=i(b=>l===void 0?u:u===void 0||Math.abs(l-b)<Math.abs(u-b)?l:u,"nearestBoundary"),g=o*e,x=f+g,y=s===void 0?x:s(x);y!==x&&(g=y-f);let V=i(b=>-g*Math.exp(-b/r),"calcDelta"),T=i(b=>y+V(b),"calcLatest"),S=i(b=>{let $=V(b),P=T(b);p.done=Math.abs($)<=c,p.value=p.done?y:P},"applyFriction"),M,E,D=i(b=>{d(p.value)&&(M=b,E=xe({keyframes:[p.value,h(p.value)],velocity:Oo(T,b,p.value),damping:n,stiffness:a,restDelta:c,restSpeed:m}))},"checkCatchBoundary");return D(0),{calculatedDuration:null,next:i(b=>{let $=!1;return!E&&M===void 0&&($=!0,S(b),D(b)),M!==void 0&&b>=M?E.next(b-M):(!$&&S(b),p)},"next")}}i(Ze,"inertia");function Ql(t,e,o){let r=[],n=o||X.mix||Io,a=t.length-1;for(let s=0;s<a;s++){let l=n(t[s],t[s+1]);if(e){let u=Array.isArray(e)?e[s]||k:e;l=lt(u,l)}r.push(l)}return r}i(Ql,"createMixers");function En(t,e,{clamp:o=!0,ease:r,mixer:n}={}){let a=t.length;if(ot(a===e.length,"Both input and output ranges must be the same length","range-length"),a===1)return()=>e[0];if(a===2&&e[0]===e[1])return()=>e[1];let s=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());let l=Ql(e,r,n),u=l.length,c=i(m=>{if(s&&m<t[0])return e[0];let f=0;if(u>1)for(;f<t.length-2&&!(m<t[f+1]);f++);let p=ft(t[f],t[f+1],m);return l[f](p)},"interpolator");return o?m=>c(U(t[0],t[a-1],m)):c}i(En,"interpolate");function Rn(t,e){let o=t[t.length-1];for(let r=1;r<=e;r++){let n=ft(0,e,r);t.push(A(o,1,n))}}i(Rn,"fillOffset");function Ln(t){let e=[0];return Rn(e,t.length-1),e}i(Ln,"defaultOffset");function kn(t,e){return t.map(o=>o*e)}i(kn,"convertOffsetToTimes");function tc(t,e){return t.map(()=>e||ze).splice(0,t.length-1)}i(tc,"defaultEasing");function Ht({duration:t=300,keyframes:e,times:o,ease:r="easeInOut"}){let n=Xr(r)?r.map(Mo):Mo(r),a={done:!1,value:e[0]},s=kn(o&&o.length===e.length?o:Ln(e),t),l=En(s,e,{ease:Array.isArray(n)?n:tc(e,n)});return{calculatedDuration:t,next:i(u=>(a.value=l(u),a.done=u>=t,a),"next")}}i(Ht,"keyframes");var ec=i(t=>t!==null,"isNotNull");function Lt(t,{repeat:e,repeatType:o="loop"},r,n=1){let a=t.filter(ec),l=n<0||e&&o!=="loop"&&e%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}i(Lt,"getFinalKeyframe");var oc={decay:Ze,inertia:Ze,tween:Ht,keyframes:Ht,spring:xe};function jo(t){typeof t.type=="string"&&(t.type=oc[t.type])}i(jo,"replaceTransitionType");var kt=class{static{i(this,"WithPromise")}constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,o){return this.finished.then(e,o)}};var rc=i(t=>t/100,"percentToProgress"),St=class extends kt{static{i(this,"JSAnimation")}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:o}=this.options;o&&o.updatedAt!==B.now()&&this.tick(B.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;jo(e);let{type:o=Ht,repeat:r=0,repeatDelay:n=0,repeatType:a,velocity:s=0}=e,{keyframes:l}=e,u=o||Ht;u!==Ht&&typeof l[0]!="number"&&(this.mixKeyframes=lt(rc,Io(l[0],l[1])),l=[0,100]);let c=u({...e,keyframes:l});a==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=ge(c));let{calculatedDuration:m}=c;this.calculatedDuration=m,this.resolvedDuration=m+n,this.totalDuration=this.resolvedDuration*(r+1)-n,this.generator=c}updateTime(e){let o=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=o}tick(e,o=!1){let{generator:r,totalDuration:n,mixKeyframes:a,mirroredGenerator:s,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);let{delay:c=0,keyframes:m,repeat:f,repeatType:p,repeatDelay:d,type:h,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),o?this.currentTime=e:this.updateTime(e);let y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),V=this.playbackSpeed>=0?y<0:y>n;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let T=this.currentTime,S=r;if(f){let b=Math.min(this.currentTime,n)/l,$=Math.floor(b),P=b%1;!P&&b>=1&&(P=1),P===1&&$--,$=Math.min($,f+1),$%2&&(p==="reverse"?(P=1-P,d&&(P-=d/l)):p==="mirror"&&(S=s)),T=U(0,1,P)*l}let M;V?(this.delayState.value=m[0],M=this.delayState):M=S.next(T),a&&!V&&(M.value=a(M.value));let{done:E}=M;!V&&u!==null&&(E=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return D&&h!==Ze&&(M.value=Lt(m,this.options,x,this.speed)),g&&g(M.value),D&&this.finish(),M}then(e,o){return this.finished.then(e,o)}get duration(){return H(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+H(e)}get time(){return H(this.currentTime)}set time(e){e=j(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let o=this.generator.next(e).value;return Oo(r=>this.generator.next(r).value,e,o)}get speed(){return this.playbackSpeed}set speed(e){let o=this.playbackSpeed!==e;o&&this.driver&&this.updateTime(B.now()),this.playbackSpeed=e,o&&this.driver&&(this.time=H(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Mn,startTime:o}=this.options;this.driver||(this.driver=e(n=>this.tick(n))),this.options.onPlay?.();let r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=o??r),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(B.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Bn(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}i(Bn,"fillWildcards");var $t=i(t=>t*180/Math.PI,"radToDeg"),si=i(t=>{let e=$t(Math.atan2(t[1],t[0]));return ai(e)},"rotate"),ic={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:i(t=>(Math.abs(t[0])+Math.abs(t[3]))/2,"scale"),rotate:si,rotateZ:si,skewX:i(t=>$t(Math.atan(t[1])),"skewX"),skewY:i(t=>$t(Math.atan(t[2])),"skewY"),skew:i(t=>(Math.abs(t[1])+Math.abs(t[2]))/2,"skew")},ai=i(t=>(t=t%360,t<0&&(t+=360),t),"rebaseAngle"),In=si,Fn=i(t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),"scaleX"),On=i(t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),"scaleY"),nc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fn,scaleY:On,scale:i(t=>(Fn(t)+On(t))/2,"scale"),rotateX:i(t=>ai($t(Math.atan2(t[6],t[5]))),"rotateX"),rotateY:i(t=>ai($t(Math.atan2(-t[2],t[0]))),"rotateY"),rotateZ:In,rotate:In,skewX:i(t=>$t(Math.atan(t[4])),"skewX"),skewY:i(t=>$t(Math.atan(t[1])),"skewY"),skew:i(t=>(Math.abs(t[1])+Math.abs(t[4]))/2,"skew")};function No(t){return t.includes("scale")?1:0}i(No,"defaultTransformValue");function Go(t,e){if(!t||t==="none")return No(e);let o=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,n;if(o)r=nc,n=o;else{let l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ic,n=l}if(!n)return No(e);let a=r[e],s=n[1].split(",").map(sc);return typeof a=="function"?a(s):s[a]}i(Go,"parseValueFromTransform");var jn=i((t,e)=>{let{transform:o="none"}=getComputedStyle(t);return Go(o,e)},"readTransformValue");function sc(t){return parseFloat(t.trim())}i(sc,"convertTransformToNumber");var dt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],it=new Set([...dt,"pathRotation"]);var li=i(t=>t===pt||t===v,"isNumOrPxType"),ac=new Set(["x","y","z"]),lc=dt.filter(t=>!ac.has(t));function Nn(t){let e=[];return lc.forEach(o=>{let r=t.getValue(o);r!==void 0&&(e.push([o,r.get()]),r.set(o.startsWith("scale")?1:0))}),e}i(Nn,"removeNonTranslationalTransform");var Pt={width:i(({x:t},{paddingLeft:e="0",paddingRight:o="0",boxSizing:r})=>{let n=t.max-t.min;return r==="border-box"?n:n-parseFloat(e)-parseFloat(o)},"width"),height:i(({y:t},{paddingTop:e="0",paddingBottom:o="0",boxSizing:r})=>{let n=t.max-t.min;return r==="border-box"?n:n-parseFloat(e)-parseFloat(o)},"height"),top:i((t,{top:e})=>parseFloat(e),"top"),left:i((t,{left:e})=>parseFloat(e),"left"),bottom:i(({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),"bottom"),right:i(({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),"right"),x:i((t,{transform:e})=>Go(e,"x"),"x"),y:i((t,{transform:e})=>Go(e,"y"),"y")};Pt.translateX=Pt.x;Pt.translateY=Pt.y;var _t=new Set,ci=!1,ui=!1,mi=!1;function Gn(){if(ui){let t=Array.from(_t).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),o=new Map;e.forEach(r=>{let n=Nn(r);n.length&&(o.set(r,n),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();let n=o.get(r);n&&n.forEach(([a,s])=>{r.getValue(a)?.set(s)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ui=!1,ci=!1,_t.forEach(t=>t.complete(mi)),_t.clear()}i(Gn,"measureAllKeyframes");function Wn(){_t.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ui=!0)})}i(Wn,"readAllKeyframes");function Un(){mi=!0,Wn(),Gn(),mi=!1}i(Un,"flushKeyframeResolvers");var Bt=class{static{i(this,"KeyframeResolver")}constructor(e,o,r,n,a,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=o,this.name=r,this.motionValue=n,this.element=a,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(_t.add(this),ci||(ci=!0,w.read(Wn),w.resolveKeyframes(Gn))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:o,element:r,motionValue:n}=this;if(e[0]===null){let a=n?.get(),s=e[e.length-1];if(a!==void 0)e[0]=a;else if(r&&o){let l=r.readValue(o,s);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=s),n&&a===void 0&&n.set(e[0])}Bn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),_t.delete(this)}cancel(){this.state==="scheduled"&&(_t.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var Kn=i(t=>t.startsWith("--"),"isCSSVar");function Wo(t,e,o){Kn(e)?t.style.setProperty(e,o):t.style[e]=o}i(Wo,"setStyle");var zn={};function Uo(t,e){let o=Oe(t);return()=>zn[e]??o()}i(Uo,"memoSupports");var Hn=Uo(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var Ko=Uo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var Yt=i(([t,e,o,r])=>`cubic-bezier(${t}, ${e}, ${o}, ${r})`,"cubicBezierAsString");var fi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yt([0,.65,.55,1]),circOut:Yt([.55,0,1,.45]),backIn:Yt([.31,.01,.66,-.59]),backOut:Yt([.33,1.53,.69,.99])};function pi(t,e){if(t)return typeof t=="function"?Ko()?Fo(t,e):"ease-out":He(t)?Yt(t):Array.isArray(t)?t.map(o=>pi(o,e)||fi.easeOut):fi[t]}i(pi,"mapEasingToNativeEasing");function $n(t,e,o,{delay:r=0,duration:n=300,repeat:a=0,repeatType:s="loop",ease:l="easeOut",times:u}={},c=void 0){let m={[e]:o};u&&(m.offset=u);let f=pi(l,n);Array.isArray(f)&&(m.easing=f);let p={delay:r,duration:n,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:s==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),t.animate(m,p)}i($n,"startWaapiAnimation");function zo(t){return typeof t=="function"&&"applyToOptions"in t}i(zo,"isGenerator");function _n({type:t,...e}){return zo(t)&&Ko()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}i(_n,"applyGeneratorOptions");var ye=class extends kt{static{i(this,"NativeAnimation")}constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:o,name:r,keyframes:n,pseudoElement:a,allowFlatten:s=!1,finalKeyframe:l,onComplete:u}=e;this.isPseudoElement=!!a,this.allowFlatten=s,this.options=e,ot(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=_n(e);this.animation=$n(o,r,n,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){let m=Lt(n,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(m),Wo(o,r,m),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;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 H(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+H(e)}get time(){return H(Number(this.animation.currentTime)||0)}set time(e){let o=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=j(e),o&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:o,rangeEnd:r,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Hn()?(this.animation.timeline=e,o&&(this.animation.rangeStart=o),r&&(this.animation.rangeEnd=r),k):n(this)}};var Yn={anticipate:Ge,backInOut:Ne,circInOut:Ke};function cc(t){return t in Yn}i(cc,"isUnsupportedEase");function Xn(t){typeof t.ease=="string"&&cc(t.ease)&&(t.ease=Yn[t.ease])}i(Xn,"replaceStringEasing");var hi=10,Ho=class extends ye{static{i(this,"NativeAnimationExtended")}constructor(e){Xn(e),jo(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:o,onUpdate:r,onComplete:n,element:a,...s}=this.options;if(!o)return;if(e!==void 0){o.set(e);return}let l=new St({...s,autoplay:!1}),u=Math.max(hi,B.now()-this.startTime),c=U(0,hi,u-hi),m=l.sample(u).value,{name:f}=this.options;a&&f&&Wo(a,f,m),o.setWithVelocity(l.sample(Math.max(0,u-c)).value,m,c),l.stop()}};var di=i((t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(K.test(t)||t==="0")&&!t.startsWith("url(")),"isAnimatable");function uc(t){let e=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==e)return!0}i(uc,"hasKeyframesChanged");function qn(t,e,o,r){let n=t[0];if(n===null)return!1;if(e==="display"||e==="visibility")return!0;let a=t[t.length-1],s=di(n,e),l=di(a,e);return vt(s===l,`You are trying to animate ${e} from "${n}" to "${a}". "${s?a:n}" is not an animatable value.`,"value-not-animatable"),!s||!l?!1:uc(t)||(o==="spring"||zo(o))&&r}i(qn,"canAnimate");function Je(t){t.duration=0,t.type="keyframes"}i(Je,"makeAnimationInstant");var $o=new Set(["opacity","clipPath","filter","transform"]);var mc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Zn(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&mc.test(t[e]))return!0;return!1}i(Zn,"hasBrowserOnlyColors");var fc=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),pc=Oe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Jn(t){let{motionValue:e,name:o,repeatDelay:r,repeatType:n,damping:a,type:s,keyframes:l}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:m}=e.owner.getProps();return pc()&&o&&($o.has(o)||fc.has(o)&&Zn(l))&&(o!=="transform"||!m)&&!c&&!r&&n!=="mirror"&&a!==0&&s!=="inertia"}i(Jn,"supportsBrowserAnimation");var hc=40,_o=class extends kt{static{i(this,"AsyncMotionValueAnimation")}constructor({autoplay:e=!0,delay:o=0,type:r="keyframes",repeat:n=0,repeatDelay:a=0,repeatType:s="loop",keyframes:l,name:u,motionValue:c,element:m,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=B.now();let p={autoplay:e,delay:o,type:r,repeat:n,repeatDelay:a,repeatType:s,name:u,motionValue:c,element:m,...f},d=m?.KeyframeResolver||Bt;this.keyframeResolver=new d(l,(h,g,x)=>this.onKeyframesResolved(h,g,p,!x),u,c,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,o,r,n){this.keyframeResolver=void 0;let{name:a,type:s,velocity:l,delay:u,isHandoff:c,onUpdate:m}=r;this.resolvedAt=B.now();let f=!0;qn(e,a,s,l)||(f=!1,(X.instantAnimations||!u)&&m?.(Lt(e,r,o)),e[0]=e[e.length-1],Je(r),r.repeat=0);let d={startTime:n?this.resolvedAt?this.resolvedAt-this.createdAt>hc?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:o,...r,keyframes:e},h=f&&!c&&Jn(d),g=d.motionValue?.owner?.current,x;if(h)try{x=new Ho({...d,element:g})}catch{x=new St(d)}else x=new St(d);x.finished.then(()=>{this.notifyFinished()}).catch(k),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,o){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Un()),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 Yo(t,e,o,r=0,n=1){let a=Array.from(t).sort((c,m)=>c.sortNodePosition(m)).indexOf(e),s=t.size,l=(s-1)*r;return typeof o=="function"?o(a,s):n===1?a*r:l-a*r}i(Yo,"calcChildStagger");var Qn=30,dc=i(t=>!isNaN(parseFloat(t)),"isFloat"),ts={current:void 0},gi=class{static{i(this,"MotionValue")}constructor(e,o={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{let n=B.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=o.owner}setCurrent(e){this.current=e,this.updatedAt=B.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=dc(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,o){this.events[e]||(this.events[e]=new Tt);let r=this.events[e].add(o);return e==="change"?()=>{r(),w.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,o){this.passiveEffect=e,this.stopPassiveEffect=o}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,o,r){this.set(o),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,o=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ts.current&&ts.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=B.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Qn)return 0;let o=Math.min(this.updatedAt-this.prevUpdatedAt,Qn);return je(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(e){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=e(o),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 ct(t,e){return new gi(t,e)}i(ct,"motionValue");function Xo(t,e){if(t?.inherit&&e){let{inherit:o,...r}=t;return{...e,...r}}return t}i(Xo,"resolveTransition");function ve(t,e){let o=t?.[e]??t?.default??t;return o!==t?Xo(o,t):o}i(ve,"getValueTransition");var gc={type:"spring",stiffness:500,damping:25,restSpeed:10},xc=i(t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),"criticallyDampedSpring"),yc={type:"keyframes",duration:.8},vc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},es=i((t,{keyframes:e})=>e.length>2?yc:it.has(t)?t.startsWith("scale")?xc(e[1]):gc:vc,"getDefaultTransition");var Tc=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function os(t){for(let e in t)if(!Tc.has(e))return!0;return!1}i(os,"isTransitionDefined");var Xt=i((t,e,o,r={},n,a)=>s=>{let l=ve(r,t)||{},u=l.delay||r.delay||0,{elapsed:c=0}=r;c=c-j(u);let m={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:i(p=>{e.set(p),l.onUpdate&&l.onUpdate(p)},"onUpdate"),onComplete:i(()=>{s(),l.onComplete&&l.onComplete()},"onComplete"),name:t,motionValue:e,element:a?void 0:n};os(l)||Object.assign(m,es(t,m)),m.duration&&(m.duration=j(m.duration)),m.repeatDelay&&(m.repeatDelay=j(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let f=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(Je(m),m.delay===0&&(f=!0)),(X.instantAnimations||X.skipAnimations||n?.shouldSkipAnimations||l.skipAnimations)&&(f=!0,Je(m),m.delay=0),m.allowFlatten=!l.type&&!l.ease,f&&!a&&e.get()!==void 0){let p=Lt(m.keyframes,l);if(p!==void 0){w.update(()=>{m.onUpdate(p),m.onComplete()});return}}return l.isSync?new St(m):new _o(m)},"animateMotionValue");var Vc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Sc(t){let e=Vc.exec(t);if(!e)return[,];let[,o,r,n]=e;return[`--${o??r}`,n]}i(Sc,"parseCSSVariable");var Pc=4;function xi(t,e,o=1){ot(o<=Pc,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[r,n]=Sc(t);if(!r)return;let a=window.getComputedStyle(e).getPropertyValue(r);if(a){let s=a.trim();return Be(s)?parseFloat(s):s}return fe(n)?xi(n,e,o+1):n}i(xi,"getVariableValue");function rs(t){let e=[{},{}];return t?.values.forEach((o,r)=>{e[0][r]=o.get(),e[1][r]=o.getVelocity()}),e}i(rs,"getValueState");function qt(t,e,o,r){if(typeof e=="function"){let[n,a]=rs(r);e=e(o!==void 0?o:t.custom,n,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){let[n,a]=rs(r);e=e(o!==void 0?o:t.custom,n,a)}return e}i(qt,"resolveVariantFromProps");function Q(t,e,o){let r=t.getProps();return qt(r,e,o!==void 0?o:r.custom,t)}i(Q,"resolveVariant");var qo=new Set(["width","height","top","left","right","bottom",...dt]);var Qe=i(t=>Array.isArray(t),"isKeyframesTarget");function bc(t,e,o){t.hasValue(e)?t.getValue(e).set(o):t.addValue(e,ct(o))}i(bc,"setMotionValue");function wc(t){return Qe(t)?t[t.length-1]||0:t}i(wc,"resolveFinalValueInKeyframes");function is(t,e){let o=Q(t,e),{transitionEnd:r={},transition:n={},...a}=o||{};a={...a,...r};for(let s in a){let l=wc(a[s]);bc(t,s,l)}}i(is,"setTarget");var C=i(t=>!!(t&&t.getVelocity),"isMotionValue");function ns(t){return!!(C(t)&&t.add)}i(ns,"isWillChangeMotionValue");function Te(t,e){let o=t.getValue("willChange");if(ns(o))return o.add(e);if(!o&&X.WillChange){let r=new X.WillChange("auto");t.addValue("willChange",r),r.add(e)}}i(Te,"addValueToWillChange");function Ve(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}i(Ve,"camelToDash");var ss="framerAppearId",to="data-"+Ve(ss);function Zo(t){return t.props[to]}i(Zo,"getOptimisedAppearId");function Ac({protectedKeys:t,needsAnimating:e},o){let r=t.hasOwnProperty(o)&&e[o]!==!0;return e[o]=!1,r}i(Ac,"shouldBlockAnimation");function Jo(t,e,{delay:o=0,transitionOverride:r,type:n}={}){let{transition:a,transitionEnd:s,...l}=e,u=t.getDefaultTransition();a=a?Xo(a,u):u;let c=a?.reduceMotion,m=a?.skipAnimations;r&&(a=r);let f=[],p=n&&t.animationState&&t.animationState.getState()[n],d=a?.path;d&&d.animateVisualElement(t,l,a,o,f);for(let h in l){let g=t.getValue(h,t.latestValues[h]??null),x=l[h];if(x===void 0||p&&Ac(p,h))continue;let y={delay:o,...ve(a||{},h)};m&&(y.skipAnimations=!0);let V=g.get();if(V!==void 0&&!g.isAnimating()&&!Array.isArray(x)&&x===V&&!y.velocity){w.update(()=>g.set(x));continue}let T=!1;if(window.MotionHandoffAnimation){let E=Zo(t);if(E){let D=window.MotionHandoffAnimation(E,h,w);D!==null&&(y.startTime=D,T=!0)}}Te(t,h);let S=c??t.shouldReduceMotion;g.start(Xt(h,g,x,S&&qo.has(h)?{type:!1}:y,t,T));let M=g.animation;M&&f.push(M)}if(s){let h=i(()=>w.update(()=>{s&&is(t,s)}),"applyTransitionEnd");f.length?Promise.all(f).then(h):h()}return f}i(Jo,"animateTarget");function Qo(t,e,o={}){let r=Q(t,e,o.type==="exit"?t.presenceContext?.custom:void 0),{transition:n=t.getDefaultTransition()||{}}=r||{};o.transitionOverride&&(n=o.transitionOverride);let a=r?()=>Promise.all(Jo(t,r,o)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(u=0)=>{let{delayChildren:c=0,staggerChildren:m,staggerDirection:f}=n;return Mc(t,e,u,c,m,f,o)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,c]=l==="beforeChildren"?[a,s]:[s,a];return u().then(()=>c())}else return Promise.all([a(),s(o.delay)])}i(Qo,"animateVariant");function Mc(t,e,o=0,r=0,n=0,a=1,s){let l=[];for(let u of t.variantChildren)u.notify("AnimationStart",e),l.push(Qo(u,e,{...s,delay:o+(typeof r=="function"?0:r)+Yo(t.variantChildren,u,r,n,a)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}i(Mc,"animateChildren");function as(t,e,o={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){let n=e.map(a=>Qo(t,a,o));r=Promise.all(n)}else if(typeof e=="string")r=Qo(t,e,o);else{let n=typeof e=="function"?Q(t,e,o.custom):e;r=Promise.all(Jo(t,n,o))}return r.then(()=>{t.notify("AnimationComplete",e)})}i(as,"animateVisualElement");var ls={test:i(t=>t==="auto","test"),parse:i(t=>t,"parse")};var tr=i(t=>e=>e.test(t),"testValueType");var yi=[pt,v,Y,rt,Qr,Jr,ls],vi=i(t=>yi.find(tr(t)),"findDimensionValueType");function cs(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Fe(t):!0}i(cs,"isNone");var Cc=new Set(["brightness","contrast","saturate","opacity"]);function Dc(t){let[e,o]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;let[r]=o.match(pe)||[];if(!r)return t;let n=o.replace(r,""),a=Cc.has(e)?1:0;return r!==o&&(a*=100),e+"("+a+n+")"}i(Dc,"applyDefaultFilter");var Ec=/\b([a-z-]*)\(.*?\)/gu,eo={...K,getAnimatableNone:i(t=>{let e=t.match(Ec);return e?e.map(Dc).join(" "):t},"getAnimatableNone")};var oo={...K,getAnimatableNone:i(t=>{let e=K.parse(t);return K.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))},"getAnimatableNone")};var Ti={...pt,transform:Math.round};var us={rotate:rt,pathRotation:rt,rotateX:rt,rotateY:rt,rotateZ:rt,scale:Ye,scaleX:Ye,scaleY:Ye,scaleZ:Ye,skew:rt,skewX:rt,skewY:rt,distance:v,translateX:v,translateY:v,translateZ:v,x:v,y:v,z:v,perspective:v,transformPerspective:v,opacity:Vt,originX:Lo,originY:Lo,originZ:v};var Zt={borderWidth:v,borderTopWidth:v,borderRightWidth:v,borderBottomWidth:v,borderLeftWidth:v,borderRadius:v,borderTopLeftRadius:v,borderTopRightRadius:v,borderBottomRightRadius:v,borderBottomLeftRadius:v,width:v,maxWidth:v,height:v,maxHeight:v,top:v,right:v,bottom:v,left:v,inset:v,insetBlock:v,insetBlockStart:v,insetBlockEnd:v,insetInline:v,insetInlineStart:v,insetInlineEnd:v,padding:v,paddingTop:v,paddingRight:v,paddingBottom:v,paddingLeft:v,paddingBlock:v,paddingBlockStart:v,paddingBlockEnd:v,paddingInline:v,paddingInlineStart:v,paddingInlineEnd:v,margin:v,marginTop:v,marginRight:v,marginBottom:v,marginLeft:v,marginBlock:v,marginBlockStart:v,marginBlockEnd:v,marginInline:v,marginInlineStart:v,marginInlineEnd:v,fontSize:v,backgroundPositionX:v,backgroundPositionY:v,...us,zIndex:Ti,fillOpacity:Vt,strokeOpacity:Vt,numOctaves:Ti};var Rc={...Zt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:eo,WebkitFilter:eo,mask:oo,WebkitMask:oo},er=i(t=>Rc[t],"getDefaultValueType");var Lc=new Set([eo,oo]);function or(t,e){let o=er(t);return Lc.has(o)||(o=K),o.getAnimatableNone?o.getAnimatableNone(e):void 0}i(or,"getAnimatableNone");var kc=new Set(["auto","none","0"]);function ms(t,e,o){let r=0,n;for(;r<t.length&&!n;){let a=t[r];typeof a=="string"&&!kc.has(a)&&Rt(a).values.length&&(n=t[r]),r++}if(n&&o)for(let a of e)t[a]=or(o,n)}i(ms,"makeNoneKeyframesAnimatable");var rr=class extends Bt{static{i(this,"DOMKeyframesResolver")}constructor(e,o,r,n,a){super(e,o,r,n,a,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:o,name:r}=this;if(!o||!o.current)return;super.readKeyframes();for(let m=0;m<e.length;m++){let f=e[m];if(typeof f=="string"&&(f=f.trim(),fe(f))){let p=xi(f,o.current);p!==void 0&&(e[m]=p),m===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!qo.has(r)||e.length!==2)return;let[n,a]=e,s=vi(n),l=vi(a),u=qr(n),c=qr(a);if(u!==c&&Pt[r]){this.needsMeasurement=!0;return}if(s!==l)if(li(s)&&li(l))for(let m=0;m<e.length;m++){let f=e[m];typeof f=="string"&&(e[m]=parseFloat(f))}else Pt[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:o}=this,r=[];for(let n=0;n<e.length;n++)(e[n]===null||cs(e[n]))&&r.push(n);r.length&&ms(e,r,o)}measureInitialState(){let{element:e,unresolvedKeyframes:o,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Pt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),o[0]=this.measuredOrigin;let n=o[o.length-1];n!==void 0&&e.getValue(r,n).jump(n,!1)}measureEndState(){let{element:e,name:o,unresolvedKeyframes:r}=this;if(!e||!e.current)return;let n=e.getValue(o);n&&n.jump(this.measuredOrigin,!1);let a=r.length-1,s=r[a];r[a]=Pt[o](e.measureViewportBox(),window.getComputedStyle(e.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var ro=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function ir(t,e,o){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;e&&(r=e.current);let n=o?.[t]??r.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(r=>r!=null)}i(ir,"resolveElements");var io=i((t,e)=>e&&typeof t=="number"?e.transform(t):t,"getValueAsType");function fs(t){return Ie(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}i(fs,"isHTMLElement");var{schedule:Jt,cancel:Bc}=Co(queueMicrotask,!1);var nt={x:!1,y:!1};function nr(){return nt.x||nt.y}i(nr,"isDragActive");function Vi(t){return t==="x"||t==="y"?nt[t]?null:(nt[t]=!0,()=>{nt[t]=!1}):nt.x||nt.y?null:(nt.x=nt.y=!0,()=>{nt.x=nt.y=!1})}i(Vi,"setDragLock");function sr(t,e){let o=ir(t),r=new AbortController,n={passive:!0,...e,signal:r.signal};return[o,n,i(()=>r.abort(),"cancel")]}i(sr,"setupGesture");function Ic(t){return!(t.pointerType==="touch"||nr())}i(Ic,"isValidHover");function Si(t,e,o={}){let[r,n,a]=sr(t,o);return r.forEach(s=>{let l=!1,u=!1,c,m=i(()=>{s.removeEventListener("pointerleave",h)},"removePointerLeave"),f=i(x=>{c&&(c(x),c=void 0),m()},"endHover"),p=i(x=>{l=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),u&&(u=!1,f(x))},"onPointerUp"),d=i(()=>{l=!0,window.addEventListener("pointerup",p,n),window.addEventListener("pointercancel",p,n)},"onPointerDown"),h=i(x=>{if(x.pointerType!=="touch"){if(l){u=!0;return}f(x)}},"onPointerLeave"),g=i(x=>{if(!Ic(x))return;u=!1;let y=e(s,x);typeof y=="function"&&(c=y,s.addEventListener("pointerleave",h,n))},"onPointerEnter");s.addEventListener("pointerenter",g,n),s.addEventListener("pointerdown",d,n)}),a}i(Si,"hover");var Pi=i((t,e)=>e?t===e?!0:Pi(t,e.parentElement):!1,"isNodeOrChild");var Qt=i(t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,"isPrimaryPointer");var Fc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bi(t){return Fc.has(t.tagName)||t.isContentEditable===!0}i(bi,"isElementKeyboardAccessible");var Oc=new Set(["INPUT","SELECT","TEXTAREA"]);function wi(t){return Oc.has(t.tagName)||t.isContentEditable===!0}i(wi,"isElementTextInput");var Se=new WeakSet;function ps(t){return e=>{e.key==="Enter"&&t(e)}}i(ps,"filterEvents");function Ai(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}i(Ai,"firePointerEvent");var hs=i((t,e)=>{let o=t.currentTarget;if(!o)return;let r=ps(()=>{if(Se.has(o))return;Ai(o,"down");let n=ps(()=>{Ai(o,"up")}),a=i(()=>Ai(o,"cancel"),"handleBlur");o.addEventListener("keyup",n,e),o.addEventListener("blur",a,e)});o.addEventListener("keydown",r,e),o.addEventListener("blur",()=>o.removeEventListener("keydown",r),e)},"enableKeyboardPress");function ds(t){return Qt(t)&&!nr()}i(ds,"isValidPressEvent");var gs=new WeakSet;function Mi(t,e,o={}){let[r,n,a]=sr(t,o),s=i(l=>{let u=l.currentTarget;if(!ds(l)||gs.has(l))return;Se.add(u),o.stopPropagation&&gs.add(l);let c=e(u,l),m={...n,capture:!0},f=i((h,g)=>{window.removeEventListener("pointerup",p,m),window.removeEventListener("pointercancel",d,m),Se.has(u)&&Se.delete(u),ds(h)&&typeof c=="function"&&c(h,{success:g})},"onPointerEnd"),p=i(h=>{f(h,u===window||u===document||o.useGlobalTarget||Pi(u,h.target))},"onPointerUp"),d=i(h=>{f(h,!1)},"onPointerCancel");window.addEventListener("pointerup",p,m),window.addEventListener("pointercancel",d,m)},"startPress");return r.forEach(l=>{(o.useGlobalTarget?window:l).addEventListener("pointerdown",s,n),fs(l)&&(l.addEventListener("focus",c=>hs(c,n)),!bi(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}i(Mi,"press");function Pe(t){return Ie(t)&&"ownerSVGElement"in t}i(Pe,"isSVGElement");var ar=new WeakMap,lr,xs=i((t,e,o)=>(r,n)=>n&&n[0]?n[0][t+"Size"]:Pe(r)&&"getBBox"in r?r.getBBox()[e]:r[o],"getSize"),jc=xs("inline","width","offsetWidth"),Nc=xs("block","height","offsetHeight");function Gc({target:t,borderBoxSize:e}){ar.get(t)?.forEach(o=>{o(t,{get width(){return jc(t,e)},get height(){return Nc(t,e)}})})}i(Gc,"notifyTarget");function Wc(t){t.forEach(Gc)}i(Wc,"notifyAll");function Uc(){typeof ResizeObserver>"u"||(lr=new ResizeObserver(Wc))}i(Uc,"createResizeObserver");function ys(t,e){lr||Uc();let o=ir(t);return o.forEach(r=>{let n=ar.get(r);n||(n=new Set,ar.set(r,n)),n.add(e),lr?.observe(r)}),()=>{o.forEach(r=>{let n=ar.get(r);n?.delete(e),n?.size||lr?.unobserve(r)})}}i(ys,"resizeElement");var cr=new Set,be;function Kc(){be=i(()=>{let t={get width(){return window.innerWidth},get height(){return window.innerHeight}};cr.forEach(e=>e(t))},"windowResizeHandler"),window.addEventListener("resize",be)}i(Kc,"createWindowResizeHandler");function vs(t){return cr.add(t),be||Kc(),()=>{cr.delete(t),!cr.size&&typeof be=="function"&&(window.removeEventListener("resize",be),be=void 0)}}i(vs,"resizeWindow");function ur(t,e){return typeof t=="function"?vs(t):ys(t,e)}i(ur,"resize");var te={value:null,addProjectionMetrics:null};function Ts(t){return Pe(t)&&t.tagName==="svg"}i(Ts,"isSVGSVGElement");var zc=[...yi,R,K],Vs=i(t=>zc.find(tr(t)),"findValueType");var Ci=i(()=>({translate:0,scale:1,origin:0,originPoint:0}),"createAxisDelta"),It=i(()=>({x:Ci(),y:Ci()}),"createDelta"),Di=i(()=>({min:0,max:0}),"createAxis"),L=i(()=>({x:Di(),y:Di()}),"createBox");var Ss=new WeakMap;function bt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}i(bt,"isAnimationControls");function gt(t){return typeof t=="string"||Array.isArray(t)}i(gt,"isVariantLabel");var mr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],no=["initial",...mr];function Ft(t){return bt(t.animate)||no.some(e=>gt(t[e]))}i(Ft,"isControllingVariants");function so(t){return!!(Ft(t)||t.variants)}i(so,"isVariantNode");function Ps(t,e,o){for(let r in e){let n=e[r],a=o[r];if(C(n))t.addValue(r,n);else if(C(a))t.addValue(r,ct(n,{owner:t}));else if(a!==n)if(t.hasValue(r)){let s=t.getValue(r);s.liveStyle===!0?s.jump(n):s.hasAnimated||s.set(n)}else{let s=t.getStaticValue(r);t.addValue(r,ct(s!==void 0?s:n,{owner:t}))}}for(let r in o)e[r]===void 0&&t.removeValue(r);return e}i(Ps,"updateMotionValuesFromProps");var Ot={current:null},ee={current:!1};var Hc=typeof window<"u";function ao(){if(ee.current=!0,!!Hc)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=i(()=>Ot.current=t.matches,"setReducedMotionPreferences");t.addEventListener("change",e),e()}else Ot.current=!1}i(ao,"initPrefersReducedMotion");var bs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],fr={};function co(t){fr=t}i(co,"setFeatureDefinitions");function Ei(){return fr}i(Ei,"getFeatureDefinitions");var lo=class{static{i(this,"VisualElement")}scrapeMotionValuesFromProps(e,o,r){return{}}constructor({parent:e,props:o,presenceContext:r,reducedMotionConfig:n,skipAnimations:a,blockInitialAnimation:s,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Bt,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 d=B.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,w.render(this.render,!1,!0))};let{latestValues:c,renderState:m}=l;this.latestValues=c,this.baseTarget={...c},this.initialValues=o.initial?{...c}:{},this.renderState=m,this.parent=e,this.props=o,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=a,this.options=u,this.blockInitialAnimation=!!s,this.isControllingVariants=Ft(o),this.isVariantNode=so(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:f,...p}=this.scrapeMotionValuesFromProps(o,{},this);for(let d in p){let h=p[d];c[d]!==void 0&&C(h)&&h.set(c[d])}}mount(e){if(this.hasBeenMounted)for(let o in this.initialValues)this.values.get(o)?.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=e,Ss.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((o,r)=>this.bindToMotionValue(r,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ee.current||ao(),this.shouldReduceMotion=Ot.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(),J(this.notifyUpdate),J(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 o=this.features[e];o&&(o.unmount(),o.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,o){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),o.accelerate&&$o.has(e)&&this.current instanceof HTMLElement){let{factory:s,keyframes:l,times:u,ease:c,duration:m}=o.accelerate,f=new ye({element:this.current,name:e,keyframes:l,times:u,ease:c,duration:j(m)}),p=s(f);this.valueSubscriptions.set(e,()=>{p(),f.cancel()});return}let r=it.has(e);r&&this.onBindTransform&&this.onBindTransform();let n=o.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&w.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,o)),this.valueSubscriptions.set(e,()=>{n(),a&&a()})}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 fr){let o=fr[e];if(!o)continue;let{isEnabled:r,Feature:n}=o;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){let a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):L()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,o){this.latestValues[e]=o}update(e,o){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let r=0;r<bs.length;r++){let n=bs[r];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let a="on"+n,s=e[a];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=Ps(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 o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(e),()=>o.variantChildren.delete(e)}addValue(e,o){let r=this.values.get(e);o!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,o),this.values.set(e,o),this.latestValues[e]=o.get())}removeValue(e){this.values.delete(e);let o=this.valueSubscriptions.get(e);o&&(o(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,o){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&o!==void 0&&(r=ct(o===null?void 0:o,{owner:this}),this.addValue(e,r)),r}readValue(e,o){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(Be(r)||Fe(r))?r=parseFloat(r):!Vs(r)&&K.test(o)&&(r=or(e,o)),this.setBaseTarget(e,C(r)?r.get():r)),C(r)?r.get():r}setBaseTarget(e,o){this.baseTarget[e]=o}getBaseTarget(e){let{initial:o}=this.props,r;if(typeof o=="string"||typeof o=="object"){let a=qt(this.props,o,this.presenceContext?.custom);a&&(r=a[e])}if(o&&r!==void 0)return r;let n=this.getBaseTargetFromProps(this.props,e);return n!==void 0&&!C(n)?n:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,o){return this.events[e]||(this.events[e]=new Tt),this.events[e].add(o)}notify(e,...o){this.events[e]&&this.events[e].notify(...o)}scheduleRenderMicrotask(){Jt.render(this.render)}};var we=class extends lo{static{i(this,"DOMVisualElement")}constructor(){super(...arguments),this.KeyframeResolver=rr}sortInstanceNodePosition(e,o){return e.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(e,o){let r=e.style;return r?r[o]:void 0}removeValueFromRenderState(e,{vars:o,style:r}){delete o[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;C(e)&&(this.childSubscription=e.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}};var z=class{static{i(this,"Feature")}constructor(e){this.isMounted=!1,this.node=e}update(){}};function uo({top:t,left:e,right:o,bottom:r}){return{x:{min:e,max:o},y:{min:t,max:r}}}i(uo,"convertBoundingBoxToBox");function Ri({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}i(Ri,"convertBoxToBoundingBox");function Li(t,e){if(!e)return t;let o=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:r.y,right:r.x}}i(Li,"transformBoxPoints");function ki(t){return t===void 0||t===1}i(ki,"isIdentityScale");function pr({scale:t,scaleX:e,scaleY:o}){return!ki(t)||!ki(e)||!ki(o)}i(pr,"hasScale");function wt(t){return pr(t)||Bi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}i(wt,"hasTransform");function Bi(t){return ws(t.x)||ws(t.y)}i(Bi,"has2DTranslate");function ws(t){return t&&t!=="0%"}i(ws,"is2DTranslate");function mo(t,e,o){let r=t-o,n=e*r;return o+n}i(mo,"scalePoint");function As(t,e,o,r,n){return n!==void 0&&(t=mo(t,n,r)),mo(t,o,r)+e}i(As,"applyPointDelta");function Ii(t,e=0,o=1,r,n){t.min=As(t.min,e,o,r,n),t.max=As(t.max,e,o,r,n)}i(Ii,"applyAxisDelta");function Fi(t,{x:e,y:o}){Ii(t.x,e.translate,e.scale,e.originPoint),Ii(t.y,o.translate,o.scale,o.originPoint)}i(Fi,"applyBoxDelta");var Ms=.999999999999,Cs=1.0000000000001;function Rs(t,e,o,r=!1){let n=o.length;if(!n)return;e.x=e.y=1;let a,s;for(let l=0;l<n;l++){a=o[l],s=a.projectionDelta;let{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(st(t.x,-a.scroll.offset.x),st(t.y,-a.scroll.offset.y)),s&&(e.x*=s.x.scale,e.y*=s.y.scale,Fi(t,s)),r&&wt(a.latestValues)&&fo(t,a.latestValues,a.layout?.layoutBox))}e.x<Cs&&e.x>Ms&&(e.x=1),e.y<Cs&&e.y>Ms&&(e.y=1)}i(Rs,"applyTreeDeltas");function st(t,e){t.min+=e,t.max+=e}i(st,"translateAxis");function Ds(t,e,o,r,n=.5){let a=A(t.min,t.max,n);Ii(t,e,o,a,r)}i(Ds,"transformAxis");function Es(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}i(Es,"resolveAxisTranslate");function fo(t,e,o){let r=o??t;Ds(t.x,Es(e.x,r.x),e.scaleX,e.scale,e.originX),Ds(t.y,Es(e.y,r.y),e.scaleY,e.scale,e.originY)}i(fo,"transformBox");function hr(t,e){return uo(Li(t.getBoundingClientRect(),e))}i(hr,"measureViewportBox");function Oi(t,e,o){let r=hr(t,o),{scroll:n}=e;return n&&(st(r.x,n.offset.x),st(r.y,n.offset.y)),r}i(Oi,"measurePageBox");var $c={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_c=dt.length;function Ls(t,e,o){let r="",n=!0;for(let s=0;s<_c;s++){let l=dt[s],u=t[l];if(u===void 0)continue;let c=!0;if(typeof u=="number")c=u===(l.startsWith("scale")?1:0);else{let m=parseFloat(u);c=l.startsWith("scale")?m===1:m===0}if(!c||o){let m=io(u,Zt[l]);if(!c){n=!1;let f=$c[l]||l;r+=`${f}(${m}) `}o&&(e[l]=m)}}let a=t.pathRotation;return a&&(n=!1,r+=`rotate(${io(a,Zt.pathRotation)}) `),r=r.trim(),o?r=o(e,n?"":r):n&&(r="none"),r}i(Ls,"buildTransform");function oe(t,e,o){let{style:r,vars:n,transformOrigin:a}=t,s=!1,l=!1;for(let u in e){let c=e[u];if(it.has(u)){s=!0;continue}else if(Eo(u)){n[u]=c;continue}else{let m=io(c,Zt[u]);u.startsWith("origin")?(l=!0,a[u]=m):r[u]=m}}if(e.transform||(s||o?r.transform=Ls(e,t.transform,o):r.transform&&(r.transform="none")),l){let{originX:u="50%",originY:c="50%",originZ:m=0}=a;r.transformOrigin=`${u} ${c} ${m}`}}i(oe,"buildHTMLStyles");function dr(t,{style:e,vars:o},r,n){let a=t.style,s;for(s in e)a[s]=e[s];n?.applyProjectionStyles(a,r);for(s in o)a.setProperty(s,o[s])}i(dr,"renderHTML");function ks(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}i(ks,"pixelsToPercent");var Ae={correct:i((t,e)=>{if(!e.target)return t;if(typeof t=="string")if(v.test(t))t=parseFloat(t);else return t;let o=ks(t,e.target.x),r=ks(t,e.target.y);return`${o}% ${r}%`},"correct")};var Bs={correct:i((t,{treeScale:e,projectionDelta:o})=>{let r=t,n=K.parse(t);if(n.length>5)return r;let a=K.createTransformer(t),s=typeof n[0]!="number"?1:0,l=o.x.scale*e.x,u=o.y.scale*e.y;n[0+s]/=l,n[1+s]/=u;let c=A(l,u,.5);return typeof n[2+s]=="number"&&(n[2+s]/=c),typeof n[3+s]=="number"&&(n[3+s]/=c),a(n)},"correct")};var po={borderRadius:{...Ae,applyTo:[...ro]},borderTopLeftRadius:Ae,borderTopRightRadius:Ae,borderBottomLeftRadius:Ae,borderBottomRightRadius:Ae,boxShadow:Bs};function ho(t,{layout:e,layoutId:o}){return it.has(t)||t.startsWith("origin")||(e||o!==void 0)&&(!!po[t]||t==="opacity")}i(ho,"isForcedMotionValue");function re(t,e,o){let r=t.style,n=e?.style,a={};if(!r)return a;for(let s in r)(C(r[s])||n&&C(n[s])||ho(s,t)||o?.getValue(s)?.liveStyle!==void 0)&&(a[s]=r[s]);return a}i(re,"scrapeMotionValuesFromProps");function Yc(t){return window.getComputedStyle(t)}i(Yc,"getComputedStyle");var go=class extends we{static{i(this,"HTMLVisualElement")}constructor(){super(...arguments),this.type="html",this.renderInstance=dr}readValueFromInstance(e,o){if(it.has(o))return this.projection?.isProjecting?No(o):jn(e,o);{let r=Yc(e),n=(Eo(o)?r.getPropertyValue(o):r[o])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:o}){return hr(e,o)}build(e,o,r){oe(e,o,r.transformTemplate)}scrapeMotionValuesFromProps(e,o,r){return re(e,o,r)}};var Xc={offset:"stroke-dashoffset",array:"stroke-dasharray"},qc={offset:"strokeDashoffset",array:"strokeDasharray"};function Is(t,e,o=1,r=0,n=!0){t.pathLength=1;let a=n?Xc:qc;t[a.offset]=`${-r}`,t[a.array]=`${e} ${o}`}i(Is,"buildSVGPath");var Zc=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function xo(t,{attrX:e,attrY:o,attrScale:r,pathLength:n,pathSpacing:a=1,pathOffset:s=0,...l},u,c,m){if(oe(t,l,c),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:f,style:p}=t;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=m?.transformBox??"fill-box",delete f.transformBox);for(let d of Zc)f[d]!==void 0&&(p[d]=f[d],delete f[d]);e!==void 0&&(f.x=e),o!==void 0&&(f.y=o),r!==void 0&&(f.scale=r),n!==void 0&&Is(f,n,a,s,!1)}i(xo,"buildSVGAttrs");var gr=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"]);var yo=i(t=>typeof t=="string"&&t.toLowerCase()==="svg","isSVGTag");function Fs(t,e,o,r){dr(t,e,void 0,r);for(let n in e.attrs)t.setAttribute(gr.has(n)?n:Ve(n),e.attrs[n])}i(Fs,"renderSVG");function vo(t,e,o){let r=re(t,e,o);for(let n in t)if(C(t[n])||C(e[n])){let a=dt.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;r[a]=t[n]}return r}i(vo,"scrapeMotionValuesFromProps");var To=class extends we{static{i(this,"SVGVisualElement")}constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=L}getBaseTargetFromProps(e,o){return e[o]}readValueFromInstance(e,o){if(it.has(o)){let r=er(o);return r&&r.default||0}return o=gr.has(o)?o:Ve(o),e.getAttribute(o)}scrapeMotionValuesFromProps(e,o,r){return vo(e,o,r)}build(e,o,r){xo(e,o,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,o,r,n){Fs(e,o,r,n)}mount(e){this.isSVGTag=yo(e.tagName),super.mount(e)}};var Jc=no.length;function ji(t){if(!t)return;if(!t.isControllingVariants){let o=t.parent?ji(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}let e={};for(let o=0;o<Jc;o++){let r=no[o],n=t.props[r];(gt(n)||n===!1)&&(e[r]=n)}return e}i(ji,"getVariantContext");function Ni(t,e){if(!Array.isArray(e))return!1;let o=e.length;if(o!==t.length)return!1;for(let r=0;r<o;r++)if(e[r]!==t[r])return!1;return!0}i(Ni,"shallowCompare");var Qc=[...mr].reverse(),tu=mr.length;function eu(t){return e=>Promise.all(e.map(({animation:o,options:r})=>as(t,o,r)))}i(eu,"createAnimateFunction");function Gi(t){let e=eu(t),o=Os(),r=!0,n=!1,a=i(c=>(m,f)=>{let p=Q(t,f,c==="exit"?t.presenceContext?.custom:void 0);if(p){let{transition:d,transitionEnd:h,...g}=p;m={...m,...g,...h}}return m},"buildResolvedTypeValues");function s(c){e=c(t)}i(s,"setAnimateFunction");function l(c){let{props:m}=t,f=ji(t.parent)||{},p=[],d=new Set,h={},g=1/0;for(let y=0;y<tu;y++){let V=Qc[y],T=o[V],S=m[V]!==void 0?m[V]:f[V],M=gt(S),E=V===c?T.isActive:null;E===!1&&(g=y);let D=S===f[V]&&S!==m[V]&&M;if(D&&(r||n)&&t.manuallyAnimateOnMount&&(D=!1),T.protectedKeys={...h},!T.isActive&&E===null||!S&&!T.prevProp||bt(S)||typeof S=="boolean")continue;if(V==="exit"&&T.isActive&&E!==!0){T.prevResolvedValues&&(h={...h,...T.prevResolvedValues});continue}let b=js(T.prevProp,S),$=b||V===c&&T.isActive&&!D&&M||y>g&&M,P=!1,N=Array.isArray(S)?S:[S],Z=N.reduce(a(V),{});E===!1&&(Z={});let{prevResolvedValues:Ut={}}=T,ut={...Ut,...Z},yt=i(_=>{$=!0,d.has(_)&&(P=!0,d.delete(_)),T.needsAnimating[_]=!0;let et=t.getValue(_);et&&(et.liveStyle=!1)},"markToAnimate");for(let _ in ut){let et=Z[_],Kt=Ut[_];if(h.hasOwnProperty(_))continue;let ue=!1;Qe(et)&&Qe(Kt)?ue=!Ni(et,Kt)||b:ue=et!==Kt,ue?et!=null?yt(_):d.add(_):et!==void 0&&d.has(_)?yt(_):T.protectedKeys[_]=!0}T.prevProp=S,T.prevResolvedValues=Z,T.isActive&&(h={...h,...Z}),(r||n)&&t.blockInitialAnimation&&($=!1);let mt=D&&b;$&&(!mt||P)&&p.push(...N.map(_=>{let et={type:V};if(typeof _=="string"&&(r||n)&&!mt&&t.manuallyAnimateOnMount&&t.parent){let{parent:Kt}=t,ue=Q(Kt,_);if(Kt.enteringChildren&&ue){let{delayChildren:Tl}=ue.transition||{};et.delay=Yo(Kt.enteringChildren,t,Tl)}}return{animation:_,options:et}}))}if(d.size){let y={};if(typeof m.initial!="boolean"){let V=Q(t,Array.isArray(m.initial)?m.initial[0]:m.initial);V&&V.transition&&(y.transition=V.transition)}d.forEach(V=>{let T=t.getBaseTarget(V),S=t.getValue(V);S&&(S.liveStyle=!0),y[V]=T??null}),p.push({animation:y})}let x=!!p.length;return r&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,n=!1,x?e(p):Promise.resolve()}i(l,"animateChanges");function u(c,m){if(o[c].isActive===m)return Promise.resolve();t.variantChildren?.forEach(p=>p.animationState?.setActive(c,m)),o[c].isActive=m;let f=l(c);for(let p in o)o[p].protectedKeys={};return f}return i(u,"setActive"),{animateChanges:l,setActive:u,setAnimateFunction:s,getState:i(()=>o,"getState"),reset:i(()=>{o=Os(),n=!0},"reset")}}i(Gi,"createAnimationState");function js(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ni(e,t):!1}i(js,"checkVariantsDidChange");function ie(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}i(ie,"createTypeState");function Os(){return{animate:ie(!0),whileInView:ie(),whileHover:ie(),whileTap:ie(),whileDrag:ie(),whileFocus:ie(),exit:ie()}}i(Os,"createState");function xr(t,e){t.min=e.min,t.max=e.max}i(xr,"copyAxisInto");function at(t,e){xr(t.x,e.x),xr(t.y,e.y)}i(at,"copyBoxInto");function Wi(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}i(Wi,"copyAxisDeltaInto");var Ns=1e-4,ou=1-Ns,ru=1+Ns,Gs=.01,iu=0-Gs,nu=0+Gs;function W(t){return t.max-t.min}i(W,"calcLength");function Hi(t,e,o){return Math.abs(t-e)<=o}i(Hi,"isNear");function Ui(t,e,o,r=.5){t.origin=r,t.originPoint=A(e.min,e.max,t.origin),t.scale=W(o)/W(e),t.translate=A(o.min,o.max,t.origin)-t.originPoint,(t.scale>=ou&&t.scale<=ru||isNaN(t.scale))&&(t.scale=1),(t.translate>=iu&&t.translate<=nu||isNaN(t.translate))&&(t.translate=0)}i(Ui,"calcAxisDelta");function ne(t,e,o,r){Ui(t.x,e.x,o.x,r?r.originX:void 0),Ui(t.y,e.y,o.y,r?r.originY:void 0)}i(ne,"calcBoxDelta");function Ki(t,e,o,r=0){let n=r?A(o.min,o.max,r):o.min;t.min=n+e.min,t.max=t.min+W(e)}i(Ki,"calcRelativeAxis");function $i(t,e,o,r){Ki(t.x,e.x,o.x,r?.x),Ki(t.y,e.y,o.y,r?.y)}i($i,"calcRelativeBox");function zi(t,e,o,r=0){let n=r?A(o.min,o.max,r):o.min;t.min=e.min-n,t.max=t.min+W(e)}i(zi,"calcRelativeAxisPosition");function Me(t,e,o,r){zi(t.x,e.x,o.x,r?.x),zi(t.y,e.y,o.y,r?.y)}i(Me,"calcRelativePosition");function Ws(t,e,o,r,n){return t-=e,t=mo(t,1/o,r),n!==void 0&&(t=mo(t,1/n,r)),t}i(Ws,"removePointDelta");function su(t,e=0,o=1,r=.5,n,a=t,s=t){if(Y.test(e)&&(e=parseFloat(e),e=A(s.min,s.max,e/100)-s.min),typeof e!="number")return;let l=A(a.min,a.max,r);t===a&&(l-=e),t.min=Ws(t.min,e,o,l,n),t.max=Ws(t.max,e,o,l,n)}i(su,"removeAxisDelta");function Us(t,e,[o,r,n],a,s){su(t,e[o],e[r],e[n],e.scale,a,s)}i(Us,"removeAxisTransforms");var au=["x","scaleX","originX"],lu=["y","scaleY","originY"];function _i(t,e,o,r){Us(t.x,e,au,o?o.x:void 0,r?r.x:void 0),Us(t.y,e,lu,o?o.y:void 0,r?r.y:void 0)}i(_i,"removeBoxTransforms");function Ks(t){return t.translate===0&&t.scale===1}i(Ks,"isAxisDeltaZero");function Yi(t){return Ks(t.x)&&Ks(t.y)}i(Yi,"isDeltaZero");function zs(t,e){return t.min===e.min&&t.max===e.max}i(zs,"axisEquals");function $s(t,e){return zs(t.x,e.x)&&zs(t.y,e.y)}i($s,"boxEquals");function Hs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}i(Hs,"axisEqualsRounded");function Xi(t,e){return Hs(t.x,e.x)&&Hs(t.y,e.y)}i(Xi,"boxEqualsRounded");function qi(t){return W(t.x)/W(t.y)}i(qi,"aspectRatio");function Zi(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}i(Zi,"axisDeltaEquals");function tt(t){return[t("x"),t("y")]}i(tt,"eachAxis");function _s(t,e,o){let r="",n=t.x.translate/e.x,a=t.y.translate/e.y,s=o?.z||0;if((n||a||s)&&(r=`translate3d(${n}px, ${a}px, ${s}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),o){let{transformPerspective:c,rotate:m,pathRotation:f,rotateX:p,rotateY:d,skewX:h,skewY:g}=o;c&&(r=`perspective(${c}px) ${r}`),m&&(r+=`rotate(${m}deg) `),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotateX(${p}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}let l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}i(_s,"buildProjectionTransform");var cu=ro.length,Ys=i(t=>typeof t=="string"?parseFloat(t):t,"asNumber"),Xs=i(t=>typeof t=="number"||v.test(t),"isPx");function Zs(t,e,o,r,n,a){n?(t.opacity=A(0,o.opacity??1,uu(r)),t.opacityExit=A(e.opacity??1,0,mu(r))):a&&(t.opacity=A(e.opacity??1,o.opacity??1,r));for(let s=0;s<cu;s++){let l=ro[s],u=qs(e,l),c=qs(o,l);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||Xs(u)===Xs(c)?(t[l]=Math.max(A(Ys(u),Ys(c),r),0),(Y.test(c)||Y.test(u))&&(t[l]+="%")):t[l]=c}(e.rotate||o.rotate)&&(t.rotate=A(e.rotate||0,o.rotate||0,r))}i(Zs,"mixValues");function qs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}i(qs,"getRadius");var uu=Js(0,.5,Ue),mu=Js(.5,.95,k);function Js(t,e,o){return r=>r<t?0:r>e?1:o(ft(t,e,r))}i(Js,"compress");function Qs(t,e,o){let r=C(t)?t:ct(t);return r.start(Xt("",r,e,o)),r.animation}i(Qs,"animateSingleValue");function xt(t,e,o,r={passive:!0}){return t.addEventListener(e,o,r),()=>t.removeEventListener(e,o,r)}i(xt,"addDomEvent");var ta=i((t,e)=>t.depth-e.depth,"compareByDepth");var yr=class{static{i(this,"FlatTree")}constructor(){this.children=[],this.isDirty=!1}add(e){zt(this.children,e),this.isDirty=!0}remove(e){Mt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ta),this.isDirty=!1,this.children.forEach(e)}};function ea(t,e){let o=B.now(),r=i(({timestamp:n})=>{let a=n-o;a>=e&&(J(r),t(a-e))},"checkElapsed");return w.setup(r,!0),()=>J(r)}i(ea,"delay");function se(t){return C(t)?t.get():t}i(se,"resolveMotionValue");var vr=class{static{i(this,"NodeStack")}constructor(){this.members=[]}add(e){zt(this.members,e);for(let o=this.members.length-1;o>=0;o--){let r=this.members[o];if(r===e||r===this.lead||r===this.prevLead)continue;let n=r.instance;(!n||n.isConnected===!1)&&!r.snapshot&&(Mt(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Mt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(e){for(let o=this.members.indexOf(e)-1;o>=0;o--){let r=this.members[o];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(e,o){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();let{layoutDependency:n}=r.options,{layoutDependency:a}=e.options;(n===void 0||n!==a)&&(e.resumeFrom=r,o&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.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)}};var ae={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var le={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ji=["","X","Y","Z"],fu=1e3,pu=0;function Qi(t,e,o,r){let{latestValues:n}=e;n[t]&&(o[t]=n[t],e.setStaticValue(t,0),r&&(r[t]=0))}i(Qi,"resetDistortingTransform");function ua(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;let{visualElement:e}=t.options;if(!e)return;let o=Zo(e);if(window.MotionHasOptimisedAnimation(o,"transform")){let{layout:n,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(o,"transform",w,!(n||a))}let{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&ua(r)}i(ua,"cancelTreeOptimisedTransformAnimations");function Tr({attachResizeListener:t,defaultParent:e,measureScroll:o,checkIsScrollRoot:r,resetTransform:n}){return class{static{i(this,"ProjectionNode")}constructor(s={},l=e?.()){this.id=pu++,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,te.value&&(le.nodes=le.calculatedTargetDeltas=le.calculatedProjections=0),this.nodes.forEach(gu),this.nodes.forEach(Su),this.nodes.forEach(Pu),this.nodes.forEach(xu),te.addProjectionMetrics&&te.addProjectionMetrics(le)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new yr)}addEventListener(s,l){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Tt),this.eventHandlers.get(s).add(l)}notifyListeners(s,...l){let u=this.eventHandlers.get(s);u&&u.notify(...l)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Pe(s)&&!Ts(s),this.instance=s;let{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let m,f=0,p=i(()=>this.root.updateBlockedByResize=!1,"resizeUnblockUpdate");w.read(()=>{f=window.innerWidth}),t(s,()=>{let d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,m&&m(),m=ea(p,250),ae.hasAnimatedSinceResize&&(ae.hasAnimatedSinceResize=!1,this.nodes.forEach(ia)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||c.getDefaultTransition()||Cu,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!Xi(this.targetLayout,d),V=!f&&p;if(this.options.layoutRoot||this.resumeFrom||V||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let T={...ve(h,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(m,V,T.path)}else f||ia(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),J(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(bu),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ua(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){let f=this.path[m];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}let{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;let c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(vu),this.nodes.forEach(oa);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ra);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Tu),this.nodes.forEach(Vu),this.nodes.forEach(hu),this.nodes.forEach(du)):this.nodes.forEach(ra),this.clearAllSnapshots();let l=B.now();O.delta=U(0,1e3/60,l-O.timestamp),O.timestamp=l,O.isProcessing=!0,_e.update.process(O),_e.preRender.process(O),_e.render.process(O),O.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Jt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(yu),this.sharedNodes.forEach(wu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,w.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){w.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!W(this.snapshot.measuredBox.x)&&!W(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=L()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(l=!1),l&&this.instance){let u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:u,offset:o(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!n)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Yi(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,m=c!==this.prevTransformTemplateValue;s&&this.instance&&(l||wt(this.latestValues)||m)&&(n(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let l=this.measurePageBox(),u=this.removeElementScroll(l);return s&&(u=this.removeTransform(u)),Du(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:s}=this.options;if(!s)return L();let l=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Eu))){let{scroll:c}=this.root;c&&(st(l.x,c.offset.x),st(l.y,c.offset.y))}return l}removeElementScroll(s){let l=L();if(at(l,s),this.scroll?.wasRoot)return l;for(let u=0;u<this.path.length;u++){let c=this.path[u],{scroll:m,options:f}=c;c!==this.root&&m&&f.layoutScroll&&(m.wasRoot&&at(l,s),st(l.x,m.offset.x),st(l.y,m.offset.y))}return l}applyTransform(s,l=!1,u){let c=u||L();at(c,s);for(let m=0;m<this.path.length;m++){let f=this.path[m];!l&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(st(c.x,-f.scroll.offset.x),st(c.y,-f.scroll.offset.y)),wt(f.latestValues)&&fo(c,f.latestValues,f.layout?.layoutBox)}return wt(this.latestValues)&&fo(c,this.latestValues,this.layout?.layoutBox),c}removeTransform(s){let l=L();at(l,s);for(let u=0;u<this.path.length;u++){let c=this.path[u];if(!wt(c.latestValues))continue;let m;c.instance&&(pr(c.latestValues)&&c.updateSnapshot(),m=L(),at(m,c.measurePageBox())),_i(l,c.latestValues,c.snapshot?.layoutBox,m)}return wt(this.latestValues)&&_i(l,this.latestValues),l}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==O.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:m,layoutId:f}=this.options;if(!this.layout||!(m||f))return;this.resolvedRelativeTargetAt=O.timestamp;let p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=L(),this.targetWithTransforms=L()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$i(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):at(this.target,this.layout.layoutBox),Fi(this.target,this.targetDelta)):at(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0),te.value&&le.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||pr(this.parent.latestValues)||Bi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,l,u){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=L(),this.relativeTargetOrigin=L(),Me(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),at(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let s=this.getLead(),l=!!this.resumingFrom||this!==s,u=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===O.timestamp&&(u=!1),u)return;let{layout:c,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||m))return;at(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,p=this.treeScale.y;Rs(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=L());let{target:d}=s;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wi(this.prevProjectionDelta.x,this.projectionDelta.x),Wi(this.prevProjectionDelta.y,this.projectionDelta.y)),ne(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Zi(this.projectionDelta.x,this.prevProjectionDelta.x)||!Zi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d)),te.value&&le.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=It(),this.projectionDelta=It(),this.projectionDeltaWithTransform=It()}setAnimationOrigin(s,l=!1,u){let c=this.snapshot,m=c?c.latestValues:{},f={...this.latestValues},p=It();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;let d=L(),h=c?c.source:void 0,g=this.layout?this.layout.source:void 0,x=h!==g,y=this.getStack(),V=!y||y.members.length<=1,T=!!(x&&!V&&this.options.crossfade===!0&&!this.path.some(Mu));this.animationProgress=0;let S,M=u?.interpolateProjection(s);this.mixTargetDelta=E=>{let D=E/1e3,b=M?.(D);b?(p.x.translate=b.x,p.x.scale=A(s.x.scale,1,D),p.x.origin=s.x.origin,p.x.originPoint=s.x.originPoint,p.y.translate=b.y,p.y.scale=A(s.y.scale,1,D),p.y.origin=s.y.origin,p.y.originPoint=s.y.originPoint):(na(p.x,s.x,D),na(p.y,s.y,D)),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Me(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Au(this.relativeTarget,this.relativeTargetOrigin,d,D),S&&$s(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=L()),at(S,this.relativeTarget)),x&&(this.animationValues=f,Zs(f,m,this.latestValues,D,T,V)),b&&b.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=b.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(J(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=w.update(()=>{ae.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ct(0)),this.motionValue.jump(0,!1),this.currentAnimation=Qs(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:i(l=>{this.mixTargetDelta(l),s.onUpdate&&s.onUpdate(l)},"onUpdate"),onComplete:i(()=>{s.onComplete&&s.onComplete(),this.completeAnimation()},"onComplete")}),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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fu),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:l,target:u,layout:c,latestValues:m}=s;if(!(!l||!u||!c)){if(this!==s&&this.layout&&c&&ma(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||L();let f=W(this.layout.layoutBox.x);u.x.min=s.target.x.min,u.x.max=u.x.min+f;let p=W(this.layout.layoutBox.y);u.y.min=s.target.y.min,u.y.max=u.y.min+p}at(l,u),fo(l,m),ne(this.projectionDeltaWithTransform,this.layoutCorrected,l,m)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new vr),this.sharedNodes.get(s).add(l);let c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){let{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:u}={}){let c=this.getStack();c&&c.promote(this,u),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let l=!1,{latestValues:u}=s;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;let c={};u.z&&Qi("z",s,c,this.animationValues);for(let m=0;m<Ji.length;m++)Qi(`rotate${Ji[m]}`,s,c,this.animationValues),Qi(`skew${Ji[m]}`,s,c,this.animationValues);s.render();for(let m in c)s.setStaticValue(m,c[m]),this.animationValues&&(this.animationValues[m]=c[m]);s.scheduleRender()}applyProjectionStyles(s,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}let u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=se(l?.pointerEvents)||"",s.transform=u?u(this.latestValues,""):"none";return}let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=se(l?.pointerEvents)||""),this.hasProjected&&!wt(this.latestValues)&&(s.transform=u?u({},""):"none",this.hasProjected=!1);return}s.visibility="";let m=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=_s(this.projectionDeltaWithTransform,this.treeScale,m);u&&(f=u(m,f)),s.transform=f;let{x:p,y:d}=this.projectionDelta;s.transformOrigin=`${p.origin*100}% ${d.origin*100}% 0`,c.animationValues?s.opacity=c===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:s.opacity=c===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(let h in po){if(m[h]===void 0)continue;let{correct:g,applyTo:x,isCSSVariable:y}=po[h],V=f==="none"?m[h]:g(m[h],c);if(x){let T=x.length;for(let S=0;S<T;S++)s[x[S]]=V}else y?this.options.visualElement.renderState.vars[h]=V:s[h]=V}this.options.layoutId&&(s.pointerEvents=c===this?se(l?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(oa),this.root.sharedNodes.clear()}}}i(Tr,"createProjectionNode");function hu(t){t.updateLayout()}i(hu,"updateLayout");function du(t){let e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){let{layoutBox:o,measuredBox:r}=t.layout,{animationType:n}=t.options,a=e.source!==t.layout.source;if(n==="size")tt(m=>{let f=a?e.measuredBox[m]:e.layoutBox[m],p=W(f);f.min=o[m].min,f.max=f.min+p});else if(n==="x"||n==="y"){let m=n==="x"?"y":"x";xr(a?e.measuredBox[m]:e.layoutBox[m],o[m])}else ma(n,e.layoutBox,o)&&tt(m=>{let f=a?e.measuredBox[m]:e.layoutBox[m],p=W(o[m]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[m].max=t.relativeTarget[m].min+p)});let s=It();ne(s,o,e.layoutBox);let l=It();a?ne(l,t.applyTransform(r,!0),e.measuredBox):ne(l,o,e.layoutBox);let u=!Yi(s),c=!1;if(!t.resumeFrom){let m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){let{snapshot:f,layout:p}=m;if(f&&p){let d=t.options.layoutAnchor||void 0,h=L();Me(h,e.layoutBox,f.layoutBox,d);let g=L();Me(g,o,p.layoutBox,d),Xi(h,g)||(c=!0),m.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=h,t.relativeParent=m)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:e,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){let{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}i(du,"notifyLayoutUpdate");function gu(t){te.value&&le.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}i(gu,"propagateDirtyNodes");function xu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}i(xu,"cleanDirtyNodes");function yu(t){t.clearSnapshot()}i(yu,"clearSnapshot");function oa(t){t.clearMeasurements()}i(oa,"clearMeasurements");function vu(t){t.isLayoutDirty=!0,t.updateLayout()}i(vu,"forceLayoutMeasure");function ra(t){t.isLayoutDirty=!1}i(ra,"clearIsLayoutDirty");function Tu(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}i(Tu,"ensureDraggedNodesSnapshotted");function Vu(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}i(Vu,"resetTransformStyle");function ia(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}i(ia,"finishAnimation");function Su(t){t.resolveTargetDelta()}i(Su,"resolveTargetDelta");function Pu(t){t.calcProjection()}i(Pu,"calcProjection");function bu(t){t.resetSkewAndRotation()}i(bu,"resetSkewAndRotation");function wu(t){t.removeLeadSnapshot()}i(wu,"removeLeadSnapshots");function na(t,e,o){t.translate=A(e.translate,0,o),t.scale=A(e.scale,1,o),t.origin=e.origin,t.originPoint=e.originPoint}i(na,"mixAxisDeltaLinear");function sa(t,e,o,r){t.min=A(e.min,o.min,r),t.max=A(e.max,o.max,r)}i(sa,"mixAxis");function Au(t,e,o,r){sa(t.x,e.x,o.x,r),sa(t.y,e.y,o.y,r)}i(Au,"mixBox");function Mu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}i(Mu,"hasOpacityCrossfade");var Cu={duration:.45,ease:[.4,0,.1,1]},aa=i(t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),"userAgentContains"),la=aa("applewebkit/")&&!aa("chrome/")?Math.round:k;function ca(t){t.min=la(t.min),t.max=la(t.max)}i(ca,"roundAxis");function Du(t){ca(t.x),ca(t.y)}i(Du,"roundBox");function ma(t,e,o){return t==="position"||t==="preserve-aspect"&&!Hi(qi(e),qi(o),.2)}i(ma,"shouldAnimatePositionOnly");function Eu(t){return t!==t.root&&t.scroll?.wasRoot}i(Eu,"checkNodeWasScrollRoot");var fa=Tr({attachResizeListener:i((t,e)=>xt(t,"resize",e),"attachResizeListener"),measureScroll:i(()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),"measureScroll"),checkIsScrollRoot:i(()=>!0,"checkIsScrollRoot")});var Vr={current:void 0},Vo=Tr({measureScroll:i(t=>({x:t.scrollLeft,y:t.scrollTop}),"measureScroll"),defaultParent:i(()=>{if(!Vr.current){let t=new fa({});t.mount(window),t.setOptions({layoutScroll:!0}),Vr.current=t}return Vr.current},"defaultParent"),resetTransform:i((t,e)=>{t.style.transform=e!==void 0?e:"none"},"resetTransform"),checkIsScrollRoot:i(t=>window.getComputedStyle(t).position==="fixed","checkIsScrollRoot")});var pa=F(G(),1);function Ru(){!ee.current&&ao();let[t]=(0,pa.useState)(Ot.current);return t}i(Ru,"useReducedMotion");var ha=F(G(),1),Sr=(0,ha.createContext)({});var da=F(G(),1);function ga(t){let e=(0,da.useRef)(null);return e.current===null&&(e.current=t()),e.current}i(ga,"useConstant");var Pr=F(G(),1);var xa=typeof window<"u";var ya=xa?Pr.useLayoutEffect:Pr.useEffect;var va=F(G(),1),Ce=(0,va.createContext)(null);var Ta=F(G(),1);var br=(0,Ta.createContext)({transformPagePoint:i(t=>t,"transformPagePoint"),isStatic:!1,reducedMotion:"never"});var jt=F(G(),1);function Va(t=!0){let e=(0,jt.useContext)(Ce);if(e===null)return[!0,null];let{isPresent:o,onExitComplete:r,register:n}=e,a=(0,jt.useId)();(0,jt.useEffect)(()=>{if(t)return n(a)},[t]);let s=(0,jt.useCallback)(()=>t&&r&&r(a),[a,r,t]);return!o&&r?[!1,s]:[!0]}i(Va,"usePresence");var Sa=F(G(),1),wr=(0,Sa.createContext)({strict:!1});var Pa={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"]},ba=!1;function Lu(){if(ba)return;let t={};for(let e in Pa)t[e]={isEnabled:i(o=>Pa[e].some(r=>!!o[r]),"isEnabled")};co(t),ba=!0}i(Lu,"initFeatureDefinitions");function Ar(){return Lu(),Ei()}i(Ar,"getInitializedFeatureDefinitions");function wa(t){let e=Ar();for(let o in t)e[o]={...e[o],...t[o]};co(e)}i(wa,"loadFeatures");var ku=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function So(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ku.has(t)}i(So,"isValidMotionProp");var Aa=i(t=>!So(t),"shouldForward");function Bu(t){typeof t=="function"&&(Aa=i(e=>e.startsWith("on")?!So(e):t(e),"shouldForward"))}i(Bu,"loadExternalIsValidProp");try{Bu(un("@emotion/is-prop-valid").default)}catch{}function Ma(t,e,o){let r={};for(let n in t)n==="values"&&typeof t.values=="object"||C(t[n])||(Aa(n)||o===!0&&So(n)||!e&&!So(n)||t.draggable&&n.startsWith("onDrag"))&&(r[n]=t[n]);return r}i(Ma,"filterProps");var Rr=F(mn(),1);var Le=F(G(),1);var Ca=F(G(),1),Nt=(0,Ca.createContext)({});var Mr=F(G(),1);function Da(t,e){if(Ft(t)){let{initial:o,animate:r}=t;return{initial:o===!1||gt(o)?o:void 0,animate:gt(r)?r:void 0}}return t.inherit!==!1?e:{}}i(Da,"getCurrentTreeVariants");function Ra(t){let{initial:e,animate:o}=Da(t,(0,Mr.useContext)(Nt));return(0,Mr.useMemo)(()=>({initial:e,animate:o}),[Ea(e),Ea(o)])}i(Ra,"useCreateMotionContext");function Ea(t){return Array.isArray(t)?t.join(" "):t}i(Ea,"variantLabelsAsDependency");var Re=F(G(),1);var La=F(G(),1);var De=i(()=>({style:{},transform:{},transformOrigin:{},vars:{}}),"createHtmlRenderState");function tn(t,e,o){for(let r in e)!C(e[r])&&!ho(r,o)&&(t[r]=e[r])}i(tn,"copyRawValuesOnly");function Iu({transformTemplate:t},e){return(0,La.useMemo)(()=>{let o=De();return oe(o,e,t),Object.assign({},o.vars,o.style)},[e])}i(Iu,"useInitialMotionValues");function Fu(t,e){let o=t.style||{},r={};return tn(r,o,t),Object.assign(r,Iu(t,e)),r}i(Fu,"useStyle");function ka(t,e){let o={},r=Fu(t,e);return t.drag&&t.dragListener!==!1&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=r,o}i(ka,"useHTMLProps");var Ba=F(G(),1);var Cr=i(()=>({...De(),attrs:{}}),"createSvgRenderState");function Ia(t,e,o,r){let n=(0,Ba.useMemo)(()=>{let a=Cr();return xo(a,e,yo(r),t.transformTemplate,t.style),{...a.attrs,style:{...a.style}}},[e]);if(t.style){let a={};tn(a,t.style,t),n.style={...a,...n.style}}return n}i(Ia,"useSVGProps");var Fa=["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 Ee(t){return typeof t!="string"||t.includes("-")?!1:!!(Fa.indexOf(t)>-1||/[A-Z]/u.test(t))}i(Ee,"isSVGComponent");function Oa(t,e,o,{latestValues:r},n,a=!1,s){let u=(s??Ee(t)?Ia:ka)(e,r,n,t),c=Ma(e,typeof t=="string",a),m=t!==Re.Fragment?{...c,...u,ref:o}:{},{children:f}=e,p=(0,Re.useMemo)(()=>C(f)?f.get():f,[f]);return(0,Re.createElement)(t,{...m,children:p})}i(Oa,"useRender");var en=F(G(),1);function Ou({scrapeMotionValuesFromProps:t,createRenderState:e},o,r,n){return{latestValues:ju(o,r,n,t),renderState:e()}}i(Ou,"makeState");function ju(t,e,o,r){let n={},a=r(t,{});for(let p in a)n[p]=se(a[p]);let{initial:s,animate:l}=t,u=Ft(t),c=so(t);e&&c&&!u&&t.inherit!==!1&&(s===void 0&&(s=e.initial),l===void 0&&(l=e.animate));let m=o?o.initial===!1:!1;m=m||s===!1;let f=m?l:s;if(f&&typeof f!="boolean"&&!bt(f)){let p=Array.isArray(f)?f:[f];for(let d=0;d<p.length;d++){let h=qt(t,p[d]);if(h){let{transitionEnd:g,transition:x,...y}=h;for(let V in y){let T=y[V];if(Array.isArray(T)){let S=m?T.length-1:0;T=T[S]}T!==null&&(n[V]=T)}for(let V in g)n[V]=g[V]}}}return n}i(ju,"makeLatestValues");var Dr=i(t=>(e,o)=>{let r=(0,en.useContext)(Nt),n=(0,en.useContext)(Ce),a=i(()=>Ou(t,e,r,n),"make");return o?a():ga(a)},"makeUseVisualState");var ja=Dr({scrapeMotionValuesFromProps:re,createRenderState:De});var Na=Dr({scrapeMotionValuesFromProps:vo,createRenderState:Cr});var Ga=Symbol.for("motionComponentSymbol");var ce=F(G(),1);function Wa(t,e,o){let r=(0,ce.useRef)(o);(0,ce.useInsertionEffect)(()=>{r.current=o});let n=(0,ce.useRef)(null);return(0,ce.useCallback)(a=>{a&&t.onMount?.(a),e&&(a?e.mount(a):e.unmount());let s=r.current;if(typeof s=="function")if(a){let l=s(a);typeof l=="function"&&(n.current=l)}else n.current?(n.current(),n.current=null):s(a);else s&&(s.current=a)},[e])}i(Wa,"useMotionRef");var q=F(G(),1);var Ua=F(G(),1),Er=(0,Ua.createContext)({});function Gt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}i(Gt,"isRefObject");function Ka(t,e,o,r,n,a){let{visualElement:s}=(0,q.useContext)(Nt),l=(0,q.useContext)(wr),u=(0,q.useContext)(Ce),c=(0,q.useContext)(br),m=c.reducedMotion,f=c.skipAnimations,p=(0,q.useRef)(null),d=(0,q.useRef)(!1);r=r||l.renderer,!p.current&&r&&(p.current=r(t,{visualState:e,parent:s,props:o,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:m,skipAnimations:f,isSVG:a}),d.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));let h=p.current,g=(0,q.useContext)(Er);h&&!h.projection&&n&&(h.type==="html"||h.type==="svg")&&Nu(p.current,o,n,g);let x=(0,q.useRef)(!1);(0,q.useInsertionEffect)(()=>{h&&x.current&&h.update(o,u)});let y=o[to],V=(0,q.useRef)(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return ya(()=>{d.current=!0,h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),V.current&&h.animationState&&h.animationState.animateChanges())}),(0,q.useEffect)(()=>{h&&(!V.current&&h.animationState&&h.animationState.animateChanges(),V.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),V.current=!1),h.enteringChildren=void 0)}),h}i(Ka,"useVisualElement");function Nu(t,e,o,r){let{layoutId:n,layout:a,drag:s,dragConstraints:l,layoutScroll:u,layoutRoot:c,layoutAnchor:m,layoutCrossfade:f}=e;t.projection=new o(t.latestValues,e["data-framer-portal-id"]?void 0:za(t.parent)),t.projection.setOptions({layoutId:n,layout:a,alwaysMeasureLayout:!!s||l&&Gt(l),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:u,layoutRoot:c,layoutAnchor:m})}i(Nu,"createProjectionNode");function za(t){if(t)return t.options.allowProjection!==!1?t.projection:za(t.parent)}i(za,"getClosestProjectingNode");function Lr(t,{forwardMotionProps:e=!1,type:o}={},r,n){r&&wa(r);let a=o?o==="svg":Ee(t),s=a?Na:ja;function l(c,m){let f,p={...(0,Le.useContext)(br),...c,layoutId:Gu(c)},{isStatic:d}=p,h=Ra(c),g=s(c,d);if(!d&&typeof window<"u"){Wu(p,r);let x=Uu(p);f=x.MeasureLayout,h.visualElement=Ka(t,g,p,n,x.ProjectionNode,a)}return(0,Rr.jsxs)(Nt.Provider,{value:h,children:[f&&h.visualElement?(0,Rr.jsx)(f,{visualElement:h.visualElement,...p}):null,Oa(t,c,Wa(g,h.visualElement,m),g,d,e,a)]})}i(l,"MotionDOMComponent"),l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;let u=(0,Le.forwardRef)(l);return u[Ga]=t,u}i(Lr,"createMotionComponent");function Gu({layoutId:t}){let e=(0,Le.useContext)(Sr).id;return e&&t!==void 0?e+"-"+t:t}i(Gu,"useLayoutId");function Wu(t,e){let o=(0,Le.useContext)(wr).strict}i(Wu,"useStrictMode");function Uu(t){let e=Ar(),{drag:o,layout:r}=e;if(!o&&!r)return{};let n={...o,...r};return{MeasureLayout:o?.isEnabled(t)||r?.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}i(Uu,"getProjectionFunctionality");function Ha(t,e){if(typeof Proxy>"u")return Lr;let o=new Map,r=i((a,s)=>Lr(a,s,t,e),"factory"),n=i((a,s)=>r(a,s),"deprecatedFactoryFunction");return new Proxy(n,{get:i((a,s)=>s==="create"?r:(o.has(s)||o.set(s,Lr(s,void 0,t,e)),o.get(s)),"get")})}i(Ha,"createMotionProxy");var $a=F(G(),1);var _a=i((t,e)=>e.isSVG??Ee(t)?new To(e):new go(e,{allowProjection:t!==$a.Fragment}),"createDomVisualElement");var kr=class extends z{static{i(this,"AnimationFeature")}constructor(e){super(e),e.animationState||(e.animationState=Gi(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();bt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:o}=this.node.prevProps||{};e!==o&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};var Ku=0,Br=class extends z{static{i(this,"ExitAnimationFeature")}constructor(){super(...arguments),this.id=Ku++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:o}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){let{initial:a,custom:s}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){let l=Q(this.node,a,s);if(l){let{transition:u,transitionEnd:c,...m}=l;for(let f in m)this.node.getValue(f)?.jump(m[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let n=this.node.animationState.setActive("exit",!e);o&&!e&&n.then(()=>{this.isExitComplete=!0,o(this.id)})}mount(){let{register:e,onExitComplete:o}=this.node.presenceContext||{};o&&o(this.id),e&&(this.unmount=e(this.id))}unmount(){}};var Ya={animation:{Feature:kr},exit:{Feature:Br}};function At(t){return{point:{x:t.pageX,y:t.pageY}}}i(At,"extractEventInfo");var Xa=i(t=>e=>Qt(e)&&t(e,At(e)),"addPointerInfo");function Wt(t,e,o,r){return xt(t,e,Xa(o),r)}i(Wt,"addPointerEvent");var Ir=i(({current:t})=>t?t.ownerDocument.defaultView:null,"getContextWindow");var qa=i((t,e)=>Math.abs(t-e),"distance");function Za(t,e){let o=qa(t.x,e.x),r=qa(t.y,e.y);return Math.sqrt(o**2+r**2)}i(Za,"distance2D");var Ja=new Set(["auto","scroll"]),ke=class{static{i(this,"PanSession")}constructor(e,o,{transformPagePoint:r,contextWindow:n=window,dragSnapToOrigin:a=!1,distanceThreshold:s=3,element:l}={}){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=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Fr(this.lastRawMoveEventInfo,this.transformPagePoint));let h=on(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=Za(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;let{point:y}=h,{timestamp:V}=O;this.history.push({...y,timestamp:V});let{onStart:T,onMove:S}=this.handlers;g||(T&&T(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=Fr(g,this.transformPagePoint),w.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();let{onEnd:x,onSessionEnd:y,resumeAnimation:V}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&V&&V(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let T=on(h.type==="pointercancel"?this.lastMoveEventInfo:Fr(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,T),y&&y(h,T)},!Qt(e))return;this.dragSnapToOrigin=a,this.handlers=o,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=n||window;let u=At(e),c=Fr(u,this.transformPagePoint),{point:m}=c,{timestamp:f}=O;this.history=[{...m,timestamp:f}];let{onSessionStart:p}=o;p&&p(e,on(c,this.history));let d={passive:!0,capture:!0};this.removeListeners=lt(Wt(this.contextWindow,"pointermove",this.handlePointerMove,d),Wt(this.contextWindow,"pointerup",this.handlePointerUp,d),Wt(this.contextWindow,"pointercancel",this.handlePointerUp,d)),l&&this.startScrollTracking(l)}startScrollTracking(e){let o=e.parentElement;for(;o;){let r=getComputedStyle(o);(Ja.has(r.overflowX)||Ja.has(r.overflowY))&&this.scrollPositions.set(o,{x:o.scrollLeft,y:o.scrollTop}),o=o.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 o=this.scrollPositions.get(e);if(!o)return;let r=e===window,n=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:n.x-o.x,y:n.y-o.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,n),w.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),J(this.updatePoint)}};function Fr(t,e){return e?{point:e(t.point)}:t}i(Fr,"transformPoint");function Qa(t,e){return{x:t.x-e.x,y:t.y-e.y}}i(Qa,"subtractPoint");function on({point:t},e){return{point:t,delta:Qa(t,tl(e)),offset:Qa(t,zu(e)),velocity:Hu(e,.1)}}i(on,"getPanInfo");function zu(t){return t[0]}i(zu,"startDevicePoint");function tl(t){return t[t.length-1]}i(tl,"lastDevicePoint");function Hu(t,e){if(t.length<2)return{x:0,y:0};let o=t.length-1,r=null,n=tl(t);for(;o>=0&&(r=t[o],!(n.timestamp-r.timestamp>j(e)));)o--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&n.timestamp-r.timestamp>j(e)*2&&(r=t[1]);let a=H(n.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let s={x:(n.x-r.x)/a,y:(n.y-r.y)/a};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}i(Hu,"getVelocity");function nl(t,{min:e,max:o},r){return e!==void 0&&t<e?t=r?A(e,t,r.min):Math.max(t,e):o!==void 0&&t>o&&(t=r?A(o,t,r.max):Math.min(t,o)),t}i(nl,"applyConstraints");function el(t,e,o){return{min:e!==void 0?t.min+e:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}i(el,"calcRelativeAxisConstraints");function sl(t,{top:e,left:o,bottom:r,right:n}){return{x:el(t.x,o,n),y:el(t.y,e,r)}}i(sl,"calcRelativeConstraints");function ol(t,e){let o=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([o,r]=[r,o]),{min:o,max:r}}i(ol,"calcViewportAxisConstraints");function al(t,e){return{x:ol(t.x,e.x),y:ol(t.y,e.y)}}i(al,"calcViewportConstraints");function ll(t,e){let o=.5,r=W(t),n=W(e);return n>r?o=ft(e.min,e.max-r,t.min):r>n&&(o=ft(t.min,t.max-n,e.min)),U(0,1,o)}i(ll,"calcOrigin");function cl(t,e){let o={};return e.min!==void 0&&(o.min=e.min-t.min),e.max!==void 0&&(o.max=e.max-t.min),o}i(cl,"rebaseAxisConstraints");var Or=.35;function ul(t=Or){return t===!1?t=0:t===!0&&(t=Or),{x:rl(t,"left","right"),y:rl(t,"top","bottom")}}i(ul,"resolveDragElastic");function rl(t,e,o){return{min:il(t,e),max:il(t,o)}}i(rl,"resolveAxisElastic");function il(t,e){return typeof t=="number"?t:t[e]||0}i(il,"resolvePointElastic");var $u=new WeakMap,Nr=class{static{i(this,"VisualElementDragControls")}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=L(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:o=!1,distanceThreshold:r}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let a=i(f=>{o&&this.snapToCursor(At(f).point),this.stopAnimation()},"onSessionStart"),s=i((f,p)=>{let{drag:d,dragPropagation:h,onDragStart:g}=this.getProps();if(d&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vi(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tt(y=>{let V=this.getAxisMotionValue(y).get()||0;if(Y.test(V)){let{projection:T}=this.visualElement;if(T&&T.layout){let S=T.layout.layoutBox[y];S&&(V=W(S)*(parseFloat(V)/100))}}this.originPoint[y]=V}),g&&w.update(()=>g(f,p),!1,!0),Te(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},"onStart"),l=i((f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p;let{dragPropagation:d,dragDirectionLock:h,onDirectionLock:g,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;let{offset:y}=p;if(h&&this.currentDirection===null){this.currentDirection=Yu(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",p.point,y),this.updateAxis("y",p.point,y),this.visualElement.render(),x&&w.update(()=>x(f,p),!1,!0)},"onMove"),u=i((f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p,this.stop(f,p),this.latestPointerEvent=null,this.latestPanInfo=null},"onSessionEnd"),c=i(()=>{let{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},"resumeAnimation"),{dragSnapToOrigin:m}=this.getProps();this.panSession=new ke(e,{onSessionStart:a,onStart:s,onMove:l,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:Ir(this.visualElement),element:this.visualElement.current})}stop(e,o){let r=e||this.latestPointerEvent,n=o||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!n||!r)return;let{velocity:s}=n;this.startAnimation(s);let{onDragEnd:l}=this.getProps();l&&w.postRender(()=>l(r,n))}cancel(){this.isDragging=!1;let{projection:e,animationState:o}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),o&&o.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,o,r){let{drag:n}=this.getProps();if(!r||!jr(e,n,this.currentDirection))return;let a=this.getAxisMotionValue(e),s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=nl(s,this.constraints[e],this.elastic[e])),a.set(s)}resolveConstraints(){let{dragConstraints:e,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;e&&Gt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=sl(r.layoutBox,e):this.constraints=!1,this.elastic=ul(o),n!==this.constraints&&!Gt(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&tt(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=cl(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:o}=this.getProps();if(!e||!Gt(e))return!1;let r=e.current;ot(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;n.root&&(n.root.scroll=void 0,n.root.updateScroll());let a=Oi(r,n.root,this.visualElement.getTransformPagePoint()),s=al(n.layout.layoutBox,a);if(o){let l=o(Ri(s));this.hasMutatedConstraints=!!l,l&&(s=uo(l))}return s}startAnimation(e){let{drag:o,dragMomentum:r,dragElastic:n,dragTransition:a,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},c=tt(m=>{if(!jr(m,o,this.currentDirection))return;let f=u&&u[m]||{};(s===!0||s===m)&&(f={min:0,max:0});let p=n?200:1e6,d=n?40:1e7,h={type:"inertia",velocity:r?e[m]:0,bounceStiffness:p,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...f};return this.startAxisValueAnimation(m,h)});return Promise.all(c).then(l)}startAxisValueAnimation(e,o){let r=this.getAxisMotionValue(e);return Te(this.visualElement,e),r.start(Xt(e,r,0,o,this.visualElement,!1))}stopAnimation(){tt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let o=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps()[o];return n||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){tt(o=>{let{drag:r}=this.getProps();if(!jr(o,r,this.currentDirection))return;let{projection:n}=this.visualElement,a=this.getAxisMotionValue(o);if(n&&n.layout){let{min:s,max:l}=n.layout.layoutBox[o],u=a.get()||0;a.set(e[o]-A(s,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:o}=this.getProps(),{projection:r}=this.visualElement;if(!Gt(o)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};tt(s=>{let l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){let u=l.get();n[s]=ll({min:u,max:u},this.constraints[s])}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),tt(s=>{if(!jr(s,e,null))return;let l=this.getAxisMotionValue(s),{min:u,max:c}=this.constraints[s];l.set(A(u,c,n[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$u.set(this.visualElement,this);let e=this.visualElement.current,o=Wt(e,"pointerdown",c=>{let{drag:m,dragListener:f=!0}=this.getProps(),p=c.target,d=p!==e&&wi(p);m&&f&&!d&&this.start(c)}),r,n=i(()=>{let{dragConstraints:c}=this.getProps();Gt(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=_u(e,c.current,()=>this.scalePositionWithinConstraints())))},"measureDragConstraints"),{projection:a}=this.visualElement,s=a.addEventListener("measure",n);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),w.read(n);let l=xt(window,"resize",()=>this.scalePositionWithinConstraints()),u=a.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:m})=>{this.isDragging&&m&&(tt(f=>{let p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=c[f].translate,p.set(p.get()+c[f].translate))}),this.visualElement.render())}));return()=>{l(),o(),s(),u&&u(),r&&r()}}getProps(){let e=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:a=!1,dragElastic:s=Or,dragMomentum:l=!0}=e;return{...e,drag:o,dragDirectionLock:r,dragPropagation:n,dragConstraints:a,dragElastic:s,dragMomentum:l}}};function ml(t){let e=!0;return()=>{if(e){e=!1;return}t()}}i(ml,"skipFirstCall");function _u(t,e,o){let r=ur(t,ml(o)),n=ur(e,ml(o));return()=>{r(),n()}}i(_u,"startResizeObservers");function jr(t,e,o){return(e===!0||e===t)&&(o===null||o===t)}i(jr,"shouldDrag");function Yu(t,e=10){let o=null;return Math.abs(t.y)>e?o="y":Math.abs(t.x)>e&&(o="x"),o}i(Yu,"getCurrentDirection");var Gr=class extends z{static{i(this,"DragGesture")}constructor(e){super(e),this.removeGroupControls=k,this.removeListeners=k,this.controls=new Nr(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||k}update(){let{dragControls:e}=this.node.getProps(),{dragControls:o}=this.node.prevProps||{};e!==o&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};var rn=i(t=>(e,o)=>{t&&w.update(()=>t(e,o),!1,!0)},"asyncHandler"),Wr=class extends z{static{i(this,"PanGesture")}constructor(){super(...arguments),this.removePointerDownListener=k}onPointerDown(e){this.session=new ke(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ir(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:o,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:rn(e),onStart:rn(o),onMove:rn(r),onEnd:i((a,s)=>{delete this.session,n&&w.postRender(()=>n(a,s))},"onEnd")}}mount(){this.removePointerDownListener=Wt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var fl=F(mn(),1);var Po=F(G(),1);var nn=!1,sn=class extends Po.Component{static{i(this,"MeasureLayoutWithContext")}componentDidMount(){let{visualElement:e,layoutGroup:o,switchLayoutGroup:r,layoutId:n}=this.props,{projection:a}=e;a&&(o.group&&o.group.add(a),r&&r.register&&n&&r.register(a),nn&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:i(()=>this.safeToRemove(),"onExitComplete")})),ae.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:o,visualElement:r,drag:n,isPresent:a}=this.props,{projection:s}=r;return s&&(s.isPresent=a,e.layoutDependency!==o&&s.setOptions({...s.options,layoutDependency:o}),nn=!0,n||e.layoutDependency!==o||o===void 0||e.isPresent!==a?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||w.postRender(()=>{let l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:e,layoutAnchor:o}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=o,r.root.didUpdate(),Jt.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:o,switchLayoutGroup:r}=this.props,{projection:n}=e;nn=!0,n&&(n.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ur(t){let[e,o]=Va(),r=(0,Po.useContext)(Sr);return(0,fl.jsx)(sn,{...t,layoutGroup:r,switchLayoutGroup:(0,Po.useContext)(Er),isPresent:e,safeToRemove:o})}i(Ur,"MeasureLayout");var pl={pan:{Feature:Wr},drag:{Feature:Gr,ProjectionNode:Vo,MeasureLayout:Ur}};function hl(t,e,o){let{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",o==="Start");let n="onHover"+o,a=r[n];a&&w.postRender(()=>a(e,At(e)))}i(hl,"handleHoverEvent");var Kr=class extends z{static{i(this,"HoverGesture")}mount(){let{current:e}=this.node;e&&(this.unmount=Si(e,(o,r)=>(hl(this.node,r,"Start"),n=>hl(this.node,n,"End"))))}unmount(){}};var zr=class extends z{static{i(this,"FocusGesture")}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=lt(xt(this.node.current,"focus",()=>this.onFocus()),xt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function dl(t,e,o){let{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",o==="Start");let n="onTap"+(o==="End"?"":o),a=r[n];a&&w.postRender(()=>a(e,At(e)))}i(dl,"handlePressEvent");var Hr=class extends z{static{i(this,"PressGesture")}mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:o,propagate:r}=this.node.props;this.unmount=Mi(e,(n,a)=>(dl(this.node,a,"Start"),(s,{success:l})=>dl(this.node,s,l?"End":"Cancel")),{useGlobalTarget:o,stopPropagation:r?.tap===!1})}unmount(){}};var ln=new WeakMap,an=new WeakMap,Xu=i(t=>{let e=ln.get(t.target);e&&e(t)},"fireObserverCallback"),qu=i(t=>{t.forEach(Xu)},"fireAllObserverCallbacks");function Zu({root:t,...e}){let o=t||document;an.has(o)||an.set(o,{});let r=an.get(o),n=JSON.stringify(e);return r[n]||(r[n]=new IntersectionObserver(qu,{root:t,...e})),r[n]}i(Zu,"initIntersectionObserver");function gl(t,e,o){let r=Zu(e);return ln.set(t,o),r.observe(t),()=>{ln.delete(t),r.unobserve(t)}}i(gl,"observeIntersection");var Ju={some:0,all:1},$r=class extends z{static{i(this,"InViewFeature")}constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:o,margin:r,amount:n="some",once:a}=e,s={root:o?o.current:void 0,rootMargin:r,threshold:typeof n=="number"?n:Ju[n]},l=i(u=>{let{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);let{onViewportEnter:m,onViewportLeave:f}=this.node.getProps(),p=c?m:f;p&&p(u)},"onIntersectionUpdate");this.stopObserver=gl(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:e,prevProps:o}=this.node;["amount","margin","root"].some(Qu(e,o))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Qu({viewport:t={}},{viewport:e={}}={}){return o=>t[o]!==e[o]}i(Qu,"hasViewportOptionChanged");var xl={inView:{Feature:$r},tap:{Feature:Hr},focus:{Feature:zr},hover:{Feature:Kr}};var yl={layout:{ProjectionNode:Vo,MeasureLayout:Ur}};var vl={...Ya,...xl,...pl,...yl};var cn=Ha(vl,_a);var CD=cn;export{Ru as a,CD as b};
@@ -1 +1 @@
1
- import{a as Y}from"./chunk-AREBQI6D.js";import{a as V}from"./chunk-3CWGJYBB.js";import{a as G}from"./chunk-RMN2JN4S.js";import{b as Q}from"./chunk-GRL5MG3Z.js";import{a as z}from"./chunk-SFDOII3B.js";import{e as P}from"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{b as Z,c as ee}from"./chunk-ZZJ7VUVZ.js";import{a as _,b as W}from"./chunk-BN4CIAXU.js";import{c as U}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import"./chunk-465RIA2L.js";import"./chunk-XXQUMVWH.js";import"./chunk-O3UMJLO3.js";import"./chunk-QLQADHFE.js";import{a as I}from"./chunk-VDW32UET.js";import{c as M}from"./chunk-ZNAGZU6H.js";import{f as B}from"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import"./chunk-MIQTKZAR.js";import"./chunk-UZERI5YC.js";import{d as A,f as H,g as K,o as k}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as l,e as L,f as fe,g as he,h as me}from"./chunk-3XIESWL4.js";var j=L(he(),1);var u=L(fe(),1);var $=L(me(),1);var pe=l(t=>{let{suggestedIndex:e,table:r}=t;return!(typeof r!="string"||r.length===0||typeof e!="object"||e===null||!Array.isArray(e.fields)||e.fields.length===0)},"pe"),be=l((t,e,r)=>{let a=`"${t}"`,n=`"${e}"`,o=r.map(c=>`"${c}"`).join(", ");return`CREATE INDEX IF NOT EXISTS ${n} ON ${a} (${o});`},"ge"),ge=l(t=>{let e=(0,j.c)(19),{fields:r,indexName:a,table:n,testId:o}=t,c=A(),[T,p]=(0,u.useState)(!1),f;e[0]!==r||e[1]!==a||e[2]!==n?(f=l(()=>{let S="navigator"in globalThis?globalThis.navigator.clipboard:void 0;if(S===void 0)return;let y=be(n,a,r);k(S.writeText(y)),p(!0)},"d"),e[0]=r,e[1]=a,e[2]=n,e[3]=f):f=e[3];let v=f;if(T){let S=`${o}-applied`,y;e[4]!==c?(y=c("CREATE INDEX SQL copied to clipboard."),e[4]=c,e[5]=y):y=e[5];let E;return e[6]!==S||e[7]!==y?(E=(0,$.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":S,children:y}),e[6]=S,e[7]=y,e[8]=E):E=e[8],E}let w;e[9]!==c?(w=c("Apply?"),e[9]=c,e[10]=w):w=e[10];let h;e[11]!==c||e[12]!==n?(h=c("Apply index on {table}",{table:n}),e[11]=c,e[12]=n,e[13]=h):h=e[13];let x;return e[14]!==v||e[15]!==w||e[16]!==h||e[17]!==o?(x=(0,$.jsx)(Y,{confirmLabel:w,onConfirm:v,testId:o,children:h}),e[14]=v,e[15]=w,e[16]=h,e[17]=o,e[18]=x):x=e[18],x},"be"),ve=l((t,e)=>{let r=new Map;for(let a of e){let n=`${a.table} ${a.index}`;r.set(n,(r.get(n)??0)+a.reads)}return t.map(a=>({index:a.index,reads:r.get(`${a.table} ${a.index}`)??0,table:a.table}))},"xe"),xe=l(t=>{let e=new Map;for(let r of t)for(let a of r.scannedTables??[])e.set(a.table,(e.get(a.table)??0)+a.scans);return[...e].map(([r,a])=>({scans:a,table:r}))},"ye"),te=l((t,e)=>e.map(r=>({index:r.name,table:t})),"X"),ye=l(t=>{let e=ve(t.declaredIndexes??[],t.indexHits??[]),r=xe(t.functions??[]),a=t.shardTraffic??[],n=t.analyticsMetrics,o=n&&n.indexHits.length>0?n.indexHits:e,c=n&&n.tableScans.length>0?n.tableScans:r,T=n&&n.shardTraffic.length>0?n.shardTraffic:a,p=ee({indexHits:o,schema:{tables:[]},shardTraffic:T,tableScans:c},{lints:Z,source:"runtime"}),f=t.suppressHotScanTables;return(f===void 0?p:p.filter(v=>!(v.metadata.kind==="hot_scan"&&typeof v.metadata.table=="string"&&f.has(v.metadata.table)))).map(v=>_(v))},"ve"),we=H(I.listTables),Se=H(I.listTableIndexes),Te=H(I.listTablesIndexes),q=l(t=>`${(t*100).toFixed(1)}%`,"K"),ae=l(t=>`${(t/1e3).toFixed(2)}s`,"B"),$e=l(t=>{if(t.length<=1)return t[0]??"";let e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`},"Te"),Ie=l((t,e)=>({"high-error-rate":t("High error rate"),"high-evictions":t("High cache eviction rate"),"high-write-contention":t("High write contention"),"low-cache-hit-rate":t("Low cache hit rate"),"missing-index":t("Missing index"),"slow-function":t("Slow function")})[e.kind],"Ie"),ne=l((t,e)=>({"high-error-rate":t("{rate} of calls failed.",{rate:q(e.value)}),"high-evictions":t("{count} entries evicted recently.",{count:e.value}),"high-write-contention":t("{rate} of calls hit a write conflict \u2014 consider sharding to cut contention.",{rate:q(e.value)}),"low-cache-hit-rate":t("{rate} hit rate over recent traffic.",{rate:q(e.value)}),"missing-index":t("Slowest call took {duration} \u2014 it full-scanned {tables} with no index.",{duration:ae(e.value),tables:$e(e.tables??[])}),"slow-function":t("Slowest call took {duration}.",{duration:ae(e.value)})})[e.kind],"J"),Ee=l(t=>{let e=(0,j.c)(10),{onJump:r,table:a}=t,n=A(),o;e[0]!==r||e[1]!==a?(o=l(()=>{r(a)},"o"),e[0]=r,e[1]=a,e[2]=o):o=e[2];let c=o,T=`in-add-index-${a}`,p;e[3]!==n||e[4]!==a?(p=n("Add index on {table}",{table:a}),e[3]=n,e[4]=a,e[5]=p):p=e[5];let f;return e[6]!==c||e[7]!==T||e[8]!==p?(f=(0,$.jsx)(U,{"data-testid":T,onClick:c,size:"sm",type:"button",variant:"outline",children:p}),e[6]=c,e[7]=T,e[8]=p,e[9]=f):f=e[9],f},"Ee"),De=l(({initialShardKey:t,loadShardTraffic:e})=>{let r=B(),a=P(),n=A(),{queryShardKey:o,setShardKey:c,shardKey:T}=V(t),[p,f]=(0,u.useState)(null),[v,w]=(0,u.useState)(null),h=(0,u.useRef)(""),x=M(I.getMetrics,{},{live:!0,shardKey:o}),S=M(I.getFunctionStats,{},{live:!0,shardKey:o}),y=M(I.getAdvisories,{},{live:!0,shardKey:o}),E=x.data??null,F=S.data?.functions??null,O=y.data?.advisories??null,re=x.data?.indexHits??null,R=x.error!==null&&S.error!==null?x.error:null,se=e??(s=>r.shardTraffic(s)),ie=l(async(s,b)=>{let i=s[0];if(i===void 0||i===""){h.current===b&&w(null);return}try{let m=await se(i);if(h.current!==b)return;let d=new Map;for(let g of m.shards)d.has(g.shardKey)||d.set(g.shardKey,{requests:g.requests,shardKey:g.shardKey});w([...d.values()])}catch{h.current===b&&w(null)}},"V"),oe=l(async(s,b)=>{let i=await Promise.allSettled(s.map(async d=>[d,await r.query(Se,{table:d},K(b))])),m=[];for(let d of i)if(d.status==="fulfilled"){let[g,N]=d.value;m.push(...te(g,N.indexes))}return m},"G"),D=(0,u.useEffectEvent)(async s=>{h.current=s;let b=[];try{let i=await r.query(we,{},K(s));if(h.current!==s)return;Q(s),b=i.map(d=>d.name);let m=[];if(b.length>0)try{let d=await r.query(Te,{tables:b},K(s));if(h.current!==s)return;for(let[g,N]of Object.entries(d.indexesByTable))m.push(...te(g,N))}catch{if(m=await oe(b,s),h.current!==s)return}f(m)}catch{h.current===s&&f(null)}await ie(b,s)});(0,u.useEffect)(()=>{k(D(o))},[o]);let le=(0,u.useEffectEvent)(()=>{x.refetch(),S.refetch(),y.refetch(),k(D(o))});(0,u.useEffect)(()=>{let s=l(()=>{document.visibilityState==="visible"&&le()},"i");return document.addEventListener("visibilitychange",s),()=>{document.removeEventListener("visibilitychange",s)}},[]);let J=(0,u.useCallback)(s=>{k(a({search:{table:s},to:"/schema"}))},[a]),C=z(E,F),ce=new Set(C.filter(s=>s.kind==="missing-index").flatMap(s=>s.tables??[])),X=ye({declaredIndexes:p??[],functions:F,indexHits:re,shardTraffic:v,suppressHotScanTables:ce}),de=(0,u.useMemo)(()=>{let s=C.map(i=>{let m=i.kind==="missing-index"?i.tables??[]:[];return{action:m.length>0?m.map(d=>(0,$.jsx)(Ee,{onJump:J,table:d},d)):void 0,description:i.message===void 0?ne(n,i):`${ne(n,i)} \u2014 ${i.message}`,entity:i.fn,issueType:Ie(n,i),key:`${i.kind}:${i.fn??""}`,level:i.severity}}),b=new Set(["unindexed_foreign_key","unindexed_relation_target"]);return[...(O??[]).map(i=>{let m=_(i);if(b.has(i.name)&&pe(i.metadata)){let{table:d,suggestedIndex:g}=i.metadata,N=`in-apply-index-${d}-${g.name}`;return{...m,action:(0,$.jsx)(ge,{fields:g.fields,indexName:g.name,table:d,testId:N})}}return m}),...X,...s]},[O,C,J,X,n]),ue=(0,$.jsx)(G,{onChange:c,testId:"in-shard-input",value:T});return(0,$.jsx)(W,{error:R,errorSource:R===null?void 0:x.errorSource,rows:de,testId:"lunora-insights",toolbar:ue})},"Je");export{De as InsightsPanel};
1
+ import{a as Y}from"./chunk-AREBQI6D.js";import{a as V}from"./chunk-3CWGJYBB.js";import{a as G}from"./chunk-RMN2JN4S.js";import{b as Q}from"./chunk-GRL5MG3Z.js";import{a as z}from"./chunk-SFDOII3B.js";import{e as P}from"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{b as Z,c as ee}from"./chunk-PLFTCTMX.js";import{a as _,b as W}from"./chunk-2KRXOCZ2.js";import{c as U}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import"./chunk-NCKRVNF2.js";import"./chunk-XXQUMVWH.js";import"./chunk-NJRW66LJ.js";import"./chunk-QLQADHFE.js";import{a as I}from"./chunk-VDW32UET.js";import{c as M}from"./chunk-6F7KP54M.js";import{f as B}from"./chunk-C2ZFQARQ.js";import"./chunk-XBDKZZ67.js";import"./chunk-WJQLNYGX.js";import"./chunk-WQH3LT2P.js";import{d as A,f as H,g as K,o as k}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as l,e as L,f as fe,g as he,h as me}from"./chunk-3XIESWL4.js";var j=L(he(),1);var u=L(fe(),1);var $=L(me(),1);var pe=l(t=>{let{suggestedIndex:e,table:r}=t;return!(typeof r!="string"||r.length===0||typeof e!="object"||e===null||!Array.isArray(e.fields)||e.fields.length===0)},"pe"),be=l((t,e,r)=>{let a=`"${t}"`,n=`"${e}"`,o=r.map(c=>`"${c}"`).join(", ");return`CREATE INDEX IF NOT EXISTS ${n} ON ${a} (${o});`},"ge"),ge=l(t=>{let e=(0,j.c)(19),{fields:r,indexName:a,table:n,testId:o}=t,c=A(),[T,p]=(0,u.useState)(!1),f;e[0]!==r||e[1]!==a||e[2]!==n?(f=l(()=>{let S="navigator"in globalThis?globalThis.navigator.clipboard:void 0;if(S===void 0)return;let y=be(n,a,r);k(S.writeText(y)),p(!0)},"d"),e[0]=r,e[1]=a,e[2]=n,e[3]=f):f=e[3];let v=f;if(T){let S=`${o}-applied`,y;e[4]!==c?(y=c("CREATE INDEX SQL copied to clipboard."),e[4]=c,e[5]=y):y=e[5];let E;return e[6]!==S||e[7]!==y?(E=(0,$.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":S,children:y}),e[6]=S,e[7]=y,e[8]=E):E=e[8],E}let w;e[9]!==c?(w=c("Apply?"),e[9]=c,e[10]=w):w=e[10];let h;e[11]!==c||e[12]!==n?(h=c("Apply index on {table}",{table:n}),e[11]=c,e[12]=n,e[13]=h):h=e[13];let x;return e[14]!==v||e[15]!==w||e[16]!==h||e[17]!==o?(x=(0,$.jsx)(Y,{confirmLabel:w,onConfirm:v,testId:o,children:h}),e[14]=v,e[15]=w,e[16]=h,e[17]=o,e[18]=x):x=e[18],x},"be"),ve=l((t,e)=>{let r=new Map;for(let a of e){let n=`${a.table} ${a.index}`;r.set(n,(r.get(n)??0)+a.reads)}return t.map(a=>({index:a.index,reads:r.get(`${a.table} ${a.index}`)??0,table:a.table}))},"xe"),xe=l(t=>{let e=new Map;for(let r of t)for(let a of r.scannedTables??[])e.set(a.table,(e.get(a.table)??0)+a.scans);return[...e].map(([r,a])=>({scans:a,table:r}))},"ye"),te=l((t,e)=>e.map(r=>({index:r.name,table:t})),"X"),ye=l(t=>{let e=ve(t.declaredIndexes??[],t.indexHits??[]),r=xe(t.functions??[]),a=t.shardTraffic??[],n=t.analyticsMetrics,o=n&&n.indexHits.length>0?n.indexHits:e,c=n&&n.tableScans.length>0?n.tableScans:r,T=n&&n.shardTraffic.length>0?n.shardTraffic:a,p=ee({indexHits:o,schema:{tables:[]},shardTraffic:T,tableScans:c},{lints:Z,source:"runtime"}),f=t.suppressHotScanTables;return(f===void 0?p:p.filter(v=>!(v.metadata.kind==="hot_scan"&&typeof v.metadata.table=="string"&&f.has(v.metadata.table)))).map(v=>_(v))},"ve"),we=H(I.listTables),Se=H(I.listTableIndexes),Te=H(I.listTablesIndexes),q=l(t=>`${(t*100).toFixed(1)}%`,"K"),ae=l(t=>`${(t/1e3).toFixed(2)}s`,"B"),$e=l(t=>{if(t.length<=1)return t[0]??"";let e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`},"Te"),Ie=l((t,e)=>({"high-error-rate":t("High error rate"),"high-evictions":t("High cache eviction rate"),"high-write-contention":t("High write contention"),"low-cache-hit-rate":t("Low cache hit rate"),"missing-index":t("Missing index"),"slow-function":t("Slow function")})[e.kind],"Ie"),ne=l((t,e)=>({"high-error-rate":t("{rate} of calls failed.",{rate:q(e.value)}),"high-evictions":t("{count} entries evicted recently.",{count:e.value}),"high-write-contention":t("{rate} of calls hit a write conflict \u2014 consider sharding to cut contention.",{rate:q(e.value)}),"low-cache-hit-rate":t("{rate} hit rate over recent traffic.",{rate:q(e.value)}),"missing-index":t("Slowest call took {duration} \u2014 it full-scanned {tables} with no index.",{duration:ae(e.value),tables:$e(e.tables??[])}),"slow-function":t("Slowest call took {duration}.",{duration:ae(e.value)})})[e.kind],"J"),Ee=l(t=>{let e=(0,j.c)(10),{onJump:r,table:a}=t,n=A(),o;e[0]!==r||e[1]!==a?(o=l(()=>{r(a)},"o"),e[0]=r,e[1]=a,e[2]=o):o=e[2];let c=o,T=`in-add-index-${a}`,p;e[3]!==n||e[4]!==a?(p=n("Add index on {table}",{table:a}),e[3]=n,e[4]=a,e[5]=p):p=e[5];let f;return e[6]!==c||e[7]!==T||e[8]!==p?(f=(0,$.jsx)(U,{"data-testid":T,onClick:c,size:"sm",type:"button",variant:"outline",children:p}),e[6]=c,e[7]=T,e[8]=p,e[9]=f):f=e[9],f},"Ee"),De=l(({initialShardKey:t,loadShardTraffic:e})=>{let r=B(),a=P(),n=A(),{queryShardKey:o,setShardKey:c,shardKey:T}=V(t),[p,f]=(0,u.useState)(null),[v,w]=(0,u.useState)(null),h=(0,u.useRef)(""),x=M(I.getMetrics,{},{live:!0,shardKey:o}),S=M(I.getFunctionStats,{},{live:!0,shardKey:o}),y=M(I.getAdvisories,{},{live:!0,shardKey:o}),E=x.data??null,F=S.data?.functions??null,O=y.data?.advisories??null,re=x.data?.indexHits??null,R=x.error!==null&&S.error!==null?x.error:null,se=e??(s=>r.shardTraffic(s)),ie=l(async(s,b)=>{let i=s[0];if(i===void 0||i===""){h.current===b&&w(null);return}try{let m=await se(i);if(h.current!==b)return;let d=new Map;for(let g of m.shards)d.has(g.shardKey)||d.set(g.shardKey,{requests:g.requests,shardKey:g.shardKey});w([...d.values()])}catch{h.current===b&&w(null)}},"V"),oe=l(async(s,b)=>{let i=await Promise.allSettled(s.map(async d=>[d,await r.query(Se,{table:d},K(b))])),m=[];for(let d of i)if(d.status==="fulfilled"){let[g,N]=d.value;m.push(...te(g,N.indexes))}return m},"G"),D=(0,u.useEffectEvent)(async s=>{h.current=s;let b=[];try{let i=await r.query(we,{},K(s));if(h.current!==s)return;Q(s),b=i.map(d=>d.name);let m=[];if(b.length>0)try{let d=await r.query(Te,{tables:b},K(s));if(h.current!==s)return;for(let[g,N]of Object.entries(d.indexesByTable))m.push(...te(g,N))}catch{if(m=await oe(b,s),h.current!==s)return}f(m)}catch{h.current===s&&f(null)}await ie(b,s)});(0,u.useEffect)(()=>{k(D(o))},[o]);let le=(0,u.useEffectEvent)(()=>{x.refetch(),S.refetch(),y.refetch(),k(D(o))});(0,u.useEffect)(()=>{let s=l(()=>{document.visibilityState==="visible"&&le()},"i");return document.addEventListener("visibilitychange",s),()=>{document.removeEventListener("visibilitychange",s)}},[]);let J=(0,u.useCallback)(s=>{k(a({search:{table:s},to:"/schema"}))},[a]),C=z(E,F),ce=new Set(C.filter(s=>s.kind==="missing-index").flatMap(s=>s.tables??[])),X=ye({declaredIndexes:p??[],functions:F,indexHits:re,shardTraffic:v,suppressHotScanTables:ce}),de=(0,u.useMemo)(()=>{let s=C.map(i=>{let m=i.kind==="missing-index"?i.tables??[]:[];return{action:m.length>0?m.map(d=>(0,$.jsx)(Ee,{onJump:J,table:d},d)):void 0,description:i.message===void 0?ne(n,i):`${ne(n,i)} \u2014 ${i.message}`,entity:i.fn,issueType:Ie(n,i),key:`${i.kind}:${i.fn??""}`,level:i.severity}}),b=new Set(["unindexed_foreign_key","unindexed_relation_target"]);return[...(O??[]).map(i=>{let m=_(i);if(b.has(i.name)&&pe(i.metadata)){let{table:d,suggestedIndex:g}=i.metadata,N=`in-apply-index-${d}-${g.name}`;return{...m,action:(0,$.jsx)(ge,{fields:g.fields,indexName:g.name,table:d,testId:N})}}return m}),...X,...s]},[O,C,J,X,n]),ue=(0,$.jsx)(G,{onChange:c,testId:"in-shard-input",value:T});return(0,$.jsx)(W,{error:R,errorSource:R===null?void 0:x.errorSource,rows:de,testId:"lunora-insights",toolbar:ue})},"Je");export{De as InsightsPanel};
@@ -1 +1 @@
1
- import{a as q}from"./chunk-54MMVNPT.js";import{a as F}from"./chunk-3CWGJYBB.js";import{a as D}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as L}from"./chunk-465RIA2L.js";import"./chunk-XXQUMVWH.js";import"./chunk-O3UMJLO3.js";import"./chunk-QLQADHFE.js";import{a as _}from"./chunk-VDW32UET.js";import{c as T}from"./chunk-ZNAGZU6H.js";import"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import{a as E}from"./chunk-XQCVZAGU.js";import{a as O,b as P,c as W,d as w,e as h,f as p}from"./chunk-MIQTKZAR.js";import{a as $,e as j}from"./chunk-UZERI5YC.js";import{d as M}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as S,e as A,g as G,h as U}from"./chunk-3XIESWL4.js";var J=A(G(),1);var t=A(U(),1);var B=80,Z=S(a=>{if(a===void 0)return"";let e=JSON.stringify(a);return e.length>B?`${e.slice(0,B)}\u2026`:e},"B"),z=S(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((l,i)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${i.toString()}`,subscription:l})})}return e},"G"),C=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),oe=S(a=>{let e=(0,J.c)(22),{initialShardKey:r}=a,n=M(),{queryShardKey:l,setShardKey:i,shardKey:u}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==l?(b={keepPreviousData:!0,shardKey:l},e[1]=l,e[2]=b):b=e[2];let{data:s,error:o,errorSource:m,refetch:R}=T(_.listSubscriptions,f,b);q(R,!0);let x;if(e[3]!==o||e[4]!==m||e[5]!==s||e[6]!==i||e[7]!==u||e[8]!==n){let k=s===void 0?[]:z(s.connections),c;e[10]!==i||e[11]!==u?(c=(0,t.jsx)(D,{onChange:i,testId:"subs-shard-input",value:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]!==s||e[14]!==n?(d=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(y,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(y,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=d):d=e[15];let g;e[16]!==c||e[17]!==d?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[16]=c,e[17]=d,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==m?(v=o!==null&&(0,t.jsx)(L,{error:m,testId:"subs-error"}),e[19]=o,e[20]=m,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&s!==void 0&&k.length===0&&(0,t.jsx)(E,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&k.length>0&&(0,t.jsx)($,{className:"overflow-hidden py-0",children:(0,t.jsx)(j,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(w,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(W,{children:k.map(N=>{let{subscription:I}=N,K=Z(I?.args);return(0,t.jsxs)(w,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",N.connectionId,N.admin&&(0,t.jsx)(y,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??C}),(0,t.jsx)(p,{children:I?.table??C}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||C})]},N.key)})})]})})})]}),e[3]=o,e[4]=m,e[5]=s,e[6]=i,e[7]=u,e[8]=n,e[9]=x}else x=e[9];return x},"oe");export{oe as default};
1
+ import{a as W}from"./chunk-54MMVNPT.js";import{a as F}from"./chunk-3CWGJYBB.js";import{a as E}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as L}from"./chunk-NCKRVNF2.js";import"./chunk-XXQUMVWH.js";import"./chunk-NJRW66LJ.js";import"./chunk-QLQADHFE.js";import{a as D}from"./chunk-VDW32UET.js";import{c as _}from"./chunk-6F7KP54M.js";import"./chunk-C2ZFQARQ.js";import"./chunk-XBDKZZ67.js";import{a as T}from"./chunk-XQCVZAGU.js";import{a as O,b as P,c as U,d as w,e as h,f as p}from"./chunk-WJQLNYGX.js";import{a as $,e as j}from"./chunk-WQH3LT2P.js";import{d as M}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as S,e as A,g as R,h as Z}from"./chunk-3XIESWL4.js";var B=A(R(),1);var t=A(Z(),1);var q=80,z=S(a=>{if(a===void 0)return"";let e=JSON.stringify(a);return e.length>q?`${e.slice(0,q)}\u2026`:e},"W"),G=S(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((l,i)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${i.toString()}`,subscription:l})})}return e},"B"),C=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),oe=S(a=>{let e=(0,B.c)(22),{initialShardKey:r}=a,n=M(),{queryShardKey:l,setShardKey:i,shardKey:m}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==l?(b={keepPreviousData:!0,shardKey:l},e[1]=l,e[2]=b):b=e[2];let{data:s,error:o,errorSource:u,refetch:J}=_(D.listSubscriptions,f,b);W(J,!0);let x;if(e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==i||e[7]!==m||e[8]!==n){let k=s===void 0?[]:G(s.connections),c;e[10]!==i||e[11]!==m?(c=(0,t.jsx)(E,{onChange:i,testId:"subs-shard-input",value:m}),e[10]=i,e[11]=m,e[12]=c):c=e[12];let d;e[13]!==s||e[14]!==n?(d=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(y,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(y,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=d):d=e[15];let g;e[16]!==c||e[17]!==d?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[16]=c,e[17]=d,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==u?(v=o!==null&&(0,t.jsx)(L,{error:u,testId:"subs-error"}),e[19]=o,e[20]=u,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&s!==void 0&&k.length===0&&(0,t.jsx)(T,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&k.length>0&&(0,t.jsx)($,{className:"overflow-hidden py-0",children:(0,t.jsx)(j,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(w,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(U,{children:k.map(N=>{let{subscription:I}=N,K=z(I?.args);return(0,t.jsxs)(w,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",N.connectionId,N.admin&&(0,t.jsx)(y,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??C}),(0,t.jsx)(p,{children:I?.table??C}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||C})]},N.key)})})]})})})]}),e[3]=o,e[4]=u,e[5]=s,e[6]=i,e[7]=m,e[8]=n,e[9]=x}else x=e[9];return x},"oe");export{oe as default};
@@ -1 +1 @@
1
- import{a as de}from"./chunk-IBVBIKUI.js";import"./chunk-S3DWUXGY.js";import"./chunk-4UOFSGUS.js";import"./chunk-ILNELDFC.js";import{d as Y,f as ee}from"./chunk-7T7UOTYK.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as T}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as te}from"./chunk-XXQUMVWH.js";import{a as X}from"./chunk-VDW32UET.js";import{f as F}from"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import{a as H}from"./chunk-XQCVZAGU.js";import{a as Q,b as U,c as D,e as V}from"./chunk-UZERI5YC.js";import{d as A,f as Z,g as G,h as J,o as P}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as k,e as O,f as ae,g as le,h as se}from"./chunk-3XIESWL4.js";var W=O(le(),1),I=O(ae(),1);var s=O(se(),1);var re=Z(X.runSql),ie=k((_,e)=>{let t=(0,W.c)(11),m=F(),[d,a]=(0,I.useState)(void 0),[r,l]=(0,I.useState)(void 0),[o,E]=(0,I.useState)(!0),c;t[0]!==m||t[1]!==e||t[2]!==_?(c=k(async u=>{E(!0);try{let N=await m.query(re,{sql:_},G(e));u.cancelled||(a(N),l(void 0))}catch(N){let $=N;u.cancelled||(a(void 0),l(J($)))}u.cancelled||E(!1)},"n"),t[0]=m,t[1]=e,t[2]=_,t[3]=c):c=t[3];let C=c,y,K;t[4]!==C?(y=k(()=>{let u={cancelled:!1};return P(C(u)),()=>{u.cancelled=!0}},"y"),K=[C],t[4]=C,t[5]=y,t[6]=K):(y=t[5],K=t[6]),(0,I.useEffect)(y,K);let h;return t[7]!==r||t[8]!==o||t[9]!==d?(h={error:r,loading:o,result:d},t[7]=r,t[8]=o,t[9]=d,t[10]=h):h=t[10],h},"re"),oe="lunora-studio-dashboards",B={shardKey:"",sql:"",title:""},ne=k(_=>{let e=(0,W.c)(54),{onEdit:t,onRemove:m,widget:d}=_,a=A(),{error:r,loading:l,result:o}=ie(d.sql,d.shardKey??""),E;e[0]!==t||e[1]!==d.id?(E=k(()=>{t(d.id)},"$"),e[0]=t,e[1]=d.id,e[2]=E):E=e[2];let c=E,C;e[3]!==m||e[4]!==d.id?(C=k(()=>{m(d.id)},"k"),e[3]=m,e[4]=d.id,e[5]=C):C=e[5];let y=C,K=`dashboards-widget-${d.id}`,h;e[6]!==d.title?(h=(0,s.jsx)(D,{className:"min-w-0 truncate",title:d.title,children:d.title}),e[6]=d.title,e[7]=h):h=e[7];let u;e[8]!==a?(u=a("Edit widget"),e[8]=a,e[9]=u):u=e[9];let N=`dashboards-widget-edit-${d.id}`,$;e[10]!==a?($=a("Edit widget"),e[10]=a,e[11]=$):$=e[11];let L;e[12]===Symbol.for("react.memo_cache_sentinel")?(L=(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 20h4L18 10l-4-4L4 16v4ZM14 6l4 4"})}),e[12]=L):L=e[12];let S;e[13]!==c||e[14]!==u||e[15]!==N||e[16]!==$?(S=(0,s.jsx)(T,{"aria-label":u,"data-testid":N,onClick:c,size:"icon-xs",title:$,type:"button",variant:"ghost",children:L}),e[13]=c,e[14]=u,e[15]=N,e[16]=$,e[17]=S):S=e[17];let x;e[18]!==a?(x=a("Remove widget"),e[18]=a,e[19]=x):x=e[19];let j=`dashboards-widget-remove-${d.id}`,g;e[20]!==a?(g=a("Remove widget"),e[20]=a,e[21]=g):g=e[21];let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[22]=w):w=e[22];let b;e[23]!==y||e[24]!==x||e[25]!==j||e[26]!==g?(b=(0,s.jsx)(T,{"aria-label":x,"data-testid":j,onClick:y,size:"icon-xs",title:g,type:"button",variant:"ghost",children:w}),e[23]=y,e[24]=x,e[25]=j,e[26]=g,e[27]=b):b=e[27];let f;e[28]!==b||e[29]!==S?(f=(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[S,b]}),e[28]=b,e[29]=S,e[30]=f):f=e[30];let p;e[31]!==f||e[32]!==h?(p=(0,s.jsxs)(U,{className:"flex flex-row items-start justify-between gap-2 border-b pb-3",children:[h,f]}),e[31]=f,e[32]=h,e[33]=p):p=e[33];let v;e[34]!==r||e[35]!==d.id?(v=r!==void 0&&(0,s.jsx)(te,{className:"font-mono text-xs",testId:`dashboards-widget-error-${d.id}`,variant:"destructive",children:r}),e[34]=r,e[35]=d.id,e[36]=v):v=e[36];let R;e[37]!==r||e[38]!==l||e[39]!==o||e[40]!==a||e[41]!==d.id?(R=r===void 0&&l&&o===void 0&&(0,s.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":`dashboards-widget-loading-${d.id}`,children:a("Running\u2026")}),e[37]=r,e[38]=l,e[39]=o,e[40]=a,e[41]=d.id,e[42]=R):R=e[42];let i;e[43]!==r||e[44]!==o?(i=r===void 0&&o!==void 0&&(0,s.jsx)(de,{result:o}),e[43]=r,e[44]=o,e[45]=i):i=e[45];let n;e[46]!==v||e[47]!==R||e[48]!==i?(n=(0,s.jsxs)(V,{className:"min-h-32 py-2",children:[v,R,i]}),e[46]=v,e[47]=R,e[48]=i,e[49]=n):n=e[49];let q;return e[50]!==p||e[51]!==n||e[52]!==K?(q=(0,s.jsxs)(Q,{"data-testid":K,children:[p,n]}),e[50]=p,e[51]=n,e[52]=K,e[53]=q):q=e[53],q},"ie"),ce=k(_=>{let e=(0,W.c)(58),{draft:t,editing:m,onCancel:d,onChange:a,onSubmit:r}=_,l=A(),o;e[0]!==t||e[1]!==a?(o=k(z=>{a({...t,title:z.target.value})},"a"),e[0]=t,e[1]=a,e[2]=o):o=e[2];let E=o,c;e[3]!==t||e[4]!==a?(c=k(z=>{a({...t,sql:z.target.value})},"n"),e[3]=t,e[4]=a,e[5]=c):c=e[5];let C=c,y;e[6]!==t||e[7]!==a?(y=k(z=>{a({...t,shardKey:z.target.value})},"y"),e[6]=t,e[7]=a,e[8]=y):y=e[8];let K=y,h;e[9]!==r?(h=k(()=>{r()},"h"),e[9]=r,e[10]=h):h=e[10];let u=h,N;e[11]!==t.sql||e[12]!==t.title?(N=t.title.trim()!==""&&t.sql.trim()!=="",e[11]=t.sql,e[12]=t.title,e[13]=N):N=e[13];let $=N,L;e[14]!==l?(L=l("Widget title"),e[14]=l,e[15]=L):L=e[15];let S;e[16]!==l?(S=l("Widget title"),e[16]=l,e[17]=S):S=e[17];let x;e[18]!==t.title||e[19]!==E||e[20]!==L||e[21]!==S?(x=(0,s.jsx)("input",{"aria-label":L,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-title",onChange:E,placeholder:S,type:"text",value:t.title}),e[18]=t.title,e[19]=E,e[20]=L,e[21]=S,e[22]=x):x=e[22];let j;e[23]!==l?(j=l("SQL query"),e[23]=l,e[24]=j):j=e[24];let g;e[25]!==t.sql||e[26]!==C||e[27]!==j?(g=(0,s.jsx)("textarea",{"aria-label":j,className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 font-mono text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-sql",onChange:C,placeholder:"SELECT author, COUNT(*) AS messages FROM \u2026",spellCheck:!1,value:t.sql}),e[25]=t.sql,e[26]=C,e[27]=j,e[28]=g):g=e[28];let w;e[29]!==l?(w=l("Shard key (optional)"),e[29]=l,e[30]=w):w=e[30];let b;e[31]!==l?(b=l("Shard key (optional)"),e[31]=l,e[32]=b):b=e[32];let f;e[33]!==t.shardKey||e[34]!==K||e[35]!==w||e[36]!==b?(f=(0,s.jsx)("input",{"aria-label":w,className:"h-8 rounded-md border border-border bg-background px-2 font-mono text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-shard",onChange:K,placeholder:b,type:"text",value:t.shardKey}),e[33]=t.shardKey,e[34]=K,e[35]=w,e[36]=b,e[37]=f):f=e[37];let p;e[38]!==l?(p=l("Cancel"),e[38]=l,e[39]=p):p=e[39];let v;e[40]!==d||e[41]!==p?(v=(0,s.jsx)(T,{"data-testid":"dashboards-form-cancel",onClick:d,size:"sm",type:"button",variant:"outline",children:p}),e[40]=d,e[41]=p,e[42]=v):v=e[42];let R=!$,i;e[43]!==m||e[44]!==l?(i=l(m?"Save widget":"Add widget"),e[43]=m,e[44]=l,e[45]=i):i=e[45];let n;e[46]!==u||e[47]!==R||e[48]!==i?(n=(0,s.jsx)(T,{"data-testid":"dashboards-form-save",disabled:R,onClick:u,size:"sm",type:"button",children:i}),e[46]=u,e[47]=R,e[48]=i,e[49]=n):n=e[49];let q;e[50]!==v||e[51]!==n?(q=(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[v,n]}),e[50]=v,e[51]=n,e[52]=q):q=e[52];let M;return e[53]!==g||e[54]!==f||e[55]!==q||e[56]!==x?(M=(0,s.jsx)(Q,{"data-testid":"dashboards-form",children:(0,s.jsxs)(V,{className:"flex flex-col gap-3 py-4",children:[x,g,f,q]})}),e[53]=g,e[54]=f,e[55]=q,e[56]=x,e[57]=M):M=e[57],M},"ae"),we=k(_=>{let e=(0,W.c)(39),{initialShardKey:t}=_,m=A(),[d,a]=Y(oe),[r,l]=(0,I.useState)(B),[o,E]=(0,I.useState)(null),[c,C]=(0,I.useState)(!1),y;e[0]!==t?(y=k(()=>{E(null),l({...B,shardKey:t??""}),C(!0)},"y"),e[0]=t,e[1]=y):y=e[1];let K=y,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=k(()=>{C(!1),E(null),l(B)},"h"),e[2]=h):h=e[2];let u=h,N;e[3]!==d?(N=k(i=>{let n=d.find(q=>q.id===i);n!==void 0&&(E(i),l({shardKey:n.shardKey??"",sql:n.sql,title:n.title}),C(!0))},"C"),e[3]=d,e[4]=N):N=e[4];let $=N,L;e[5]!==a?(L=k(i=>{a(n=>n.filter(q=>q.id!==i))},"K"),e[5]=a,e[6]=L):L=e[6];let S=L,x;e[7]!==r.shardKey||e[8]!==r.sql||e[9]!==r.title||e[10]!==o||e[11]!==a?(x=k(()=>{let i=r.title.trim(),n=r.sql.trim();if(i===""||n==="")return;let q=r.shardKey.trim();a(o===null?M=>[...M,{id:ee("w"),shardKey:q,sql:n,title:i}]:M=>M.map(z=>z.id===o?{...z,shardKey:q,sql:n,title:i}:z)),u()},"x"),e[7]=r.shardKey,e[8]=r.sql,e[9]=r.title,e[10]=o,e[11]=a,e[12]=x):x=e[12];let j=x,g;e[13]!==m?(g=m("Chart widgets backed by saved read-only SQL queries."),e[13]=m,e[14]=g):g=e[14];let w;e[15]!==g?(w=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:g}),e[15]=g,e[16]=w):w=e[16];let b;e[17]!==c||e[18]!==K||e[19]!==m?(b=!c&&(0,s.jsx)(T,{"data-testid":"dashboards-add",onClick:K,size:"sm",type:"button",children:m("Add widget")}),e[17]=c,e[18]=K,e[19]=m,e[20]=b):b=e[20];let f;e[21]!==w||e[22]!==b?(f=(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[w,b]}),e[21]=w,e[22]=b,e[23]=f):f=e[23];let p;e[24]!==r||e[25]!==o||e[26]!==c||e[27]!==j?(p=c&&(0,s.jsx)(ce,{draft:r,editing:o!==null,onCancel:u,onChange:l,onSubmit:j}),e[24]=r,e[25]=o,e[26]=c,e[27]=j,e[28]=p):p=e[28];let v;e[29]!==c||e[30]!==$||e[31]!==S||e[32]!==m||e[33]!==d?(v=d.length===0&&!c?(0,s.jsx)(H,{description:m("Add a widget to chart a saved SQL query on this browser."),testId:"dashboards-empty",title:m("No widgets yet")}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3","data-testid":"dashboards-grid",children:d.map(i=>(0,s.jsx)(ne,{onEdit:$,onRemove:S,widget:i},i.id))}),e[29]=c,e[30]=$,e[31]=S,e[32]=m,e[33]=d,e[34]=v):v=e[34];let R;return e[35]!==p||e[36]!==v||e[37]!==f?(R=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-dashboards",children:[f,p,v]}),e[35]=p,e[36]=v,e[37]=f,e[38]=R):R=e[38],R},"we");export{we as default};
1
+ import{a as de}from"./chunk-ATLV7KWK.js";import"./chunk-OQIGV6FX.js";import"./chunk-4UOFSGUS.js";import"./chunk-CZZWYUTR.js";import{d as Y,f as ee}from"./chunk-7T7UOTYK.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as T}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as te}from"./chunk-XXQUMVWH.js";import{a as X}from"./chunk-VDW32UET.js";import{f as F}from"./chunk-C2ZFQARQ.js";import"./chunk-XBDKZZ67.js";import{a as H}from"./chunk-XQCVZAGU.js";import{a as Q,b as U,c as D,e as V}from"./chunk-WQH3LT2P.js";import{d as A,f as Z,g as G,h as J,o as P}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as k,e as O,f as ae,g as le,h as se}from"./chunk-3XIESWL4.js";var W=O(le(),1),I=O(ae(),1);var s=O(se(),1);var re=Z(X.runSql),ie=k((_,e)=>{let t=(0,W.c)(11),m=F(),[d,a]=(0,I.useState)(void 0),[r,l]=(0,I.useState)(void 0),[o,E]=(0,I.useState)(!0),c;t[0]!==m||t[1]!==e||t[2]!==_?(c=k(async u=>{E(!0);try{let N=await m.query(re,{sql:_},G(e));u.cancelled||(a(N),l(void 0))}catch(N){let $=N;u.cancelled||(a(void 0),l(J($)))}u.cancelled||E(!1)},"n"),t[0]=m,t[1]=e,t[2]=_,t[3]=c):c=t[3];let C=c,y,K;t[4]!==C?(y=k(()=>{let u={cancelled:!1};return P(C(u)),()=>{u.cancelled=!0}},"y"),K=[C],t[4]=C,t[5]=y,t[6]=K):(y=t[5],K=t[6]),(0,I.useEffect)(y,K);let h;return t[7]!==r||t[8]!==o||t[9]!==d?(h={error:r,loading:o,result:d},t[7]=r,t[8]=o,t[9]=d,t[10]=h):h=t[10],h},"re"),oe="lunora-studio-dashboards",B={shardKey:"",sql:"",title:""},ne=k(_=>{let e=(0,W.c)(54),{onEdit:t,onRemove:m,widget:d}=_,a=A(),{error:r,loading:l,result:o}=ie(d.sql,d.shardKey??""),E;e[0]!==t||e[1]!==d.id?(E=k(()=>{t(d.id)},"$"),e[0]=t,e[1]=d.id,e[2]=E):E=e[2];let c=E,C;e[3]!==m||e[4]!==d.id?(C=k(()=>{m(d.id)},"k"),e[3]=m,e[4]=d.id,e[5]=C):C=e[5];let y=C,K=`dashboards-widget-${d.id}`,h;e[6]!==d.title?(h=(0,s.jsx)(D,{className:"min-w-0 truncate",title:d.title,children:d.title}),e[6]=d.title,e[7]=h):h=e[7];let u;e[8]!==a?(u=a("Edit widget"),e[8]=a,e[9]=u):u=e[9];let N=`dashboards-widget-edit-${d.id}`,$;e[10]!==a?($=a("Edit widget"),e[10]=a,e[11]=$):$=e[11];let L;e[12]===Symbol.for("react.memo_cache_sentinel")?(L=(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 20h4L18 10l-4-4L4 16v4ZM14 6l4 4"})}),e[12]=L):L=e[12];let S;e[13]!==c||e[14]!==u||e[15]!==N||e[16]!==$?(S=(0,s.jsx)(T,{"aria-label":u,"data-testid":N,onClick:c,size:"icon-xs",title:$,type:"button",variant:"ghost",children:L}),e[13]=c,e[14]=u,e[15]=N,e[16]=$,e[17]=S):S=e[17];let x;e[18]!==a?(x=a("Remove widget"),e[18]=a,e[19]=x):x=e[19];let j=`dashboards-widget-remove-${d.id}`,g;e[20]!==a?(g=a("Remove widget"),e[20]=a,e[21]=g):g=e[21];let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[22]=w):w=e[22];let b;e[23]!==y||e[24]!==x||e[25]!==j||e[26]!==g?(b=(0,s.jsx)(T,{"aria-label":x,"data-testid":j,onClick:y,size:"icon-xs",title:g,type:"button",variant:"ghost",children:w}),e[23]=y,e[24]=x,e[25]=j,e[26]=g,e[27]=b):b=e[27];let f;e[28]!==b||e[29]!==S?(f=(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[S,b]}),e[28]=b,e[29]=S,e[30]=f):f=e[30];let p;e[31]!==f||e[32]!==h?(p=(0,s.jsxs)(U,{className:"flex flex-row items-start justify-between gap-2 border-b pb-3",children:[h,f]}),e[31]=f,e[32]=h,e[33]=p):p=e[33];let v;e[34]!==r||e[35]!==d.id?(v=r!==void 0&&(0,s.jsx)(te,{className:"font-mono text-xs",testId:`dashboards-widget-error-${d.id}`,variant:"destructive",children:r}),e[34]=r,e[35]=d.id,e[36]=v):v=e[36];let R;e[37]!==r||e[38]!==l||e[39]!==o||e[40]!==a||e[41]!==d.id?(R=r===void 0&&l&&o===void 0&&(0,s.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":`dashboards-widget-loading-${d.id}`,children:a("Running\u2026")}),e[37]=r,e[38]=l,e[39]=o,e[40]=a,e[41]=d.id,e[42]=R):R=e[42];let i;e[43]!==r||e[44]!==o?(i=r===void 0&&o!==void 0&&(0,s.jsx)(de,{result:o}),e[43]=r,e[44]=o,e[45]=i):i=e[45];let n;e[46]!==v||e[47]!==R||e[48]!==i?(n=(0,s.jsxs)(V,{className:"min-h-32 py-2",children:[v,R,i]}),e[46]=v,e[47]=R,e[48]=i,e[49]=n):n=e[49];let q;return e[50]!==p||e[51]!==n||e[52]!==K?(q=(0,s.jsxs)(Q,{"data-testid":K,children:[p,n]}),e[50]=p,e[51]=n,e[52]=K,e[53]=q):q=e[53],q},"ie"),ce=k(_=>{let e=(0,W.c)(58),{draft:t,editing:m,onCancel:d,onChange:a,onSubmit:r}=_,l=A(),o;e[0]!==t||e[1]!==a?(o=k(z=>{a({...t,title:z.target.value})},"a"),e[0]=t,e[1]=a,e[2]=o):o=e[2];let E=o,c;e[3]!==t||e[4]!==a?(c=k(z=>{a({...t,sql:z.target.value})},"n"),e[3]=t,e[4]=a,e[5]=c):c=e[5];let C=c,y;e[6]!==t||e[7]!==a?(y=k(z=>{a({...t,shardKey:z.target.value})},"y"),e[6]=t,e[7]=a,e[8]=y):y=e[8];let K=y,h;e[9]!==r?(h=k(()=>{r()},"h"),e[9]=r,e[10]=h):h=e[10];let u=h,N;e[11]!==t.sql||e[12]!==t.title?(N=t.title.trim()!==""&&t.sql.trim()!=="",e[11]=t.sql,e[12]=t.title,e[13]=N):N=e[13];let $=N,L;e[14]!==l?(L=l("Widget title"),e[14]=l,e[15]=L):L=e[15];let S;e[16]!==l?(S=l("Widget title"),e[16]=l,e[17]=S):S=e[17];let x;e[18]!==t.title||e[19]!==E||e[20]!==L||e[21]!==S?(x=(0,s.jsx)("input",{"aria-label":L,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-title",onChange:E,placeholder:S,type:"text",value:t.title}),e[18]=t.title,e[19]=E,e[20]=L,e[21]=S,e[22]=x):x=e[22];let j;e[23]!==l?(j=l("SQL query"),e[23]=l,e[24]=j):j=e[24];let g;e[25]!==t.sql||e[26]!==C||e[27]!==j?(g=(0,s.jsx)("textarea",{"aria-label":j,className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 font-mono text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-sql",onChange:C,placeholder:"SELECT author, COUNT(*) AS messages FROM \u2026",spellCheck:!1,value:t.sql}),e[25]=t.sql,e[26]=C,e[27]=j,e[28]=g):g=e[28];let w;e[29]!==l?(w=l("Shard key (optional)"),e[29]=l,e[30]=w):w=e[30];let b;e[31]!==l?(b=l("Shard key (optional)"),e[31]=l,e[32]=b):b=e[32];let f;e[33]!==t.shardKey||e[34]!==K||e[35]!==w||e[36]!==b?(f=(0,s.jsx)("input",{"aria-label":w,className:"h-8 rounded-md border border-border bg-background px-2 font-mono text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-shard",onChange:K,placeholder:b,type:"text",value:t.shardKey}),e[33]=t.shardKey,e[34]=K,e[35]=w,e[36]=b,e[37]=f):f=e[37];let p;e[38]!==l?(p=l("Cancel"),e[38]=l,e[39]=p):p=e[39];let v;e[40]!==d||e[41]!==p?(v=(0,s.jsx)(T,{"data-testid":"dashboards-form-cancel",onClick:d,size:"sm",type:"button",variant:"outline",children:p}),e[40]=d,e[41]=p,e[42]=v):v=e[42];let R=!$,i;e[43]!==m||e[44]!==l?(i=l(m?"Save widget":"Add widget"),e[43]=m,e[44]=l,e[45]=i):i=e[45];let n;e[46]!==u||e[47]!==R||e[48]!==i?(n=(0,s.jsx)(T,{"data-testid":"dashboards-form-save",disabled:R,onClick:u,size:"sm",type:"button",children:i}),e[46]=u,e[47]=R,e[48]=i,e[49]=n):n=e[49];let q;e[50]!==v||e[51]!==n?(q=(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[v,n]}),e[50]=v,e[51]=n,e[52]=q):q=e[52];let M;return e[53]!==g||e[54]!==f||e[55]!==q||e[56]!==x?(M=(0,s.jsx)(Q,{"data-testid":"dashboards-form",children:(0,s.jsxs)(V,{className:"flex flex-col gap-3 py-4",children:[x,g,f,q]})}),e[53]=g,e[54]=f,e[55]=q,e[56]=x,e[57]=M):M=e[57],M},"ae"),we=k(_=>{let e=(0,W.c)(39),{initialShardKey:t}=_,m=A(),[d,a]=Y(oe),[r,l]=(0,I.useState)(B),[o,E]=(0,I.useState)(null),[c,C]=(0,I.useState)(!1),y;e[0]!==t?(y=k(()=>{E(null),l({...B,shardKey:t??""}),C(!0)},"y"),e[0]=t,e[1]=y):y=e[1];let K=y,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=k(()=>{C(!1),E(null),l(B)},"h"),e[2]=h):h=e[2];let u=h,N;e[3]!==d?(N=k(i=>{let n=d.find(q=>q.id===i);n!==void 0&&(E(i),l({shardKey:n.shardKey??"",sql:n.sql,title:n.title}),C(!0))},"C"),e[3]=d,e[4]=N):N=e[4];let $=N,L;e[5]!==a?(L=k(i=>{a(n=>n.filter(q=>q.id!==i))},"K"),e[5]=a,e[6]=L):L=e[6];let S=L,x;e[7]!==r.shardKey||e[8]!==r.sql||e[9]!==r.title||e[10]!==o||e[11]!==a?(x=k(()=>{let i=r.title.trim(),n=r.sql.trim();if(i===""||n==="")return;let q=r.shardKey.trim();a(o===null?M=>[...M,{id:ee("w"),shardKey:q,sql:n,title:i}]:M=>M.map(z=>z.id===o?{...z,shardKey:q,sql:n,title:i}:z)),u()},"x"),e[7]=r.shardKey,e[8]=r.sql,e[9]=r.title,e[10]=o,e[11]=a,e[12]=x):x=e[12];let j=x,g;e[13]!==m?(g=m("Chart widgets backed by saved read-only SQL queries."),e[13]=m,e[14]=g):g=e[14];let w;e[15]!==g?(w=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:g}),e[15]=g,e[16]=w):w=e[16];let b;e[17]!==c||e[18]!==K||e[19]!==m?(b=!c&&(0,s.jsx)(T,{"data-testid":"dashboards-add",onClick:K,size:"sm",type:"button",children:m("Add widget")}),e[17]=c,e[18]=K,e[19]=m,e[20]=b):b=e[20];let f;e[21]!==w||e[22]!==b?(f=(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[w,b]}),e[21]=w,e[22]=b,e[23]=f):f=e[23];let p;e[24]!==r||e[25]!==o||e[26]!==c||e[27]!==j?(p=c&&(0,s.jsx)(ce,{draft:r,editing:o!==null,onCancel:u,onChange:l,onSubmit:j}),e[24]=r,e[25]=o,e[26]=c,e[27]=j,e[28]=p):p=e[28];let v;e[29]!==c||e[30]!==$||e[31]!==S||e[32]!==m||e[33]!==d?(v=d.length===0&&!c?(0,s.jsx)(H,{description:m("Add a widget to chart a saved SQL query on this browser."),testId:"dashboards-empty",title:m("No widgets yet")}):(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3","data-testid":"dashboards-grid",children:d.map(i=>(0,s.jsx)(ne,{onEdit:$,onRemove:S,widget:i},i.id))}),e[29]=c,e[30]=$,e[31]=S,e[32]=m,e[33]=d,e[34]=v):v=e[34];let R;return e[35]!==p||e[36]!==v||e[37]!==f?(R=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-dashboards",children:[f,p,v]}),e[35]=p,e[36]=v,e[37]=f,e[38]=R):R=e[38],R},"we");export{we as default};
@@ -1 +1 @@
1
- import{a as te}from"./chunk-V53KNYRN.js";import{R as Z}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as I}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as K}from"./chunk-VDW32UET.js";import{c as ee}from"./chunk-ZNAGZU6H.js";import{f as M}from"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import{a as q}from"./chunk-XQCVZAGU.js";import{a as z,b as D,c as F,d as h,e as o,f as i}from"./chunk-MIQTKZAR.js";import{a as T,e as j}from"./chunk-UZERI5YC.js";import{d as H,f as Q,g as V,h as W,o as $}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as n,e as Y,f as ne,h as le}from"./chunk-3XIESWL4.js";var c=Y(ne(),1);var e=Y(le(),1);var oe=["queued","running","paused","waiting","complete","errored","terminated"],ie=["pause","resume","terminate"],de="WORKFLOWS_NOT_CONFIGURED",ce=n(l=>typeof l=="object"&&l!==null&&l.code===de,"ie"),me=n(l=>{let r=l.error??l.output;if(r===void 0)return"\u2014";try{return JSON.stringify(r)}catch{return"(unserializable)"}},"de"),ue=n(({loadDetail:l,loadInstances:r,readOnly:N,runAction:R,workflowName:g})=>{let A=M(),s=H(),[p,k]=(0,c.useState)(null),[S,O]=(0,c.useState)(null),[v,_]=(0,c.useState)(""),[b,f]=(0,c.useState)(null),[J,C]=(0,c.useState)(!1),[L,P]=(0,c.useState)(null),w=l??(a=>A.getWorkflowInstance(a)),x=N?void 0:R??(r===void 0?a=>A.setWorkflowInstanceStatus(a):void 0),E=n(async()=>{f(null),C(!1);let a=v===""?void 0:v;try{if(r===void 0){let d=await A.listWorkflowInstances({name:g,status:a});if(d.configured===!1){k(null),C(!0);return}k(d.instances);return}k(await r({name:g,status:a}))}catch(d){k(null),ce(d)?C(!0):f(W(d))}},"O");(0,c.useEffect)(()=>{O(null),$(E())},[g,v]);let U=n(async a=>{f(null);try{O(await w({id:a,name:g}))}catch(d){f(W(d))}},"D"),B=n(async(a,d)=>{if(x!==void 0){P(a),f(null);try{await x({action:d,id:a,name:g}),await E()}catch(G){f(W(G))}P(null)}},"K");return(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:s("Instance history")}),(0,e.jsxs)("select",{"aria-label":s("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:n(a=>{_(a.target.value)},"onChange"),value:v,children:[(0,e.jsx)("option",{value:"",children:s("All statuses")}),oe.map(a=>(0,e.jsx)("option",{value:a,children:a},a))]})]}),b!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:b}),J&&(0,e.jsx)(q,{description:s("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:s("Workflow inspection not configured")}),!J&&p!==null&&p.length===0&&(0,e.jsx)(q,{description:s("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:s("No instances")}),p!==null&&p.length>0&&(0,e.jsx)(T,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflow-instances-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:s("Instance id")}),(0,e.jsx)(o,{children:s("Status")}),(0,e.jsx)(o,{children:s("Created")}),(0,e.jsx)(o,{children:s("Ended")}),(0,e.jsx)(o,{"aria-label":s("Actions")})]})}),(0,e.jsx)(F,{children:p.map(a=>(0,e.jsxs)(h,{"data-testid":`workflow-instance-${a.id}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:a.id}),(0,e.jsx)(i,{className:"font-mono text-xs",children:a.status}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:a.createdOn??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:a.endedOn??"\u2014"}),(0,e.jsx)(i,{className:"text-right",children:(0,e.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,e.jsx)(I,{"data-testid":`workflow-instance-steps-${a.id}`,onClick:n(()=>{$(U(a.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:s("Steps")}),x!==void 0&&ie.map(d=>(0,e.jsx)(I,{"data-testid":`workflow-instance-${d}-${a.id}`,disabled:L===a.id,onClick:n(()=>{$(B(a.id,d))},"onClick"),size:"sm",type:"button",variant:"ghost",children:s(d)},d))]})})]},a.id))})]})})}),S!==null&&(0,e.jsx)(T,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,e.jsxs)(j,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[s("Steps")," \xB7 ",S.id]}),(0,e.jsx)(I,{"data-testid":"workflow-instance-detail-close",onClick:n(()=>{O(null)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Close")})]}),S.steps.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:s("This instance has no recorded steps yet.")}):(0,e.jsxs)(z,{"data-testid":"workflow-instance-steps",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:s("Step")}),(0,e.jsx)(o,{children:s("Type")}),(0,e.jsx)(o,{children:s("Attempts")}),(0,e.jsx)(o,{children:s("Started")}),(0,e.jsx)(o,{children:s("Output")})]})}),(0,e.jsx)(F,{children:S.steps.map((a,d)=>(0,e.jsxs)(h,{"data-testid":`workflow-step-${String(d)}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:a.name}),(0,e.jsx)(i,{className:"text-xs text-muted-foreground",children:a.type??"\u2014"}),(0,e.jsx)(i,{className:"tabular-nums",children:a.attempts??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:a.start??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:me(a)})]},`${a.name}:${String(d)}`))})]})]})})]})},"ce"),fe=Q(K.createWorkflowInstance),he=Q(K.getWorkflowInstanceStatus),pe=n(l=>{if(l.error)return`${l.error.name}: ${l.error.message}`;if(l.output===void 0)return"\u2014";try{return JSON.stringify(l.output)}catch{return"(unserializable)"}},"fe"),we=n((l,r)=>l.some(N=>N.exportName===r)?r:l[0]?.exportName??"","he"),We=n(()=>{let l=M(),r=H(),{data:N,error:R}=ee(K.listWorkflows,{}),[g,A]=(0,c.useState)(""),[s,p]=(0,c.useState)(""),[k,S]=(0,c.useState)(""),[O,v]=(0,c.useState)(!1),[_,b]=(0,c.useState)(null),[f,J]=(0,c.useState)([]),[C,L]=(0,c.useState)(null),P=N!==void 0,w=Array.isArray(N?.workflows)?[...N.workflows].toSorted((t,u)=>t.exportName.localeCompare(u.exportName)):[],x=we(w,g),E=w.find(t=>t.exportName===x),U=n(t=>{J(u=>{let m=u.filter(y=>!(y.exportName===t.exportName&&y.id===t.id));return[t,...m]})},"D"),B=n(async()=>{let t=x;if(t==="")return;let u,m=k.trim();if(m!=="")try{u=JSON.parse(m)}catch{b(r("Params must be valid JSON"));return}v(!0),b(null);try{let y=s.trim(),X=await l.query(fe,{exportName:t,id:y===""?void 0:y,params:u},V(""));U({exportName:t,id:X.id,status:X.status}),p("")}catch(y){b(W(y))}v(!1)},"K"),a=n(()=>{$(B())},"a"),d=n(async(t,u)=>{L(u);try{let m=await l.query(he,{exportName:t,id:u},V(""));U({error:m.error,exportName:t,id:m.id,output:m.output,status:m.status})}catch(m){b(W(m))}L(null)},"l"),G=n(t=>{A(t.target.value)},"P"),ae=n(t=>{p(t.target.value)},"Y"),re=n(t=>{S(t.target.value)},"Z"),se=n(t=>{let{export:u,id:m}=t.currentTarget.dataset;u!==void 0&&m!==void 0&&$(d(u,m))},"ee");return(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[R!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:R}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),P&&w.length===0?(0,e.jsx)(q,{description:r("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:r("No workflows defined")}):(0,e.jsx)(T,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflows-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:r("Export")}),(0,e.jsx)(o,{children:r("Name")}),(0,e.jsx)(o,{children:r("Class")}),(0,e.jsx)(o,{children:r("Binding")})]})}),(0,e.jsx)(F,{children:w.map(t=>(0,e.jsxs)(h,{"data-testid":`workflows-row-${t.exportName}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.name}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.className}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.binding})]},t.exportName))})]})})}),w.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Start instance")}),_!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:_}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("select",{"aria-label":r("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:G,value:x,children:w.map(t=>(0,e.jsx)("option",{value:t.exportName,children:t.exportName},t.exportName))}),(0,e.jsx)(Z,{"aria-label":r("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:ae,placeholder:r("Instance id (optional)"),value:s}),(0,e.jsx)(I,{"data-testid":"workflows-start-button",disabled:O||x==="",onClick:a,children:r(O?"Starting\u2026":"Start instance")})]}),(0,e.jsx)(te,{"aria-label":r("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:re,placeholder:r("Params (JSON, optional)"),value:k})]}),f.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Instances")}),(0,e.jsx)(T,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflows-instances-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:r("Workflow")}),(0,e.jsx)(o,{children:r("Instance id")}),(0,e.jsx)(o,{children:r("Status")}),(0,e.jsx)(o,{children:r("Output")}),(0,e.jsx)(o,{})]})}),(0,e.jsx)(F,{children:f.map(t=>(0,e.jsxs)(h,{"data-testid":`workflows-instance-${t.id}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.id}),(0,e.jsx)(i,{className:"font-mono text-xs",children:t.status}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:pe(t)}),(0,e.jsx)(i,{children:(0,e.jsx)(I,{"data-export":t.exportName,"data-id":t.id,"data-testid":`workflows-instance-refresh-${t.id}`,disabled:C===t.id,onClick:se,size:"xs",variant:"outline",children:C===t.id?r("Refreshing\u2026"):r("Refresh")})})]},`${t.exportName}:${t.id}`))})]})})})]}),E!==void 0&&(0,e.jsx)(ue,{workflowName:E.name})]})},"Oe");export{We as default};
1
+ import{a as te}from"./chunk-V53KNYRN.js";import{R as Z}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as I}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as K}from"./chunk-VDW32UET.js";import{c as ee}from"./chunk-6F7KP54M.js";import{f as M}from"./chunk-C2ZFQARQ.js";import"./chunk-XBDKZZ67.js";import{a as q}from"./chunk-XQCVZAGU.js";import{a as z,b as D,c as F,d as h,e as o,f as i}from"./chunk-WJQLNYGX.js";import{a as T,e as j}from"./chunk-WQH3LT2P.js";import{d as H,f as Q,g as V,h as W,o as $}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as n,e as Y,f as ne,h as le}from"./chunk-3XIESWL4.js";var c=Y(ne(),1);var e=Y(le(),1);var oe=["queued","running","paused","waiting","complete","errored","terminated"],ie=["pause","resume","terminate"],de="WORKFLOWS_NOT_CONFIGURED",ce=n(l=>typeof l=="object"&&l!==null&&l.code===de,"ie"),me=n(l=>{let r=l.error??l.output;if(r===void 0)return"\u2014";try{return JSON.stringify(r)}catch{return"(unserializable)"}},"de"),ue=n(({loadDetail:l,loadInstances:r,readOnly:N,runAction:R,workflowName:g})=>{let A=M(),s=H(),[p,k]=(0,c.useState)(null),[S,O]=(0,c.useState)(null),[v,_]=(0,c.useState)(""),[b,f]=(0,c.useState)(null),[J,C]=(0,c.useState)(!1),[L,P]=(0,c.useState)(null),w=l??(a=>A.getWorkflowInstance(a)),x=N?void 0:R??(r===void 0?a=>A.setWorkflowInstanceStatus(a):void 0),E=n(async()=>{f(null),C(!1);let a=v===""?void 0:v;try{if(r===void 0){let d=await A.listWorkflowInstances({name:g,status:a});if(d.configured===!1){k(null),C(!0);return}k(d.instances);return}k(await r({name:g,status:a}))}catch(d){k(null),ce(d)?C(!0):f(W(d))}},"O");(0,c.useEffect)(()=>{O(null),$(E())},[g,v]);let U=n(async a=>{f(null);try{O(await w({id:a,name:g}))}catch(d){f(W(d))}},"D"),B=n(async(a,d)=>{if(x!==void 0){P(a),f(null);try{await x({action:d,id:a,name:g}),await E()}catch(G){f(W(G))}P(null)}},"K");return(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:s("Instance history")}),(0,e.jsxs)("select",{"aria-label":s("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:n(a=>{_(a.target.value)},"onChange"),value:v,children:[(0,e.jsx)("option",{value:"",children:s("All statuses")}),oe.map(a=>(0,e.jsx)("option",{value:a,children:a},a))]})]}),b!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:b}),J&&(0,e.jsx)(q,{description:s("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:s("Workflow inspection not configured")}),!J&&p!==null&&p.length===0&&(0,e.jsx)(q,{description:s("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:s("No instances")}),p!==null&&p.length>0&&(0,e.jsx)(T,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflow-instances-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:s("Instance id")}),(0,e.jsx)(o,{children:s("Status")}),(0,e.jsx)(o,{children:s("Created")}),(0,e.jsx)(o,{children:s("Ended")}),(0,e.jsx)(o,{"aria-label":s("Actions")})]})}),(0,e.jsx)(F,{children:p.map(a=>(0,e.jsxs)(h,{"data-testid":`workflow-instance-${a.id}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:a.id}),(0,e.jsx)(i,{className:"font-mono text-xs",children:a.status}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:a.createdOn??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:a.endedOn??"\u2014"}),(0,e.jsx)(i,{className:"text-right",children:(0,e.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,e.jsx)(I,{"data-testid":`workflow-instance-steps-${a.id}`,onClick:n(()=>{$(U(a.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:s("Steps")}),x!==void 0&&ie.map(d=>(0,e.jsx)(I,{"data-testid":`workflow-instance-${d}-${a.id}`,disabled:L===a.id,onClick:n(()=>{$(B(a.id,d))},"onClick"),size:"sm",type:"button",variant:"ghost",children:s(d)},d))]})})]},a.id))})]})})}),S!==null&&(0,e.jsx)(T,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,e.jsxs)(j,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[s("Steps")," \xB7 ",S.id]}),(0,e.jsx)(I,{"data-testid":"workflow-instance-detail-close",onClick:n(()=>{O(null)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Close")})]}),S.steps.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:s("This instance has no recorded steps yet.")}):(0,e.jsxs)(z,{"data-testid":"workflow-instance-steps",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:s("Step")}),(0,e.jsx)(o,{children:s("Type")}),(0,e.jsx)(o,{children:s("Attempts")}),(0,e.jsx)(o,{children:s("Started")}),(0,e.jsx)(o,{children:s("Output")})]})}),(0,e.jsx)(F,{children:S.steps.map((a,d)=>(0,e.jsxs)(h,{"data-testid":`workflow-step-${String(d)}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:a.name}),(0,e.jsx)(i,{className:"text-xs text-muted-foreground",children:a.type??"\u2014"}),(0,e.jsx)(i,{className:"tabular-nums",children:a.attempts??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:a.start??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:me(a)})]},`${a.name}:${String(d)}`))})]})]})})]})},"ce"),fe=Q(K.createWorkflowInstance),he=Q(K.getWorkflowInstanceStatus),pe=n(l=>{if(l.error)return`${l.error.name}: ${l.error.message}`;if(l.output===void 0)return"\u2014";try{return JSON.stringify(l.output)}catch{return"(unserializable)"}},"fe"),we=n((l,r)=>l.some(N=>N.exportName===r)?r:l[0]?.exportName??"","he"),We=n(()=>{let l=M(),r=H(),{data:N,error:R}=ee(K.listWorkflows,{}),[g,A]=(0,c.useState)(""),[s,p]=(0,c.useState)(""),[k,S]=(0,c.useState)(""),[O,v]=(0,c.useState)(!1),[_,b]=(0,c.useState)(null),[f,J]=(0,c.useState)([]),[C,L]=(0,c.useState)(null),P=N!==void 0,w=Array.isArray(N?.workflows)?[...N.workflows].toSorted((t,u)=>t.exportName.localeCompare(u.exportName)):[],x=we(w,g),E=w.find(t=>t.exportName===x),U=n(t=>{J(u=>{let m=u.filter(y=>!(y.exportName===t.exportName&&y.id===t.id));return[t,...m]})},"D"),B=n(async()=>{let t=x;if(t==="")return;let u,m=k.trim();if(m!=="")try{u=JSON.parse(m)}catch{b(r("Params must be valid JSON"));return}v(!0),b(null);try{let y=s.trim(),X=await l.query(fe,{exportName:t,id:y===""?void 0:y,params:u},V(""));U({exportName:t,id:X.id,status:X.status}),p("")}catch(y){b(W(y))}v(!1)},"K"),a=n(()=>{$(B())},"a"),d=n(async(t,u)=>{L(u);try{let m=await l.query(he,{exportName:t,id:u},V(""));U({error:m.error,exportName:t,id:m.id,output:m.output,status:m.status})}catch(m){b(W(m))}L(null)},"l"),G=n(t=>{A(t.target.value)},"P"),ae=n(t=>{p(t.target.value)},"Y"),re=n(t=>{S(t.target.value)},"Z"),se=n(t=>{let{export:u,id:m}=t.currentTarget.dataset;u!==void 0&&m!==void 0&&$(d(u,m))},"ee");return(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[R!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:R}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),P&&w.length===0?(0,e.jsx)(q,{description:r("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:r("No workflows defined")}):(0,e.jsx)(T,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflows-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:r("Export")}),(0,e.jsx)(o,{children:r("Name")}),(0,e.jsx)(o,{children:r("Class")}),(0,e.jsx)(o,{children:r("Binding")})]})}),(0,e.jsx)(F,{children:w.map(t=>(0,e.jsxs)(h,{"data-testid":`workflows-row-${t.exportName}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.name}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.className}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.binding})]},t.exportName))})]})})}),w.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Start instance")}),_!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:_}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("select",{"aria-label":r("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:G,value:x,children:w.map(t=>(0,e.jsx)("option",{value:t.exportName,children:t.exportName},t.exportName))}),(0,e.jsx)(Z,{"aria-label":r("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:ae,placeholder:r("Instance id (optional)"),value:s}),(0,e.jsx)(I,{"data-testid":"workflows-start-button",disabled:O||x==="",onClick:a,children:r(O?"Starting\u2026":"Start instance")})]}),(0,e.jsx)(te,{"aria-label":r("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:re,placeholder:r("Params (JSON, optional)"),value:k})]}),f.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Instances")}),(0,e.jsx)(T,{className:"overflow-hidden py-0",children:(0,e.jsx)(j,{className:"px-0",children:(0,e.jsxs)(z,{"data-testid":"workflows-instances-table",children:[(0,e.jsx)(D,{children:(0,e.jsxs)(h,{children:[(0,e.jsx)(o,{children:r("Workflow")}),(0,e.jsx)(o,{children:r("Instance id")}),(0,e.jsx)(o,{children:r("Status")}),(0,e.jsx)(o,{children:r("Output")}),(0,e.jsx)(o,{})]})}),(0,e.jsx)(F,{children:f.map(t=>(0,e.jsxs)(h,{"data-testid":`workflows-instance-${t.id}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.id}),(0,e.jsx)(i,{className:"font-mono text-xs",children:t.status}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:pe(t)}),(0,e.jsx)(i,{children:(0,e.jsx)(I,{"data-export":t.exportName,"data-id":t.id,"data-testid":`workflows-instance-refresh-${t.id}`,disabled:C===t.id,onClick:se,size:"xs",variant:"outline",children:C===t.id?r("Refreshing\u2026"):r("Refresh")})})]},`${t.exportName}:${t.id}`))})]})})})]}),E!==void 0&&(0,e.jsx)(ue,{workflowName:E.name})]})},"Oe");export{We as default};
@@ -1 +1 @@
1
- import{a as O}from"./chunk-IGCNMZSB.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as L}from"./chunk-VDW32UET.js";import{c as $}from"./chunk-ZNAGZU6H.js";import"./chunk-5KCULF7S.js";import"./chunk-XBDKZZ67.js";import{a as I}from"./chunk-XQCVZAGU.js";import{a as k,b as A,c as D,d as g,e as c,f as l}from"./chunk-MIQTKZAR.js";import{a as S,e as b}from"./chunk-UZERI5YC.js";import{d as w}from"./chunk-IUYFXK4X.js";import"./chunk-XNGYYOLS.js";import{a as u,e as y,g as j,h as E}from"./chunk-3XIESWL4.js";var _=y(j(),1);var t=y(E(),1);var T="container:",M={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},P=u(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"_"),W=u(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(T))continue;let i=a.slice(T.length);if(i==="")continue;let s=JSON.stringify([i,r.instance??""]),o=n.get(s);if(o!==void 0&&o.timestamp>=r.timestamp)continue;let{detail:f,event:m}=P(r.message);n.set(s,{detail:f,event:m,exitCode:r.exitCode,instance:r.instance,level:r.level,name:i,state:M[m]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"j"),F={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},H=u(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"P"),V=u(()=>{let e=(0,_.c)(19),n=w(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:i,error:s,liveError:o}=$(L.getLogs,r,a),f=i!==void 0,m;if(e[2]!==i||e[3]!==s||e[4]!==o||e[5]!==f||e[6]!==n){let N=W(H(i)),x;e[8]!==s?(x=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:s}),e[8]=s,e[9]=x):x=e[9];let d;e[10]!==n?(d=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[10]=n,e[11]=d):d=e[11];let h;e[12]!==d?(h=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:d}),e[12]=d,e[13]=h):h=e[13];let p;e[14]!==o?(p=(0,t.jsx)(O,{message:o,prefix:"containers"}),e[14]=o,e[15]=p):p=e[15];let v;e[16]!==h||e[17]!==p?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[h,p]}),e[16]=h,e[17]=p,e[18]=v):v=e[18],m=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[x,v,f&&N.length===0?(0,t.jsx)(I,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(S,{className:"overflow-hidden py-0",children:(0,t.jsx)(b,{className:"px-0",children:(0,t.jsxs)(k,{"data-testid":"containers-table",children:[(0,t.jsx)(A,{children:(0,t.jsxs)(g,{children:[(0,t.jsx)(c,{children:n("Container")}),(0,t.jsx)(c,{children:n("Instance")}),(0,t.jsx)(c,{children:n("State")}),(0,t.jsx)(c,{children:n("Last event")}),(0,t.jsx)(c,{children:n("Detail")}),(0,t.jsx)(c,{children:n("Exit")}),(0,t.jsx)(c,{children:n("When")})]})}),(0,t.jsx)(D,{children:N.map(J)})]})})})]}),e[2]=i,e[3]=s,e[4]=o,e[5]=f,e[6]=n,e[7]=m}else m=e[7];return m},"H");function J(e){return(0,t.jsxs)(g,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(l,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(l,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(l,{children:(0,t.jsx)(C,{variant:F[e.state],children:e.state})}),(0,t.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(l,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(l,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(l,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}u(J,"W");export{V as ContainersPanel};
1
+ import{a as O}from"./chunk-IGCNMZSB.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as L}from"./chunk-VDW32UET.js";import{c as $}from"./chunk-6F7KP54M.js";import"./chunk-C2ZFQARQ.js";import"./chunk-XBDKZZ67.js";import{a as I}from"./chunk-XQCVZAGU.js";import{a as k,b as A,c as D,d as g,e as c,f as l}from"./chunk-WJQLNYGX.js";import{a as b,e as S}from"./chunk-WQH3LT2P.js";import{d as w}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as p,e as y,g as j,h as E}from"./chunk-3XIESWL4.js";var _=y(j(),1);var t=y(E(),1);var T="container:",M={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},W=p(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"_"),B=p(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(T))continue;let i=a.slice(T.length);if(i==="")continue;let s=JSON.stringify([i,r.instance??""]),o=n.get(s);if(o!==void 0&&o.timestamp>=r.timestamp)continue;let{detail:u,event:d}=W(r.message);n.set(s,{detail:u,event:d,exitCode:r.exitCode,instance:r.instance,level:r.level,name:i,state:M[d]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"j"),F={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},H=p(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"W"),V=p(()=>{let e=(0,_.c)(19),n=w(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:i,error:s,liveError:o}=$(L.getLogs,r,a),u=i!==void 0,d;if(e[2]!==i||e[3]!==s||e[4]!==o||e[5]!==u||e[6]!==n){let N=B(H(i)),x;e[8]!==s?(x=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:s}),e[8]=s,e[9]=x):x=e[9];let m;e[10]!==n?(m=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[10]=n,e[11]=m):m=e[11];let f;e[12]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[12]=m,e[13]=f):f=e[13];let h;e[14]!==o?(h=(0,t.jsx)(O,{message:o,prefix:"containers"}),e[14]=o,e[15]=h):h=e[15];let v;e[16]!==f||e[17]!==h?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[f,h]}),e[16]=f,e[17]=h,e[18]=v):v=e[18],d=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[x,v,u&&N.length===0?(0,t.jsx)(I,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(b,{className:"overflow-hidden py-0",children:(0,t.jsx)(S,{className:"px-0",children:(0,t.jsxs)(k,{"data-testid":"containers-table",children:[(0,t.jsx)(A,{children:(0,t.jsxs)(g,{children:[(0,t.jsx)(c,{children:n("Container")}),(0,t.jsx)(c,{children:n("Instance")}),(0,t.jsx)(c,{children:n("State")}),(0,t.jsx)(c,{children:n("Last event")}),(0,t.jsx)(c,{children:n("Detail")}),(0,t.jsx)(c,{children:n("Exit")}),(0,t.jsx)(c,{children:n("When")})]})}),(0,t.jsx)(D,{children:N.map(J)})]})})})]}),e[2]=i,e[3]=s,e[4]=o,e[5]=u,e[6]=n,e[7]=d}else d=e[7];return d},"H");function J(e){return(0,t.jsxs)(g,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(l,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(l,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(l,{children:(0,t.jsx)(C,{variant:F[e.state],children:e.state})}),(0,t.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(l,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(l,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(l,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}p(J,"B");export{V as default};