import{j as m,i as M,t as ne,z as Y,w as Ks}from"./vendor-ui-BUsIib4b.js";import{r as f,u as Ir,L as Sn}from"./vendor-react-C0ZmnAiH.js";import{p as se,y as Or,F as he,s as Gs,D as qs,h as Xs,B as mt,i as Ys,j as Se,Q as Nr,R as _r,S as Ur,V as $r,W as Zr,X as Hr,Y as Mn}from"./index-ccpu5IUx.js";import{c as Wr}from"./header-BxYiJFj2.js";import{e as zr}from"./Code.es-B-PidnDg.js";import{e as Kr}from"./Copy.es-D7GJuo7-.js";import{C as Gr,S as qr,e as Xr}from"./use_metric-JQcwAm9V.js";import{u as Qs}from"./use_show_toast-CuYK1CaH.js";import{m as Js}from"./WarningCircle.es-BV2TrezU.js";import{c as Yr}from"./vendor-query-CD5rVjAu.js";import{u as ti,f as Qr}from"./vendor-utils-DwtcRXMR.js";import{o as Jr}from"./Circle.es-BgVv0ZAg.js";import{e as to}from"./Plug.es-BgX4riqg.js";import{D as eo}from"./react-icons.esm-CZCqRWzH.js";import{T as no,a as so,b as io,c as ro}from"./tooltip-bxA1RoBu.js";import{E as oo,a as ao,b as lo,c as co,d as uo,e as Vn}from"./empty-D3OFfn6N.js";import{U as ho}from"./index-Jtxtz2gd.js";import{C as fo}from"./chevron-down-D56FQZV8.js";const po=new Map([["bold",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm48.49-108.49a12,12,0,0,1,0,17l-40,40a12,12,0,0,1-17,0l-40-40a12,12,0,0,1,17-17L128,135l31.51-31.52A12,12,0,0,1,176.49,103.51Z"}))],["duotone",f.createElement(f.Fragment,null,f.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),f.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm45.66-109.66a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L128,140.69l34.34-34.35A8,8,0,0,1,173.66,106.34Z"}))],["fill",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,93.66-40,40a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L128,140.69l34.34-34.35a8,8,0,0,1,11.32,11.32Z"}))],["light",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm44.24-110.24a6,6,0,0,1,0,8.48l-40,40a6,6,0,0,1-8.48,0l-40-40a6,6,0,0,1,8.48-8.48L128,143.51l35.76-35.75A6,6,0,0,1,172.24,107.76Z"}))],["regular",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm45.66-109.66a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L128,140.69l34.34-34.35A8,8,0,0,1,173.66,106.34Z"}))],["thin",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm42.83-110.83a4,4,0,0,1,0,5.66l-40,40a4,4,0,0,1-5.66,0l-40-40a4,4,0,0,1,5.66-5.66L128,146.34l37.17-37.17A4,4,0,0,1,170.83,109.17Z"}))]]),mo=new Map([["bold",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm32.49-92.49a12,12,0,0,1,0,17l-40,40a12,12,0,0,1-17-17L135,128,103.51,96.49a12,12,0,0,1,17-17Z"}))],["duotone",f.createElement(f.Fragment,null,f.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),f.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm29.66-93.66a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32L140.69,128,106.34,93.66a8,8,0,0,1,11.32-11.32Z"}))],["fill",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm29.66,109.66-40,40a8,8,0,0,1-11.32-11.32L140.69,128,106.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,157.66,133.66Z"}))],["light",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm28.24-94.24a6,6,0,0,1,0,8.48l-40,40a6,6,0,0,1-8.48-8.48L143.51,128,107.76,92.24a6,6,0,0,1,8.48-8.48Z"}))],["regular",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm29.66-93.66a8,8,0,0,1,0,11.32l-40,40a8,8,0,0,1-11.32-11.32L140.69,128,106.34,93.66a8,8,0,0,1,11.32-11.32Z"}))],["thin",f.createElement(f.Fragment,null,f.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm26.83-94.83a4,4,0,0,1,0,5.66l-40,40a4,4,0,0,1-5.66-5.66L146.34,128,109.17,90.83a4,4,0,0,1,5.66-5.66Z"}))]]),go=new Map([["bold",f.createElement(f.Fragment,null,f.createElement("path",{d:"M180,64H40A12,12,0,0,0,28,76V216a12,12,0,0,0,12,12H180a12,12,0,0,0,12-12V76A12,12,0,0,0,180,64ZM168,204H52V88H168ZM228,40V180a12,12,0,0,1-24,0V52H76a12,12,0,0,1,0-24H216A12,12,0,0,1,228,40Z"}))],["duotone",f.createElement(f.Fragment,null,f.createElement("path",{d:"M184,72V216H40V72Z",opacity:"0.2"}),f.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["fill",f.createElement(f.Fragment,null,f.createElement("path",{d:"M192,72V216a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V72a8,8,0,0,1,8-8H184A8,8,0,0,1,192,72Zm24-40H72a8,8,0,0,0,0,16H208V184a8,8,0,0,0,16,0V40A8,8,0,0,0,216,32Z"}))],["light",f.createElement(f.Fragment,null,f.createElement("path",{d:"M184,66H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H184a6,6,0,0,0,6-6V72A6,6,0,0,0,184,66Zm-6,144H46V78H178ZM222,40V184a6,6,0,0,1-12,0V46H72a6,6,0,0,1,0-12H216A6,6,0,0,1,222,40Z"}))],["regular",f.createElement(f.Fragment,null,f.createElement("path",{d:"M184,64H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H184a8,8,0,0,0,8-8V72A8,8,0,0,0,184,64Zm-8,144H48V80H176ZM224,40V184a8,8,0,0,1-16,0V48H72a8,8,0,0,1,0-16H216A8,8,0,0,1,224,40Z"}))],["thin",f.createElement(f.Fragment,null,f.createElement("path",{d:"M184,68H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H184a4,4,0,0,0,4-4V72A4,4,0,0,0,184,68Zm-4,144H44V76H180ZM220,40V184a4,4,0,0,1-8,0V44H72a4,4,0,0,1,0-8H216A4,4,0,0,1,220,40Z"}))]]),yo=new Map([["bold",f.createElement(f.Fragment,null,f.createElement("path",{d:"M228.88,113.61A60,60,0,0,0,166,33.42,60,60,0,0,0,65.1,47.83a60,60,0,0,0-38,94.56A60.08,60.08,0,0,0,83.6,223a57.83,57.83,0,0,0,6.45-.36A60,60,0,0,0,190.9,208.17a60,60,0,0,0,38-94.56ZM181.81,58.3a36,36,0,0,1,26.58,37.6L170,73.73a12,12,0,0,0-12,0L120,95.67V81.81L154.5,61.9A35.74,35.74,0,0,1,181.81,58.3ZM136,123.38v9.24l-8,4.62-8-4.62v-9.24l8-4.62ZM84,72a36,36,0,0,1,56.39-29.67L102,64.49a12,12,0,0,0-6,10.39v43.88l-12-6.93ZM44.33,88.93A35.81,35.81,0,0,1,60,74.43v44.33a12,12,0,0,0,6,10.4l38,21.93L92,158,57.5,138.1A36,36,0,0,1,44.33,88.93ZM74.19,197.7a36,36,0,0,1-26.58-37.6L86,182.27a12,12,0,0,0,12,0l38-21.94v13.86L101.5,194.1A35.74,35.74,0,0,1,74.19,197.7ZM172,184a36,36,0,0,1-56.39,29.67L154,191.51a12,12,0,0,0,6-10.39V137.24l12,6.93Zm39.67-16.93A35.81,35.81,0,0,1,196,181.57V137.24a12,12,0,0,0-6-10.4l-38-21.93L164,98l34.5,19.92A36,36,0,0,1,211.67,167.07Z"}))],["duotone",f.createElement(f.Fragment,null,f.createElement("path",{d:"M96,174.19l56-32.33v36.95L107.5,204.5a48,48,0,0,1-66.4-64.08h0A48,48,0,0,0,51.5,148.5ZM204.5,107.5,160,81.81l-32,18.48,56,32.33V184a48,48,0,0,1-1.81,13h0A48,48,0,0,0,204.5,107.5ZM104,77.19,148.5,51.5a47.77,47.77,0,0,1,12.19-5v0A48,48,0,0,0,72,72v51.38l32,18.48Z",opacity:"0.2"}),f.createElement("path",{d:"M224.32,114.24a56,56,0,0,0-60.07-76.57A56,56,0,0,0,67.93,51.44a56,56,0,0,0-36.25,90.32A56,56,0,0,0,69,217,56.39,56.39,0,0,0,83.59,219a55.75,55.75,0,0,0,8.17-.61,56,56,0,0,0,96.31-13.78,56,56,0,0,0,36.25-90.32ZM182.85,54.43a40,40,0,0,1,28.56,48c-.95-.63-1.91-1.24-2.91-1.81L164,74.88a8,8,0,0,0-8,0l-44,25.41V81.81l40.5-23.38A39.76,39.76,0,0,1,182.85,54.43ZM144,137.24l-16,9.24-16-9.24V118.76l16-9.24,16,9.24ZM80,72a40,40,0,0,1,67.53-29c-1,.51-2,1-3,1.62L100,70.27a8,8,0,0,0-4,6.92V128l-16-9.24ZM40.86,86.93A39.75,39.75,0,0,1,64.12,68.57C64.05,69.71,64,70.85,64,72v51.38a8,8,0,0,0,4,6.93l44,25.4L96,165,55.5,141.57A40,40,0,0,1,40.86,86.93ZM73.15,201.57a40,40,0,0,1-28.56-48c.95.63,1.91,1.24,2.91,1.81L92,181.12a8,8,0,0,0,8,0l44-25.41v18.48l-40.5,23.38A39.76,39.76,0,0,1,73.15,201.57ZM176,184a40,40,0,0,1-67.52,29.05c1-.51,2-1.05,3-1.63L156,185.73a8,8,0,0,0,4-6.92V128l16,9.24Zm39.14-14.93a39.75,39.75,0,0,1-23.26,18.36c.07-1.14.12-2.28.12-3.43V132.62a8,8,0,0,0-4-6.93l-44-25.4,16-9.24,40.5,23.38A40,40,0,0,1,215.14,169.07Z"}))],["fill",f.createElement(f.Fragment,null,f.createElement("path",{d:"M224.32,114.24a56,56,0,0,0-60.07-76.57A56,56,0,0,0,67.93,51.44a56,56,0,0,0-36.25,90.32A56,56,0,0,0,69,217,56.39,56.39,0,0,0,83.59,219a55.75,55.75,0,0,0,8.17-.61,56,56,0,0,0,96.31-13.78,56,56,0,0,0,36.25-90.32Zm-80.32,23-16,9.24-16-9.24V118.76l16-9.24,16,9.24Zm38.85-82.81a40,40,0,0,1,28.56,48c-.95-.63-1.91-1.24-2.91-1.81L164,74.88a8,8,0,0,0-8,0l-44,25.41V81.81l40.5-23.38A39.76,39.76,0,0,1,182.85,54.43Zm-142,32.5A39.75,39.75,0,0,1,64.12,68.57C64.05,69.71,64,70.85,64,72v51.38a8,8,0,0,0,4,6.93l44,25.4L96,165,55.5,141.57A40,40,0,0,1,40.86,86.93ZM136,224a39.79,39.79,0,0,1-27.52-10.95c1-.51,2-1.05,3-1.63L156,185.73a8,8,0,0,0,4-6.92V128l16,9.24V184A40,40,0,0,1,136,224Z"}))],["light",f.createElement(f.Fragment,null,f.createElement("path",{d:"M222,114.56a54,54,0,0,0-58.67-74.73,54,54,0,0,0-94,13.46A54,54,0,0,0,34,141.44a54,54,0,0,0,35.56,73.65A54.54,54.54,0,0,0,83.59,217a52.86,52.86,0,0,0,9.06-.78,54,54,0,0,0,94-13.46A54,54,0,0,0,222,114.56ZM183.37,52.5a42,42,0,0,1,29.21,53.14,54.84,54.84,0,0,0-5.08-3.33L163,76.62a6,6,0,0,0-6,0l-47,27.13V80.66l41.5-24A41.73,41.73,0,0,1,183.37,52.5ZM146,138.39l-18,10.39-18-10.39V117.61l18-10.39,18,10.39ZM78,72a42,42,0,0,1,72.92-28.43,56.18,56.18,0,0,0-5.42,2.74L101,72a6,6,0,0,0-3,5.19v54.27L78,119.92ZM39.13,85.93a41.75,41.75,0,0,1,27.22-20A55.09,55.09,0,0,0,66,72v51.38a6,6,0,0,0,3,5.2l47,27.13L96,167.26l-41.5-24A42,42,0,0,1,39.13,85.93ZM72.63,203.5a42,42,0,0,1-29.21-53.14,54.84,54.84,0,0,0,5.08,3.33L93,179.38a6,6,0,0,0,6,0l47-27.13v23.09l-41.5,24A41.73,41.73,0,0,1,72.63,203.5ZM178,184a42,42,0,0,1-72.92,28.43,56.18,56.18,0,0,0,5.42-2.74L155,184a6,6,0,0,0,3-5.19V124.54l20,11.54Zm38.87-13.93a41.75,41.75,0,0,1-27.22,20A55.09,55.09,0,0,0,190,184V132.62a6,6,0,0,0-3-5.2l-47-27.13,20-11.55,41.5,24A42,42,0,0,1,216.87,170.07Z"}))],["regular",f.createElement(f.Fragment,null,f.createElement("path",{d:"M224.32,114.24a56,56,0,0,0-60.07-76.57A56,56,0,0,0,67.93,51.44a56,56,0,0,0-36.25,90.32A56,56,0,0,0,69,217,56.39,56.39,0,0,0,83.59,219a55.75,55.75,0,0,0,8.17-.61,56,56,0,0,0,96.31-13.78,56,56,0,0,0,36.25-90.32ZM182.85,54.43a40,40,0,0,1,28.56,48c-.95-.63-1.91-1.24-2.91-1.81L164,74.88a8,8,0,0,0-8,0l-44,25.41V81.81l40.5-23.38A39.76,39.76,0,0,1,182.85,54.43ZM144,137.24l-16,9.24-16-9.24V118.76l16-9.24,16,9.24ZM80,72a40,40,0,0,1,67.53-29c-1,.51-2,1-3,1.62L100,70.27a8,8,0,0,0-4,6.92V128l-16-9.24ZM40.86,86.93A39.75,39.75,0,0,1,64.12,68.57C64.05,69.71,64,70.85,64,72v51.38a8,8,0,0,0,4,6.93l44,25.4L96,165,55.5,141.57A40,40,0,0,1,40.86,86.93ZM73.15,201.57a40,40,0,0,1-28.56-48c.95.63,1.91,1.24,2.91,1.81L92,181.12a8,8,0,0,0,8,0l44-25.41v18.48l-40.5,23.38A39.76,39.76,0,0,1,73.15,201.57ZM176,184a40,40,0,0,1-67.52,29.05c1-.51,2-1.05,3-1.63L156,185.73a8,8,0,0,0,4-6.92V128l16,9.24Zm39.14-14.93a39.75,39.75,0,0,1-23.26,18.36c.07-1.14.12-2.28.12-3.43V132.62a8,8,0,0,0-4-6.93l-44-25.4,16-9.24,40.5,23.38A40,40,0,0,1,215.14,169.07Z"}))],["thin",f.createElement(f.Fragment,null,f.createElement("path",{d:"M219.68,114.91A52,52,0,0,0,162.49,42,52,52,0,0,0,70.82,55.15a52,52,0,0,0-34.5,85.94A52,52,0,0,0,70,213.16,52.33,52.33,0,0,0,83.59,215a51.66,51.66,0,0,0,9.93-1,52,52,0,0,0,91.66-13.13,52,52,0,0,0,34.5-85.94Zm-35.8-64.34a44,44,0,0,1,29.66,58.36,51.84,51.84,0,0,0-7-4.89L162,78.35a4,4,0,0,0-4,0l-50,28.87V79.5L150.5,55A43.69,43.69,0,0,1,183.88,50.57Zm-35.88,89-20,11.54-20-11.54v-23.1l20-11.54,20,11.54ZM76,72a44,44,0,0,1,78.25-27.62A52.08,52.08,0,0,0,146.5,48L102,73.73a4,4,0,0,0-2,3.46v57.74L76,121.07ZM37.4,84.93A43.72,43.72,0,0,1,68.71,63.46,52.26,52.26,0,0,0,68,72v51.38a4,4,0,0,0,2,3.46l50,28.87L96,169.57,53.5,145A44,44,0,0,1,37.4,84.93Zm34.72,120.5a44,44,0,0,1-29.66-58.36,51.84,51.84,0,0,0,7,4.89L94,177.65a4,4,0,0,0,4,0l50-28.87V176.5L105.5,201A43.69,43.69,0,0,1,72.12,205.43ZM180,184a44,44,0,0,1-78.26,27.61A51.66,51.66,0,0,0,109.5,208L154,182.27a4,4,0,0,0,2-3.46V121.07l24,13.86Zm38.6-12.93a43.72,43.72,0,0,1-31.31,21.47A52.26,52.26,0,0,0,188,184V132.62a4,4,0,0,0-2-3.46l-50-28.87,24-13.86L202.5,111A44,44,0,0,1,218.6,171.07Z"}))]]),ei=f.forwardRef((t,e)=>f.createElement(se,{ref:e,...t,weights:po}));ei.displayName="CaretCircleDownIcon";const ni=f.forwardRef((t,e)=>f.createElement(se,{ref:e,...t,weights:mo}));ni.displayName="CaretCircleRightIcon";const si=f.forwardRef((t,e)=>f.createElement(se,{ref:e,...t,weights:go}));si.displayName="CopySimpleIcon";const ii=f.forwardRef((t,e)=>f.createElement(se,{ref:e,...t,weights:yo}));ii.displayName="OpenAiLogoIcon";const Ze=f.createContext({});function He(t){const e=f.useRef(null);return e.current===null&&(e.current=t()),e.current}const ie=f.createContext(null),We=f.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class vo extends f.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function xo({children:t,isPresent:e}){const n=f.useId(),s=f.useRef(null),i=f.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=f.useContext(We);return f.useInsertionEffect(()=>{const{width:r,height:a,top:l,left:c}=i.current;if(e||!s.current||!r||!a)return;s.current.dataset.motionPopId=n;const u=document.createElement("style");return o&&(u.nonce=o),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
          [data-motion-pop-id="${n}"] {
            position: absolute !important;
            width: ${r}px !important;
            height: ${a}px !important;
            top: ${l}px !important;
            left: ${c}px !important;
          }
        `),()=>{document.head.removeChild(u)}},[e]),m.jsx(vo,{isPresent:e,childRef:s,sizeRef:i,children:f.cloneElement(t,{ref:s})})}const Ao=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r})=>{const a=He(To),l=f.useId(),c=f.useCallback(d=>{a.set(d,!0);for(const h of a.values())if(!h)return;s&&s()},[a,s]),u=f.useMemo(()=>({id:l,initial:e,isPresent:n,custom:i,onExitComplete:c,register:d=>(a.set(d,!1),()=>a.delete(d))}),o?[Math.random(),c]:[n,c]);return f.useMemo(()=>{a.forEach((d,h)=>a.set(h,!1))},[n]),f.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),r==="popLayout"&&(t=m.jsx(xo,{isPresent:n,children:t})),m.jsx(ie.Provider,{value:u,children:t})};function To(){return new Map}function ri(t=!0){const e=f.useContext(ie);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=f.useId();f.useEffect(()=>{t&&i(o)},[t]);const r=f.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Ut=t=>t.key||"";function En(t){const e=[];return f.Children.forEach(t,n=>{f.isValidElement(n)&&e.push(n)}),e}const ze=typeof window<"u",oi=ze?f.useLayoutEffect:f.useEffect,wo=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1})=>{const[a,l]=ri(r),c=f.useMemo(()=>En(t),[t]),u=r&&!a?[]:c.map(Ut),d=f.useRef(!0),h=f.useRef(c),p=He(()=>new Map),[g,y]=f.useState(c),[v,x]=f.useState(c);oi(()=>{d.current=!1,h.current=c;for(let b=0;b<v.length;b++){const w=Ut(v[b]);u.includes(w)?p.delete(w):p.get(w)!==!0&&p.set(w,!1)}},[v,u.length,u.join("-")]);const A=[];if(c!==g){let b=[...c];for(let w=0;w<v.length;w++){const S=v[w],E=Ut(S);u.includes(E)||(b.splice(w,0,S),A.push(S))}o==="wait"&&A.length&&(b=A),x(En(b)),y(c);return}const{forceRender:T}=f.useContext(Ze);return m.jsx(m.Fragment,{children:v.map(b=>{const w=Ut(b),S=r&&!a?!1:c===v||u.includes(w),E=()=>{if(p.has(w))p.set(w,!0);else return;let P=!0;p.forEach(F=>{F||(P=!1)}),P&&(T==null||T(),x(h.current),r&&(l==null||l()),s&&s())};return m.jsx(Ao,{isPresent:S,initial:!d.current||n?void 0:!1,custom:S?void 0:e,presenceAffectsLayout:i,mode:o,onExitComplete:S?void 0:E,children:b},w)})})},_=t=>t;let ai=_;function Ke(t){let e;return()=>(e===void 0&&(e=t()),e)}const gt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},G=t=>t*1e3,q=t=>t/1e3,Co={useManualTiming:!1};function bo(t){let e=new Set,n=new Set,s=!1,i=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(c){o.has(c)&&(l.schedule(c),t()),c(r)}const l={schedule:(c,u=!1,d=!1)=>{const p=d&&s?e:n;return u&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(r=c,s){i=!0;return}s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(c))}};return l}const $t=["read","resolveKeyframes","update","preRender","render","postRender"],Po=40;function li(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=$t.reduce((x,A)=>(x[A]=bo(o),x),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:h}=r,p=()=>{const x=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(x-i.timestamp,Po),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},g=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:$t.reduce((x,A)=>{const T=r[A];return x[A]=(b,w=!1,S=!1)=>(n||g(),T.schedule(b,w,S)),x},{}),cancel:x=>{for(let A=0;A<$t.length;A++)r[$t[A]].cancel(x)},state:i,steps:r}}const{schedule:V,cancel:tt,state:k,steps:fe}=li(typeof requestAnimationFrame<"u"?requestAnimationFrame:_,!0),ci=f.createContext({strict:!1}),Dn={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"]},yt={};for(const t in Dn)yt[t]={isEnabled:e=>Dn[t].some(n=>!!e[n])};function So(t){for(const e in t)yt[e]={...yt[e],...t[e]}}const Mo=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Gt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Mo.has(t)}let ui=t=>!Gt(t);function Vo(t){t&&(ui=e=>e.startsWith("on")?!Gt(e):t(e))}try{Vo(require("@emotion/is-prop-valid").default)}catch{}function Eo(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(ui(i)||n===!0&&Gt(i)||!e&&!Gt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function Do(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>t(...s);return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const re=f.createContext({});function Lt(t){return typeof t=="string"||Array.isArray(t)}function oe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Ge=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qe=["initial",...Ge];function ae(t){return oe(t.animate)||qe.some(e=>Lt(t[e]))}function di(t){return!!(ae(t)||t.variants)}function Lo(t,e){if(ae(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Lt(n)?n:void 0,animate:Lt(s)?s:void 0}}return t.inherit!==!1?e:{}}function Ro(t){const{initial:e,animate:n}=Lo(t,f.useContext(re));return f.useMemo(()=>({initial:e,animate:n}),[Ln(e),Ln(n)])}function Ln(t){return Array.isArray(t)?t.join(" "):t}const jo=Symbol.for("motionComponentSymbol");function ut(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Fo(t,e,n){return f.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):ut(n)&&(n.current=s))},[e])}const Xe=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Bo="framerAppearId",hi="data-"+Xe(Bo),{schedule:Ye}=li(queueMicrotask,!1),fi=f.createContext({});function ko(t,e,n,s,i){var o,r;const{visualElement:a}=f.useContext(re),l=f.useContext(ci),c=f.useContext(ie),u=f.useContext(We).reducedMotion,d=f.useRef(null);s=s||l.renderer,!d.current&&s&&(d.current=s(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=d.current,p=f.useContext(fi);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&Io(d.current,n,i,p);const g=f.useRef(!1);f.useInsertionEffect(()=>{h&&g.current&&h.update(n,c)});const y=n[hi],v=f.useRef(!!y&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,y))&&((r=window.MotionHasOptimisedAnimation)===null||r===void 0?void 0:r.call(window,y)));return oi(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Ye.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),f.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,y)}),v.current=!1))}),h}function Io(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:pi(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&ut(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:c})}function pi(t){if(t)return t.options.allowProjection!==!1?t.projection:pi(t.parent)}function Oo({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){var o,r;t&&So(t);function a(c,u){let d;const h={...f.useContext(We),...c,layoutId:No(c)},{isStatic:p}=h,g=Ro(c),y=s(c,p);if(!p&&ze){_o();const v=Uo(h);d=v.MeasureLayout,g.visualElement=ko(i,y,h,e,v.ProjectionNode)}return m.jsxs(re.Provider,{value:g,children:[d&&g.visualElement?m.jsx(d,{visualElement:g.visualElement,...h}):null,n(i,c,Fo(y,g.visualElement,u),y,p,g.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(r=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&r!==void 0?r:""})`}`;const l=f.forwardRef(a);return l[jo]=i,l}function No({layoutId:t}){const e=f.useContext(Ze).id;return e&&t!==void 0?e+"-"+t:t}function _o(t,e){f.useContext(ci).strict}function Uo(t){const{drag:e,layout:n}=yt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const $o=["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 Qe(t){return typeof t!="string"||t.includes("-")?!1:!!($o.indexOf(t)>-1||/[A-Z]/u.test(t))}function Rn(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Je(t,e,n,s){if(typeof e=="function"){const[i,o]=Rn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=Rn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}const Me=t=>Array.isArray(t),Zo=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Ho=t=>Me(t)?t[t.length-1]||0:t,O=t=>!!(t&&t.getVelocity);function Wt(t){const e=O(t)?t.get():t;return Zo(e)?e.toValue():e}function Wo({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,o){const r={latestValues:zo(s,i,o,t),renderState:e()};return n&&(r.onMount=a=>n({props:s,current:a,...r}),r.onUpdate=a=>n(a)),r}const mi=t=>(e,n)=>{const s=f.useContext(re),i=f.useContext(ie),o=()=>Wo(t,e,s,i);return n?o():He(o)};function zo(t,e,n,s){const i={},o=s(t,{});for(const h in o)i[h]=Wt(o[h]);let{initial:r,animate:a}=t;const l=ae(t),c=di(t);e&&c&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const d=u?a:r;if(d&&typeof d!="boolean"&&!oe(d)){const h=Array.isArray(d)?d:[d];for(let p=0;p<h.length;p++){const g=Je(t,h[p]);if(g){const{transitionEnd:y,transition:v,...x}=g;for(const A in x){let T=x[A];if(Array.isArray(T)){const b=u?T.length-1:0;T=T[b]}T!==null&&(i[A]=T)}for(const A in y)i[A]=y[A]}}}return i}const xt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ct=new Set(xt),gi=t=>e=>typeof e=="string"&&e.startsWith(t),yi=gi("--"),Ko=gi("var(--"),tn=t=>Ko(t)?Go.test(t.split("/*")[0].trim()):!1,Go=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,X=(t,e,n)=>n>e?e:n<t?t:n,At={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Rt={...At,transform:t=>X(0,1,t)},Zt={...At,default:1},kt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),J=kt("deg"),W=kt("%"),C=kt("px"),qo=kt("vh"),Xo=kt("vw"),jn={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},Yo={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,radius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,backgroundPositionX:C,backgroundPositionY:C},Qo={rotate:J,rotateX:J,rotateY:J,rotateZ:J,scale:Zt,scaleX:Zt,scaleY:Zt,scaleZ:Zt,skew:J,skewX:J,skewY:J,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:Rt,originX:jn,originY:jn,originZ:C},Fn={...At,transform:Math.round},en={...Yo,...Qo,zIndex:Fn,size:C,fillOpacity:Rt,strokeOpacity:Rt,numOctaves:Fn},Jo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ta=xt.length;function ea(t,e,n){let s="",i=!0;for(let o=0;o<ta;o++){const r=xt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=vi(a,en[r]);if(!l){i=!1;const u=Jo[r]||r;s+=`${u}(${c}) `}n&&(e[r]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function nn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const c=e[l];if(ct.has(l)){r=!0;continue}else if(yi(l)){i[l]=c;continue}else{const u=vi(c,en[l]);l.startsWith("origin")?(a=!0,o[l]=u):s[l]=u}}if(e.transform||(r||n?s.transform=ea(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;s.transformOrigin=`${l} ${c} ${u}`}}const na={offset:"stroke-dashoffset",array:"stroke-dasharray"},sa={offset:"strokeDashoffset",array:"strokeDasharray"};function ia(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?na:sa;t[o.offset]=C.transform(-s);const r=C.transform(e),a=C.transform(n);t[o.array]=`${r} ${a}`}function Bn(t,e,n){return typeof t=="string"?t:C.transform(e+n*t)}function ra(t,e,n){const s=Bn(e,t.x,t.width),i=Bn(n,t.y,t.height);return`${s} ${i}`}function sn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(nn(t,c,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p,dimensions:g}=t;h.transform&&(g&&(p.transform=h.transform),delete h.transform),g&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=ra(g,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),r!==void 0&&ia(h,r,a,l,!1)}const rn=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),xi=()=>({...rn(),attrs:{}}),on=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Ai(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const Ti=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function wi(t,e,n,s){Ai(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Ti.has(i)?i:Xe(i),e.attrs[i])}const qt={};function oa(t){Object.assign(qt,t)}function Ci(t,{layout:e,layoutId:n}){return ct.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!qt[t]||t==="opacity")}function an(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(O(i[r])||e.style&&O(e.style[r])||Ci(r,t)||((s=n==null?void 0:n.getValue(r))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(o[r]=i[r]);return o}function bi(t,e,n){const s=an(t,e,n);for(const i in t)if(O(t[i])||O(e[i])){const o=xt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function aa(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const kn=["x","y","width","height","cx","cy","r"],la={useVisualState:mi({scrapeMotionValuesFromProps:bi,createRenderState:xi,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let o=!!t.drag;if(!o){for(const a in i)if(ct.has(a)){o=!0;break}}if(!o)return;let r=!e;if(e)for(let a=0;a<kn.length;a++){const l=kn[a];t[l]!==e[l]&&(r=!0)}r&&V.read(()=>{aa(n,s),V.render(()=>{sn(s,i,on(n.tagName),t.transformTemplate),wi(n,s)})})}})},ca={useVisualState:mi({scrapeMotionValuesFromProps:an,createRenderState:rn})};function Pi(t,e,n){for(const s in e)!O(e[s])&&!Ci(s,n)&&(t[s]=e[s])}function ua({transformTemplate:t},e){return f.useMemo(()=>{const n=rn();return nn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function da(t,e){const n=t.style||{},s={};return Pi(s,n,t),Object.assign(s,ua(t,e)),s}function ha(t,e){const n={},s=da(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}function fa(t,e,n,s){const i=f.useMemo(()=>{const o=xi();return sn(o,e,on(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Pi(o,t.style,t),i.style={...o,...i.style}}return i}function pa(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(Qe(n)?fa:ha)(s,o,r,n),c=Eo(s,typeof n=="string",t),u=n!==f.Fragment?{...c,...l,ref:i}:{},{children:d}=s,h=f.useMemo(()=>O(d)?d.get():d,[d]);return f.createElement(n,{...u,children:h})}}function ma(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const r={...Qe(s)?la:ca,preloadedFeatures:t,useRender:pa(i),createVisualElement:e,Component:s};return Oo(r)}}function Si(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function le(t,e,n){const s=t.getProps();return Je(s,e,n!==void 0?n:s.custom,t)}const ga=Ke(()=>window.ScrollTimeline!==void 0);class ya{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>{if(ga()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class va extends ya{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function ln(t,e){return t?t[e]||t.default||t:void 0}const Ve=2e4;function Mi(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Ve;)e+=n,s=t.next(e);return e>=Ve?1/0:e}function cn(t){return typeof t=="function"}function In(t,e){t.timeline=e,t.onfinish=null}const un=t=>Array.isArray(t)&&typeof t[0]=="number",xa={linearEasing:void 0};function Aa(t,e){const n=Ke(t);return()=>{var s;return(s=xa[e])!==null&&s!==void 0?s:n()}}const Xt=Aa(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=t(gt(0,i-1,o))+", ";return`linear(${s.substring(0,s.length-2)})`};function Ei(t){return!!(typeof t=="function"&&Xt()||!t||typeof t=="string"&&(t in Ee||Xt())||un(t)||Array.isArray(t)&&t.every(Ei))}const Ct=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ee={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ct([0,.65,.55,1]),circOut:Ct([.55,0,1,.45]),backIn:Ct([.31,.01,.66,-.59]),backOut:Ct([.33,1.53,.69,.99])};function Di(t,e){if(t)return typeof t=="function"&&Xt()?Vi(t,e):un(t)?Ct(t):Array.isArray(t)?t.map(n=>Di(n,e)||Ee.easeOut):Ee[t]}const H={x:!1,y:!1};function Li(){return H.x||H.y}function Ta(t,e,n){var s;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const o=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}function Ri(t,e){const n=Ta(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function On(t){return e=>{e.pointerType==="touch"||Li()||t(e)}}function wa(t,e,n={}){const[s,i,o]=Ri(t,n),r=On(a=>{const{target:l}=a,c=e(a);if(typeof c!="function"||!l)return;const u=On(d=>{c(d),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const ji=(t,e)=>e?t===e?!0:ji(t,e.parentElement):!1,dn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ca=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ba(t){return Ca.has(t.tagName)||t.tabIndex!==-1}const bt=new WeakSet;function Nn(t){return e=>{e.key==="Enter"&&t(e)}}function pe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Pa=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Nn(()=>{if(bt.has(n))return;pe(n,"down");const i=Nn(()=>{pe(n,"up")}),o=()=>pe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function _n(t){return dn(t)&&!Li()}function Sa(t,e,n={}){const[s,i,o]=Ri(t,n),r=a=>{const l=a.currentTarget;if(!_n(a)||bt.has(l))return;bt.add(l);const c=e(a),u=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),!(!_n(p)||!bt.has(l))&&(bt.delete(l),typeof c=="function"&&c(p,{success:g}))},d=p=>{u(p,n.useGlobalTarget||ji(l,p.target))},h=p=>{u(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{!ba(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),a.addEventListener("focus",c=>Pa(c,i),i)}),o}function Ma(t){return t==="x"||t==="y"?H[t]?null:(H[t]=!0,()=>{H[t]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}const Fi=new Set(["width","height","top","left","right","bottom",...xt]);let zt;function Va(){zt=void 0}const z={now:()=>(zt===void 0&&z.set(k.isProcessing||Co.useManualTiming?k.timestamp:performance.now()),zt),set:t=>{zt=t,queueMicrotask(Va)}};function hn(t,e){t.indexOf(e)===-1&&t.push(e)}function fn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class pn{constructor(){this.subscriptions=[]}add(e){return hn(this.subscriptions,e),()=>fn(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Bi(t,e){return e?t*(1e3/e):0}const Un=30,Ea=t=>!isNaN(parseFloat(t));class Da{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=z.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=z.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ea(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new pn);const s=this.events[e].add(n);return e==="change"?()=>{s(),V.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Un)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Un);return Bi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jt(t,e){return new Da(t,e)}function La(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,jt(n))}function Ra(t,e){const n=le(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Ho(o[r]);La(t,r,a)}}function ja(t){return!!(O(t)&&t.add)}function De(t,e){const n=t.getValue("willChange");if(ja(n))return n.add(e)}function ki(t){return t.props[hi]}const Ii=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Fa=1e-7,Ba=12;function ka(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Ii(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Fa&&++a<Ba);return r}function It(t,e,n,s){if(t===e&&n===s)return _;const i=o=>ka(o,0,1,t,n);return o=>o===0||o===1?o:Ii(i(o),e,s)}const Oi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ni=t=>e=>1-t(1-e),_i=It(.33,1.53,.69,.99),mn=Ni(_i),Ui=Oi(mn),$i=t=>(t*=2)<1?.5*mn(t):.5*(2-Math.pow(2,-10*(t-1))),gn=t=>1-Math.sin(Math.acos(t)),Zi=Ni(gn),Hi=Oi(gn),Wi=t=>/^0[^.\s]+$/u.test(t);function Ia(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Wi(t):!0}const Mt=t=>Math.round(t*1e5)/1e5,yn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Oa(t){return t==null}const Na=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vn=(t,e)=>n=>!!(typeof n=="string"&&Na.test(n)&&n.startsWith(t)||e&&!Oa(n)&&Object.prototype.hasOwnProperty.call(n,e)),zi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(yn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},_a=t=>X(0,255,t),me={...At,transform:t=>Math.round(_a(t))},at={test:vn("rgb","red"),parse:zi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+me.transform(t)+", "+me.transform(e)+", "+me.transform(n)+", "+Mt(Rt.transform(s))+")"};function Ua(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Le={test:vn("#"),parse:Ua,transform:at.transform},dt={test:vn("hsl","hue"),parse:zi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+W.transform(Mt(e))+", "+W.transform(Mt(n))+", "+Mt(Rt.transform(s))+")"},I={test:t=>at.test(t)||Le.test(t)||dt.test(t),parse:t=>at.test(t)?at.parse(t):dt.test(t)?dt.parse(t):Le.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?at.transform(t):dt.transform(t)},$a=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Za(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(yn))===null||e===void 0?void 0:e.length)||0)+(((n=t.match($a))===null||n===void 0?void 0:n.length)||0)>0}const Ki="number",Gi="color",Ha="var",Wa="var(",$n="${}",za=/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 Ft(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(za,l=>(I.test(l)?(s.color.push(o),i.push(Gi),n.push(I.parse(l))):l.startsWith(Wa)?(s.var.push(o),i.push(Ha),n.push(l)):(s.number.push(o),i.push(Ki),n.push(parseFloat(l))),++o,$n)).split($n);return{values:n,split:a,indexes:s,types:i}}function qi(t){return Ft(t).values}function Xi(t){const{split:e,types:n}=Ft(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Ki?o+=Mt(i[r]):a===Gi?o+=I.transform(i[r]):o+=i[r]}return o}}const Ka=t=>typeof t=="number"?0:t;function Ga(t){const e=qi(t);return Xi(t)(e.map(Ka))}const et={test:Za,parse:qi,createTransformer:Xi,getAnimatableNone:Ga},qa=new Set(["brightness","contrast","saturate","opacity"]);function Xa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(yn)||[];if(!s)return t;const i=n.replace(s,"");let o=qa.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Ya=/\b([a-z-]*)\(.*?\)/gu,Re={...et,getAnimatableNone:t=>{const e=t.match(Ya);return e?e.map(Xa).join(" "):t}},Qa={...en,color:I,backgroundColor:I,outlineColor:I,fill:I,stroke:I,borderColor:I,borderTopColor:I,borderRightColor:I,borderBottomColor:I,borderLeftColor:I,filter:Re,WebkitFilter:Re},xn=t=>Qa[t];function Yi(t,e){let n=xn(t);return n!==Re&&(n=et),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ja=new Set(["auto","none","0"]);function tl(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Ja.has(o)&&Ft(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Yi(n,i)}const Zn=t=>t===At||t===C,Hn=(t,e)=>parseFloat(t.split(", ")[e]),Wn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return Hn(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?Hn(o[1],t):0}},el=new Set(["x","y","z"]),nl=xt.filter(t=>!el.has(t));function sl(t){const e=[];return nl.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const vt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Wn(4,13),y:Wn(5,14)};vt.translateX=vt.x;vt.translateY=vt.y;const lt=new Set;let je=!1,Fe=!1;function Qi(){if(Fe){const t=Array.from(lt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=sl(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))===null||a===void 0||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Fe=!1,je=!1,lt.forEach(t=>t.complete()),lt.clear()}function Ji(){lt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fe=!0)})}function il(){Ji(),Qi()}class An{constructor(e,n,s,i,o,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(lt.add(this),je||(je=!0,V.read(Ji),V.resolveKeyframes(Qi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const r=i==null?void 0:i.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),lt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,lt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const tr=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),rl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ol(t){const e=rl.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function er(t,e,n=1){const[s,i]=ol(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return tr(r)?parseFloat(r):r}return tn(i)?er(i,e,n+1):i}const nr=t=>e=>e.test(t),al={test:t=>t==="auto",parse:t=>t},sr=[At,C,W,J,Xo,qo,al],zn=t=>sr.find(nr(t));class ir extends An{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),tn(c))){const u=er(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Fi.has(s)||e.length!==2)return;const[i,o]=e,r=zn(i),a=zn(o);if(r!==a)if(Zn(r)&&Zn(a))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Ia(e[i])&&s.push(i);s.length&&tl(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(s);o&&o.jump(this.measuredOrigin,!1);const r=i.length-1,a=i[r];i[r]=vt[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Kn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(et.test(t)||t==="0")&&!t.startsWith("url("));function ll(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function cl(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=Kn(i,e),a=Kn(o,e);return!r||!a?!1:ll(t)||(n==="spring"||cn(n))&&s}const ul=t=>t!==null;function ce(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ul),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}const dl=40;class rr{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=z.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>dl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&il(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=z.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!cl(e,s,i,o))if(r)this.options.duration=0;else{l&&l(ce(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const L=(t,e,n)=>t+(e-t)*n;function ge(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function hl({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ge(l,a,t+1/3),o=ge(l,a,t),r=ge(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Yt(t,e){return n=>n>0?e:t}const ye=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},fl=[Le,at,dt],pl=t=>fl.find(e=>e.test(t));function Gn(t){const e=pl(t);if(!e)return!1;let n=e.parse(t);return e===dt&&(n=hl(n)),n}const qn=(t,e)=>{const n=Gn(t),s=Gn(e);if(!n||!s)return Yt(t,e);const i={...n};return o=>(i.red=ye(n.red,s.red,o),i.green=ye(n.green,s.green,o),i.blue=ye(n.blue,s.blue,o),i.alpha=L(n.alpha,s.alpha,o),at.transform(i))},ml=(t,e)=>n=>e(t(n)),Ot=(...t)=>t.reduce(ml),Be=new Set(["none","hidden"]);function gl(t,e){return Be.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function yl(t,e){return n=>L(t,e,n)}function Tn(t){return typeof t=="number"?yl:typeof t=="string"?tn(t)?Yt:I.test(t)?qn:Al:Array.isArray(t)?or:typeof t=="object"?I.test(t)?qn:vl:Yt}function or(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>Tn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function vl(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Tn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function xl(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][i[r]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[o]=l,i[r]++}return s}const Al=(t,e)=>{const n=et.createTransformer(e),s=Ft(t),i=Ft(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Be.has(t)&&!i.values.length||Be.has(e)&&!s.values.length?gl(t,e):Ot(or(xl(s,i),i.values),n):Yt(t,e)};function ar(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?L(t,e,n):Tn(t)(t,e)}const Tl=5;function lr(t,e,n){const s=Math.max(e-Tl,0);return Bi(n-t(s),e-s)}const R={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ve=.001;function wl({duration:t=R.duration,bounce:e=R.bounce,velocity:n=R.velocity,mass:s=R.mass}){let i,o,r=1-e;r=X(R.minDamping,R.maxDamping,r),t=X(R.minDuration,R.maxDuration,q(t)),r<1?(i=c=>{const u=c*r,d=u*t,h=u-n,p=ke(c,r),g=Math.exp(-d);return ve-h/p*g},o=c=>{const d=c*r*t,h=d*n+n,p=Math.pow(r,2)*Math.pow(c,2)*t,g=Math.exp(-d),y=ke(Math.pow(c,2),r);return(-i(c)+ve>0?-1:1)*((h-p)*g)/y}):(i=c=>{const u=Math.exp(-c*t),d=(c-n)*t+1;return-ve+u*d},o=c=>{const u=Math.exp(-c*t),d=(n-c)*(t*t);return u*d});const a=5/t,l=bl(i,o,a);if(t=G(t),isNaN(l))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:r*2*Math.sqrt(s*c),duration:t}}}const Cl=12;function bl(t,e,n){let s=n;for(let i=1;i<Cl;i++)s=s-t(s)/e(s);return s}function ke(t,e){return t*Math.sqrt(1-e*e)}const Pl=["duration","bounce"],Sl=["stiffness","damping","mass"];function Xn(t,e){return e.some(n=>t[n]!==void 0)}function Ml(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!Xn(t,Sl)&&Xn(t,Pl))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*X(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:R.mass,stiffness:i,damping:o}}else{const n=wl(t);e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function cr(t=R.visualDuration,e=R.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:h,isResolvedFromDuration:p}=Ml({...n,velocity:-q(n.velocity||0)}),g=h||0,y=c/(2*Math.sqrt(l*u)),v=r-o,x=q(Math.sqrt(l/u)),A=Math.abs(v)<5;s||(s=A?R.restSpeed.granular:R.restSpeed.default),i||(i=A?R.restDelta.granular:R.restDelta.default);let T;if(y<1){const w=ke(x,y);T=S=>{const E=Math.exp(-y*x*S);return r-E*((g+y*x*v)/w*Math.sin(w*S)+v*Math.cos(w*S))}}else if(y===1)T=w=>r-Math.exp(-x*w)*(v+(g+x*v)*w);else{const w=x*Math.sqrt(y*y-1);T=S=>{const E=Math.exp(-y*x*S),P=Math.min(w*S,300);return r-E*((g+y*x*v)*Math.sinh(P)+w*v*Math.cosh(P))/w}}const b={calculatedDuration:p&&d||null,next:w=>{const S=T(w);if(p)a.done=w>=d;else{let E=0;y<1&&(E=w===0?G(g):lr(T,w,S));const P=Math.abs(E)<=s,F=Math.abs(r-S)<=i;a.done=P&&F}return a.value=a.done?r:S,a},toString:()=>{const w=Math.min(Mi(b),Ve),S=Vi(E=>b.next(w*E).value,w,30);return w+"ms "+S}};return b}function Yn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=t[0],h={done:!1,value:d},p=P=>a!==void 0&&P<a||l!==void 0&&P>l,g=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let y=n*e;const v=d+y,x=r===void 0?v:r(v);x!==v&&(y=x-d);const A=P=>-y*Math.exp(-P/s),T=P=>x+A(P),b=P=>{const F=A(P),N=T(P);h.done=Math.abs(F)<=c,h.value=h.done?x:N};let w,S;const E=P=>{p(h.value)&&(w=P,S=cr({keyframes:[h.value,g(h.value)],velocity:lr(T,P,h.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:P=>{let F=!1;return!S&&w===void 0&&(F=!0,b(P),E(P)),w!==void 0&&P>=w?S.next(P-w):(!F&&b(P),h)}}}const Vl=It(.42,0,1,1),El=It(0,0,.58,1),ur=It(.42,0,.58,1),Dl=t=>Array.isArray(t)&&typeof t[0]!="number",Ll={linear:_,easeIn:Vl,easeInOut:ur,easeOut:El,circIn:gn,circInOut:Hi,circOut:Zi,backIn:mn,backInOut:Ui,backOut:_i,anticipate:$i},Qn=t=>{if(un(t)){ai(t.length===4);const[e,n,s,i]=t;return It(e,n,s,i)}else if(typeof t=="string")return Ll[t];return t};function Rl(t,e,n){const s=[],i=n||ar,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||_:e;a=Ot(l,a)}s.push(a)}return s}function jl(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(ai(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Rl(e,s,i),l=a.length,c=u=>{if(r&&u<t[0])return e[0];let d=0;if(l>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const h=gt(t[d],t[d+1],u);return a[d](h)};return n?u=>c(X(t[0],t[o-1],u)):c}function Fl(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=gt(0,e,s);t.push(L(n,1,i))}}function Bl(t){const e=[0];return Fl(e,t.length-1),e}function kl(t,e){return t.map(n=>n*e)}function Il(t,e){return t.map(()=>e||ur).splice(0,t.length-1)}function Qt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Dl(s)?s.map(Qn):Qn(s),o={done:!1,value:e[0]},r=kl(n&&n.length===e.length?n:Bl(e),t),a=jl(r,e,{ease:Array.isArray(i)?i:Il(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Ol=t=>{const e=({timestamp:n})=>t(n);return{start:()=>V.update(e,!0),stop:()=>tt(e),now:()=>k.isProcessing?k.timestamp:z.now()}},Nl={decay:Yn,inertia:Yn,tween:Qt,keyframes:Qt,spring:cr},_l=t=>t/100;class wn extends rr{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:o}=this.options,r=(i==null?void 0:i.KeyframeResolver)||An,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new r(o,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=cn(n)?n:Nl[n]||Qt;let l,c;a!==Qt&&typeof e[0]!="number"&&(l=Ot(_l,ar(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});o==="mirror"&&(c=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=Mi(u));const{calculatedDuration:d}=u,h=d+i,p=h*(s+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=s;if(this.startTime===null)return o.next(0);const{delay:h,repeat:p,repeatType:g,repeatDelay:y,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const x=this.currentTime-h*(this.speed>=0?1:-1),A=this.speed>=0?x<0:x>u;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let T=this.currentTime,b=o;if(p){const P=Math.min(this.currentTime,u)/d;let F=Math.floor(P),N=P%1;!N&&P>=1&&(N=1),N===1&&F--,F=Math.min(F,p+1),!!(F%2)&&(g==="reverse"?(N=1-N,y&&(N-=y/d)):g==="mirror"&&(b=r)),T=X(0,1,N)*d}const w=A?{done:!1,value:l[0]}:b.next(T);a&&(w.value=a(w.value));let{done:S}=w;!A&&c!==null&&(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return E&&i!==void 0&&(w.value=ce(l,this.options,i)),v&&v(w.value),E&&this.finish(),w}get duration(){const{resolved:e}=this;return e?q(e.calculatedDuration):0}get time(){return q(this.currentTime)}set time(e){e=G(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=q(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Ol,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Ul=new Set(["opacity","clipPath","filter","transform"]);function $l(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={}){const c={[e]:n};l&&(c.offset=l);const u=Di(a,i);return Array.isArray(u)&&(c.easing=u),t.animate(c,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}const Zl=Ke(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Jt=10,Hl=2e4;function Wl(t){return cn(t.type)||t.type==="spring"||!Ei(t.ease)}function zl(t,e){const n=new wn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&o<Hl;)s=n.sample(o),i.push(s.value),o+=Jt;return{times:void 0,keyframes:i,duration:o-Jt,ease:"linear"}}const dr={anticipate:$i,backInOut:Ui,circInOut:Hi};function Kl(t){return t in dr}class Jn extends rr{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:o}=this.options;this.resolver=new ir(o,(r,a)=>this.onKeyframesResolved(r,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:i,ease:o,type:r,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof o=="string"&&Xt()&&Kl(o)&&(o=dr[o]),Wl(this.options)){const{onComplete:d,onUpdate:h,motionValue:p,element:g,...y}=this.options,v=zl(e,y);e=v.keyframes,e.length===1&&(e[1]=e[0]),s=v.duration,i=v.times,o=v.ease,r="keyframes"}const u=$l(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:o});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(In(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(ce(e,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:s,times:i,type:r,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return q(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return q(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=G(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return _;const{animation:s}=n;In(s,e)}return _}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:o,ease:r,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:h,...p}=this.options,g=new wn({...p,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),y=G(this.time);c.setWithVelocity(g.sample(y-Jt).value,g.sample(y).value,Jt)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:o,damping:r,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Zl()&&s&&Ul.has(s)&&!l&&!c&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const Gl={type:"spring",stiffness:500,damping:25,restSpeed:10},ql=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Xl={type:"keyframes",duration:.8},Yl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ql=(t,{keyframes:e})=>e.length>2?Xl:ct.has(t)?t.startsWith("scale")?ql(e[1]):Gl:Yl;function Jl({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Cn=(t,e,n,s={},i,o)=>r=>{const a=ln(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-G(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};Jl(a)||(u={...u,...Ql(t,u)}),u.duration&&(u.duration=G(u.duration)),u.repeatDelay&&(u.repeatDelay=G(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!o&&e.get()!==void 0){const h=ce(u.keyframes,a);if(h!==void 0)return V.update(()=>{u.onUpdate(h),u.onComplete()}),new va([])}return!o&&Jn.supports(u)?new Jn(u):new wn(u)};function tc({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function hr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(r=s);const c=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const d in l){const h=t.getValue(d,(o=t.latestValues[d])!==null&&o!==void 0?o:null),p=l[d];if(p===void 0||u&&tc(u,d))continue;const g={delay:n,...ln(r||{},d)};let y=!1;if(window.MotionHandoffAnimation){const x=ki(t);if(x){const A=window.MotionHandoffAnimation(x,d,V);A!==null&&(g.startTime=A,y=!0)}}De(t,d),h.start(Cn(d,h,p,t.shouldReduceMotion&&Fi.has(d)?{type:!1}:g,t,y));const v=h.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{V.update(()=>{a&&Ra(t,a)})}),c}function Ie(t,e,n={}){var s;const i=le(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(hr(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=o;return ec(t,e,u+c,d,h,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[c,u]=l==="beforeChildren"?[r,a]:[a,r];return c().then(()=>u())}else return Promise.all([r(),a(n.delay)])}function ec(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(c=0)=>c*s:(c=0)=>a-c*s;return Array.from(t.variantChildren).sort(nc).forEach((c,u)=>{c.notify("AnimationStart",e),r.push(Ie(c,e,{...o,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(r)}function nc(t,e){return t.sortNodePosition(e)}function sc(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Ie(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Ie(t,e,n);else{const i=typeof e=="function"?le(t,e,n.custom):e;s=Promise.all(hr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const ic=qe.length;function fr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?fr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<ic;n++){const s=qe[n],i=t.props[s];(Lt(i)||i===!1)&&(e[s]=i)}return e}const rc=[...Ge].reverse(),oc=Ge.length;function ac(t){return e=>Promise.all(e.map(({animation:n,options:s})=>sc(t,n,s)))}function lc(t){let e=ac(t),n=ts(),s=!0;const i=l=>(c,u)=>{var d;const h=le(t,u,l==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(h){const{transition:p,transitionEnd:g,...y}=h;c={...c,...y,...g}}return c};function o(l){e=l(t)}function r(l){const{props:c}=t,u=fr(t.parent)||{},d=[],h=new Set;let p={},g=1/0;for(let v=0;v<oc;v++){const x=rc[v],A=n[x],T=c[x]!==void 0?c[x]:u[x],b=Lt(T),w=x===l?A.isActive:null;w===!1&&(g=v);let S=T===u[x]&&T!==c[x]&&b;if(S&&s&&t.manuallyAnimateOnMount&&(S=!1),A.protectedKeys={...p},!A.isActive&&w===null||!T&&!A.prevProp||oe(T)||typeof T=="boolean")continue;const E=cc(A.prevProp,T);let P=E||x===l&&A.isActive&&!S&&b||v>g&&b,F=!1;const N=Array.isArray(T)?T:[T];let Q=N.reduce(i(x),{});w===!1&&(Q={});const{prevResolvedValues:_t={}}=A,ue={..._t,...Q},K=B=>{P=!0,h.has(B)&&(F=!0,h.delete(B)),A.needsAnimating[B]=!0;const D=t.getValue(B);D&&(D.liveStyle=!1)};for(const B in ue){const D=Q[B],Tt=_t[B];if(p.hasOwnProperty(B))continue;let de=!1;Me(D)&&Me(Tt)?de=!Si(D,Tt):de=D!==Tt,de?D!=null?K(B):h.add(B):D!==void 0&&h.has(B)?K(B):A.protectedKeys[B]=!0}A.prevProp=T,A.prevResolvedValues=Q,A.isActive&&(p={...p,...Q}),s&&t.blockInitialAnimation&&(P=!1),P&&(!(S&&E)||F)&&d.push(...N.map(B=>({animation:B,options:{type:x}})))}if(h.size){const v={};h.forEach(x=>{const A=t.getBaseTarget(x),T=t.getValue(x);T&&(T.liveStyle=!0),v[x]=A??null}),d.push({animation:v})}let y=!!d.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(y=!1),s=!1,y?e(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,c)}),n[l].isActive=c;const d=r(l);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ts(),s=!0}}}function cc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Si(e,t):!1}function it(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ts(){return{animate:it(!0),whileInView:it(),whileHover:it(),whileTap:it(),whileDrag:it(),whileFocus:it(),exit:it()}}class nt{constructor(e){this.isMounted=!1,this.node=e}update(){}}class uc extends nt{constructor(e){super(e),e.animationState||(e.animationState=lc(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();oe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let dc=0;class hc extends nt{constructor(){super(...arguments),this.id=dc++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const fc={animation:{Feature:uc},exit:{Feature:hc}};function Bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Nt(t){return{point:{x:t.pageX,y:t.pageY}}}const pc=t=>e=>dn(e)&&t(e,Nt(e));function Vt(t,e,n,s){return Bt(t,e,pc(n),s)}const es=(t,e)=>Math.abs(t-e);function mc(t,e){const n=es(t.x,e.x),s=es(t.y,e.y);return Math.sqrt(n**2+s**2)}class pr{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Ae(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=mc(d.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:g}=d,{timestamp:y}=k;this.history.push({...g,timestamp:y});const{onStart:v,onMove:x}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=xe(h,this.transformPagePoint),V.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:p,onSessionEnd:g,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Ae(d.type==="pointercancel"?this.lastMoveEventInfo:xe(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,v),g&&g(d,v)},!dn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=Nt(e),a=xe(r,this.transformPagePoint),{point:l}=a,{timestamp:c}=k;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(e,Ae(a,this.history)),this.removeListeners=Ot(Vt(this.contextWindow,"pointermove",this.handlePointerMove),Vt(this.contextWindow,"pointerup",this.handlePointerUp),Vt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),tt(this.updatePoint)}}function xe(t,e){return e?{point:e(t.point)}:t}function ns(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ae({point:t},e){return{point:t,delta:ns(t,mr(e)),offset:ns(t,gc(e)),velocity:yc(e,.1)}}function gc(t){return t[0]}function mr(t){return t[t.length-1]}function yc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=mr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>G(e)));)n--;if(!s)return{x:0,y:0};const o=q(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}const gr=1e-4,vc=1-gr,xc=1+gr,yr=.01,Ac=0-yr,Tc=0+yr;function U(t){return t.max-t.min}function wc(t,e,n){return Math.abs(t-e)<=n}function ss(t,e,n,s=.5){t.origin=s,t.originPoint=L(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=L(n.min,n.max,t.origin)-t.originPoint,(t.scale>=vc&&t.scale<=xc||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ac&&t.translate<=Tc||isNaN(t.translate))&&(t.translate=0)}function Et(t,e,n,s){ss(t.x,e.x,n.x,s?s.originX:void 0),ss(t.y,e.y,n.y,s?s.originY:void 0)}function is(t,e,n){t.min=n.min+e.min,t.max=t.min+U(e)}function Cc(t,e,n){is(t.x,e.x,n.x),is(t.y,e.y,n.y)}function rs(t,e,n){t.min=e.min-n.min,t.max=t.min+U(e)}function Dt(t,e,n){rs(t.x,e.x,n.x),rs(t.y,e.y,n.y)}function bc(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?L(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?L(n,t,s.max):Math.min(t,n)),t}function os(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Pc(t,{top:e,left:n,bottom:s,right:i}){return{x:os(t.x,n,i),y:os(t.y,e,s)}}function as(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Sc(t,e){return{x:as(t.x,e.x),y:as(t.y,e.y)}}function Mc(t,e){let n=.5;const s=U(t),i=U(e);return i>s?n=gt(e.min,e.max-s,t.min):s>i&&(n=gt(t.min,t.max-i,e.min)),X(0,1,n)}function Vc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Oe=.35;function Ec(t=Oe){return t===!1?t=0:t===!0&&(t=Oe),{x:ls(t,"left","right"),y:ls(t,"top","bottom")}}function ls(t,e,n){return{min:cs(t,e),max:cs(t,n)}}function cs(t,e){return typeof t=="number"?t:t[e]||0}const us=()=>({translate:0,scale:1,origin:0,originPoint:0}),ht=()=>({x:us(),y:us()}),ds=()=>({min:0,max:0}),j=()=>({x:ds(),y:ds()});function Z(t){return[t("x"),t("y")]}function vr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Dc({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Lc(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Te(t){return t===void 0||t===1}function Ne({scale:t,scaleX:e,scaleY:n}){return!Te(t)||!Te(e)||!Te(n)}function rt(t){return Ne(t)||xr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function xr(t){return hs(t.x)||hs(t.y)}function hs(t){return t&&t!=="0%"}function te(t,e,n){const s=t-n,i=e*s;return n+i}function fs(t,e,n,s,i){return i!==void 0&&(t=te(t,i,s)),te(t,n,s)+e}function _e(t,e=0,n=1,s,i){t.min=fs(t.min,e,n,s,i),t.max=fs(t.max,e,n,s,i)}function Ar(t,{x:e,y:n}){_e(t.x,e.translate,e.scale,e.originPoint),_e(t.y,n.translate,n.scale,n.originPoint)}const ps=.999999999999,ms=1.0000000000001;function Rc(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&pt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ar(t,r)),s&&rt(o.latestValues)&&pt(t,o.latestValues))}e.x<ms&&e.x>ps&&(e.x=1),e.y<ms&&e.y>ps&&(e.y=1)}function ft(t,e){t.min=t.min+e,t.max=t.max+e}function gs(t,e,n,s,i=.5){const o=L(t.min,t.max,i);_e(t,e,n,o,s)}function pt(t,e){gs(t.x,e.x,e.scaleX,e.scale,e.originX),gs(t.y,e.y,e.scaleY,e.scale,e.originY)}function Tr(t,e){return vr(Lc(t.getBoundingClientRect(),e))}function jc(t,e,n){const s=Tr(t,n),{scroll:i}=e;return i&&(ft(s.x,i.offset.x),ft(s.y,i.offset.y)),s}const wr=({current:t})=>t?t.ownerDocument.defaultView:null,Fc=new WeakMap;class Bc{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=j(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Nt(u).point)},o=(u,d)=>{const{drag:h,dragPropagation:p,onDragStart:g}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ma(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Z(v=>{let x=this.getAxisMotionValue(v).get()||0;if(W.test(x)){const{projection:A}=this.visualElement;if(A&&A.layout){const T=A.layout.layoutBox[v];T&&(x=U(T)*(parseFloat(x)/100))}}this.originPoint[v]=x}),g&&V.postRender(()=>g(u,d)),De(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},r=(u,d)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:g,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=d;if(p&&this.currentDirection===null){this.currentDirection=kc(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),y&&y(u,d)},a=(u,d)=>this.stop(u,d),l=()=>Z(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new pr(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:wr(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&V.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ht(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=bc(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,o=this.constraints;n&&ut(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Pc(i.layoutBox,n):this.constraints=!1,this.elastic=Ec(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Z(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Vc(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ut(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=jc(s,i.root,this.visualElement.getTransformPagePoint());let r=Sc(i.layout.layoutBox,o);if(n){const a=n(Dc(r));this.hasMutatedConstraints=!!a,a&&(r=vr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Z(u=>{if(!Ht(u,n,this.currentDirection))return;let d=l&&l[u]||{};r&&(d={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:s?e[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return De(this.visualElement,e),s.start(Cn(e,s,0,n,this.visualElement,!1))}stopAnimation(){Z(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Z(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){Z(n=>{const{drag:s}=this.getProps();if(!Ht(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-L(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ut(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Z(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=Mc({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Z(r=>{if(!Ht(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(L(l,c,i[r]))})}addListeners(){if(!this.visualElement.current)return;Fc.set(this.visualElement,this);const e=this.visualElement.current,n=Vt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();ut(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),V.read(s);const r=Bt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Z(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Oe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Ht(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function kc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Ic extends nt{constructor(e){super(e),this.removeGroupControls=_,this.removeListeners=_,this.controls=new Bc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_}unmount(){this.removeGroupControls(),this.removeListeners()}}const ys=t=>(e,n)=>{t&&V.postRender(()=>t(e,n))};class Oc extends nt{constructor(){super(...arguments),this.removePointerDownListener=_}onPointerDown(e){this.session=new pr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:ys(e),onStart:ys(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&V.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Vt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Kt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function vs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(C.test(t))t=parseFloat(t);else return t;const n=vs(t,e.target.x),s=vs(t,e.target.y);return`${n}% ${s}%`}},Nc={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=et.parse(t);if(i.length>5)return s;const o=et.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const c=L(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=c),typeof i[3+r]=="number"&&(i[3+r]/=c),o(i)}};class _c extends f.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;oa(Uc),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Kt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||V.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ye.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Cr(t){const[e,n]=ri(),s=f.useContext(Ze);return m.jsx(_c,{...t,layoutGroup:s,switchLayoutGroup:f.useContext(fi),isPresent:e,safeToRemove:n})}const Uc={borderRadius:{...wt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wt,borderTopRightRadius:wt,borderBottomLeftRadius:wt,borderBottomRightRadius:wt,boxShadow:Nc};function $c(t,e,n){const s=O(t)?t:jt(t);return s.start(Cn("",s,e,n)),s.animation}function Zc(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Hc=(t,e)=>t.depth-e.depth;class Wc{constructor(){this.children=[],this.isDirty=!1}add(e){hn(this.children,e),this.isDirty=!0}remove(e){fn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Hc),this.isDirty=!1,this.children.forEach(e)}}function zc(t,e){const n=z.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(tt(s),t(o-e))};return V.read(s,!0),()=>tt(s)}const br=["TopLeft","TopRight","BottomLeft","BottomRight"],Kc=br.length,xs=t=>typeof t=="string"?parseFloat(t):t,As=t=>typeof t=="number"||C.test(t);function Gc(t,e,n,s,i,o){i?(t.opacity=L(0,n.opacity!==void 0?n.opacity:1,qc(s)),t.opacityExit=L(e.opacity!==void 0?e.opacity:1,0,Xc(s))):o&&(t.opacity=L(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;r<Kc;r++){const a=`border${br[r]}Radius`;let l=Ts(e,a),c=Ts(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||As(l)===As(c)?(t[a]=Math.max(L(xs(l),xs(c),s),0),(W.test(c)||W.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=L(e.rotate||0,n.rotate||0,s))}function Ts(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const qc=Pr(0,.5,Zi),Xc=Pr(.5,.95,_);function Pr(t,e,n){return s=>s<t?0:s>e?1:n(gt(t,e,s))}function ws(t,e){t.min=e.min,t.max=e.max}function $(t,e){ws(t.x,e.x),ws(t.y,e.y)}function Cs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function bs(t,e,n,s,i){return t-=e,t=te(t,1/n,s),i!==void 0&&(t=te(t,1/i,s)),t}function Yc(t,e=0,n=1,s=.5,i,o=t,r=t){if(W.test(e)&&(e=parseFloat(e),e=L(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=L(o.min,o.max,s);t===o&&(a-=e),t.min=bs(t.min,e,n,a,i),t.max=bs(t.max,e,n,a,i)}function Ps(t,e,[n,s,i],o,r){Yc(t,e[n],e[s],e[i],e.scale,o,r)}const Qc=["x","scaleX","originX"],Jc=["y","scaleY","originY"];function Ss(t,e,n,s){Ps(t.x,e,Qc,n?n.x:void 0,s?s.x:void 0),Ps(t.y,e,Jc,n?n.y:void 0,s?s.y:void 0)}function Ms(t){return t.translate===0&&t.scale===1}function Sr(t){return Ms(t.x)&&Ms(t.y)}function Vs(t,e){return t.min===e.min&&t.max===e.max}function tu(t,e){return Vs(t.x,e.x)&&Vs(t.y,e.y)}function Es(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Mr(t,e){return Es(t.x,e.x)&&Es(t.y,e.y)}function Ds(t){return U(t.x)/U(t.y)}function Ls(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class eu{constructor(){this.members=[]}add(e){hn(this.members,e),e.scheduleRender()}remove(e){if(fn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function nu(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:h,skewX:p,skewY:g}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),d&&(s+=`rotateX(${d}deg) `),h&&(s+=`rotateY(${h}deg) `),p&&(s+=`skewX(${p}deg) `),g&&(s+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const ot={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Pt=typeof window<"u"&&window.MotionDebug!==void 0,we=["","X","Y","Z"],su={visibility:"hidden"},Rs=1e3;let iu=0;function Ce(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Vr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ki(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",V,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Vr(s)}function Er({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=iu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Pt&&(ot.totalNodes=ot.resolvedTargetDeltas=ot.recalculatedProjection=0),this.nodes.forEach(au),this.nodes.forEach(hu),this.nodes.forEach(fu),this.nodes.forEach(lu),Pt&&window.MotionDebug.record(ot)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Wc)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new pn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Zc(r),this.instance=r;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),t){let d;const h=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=zc(h,250),Kt.hasAnimatedSinceResize&&(Kt.hasAnimatedSinceResize=!1,this.nodes.forEach(Fs))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||vu,{onLayoutAnimationStart:v,onLayoutAnimationComplete:x}=u.getProps(),A=!this.targetLayout||!Mr(this.targetLayout,g)||p,T=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||T||h&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,T);const b={...ln(y,"layout"),onPlay:v,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else h||Fs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,tt(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(pu),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Vr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(js);return}this.isUpdating||this.nodes.forEach(uu),this.isUpdating=!1,this.nodes.forEach(du),this.nodes.forEach(ru),this.nodes.forEach(ou),this.clearAllSnapshots();const a=z.now();k.delta=X(0,1e3/60,a-k.timestamp),k.timestamp=a,k.isProcessing=!0,fe.update.process(k),fe.preRender.process(k),fe.render.process(k),k.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ye.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cu),this.sharedNodes.forEach(mu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=j(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Sr(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;r&&(a||rt(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),xu(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var r;const{visualElement:a}=this.options;if(!a)return j();const l=a.measureViewportBox();if(!(((r=this.scroll)===null||r===void 0?void 0:r.wasRoot)||this.path.some(Au))){const{scroll:u}=this.root;u&&(ft(l.x,u.offset.x),ft(l.y,u.offset.y))}return l}removeElementScroll(r){var a;const l=j();if($(l,r),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&$(l,r),ft(l.x,d.offset.x),ft(l.y,d.offset.y))}return l}applyTransform(r,a=!1){const l=j();$(l,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&pt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),rt(u.latestValues)&&pt(l,u.latestValues)}return rt(this.latestValues)&&pt(l,this.latestValues),l}removeTransform(r){const a=j();$(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!rt(c.latestValues))continue;Ne(c.latestValues)&&c.updateSnapshot();const u=j(),d=c.measurePageBox();$(u,d),Ss(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return rt(this.latestValues)&&Ss(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.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!==k.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(r||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!(!this.layout||!(d||h))){if(this.resolvedRelativeTargetAt=k.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j(),this.relativeTargetOrigin=j(),Dt(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),$(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=j(),this.targetWithTransforms=j()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),Ar(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=j(),this.relativeTargetOrigin=j(),Dt(this.relativeTargetOrigin,this.target,p.target),$(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Pt&&ot.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Ne(this.parent.latestValues)||xr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var r;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((r=this.parent)===null||r===void 0)&&r.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===k.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;Rc(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=j());const{target:g}=a;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cs(this.prevProjectionDelta.x,this.projectionDelta.x),Cs(this.prevProjectionDelta.y,this.projectionDelta.y)),Et(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!Ls(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ls(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),Pt&&ot.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ht(),this.projectionDelta=ht(),this.projectionDeltaWithTransform=ht()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=ht();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=j(),p=l?l.source:void 0,g=this.layout?this.layout.source:void 0,y=p!==g,v=this.getStack(),x=!v||v.members.length<=1,A=!!(y&&!x&&this.options.crossfade===!0&&!this.path.some(yu));this.animationProgress=0;let T;this.mixTargetDelta=b=>{const w=b/1e3;Bs(d.x,r.x,w),Bs(d.y,r.y,w),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Dt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gu(this.relativeTarget,this.relativeTargetOrigin,h,w),T&&tu(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=j()),$(T,this.relativeTarget)),y&&(this.animationValues=u,Gc(u,c,this.latestValues,w,A,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(tt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=V.update(()=>{Kt.hasAnimatedSinceResize=!0,this.currentAnimation=$c(0,Rs,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Rs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&Dr(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||j();const d=U(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+d;const h=U(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+h}$(a,l),pt(a,u),Et(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new eu),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Ce("z",r,c,this.animationValues);for(let u=0;u<we.length;u++)Ce(`rotate${we[u]}`,r,c,this.animationValues),Ce(`skew${we[u]}`,r,c,this.animationValues);r.render();for(const u in c)r.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);r.scheduleRender()}getProjectionStyles(r){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return su;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Wt(r==null?void 0:r.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=Wt(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!rt(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=nu(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:p,y:g}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in qt){if(h[y]===void 0)continue;const{correct:v,applyTo:x}=qt[y],A=c.transform==="none"?h[y]:v(h[y],d);if(x){const T=x.length;for(let b=0;b<T;b++)c[x[b]]=A}else c[y]=A}return this.options.layoutId&&(c.pointerEvents=d===this?Wt(r==null?void 0:r.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(js),this.root.sharedNodes.clear()}}}function ru(t){t.updateLayout()}function ou(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=n.source!==t.layout.source;o==="size"?Z(d=>{const h=r?n.measuredBox[d]:n.layoutBox[d],p=U(h);h.min=s[d].min,h.max=h.min+p}):Dr(o,n.layoutBox,s)&&Z(d=>{const h=r?n.measuredBox[d]:n.layoutBox[d],p=U(s[d]);h.max=h.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const a=ht();Et(a,s,n.layoutBox);const l=ht();r?Et(l,t.applyTransform(i,!0),n.measuredBox):Et(l,s,n.layoutBox);const c=!Sr(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:p}=d;if(h&&p){const g=j();Dt(g,n.layoutBox,h.layoutBox);const y=j();Dt(y,s,p.layoutBox),Mr(g,y)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=g,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function au(t){Pt&&ot.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function lu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function cu(t){t.clearSnapshot()}function js(t){t.clearMeasurements()}function uu(t){t.isLayoutDirty=!1}function du(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Fs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function hu(t){t.resolveTargetDelta()}function fu(t){t.calcProjection()}function pu(t){t.resetSkewAndRotation()}function mu(t){t.removeLeadSnapshot()}function Bs(t,e,n){t.translate=L(e.translate,0,n),t.scale=L(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ks(t,e,n,s){t.min=L(e.min,n.min,s),t.max=L(e.max,n.max,s)}function gu(t,e,n,s){ks(t.x,e.x,n.x,s),ks(t.y,e.y,n.y,s)}function yu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const vu={duration:.45,ease:[.4,0,.1,1]},Is=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Os=Is("applewebkit/")&&!Is("chrome/")?Math.round:_;function Ns(t){t.min=Os(t.min),t.max=Os(t.max)}function xu(t){Ns(t.x),Ns(t.y)}function Dr(t,e,n){return t==="position"||t==="preserve-aspect"&&!wc(Ds(e),Ds(n),.2)}function Au(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Tu=Er({attachResizeListener:(t,e)=>Bt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),be={current:void 0},Lr=Er({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!be.current){const t=new Tu({});t.mount(window),t.setOptions({layoutScroll:!0}),be.current=t}return be.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),wu={pan:{Feature:Oc},drag:{Feature:Ic,ProjectionNode:Lr,MeasureLayout:Cr}};function _s(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&V.postRender(()=>o(e,Nt(e)))}class Cu extends nt{mount(){const{current:e}=this.node;e&&(this.unmount=wa(e,n=>(_s(this.node,n,"Start"),s=>_s(this.node,s,"End"))))}unmount(){}}class bu extends nt{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=Ot(Bt(this.node.current,"focus",()=>this.onFocus()),Bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Us(t,e,n){const{props:s}=t;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&V.postRender(()=>o(e,Nt(e)))}class Pu extends nt{mount(){const{current:e}=this.node;e&&(this.unmount=Sa(e,n=>(Us(this.node,n,"Start"),(s,{success:i})=>Us(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ue=new WeakMap,Pe=new WeakMap,Su=t=>{const e=Ue.get(t.target);e&&e(t)},Mu=t=>{t.forEach(Su)};function Vu({root:t,...e}){const n=t||document;Pe.has(n)||Pe.set(n,{});const s=Pe.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Mu,{root:t,...e})),s[i]}function Eu(t,e,n){const s=Vu(e);return Ue.set(t,n),s.observe(t),()=>{Ue.delete(t),s.unobserve(t)}}const Du={some:0,all:1};class Lu extends nt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Du[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),h=c?u:d;h&&h(l)};return Eu(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Ru(e,n))&&this.startObserver()}unmount(){}}function Ru({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ju={inView:{Feature:Lu},tap:{Feature:Pu},focus:{Feature:bu},hover:{Feature:Cu}},Fu={layout:{ProjectionNode:Lr,MeasureLayout:Cr}},$e={current:null},Rr={current:!1};function Bu(){if(Rr.current=!0,!!ze)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>$e.current=t.matches;t.addListener(e),e()}else $e.current=!1}const ku=[...sr,I,et],Iu=t=>ku.find(nr(t)),$s=new WeakMap;function Ou(t,e,n){for(const s in e){const i=e[s],o=n[s];if(O(i))t.addValue(s,i);else if(O(o))t.addValue(s,jt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,jt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Zs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Nu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=An,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=z.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,V.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=r;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=ae(n),this.isVariantNode=di(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const g=h[p];l[p]!==void 0&&O(g)&&g.set(l[p],!1)}}mount(e){this.current=e,$s.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Rr.current||Bu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:$e.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){$s.delete(this.current),this.projection&&this.projection.unmount(),tt(this.notifyUpdate),tt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=ct.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&V.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in yt){const n=yt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):j()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Zs.length;s++){const i=Zs[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Ou(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=jt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(tr(i)||Wi(i))?i=parseFloat(i):!Iu(i)&&et.test(n)&&(i=Yi(e,n)),this.setBaseTarget(e,O(i)?i.get():i)),O(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const r=Je(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);r&&(i=r[e])}if(s&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!O(o)?o:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new pn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class jr extends Nu{constructor(){super(...arguments),this.KeyframeResolver=ir}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;O(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function _u(t){return window.getComputedStyle(t)}class Uu extends jr{constructor(){super(...arguments),this.type="html",this.renderInstance=Ai}readValueFromInstance(e,n){if(ct.has(n)){const s=xn(n);return s&&s.default||0}else{const s=_u(e),i=(yi(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Tr(e,n)}build(e,n,s){nn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return an(e,n,s)}}class $u extends jr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=j}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ct.has(n)){const s=xn(n);return s&&s.default||0}return n=Ti.has(n)?n:Xe(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return bi(e,n,s)}build(e,n,s){sn(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){wi(e,n,s,i)}mount(e){this.isSVGTag=on(e.tagName),super.mount(e)}}const Zu=(t,e)=>Qe(t)?new $u(e):new Uu(e,{allowProjection:t!==f.Fragment}),Hu=ma({...fc,...ju,...wu,...Fu},Zu),Wu=Do(Hu),zu=(t,e,n={})=>{const{charWidth:s=9.6,maxChars:i=30}=n,[o,r]=f.useState(t);return f.useEffect(()=>{const a=()=>{if(!e.current)return;const c=e.current.offsetWidth,u=Math.floor(c/s)-1,d=Math.min(u,i);if(t.length<=d)r(t);else{const h=Math.floor((d-3)/2);r(`${t.slice(0,h)}...${t.slice(-h)}`)}};a();const l=new ResizeObserver(a);return e.current&&l.observe(e.current),()=>l.disconnect()},[t,e,s,i]),o};var Ku={VITE_API_HOST_URL:"https://modelworks.ai/api"};const Gu=Ku.VITE_API_HOST_URL,st=`${Gu}/circuit-adaptors`,qu=async(t,e)=>{const n=st;return(await t.post(n,e)).data.payload},Xu=async t=>{const e=st;return(await t.get(e)).data.payload},Yu=async(t,e)=>{const n=`${st}/${e}`;return(await t.get(n)).data.payload},Qu=async(t,e,n)=>{const s=`${st}/${e}`;return(await t.put(s,n)).data.payload},Ju=async(t,e)=>{const n=`${st}/${e}`;return(await t.delete(n)).data.payload??!0},td=async(t,e,n)=>{const s=`${st}/${e}/query`;return(await t.post(s,n)).data.payload},ed=async(t,e)=>{const n=`${st}/by-circuit-version/${e}`;return(await t.get(n)).data.payload},nd=async(t,e,n)=>{const s=`${st}/by-circuit-version/${e}/by-user-uid/${n}`;return(await t.get(s)).data.payload},Fr=()=>{const[t,e]=ti(Gs),n=Ir(),s=Yr(),i=Or({navigate:n,setState:e});return{useListCircuitAdaptorsQuery:()=>he({queryKey:["circuitAdaptors"],queryFn:async()=>{const h=await Xu(i);return e({circuitAdaptor:{mem:{adaptorsById:h.reduce((p,g)=>(p[g.uid]=g,p),{...t.circuitAdaptor.mem.adaptorsById||{}}),adaptorsByCircuitVersion:t.circuitAdaptor.mem.adaptorsByCircuitVersion||{}}}}),h},options:{enabled:!0},navigate:n,setState:e}),useCircuitAdaptorByIdQuery:h=>he({queryKey:["circuitAdaptor",h],queryFn:async()=>{if(!h)return null;const p=await Yu(i,h);return e({circuitAdaptor:{mem:{adaptorsById:{...t.circuitAdaptor.mem.adaptorsById,[h]:p},adaptorsByCircuitVersion:t.circuitAdaptor.mem.adaptorsByCircuitVersion||{}}}}),p},options:{enabled:!!h},navigate:n,setState:e}),useAdaptorsByCircuitVersionQuery:(h,p)=>he({queryKey:["circuitAdaptorsByVersion",h,p],queryFn:async()=>{if(!h)return[];let g;return p?g=await nd(i,h,p):g=await ed(i,h),e({circuitAdaptor:{mem:{adaptorsById:t.circuitAdaptor.mem.adaptorsById||{},adaptorsByCircuitVersion:{...t.circuitAdaptor.mem.adaptorsByCircuitVersion,[h]:g}}}}),g},options:{enabled:!!h},navigate:n,setState:e}),createCircuitAdaptor:async h=>{const p=await qu(i,h),g=h.circuit_version_uid,y=t.circuitAdaptor.mem.adaptorsByCircuitVersion||{},v=y[g]||[];return e({circuitAdaptor:{mem:{adaptorsById:{...t.circuitAdaptor.mem.adaptorsById,[p.uid]:p},adaptorsByCircuitVersion:{...y,[g]:[...v,p]}}}}),s.invalidateQueries({queryKey:["circuitAdaptorsByVersion",g]}),p},updateCircuitAdaptor:async(h,p)=>{const g=await Qu(i,h,p),y=t.circuitAdaptor.mem.adaptorsByCircuitVersion||{},v={};for(const[x,A]of Object.entries(y))v[x]=A.map(T=>T.uid===h?g:T);return e({circuitAdaptor:{mem:{adaptorsById:{...t.circuitAdaptor.mem.adaptorsById,[h]:g},adaptorsByCircuitVersion:v}}}),g},deleteCircuitAdaptor:async h=>{var y;const p=t.circuitAdaptor.mem.adaptorsByCircuitVersion?(y=Object.entries(t.circuitAdaptor.mem.adaptorsByCircuitVersion).find(([,v])=>v.some(x=>x.uid===h)))==null?void 0:y[0]:void 0,g=await Ju(i,h);if(g){const{[h]:v,...x}=t.circuitAdaptor.mem.adaptorsById,A=t.circuitAdaptor.mem.adaptorsByCircuitVersion||{},T={};for(const[b,w]of Object.entries(A))T[b]=w.filter(S=>S.uid!==h);e({circuitAdaptor:{mem:{adaptorsById:x,adaptorsByCircuitVersion:T}}}),p&&s.invalidateQueries({queryKey:["circuitAdaptorsByVersion",p]})}return g},queryCircuitAdaptor:async(h,p)=>await td(i,h,p)}},sd=M(ne)`
  display: flex;
  align-items: center;
  padding: 8px 0px 12px 8px;
  position: relative;

  &:not(:last-child) {
    margin-bottom: 5px;
  }
`,id=M.div`
  margin-right: 20px;
  color: ${t=>t.$color||"#ffffff"};
  font-size: 20px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
`,Hs=M.div`
  position: absolute;
  top: -3px;
  right: -3px;
  display: inline-flex;
  align-items: right;
  justify-content: center;
  background-color: #111827;
  border-radius: 9999px;
  padding: 1px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
`,rd=M.div`
  display: flex;
  flex-direction: column;
  color: #ccc;
  flex-grow: 1;
`,od=M(Y)`
  font-weight: bold;
  font-size: 16px;
`,ad=M(Y)`
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
  font-size: 13px;
`,ld=M.div`
  display: flex;
  align-items: center;
  margin-top: 4px;
`,cd=M(Y)`
  font-size: 12px;
  color: #888;
  font-family: monospace;
`,ud=M.div`
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: ${t=>t.$statusColor||"#7f8c8d"};
  opacity: 0.9;
`,dd=M(Y)`
  font-size: 11px;
  color: inherit;
  font-weight: 500;
`,hd=M.div`
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  margin-right: ${t=>t.$hasMenu?"0":"10px"};
`,fd=M.div`
  display: flex;
  align-items: center;
`,pd=({title:t,description:e,queryUrl:n,transport:s,icon:i,iconColor:o="#FFFFFF",statusColor:r,statusIcon:a,iconTooltipContext:l,tooltipClassName:c,onDelete:u,adaptorUid:d})=>{const{showToast:h}=Qs(),p=async()=>{try{await navigator.clipboard.writeText(n),h({message:"URL copied to clipboard",color:"green"})}catch{h({message:"Failed to copy URL",color:"red"})}},g=()=>{d&&u&&u(d)},y=()=>a?l?m.jsx(no,{delayDuration:100,children:m.jsxs(so,{children:[m.jsx(io,{asChild:!0,children:m.jsx("button",{type:"button",onClick:v=>v.preventDefault(),className:"inline-flex items-center justify-center focus:outline-none",children:m.jsx(Hs,{children:a})})}),m.jsx(ro,{side:"top",align:"center",className:c||"max-w-xs whitespace-normal break-words text-xs leading-snug bg-neutral-900 text-neutral-100 border-neutral-700",children:l})]})}):m.jsx(Hs,{children:a}):null;return m.jsxs(sd,{children:[m.jsxs(id,{$color:o,children:[i??m.jsx(to,{size:25,weight:"regular"}),y()]}),m.jsxs(rd,{children:[m.jsx(od,{as:"span",children:t}),m.jsx(ad,{as:"span",children:e}),m.jsxs(ld,{children:[m.jsx(cd,{as:"span",children:n}),m.jsx(si,{size:12,weight:"regular",style:{marginLeft:"6px",cursor:"pointer"},onClick:p})]})]}),m.jsxs(hd,{$hasMenu:!!(u&&d),children:[m.jsxs(ud,{$statusColor:r,children:[m.jsx(Jr,{size:8,weight:"fill"}),m.jsx(dd,{as:"span",children:s})]}),u&&d&&m.jsx(fd,{children:m.jsxs(qs,{children:[m.jsx(Xs,{asChild:!0,children:m.jsx(mt,{variant:"ghost",size:"icon",className:"h-8 w-8 text-zinc-400 hover:text-zinc-100",children:m.jsx(eo,{className:"h-4 w-4"})})}),m.jsx(Ys,{align:"end",sideOffset:4,className:"min-w-[8rem] rounded-md border border-zinc-800 bg-zinc-950 p-1 text-zinc-100 shadow-md",children:m.jsx(Se,{onClick:g,className:"cursor-pointer text-red-500 focus:bg-zinc-800 focus:text-red-400",children:"Delete"})})]})})]})]})};var St=(t=>(t.OpenAiSse="OpenAiSse",t.ModelworksSse="ModelworksSse",t.MCP="MCP",t.ModelworksHTTP="ModelworksHTTP",t))(St||{});function md(t){switch(t){case"OPEN_AI_SSE":return"OpenAiSse";case"MODELWORKS_SSE":return"ModelworksSse";case"MCP":return"MCP";case"MODELWORKS_HTTP":return"ModelworksHTTP";default:return}}function Br(t){switch(t){case"OPEN_AI_SSE":return"OpenAI SSE";case"MODELWORKS_SSE":return"ModelWorks SSE";case"MCP":return"Model Context Protocol (MCP)";case"MODELWORKS_HTTP":return"ModelWorks HTTP";default:return"Unknown Adapter"}}function gd(t){switch(t){case"OPEN_AI_SSE":return"OpenAI Server Side Events HTTP adapter.";case"MODELWORKS_SSE":return"ModelWorks Server Side Events HTTP adapter.";case"MCP":return"Model Context Protocol adapter often referred to as MCP.";case"MODELWORKS_HTTP":return"ModelWorks HTTP(S) adaptor for making simple HTTP calls.";default:return"Unknown adapter type."}}const ee="data:image/svg+xml,%3csvg%20width='211'%20height='174'%20viewBox='0%200%20211%20174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M63.9187%2046.1047V61.6088C63.9187%2068.4492%2053.5808%2068.4492%2053.5808%2061.6088V46.1047C53.5808%2039.2669%2063.9187%2039.2669%2063.9187%2046.1047ZM173.274%2054.6805C203.15%2082.1993%20186.145%20119.901%20157.543%20122.111C176.087%20123.556%20191.002%20110.262%20193.867%2093.1263L210.505%2093.137C210.505%20194.906%2088.0226%20195.634%2074.8617%20123.156C78.9643%20123.977%2083.2109%20124.407%2087.5508%20124.407C110.73%20124.407%20131.493%20112.024%20142.911%2093.097L155.987%2093.105L173.274%2054.6805ZM29.6181%2074.6525C22.2472%2074.2526%2014.1725%2073.3996%204.82899%2071.5868C-0.643852%2070.5259%20-0.390603%2077.001%200.478441%2082.5139C2.31783%2094.1473%2015.2469%20106.586%2043.6294%20100.343C54.5591%20112.173%2070.1966%20119.598%2087.5508%20119.598C118.215%20119.598%20143.529%2096.4372%20146.95%2066.6818C156.368%2066.6818%20156.12%2054.6511%20147.123%2054.6511C146.979%2052.9797%20146.766%2051.3189%20146.483%2049.6741H147.901C155.816%2049.6741%20155.816%2037.6435%20147.901%2037.6435H143.076C142.397%2035.9507%20141.642%2034.2873%20140.813%2032.6638H147.901C155.816%2032.6638%20155.816%2020.6331%20147.901%2020.6331H132.709C131.901%2019.6974%20131.059%2018.7857%20130.187%2017.9007C124.658%2012.2759%20116.104%2020.6838%20121.635%2026.3112C130.494%2035.3349%20135.319%2047.155%20135.319%2059.7988C135.319%2086.2113%20113.963%20107.567%2087.5508%20107.567C61.1382%20107.567%2039.7854%2086.2113%2039.7854%2059.7988C39.7854%2033.4129%2061.1649%2012.0307%2087.5508%2012.0307H147.901C155.816%2012.0307%20155.816%200%20147.901%200H87.5508C54.5324%200%2027.7547%2026.7858%2027.7547%2059.7988C27.7547%2064.9251%2028.4025%2069.9047%2029.6181%2074.6525Z'%20fill='black'/%3e%3c/svg%3e",kr="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='25'%20viewBox='0%200%2024%2024'%20width='25'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eModelContextProtocol%3c/title%3e%3cpath%20d='M15.688%202.343a2.588%202.588%200%2000-3.61%200l-9.626%209.44a.863.863%200%2001-1.203%200%20.823.823%200%20010-1.18l9.626-9.44a4.313%204.313%200%20016.016%200%204.116%204.116%200%20011.204%203.54%204.3%204.3%200%20013.609%201.18l.05.05a4.115%204.115%200%20010%205.9l-8.706%208.537a.274.274%200%20000%20.393l1.788%201.754a.823.823%200%20010%201.18.863.863%200%2001-1.203%200l-1.788-1.753a1.92%201.92%200%20010-2.754l8.706-8.538a2.47%202.47%200%20000-3.54l-.05-.049a2.588%202.588%200%2000-3.607-.003l-7.172%207.034-.002.002-.098.097a.863.863%200%2001-1.204%200%20.823.823%200%20010-1.18l7.273-7.133a2.47%202.47%200%2000-.003-3.537z'%3e%3c/path%3e%3cpath%20d='M14.485%204.703a.823.823%200%20000-1.18.863.863%200%2000-1.204%200l-7.119%206.982a4.115%204.115%200%20000%205.9%204.314%204.314%200%20006.016%200l7.12-6.982a.823.823%200%20000-1.18.863.863%200%2000-1.204%200l-7.119%206.982a2.588%202.588%200%2001-3.61%200%202.47%202.47%200%20010-3.54l7.12-6.982z'%3e%3c/path%3e%3c/svg%3e";var yd={VITE_API_HOST_URL:"https://modelworks.ai/api"};const Ws=M(ne)`
  position: relative;
  padding-top: 8px;
  margin-left: ${t=>t.$marginLeft};
  margin-top: 5px;
`,vd=M.div`
  margin: 5px 0 15px 0px;
  font-size: 12px;
  color: white;
`;function xd(t){return Br(t)}function Ad(t){return gd(t)}function Td(t){switch(t){case"OPEN_AI_SSE":return m.jsx(ii,{size:25});case"MODELWORKS_SSE":case"MODELWORKS_HTTP":return m.jsx("img",{src:ee,alt:"ModelWorks",style:{width:25,height:25,filter:"brightness(0) invert(1)"}});case"MCP":return m.jsx("img",{src:kr,alt:"MCP",style:{width:25,height:25,filter:"brightness(0) invert(1)"}});default:return m.jsx("img",{src:ee,alt:"ModelWorks",style:{width:25,height:25,filter:"brightness(0) invert(1)"}})}}function wd(t){switch(t){case"OPEN_AI_SSE":return"#FFFFFF";case"MODELWORKS_SSE":return"#FFFFFF";default:return"#FFFFFF"}}function Cd(t){switch(t){case"OPEN_AI_SSE":return"HTTP(S) SSE";case"MODELWORKS_SSE":return"HTTP(S) SSE";default:return"HTTP(S)"}}const bd=({showGlobal:t})=>m.jsx(oo,{children:m.jsxs(ao,{children:[m.jsx(lo,{children:m.jsx("img",{src:ee,alt:"ModelWorks",style:{width:32,height:32,filter:"brightness(0) invert(1)"}})}),m.jsxs(co,{children:[m.jsx(uo,{children:t?"No adaptors available":"No private adaptors"}),m.jsx(Vn,{children:t?"There are no adaptors configured for this circuit version yet.":"You have not forged any private adaptors for this circuit version."}),!t&&m.jsx(Vn,{children:"Forge a private adaptor from the engine to target this circuit version."})]})]})}),zs=({circuitVersion:t,marginLeft:e="35px",showGlobal:n=!0,showEmptyState:s=!1,userUid:i,onDeleteAdaptor:o})=>{if(t.state===Gr.DEACTIVATED)return null;const{useAdaptorsByCircuitVersionQuery:r}=Fr(),{data:a=[],isLoading:l}=r(t.uid,i),c=yd.VITE_API_HOST_URL,u=qr[t.state],d=a.filter(y=>n?!y.user_uid:!!y.user_uid),h=n?"Globally available adaptors":"Private adaptors";if(l)return m.jsx(Ws,{$marginLeft:e,children:m.jsx(Y,{size:"1",children:"Loading adaptors…"})});if(d.length===0&&!s)return null;const p="This URL does not require authentication. Do not share it publicly or put it in places where it could be accessed by others.",g="max-w-xs whitespace-normal break-words text-xs leading-snug bg-[#2b1500] text-[#ff9800] border border-[#ff9800]";return m.jsxs(Ws,{$marginLeft:e,children:[m.jsx(vd,{children:h}),d.length===0&&s&&m.jsx(bd,{showGlobal:n}),d.length>0&&d.map(y=>m.jsx(pd,{title:xd(y.adapter_type),description:Ad(y.adapter_type),queryUrl:`${c}/circuit-adaptors/${y.uid}/query`,transport:Cd(y.adapter_type),icon:Td(y.adapter_type),iconColor:wd(y.adapter_type),statusColor:u,statusIcon:n?void 0:m.jsx(Js,{size:14,weight:"fill",className:"text-[#ff9800]"}),iconTooltipContext:n?void 0:p,tooltipClassName:n?void 0:g,onDelete:!n&&o?o:void 0,adaptorUid:y.uid},y.uid))]})},Pd="Temporal adaptors are for LLMs that can't authenticate to adaptors. Never share your temporal URL with anyone. After you are done using it, delete the temporal adaptor.",Sd=t=>[{label:"Adaptor name",value:Br(t)},{label:"Adaptor type",value:"Temporal (unauthenticated)"},{label:"Scope",value:"LLMs that cannot perform HTTP authentication"},{label:"Visibility",value:"Private – URL acts as the only secret"}],Md=t=>{const e=Sd(t);return m.jsx("div",{className:"mt-4 rounded-md",children:e.map((n,s)=>m.jsxs("div",{className:`flex items-start justify-between text-sm py-2 ${s>0?"border-t border-dotted border-neutral-800":""}`,children:[m.jsx("span",{className:"text-neutral-400",children:n.label}),m.jsx("span",{className:"text-neutral-100 text-right",children:n.value})]},n.label))})},Vd=()=>m.jsxs("div",{className:"mt-4 border border-[#ff9800] bg-[#2b1500] text-[#ff9800] text-sm rounded-md px-3 py-2 flex items-start gap-2",children:[m.jsx("div",{className:"mt-0.5",children:m.jsx(Js,{size:18,weight:"fill",className:"text-[#ff9800]"})}),m.jsx("p",{children:Pd})]}),Ed=({open:t,onOpenChange:e,adapterType:n,onConfirm:s,onCancel:i,isCreating:o=!1})=>{const r=()=>{i==null||i(),e(!1)},a=()=>{n&&s(n),e(!1)};return m.jsx(Nr,{open:t,onOpenChange:e,children:m.jsxs(_r,{onCloseAutoFocus:l=>{l.preventDefault(),document.body.style.pointerEvents=""},className:"bg-neutral-950 border-neutral-700 text-neutral-100 max-w-md",children:[m.jsx(Ur,{children:m.jsx("div",{className:"flex items-start gap-3",children:m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx($r,{className:"text-xl font-semibold text-neutral-100 text-left",children:"Create an adaptor."}),m.jsx(Zr,{className:"text-sm text-neutral-300 text-left",children:"You're about to create an unauthenticated temporal adaptor for this circuit version. Review the details below before continuing."})]})})}),n&&Md(n),Vd(),m.jsx(Hr,{className:"mt-5",children:m.jsxs("div",{className:"flex gap-3 w-full",children:[m.jsx(Mn,{asChild:!0,children:m.jsx(mt,{variant:"outline",size:"lg",className:"w-1/2 text-sm bg-transparent border-neutral-700 text-neutral-100 hover:bg-neutral-900",onClick:r,children:"Cancel"})}),m.jsx(Mn,{asChild:!0,children:m.jsx(mt,{variant:"destructive",size:"lg",className:"w-1/2 text-sm",onClick:a,disabled:o,children:o?"Creating...":"Create"})})]})})]})})},Dd=M(ne)`
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 5px 0 0px;
  padding-bottom: 5px;
`,Ld=M.div`
  margin-right: 15px;
  color: #ffffff;
`,Rd=M.button`
  cursor: pointer;
  color: #aaa;
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  margin-right: 10px;
  &:hover {
    color: #fff;
  }
`,jd=M(Ks)`
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 20px;
`,Fd=M(Y)`
  font-weight: bold;
  font-size: 18px;
  color: #ffffff;
`,Bd=M.div`
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
`,kd=M(Y)`
  font-size: 12px;
  color: #aaa;
`,Id=M.div`
  display: flex;
  align-items: center;
  font-size: 16px;
  min-width: 0;
  overflow: hidden;
`,Od=M(Y)`
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  font-size: 16px;
`,Nd=M.div`
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-wrap: wrap;
`,_d=M(ne)`
  position: relative;
  border: ${t=>t.$hideFrame?"none":"1px solid #333"};
  color: white;
  padding: ${t=>t.$hideFrame?"0":"15px"};
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
`,Ud=M.div`
  margin-top: 16px;
`;M(Y)`
  margin-top: 6px;
  font-size: 12px;
  color: #ff6b6b;
`;const ah=({user:t,circuit:e,circuitVersion:n,showDocumentationCTA:s=!1,hideFrame:i=!1,hideHeader:o=!1})=>{const[r]=ti(Gs),a=r.user.disk.currentUser,l=!!a,c=f.useRef(null),u=zu(n.uid,c),[d,h]=f.useState(!1),[p,g]=f.useState(null),[y,v]=f.useState(!1),[x,A]=f.useState(null),[T,b]=f.useState(()=>{const D=localStorage.getItem(`endpoint_box_${e.uid}`);return D!==null?JSON.parse(D):!0}),[w,S]=f.useState([]);f.useEffect(()=>{if(n!=null&&n.json_blob)try{const D=JSON.parse(n.json_blob);S(D.adapters||[])}catch{S([])}},[n==null?void 0:n.json_blob]);const E=D=>w.some(Tt=>md(Tt.type)===D);f.useEffect(()=>{localStorage.setItem(`endpoint_box_${e.uid}`,JSON.stringify(T))},[T,e.uid]);const P=Qr(new Date(n.created_at),{addSuffix:!0}),F=!1,N=D=>{g(D),h(!0)},Q=async D=>{v(!0);try{await bn({circuit_version_uid:n.uid,adapter_type:D}),K({message:"Adaptor created successfully!",color:"green"}),h(!1)}catch{K({message:"Failed to create adaptor",color:"red"})}finally{v(!1)}},_t=async D=>{try{await Pn(D),K({message:"Adaptor deleted successfully",color:"green"})}catch{K({message:"Failed to delete adaptor",color:"red"})}},ue=async()=>{x&&(await _t(x),A(null))},{showToast:K}=Qs(),{createCircuitAdaptor:bn,deleteCircuitAdaptor:Pn}=Fr(),B=async()=>{try{await navigator.clipboard.writeText(n.uid),K({message:"Version UID copied!",color:"green"})}catch{K({message:"Failed to copy",color:"red"})}};return m.jsxs(_d,{$hideFrame:i,children:[!o&&m.jsx(jd,{children:m.jsx(Ks,{align:"center",gap:"3",children:m.jsx(Fd,{children:"Endpoints"})})}),m.jsxs(Dd,{children:[m.jsx(Rd,{onClick:()=>b(!T),title:T?"Collapse endpoints":"Expand endpoints",children:T?m.jsx(ei,{size:20}):m.jsx(ni,{size:20})}),m.jsx(Ld,{children:m.jsx(Wr,{size:30,weight:"regular"})}),m.jsxs(Bd,{ref:c,children:[m.jsxs(kd,{children:["Released ",P]}),m.jsxs(Id,{children:[m.jsx(Od,{title:n.uid,children:u}),m.jsx("button",{onClick:B,className:"inline-flex items-center justify-center p-1 ml-2 text-neutral-400 hover:text-white transition-colors",title:"Copy version UID",children:m.jsx(Kr,{size:16})})]})]}),m.jsxs(Nd,{children:[s&&m.jsx(Sn,{to:`/${t.username}/${e.name}/api`,children:m.jsxs(mt,{variant:"outline",size:"sm",className:"inline-flex items-center justify-center rounded-md border border-neutral-700 bg-transparent px-3 py-1 text-xs font-bold text-neutral-100 hover:bg-neutral-900",children:[m.jsx(zr,{className:"h-4 w-4"}),"API Playground"]})}),l&&m.jsxs(qs,{children:[m.jsx(Xs,{asChild:!0,children:m.jsxs(mt,{variant:"outline",size:"sm",className:"inline-flex items-center justify-center rounded-md border border-neutral-700 bg-transparent px-3 py-1 text-xs font-bold text-neutral-100 hover:bg-neutral-900",children:[m.jsx(Xr,{className:"h-4 w-4 mr-1.5"}),"Forge Adaptor",m.jsx(fo,{className:"h-3.5 w-3.5 ml-1.5 text-neutral-400"})]})}),m.jsxs(Ys,{align:"end",sideOffset:4,className:"w-[18rem] rounded-md border border-neutral-700 bg-neutral-950 p-1 text-neutral-100 shadow-md",children:[E(St.ModelworksHTTP)&&m.jsxs(Se,{onClick:()=>N(St.ModelworksHTTP),className:"cursor-pointer focus:bg-neutral-900 focus:text-neutral-100 px-3 py-2",children:[m.jsx("img",{src:ee,alt:"ModelWorks",className:"w-6 h-6 mr-3",style:{filter:"brightness(0) invert(1)"}}),m.jsxs("div",{className:"flex flex-col",children:[m.jsx("span",{className:"font-bold",children:"ModelWorks HTTP"}),m.jsx("span",{className:"text-xs text-neutral-400 mt-0.5",children:"ModelWorks HTTP(S) adaptor for making simple HTTP calls. Temporal without authentication."})]})]}),E(St.MCP)&&m.jsxs(Se,{onClick:()=>N(St.MCP),className:"cursor-pointer focus:bg-neutral-900 focus:text-neutral-100 px-3 py-2",children:[m.jsx("img",{src:kr,alt:"MCP",className:"w-6 h-6 mr-3",style:{filter:"brightness(0) invert(1)"}}),m.jsxs("div",{className:"flex flex-col",children:[m.jsx("span",{className:"font-bold",children:"MCP"}),m.jsx("span",{className:"text-xs text-neutral-400 mt-0.5",children:"Model Context Protocol (MCP) adaptor. Temporal without authentication."})]})]})]})]}),!l&&m.jsx(Sn,{to:"/login",children:m.jsx(mt,{variant:"outline",size:"sm",className:"inline-flex items-center justify-center rounded-md border border-neutral-700 bg-transparent px-3 py-1 text-xs font-bold text-neutral-100 hover:bg-neutral-900",children:"Login to ModelWorks"})})]})]}),m.jsx(wo,{children:T&&m.jsxs(Wu.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:[m.jsx(zs,{circuitVersion:n,marginLeft:"0px",showGlobal:!0}),m.jsx(Ud,{children:m.jsxs(m.Fragment,{children:[l&&a&&m.jsx(zs,{circuitVersion:n,marginLeft:"0px",showGlobal:!1,userUid:a.uid,onDeleteAdaptor:A}),F]})})]})}),m.jsx(Ed,{open:d,onOpenChange:h,adapterType:p,onConfirm:Q,isCreating:y}),m.jsx(ho,{open:!!x,onOpenChange:D=>!D&&A(null),title:"Delete Adaptor",description:"Are you sure you want to delete this adaptor? The URL will stop working and this action cannot be undone.",confirmText:"Delete",confirmVariant:"destructive",onConfirm:ue})]})};export{St as C,ah as E,md as t,Fr as u};